JezK
Edit File: frontend.js
/*! For license information please see frontend.js.LICENSE.txt */ (()=>{var e={181(e,t,n){var r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,d=l||c||Function("return this")(),u=Object.prototype.toString,h=Math.max,f=Math.min,p=function(){return d.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=a.test(e);return n||o.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,a,o,s,l,c=0,d=!1,u=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,a=i;return r=i=void 0,c=t,o=e.apply(a,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=a}function x(){var e=p();if(b(e))return w(e);s=setTimeout(x,function(e){var n=t-(e-l);return u?f(n,a-(e-c)):n}(e))}function w(e){return s=void 0,v&&r?y(e):(r=i=void 0,o)}function _(){var e=p(),n=b(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(x,t),d?y(e):o}(l);if(u)return s=setTimeout(x,t),y(l)}return void 0===s&&(s=setTimeout(x,t)),o}return t=g(t)||0,m(n)&&(d=!!n.leading,a=(u="maxWait"in n)?h(g(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),_.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=i=s=void 0},_.flush=function(){return void 0===s?o:w(p())},_}},217(e,t,n){"use strict";n(8446),n(7723),n(790)},228(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||e,o),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i<a;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var l,c,d=this._events[s],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,r),!0;case 4:return d.fn.call(d.context,t,r,i),!0;case 5:return d.fn.call(d.context,t,r,i,a),!0;case 6:return d.fn.call(d.context,t,r,i,a,o),!0}for(c=1,l=new Array(u-1);c<u;c++)l[c-1]=arguments[c];d.fn.apply(d.context,l)}else{var h,f=d.length;for(c=0;c<f;c++)switch(d[c].once&&this.removeListener(e,d[c].fn,void 0,!0),u){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,t);break;case 3:d[c].fn.call(d[c].context,t,r);break;case 4:d[c].fn.call(d[c].context,t,r,i);break;default:if(!l)for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];d[c].fn.apply(d[c].context,l)}}return!0},s.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var l=0,c=[],d=s.length;l<d;l++)(s[l].fn!==t||i&&!s[l].once||r&&s[l].context!==r)&&c.push(s[l]);c.length?this._events[a]=1===c.length?c[0]:c:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s},231(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(6087),i=n(9491),a=n(8446),o=n(790);const s=({value:e="",onChange:t,delay:n=500,component:s="",...l})=>{const[c,d]=(0,r.useState)(e),u=(0,i.useDebounce)(t,n);(0,r.useEffect)(()=>{d(e)},[e]);const h=e=>{const t=e.target.value;d(t),u&&u(t)},f=null!=s?s:"";return f?(0,o.jsx)(f,{...l,value:c,onChange:h}):(0,o.jsx)(a.SimpleInput,{...l,value:c,onChange:h})}},574(e,t,n){"use strict";function r(){}function i(e){return null==e?r:function(){return this.querySelector(e)}}n.d(t,{A:()=>i})},576(e,t,n){"use strict";n.d(t,{MX:()=>i,fX:()=>r,m$:()=>o,zP:()=>a});const r=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},a=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),o=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0}},655(e,t,n){"use strict";n.d(t,{$g:()=>r,Ih:()=>a,ZV:()=>i});const r=(e="",t="",n=null,r="",i="",a="")=>window.accounting?window?.dokanFrontend?.currency||window?.dokanAdminDashboard?.currency?(t||(t=window?.dokanFrontend?.currency.symbol||window?.dokanAdminDashboard?.currency.symbol),n||(n=window?.dokanFrontend?.currency.precision||window?.dokanAdminDashboard?.currency.precision),r||(r=window?.dokanFrontend?.currency.thousand||window?.dokanAdminDashboard?.currency.thousand),i||(i=window?.dokanFrontend?.currency.decimal||window?.dokanAdminDashboard?.currency.decimal),a||(a=window?.dokanFrontend?.currency.format||window?.dokanAdminDashboard?.currency.format),window.accounting.formatMoney(e,t,n,r,i,a)):(console.warn("Dokan Currency Data Not Found"),e):(console.warn("Woocommerce Accounting Library Not Found"),e),i=e=>""===e?e:window.accounting?window?.dokanFrontend?.currency||window?.dokanAdminDashboard?.currency?window.accounting.formatNumber(e,window?.dokanFrontend?.currency.precision||window?.dokanAdminDashboard?.currency.precision,window?.dokanFrontend?.currency.thousand||window?.dokanAdminDashboard?.currency.thousand,window?.dokanFrontend?.currency.decimal||window?.dokanAdminDashboard?.currency.decimal):(console.warn("Dokan Currency Data Not Found"),e):(console.warn("Woocommerce Accounting Library Not Found"),e),a=e=>""===e?e:window.accounting.unformat(e,window?.dokanFrontend?.currency.decimal||window?.dokanAdminDashboard?.currency.decimal)},747(e,t,n){"use strict";function r(){return[]}function i(e){return null==e?r:function(){return this.querySelectorAll(e)}}n.d(t,{A:()=>i})},790(e){"use strict";e.exports=window.ReactJSXRuntime},856(e,t,n){"use strict";n.d(t,{QP:()=>Z});const r=e=>{const t=s(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),i(n,t)||o(e)},getConflictingClassGroupIds:(e,t)=>{const i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},i=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?i(e.slice(1),r):void 0;if(a)return a;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},a=/^\[(.+)\]$/,o=e=>{if(a.test(e)){const t=a.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},s=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return u(Object.entries(e.classGroups),n).forEach(([e,n])=>{l(n,r,e,t)}),r},l=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?d(e)?void l(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,i])=>{l(i,c(t,e),n,r)});(""===e?t:c(t,e)).classGroupId=n})},c=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},d=e=>e.isThemeGetter,u=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,h=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(i(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},f=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,i=t[0],a=t.length,o=e=>{const n=[];let o,s=0,l=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===s){if(d===i&&(r||e.slice(c,c+a)===t)){n.push(e.slice(l,c)),l=c+a;continue}if("/"===d){o=c;continue}}"["===d?s++:"]"===d&&s--}const c=0===n.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:n,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:o&&o>l?o-l:void 0}};return n?e=>n({className:e,parseClassName:o}):o},p=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},m=/\s+/;function g(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=v(e))&&(r&&(r+=" "),r+=t);return r}const v=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=v(e[r]))&&(n&&(n+=" "),n+=t);return n};function y(e,...t){let n,i,a,o=function(l){const c=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:h(e.cacheSize),parseClassName:f(e),...r(e)}))(c),i=n.cache.get,a=n.cache.set,o=s,s(l)};function s(e){const t=i(e);if(t)return t;const r=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(m);let s="";for(let e=o.length-1;e>=0;e-=1){const t=o[e],{modifiers:l,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=n(t);let h=Boolean(u),f=r(h?d.substring(0,u):d);if(!f){if(!h){s=t+(s.length>0?" "+s:s);continue}if(f=r(d),!f){s=t+(s.length>0?" "+s:s);continue}h=!1}const m=p(l).join(":"),g=c?m+"!":m,v=g+f;if(a.includes(v))continue;a.push(v);const y=i(f,h);for(let e=0;e<y.length;++e){const t=y[e];a.push(g+t)}s=t+(s.length>0?" "+s:s)}return s})(e,n);return a(e,r),r}return function(){return o(g.apply(null,arguments))}}const b=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},x=/^\[(?:([a-z-]+):)?(.+)\]$/i,w=/^\d+\/\d+$/,_=new Set(["px","full","screen"]),k=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,E=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,S=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,C=e=>T(e)||_.has(e)||w.test(e),A=e=>$(e,"length",H),T=e=>Boolean(e)&&!Number.isNaN(Number(e)),L=e=>$(e,"number",T),O=e=>Boolean(e)&&Number.isInteger(Number(e)),R=e=>e.endsWith("%")&&T(e.slice(0,-1)),D=e=>x.test(e),M=e=>k.test(e),q=new Set(["length","size","percentage"]),P=e=>$(e,q,V),I=e=>$(e,"position",V),B=new Set(["image","url"]),F=e=>$(e,B,G),U=e=>$(e,"",W),z=()=>!0,$=(e,t,n)=>{const r=x.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},H=e=>N.test(e)&&!E.test(e),V=()=>!1,W=e=>S.test(e),G=e=>j.test(e),Z=y((Symbol.toStringTag,()=>{const e=b("colors"),t=b("spacing"),n=b("blur"),r=b("brightness"),i=b("borderColor"),a=b("borderRadius"),o=b("borderSpacing"),s=b("borderWidth"),l=b("contrast"),c=b("grayscale"),d=b("hueRotate"),u=b("invert"),h=b("gap"),f=b("gradientColorStops"),p=b("gradientColorStopPositions"),m=b("inset"),g=b("margin"),v=b("opacity"),y=b("padding"),x=b("saturate"),w=b("scale"),_=b("sepia"),k=b("skew"),N=b("space"),E=b("translate"),S=()=>["auto",D,t],j=()=>[D,t],q=()=>["",C,A],B=()=>["auto",T,D],$=()=>["","0",D],H=()=>[T,D];return{cacheSize:500,separator:":",theme:{colors:[z],spacing:[C,A],blur:["none","",M,D],brightness:H(),borderColor:[e],borderRadius:["none","","full",M,D],borderSpacing:j(),borderWidth:q(),contrast:H(),grayscale:$(),hueRotate:H(),invert:$(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[R,A],inset:S(),margin:S(),opacity:H(),padding:j(),saturate:H(),scale:H(),sepia:$(),skew:H(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",D]}],container:["container"],columns:[{columns:[M]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",D]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",O,D]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",D]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",O,D]}],"grid-cols":[{"grid-cols":[z]}],"col-start-end":[{col:["auto",{span:["full",O,D]},D]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[z]}],"row-start-end":[{row:["auto",{span:[O,D]},D]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",D]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",D]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",D,t]}],"min-w":[{"min-w":[D,t,"min","max","fit"]}],"max-w":[{"max-w":[D,t,"none","full","min","max","fit","prose",{screen:[M]},M]}],h:[{h:[D,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[D,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[D,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[D,t,"auto","min","max","fit"]}],"font-size":[{text:["base",M,A]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",L]}],"font-family":[{font:[z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",D]}],"line-clamp":[{"line-clamp":["none",T,L]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",C,D]}],"list-image":[{"list-image":["none",D]}],"list-style-type":[{list:["none","disc","decimal",D]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",C,A]}],"underline-offset":[{"underline-offset":["auto",C,D]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",D]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",D]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",I]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",P]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},F]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[C,D]}],"outline-w":[{outline:[C,A]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[C,A]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",M,U]}],"shadow-color":[{shadow:[z]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",M,D]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",D]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",D]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",D]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[O,D]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",D]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",D]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",D]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[C,A,L]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}))},891(e,t,n){"use strict";var r=n(8227),i={value:()=>{}};function a(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new o(r)}function o(e){this._=e}function s(e,t){for(var n,r=0,i=e.length;r<i;++r)if((n=e[r]).name===t)return n.value}function l(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=i,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}o.prototype=a.prototype={constructor:o,on:function(e,t){var n,r,i=this._,a=(r=i,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),o=-1,c=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++o<c;)if(n=(e=a[o]).type)i[n]=l(i[n],e.name,t);else if(null==t)for(n in i)i[n]=l(i[n],e.name,null);return this}for(;++o<c;)if((n=(e=a[o]).type)&&(n=s(i[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new o(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(r=this._[e]).length;a<n;++a)r[a].value.apply(t,i)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};const c=a;var d,u,h=0,f=0,p=0,m=0,g=0,v=0,y="object"==typeof performance&&performance.now?performance:Date,b="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function x(){return g||(b(w),g=y.now()+v)}function w(){g=0}function _(){this._call=this._time=this._next=null}function k(e,t,n){var r=new _;return r.restart(e,t,n),r}function N(){g=(m=y.now())+v,h=f=0;try{!function(){x(),++h;for(var e,t=d;t;)(e=g-t._time)>=0&&t._call.call(void 0,e),t=t._next;--h}()}finally{h=0,function(){for(var e,t,n=d,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:d=t);u=e,S(r)}(),g=0}}function E(){var e=y.now(),t=e-m;t>1e3&&(v-=t,m=e)}function S(e){h||(f&&(f=clearTimeout(f)),e-g>24?(e<1/0&&(f=setTimeout(N,e-y.now()-v)),p&&(p=clearInterval(p))):(p||(m=y.now(),p=setInterval(E,1e3)),h=1,b(N)))}function j(e,t,n){var r=new _;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}_.prototype=k.prototype={constructor:_,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?x():+n)+(null==t?0:+t),this._next||u===this||(u?u._next=this:d=this,u=this),this._call=e,this._time=n,S()},stop:function(){this._call&&(this._call=null,this._time=1/0,S())}};var C=c("start","end","cancel","interrupt"),A=[];function T(e,t,n,r,i,a){var o=e.__transition;if(o){if(n in o)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function a(l){var c,d,u,h;if(1!==n.state)return s();for(c in i)if((h=i[c]).name===n.name){if(3===h.state)return j(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete i[c]):+c<t&&(h.state=6,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete i[c])}if(j(function(){3===n.state&&(n.state=4,n.timer.restart(o,n.delay,n.time),o(l))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(u=n.tween.length),c=0,d=-1;c<u;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=h);r.length=d+1}}function o(t){for(var i=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),a=-1,o=r.length;++a<o;)r[a].call(e,i);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete i[t],i)return;delete e.__transition}i[t]=n,n.timer=k(function(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:i,on:C,tween:A,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function L(e,t){var n=R(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function O(e,t){var n=R(e,t);if(n.state>3)throw new Error("too late; already running");return n}function R(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}var D,M=n(8981),q=180/Math.PI,P={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function I(e,t,n,r,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*q,skewX:Math.atan(l)*q,scaleX:o,scaleY:s}}function B(e,t,n,r){function i(e){return e.length?e.pop()+" ":""}return function(a,o){var s=[],l=[];return a=e(a),o=e(o),function(e,r,i,a,o,s){if(e!==i||r!==a){var l=o.push("translate(",null,t,null,n);s.push({i:l-4,x:(0,M.A)(e,i)},{i:l-2,x:(0,M.A)(r,a)})}else(i||a)&&o.push("translate("+i+t+a+n)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:(0,M.A)(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(a.rotate,o.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:(0,M.A)(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(a.skewX,o.skewX,s,l),function(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:(0,M.A)(e,n)},{i:s-2,x:(0,M.A)(t,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var F=B(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?P:I(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),U=B(function(e){return null==e?P:(D||(D=document.createElementNS("http://www.w3.org/2000/svg","g")),D.setAttribute("transform",e),(e=D.transform.baseVal.consolidate())?I((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):P)},", ",")",")"),z=n(7268);function $(e,t){var n,r;return function(){var i=O(this,e),a=i.tween;if(a!==n)for(var o=0,s=(r=n=a).length;o<s;++o)if(r[o].name===t){(r=r.slice()).splice(o,1);break}i.tween=r}}function H(e,t,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var a=O(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=s;break}l===c&&i.push(s)}a.tween=i}}function V(e,t,n){var r=e._id;return e.each(function(){var e=O(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return R(e,r).value[t]}}var W=n(5315),G=n(3377),Z=n(7737);function K(e,t){var n;return("number"==typeof t?M.A:t instanceof W.Ay?G.Ay:(n=(0,W.Ay)(t))?(t=n,G.Ay):Z.A)(e,t)}function Y(e){return function(){this.removeAttribute(e)}}function X(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Q(e,t,n){var r,i,a=n+"";return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}}function J(e,t,n){var r,i,a=n+"";return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}function ee(e,t,n){var r,i,a;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttribute(e))===(s=l+"")?null:o===r&&s===i?a:(i=s,a=t(r=o,l));this.removeAttribute(e)}}function te(e,t,n){var r,i,a;return function(){var o,s,l=n(this);if(null!=l)return(o=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:o===r&&s===i?a:(i=s,a=t(r=o,l));this.removeAttributeNS(e.space,e.local)}}function ne(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,i)),n}return i._value=t,i}function re(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,i)),n}return i._value=t,i}function ie(e,t){return function(){L(this,e).delay=+t.apply(this,arguments)}}function ae(e,t){return t=+t,function(){L(this,e).delay=t}}function oe(e,t){return function(){O(this,e).duration=+t.apply(this,arguments)}}function se(e,t){return t=+t,function(){O(this,e).duration=t}}var le=n(6541),ce=n(574),de=n(747),ue=r.Ay.prototype.constructor,he=n(3683);function fe(e){return function(){this.style.removeProperty(e)}}var pe=0;function me(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ge(){return++pe}var ve=r.Ay.prototype;me.prototype=function(e){return(0,r.Ay)().transition(e)}.prototype={constructor:me,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=(0,ce.A)(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s,l,c=r[o],d=c.length,u=a[o]=new Array(d),h=0;h<d;++h)(s=c[h])&&(l=e.call(s,s.__data__,h,c))&&("__data__"in s&&(l.__data__=s.__data__),u[h]=l,T(u[h],t,n,h,u,R(s,n)));return new me(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=(0,de.A)(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var l,c=r[s],d=c.length,u=0;u<d;++u)if(l=c[u]){for(var h,f=e.call(l,l.__data__,u,c),p=R(l,n),m=0,g=f.length;m<g;++m)(h=f[m])&&T(h,t,n,m,f,p);a.push(f),o.push(l)}return new me(a,o,t,n)},selectChild:ve.selectChild,selectChildren:ve.selectChildren,filter:function(e){"function"!=typeof e&&(e=(0,le.A)(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a,o=t[i],s=o.length,l=r[i]=[],c=0;c<s;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new me(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var l,c=t[s],d=n[s],u=c.length,h=o[s]=new Array(u),f=0;f<u;++f)(l=c[f]||d[f])&&(h[f]=l);for(;s<r;++s)o[s]=t[s];return new me(o,this._parents,this._name,this._id)},selection:function(){return new ue(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=ge(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],l=s.length,c=0;c<l;++c)if(o=s[c]){var d=R(o,t);T(o,e,n,c,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new me(r,this._parents,e,n)},call:ve.call,nodes:ve.nodes,node:ve.node,size:ve.size,empty:ve.empty,each:ve.each,on:function(e,t){var n=this._id;return arguments.length<2?R(this.node(),n).on.on(e):this.each(function(e,t,n){var r,i,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?L:O;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}(n,e,t))},attr:function(e,t){var n=(0,z.A)(e),r="transform"===n?U:K;return this.attrTween(e,"function"==typeof t?(n.local?te:ee)(n,r,V(this,"attr."+e,t)):null==t?(n.local?X:Y)(n):(n.local?J:Q)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=(0,z.A)(e);return this.tween(n,(r.local?ne:re)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?F:K;return null==t?this.styleTween(e,function(e,t){var n,r,i;return function(){var a=(0,he.j)(this,e),o=(this.style.removeProperty(e),(0,he.j)(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}(e,r)).on("end.style."+e,fe(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,i,a;return function(){var o=(0,he.j)(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=(0,he.j)(this,e)),o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s))}}(e,r,V(this,"style."+e,t))).each(function(e,t){var n,r,i,a,o="style."+t,s="end."+o;return function(){var l=O(this,e),c=l.on,d=null==l.value[o]?a||(a=fe(t)):void 0;c===n&&i===d||(r=(n=c).copy()).on(s,i=d),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,i,a=n+"";return function(){var o=(0,he.j)(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(V(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,i=R(this.node(),n).tween,a=0,o=i.length;a<o;++a)if((r=i[a]).name===e)return r.value;return null}return this.each((null==t?$:H)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ie:ae)(t,e)):R(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?oe:se)(t,e)):R(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){O(this,e).ease=t}}(t,e)):R(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;O(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},l={value:function(){0===--i&&a()}};n.each(function(){var n=O(this,r),i=n.on;i!==e&&((t=(e=i).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===i&&a()})},[Symbol.iterator]:ve[Symbol.iterator]};var ye={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function be(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}r.Ay.prototype.interrupt=function(e){return this.each(function(){!function(e,t){var n,r,i,a=e.__transition,o=!0;if(a){for(i in t=null==t?null:t+"",a)(n=a[i]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete e.__transition}}(this,e)})},r.Ay.prototype.transition=function(e){var t,n;e instanceof me?(t=e._id,e=e._name):(t=ge(),(n=ye).time=x(),e=null==e?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o,s=r[a],l=s.length,c=0;c<l;++c)(o=s[c])&&T(o,e,t,c,s,n||be(o,t));return new me(r,this._parents,e,t)};const{abs:xe,max:we,min:_e}=Math;function ke(e){return{type:e}}function Ne(e,t,n){this.k=e,this.x=t,this.y=n}["w","e"].map(ke),["n","s"].map(ke),["n","w","e","s","nw","ne","sw","se"].map(ke),Ne.prototype={constructor:Ne,scale:function(e){return 1===e?this:new Ne(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Ne(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new Ne(1,0,0),Ne.prototype},1455(e){"use strict";e.exports=window.wp.apiFetch},1609(e){"use strict";e.exports=window.React},1635(e,t,n){"use strict";n.d(t,{Cl:()=>r});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError},1674(e,t,n){"use strict";n(7723)},2106(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(6087),i=n(8443),a=n(7723),o=n(790);function s({date:e,defaultDate:t="-"}){return e?(0,o.jsx)(r.RawHTML,{children:(0,a.sprintf)((0,a.__)("%1$s at %2$s","dokan-lite"),(0,i.dateI18n)((0,i.getSettings)().formats.date,e,(0,i.getSettings)().timezone.string),(0,i.dateI18n)((0,i.getSettings)().formats.time,e,(0,i.getSettings)().timezone.string))}):t}s.Date=({date:e,defaultDate:t="-"})=>e?(0,o.jsx)(r.RawHTML,{children:(0,i.dateI18n)((0,i.getSettings)().formats.date,e,(0,i.getSettings)().timezone.string)}):t,s.Time=({time:e,defaultTime:t="-"})=>e?(0,o.jsx)(r.RawHTML,{children:(0,i.dateI18n)((0,i.getSettings)().formats.time,e,(0,i.getSettings)().timezone.string)}):t;const l=s},2619(e){"use strict";e.exports=window.wp.hooks},2660(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const r=n(5606),i=n(7193),a=n(8142),o=n(9106);t.AttributeMap=o.default;const s=n(5759);t.Op=s.default;const l=n(8317);t.OpIterator=l.default;const c=String.fromCharCode(0),d=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]};class u{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=i(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(a(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach(r=>{(e(r)?t:n).push(r)}),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce((e,t)=>t.insert?e+s.default.length(t):t.delete?e-t.delete:e,0)}length(){return this.reduce((e,t)=>e+s.default.length(t),0)}slice(e=0,t=1/0){const n=[],r=new l.default(this.ops);let i=0;for(;i<t&&r.hasNext();){let a;i<e?a=r.next(e-i):(a=r.next(t-i),n.push(a)),i+=s.default.length(a)}return new u(n)}compose(e){const t=new l.default(this.ops),n=new l.default(e.ops),r=[],i=n.peek();if(null!=i&&"number"==typeof i.retain&&null==i.attributes){let e=i.retain;for(;"insert"===t.peekType()&&t.peekLength()<=e;)e-=t.peekLength(),r.push(t.next());i.retain-e>0&&n.next(i.retain-e)}const s=new u(r);for(;t.hasNext()||n.hasNext();)if("insert"===n.peekType())s.push(n.next());else if("delete"===t.peekType())s.push(t.next());else{const e=Math.min(t.peekLength(),n.peekLength()),r=t.next(e),i=n.next(e);if(i.retain){const l={};if("number"==typeof r.retain)l.retain="number"==typeof i.retain?e:i.retain;else if("number"==typeof i.retain)null==r.retain?l.insert=r.insert:l.retain=r.retain;else{const e=null==r.retain?"insert":"retain",[t,n,a]=d(r[e],i.retain),o=u.getHandler(t);l[e]={[t]:o.compose(n,a,"retain"===e)}}const c=o.default.compose(r.attributes,i.attributes,"number"==typeof r.retain);if(c&&(l.attributes=c),s.push(l),!n.hasNext()&&a(s.ops[s.ops.length-1],l)){const e=new u(t.rest());return s.concat(e).chop()}}else"number"==typeof i.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&s.push(i)}return s.chop()}concat(e){const t=new u(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new u;const n=[this,e].map(t=>t.map(n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:c;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")),i=new u,s=r(n[0],n[1],t,!0),d=new l.default(this.ops),h=new l.default(e.ops);return s.forEach(e=>{let t=e[1].length;for(;t>0;){let n=0;switch(e[0]){case r.INSERT:n=Math.min(h.peekLength(),t),i.push(h.next(n));break;case r.DELETE:n=Math.min(t,d.peekLength()),d.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(d.peekLength(),h.peekLength(),t);const e=d.next(n),s=h.next(n);a(e.insert,s.insert)?i.retain(n,o.default.diff(e.attributes,s.attributes)):i.push(s).delete(n)}t-=n}}),i.chop()}eachLine(e,t="\n"){const n=new l.default(this.ops);let r=new u,i=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const a=n.peek(),o=s.default.length(a)-n.peekLength(),l="string"==typeof a.insert?a.insert.indexOf(t,o)-o:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(!1===e(r,n.next(1).attributes||{},i))return;i+=1,r=new u}}r.length()>0&&e(r,{},i)}invert(e){const t=new u;return this.reduce((n,r)=>{if(r.insert)t.delete(s.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return t.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const i=r.delete||r.retain;return e.slice(n,n+i).forEach(e=>{r.delete?t.push(e):r.retain&&r.attributes&&t.retain(s.default.length(e),o.default.invert(r.attributes,e.attributes))}),n+i}if("object"==typeof r.retain&&null!==r.retain){const i=e.slice(n,n+1),a=new l.default(i.ops).next(),[s,c,h]=d(r.retain,a.insert),f=u.getHandler(s);return t.retain({[s]:f.invert(c,h)},o.default.invert(r.attributes,a.attributes)),n+1}}return n},0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const n=e,r=new l.default(this.ops),i=new l.default(n.ops),a=new u;for(;r.hasNext()||i.hasNext();)if("insert"!==r.peekType()||!t&&"insert"===i.peekType())if("insert"===i.peekType())a.push(i.next());else{const e=Math.min(r.peekLength(),i.peekLength()),n=r.next(e),s=i.next(e);if(n.delete)continue;if(s.delete)a.push(s);else{const r=n.retain,i=s.retain;let l="object"==typeof i&&null!==i?i:e;if("object"==typeof r&&null!==r&&"object"==typeof i&&null!==i){const e=Object.keys(r)[0];if(e===Object.keys(i)[0]){const n=u.getHandler(e);n&&(l={[e]:n.transform(r[e],i[e],t)})}}a.retain(l,o.default.transform(n.attributes,s.attributes,t))}}else a.retain(s.default.length(r.next()));return a.chop()}transformPosition(e,t=!1){t=!!t;const n=new l.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const i=n.peekLength(),a=n.peekType();n.next(),"delete"!==a?("insert"===a&&(r<e||!t)&&(e+=i),r+=i):e-=Math.min(i,e-r)}return e}}u.Op=s.default,u.OpIterator=l.default,u.AttributeMap=o.default,u.handlers={},t.default=u,e.exports=u,e.exports.default=u},2816(e){"use strict";e.exports=window.dokan.reactHooks},2847(e,t,n){"use strict";n.d(t,{p:()=>ae});const{entries:r,setPrototypeOf:i,isFrozen:a,getPrototypeOf:o,getOwnPropertyDescriptor:s}=Object;let{freeze:l,seal:c,create:d}=Object,{apply:u,construct:h}="undefined"!=typeof Reflect&&Reflect;l||(l=function(e){return e}),c||(c=function(e){return e}),u||(u=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),h||(h=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const f=C(Array.prototype.forEach),p=C(Array.prototype.lastIndexOf),m=C(Array.prototype.pop),g=C(Array.prototype.push),v=C(Array.prototype.splice),y=C(String.prototype.toLowerCase),b=C(String.prototype.toString),x=C(String.prototype.match),w=C(String.prototype.replace),_=C(String.prototype.indexOf),k=C(String.prototype.trim),N=C(Object.prototype.hasOwnProperty),E=C(RegExp.prototype.test),S=(j=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h(j,t)});var j;function C(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return u(e,t,r)}}function A(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y;i&&i(e,null);let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(a(t)||(t[r]=e),i=e)}e[i]=!0}return e}function T(e){for(let t=0;t<e.length;t++)N(e,t)||(e[t]=null);return e}function L(e){const t=d(null);for(const[n,i]of r(e))N(e,n)&&(Array.isArray(i)?t[n]=T(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=L(i):t[n]=i);return t}function O(e,t){for(;null!==e;){const n=s(e,t);if(n){if(n.get)return C(n.get);if("function"==typeof n.value)return C(n.value)}e=o(e)}return function(){return null}}const R=l(["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"]),D=l(["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"]),M=l(["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"]),q=l(["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"]),P=l(["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"]),I=l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),B=l(["#text"]),F=l(["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=l(["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=l(["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"]),$=l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=c(/\{\{[\w\W]*|[\w\W]*\}\}/gm),V=c(/<%[\w\W]*|[\w\W]*%>/gm),W=c(/\$\{[\w\W]*/gm),G=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),Z=c(/^aria-[\-\w]+$/),K=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Y=c(/^(?:\w+script|data):/i),X=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Q=c(/^html$/i),J=c(/^[a-z][.\w]*(-[.\w]+)+$/i);var ee=Object.freeze({__proto__:null,ARIA_ATTR:Z,ATTR_WHITESPACE:X,CUSTOM_ELEMENT:J,DATA_ATTR:G,DOCTYPE_NAME:Q,ERB_EXPR:V,IS_ALLOWED_URI:K,IS_SCRIPT_OR_DATA:Y,MUSTACHE_EXPR:H,TMPLIT_EXPR:W});const te=function(){return"undefined"==typeof window?null:window};var ne=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const a=i,o=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:c,Node:u,Element:h,NodeFilter:j,NamedNodeMap:C=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:T,DOMParser:H,trustedTypes:V}=t,W=h.prototype,G=O(W,"cloneNode"),Z=O(W,"remove"),Y=O(W,"nextSibling"),X=O(W,"childNodes"),J=O(W,"parentNode");if("function"==typeof c){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let ne,re="";const{implementation:ie,createNodeIterator:ae,createDocumentFragment:oe,getElementsByTagName:se}=i,{importNode:le}=a;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof r&&"function"==typeof J&&ie&&void 0!==ie.createHTMLDocument;const{MUSTACHE_EXPR:de,ERB_EXPR:ue,TMPLIT_EXPR:he,DATA_ATTR:fe,ARIA_ATTR:pe,IS_SCRIPT_OR_DATA:me,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:ve}=ee;let{IS_ALLOWED_URI:ye}=ee,be=null;const xe=A({},[...R,...D,...M,...P,...B]);let we=null;const _e=A({},[...F,...U,...z,...$]);let ke=Object.seal(d(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}})),Ne=null,Ee=null;const Se=Object.seal(d(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let je=!0,Ce=!0,Ae=!1,Te=!0,Le=!1,Oe=!0,Re=!1,De=!1,Me=!1,qe=!1,Pe=!1,Ie=!1,Be=!0,Fe=!1,Ue=!0,ze=!1,$e={},He=null;const Ve=A({},["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 We=null;const Ge=A({},["audio","video","img","source","image","track"]);let Ze=null;const Ke=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1999/xhtml";let Je=Qe,et=!1,tt=null;const nt=A({},[Ye,Xe,Qe],b);let rt=A({},["mi","mo","mn","ms","mtext"]),it=A({},["annotation-xml"]);const at=A({},["title","style","font","a","script"]);let ot=null;const st=["application/xhtml+xml","text/html"];let lt=null,ct=null;const dt=i.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},ht=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=L(e),ot=-1===st.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===ot?b:y,be=N(e,"ALLOWED_TAGS")?A({},e.ALLOWED_TAGS,lt):xe,we=N(e,"ALLOWED_ATTR")?A({},e.ALLOWED_ATTR,lt):_e,tt=N(e,"ALLOWED_NAMESPACES")?A({},e.ALLOWED_NAMESPACES,b):nt,Ze=N(e,"ADD_URI_SAFE_ATTR")?A(L(Ke),e.ADD_URI_SAFE_ATTR,lt):Ke,We=N(e,"ADD_DATA_URI_TAGS")?A(L(Ge),e.ADD_DATA_URI_TAGS,lt):Ge,He=N(e,"FORBID_CONTENTS")?A({},e.FORBID_CONTENTS,lt):Ve,Ne=N(e,"FORBID_TAGS")?A({},e.FORBID_TAGS,lt):L({}),Ee=N(e,"FORBID_ATTR")?A({},e.FORBID_ATTR,lt):L({}),$e=!!N(e,"USE_PROFILES")&&e.USE_PROFILES,je=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,Oe=!1!==e.SAFE_FOR_XML,Re=e.WHOLE_DOCUMENT||!1,qe=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Be=!1!==e.SANITIZE_DOM,Fe=e.SANITIZE_NAMED_PROPS||!1,Ue=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||K,Je=e.NAMESPACE||Qe,rt=e.MATHML_TEXT_INTEGRATION_POINTS||rt,it=e.HTML_INTEGRATION_POINTS||it,ke=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ke.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ke.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ke.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Ce=!1),Pe&&(qe=!0),$e&&(be=A({},B),we=[],!0===$e.html&&(A(be,R),A(we,F)),!0===$e.svg&&(A(be,D),A(we,U),A(we,$)),!0===$e.svgFilters&&(A(be,M),A(we,U),A(we,$)),!0===$e.mathMl&&(A(be,P),A(we,z),A(we,$))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Se.tagCheck=e.ADD_TAGS:(be===xe&&(be=L(be)),A(be,e.ADD_TAGS,lt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Se.attributeCheck=e.ADD_ATTR:(we===_e&&(we=L(we)),A(we,e.ADD_ATTR,lt))),e.ADD_URI_SAFE_ATTR&&A(Ze,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(He===Ve&&(He=L(He)),A(He,e.FORBID_CONTENTS,lt)),e.ADD_FORBID_CONTENTS&&(He===Ve&&(He=L(He)),A(He,e.ADD_FORBID_CONTENTS,lt)),Ue&&(be["#text"]=!0),Re&&A(be,["html","head","body"]),be.table&&(A(be,["tbody"]),delete Ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ne=e.TRUSTED_TYPES_POLICY,re=ne.createHTML("")}else void 0===ne&&(ne=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(V,o)),null!==ne&&"string"==typeof re&&(re=ne.createHTML(""));l&&l(e),ct=e}},ft=A({},[...D,...M,...q]),pt=A({},[...P,...I]),mt=function(e){g(n.removed,{element:e});try{J(e).removeChild(e)}catch(t){Z(e)}},gt=function(e,t){try{g(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){g(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(qe||Pe)try{mt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,n=null;if(Me)e="<remove></remove>"+e;else{const t=x(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ot&&Je===Qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=ne?ne.createHTML(e):e;if(Je===Qe)try{t=(new H).parseFromString(r,ot)}catch(e){}if(!t||!t.documentElement){t=ie.createDocument(Je,"template",null);try{t.documentElement.innerHTML=et?re:r}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Je===Qe?se.call(t,Re?"html":"body")[0]:Re?t.documentElement:a},yt=function(e){return ae.call(e.ownerDocument||e,e,j.SHOW_ELEMENT|j.SHOW_COMMENT|j.SHOW_TEXT|j.SHOW_PROCESSING_INSTRUCTION|j.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof T&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof C)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},xt=function(e){return"function"==typeof u&&e instanceof u};function wt(e,t,r){f(e,e=>{e.call(n,t,r,ct)})}const _t=function(e){let t=null;if(wt(ce.beforeSanitizeElements,e,null),bt(e))return mt(e),!0;const r=lt(e.nodeName);if(wt(ce.uponSanitizeElement,e,{tagName:r,allowedTags:be}),Oe&&e.hasChildNodes()&&!xt(e.firstElementChild)&&E(/<[/\w!]/g,e.innerHTML)&&E(/<[/\w!]/g,e.textContent))return mt(e),!0;if(7===e.nodeType)return mt(e),!0;if(Oe&&8===e.nodeType&&E(/<[/\w]/g,e.data))return mt(e),!0;if(!(Se.tagCheck instanceof Function&&Se.tagCheck(r))&&(!be[r]||Ne[r])){if(!Ne[r]&&Nt(r)){if(ke.tagNameCheck instanceof RegExp&&E(ke.tagNameCheck,r))return!1;if(ke.tagNameCheck instanceof Function&&ke.tagNameCheck(r))return!1}if(Ue&&!He[r]){const t=J(e)||e.parentNode,n=X(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const i=G(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,Y(e))}}return mt(e),!0}return e instanceof h&&!function(e){let t=J(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=y(e.tagName),r=y(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Xe?t.namespaceURI===Qe?"svg"===n:t.namespaceURI===Ye?"svg"===n&&("annotation-xml"===r||rt[r]):Boolean(ft[n]):e.namespaceURI===Ye?t.namespaceURI===Qe?"math"===n:t.namespaceURI===Xe?"math"===n&&it[r]:Boolean(pt[n]):e.namespaceURI===Qe?!(t.namespaceURI===Xe&&!it[r])&&!(t.namespaceURI===Ye&&!rt[r])&&!pt[n]&&(at[n]||!ft[n]):!("application/xhtml+xml"!==ot||!tt[e.namespaceURI]))}(e)?(mt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!E(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,f([de,ue,he],e=>{t=w(t,e," ")}),e.textContent!==t&&(g(n.removed,{element:e.cloneNode()}),e.textContent=t)),wt(ce.afterSanitizeElements,e,null),!1):(mt(e),!0)},kt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in i||n in dt))return!1;if(Ce&&!Ee[t]&&E(fe,t));else if(je&&E(pe,t));else if(Se.attributeCheck instanceof Function&&Se.attributeCheck(t,e));else if(!we[t]||Ee[t]){if(!(Nt(e)&&(ke.tagNameCheck instanceof RegExp&&E(ke.tagNameCheck,e)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(e))&&(ke.attributeNameCheck instanceof RegExp&&E(ke.attributeNameCheck,t)||ke.attributeNameCheck instanceof Function&&ke.attributeNameCheck(t,e))||"is"===t&&ke.allowCustomizedBuiltInElements&&(ke.tagNameCheck instanceof RegExp&&E(ke.tagNameCheck,n)||ke.tagNameCheck instanceof Function&&ke.tagNameCheck(n))))return!1}else if(Ze[t]);else if(E(ye,w(n,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!We[e])if(Ae&&!E(me,w(n,ge,"")));else if(n)return!1;return!0},Nt=function(e){return"annotation-xml"!==e&&x(e,ve)},Et=function(e){wt(ce.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let i=t.length;for(;i--;){const a=t[i],{name:o,namespaceURI:s,value:l}=a,c=lt(o),d=l;let u="value"===o?d:k(d);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,wt(ce.uponSanitizeAttribute,e,r),u=r.attrValue,!Fe||"id"!==c&&"name"!==c||(gt(o,e),u="user-content-"+u),Oe&&E(/((--!?|])>)|<\/(style|title|textarea)/i,u)){gt(o,e);continue}if("attributename"===c&&x(u,"href")){gt(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){gt(o,e);continue}if(!Te&&E(/\/>/i,u)){gt(o,e);continue}Le&&f([de,ue,he],e=>{u=w(u,e," ")});const h=lt(e.nodeName);if(kt(h,c,u)){if(ne&&"object"==typeof V&&"function"==typeof V.getAttributeType)if(s);else switch(V.getAttributeType(h,c)){case"TrustedHTML":u=ne.createHTML(u);break;case"TrustedScriptURL":u=ne.createScriptURL(u)}if(u!==d)try{s?e.setAttributeNS(s,o,u):e.setAttribute(o,u),bt(e)?mt(e):m(n.removed)}catch(t){gt(o,e)}}else gt(o,e)}wt(ce.afterSanitizeAttributes,e,null)},St=function e(t){let n=null;const r=yt(t);for(wt(ce.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)wt(ce.uponSanitizeShadowNode,n,null),_t(n),Et(n),n.content instanceof s&&e(n.content);wt(ce.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,o=null,l=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!xt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(De||ht(t),n.removed=[],"string"==typeof e&&(ze=!1),ze){if(e.nodeName){const t=lt(e.nodeName);if(!be[t]||Ne[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof u)r=vt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!qe&&!Le&&!Re&&-1===e.indexOf("<"))return ne&&Ie?ne.createHTML(e):e;if(r=vt(e),!r)return qe?null:Ie?re:""}r&&Me&&mt(r.firstChild);const c=yt(ze?e:r);for(;o=c.nextNode();)_t(o),Et(o),o.content instanceof s&&St(o.content);if(ze)return e;if(qe){if(Pe)for(l=oe.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(we.shadowroot||we.shadowrootmode)&&(l=le.call(a,l,!0)),l}let d=Re?r.outerHTML:r.innerHTML;return Re&&be["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&E(Q,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Le&&f([de,ue,he],e=>{d=w(d,e," ")}),ne&&Ie?ne.createHTML(d):d},n.setConfig=function(){ht(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),De=!0},n.clearConfig=function(){ct=null,De=!1},n.isValidAttribute=function(e,t,n){ct||ht({});const r=lt(e),i=lt(t);return kt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&g(ce[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=p(ce[e],t);return-1===n?void 0:v(ce[e],n,1)[0]}return m(ce[e])},n.removeHooks=function(e){ce[e]=[]},n.removeAllHooks=function(){ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const re=["a","b","em","i","strong","p","br","h1","h2","h3","h4","h5","h6","img","video","ul","li","ol","u","blockquote","span"],ie=["target","href","rel","name","download","class","style","src","alt"],ae=(e,t)=>{const n=t?.tags||re,r=t?.attr||ie;return ne.sanitize(e,{ALLOWED_TAGS:n,ALLOWED_ATTR:r})}},2956(e,t,n){"use strict";n.d(t,{formatNumber:()=>i.ZV,formatPrice:()=>i.$g,kebabCase:()=>r.kW,sanitizeHTML:()=>o.p,unformatNumber:()=>i.Ih});var r=n(7710),i=n(655),a=n(7374);n.o(a,"sanitizeHTML")&&n.d(t,{sanitizeHTML:function(){return a.sanitizeHTML}});var o=n(2847);n(3958),n(1674)},3072(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,x=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case d:case u:case a:case s:case o:case f:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case m:case l:return e;default:return t}}case i:return t}}}function _(e){return w(e)===u}t.AsyncMode=d,t.ConcurrentMode=u,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=f,t.isAsyncMode=function(e){return _(e)||w(e)===d},t.isConcurrentMode=_,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===o},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===u||e===s||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===v)},t.typeOf=w},3078(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(8446),i=n(790);const a=({children:e,...t})=>(0,i.jsx)(r.Tooltip,{...t,contentClass:"dokan-layout",content:(0,i.jsx)("div",{className:"z-50 select-none rounded-[5px] max-w-[285px] bg-black px-3.5 py-1.5 text-xs text-white break-words",children:t?.content||e}),children:e})},3116(e,t,n){"use strict";n.d(t,{A:()=>r});const r=e=>()=>e},3377(e,t,n){"use strict";n.d(t,{Ay:()=>s});var r=n(5315);function i(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}var a=n(3116);function o(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):(0,a.A)(isNaN(e)?t:e)}const s=function e(t){var n=function(e){return 1===(e=+e)?o:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):(0,a.A)(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=(0,r.Qh)(e)).r,(t=(0,r.Qh)(t)).r),a=n(e.g,t.g),s=n(e.b,t.b),l=o(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=a(t),e.b=s(t),e.opacity=l(t),e+""}}return i.gamma=e,i}(1);function l(e){return function(t){var n,i,a=t.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n<a;++n)i=(0,r.Qh)(t[n]),o[n]=i.r||0,s[n]=i.g||0,l[n]=i.b||0;return o=e(o),s=e(s),l=e(l),i.opacity=1,function(e){return i.r=o(e),i.g=s(e),i.b=l(e),i+""}}}l(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),a=e[r],o=e[r+1],s=r>0?e[r-1]:2*a-o,l=r<t-1?e[r+2]:2*o-a;return i((n-r/t)*t,s,a,o,l)}}),l(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),a=e[(r+t-1)%t],o=e[r%t],s=e[(r+1)%t],l=e[(r+2)%t];return i((n-r/t)*t,a,o,s,l)}})},3404(e,t,n){"use strict";e.exports=n(3072)},3552(e,t,n){"use strict";n.d(t,{A:()=>r});var r={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},3683(e,t,n){"use strict";n.d(t,{A:()=>s,j:()=>l});var r=n(6747);function i(e){return function(){this.style.removeProperty(e)}}function a(e,t,n){return function(){this.style.setProperty(e,t,n)}}function o(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function s(e,t,n){return arguments.length>1?this.each((null==t?i:"function"==typeof t?o:a)(e,t,null==n?"":n)):l(this.node(),e)}function l(e,t){return e.style.getPropertyValue(t)||(0,r.A)(e).getComputedStyle(e,null).getPropertyValue(t)}},3832(e){"use strict";e.exports=window.wp.url},3958(){"use strict";window.wc.csvExport},4146(e,t,n){"use strict";var r=n(3404),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?o:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=o;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var o=d(n);u&&(o=o.concat(u(n)));for(var s=l(t),m=l(n),g=0;g<o.length;++g){var v=o[g];if(!(a[v]||r&&r[v]||m&&m[v]||s&&s[v])){var y=h(n,v);try{c(t,v,y)}catch(e){}}}}return t}},4460(e,t,n){"use strict";n(6087),n(7723),n(4960),n(6427),n(8446),n(8443),window.wc.components,n(9491),n(790)},4960(e,t,n){"use strict";n.d(t,{AsyncSelect:()=>se,DateTimePicker:()=>ce,DokanButton:()=>h.A,DokanModal:()=>m,DokanPriceInput:()=>ue,DokanTooltip:()=>de.A,InternalError:()=>K,MediaUploader:()=>Gr,RichText:()=>Vr,Select:()=>Wr});var r={};n.r(r),n.d(r,{Attributor:()=>pe,AttributorStore:()=>_e,BlockBlot:()=>De,ClassAttributor:()=>be,ContainerBlot:()=>qe,EmbedBlot:()=>Pe,InlineBlot:()=>Oe,LeafBlot:()=>Se,ParentBlot:()=>Te,Registry:()=>ve,Scope:()=>fe,ScrollBlot:()=>Fe,StyleAttributor:()=>we,TextBlot:()=>ze});var i=n(6427),a=(n(2816),n(8395)),o=n(6087),s=n(7723),l=n(790);n(1674),n(7512);var c=n(2956),d=n(9491);const u=({className:e=""})=>(0,l.jsx)("svg",{className:`w-4 h-4 fill-red-500 stroke-red-500 ${e}`,children:(0,l.jsx)("path",{d:"M2.674 3.323zm.628.284v.005-.005zm0 .005h0zm1.31 1.486h0c-.14.215-.236.49-.182.766a.71.71 0 0 0 .24.411c.139.116.304.162.461.162h.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001.001 0 0 .001 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0c.345 0 .631.283.631.64s-.286.64-.631.64H1.67c-.345 0-.631-.283-.631-.64V3.171c0-.357.286-.64.631-.64s.631.283.631.64v.439c0 .087.009.262.121.419a.56.56 0 0 0 .298.212c.126.037.24.023.321 0 .147-.042.256-.131.319-.19a1.8 1.8 0 0 0 .209-.235c1.298-1.714 3.337-2.761 5.524-2.761h0c3.826 0 6.946 3.137 6.946 7s-3.12 7-6.945 7h0c-.434 0-.793-.356-.793-.803s.359-.803.793-.803c2.959 0 5.36-2.423 5.36-5.395s-2.4-5.395-5.36-5.395c-1.821 0-3.502.938-4.482 2.439z"})});var h=n(6650),f=n(856),p=n(8697);const m=e=>{const{isOpen:t,onClose:n,className:r,modalClassName:a,modalBodyClassName:m,modalFooterClassName:g,onConfirm:v,namespace:y,dialogTitle:b,cancelButtonText:x,confirmButtonText:w,confirmationTitle:_,confirmationDescription:k,cancelIcon:N,dialogIcon:E,dialogHeader:S,dialogFooter:j,dialogFooterContent:C,dialogContent:A,loading:T=!1,confirmButtonVariant:L="primary",hideCancelButton:O=!1,confirmButtonDisabled:R=!1,isDismissible:D=!0,shouldCloseOnClickOutside:M=!0,shouldCloseOnEsc:q=!0}=e;if(!y)throw new Error("Namespace is required for the Confirmation Modal component");const P=c.kebabCase?(0,c.kebabCase)(y||""):y,[I,B]=(0,o.useState)(!1),F=(0,o.useCallback)((0,d.debounce)(async()=>{B(!0);try{await v(),n()}catch(e){console.error("Confirmation action failed:",e)}finally{B(!1)}},300),[v,n]);return t?(0,l.jsx)(i.Modal,{...e,onRequestClose:n,className:(0,f.QP)("dokan-custom-modal dokan-layout bg-transparent shadow-none",a),isDismissible:D,shouldCloseOnClickOutside:M,shouldCloseOnEsc:q,__experimentalHideHeader:!0,children:(0,l.jsxs)("div",{className:(0,f.QP)("relative text-left bg-white w-full max-w-xl rounded-lg transition-all transform shadow-xl",r),children:[!1===D?null:N||(0,l.jsx)("button",{onClick:n,className:"absolute top-4 right-4 p-1 rounded-full text-gray-400 hover:text-red-600 hover:bg-red-50 hover:border hover:border-red-600 transition-all duration-200 z-10","aria-label":"Close",children:(0,l.jsx)(p.A,{className:"w-5 h-5"})}),!1===S?null:S||(0,l.jsxs)("div",{className:"px-6 py-4 border-b border-gray-200",children:[(0,l.jsx)(i.Slot,{name:`dokan-before-dialog-header-${P}`,fillProps:{namespace:y}}),(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900 leading-6 pr-8",children:b||(0,s.__)("Confirmation Dialog","dokan-lite")}),(0,l.jsx)(i.Slot,{name:`dokan-after-dialog-header-${P}`,fillProps:{namespace:y}})]}),(0,l.jsxs)("div",{className:(0,f.QP)("px-6 py-5",m),children:[(0,l.jsx)(i.Slot,{name:`dokan-before-${P}-dialog-content`,fillProps:{namespace:y}}),A||(0,l.jsxs)("div",{className:"flex items-start gap-4",children:[E||(0,l.jsx)("div",{className:"flex items-center justify-center shrink-0 w-12 h-12 bg-red-50 rounded-full",children:(0,l.jsx)(u,{})}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900 mb-1",dangerouslySetInnerHTML:{__html:_||(0,s.__)("Delete Confirmation","dokan-lite")}}),(0,l.jsx)("p",{className:"text-sm text-gray-500 leading-relaxed",dangerouslySetInnerHTML:{__html:k||(0,s.sprintf)((0,s.__)("Are you sure you want to proceed with this %1$sdeletion%2$s?","dokan-lite"),"<strong>","</strong>")}})]})]}),(0,l.jsx)(i.Slot,{name:`dokan-after-${P}-dialog-content`,fillProps:{namespace:y}})]}),!1===j?null:j||(0,l.jsx)("div",{className:(0,f.QP)("px-6 py-4 border-t border-gray-200 flex items-center justify-end gap-3",g),children:C||(0,l.jsxs)(l.Fragment,{children:[O||(0,l.jsx)(h.A,{onClick:n,variant:"secondary",disabled:I||T,children:x||(0,s.__)("Cancel","dokan-lite")}),(0,l.jsx)(h.A,{onClick:F,variant:L,loading:I||T,disabled:I||T||R,children:w||(0,s.__)("Yes, Delete","dokan-lite")})]})})]})}):null};n(1609);n(5795);"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;function g(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function v(e){return"nodeType"in e}function y(e){var t,n;return e?g(e)?e:v(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function b(e){const{Document:t}=y(e);return e instanceof t}function x(e){return!g(e)&&e instanceof y(e).HTMLElement}function w(e){return e instanceof y(e).SVGElement}function _(e){return e?g(e)?e.document:v(e)?b(e)?e:x(e)||w(e)?e.ownerDocument:document:document:document}function k(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,i]of r){const r=t[n];null!=r&&(t[n]=r+e*i)}return t},{...t})}}const N=k(-1);function E(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=y(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}var S;!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(S||(S={}));const j=Object.freeze({x:0,y:0});var C,A,T,L;!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(C||(C={}));class O{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function R(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}function D(e){e.preventDefault()}function M(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(A||(A={})),(L=T||(T={})).Space="Space",L.Down="ArrowDown",L.Right="ArrowRight",L.Left="ArrowLeft",L.Up="ArrowUp",L.Esc="Escape",L.Enter="Enter",L.Tab="Tab";T.Space,T.Enter,T.Esc,T.Space,T.Enter,T.Tab;function q(e){return Boolean(e&&"distance"in e)}function P(e){return Boolean(e&&"delay"in e)}class I{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=y(e);return e instanceof t?e:_(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:a}=i;this.props=e,this.events=t,this.document=_(a),this.documentListeners=new O(this.document),this.listeners=new O(n),this.windowListeners=new O(y(a)),this.initialCoordinates=null!=(r=E(i))?r:j,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(A.Resize,this.handleCancel),this.windowListeners.add(A.DragStart,D),this.windowListeners.add(A.VisibilityChange,this.handleCancel),this.windowListeners.add(A.ContextMenu,D),this.documentListeners.add(A.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(P(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(q(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(A.Click,M,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(A.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:o}}=i;if(!r)return;const s=null!=(t=E(e))?t:j,l=N(r,s);if(!n&&o){if(q(o)){if(null!=o.tolerance&&R(l,o.tolerance))return this.handleCancel();if(R(l,o.distance))return this.handleStart()}return P(o)&&R(l,o.tolerance)?this.handleCancel():void this.handlePending(o,l)}e.cancelable&&e.preventDefault(),a(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===T.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const B={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};(class extends I{constructor(e){const{event:t}=e,n=_(t.target);super(e,B,n)}}).activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const F={move:{name:"mousemove"},end:{name:"mouseup"}};var U;!function(e){e[e.RightClick=2]="RightClick"}(U||(U={})),class extends I{constructor(e){super(e,F,_(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==U.RightClick&&(null==r||r({event:n}),!0)}}];const z={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var $,H,V,W,G;(class extends I{constructor(e){super(e,z)}static setup(){return window.addEventListener(z.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(z.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return!(i.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}($||($={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(H||(H={})),C.Backward,C.Forward,C.Backward,C.Forward,function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(V||(V={})),function(e){e.Optimized="optimized"}(W||(W={})),V.WhileDragging,W.Optimized,Map,function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(G||(G={})),T.Down,T.Right,T.Up,T.Left,n(9284),n(8448);const Z=({className:e="",color:t="text-primary-500"})=>(0,l.jsxs)("svg",{width:"200",height:"187",viewBox:"0 0 200 187",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`${e} ${t}`,children:[(0,l.jsx)("path",{d:"M134.737 71.2776C120.543 71.2776 106.094 70.7016 92.5785 66.9409C79.3169 63.2649 67.1407 56.1332 56.2873 47.8834C49.1817 42.5134 42.7205 38.2445 33.4951 38.8882C24.4622 39.3822 15.8284 42.7678 8.87134 48.5441C-2.86394 58.7081 -1.10026 77.7317 3.59725 91.0974C10.652 111.222 32.1214 125.164 50.3688 134.277C71.4482 144.797 94.6135 150.896 117.83 154.419C138.18 157.502 164.33 159.755 181.967 146.474C198.162 134.277 202.605 106.428 198.637 87.6247C197.675 82.0648 194.714 77.0469 190.31 73.5136C178.931 65.213 161.956 70.7524 149.169 71.0404C144.421 71.142 139.587 71.2606 134.737 71.2776Z",fill:"#F3F2F2"}),(0,l.jsx)("path",{d:"M99.5098 187C133.892 187 161.765 185.254 161.765 183.101C161.765 180.947 133.892 179.201 99.5098 179.201C65.1273 179.201 37.2549 180.947 37.2549 183.101C37.2549 185.254 65.1273 187 99.5098 187Z",fill:"#F3F2F2"}),(0,l.jsx)("path",{d:"M163.726 50.522V58.3207",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M159.804 54.4214H167.647",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M41.1763 111.937V118.761",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M37.2549 115.836H45.098",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M30.3921 20.3018V28.1006",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M27.4507 24.2012H34.3134",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M110.294 3.72952C111.106 3.72952 111.764 3.07484 111.764 2.26726C111.764 1.45967 111.106 0.804993 110.294 0.804993C109.482 0.804993 108.823 1.45967 108.823 2.26726C108.823 3.07484 109.482 3.72952 110.294 3.72952Z",fill:"#DDDDDD"}),(0,l.jsx)("path",{d:"M106.372 164.579C107.185 164.579 107.843 163.924 107.843 163.116C107.843 162.309 107.185 161.654 106.372 161.654C105.56 161.654 104.902 162.309 104.902 163.116C104.902 163.924 105.56 164.579 106.372 164.579Z",fill:"#DDDDDD"}),(0,l.jsx)("path",{d:"M142.088 11.6192L45.3378 21.6116C43.1293 21.8397 41.5248 23.8049 41.7542 26.0009L54.9863 152.672C55.2157 154.868 57.1921 156.463 59.4006 156.235L156.151 146.243C158.359 146.014 159.964 144.049 159.734 141.853L146.502 15.1824C146.273 12.9864 144.297 11.391 142.088 11.6192Z",fill:"#D2D2D2"}),(0,l.jsx)("path",{d:"M137.924 17.4661L50.6059 26.4844C48.3973 26.7125 46.7929 28.6777 47.0223 30.8737L58.989 145.431C59.2184 147.627 61.1948 149.222 63.4033 148.994L150.722 139.976C152.93 139.748 154.535 137.783 154.305 135.587L142.338 21.0294C142.109 18.8333 140.133 17.238 137.924 17.4661Z",fill:"white",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M122.534 23.1959L121.175 9.99418C121.107 9.44623 120.828 8.94711 120.399 8.60408C119.97 8.26105 119.425 8.10148 118.88 8.15966L102.701 9.87416C102.569 8.55702 102.182 7.27895 101.561 6.11291C100.939 4.94687 100.096 3.91569 99.0801 3.07827C98.0637 2.24084 96.8939 1.61357 95.6372 1.23225C94.3806 0.850927 93.0618 0.723035 91.7562 0.855874C90.4506 0.988714 89.1837 1.37968 88.0279 2.00646C86.872 2.63323 85.8499 3.48354 85.0198 4.50883C83.3433 6.57949 82.5509 9.2372 82.8168 11.8973L66.5865 13.6118C66.313 13.6396 66.0476 13.7216 65.8056 13.8531C65.5635 13.9845 65.3495 14.1629 65.1759 14.3779C65.0022 14.5929 64.8723 14.8403 64.7936 15.106C64.7149 15.3717 64.6889 15.6505 64.7171 15.9264L66.0767 29.128C66.1043 29.404 66.1856 29.6717 66.3159 29.9159C66.4462 30.1601 66.623 30.3759 66.8361 30.5511C67.0492 30.7263 67.2945 30.8574 67.5579 30.9368C67.8212 31.0162 68.0976 31.0425 68.371 31.014L120.682 25.5276C120.956 25.4999 121.223 25.4173 121.465 25.2845C121.707 25.1518 121.921 24.9715 122.094 24.7544C122.266 24.5372 122.394 24.2875 122.47 24.0199C122.545 23.7523 122.567 23.4721 122.534 23.1959Z",fill:"white",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M80.3921 102.189C80.9481 97.2166 83.212 92.5823 86.8073 89.0565C90.4025 85.5307 95.1124 83.326 100.154 82.8091C105.195 82.2922 110.263 83.4942 114.516 86.2152C118.769 88.9362 121.95 93.0122 123.529 97.7652",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M83.3334 63.1949L75.4902 73.9182",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M74.5098 64.1698L84.3137 72.9434",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M122.549 59.2956L114.706 69.044",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M113.726 60.2704L123.53 69.044",stroke:"#9E9FA5",strokeLinecap:"round",strokeLinejoin:"round"})]}),K=({children:e,onRefresh:t,title:n=(0,s.__)("Oh no! Something went wrong…","dokan-lite"),message:r=(0,s.__)("Kindly refresh the page to load data or try again.","dokan-lite")})=>(0,l.jsx)(l.Fragment,{children:e||(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"bg-no-repeat bg-center w-full bg-cover h-[21rem] ",children:[(0,l.jsx)(i.Slot,{name:"before-dokan-internal-error"}),(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[(0,l.jsx)(Z,{color:"text-dokan-link w-44"}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center",children:[(0,l.jsx)("h1",{className:"text-xl font-bold text-center tracking-wide leading-6",children:n}),(0,l.jsx)("p",{className:"max-w-[23rem] text-center font-normal leading-5 text-[#637381]",children:r}),(0,l.jsx)(h.O,{onClick:t,variant:"primary",className:"w-[10.5rem] mt-2 py-2 px-[18px]",children:(0,s.__)("Try Again","dokan-lite")})]})]}),(0,l.jsx)(i.Slot,{name:"after-dokan-internal-error"})]})})});var Y=n(2619),X=n(8446);const Q=e=>{const{components:t}=X.ReactSelect,{selectProps:n,hasValue:r}=e;if(!Boolean(n?.isMulti))return(0,l.jsx)(t.ValueContainer,{...e});const i=(n?.value||[]).map(e=>{var t;return null!==(t=e?.label)&&void 0!==t?t:""}),a=n?.selectedTitle,o=i.join(", ");return(0,l.jsxs)(t.ValueContainer,{...e,children:[r?(0,l.jsxs)("div",{className:"break-all text-[14px] leading-[22px] text-gray-700",children:[a?(0,l.jsx)("span",{className:"font-normal",children:`${String(a)}: `}):null,(0,l.jsx)("span",{className:"align-middle",title:o,children:o})]}):null,e.children]})};var J=n(5773);const ee=e=>{const{components:t}=X.ReactSelect,{isSelected:n,isDisabled:r}=e;return e.isMulti?(0,l.jsx)(t.Option,{...e,children:(0,l.jsx)("div",{className:"dokan-layout",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"inline-flex h-4 w-4 items-center justify-center rounded border "+(n?"bg-dokan-btn border-dokan-btn-border":"bg-white border-gray-300")+(r?" opacity-50":""),children:(0,l.jsx)(J.A,{size:16,color:"white"})}),(0,l.jsx)("span",{children:e.label})]})})}):(0,l.jsx)(t.Option,{...e})},te=e=>{const{components:t}=X.ReactSelect;return Boolean(e?.selectProps?.isMulti)?null:(0,l.jsx)(t.MultiValue,{...e})},ne=e=>{const{components:t}=X.ReactSelect,{selectProps:n,data:r}=e,i=Boolean(n?.isMulti),a=n?.selectedTitle;let o=e.children;if(!i&&a&&r){var s;const e="function"==typeof a?a(r):a,t=null!==(s=r?.label)&&void 0!==s?s:o;o=e?(0,l.jsxs)("span",{title:`${e}: ${t}`,children:[e,": ",t]}):(0,l.jsx)("span",{title:`${t}`,children:t})}return(0,l.jsx)(t.SingleValue,{...e,children:o})},re=e=>{var t;const{children:n,selectProps:r}=e,{components:i}=X.ReactSelect,a=r.icon,o=null!==(t=r.iconPosition)&&void 0!==t?t:"left";return(0,l.jsxs)(i.Control,{...e,children:[a&&"left"===o?(0,l.jsx)("span",{className:"!flex !items-center !ml-[15px]",children:a}):null,(0,l.jsx)("div",{className:(0,f.QP)("flex flex-1",a&&"left"===o?"ml-1.5":"ml-0",a&&"right"===o?"mr-1.5":"mr-0"),children:n}),a&&"right"===o?(0,l.jsx)("span",{className:"!flex !items-center !mr-[15px]",children:a}):null]})};var ie=n(5107);const ae=e=>{const{components:t}=X.ReactSelect;return(0,l.jsx)(t.DropdownIndicator,{...e,children:(0,l.jsx)("div",{className:"text-gray-400",children:(0,l.jsx)(ie.A,{size:16})})})},oe={control:e=>({...e,borderRadius:"0.40rem",minHeight:"2.5rem",boxShadow:"none",marginTop:0,outline:"none",":focus":{outline:"none"},":focus-within":{outline:"none"},borderColor:e.borderColor}),placeholder:e=>({...e,fontSize:14,lineHeight:"22px"}),singleValue:e=>({...e,fontSize:14,lineHeight:"22px"}),input:e=>({...e,fontSize:14,lineHeight:"22px",marginTop:1,marginBottom:1}),valueContainer:e=>({...e,paddingLeft:4}),indicatorsContainer:e=>({...e,cursor:"pointer"}),menuPortal:e=>({...e,zIndex:999999,wordBreak:"break-all",minWidth:"18.75rem"}),menu:e=>({...e,zIndex:999999,wordBreak:"break-all"}),menuList:e=>({...e,cursor:"default"}),option:(e,t)=>({...e,cursor:t.isDisabled?"not-allowed":"pointer",backgroundColor:t.isSelected?"var(--colors-primary-50)":e.backgroundColor,":active":{...e[":active"],backgroundColor:t.isSelected?"var(--colors-primary-100)":e[":active"]?.backgroundColor},":hover":{...e[":hover"],backgroundColor:t.isSelected?"var(--colors-primary-200)":e[":hover"]?.backgroundColor},color:t.isSelected?"var(--colors-primary-800)":e.color})},se=function(e){var t,n,r,i,a,o;const s=(()=>{if("undefined"==typeof document)return;const e="dokan-select-menu-portal";let t=document.getElementById(e);return t||(t=document.createElement("div"),t.id=e,t.className="dokan-layout",document.body.appendChild(t)),t})();return(0,l.jsx)(X.AsyncSearchableSelect,{components:{Control:re,DropdownIndicator:ae,SingleValue:ne,ValueContainer:Q,MultiValue:te,Option:ee,...e?.components?e.components:{}},styles:oe,className:(0,f.QP)("shadow-none",e?.className),classNamePrefix:null!==(t=e.classNamePrefix)&&void 0!==t?t:"react-select",blurInputOnSelect:null===(n=e.blurInputOnSelect)||void 0===n||n,closeMenuOnSelect:null===(r=e.closeMenuOnSelect)||void 0===r||r,hideSelectedOptions:null!==(i=e.hideSelectedOptions)&&void 0!==i&&i,menuPortalTarget:null!==(a=e.menuPortalTarget)&&void 0!==a?a:s,menuPosition:null!==(o=e.menuPosition)&&void 0!==o?o:"fixed",...e})};n(1455),n(3832),n(4460),n(2106);var le=n(8443);const ce=e=>{var t,n,r,a,c,d,u;const[p,m]=(0,o.useState)(),[g,v]=(0,o.useState)(!1),y={...e,onChange:t=>{v(!1),e?.onChange&&e.onChange(t)}};return(0,l.jsxs)("div",{className:null!==(t=e?.wrapperClassName)&&void 0!==t?t:"",children:[(0,l.jsx)("div",{className:null!==(n=e?.pickerToggleClassName)&&void 0!==n?n:"",onClick:()=>v(!g),ref:m,role:"button",children:null!==(r=e.children)&&void 0!==r?r:(0,l.jsx)(X.SimpleInput,{onChange:()=>{},value:e?.currentDate?(0,le.dateI18n)((0,le.getSettings)().formats.date,e?.currentDate,(0,le.getSettings)().timezone.string):"",input:{id:null!==(a=e?.inputId)&&void 0!==a?a:"dokan-date-time-picker-input",name:null!==(c=e?.inputName)&&void 0!==c?c:"dokan_date_time_picker_input",type:"text",autoComplete:"off",placeholder:(0,s.__)("Enter Date","dokan-lite")}})}),g&&(0,l.jsx)(i.Popover,{animate:!0,anchor:p,focusOnMount:!0,className:(0,f.QP)(null!==(d=e?.wpPopoverClassName)&&void 0!==d?d:"","dokan-layout"),onClose:()=>{v(!1)},onFocusOutside:()=>{v(!1)},children:(0,l.jsxs)("div",{className:(0,f.QP)("p-4 w-auto text-sm/6",null!==(u=e?.popoverBodyClassName)&&void 0!==u?u:""),children:[(0,l.jsx)(i.DateTimePicker,{...y}),(0,l.jsxs)("div",{className:"mt-2 flex flex-row gap-2",children:[(0,l.jsx)(h.A,{size:"sm",onClick:()=>{v(!1),e?.onClear?e.onClear():y.onChange("")},children:(0,s.__)("Clear","dokan-lite")}),e?.onOk?(0,l.jsx)(h.A,{size:"sm",onClick:()=>{v(!1),e.onOk&&e.onOk()},children:(0,s.__)("Ok","dokan-lite")}):null]})]})})]})};n(231);var de=n(3078);n(217),n(5620);const ue=e=>{var t,n,r,i;if(!e.namespace)throw new Error("Namespace is required for the DokanMaskedInput component");const o=null!==(t=window?.dokanFrontend?.currency?.symbol)&&void 0!==t?t:"",c={label:(0,s.__)("Amount","dokan-lite"),className:"focus:border-none",maskRule:{numeral:!0,numeralPositiveOnly:!0,numeralDecimalMark:null!==(n=window?.dokanFrontend?.currency?.decimal)&&void 0!==n?n:".",delimiter:null!==(r=window?.dokanFrontend?.currency?.thousand)&&void 0!==r?r:",",numeralDecimalScale:null!==(i=window?.dokanFrontend?.currency?.precision)&&void 0!==i?i:2,...e.maskRule},input:{id:"amount",name:"amount",type:"text",placeholder:(0,s.__)("Enter amount","dokan-lite"),required:!0,disabled:!1,...e.input},showAddOn:!0,...e};var d;if(c?.showAddOn)switch(null!==(d=window?.dokanFrontend?.currency?.position)&&void 0!==d?d:"left"){case"left":case"left_space":c.addOnLeft=o,c.className=(0,f.QP)("rounded-l-none",c.className);break;case"right":case"right_space":c.addOnRight=o,c.className=(0,f.QP)("rounded-r-none",c.className)}const u=(0,a.snakeCase)(e.namespace),h=(0,Y.applyFilters)(`dokan_${u}_price_input_props`,c,o),p=(0,a.kebabCase)(e.namespace);return(0,l.jsx)("div",{id:`dokan-${p}-price-input`,className:"dokan-price-input",children:(0,l.jsx)(X.MaskedInput,{...h,onChange:e=>{const t=e.target.value,n=(0,a.unformatNumber)(t);h.onChange(t,n)}})})};var he=n(8468),fe=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(fe||{});class pe{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const r=fe.TYPE&fe.ATTRIBUTE;this.scope=null!=n.scope?n.scope&fe.LEVEL|r:fe.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(e=>e.name)}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class me extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const ge=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){const i=this.query(n);if(null==i)throw new me(`Unable to create ${n} blot`);const a=i,o=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),s=new a(t,o,r);return e.blots.set(s.domNode,s),s}find(t,n=!1){return e.find(t,n)}query(e,t=fe.ANY){let n;return"string"==typeof e?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof e?e&fe.LEVEL&fe.BLOCK?n=this.types.block:e&fe.LEVEL&fe.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(e=>(n=this.classes[e],!!n)),n=n||this.tags[e.tagName]),null==n?null:"scope"in n&&t&fe.LEVEL&n.scope&&t&fe.TYPE&n.scope?n:null}register(...e){return e.map(e=>{const t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new me("Invalid definition");if(t&&"abstract"===e.blotName)throw new me("Cannot register abstract class");const r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(e=>e.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)}))),e})}};ge.blots=new WeakMap;let ve=ge;function ye(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(e=>0===e.indexOf(`${t}-`))}const be=class extends pe{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){ye(e,this.keyName).forEach(t=>{e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(ye(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function xe(e){const t=e.split("-"),n=t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join("");return t[0]+n}const we=class extends pe{static keys(e){return(e.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(e,t){return!!this.canAdd(e,t)&&(e.style[xe(this.keyName)]=t,!0)}remove(e){e.style[xe(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[xe(this.keyName)];return this.canAdd(e,t)?t:""}},_e=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=ve.find(this.domNode);if(null==e)return;const t=pe.keys(this.domNode),n=be.keys(this.domNode),r=we.keys(this.domNode);t.concat(n).concat(r).forEach(t=>{const n=e.scroll.query(t,fe.ATTRIBUTE);n instanceof pe&&(this.attributes[n.attrName]=n)})}copy(e){Object.keys(this.attributes).forEach(t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}},ke=class{constructor(e,t){this.scroll=e,this.domNode=t,ve.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new me("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?("string"==typeof e?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof e&&(n=e),t="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),ve.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){const i=this.isolate(e,t);if(null!=this.scroll.query(n,fe.BLOT)&&r)i.wrap(n,r);else if(null!=this.scroll.query(n,fe.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);i.wrap(e),e.format(n,r)}}insertAt(e,t,n){const r=null==n?this.scroll.create("text",t):this.scroll.create(t,n),i=this.split(e);this.parent.insertBefore(r,i||void 0)}isolate(e,t){const n=this.split(e);if(null==n)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new me(`Cannot wrap ${e}`);return n.appendChild(this),n}};ke.blotName="abstract";let Ne=ke;const Ee=class extends Ne{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Ee.scope=fe.INLINE_BLOT;const Se=Ee;class je{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let r=n();for(;r;){const i=r.length();if(e<i||t&&e===i&&(null==r.next||0!==r.next.length()))return[r,e];e-=i,r=n()}return[null,0]}forEach(e){const t=this.iterator();let n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;const[r,i]=this.find(e);let a=e-i;const o=this.iterator(r);let s=o();for(;s&&a<e+t;){const r=s.length();e>a?n(s,e-a,Math.min(t,a+r-e)):n(s,0,Math.min(r,e+t-a)),a+=r,s=o()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){const n=this.iterator();let r=n();for(;r;)t=e(t,r),r=n();return t}}function Ce(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const n=t.create(fe.INLINE);return Array.from(e.childNodes).forEach(e=>{n.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}const Ae=class e extends Ne{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new je,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Ce(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof me)return;throw e}})}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,(e,t,n)=>{e.deleteAt(t,n)})}descendant(t,n=0){const[r,i]=this.children.find(n);return null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t?[r,i]:r instanceof e?r.descendant(t,i):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let i=[],a=r;return this.children.forEachAt(n,r,(n,r,o)=>{(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&i.push(n),n instanceof e&&(i=i.concat(n.descendants(t,r,a))),a-=o}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(n=>{t||this.statics.allowedChildren.some(e=>n instanceof e)||(n.statics.scope===fe.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())})}formatAt(e,t,n,r){this.children.forEachAt(e,t,(e,t,i)=>{e.formatAt(t,i,n,r)})}insertAt(e,t,n){const[r,i]=this.children.find(e);if(r)r.insertAt(i,t,n);else{const e=null==n?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(n=>{e.insertBefore(n,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){const[r,i]=this.children.find(t,n),a=[[this,t]];return r instanceof e?a.concat(r.path(i,n)):(null!=r&&a.push([r,i]),a)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const r="string"==typeof t?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),(e,r,i)=>{const a=e.split(r,t);null!=a&&n.appendChild(a)}),n}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],r=[];e.forEach(e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),r.push(...e.removedNodes))}),r.forEach(e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()}),n.filter(e=>e.parentNode===this.domNode&&e!==this.uiNode).sort((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const n=Ce(e,this.scroll);(n.next!==t||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))}),this.enforceAllowedChildren()}};Ae.uiClass="";const Te=Ae,Le=class e extends Te{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new _e(this.domNode)}format(t,n){if(t!==this.statics.blotName||n){const e=this.scroll.query(t,fe.INLINE);if(null==e)return;e instanceof pe?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}else this.children.forEach(t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)}),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.formats()[n]||this.scroll.query(n,fe.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof e&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&"attributes"===e.type)&&this.attributes.build()}wrap(t,n){const r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};Le.allowedChildren=[Le,Se],Le.blotName="inline",Le.scope=fe.INLINE_BLOT,Le.tagName="SPAN";const Oe=Le,Re=class e extends Te{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new _e(this.domNode)}format(t,n){const r=this.scroll.query(t,fe.BLOCK);null!=r&&(r instanceof pe?this.attributes.attribute(r,n):t!==this.statics.blotName||n?n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){null!=this.scroll.query(n,fe.BLOCK)?this.format(n,r):super.formatAt(e,t,n,r)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,fe.INLINE))super.insertAt(e,t,n);else{const r=this.split(e);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&"attributes"===e.type)&&this.attributes.build()}};Re.blotName="block",Re.scope=fe.BLOCK_BLOT,Re.tagName="P",Re.allowedChildren=[Oe,Re,Se];const De=Re,Me=class extends Te{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Me.blotName="container",Me.scope=fe.BLOCK_BLOT;const qe=Me,Pe=class extends Se{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){0===e&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},Ie={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Be=class extends Te{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(e=>{this.update(e)}),this.observer.observe(this.domNode,Ie),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=fe.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach(e=>{e.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());const i=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&i(e.parent))},a=e=>{n.has(e.domNode)&&(e instanceof Te&&e.children.forEach(a),n.delete(e.domNode),e.optimize(t))};let o=e;for(let t=0;o.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(i(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach(e=>{const t=this.find(e,!1);i(t,!1),t instanceof Te&&t.children.forEach(e=>{i(e,!1)})})):"attributes"===e.type&&i(t.prev)),i(t))}),this.children.forEach(a),o=Array.from(this.observer.takeRecords()),r=o.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map(e=>{const t=this.find(e.target,!0);return null==t?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)}).forEach(e=>{null!=e&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Be.blotName="scroll",Be.defaultChild=De,Be.allowedChildren=[De,qe],Be.scope=fe.BLOCK_BLOT,Be.tagName="DIV";const Fe=Be,Ue=class e extends Se{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){null==n?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some(e=>"characterData"===e.type&&e.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Ue.blotName="text",Ue.scope=fe.INLINE_BLOT;const ze=Ue;var $e=n(2660);class He extends Pe{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}He.blotName="break",He.tagName="BR";const Ve=He;class We extends ze{}const Ge={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ze(e){return e.replace(/[&<>"']/g,e=>Ge[e])}class Ke extends Oe{static allowedChildren=[Ke,Ve,Pe,We];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const n=Ke.order.indexOf(e),r=Ke.order.indexOf(t);return n>=0||r>=0?n-r:e===t?0:e<t?-1:1}formatAt(e,t,n,r){if(Ke.compare(this.statics.blotName,n)<0&&this.scroll.query(n,fe.BLOT)){const i=this.isolate(e,t);r&&i.wrap(n,r)}else super.formatAt(e,t,n,r)}optimize(e){if(super.optimize(e),this.parent instanceof Ke&&Ke.compare(this.statics.blotName,this.parent.statics.blotName)>0){const e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}}const Ye=Ke;class Xe extends De{cache={};delta(){return null==this.cache.delta&&(this.cache.delta=Je(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,fe.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(null!=n)return super.insertAt(e,t,n),void(this.cache={});if(0===t.length)return;const r=t.split("\n"),i=r.shift();i.length>0&&(e<this.length()-1||null==this.children.tail?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;r.reduce((e,t)=>(a=a.split(e,!0),a.insertAt(0,t),t.length),e+i.length)}insertBefore(e,t){const{head:n}=this.children;super.insertBefore(e,t),n instanceof Ve&&n.remove(),this.cache={}}length(){return null==this.cache.length&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&(0===e||e>=this.length()-1)){const t=this.clone();return 0===e?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}const n=super.split(e,t);return this.cache={},n}}Xe.blotName="block",Xe.tagName="P",Xe.defaultChild=Ve,Xe.allowedChildren=[Ve,Ye,Pe,We];class Qe extends Pe{attach(){super.attach(),this.attributes=new _e(this.domNode)}delta(){return(new $e).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const n=this.scroll.query(e,fe.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(null!=n)return void super.insertAt(e,t,n);const r=t.split("\n"),i=r.pop(),a=r.map(e=>{const t=this.scroll.create(Xe.blotName);return t.insertAt(0,e),t}),o=this.split(e);a.forEach(e=>{this.parent.insertBefore(e,o)}),i&&this.parent.insertBefore(this.scroll.create("text",i),o)}}function Je(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.descendants(Se).reduce((e,n)=>0===n.length()?e:e.insert(n.value(),et(n,{},t)),new $e).insert("\n",et(e))}function et(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==e?t:("formats"in e&&"function"==typeof e.formats&&(t={...t,...e.formats()},n&&delete t["code-token"]),null==e.parent||"scroll"===e.parent.statics.blotName||e.parent.statics.scope!==e.statics.scope?t:et(e.parent,t,n))}Qe.scope=fe.BLOCK_BLOT;class tt extends Pe{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,n){super(e,t),this.selection=n,this.textNode=document.createTextNode(tt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){null!=this.parent&&this.parent.removeChild(this)}format(e,t){if(0!==this.savedLength)return void super.format(e,t);let n=this,r=0;for(;null!=n&&n.statics.scope!==fe.BLOCK_BLOT;)r+=n.offset(n.parent),n=n.parent;null!=n&&(this.savedLength=tt.CONTENTS.length,n.optimize(),n.formatAt(r,tt.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||null==this.parent)return null;const e=this.selection.getNativeRange();for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof We?this.prev:null,n=t?t.length():0,r=this.next instanceof We?this.next:null,i=r?r.text:"",{textNode:a}=this,o=a.data.split(tt.CONTENTS).join("");let s;if(a.data=tt.CONTENTS,t)s=t,(o||r)&&(t.insertAt(t.length(),o+i),r&&r.remove());else if(r)s=r,r.insertAt(0,o);else{const e=document.createTextNode(o);s=this.scroll.create(e),this.parent.insertBefore(s,this)}if(this.remove(),e){const i=(e,i)=>t&&e===t.domNode?i:e===a?n+i-1:r&&e===r.domNode?n+o.length+i:null,l=i(e.start.node,e.start.offset),c=i(e.end.node,e.end.offset);if(null!==l&&null!==c)return{startNode:s.domNode,startOffset:l,endNode:s.domNode,endOffset:c}}return null}update(e,t){if(e.some(e=>"characterData"===e.type&&e.target===this.textNode)){const e=this.restore();e&&(t.range=e)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if("A"===t.domNode.tagName){this.savedLength=tt.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}const nt=tt;var rt=n(228);const it=new WeakMap,at=["error","warn","log","info"];let ot="warn";function st(e){if(ot&&at.indexOf(e)<=at.indexOf(ot)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console[e](...n)}}function lt(e){return at.reduce((t,n)=>(t[n]=st.bind(console,n,e),t),{})}lt.level=e=>{ot=e},st.level=lt.level;const ct=lt,dt=ct("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(e=>{document.addEventListener(e,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.from(document.querySelectorAll(".ql-container")).forEach(e=>{const n=it.get(e);n&&n.emitter&&n.emitter.handleDOM(...t)})})});const ut=class extends rt{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",dt.error)}emit(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return dt.log.call(dt,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(this.domListeners[e.type]||[]).forEach(t=>{let{node:r,handler:i}=t;(e.target===r||r.contains(e.target))&&i(e,...n)})}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}},ht=ct("quill:selection");class ft{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.index=e,this.length=t}}function pt(e,t){try{t.parentNode}catch(e){return!1}return e.contains(t)}const mt=class{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new ft(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,ut.sources.USER),1)}),this.emitter.on(ut.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const e=this.getNativeRange();null!=e&&e.start.node!==this.cursor.textNode&&this.emitter.once(ut.events.SCROLL_UPDATE,(t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);const r=n.some(e=>"characterData"===e.type||"childList"===e.type||"attributes"===e.type&&e.target===this.root);this.update(r?ut.sources.SILENT:t)}catch(e){}})}),this.emitter.on(ut.events.SCROLL_OPTIMIZE,(e,t)=>{if(t.range){const{startNode:e,startOffset:n,endNode:r,endOffset:i}=t.range;this.setNativeRange(e,n,r,i),this.update(ut.sources.SILENT)}}),this.update(ut.sources.SILENT)}handleComposition(){this.emitter.on(ut.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(ut.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(ut.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!this.scroll.query(e,fe.BLOCK)){if(n.start.node!==this.cursor.textNode){const e=this.scroll.find(n.start.node,!1);if(null==e)return;if(e instanceof Se){const t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.scroll.length();let r;e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let[i,a]=this.scroll.leaf(e);if(null==i)return null;if(t>0&&a===i.length()){const[t]=this.scroll.leaf(e+1);if(t){const[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(i=t,a=0)}}[r,a]=i.position(a,!0);const o=document.createRange();if(t>0)return o.setStart(r,a),[i,a]=this.scroll.leaf(e+t),null==i?null:([r,a]=i.position(a,!0),o.setEnd(r,a),o.getBoundingClientRect());let s,l="left";if(r instanceof Text){if(!r.data.length)return null;a<r.data.length?(o.setStart(r,a),o.setEnd(r,a+1)):(o.setStart(r,a-1),o.setEnd(r,a),l="right"),s=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;s=i.domNode.getBoundingClientRect(),a>0&&(l="right")}return{bottom:s.top+s.height,height:s.height,left:s[l],right:s[l],top:s.top,width:0}}getNativeRange(){const e=document.getSelection();if(null==e||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(null==t)return null;const n=this.normalizeNative(t);return ht.info("getNativeRange",n),n}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||null!=document.activeElement&&pt(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const n=t.map(e=>{const[t,n]=e,r=this.scroll.find(t,!0),i=r.offset(this.scroll);return 0===n?i:r instanceof Se?i+r.index(t,n):i+r.length()}),r=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(r,...n);return new ft(i,r-i)}normalizeNative(e){if(!pt(this.root,e.startContainer)||!e.collapsed&&!pt(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1}e.node=t,e.offset=n}),t}rangeToNative(e){const t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);const[r,i]=this.scroll.leaf(e);return r?r.position(i,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(ht.info("setNativeRange",e,t,n,r),null!=e&&(null==this.root.parentNode||null==e.parentNode||null==n.parentNode))return;const a=document.getSelection();if(null!=a)if(null!=e){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(null==o||i||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e instanceof Element&&"BR"===e.tagName&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&"BR"===n.tagName&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);const i=document.createRange();i.setStart(e,t),i.setEnd(n,r),a.removeAllRanges(),a.addRange(i)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ut.sources.API;if("string"==typeof t&&(n=t,t=!1),ht.info("setRange",e),null!=e){const n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ut.sources.USER;const t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,he.isEqual)(t,this.lastRange)){if(!this.composing&&null!=r&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}const n=[ut.events.SELECTION_CHANGE,(0,he.cloneDeep)(this.lastRange),(0,he.cloneDeep)(t),e];this.emitter.emit(ut.events.EDITOR_CHANGE,...n),e!==ut.sources.SILENT&&this.emitter.emit(...n)}}},gt=/^[ -~]*$/;function vt(e,t,n){if(0===e.length){const[e]=xt(n.pop());return t<=0?`</li></${e}>`:`</li></${e}>${vt([],t-1,n)}`}const[{child:r,offset:i,length:a,indent:o,type:s},...l]=e,[c,d]=xt(s);if(o>t)return n.push(s),o===t+1?`<${c}><li${d}>${yt(r,i,a)}${vt(l,o,n)}`:`<${c}><li>${vt(e,t+1,n)}`;const u=n[n.length-1];if(o===t&&s===u)return`</li><li${d}>${yt(r,i,a)}${vt(l,o,n)}`;const[h]=xt(n.pop());return`</li></${h}>${vt(e,t-1,n)}`}function yt(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("html"in e&&"function"==typeof e.html)return e.html(t,n);if(e instanceof We)return Ze(e.value().slice(t,t+n)).replaceAll(" "," ");if(e instanceof Te){if("list-container"===e.statics.blotName){const r=[];return e.children.forEachAt(t,n,(e,t,n)=>{const i="formats"in e&&"function"==typeof e.formats?e.formats():{};r.push({child:e,offset:t,length:n,indent:i.indent||0,type:i.list})}),vt(r,-1,[])}const i=[];if(e.children.forEachAt(t,n,(e,t,n)=>{i.push(yt(e,t,n))}),r||"list"===e.statics.blotName)return i.join("");const{outerHTML:a,innerHTML:o}=e.domNode,[s,l]=a.split(`>${o}<`);return"<table"===s?`<table style="border: 1px solid #000;">${i.join("")}<${l}`:`${s}>${i.join("")}<${l}`}return e.domNode instanceof Element?e.domNode.outerHTML:""}function bt(e,t){return Object.keys(t).reduce((n,r)=>{if(null==e[r])return n;const i=t[r];return i===e[r]?n[r]=i:Array.isArray(i)?i.indexOf(e[r])<0?n[r]=i.concat([e[r]]):n[r]=i:n[r]=[i,e[r]],n},{})}function xt(e){const t="ordered"===e?"ol":"ul";switch(e){case"checked":return[t,' data-list="checked"'];case"unchecked":return[t,' data-list="unchecked"'];default:return[t,""]}}function wt(e){return e.reduce((e,t)=>{if("string"==typeof t.insert){const n=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(n,t.attributes)}return e.push(t)},new $e)}function _t(e,t){let{index:n,length:r}=e;return new ft(n+t,r)}const kt=class{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const n=wt(e),r=new $e;return function(e){const t=[];return e.forEach(e=>{"string"==typeof e.insert?e.insert.split("\n").forEach((n,r)=>{r&&t.push({insert:"\n",attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}(n.ops.slice()).reduce((e,n)=>{const i=$e.Op.length(n);let a=n.attributes||{},o=!1,s=!1;if(null!=n.insert){if(r.retain(i),"string"==typeof n.insert){const r=n.insert;s=!r.endsWith("\n")&&(t<=e||!!this.scroll.descendant(Qe,e)[0]),this.scroll.insertAt(e,r);const[i,o]=this.scroll.line(e);let l=(0,he.merge)({},et(i));if(i instanceof Xe){const[e]=i.descendant(Se,o);e&&(l=(0,he.merge)(l,et(e)))}a=$e.AttributeMap.diff(l,a)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return e;const i=null!=this.scroll.query(r,fe.INLINE);if(i)(t<=e||this.scroll.descendant(Qe,e)[0])&&(s=!0);else if(e>0){const[t,n]=this.scroll.descendant(Se,e-1);t instanceof We?"\n"!==t.value()[n]&&(o=!0):t instanceof Pe&&t.statics.scope===fe.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),i){const[t]=this.scroll.descendant(Se,e);if(t){const e=(0,he.merge)({},et(t));a=$e.AttributeMap.diff(e,a)||{}}}}t+=i}else if(r.push(n),null!==n.retain&&"object"==typeof n.retain){const t=Object.keys(n.retain)[0];if(null==t)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(a).forEach(t=>{this.scroll.formatAt(e,i,t,a[t])});const l=o?1:0,c=s?1:0;return t+=l+c,r.retain(l),r.delete(c),e+i+l+c},0),r.reduce((e,t)=>"number"==typeof t.delete?(this.scroll.deleteAt(e,t.delete),e):e+$e.Op.length(t),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new $e).retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(r=>{this.scroll.lines(e,Math.max(t,1)).forEach(e=>{e.format(r,n[r])})}),this.scroll.optimize();const r=(new $e).retain(e).retain(t,(0,he.cloneDeep)(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t,r,n[r])});const r=(new $e).retain(e).retain(t,(0,he.cloneDeep)(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new $e)}getFormat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach(e=>{const[t]=e;t instanceof Xe?n.push(t):t instanceof Se&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(Se,e,t));const[i,a]=[n,r].map(e=>{const t=e.shift();if(null==t)return{};let n=et(t);for(;Object.keys(n).length>0;){const t=e.shift();if(null==t)return n;n=bt(et(t),n)}return n});return{...i,...a}}getHTML(e,t){const[n,r]=this.scroll.line(e);if(n){const i=n.length();return n.length()>=r+t&&(0!==r||t!==i)?yt(n,r,t,!0):yt(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(e=>"string"==typeof e.insert).map(e=>e.insert).join("")}insertContents(e,t){const n=wt(t),r=(new $e).retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new $e).retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t.length,r,n[r])}),this.update((new $e).retain(e).insert(t,(0,he.cloneDeep)(n)))}isBlank(){if(0===this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==Xe.blotName)return!1;const t=e;return!(t.children.length>1)&&t.children.head instanceof Ve}removeFormat(e,t){const n=this.getText(e,t),[r,i]=this.scroll.line(e+t);let a=0,o=new $e;null!=r&&(a=r.length()-i,o=r.delta().slice(i,i+a-1).insert("\n"));const s=this.getContents(e,t+a).diff((new $e).insert(n).concat(o)),l=(new $e).retain(e).concat(s);return this.applyDelta(l)}update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(gt)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=et(i),o=i.offset(this.scroll),s=t[0].oldValue.replace(nt.CONTENTS,""),l=(new $e).insert(s),c=(new $e).insert(i.value()),d=n&&{oldRange:_t(n.oldRange,-o),newRange:_t(n.newRange,-o)};e=(new $e).retain(o).concat(l.diff(c,d)).reduce((e,t)=>t.insert?e.insert(t.insert,a):e.push(t),new $e),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&(0,he.isEqual)(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}},Nt=class{static DEFAULTS={};constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.quill=e,this.options=t}},Et="\ufeff",St=class extends Pe{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(e=>{this.contentNode.appendChild(e)}),this.leftGuard=document.createTextNode(Et),this.rightGuard=document.createTextNode(Et),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t,n=null;const r=e.data.split(Et).join("");if(e===this.leftGuard)if(this.prev instanceof We){const e=this.prev.length();this.prev.insertAt(e,r),n={startNode:this.prev.domNode,startOffset:e+r.length}}else t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this),n={startNode:t,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof We?(this.next.insertAt(0,r),n={startNode:this.next.domNode,startOffset:r.length}):(t=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(t),this.next),n={startNode:t,startOffset:r.length}));return e.data=Et,n}update(e,t){e.forEach(e=>{if("characterData"===e.type&&(e.target===this.leftGuard||e.target===this.rightGuard)){const n=this.restore(e.target);n&&(t.range=n)}})}},jt=class{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;!t||t instanceof St||(this.emitter.emit(ut.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(ut.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(ut.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(ut.events.COMPOSITION_END,e),this.isComposing=!1}};class Ct{static DEFAULTS={modules:{}};static themes={default:Ct};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{null==this.modules[e]&&this.addModule(e)})}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const At=Ct,Tt=e=>e.parentElement||e.getRootNode().host||null,Lt=e=>{const t=e.getBoundingClientRect(),n="offsetWidth"in e&&Math.abs(t.width)/e.offsetWidth||1,r="offsetHeight"in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},Ot=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:t},Rt=(e,t,n,r,i,a)=>e<n&&t>r?0:e<n?-(n-e+i):t>r?t-e>r-n?e+i-n:t-r+a:0,Dt=["block","break","cursor","inline","scroll","text"],Mt=ct("quill"),qt=new ve;Te.uiClass="ql-ui";class Pt{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:qt,theme:"default"};static events=ut.events;static sources=ut.sources;static version="2.0.3";static imports={delta:$e,parchment:r,"core/module":Nt,"core/theme":At};static debug(e){!0===e&&(e="log"),ct.level(e)}static find(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return it.get(e)||qt.find(e,t)}static import(e){return null==this.imports[e]&&Mt.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if("string"!=typeof(arguments.length<=0?void 0:arguments[0])){const e=arguments.length<=0?void 0:arguments[0],t=!!(arguments.length<=1?void 0:arguments[1]),n="attrName"in e?e.attrName:e.blotName;"string"==typeof n?this.register(`formats/${n}`,e,t):Object.keys(e).forEach(n=>{this.register(n,e[n],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(arguments.length<=2?void 0:arguments[2]);null==this.imports[e]||n||Mt.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&"boolean"!=typeof t&&"abstract"!==t.blotName&&qt.register(t),"function"==typeof t.register&&t.register(qt)}}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.options=function(e,t){const n=It(e);if(!n)throw new Error("Invalid Quill container");const r=!t.theme||t.theme===Pt.DEFAULTS.theme?At:Pt.import(`themes/${t.theme}`);if(!r)throw new Error(`Invalid theme ${t.theme}. Did you register it?`);const{modules:i,...a}=Pt.DEFAULTS,{modules:o,...s}=r.DEFAULTS;let l=Bt(t.modules);null!=l&&l.toolbar&&l.toolbar.constructor!==Object&&(l={...l,toolbar:{container:l.toolbar}});const c=(0,he.merge)({},Bt(i),Bt(o),l),d={...a,...Ft(s),...Ft(t)};let u=t.registry;return u?t.formats&&Mt.warn('Ignoring "formats" option because "registry" is specified'):u=t.formats?((e,t,n)=>{const r=new ve;return Dt.forEach(e=>{const n=t.query(e);n&&r.register(n)}),e.forEach(e=>{let i=t.query(e);i||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>100){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}}),r})(t.formats,d.registry,Mt):d.registry,{...d,registry:u,container:n,theme:r,modules:Object.entries(c).reduce((e,t)=>{let[n,r]=t;if(!r)return e;const i=Pt.import(`modules/${n}`);return null==i?(Mt.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:(0,he.merge)({},i.DEFAULTS||{},r)}},{}),bounds:It(d.bounds)}}(e,t),this.container=this.options.container,null==this.container)return void Mt.error("Invalid Quill container",e);this.options.debug&&Pt.debug(this.options.debug);const n=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",it.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new ut;const r=Fe.blotName,i=this.options.registry.query(r);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${r}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new kt(this.scroll),this.selection=new mt(this.scroll,this.emitter),this.composition=new jt(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(ut.events.EDITOR_CHANGE,e=>{e===ut.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(ut.events.SCROLL_UPDATE,(e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),i=n&&r?{oldRange:n,newRange:r}:void 0;Ut.call(this,()=>this.editor.update(null,t,i),e)}),this.emitter.on(ut.events.SCROLL_EMBED_UPDATE,(e,t)=>{const n=this.selection.lastRange,[r]=this.selection.getRange(),i=n&&r?{oldRange:n,newRange:r}:void 0;Ut.call(this,()=>{const n=(new $e).retain(e.offset(this)).retain({[e.statics.blotName]:t});return this.editor.update(n,[],i)},Pt.sources.USER)}),n){const e=this.clipboard.convert({html:`${n}<p><br></p>`,text:"\n"});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){const t=e;(e=document.createElement("div")).classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=zt(e,t,n),Ut.call(this,()=>this.editor.deleteText(e,t),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ut.sources.API;return Ut.call(this,()=>{const n=this.getSelection(!0);let r=new $e;if(null==n)return r;if(this.scroll.query(e,fe.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else{if(0===n.length)return this.selection.format(e,t),r;r=this.editor.formatText(n.index,n.length,{[e]:t})}return this.setSelection(n,ut.sources.SILENT),r},n)}formatLine(e,t,n,r,i){let a;return[e,t,a,i]=zt(e,t,n,r,i),Ut.call(this,()=>this.editor.formatLine(e,t,a),i,e,0)}formatText(e,t,n,r,i){let a;return[e,t,a,i]=zt(e,t,n,r,i),Ut.call(this,()=>this.editor.formatText(e,t,a),i,e,0)}getBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(n="number"==typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;const r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e;return[e,t]=zt(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=zt(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return"number"==typeof e&&(t=t??this.getLength()-e),[e,t]=zt(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pt.sources.API;return Ut.call(this,()=>this.editor.insertEmbed(e,t,n),r,e)}insertText(e,t,n,r,i){let a;return[e,,a,i]=zt(e,0,n,r,i),Ut.call(this,()=>this.editor.insertText(e,t,a),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=zt(e,t,n),Ut.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){((e,t)=>{const n=e.ownerDocument;let r=t,i=e;for(;i;){const e=i===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:Lt(i),a=getComputedStyle(i),o=Rt(r.left,r.right,t.left,t.right,Ot(a.scrollPaddingLeft),Ot(a.scrollPaddingRight)),s=Rt(r.top,r.bottom,t.top,t.bottom,Ot(a.scrollPaddingTop),Ot(a.scrollPaddingBottom));if(o||s)if(e)n.defaultView?.scrollBy(o,s);else{const{scrollLeft:e,scrollTop:t}=i;s&&(i.scrollTop+=s),o&&(i.scrollLeft+=o);const n=i.scrollLeft-e,a=i.scrollTop-t;r={left:r.left-n,top:r.top-a,right:r.right-n,bottom:r.bottom-a}}i=e||"fixed"===a.position?null:Tt(i)}})(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ut.sources.API;return Ut.call(this,()=>{e=new $e(e);const t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)},t)}setSelection(e,t,n){null==e?this.selection.setRange(null,t||Pt.sources.API):([e,t,,n]=zt(e,t,n),this.selection.setRange(new ft(Math.max(0,e),t),n),n!==ut.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ut.sources.API;const n=(new $e).insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ut.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ut.sources.API;return Ut.call(this,()=>(e=new $e(e),this.editor.applyDelta(e)),t,!0)}}function It(e){return"string"==typeof e?document.querySelector(e):e}function Bt(e){return Object.entries(e??{}).reduce((e,t)=>{let[n,r]=t;return{...e,[n]:!0===r?{}:r}},{})}function Ft(e){return Object.fromEntries(Object.entries(e).filter(e=>void 0!==e[1]))}function Ut(e,t,n,r){if(!this.isEnabled()&&t===ut.sources.USER&&!this.allowReadOnlyEdits)return new $e;let i=null==n?null:this.getSelection();const a=this.editor.delta,o=e();if(null!=i&&(!0===n&&(n=i.index),null==r?i=$t(i,o,t):0!==r&&(i=$t(i,n,r,t)),this.setSelection(i,ut.sources.SILENT)),o.length()>0){const e=[ut.events.TEXT_CHANGE,o,a,t];this.emitter.emit(ut.events.EDITOR_CHANGE,...e),t!==ut.sources.SILENT&&this.emitter.emit(...e)}return o}function zt(e,t,n,r,i){let a={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(i=r,r=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(i=r,r=n,n=t,t=0),"object"==typeof n?(a=n,i=r):"string"==typeof n&&(null!=r?a[n]=r:i=n),[e,t,a,i=i||ut.sources.API]}function $t(e,t,n,r){const i="number"==typeof n?n:0;if(null==e)return null;let a,o;return t&&"function"==typeof t.transformPosition?[a,o]=[e.index,e.index+e.length].map(e=>t.transformPosition(e,r!==ut.sources.USER)):[a,o]=[e.index,e.index+e.length].map(e=>e<t||e===t&&r===ut.sources.USER?e:i>=0?e+i:Math.max(t,e+i)),new ft(a,o-a)}const Ht=class extends qe{};function Vt(e){return e instanceof Xe||e instanceof Qe}function Wt(e){return"function"==typeof e.updateContent}function Gt(e,t,n){n.reduce((t,n)=>{const r=$e.Op.length(n);let i=n.attributes||{};if(null!=n.insert)if("string"==typeof n.insert){const r=n.insert;e.insertAt(t,r);const[a]=e.descendant(Se,t),o=et(a);i=$e.AttributeMap.diff(o,i)||{}}else if("object"==typeof n.insert){const r=Object.keys(n.insert)[0];if(null==r)return t;if(e.insertAt(t,r,n.insert[r]),null!=e.scroll.query(r,fe.INLINE)){const[n]=e.descendant(Se,t),r=et(n);i=$e.AttributeMap.diff(r,i)||{}}}return Object.keys(i).forEach(n=>{e.formatAt(t,r,n,i[n])}),t+r},t)}const Zt={scope:fe.BLOCK,whitelist:["right","center","justify"]},Kt=new pe("align","align",Zt),Yt=new be("align","ql-align",Zt),Xt=new we("align","text-align",Zt);class Qt extends we{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(e=>`00${parseInt(e,10).toString(16)}`.slice(-2)).join("")}`):t}}const Jt=new be("color","ql-color",{scope:fe.INLINE}),en=new Qt("color","color",{scope:fe.INLINE}),tn=new be("background","ql-bg",{scope:fe.INLINE}),nn=new Qt("background","background-color",{scope:fe.INLINE});class rn extends Ht{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(e=>e.length()<=1?"":e.domNode.innerText).join("\n").slice(e,e+t)}html(e,t){return`<pre>\n${Ze(this.code(e,t))}\n</pre>`}}class an extends Xe{static TAB=" ";static register(){Pt.register(rn)}}class on extends Ye{}on.blotName="code",on.tagName="CODE",an.blotName="code-block",an.className="ql-code-block",an.tagName="DIV",rn.blotName="code-block-container",rn.className="ql-code-block-container",rn.tagName="DIV",rn.allowedChildren=[an],an.allowedChildren=[We,Ve,nt],an.requiredContainer=rn;const sn={scope:fe.BLOCK,whitelist:["rtl"]},ln=new pe("direction","dir",sn),cn=new be("direction","ql-direction",sn),dn=new we("direction","direction",sn),un={scope:fe.INLINE,whitelist:["serif","monospace"]},hn=new be("font","ql-font",un),fn=new class extends we{value(e){return super.value(e).replace(/["']/g,"")}}("font","font-family",un),pn=new be("size","ql-size",{scope:fe.INLINE,whitelist:["small","large","huge"]}),mn=new we("size","font-size",{scope:fe.INLINE,whitelist:["10px","18px","32px"]}),gn=ct("quill:keyboard"),vn=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class yn extends Nt{static match(e,t){return!["altKey","ctrlKey","metaKey","shiftKey"].some(n=>!!t[n]!==e[n]&&null!==t[n])&&(t.key===e.key||t.key===e.which)}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(e){if("string"==typeof e||"number"==typeof e)e={key:e};else{if("object"!=typeof e)return null;e=(0,he.cloneDeep)(e)}return e.shortKey&&(e[vn]=e.shortKey,delete e.shortKey),e}(e);null!=r?("function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n}),(Array.isArray(r.key)?r.key:[r.key]).forEach(e=>{const i={...r,key:e,...t,...n};this.bindings[i.key]=this.bindings[i.key]||[],this.bindings[i.key].push(i)})):gn.warn("Attempted to add invalid keyboard binding",r)}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing)return;if(229===e.keyCode&&("Enter"===e.key||"Backspace"===e.key))return;const t=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(t=>yn.match(e,t));if(0===t.length)return;const n=Pt.find(e.target,!0);if(n&&n.scroll!==this.quill.scroll)return;const r=this.quill.getSelection();if(null==r||!this.quill.hasFocus())return;const[i,a]=this.quill.getLine(r.index),[o,s]=this.quill.getLeaf(r.index),[l,c]=0===r.length?[o,s]:this.quill.getLeaf(r.index+r.length),d=o instanceof ze?o.value().slice(0,s):"",u=l instanceof ze?l.value().slice(c):"",h={collapsed:0===r.length,empty:0===r.length&&i.length()<=1,format:this.quill.getFormat(r),line:i,offset:a,prefix:d,suffix:u,event:e};t.some(e=>{if(null!=e.collapsed&&e.collapsed!==h.collapsed)return!1;if(null!=e.empty&&e.empty!==h.empty)return!1;if(null!=e.offset&&e.offset!==h.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(e=>null==h.format[e]))return!1}else if("object"==typeof e.format&&!Object.keys(e.format).every(t=>!0===e.format[t]?null!=h.format[t]:!1===e.format[t]?null==h.format[t]:(0,he.isEqual)(e.format[t],h.format[t])))return!1;return!(null!=e.prefix&&!e.prefix.test(h.prefix)||null!=e.suffix&&!e.suffix.test(h.suffix)||!0===e.handler.call(this,r,h,e))})&&e.preventDefault()})}handleBackspace(e,t){const n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(0===e.index||this.quill.getLength()<=1)return;let r={};const[i]=this.quill.getLine(e.index);let a=(new $e).retain(e.index-n).delete(n);if(0===t.offset){const[t]=this.quill.getLine(e.index-1);if(t&&!("block"===t.statics.blotName&&t.length()<=1)){const t=i.formats(),n=this.quill.getFormat(e.index-1,1);if(r=$e.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){const t=(new $e).retain(e.index+i.length()-2).retain(1,r);a=a.compose(t)}}}this.quill.updateContents(a,Pt.sources.USER),this.quill.focus()}handleDelete(e,t){const n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={};const[i]=this.quill.getLine(e.index);let a=(new $e).retain(e.index).delete(n);if(t.offset>=i.length()-1){const[t]=this.quill.getLine(e.index+1);if(t){const n=i.formats(),o=this.quill.getFormat(e.index,1);r=$e.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(a=a.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(a,Pt.sources.USER),this.quill.focus()}handleDeleteRange(e){Nn({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const n=Object.keys(t.format).reduce((e,n)=>(this.quill.scroll.query(n,fe.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e),{}),r=(new $e).retain(e.index).delete(e.length).insert("\n",n);this.quill.updateContents(r,Pt.sources.USER),this.quill.setSelection(e.index+1,Pt.sources.SILENT),this.quill.focus()}}const bn={bindings:{bold:_n("bold"),italic:_n("italic"),underline:_n("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","+1",Pt.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(e,t){return!(!t.collapsed||0===t.offset)||(this.quill.format("indent","-1",Pt.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(e,t){null!=t.format.indent?this.quill.format("indent","-1",Pt.sources.USER):null!=t.format.list&&this.quill.format("list",!1,Pt.sources.USER)}},"indent code-block":xn(!0),"outdent code-block":xn(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,Pt.sources.USER)}},tab:{key:"Tab",handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();const n=(new $e).retain(e.index).delete(e.length).insert("\t");return this.quill.updateContents(n,Pt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,Pt.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Pt.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(e,t){const n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,Pt.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(e){const[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:"checked"},i=(new $e).retain(e.index).insert("\n",r).retain(t.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,Pt.sources.USER),this.quill.setSelection(e.index+1,Pt.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(e,t){const[n,r]=this.quill.getLine(e.index),i=(new $e).retain(e.index).insert("\n",t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,Pt.sources.USER),this.quill.setSelection(e.index+1,Pt.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(e){const t=this.quill.getModule("table");if(t){const[n,r,i,a]=t.getTable(e),o=function(e,t,n,r){return null==t.prev&&null==t.next?null==n.prev&&null==n.next?0===r?-1:1:null==n.prev?-1:1:null==t.prev?-1:null==t.next?1:null}(0,r,i,a);if(null==o)return;let s=n.offset();if(o<0){const t=(new $e).retain(s).insert("\n");this.quill.updateContents(t,Pt.sources.USER),this.quill.setSelection(e.index+1,e.length,Pt.sources.SILENT)}else if(o>0){s+=n.length();const e=(new $e).retain(s).insert("\n");this.quill.updateContents(e,Pt.sources.USER),this.quill.setSelection(s,Pt.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(e,t){const{event:n,line:r}=t,i=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,Pt.sources.USER):this.quill.setSelection(i+r.length(),Pt.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(null==this.quill.scroll.query("list"))return!0;const{length:n}=t.prefix,[r,i]=this.quill.getLine(e.index);if(i>n)return!0;let a;switch(t.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(e.index," ",Pt.sources.USER),this.quill.history.cutoff();const o=(new $e).retain(e.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:a});return this.quill.updateContents(o,Pt.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,Pt.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(e){const[t,n]=this.quill.getLine(e.index);let r=2,i=t;for(;null!=i&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,r-=1,r<=0){const r=(new $e).retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,Pt.sources.USER),this.quill.setSelection(e.index-1,Pt.sources.SILENT),!1}return!0}},"embed left":wn("ArrowLeft",!1),"embed left shift":wn("ArrowLeft",!0),"embed right":wn("ArrowRight",!1),"embed right shift":wn("ArrowRight",!0),"table down":kn(!1),"table up":kn(!0)}};function xn(e){return{key:"Tab",shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n;const i=this.quill.scroll.query("code-block"),{TAB:a}=i;if(0===t.length&&!r.shiftKey)return this.quill.insertText(t.index,a,Pt.sources.USER),void this.quill.setSelection(t.index+a.length,Pt.sources.SILENT);const o=0===t.length?this.quill.getLines(t.index,1):this.quill.getLines(t);let{index:s,length:l}=t;o.forEach((t,n)=>{e?(t.insertAt(0,a),0===n?s+=a.length:l+=a.length):t.domNode.textContent.startsWith(a)&&(t.deleteAt(0,a.length),0===n?s-=a.length:l-=a.length)}),this.quill.update(Pt.sources.USER),this.quill.setSelection(s,l,Pt.sources.SILENT)}}}function wn(e,t){const n="ArrowLeft"===e?"prefix":"suffix";return{key:e,shiftKey:t,altKey:null,[n]:/^$/,handler(n){let{index:r}=n;"ArrowRight"===e&&(r+=n.length+1);const[i]=this.quill.getLeaf(r);return!(i instanceof Pe&&("ArrowLeft"===e?t?this.quill.setSelection(n.index-1,n.length+1,Pt.sources.USER):this.quill.setSelection(n.index-1,Pt.sources.USER):t?this.quill.setSelection(n.index,n.length+1,Pt.sources.USER):this.quill.setSelection(n.index+n.length+1,Pt.sources.USER),1))}}}function _n(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],Pt.sources.USER)}}}function kn(e){return{key:e?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(t,n){const r=e?"prev":"next",i=n.line,a=i.parent[r];if(null!=a){if("table-row"===a.statics.blotName){let e=a.children.head,t=i;for(;null!=t.prev;)t=t.prev,e=e.next;const r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,Pt.sources.USER)}}else{const t=i.table()[r];null!=t&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,Pt.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,Pt.sources.USER))}return!1}}}function Nn(e){let{quill:t,range:n}=e;const r=t.getLines(n);let i={};if(r.length>1){const e=r[0].formats(),t=r[r.length-1].formats();i=$e.AttributeMap.diff(t,e)||{}}t.deleteText(n,Pt.sources.USER),Object.keys(i).length>0&&t.formatLine(n.index,1,i,Pt.sources.USER),t.setSelection(n.index,Pt.sources.SILENT)}yn.DEFAULTS=bn;const En=/font-weight:\s*normal/,Sn=["P","OL","UL"],jn=e=>e&&Sn.includes(e.tagName),Cn=/\bmso-list:[^;]*ignore/i,An=/\bmso-list:[^;]*\bl(\d+)/i,Tn=/\bmso-list:[^;]*\blevel(\d+)/i,Ln=[function(e){"urn:schemas-microsoft-com:office:word"===e.documentElement.getAttribute("xmlns:w")&&(e=>{const t=Array.from(e.querySelectorAll("[style*=mso-list]")),n=[],r=[];t.forEach(e=>{(e.getAttribute("style")||"").match(Cn)?n.push(e):r.push(e)}),n.forEach(e=>e.parentNode?.removeChild(e));const i=e.documentElement.innerHTML,a=r.map(e=>((e,t)=>{const n=e.getAttribute("style"),r=n?.match(An);if(!r)return null;const i=Number(r[1]),a=n?.match(Tn),o=a?Number(a[1]):1,s=new RegExp(`@list l${i}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=t.match(s);return{id:i,indent:o,type:l&&"bullet"===l[1]?"bullet":"ordered",element:e}})(e,i)).filter(e=>e);for(;a.length;){const e=[];let t=a.shift();for(;t;)e.push(t),t=a.length&&a[0]?.element===t.element.nextElementSibling&&a[0].id===t.id?a.shift():null;const n=document.createElement("ul");e.forEach(e=>{const t=document.createElement("li");t.setAttribute("data-list",e.type),e.indent>1&&t.setAttribute("class","ql-indent-"+(e.indent-1)),t.innerHTML=e.element.innerHTML,n.appendChild(t)});const r=e[0]?.element,{parentNode:i}=r??{};r&&i?.replaceChild(n,r),e.slice(1).forEach(e=>{let{element:t}=e;i?.removeChild(t)})}})(e)},function(e){e.querySelector('[id^="docs-internal-guid-"]')&&((e=>{Array.from(e.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(En)).forEach(t=>{const n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)})})(e),(e=>{Array.from(e.querySelectorAll("br")).filter(e=>jn(e.previousElementSibling)&&jn(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})})(e))}],On=ct("quill:clipboard"),Rn=[[Node.TEXT_NODE,function(e,t,n){let r=e.data;if("O:P"===e.parentElement?.tagName)return t.insert(r.trim());if(!Fn(e)){if(0===r.trim().length&&r.includes("\n")&&!function(e,t){return e.previousElementSibling&&e.nextElementSibling&&!In(e.previousElementSibling,t)&&!In(e.nextElementSibling,t)}(e,n))return t;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(null==e.previousSibling&&null!=e.parentElement&&In(e.parentElement,n)||e.previousSibling instanceof Element&&In(e.previousSibling,n))&&(r=r.replace(/^ /,"")),(null==e.nextSibling&&null!=e.parentElement&&In(e.parentElement,n)||e.nextSibling instanceof Element&&In(e.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return t.insert(r)}],[Node.TEXT_NODE,$n],["br",function(e,t){return Pn(t,"\n")||t.insert("\n"),t}],[Node.ELEMENT_NODE,$n],[Node.ELEMENT_NODE,function(e,t,n){const r=n.query(e);if(null==r)return t;if(r.prototype instanceof Pe){const t={},i=r.value(e);if(null!=i)return t[r.blotName]=i,(new $e).insert(t,r.formats(e,n))}else if(r.prototype instanceof De&&!Pn(t,"\n")&&t.insert("\n"),"blotName"in r&&"formats"in r&&"function"==typeof r.formats)return qn(t,r.blotName,r.formats(e,n),n);return t}],[Node.ELEMENT_NODE,function(e,t,n){const r=pe.keys(e),i=be.keys(e),a=we.keys(e),o={};return r.concat(i).concat(a).forEach(t=>{let r=n.query(t,fe.ATTRIBUTE);null!=r&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=Dn[t],null==r||r.attrName!==t&&r.keyName!==t||(o[r.attrName]=r.value(e)||void 0),r=Mn[t],null==r||r.attrName!==t&&r.keyName!==t||(r=Mn[t],o[r.attrName]=r.value(e)||void 0))}),Object.entries(o).reduce((e,t)=>{let[r,i]=t;return qn(e,r,i,n)},t)}],[Node.ELEMENT_NODE,function(e,t,n){const r={},i=e.style||{};return"italic"===i.fontStyle&&(r.italic=!0),"underline"===i.textDecoration&&(r.underline=!0),"line-through"===i.textDecoration&&(r.strike=!0),(i.fontWeight?.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((e,t)=>{let[r,i]=t;return qn(e,r,i,n)},t),parseFloat(i.textIndent||0)>0?(new $e).insert("\t").concat(t):t}],["li",function(e,t,n){const r=n.query(e);if(null==r||"list"!==r.blotName||!Pn(t,"\n"))return t;let i=-1,a=e.parentNode;for(;null!=a;)["OL","UL"].includes(a.tagName)&&(i+=1),a=a.parentNode;return i<=0?t:t.reduce((e,t)=>t.insert?t.attributes&&"number"==typeof t.attributes.indent?e.push(t):e.insert(t.insert,{indent:i,...t.attributes||{}}):e,new $e)}],["ol, ul",function(e,t,n){const r=e;let i="OL"===r.tagName?"ordered":"bullet";const a=r.getAttribute("data-checked");return a&&(i="true"===a?"checked":"unchecked"),qn(t,"list",i,n)}],["pre",function(e,t,n){const r=n.query("code-block");return qn(t,"code-block",!r||!("formats"in r)||"function"!=typeof r.formats||r.formats(e,n),n)}],["tr",function(e,t,n){const r="TABLE"===e.parentElement?.tagName?e.parentElement:e.parentElement?.parentElement;return null!=r?qn(t,"table",Array.from(r.querySelectorAll("tr")).indexOf(e)+1,n):t}],["b",zn("bold")],["i",zn("italic")],["strike",zn("strike")],["style",function(){return new $e}]],Dn=[Kt,ln].reduce((e,t)=>(e[t.keyName]=t,e),{}),Mn=[Xt,nn,en,dn,fn,mn].reduce((e,t)=>(e[t.keyName]=t,e),{});function qn(e,t,n,r){return r.query(t)?e.reduce((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);const i=n?{[t]:n}:{};return e.insert(r.insert,{...i,...r.attributes})},new $e):e}function Pn(e,t){let n="";for(let r=e.ops.length-1;r>=0&&n.length<t.length;--r){const t=e.ops[r];if("string"!=typeof t.insert)break;n=t.insert+n}return n.slice(-1*t.length)===t}function In(e,t){if(!(e instanceof Element))return!1;const n=t.query(e);return!(n&&n.prototype instanceof Pe)&&["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(e.tagName.toLowerCase())}const Bn=new WeakMap;function Fn(e){return null!=e&&(Bn.has(e)||("PRE"===e.tagName?Bn.set(e,!0):Bn.set(e,Fn(e.parentNode))),Bn.get(e))}function Un(e,t,n,r,i){return t.nodeType===t.TEXT_NODE?r.reduce((n,r)=>r(t,n,e),new $e):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((a,o)=>{let s=Un(e,o,n,r,i);return o.nodeType===t.ELEMENT_NODE&&(s=n.reduce((t,n)=>n(o,t,e),s),s=(i.get(o)||[]).reduce((t,n)=>n(o,t,e),s)),a.concat(s)},new $e):new $e}function zn(e){return(t,n,r)=>qn(n,e,!0,r)}function $n(e,t,n){if(!Pn(t,"\n")){if(In(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert("\n");if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;null!=r;){if(In(r,n))return t.insert("\n");const e=n.query(r);if(e&&e.prototype instanceof Qe)return t.insert("\n");r=r.firstChild}}}return t}function Hn(e,t){let n=t;for(let t=e.length-1;t>=0;t-=1){const r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&Vn(r.range,n)},n=r.delta.transform(n),0===e[t].delta.length()&&e.splice(t,1)}}function Vn(e,t){if(!e)return e;const n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}class Wn extends Nt{constructor(e,t){super(e,t),e.root.addEventListener("drop",t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}const r=n&&e.selection.normalizeNative(n);if(r){const n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}})}upload(e,t){const n=[];Array.from(t).forEach(e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)}),n.length>0&&this.options.handler.call(this,e,n)}}Wn.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(e,t){if(!this.quill.scroll.query("image"))return;const n=t.map(e=>new Promise(t=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}));Promise.all(n).then(t=>{const n=t.reduce((e,t)=>e.insert({image:t}),(new $e).retain(e.index).delete(e.length));this.quill.updateContents(n,ut.sources.USER),this.quill.setSelection(e.index+t.length,ut.sources.SILENT)})}};const Gn=Wn,Zn=["insertText","insertReplacementText"],Kn=/Mac/i.test(navigator.platform);Pt.register({"blots/block":Xe,"blots/block/embed":Qe,"blots/break":Ve,"blots/container":Ht,"blots/cursor":nt,"blots/embed":St,"blots/inline":Ye,"blots/scroll":class extends Fe{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Xe;static allowedChildren=[Xe,Qe,Ht];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",e=>this.handleDragStart(e))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(ut.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(ut.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(ut.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[n,r]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),null!=i&&n!==i&&r>0){if(n instanceof Qe||i instanceof Qe)return void this.optimize();const e=i.children.head instanceof Ve?null:i.children.head;n.moveChildren(i,e),n.remove()}this.optimize()}enable(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length())if(null==n||null==this.scroll.query(t,fe.BLOCK)){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),null==n&&t.endsWith("\n")?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{const e=this.scroll.create(t,n);this.appendChild(e)}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===fe.INLINE_BLOT){const n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){const n=this.deltaToRenderBlocks(t.concat((new $e).insert("\n"))),r=n.pop();if(null==r)return;this.batchStart();const i=n.shift();if(i){const t="block"===i.type&&(0===i.delta.length()||!this.descendant(Qe,e)[0]&&e<this.length()),n="block"===i.type?i.delta:(new $e).insert({[i.key]:i.value});Gt(this,e,n);const r="block"===i.type?1:0,a=e+n.length()+r;t&&this.insertAt(a-1,"\n");const o=et(this.line(e)[0]),s=$e.AttributeMap.diff(o,i.attributes)||{};Object.keys(s).forEach(e=>{this.formatAt(a-1,1,e,s[e])}),e=a}let[a,o]=this.children.find(e);n.length&&(a&&(a=a.split(o),o=0),n.forEach(e=>{if("block"===e.type)Gt(this.createBlock(e.attributes,a||void 0),0,e.delta);else{const t=this.create(e.key,e.value);this.insertBefore(t,a||void 0),Object.keys(e.attributes).forEach(n=>{t.format(n,e.attributes[n])})}})),"block"===r.type&&r.delta.length()&&Gt(this,a?a.offset(a.scroll)+o:this.length(),r.delta),this.batchEnd(),this.optimize()}isEnabled(){return"true"===this.domNode.getAttribute("contenteditable")}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[n,r]=t;return n instanceof Se?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Vt,e)}lines(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;const n=(e,t,r)=>{let i=[],a=r;return e.children.forEachAt(t,r,(e,t,r)=>{Vt(e)?i.push(e):e instanceof qe&&(i=i.concat(n(e,t,a))),a-=r}),i};return n(this,e,t)}optimize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(ut.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch)return void(Array.isArray(e)&&(this.batch=this.batch.concat(e)));let t=ut.sources.USER;"string"==typeof e&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),(e=e.filter(e=>{let{target:t}=e;const n=this.find(t,!0);return n&&!Wt(n)})).length>0&&this.emitter.emit(ut.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(ut.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){const[r]=this.descendant(e=>e instanceof Qe,e);r&&r.statics.blotName===t&&Wt(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let n=new $e;return e.forEach(e=>{const r=e?.insert;if(r)if("string"==typeof r){const i=r.split("\n");i.slice(0,-1).forEach(r=>{n.insert(r,e.attributes),t.push({type:"block",delta:n,attributes:e.attributes??{}}),n=new $e});const a=i[i.length-1];a&&n.insert(a,e.attributes)}else{const i=Object.keys(r)[0];if(!i)return;this.query(i,fe.INLINE)?n.push(e):(n.length()&&t.push({type:"block",delta:n,attributes:{}}),n=new $e,t.push({type:"blockEmbed",key:i,value:r[i],attributes:e.attributes??{}}))}}),n.length()&&t.push({type:"block",delta:n,attributes:{}}),t}createBlock(e,t){let n;const r={};Object.entries(e).forEach(e=>{let[t,i]=e;null!=this.query(t,fe.BLOCK&fe.BLOT)?n=t:r[t]=i});const i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);const a=i.length();return Object.entries(r).forEach(e=>{let[t,n]=e;i.formatAt(0,a,t,n)}),i}},"blots/text":We,"modules/clipboard":class extends Nt{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",e=>this.onCaptureCopy(e,!1)),this.quill.root.addEventListener("cut",e=>this.onCaptureCopy(e,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Rn.concat(this.options.matchers??[]).forEach(e=>{let[t,n]=e;this.addMatcher(t,n)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r[an.blotName])return(new $e).insert(n||"",{[an.blotName]:r[an.blotName]});if(!t)return(new $e).insert(n||"",r);const i=this.convertHTML(t);return Pn(i,"\n")&&(null==i.ops[i.ops.length-1].attributes||r.table)?i.compose((new $e).retain(i.length()-1).delete(1)):i}normalizeHTML(e){(e=>{e.documentElement&&Ln.forEach(t=>{t(e)})})(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const n=t.body,r=new WeakMap,[i,a]=this.prepareMatching(n,r);return Un(this.quill.scroll,n,i,a,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Pt.sources.API;if("string"==typeof e){const n=this.convert({html:e,text:""});this.quill.setContents(n,t),this.quill.setSelection(0,Pt.sources.SILENT)}else{const r=this.convert({html:t,text:""});this.quill.updateContents((new $e).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),Pt.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.defaultPrevented)return;e.preventDefault();const[n]=this.quill.selection.getRange();if(null==n)return;const{html:r,text:i}=this.onCopy(n,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",r),t&&Nn({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(e=>"#"!==e[0]).join("\n")}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(null==t)return;const n=e.clipboardData?.getData("text/html");let r=e.clipboardData?.getData("text/plain");if(!n&&!r){const t=e.clipboardData?.getData("text/uri-list");t&&(r=this.normalizeURIList(t))}const i=Array.from(e.clipboardData?.files||[]);if(!n&&i.length>0)this.quill.uploader.upload(t,i);else{if(n&&i.length>0){const e=(new DOMParser).parseFromString(n,"text/html");if(1===e.body.childElementCount&&"IMG"===e.body.firstElementChild?.tagName)return void this.quill.uploader.upload(t,i)}this.onPaste(t,{html:n,text:r})}}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t;const i=this.quill.getFormat(e.index),a=this.convert({text:n,html:r},i);On.log("onPaste",a,{text:n,html:r});const o=(new $e).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(o,Pt.sources.USER),this.quill.setSelection(o.length()-e.length,Pt.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const n=[],r=[];return this.matchers.forEach(i=>{const[a,o]=i;switch(a){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(a)).forEach(e=>{if(t.has(e)){const n=t.get(e);n?.push(o)}else t.set(e,[o])})}}),[n,r]}},"modules/history":class extends Nt{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(Pt.events.EDITOR_CHANGE,(e,t,n,r)=>{e===Pt.events.SELECTION_CHANGE?t&&r!==Pt.sources.SILENT&&(this.currentRange=t):e===Pt.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&r!==Pt.sources.USER?this.transform(t):this.record(t,n)),this.currentRange=Vn(this.currentRange,t))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",e=>{"historyUndo"===e.inputType?(this.undo(),e.preventDefault()):"historyRedo"===e.inputType&&(this.redo(),e.preventDefault())})}change(e,t){if(0===this.stack[e].length)return;const n=this.stack[e].pop();if(!n)return;const r=this.quill.getContents(),i=n.delta.invert(r);this.stack[t].push({delta:i,range:Vn(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,Pt.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(0===e.ops.length)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=i;0!==n.length()&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Hn(this.stack.undo,e),Hn(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,Pt.sources.USER);else{const t=function(e,t){const n=t.reduce((e,t)=>e+(t.delete||0),0);let r=t.length()-n;return function(e,t){const n=t.ops[t.ops.length-1];return null!=n&&(null!=n.insert?"string"==typeof n.insert&&n.insert.endsWith("\n"):null!=n.attributes&&Object.keys(n.attributes).some(t=>null!=e.query(t,fe.BLOCK)))}(e,t)&&(r-=1),r}(this.quill.scroll,e.delta);this.quill.setSelection(t,Pt.sources.USER)}}},"modules/keyboard":yn,"modules/uploader":Gn,"modules/input":class extends Nt{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",e=>{this.handleBeforeInput(e)}),/Android/i.test(navigator.userAgent)||e.on(Pt.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Nn({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(0===e.length)return!1;if(t){const n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new $e).retain(e.index).insert(t,n),Pt.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,Pt.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Zn.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||!0===t.collapsed)return;const n=function(e){return"string"==typeof e.data?e.data:e.dataTransfer?.types.includes("text/plain")?e.dataTransfer.getData("text/plain"):null}(e);if(null==n)return;const r=this.quill.selection.normalizeNative(t),i=r?this.quill.selection.normalizedToRange(r):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}},"modules/uiNode":class extends Nt{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof Te&&n.uiNode))return!0;const i="rtl"===getComputedStyle(n.domNode).direction;return!!(i&&"ArrowRight"!==r.key||!i&&"ArrowLeft"!==r.key)||(this.quill.setSelection(e.index-1,e.length+(r.shiftKey?1:0),Pt.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&(e=>"ArrowLeft"===e.key||"ArrowRight"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key||"Home"===e.key||!(!Kn||"a"!==e.key||!0!==e.ctrlKey))(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,this.isListening||(this.isListening=!0,document.addEventListener("selectionchange",()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0}))}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(!0!==t.collapsed||0!==t.startOffset)return;const n=this.quill.scroll.find(t.startContainer);if(!(n instanceof Te&&n.uiNode))return;const r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}}});const Yn=Pt,Xn=new class extends be{add(e,t){let n=0;if("+1"===t||"-1"===t){const r=this.value(e)||0;n="+1"===t?r+1:r-1}else"number"==typeof t&&(n=t);return 0===n?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}("indent","ql-indent",{scope:fe.BLOCK,whitelist:[1,2,3,4,5,6,7,8]}),Qn=Xn;class Jn extends Ht{}Jn.blotName="list-container",Jn.tagName="OL";class er extends Xe{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){Pt.register(Jn)}constructor(e,t){super(e,t);const n=t.ownerDocument.createElement("span"),r=n=>{if(!e.isEnabled())return;const r=this.statics.formats(t,e);"checked"===r?(this.format("list","unchecked"),n.preventDefault()):"unchecked"===r&&(this.format("list","checked"),n.preventDefault())};n.addEventListener("mousedown",r),n.addEventListener("touchstart",r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}er.blotName="list",er.tagName="LI",Jn.allowedChildren=[er],er.requiredContainer=Jn;const tr=class extends Ye{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}};class nr extends Ye{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return rr(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("href",this.constructor.sanitize(t)):super.format(e,t)}}function rr(e,t){const n=document.createElement("a");n.href=e;const r=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(r)>-1}const ir=["alt","height","width"],ar=["height","width"],or=new be("code-token","hljs",{scope:fe.INLINE});class sr extends Ye{static formats(e,t){for(;null!=e&&e!==t.domNode;){if(e.classList&&e.classList.contains(an.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),or.add(this.domNode,n)}format(e,t){e!==sr.blotName?super.format(e,t):t?or.add(this.domNode,t):(or.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),or.value(this.domNode)||this.unwrap()}}sr.blotName="code-token",sr.className="ql-token";class lr extends an{static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),sr.blotName,!1),super.replaceWith(e,t)}}class cr extends rn{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===lr.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(e,t)}))}formatAt(e,t,n,r){n===lr.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==this.children.head)return;const n=`${Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).map(e=>e.textContent).join("\n")}\n`,r=lr.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||null==this.cachedText){const t=this.children.reduce((e,t)=>e.concat(Je(t,!1)),new $e),i=e(n,r);t.diff(i).reduce((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach(t=>{[lr.blotName,sr.blotName].includes(t)&&this.formatAt(e,n,t,r[t])}),e+n):e},0)}this.cachedText=n,this.forceNext=!1}}html(e,t){const[n]=this.children.find(e);return`<pre data-language="${n?lr.formats(n.domNode):"plain"}">\n${Ze(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),null!=this.parent&&null!=this.children.head&&null!=this.uiNode){const e=lr.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}}cr.allowedChildren=[lr],lr.requiredContainer=cr,lr.allowedChildren=[sr,nt,We,Ve];class dr extends Nt{static register(){Pt.register(sr,!0),Pt.register(lr,!0),Pt.register(cr,!0)}constructor(e,t){if(super(e,t),null==this.options.hljs)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((e,t)=>{let{key:n}=t;return e[n]=!0,e},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Pt.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof cr))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(e=>{let{key:n,label:r}=e;const i=t.ownerDocument.createElement("option");i.textContent=r,i.setAttribute("value",n),t.appendChild(i)}),t.addEventListener("change",()=>{e.format(lr.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),null==e.uiNode&&(e.attachUI(t),e.children.head&&(t.value=lr.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(Pt.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(Pt.sources.USER);const n=this.quill.getSelection();(null==e?this.quill.scroll.descendants(cr):[e]).forEach(e=>{e.highlight(this.highlightBlot,t)}),this.quill.update(Pt.sources.SILENT),null!=n&&this.quill.setSelection(n,Pt.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"plain";if(t=this.languages[t]?t:"plain","plain"===t)return Ze(e).split("\n").reduce((e,n,r)=>(0!==r&&e.insert("\n",{[an.blotName]:t}),e.insert(n)),new $e);const n=this.quill.root.ownerDocument.createElement("div");return n.classList.add(an.className),n.innerHTML=((e,t,n)=>{if("string"==typeof e.versionString){const r=e.versionString.split(".")[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value})(this.options.hljs,t,e),Un(this.quill.scroll,n,[(e,t)=>{const n=or.value(e);return n?t.compose((new $e).retain(t.length(),{[sr.blotName]:n})):t}],[(e,n)=>e.data.split("\n").reduce((e,n,r)=>(0!==r&&e.insert("\n",{[an.blotName]:t}),e.insert(n)),n)],new WeakMap)}}dr.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class ur extends Xe{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",mr()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===ur.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class hr extends Ht{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&null!=this.next.children.head){const e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach(e=>{if(null==e.next)return;const t=e.formats(),n=e.next.formats();if(t.table!==n.table){const t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class fr extends Ht{static blotName="table-body";static tagName="TBODY"}class pr extends Ht{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(hr),t=e.reduce((e,t)=>Math.max(t.children.length,e),0);e.forEach(e=>{new Array(t-e.children.length).fill(0).forEach(()=>{let t;null!=e.children.head&&(t=ur.formats(e.children.head.domNode));const n=this.scroll.create(ur.blotName,t);e.appendChild(n),n.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(fr);null!=t&&null!=t.children.head&&t.children.forEach(t=>{const n=t.children.at(e);null!=n&&n.remove()})}insertColumn(e){const[t]=this.descendant(fr);null!=t&&null!=t.children.head&&t.children.forEach(t=>{const n=t.children.at(e),r=ur.formats(t.children.head.domNode),i=this.scroll.create(ur.blotName,r);t.insertBefore(i,n)})}insertRow(e){const[t]=this.descendant(fr);if(null==t||null==t.children.head)return;const n=mr(),r=this.scroll.create(hr.blotName);t.children.head.children.forEach(()=>{const e=this.scroll.create(ur.blotName,n);r.appendChild(e)});const i=t.children.at(e);t.insertBefore(r,i)}rows(){const e=this.children.head;return null==e?[]:e.children.map(e=>e)}}function mr(){return`row-${Math.random().toString(36).slice(2,6)}`}pr.allowedChildren=[fr],fr.requiredContainer=pr,fr.allowedChildren=[hr],hr.requiredContainer=fr,hr.allowedChildren=[ur],ur.requiredContainer=hr;const gr=ct("quill:toolbar");class vr extends Nt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const t=document.createElement("div");t.setAttribute("role","toolbar"),function(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(t=>{const n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(e=>{if("string"==typeof e)yr(n,e);else{const t=Object.keys(e)[0],r=e[t];Array.isArray(r)?function(e,t,n){const r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach(e=>{const t=document.createElement("option");!1!==e?t.setAttribute("value",String(e)):t.setAttribute("selected","selected"),r.appendChild(t)}),e.appendChild(r)}(n,t,r):yr(n,t,r)}}),e.appendChild(n)})}(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else"string"==typeof this.options.container?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(e=>{const t=this.options.handlers?.[e];t&&this.addHandler(e,t)}),Array.from(this.container.querySelectorAll("button, select")).forEach(e=>{this.attach(e)}),this.quill.on(Pt.events.EDITOR_CHANGE,()=>{const[e]=this.quill.selection.getRange();this.update(e)})):gr.error("Container required for toolbar",this.options)}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(e=>0===e.indexOf("ql-"));if(!t)return;if(t=t.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[t]&&null==this.quill.scroll.query(t))return void gr.warn("ignoring attaching to nonexistent format",t,e);const n="SELECT"===e.tagName?"change":"click";e.addEventListener(n,n=>{let r;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;const t=e.options[e.selectedIndex];r=!t.hasAttribute("selected")&&(t.value||!1)}else r=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),n.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(null!=this.handlers[t])this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof Pe){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents((new $e).retain(i.index).delete(i.length).insert({[t]:r}),Pt.sources.USER)}else this.quill.format(t,r,Pt.sources.USER);this.update(i)}),this.controls.push([t,e])}update(e){const t=null==e?{}:this.quill.getFormat(e);this.controls.forEach(n=>{const[r,i]=n;if("SELECT"===i.tagName){let n=null;if(null==e)n=null;else if(null==t[r])n=i.querySelector("option[selected]");else if(!Array.isArray(t[r])){let e=t[r];"string"==typeof e&&(e=e.replace(/"/g,'\\"')),n=i.querySelector(`option[value="${e}"]`)}null==n?(i.value="",i.selectedIndex=-1):n.selected=!0}else if(null==e)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const e=t[r],n=e===i.getAttribute("value")||null!=e&&e.toString()===i.getAttribute("value")||null==e&&!i.getAttribute("value");i.classList.toggle("ql-active",n),i.setAttribute("aria-pressed",n.toString())}else{const e=null!=t[r];i.classList.toggle("ql-active",e),i.setAttribute("aria-pressed",e.toString())}})}}function yr(e,t,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),null!=n?(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)):r.setAttribute("aria-label",t),e.appendChild(r)}vr.DEFAULTS={},vr.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(null!=e)if(0===e.length){const e=this.quill.getFormat();Object.keys(e).forEach(e=>{null!=this.quill.scroll.query(e,fe.INLINE)&&this.quill.format(e,!1,Pt.sources.USER)})}else this.quill.removeFormat(e.index,e.length,Pt.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();"rtl"===e&&null==t?this.quill.format("align","right",Pt.sources.USER):e||"right"!==t||this.quill.format("align",!1,Pt.sources.USER),this.quill.format("direction",e,Pt.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if("+1"===e||"-1"===e){let t="+1"===e?1:-1;"rtl"===n.direction&&(t*=-1),this.quill.format("indent",r+t,Pt.sources.USER)}},link(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,Pt.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,Pt.sources.USER):this.quill.format("list","unchecked",Pt.sources.USER):this.quill.format("list",e,Pt.sources.USER)}}};const br='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',xr={align:{"":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',center:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',right:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',justify:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>'},background:'<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',blockquote:'<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',bold:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',clean:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',code:br,"code-block":br,color:'<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',direction:{"":'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',rtl:'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>'},formula:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',header:{1:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',2:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',3:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',4:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',5:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',6:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>'},italic:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',image:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indent:{"+1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',"-1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>'},link:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',list:{bullet:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',check:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',ordered:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>'},script:{sub:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',super:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>'},strike:'<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',table:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underline:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',video:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>'};let wr=0;function _r(e,t){e.setAttribute(t,`${!("true"===e.getAttribute(t))}`)}const kr=class{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),e.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),_r(this.label,"aria-expanded"),_r(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const n=e.getAttribute("value");return n&&t.setAttribute("data-value",n),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",e=>{switch(e.key){case"Enter":this.selectItem(t,!0),e.preventDefault();break;case"Escape":this.escape(),e.preventDefault()}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>',e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${wr}`,wr+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const n=this.buildItem(t);e.appendChild(n),!0===t.selected&&this.selectItem(n)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.container.querySelector(".ql-selected");e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);const t=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}},Nr=class extends kr{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(e=>{e.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const n=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";n&&("line"===n.tagName?n.style.stroke=r:n.style.fill=r)}},Er=class extends kr{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(e=>{e.innerHTML=t[e.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const n=e||this.defaultItem;if(null!=n){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}},Sr=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(e=>{const{overflowY:t}=getComputedStyle(e,null);return"visible"!==t&&"clip"!==t})(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=-1*this.quill.root.scrollTop+"px"}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let a=0;if(i.right>r.right&&(a=r.right-i.right,this.root.style.left=`${t+a}px`),i.left<r.left&&(a=r.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>r.bottom){const t=i.bottom-i.top,r=e.bottom-e.top+t;this.root.style.top=n-r+"px",this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}},jr=[!1,"center","right","justify"],Cr=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Ar=[!1,"serif","monospace"],Tr=["1","2","3",!1],Lr=["small",!1,"large","huge"];class Or extends At{constructor(e,t){super(e,t);const n=t=>{document.body.contains(e.root)?(null==this.tooltip||this.tooltip.root.contains(t.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),null!=this.pickers&&this.pickers.forEach(e=>{e.container.contains(t.target)||e.close()})):document.body.removeEventListener("click",n)};e.emitter.listenDOM("click",document.body,n)}addModule(e){const t=super.addModule(e);return"toolbar"===e&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(e=>{(e.getAttribute("class")||"").split(/\s+/).forEach(n=>{if(n.startsWith("ql-")&&(n=n.slice(3),null!=t[n]))if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{const r=e.value||"";null!=r&&t[n][r]&&(e.innerHTML=t[n][r])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(e=>{if(e.classList.contains("ql-align")&&(null==e.querySelector("option")&&Dr(e,jr),"object"==typeof t.align))return new Er(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){const n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&Dr(e,Cr,"background"===n?"#ffffff":"#000000"),new Nr(e,t[n])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?Dr(e,Ar):e.classList.contains("ql-header")?Dr(e,Tr):e.classList.contains("ql-size")&&Dr(e,Lr)),new kr(e)}),this.quill.on(ut.events.EDITOR_CHANGE,()=>{this.pickers.forEach(e=>{e.update()})})}}Or.DEFAULTS=(0,he.merge)({},At.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");null==e&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""}),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Rr extends Sr{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{"Enter"===e.key?(this.save(),e.preventDefault()):"Escape"===e.key&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null==this.textbox)return;null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const n=this.quill.getBounds(this.quill.selection.savedRange);null!=n&&this.position(n),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,ut.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,ut.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=function(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:e}(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(null!=t){const n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute("data-mode"),e,ut.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(n+1," ",ut.sources.USER),this.quill.setSelection(n+2,ut.sources.USER)}break}}this.textbox.value="",this.hide()}}function Dr(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach(t=>{const r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",String(t)),e.appendChild(r)})}const Mr=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class qr extends Rr{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(e,t){super(e,t),this.quill.on(ut.events.EDITOR_CHANGE,(e,t,n,r)=>{if(e===ut.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&r===ut.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const e=this.quill.getLines(t.index,t.length);if(1===e.length){const e=this.quill.getBounds(t);null!=e&&this.position(e)}else{const n=e[e.length-1],r=this.quill.getIndex(n),i=Math.min(n.length()-1,t.index+t.length-r),a=this.quill.getBounds(new ft(r,i));null!=a&&this.position(a)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(ut.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(null!=e){const t=this.quill.getBounds(e);null!=t&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),n=this.root.querySelector(".ql-tooltip-arrow");return n.style.marginLeft="",0!==t&&(n.style.marginLeft=-1*t-n.offsetWidth/2+"px"),t}}class Pr extends Or{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=Mr),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new qr(this.quill,this.options.bounds),null!=e.container&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),xr),this.buildPickers(e.container.querySelectorAll("select"),xr))}}Pr.DEFAULTS=(0,he.merge)({},Or.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Pt.sources.USER)}}}}});const Ir=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Br extends Rr{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",e=>{if(null!=this.linkRange){const e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,"link",!1,ut.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(ut.events.SELECTION_CHANGE,(e,t,n)=>{if(null!=e){if(0===e.length&&n===ut.sources.USER){const[t,n]=this.quill.scroll.descendant(nr,e.index);if(null!=t){this.linkRange=new ft(e.index-n,t.length());const r=nr.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute("href",r),this.show();const i=this.quill.getBounds(this.linkRange);return void(null!=i&&this.position(i))}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class Fr extends Or{constructor(e,t){null!=t.modules.toolbar&&null==t.modules.toolbar.container&&(t.modules.toolbar.container=Ir),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){null!=e.container&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),xr),this.buildPickers(e.container.querySelectorAll("select"),xr),this.tooltip=new Br(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,n)=>{e.handlers.link.call(e,!n.format.link)}))}}Fr.DEFAULTS=(0,he.merge)({},Or.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const e=this.quill.getSelection();if(null==e||0===e.length)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&0!==t.indexOf("mailto:")&&(t=`mailto:${t}`);const{tooltip:n}=this.quill.theme;n.edit("link",t)}else this.quill.format("link",!1,Pt.sources.USER)}}}}});const Ur=Fr;Yn.register({"attributors/attribute/direction":ln,"attributors/class/align":Yt,"attributors/class/background":tn,"attributors/class/color":Jt,"attributors/class/direction":cn,"attributors/class/font":hn,"attributors/class/size":pn,"attributors/style/align":Xt,"attributors/style/background":nn,"attributors/style/color":en,"attributors/style/direction":dn,"attributors/style/font":fn,"attributors/style/size":mn},!0),Yn.register({"formats/align":Yt,"formats/direction":cn,"formats/indent":Qn,"formats/background":nn,"formats/color":en,"formats/font":hn,"formats/size":pn,"formats/blockquote":class extends Xe{static blotName="blockquote";static tagName="blockquote"},"formats/code-block":an,"formats/header":class extends Xe{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}},"formats/list":er,"formats/bold":tr,"formats/code":on,"formats/italic":class extends tr{static blotName="italic";static tagName=["EM","I"]},"formats/link":nr,"formats/script":class extends Ye{static blotName="script";static tagName=["SUB","SUP"];static create(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):super.create(e)}static formats(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}},"formats/strike":class extends tr{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":class extends Ye{static blotName="underline";static tagName="U"},"formats/formula":class extends St{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(null==window.katex)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return"string"==typeof e&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}},"formats/image":class extends Pe{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return"string"==typeof e&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return ir.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return rr(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){ir.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},"formats/video":class extends Qe{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return ar.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static sanitize(e){return nr.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){ar.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}},"modules/syntax":dr,"modules/table":class extends Nt{static register(){Pt.register(ur),Pt.register(hr),Pt.register(fr),Pt.register(pr)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(pr).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();null!=t&&(e.deleteColumn(t.cellOffset()),this.quill.update(Pt.sources.USER))}deleteRow(){const[,e]=this.getTable();null!=e&&(e.remove(),this.quill.update(Pt.sources.USER))}deleteTable(){const[e]=this.getTable();if(null==e)return;const t=e.offset();e.remove(),this.quill.update(Pt.sources.USER),this.quill.setSelection(t,Pt.sources.SILENT)}getTable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.quill.getSelection();if(null==e)return[null,null,null,-1];const[t,n]=this.quill.getLine(e.index);if(null==t||t.statics.blotName!==ur.blotName)return[null,null,null,-1];const r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[n,r,i]=this.getTable(t);if(null==i)return;const a=i.cellOffset();n.insertColumn(a+e),this.quill.update(Pt.sources.USER);let o=r.rowOffset();0===e&&(o+=1),this.quill.setSelection(t.index+o,t.length,Pt.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[n,r,i]=this.getTable(t);if(null==i)return;const a=r.rowOffset();n.insertRow(a+e),this.quill.update(Pt.sources.USER),e>0?this.quill.setSelection(t,Pt.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,Pt.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const n=this.quill.getSelection();if(null==n)return;const r=new Array(e).fill(0).reduce(e=>{const n=new Array(t).fill("\n").join("");return e.insert(n,{table:mr()})},(new $e).retain(n.index));this.quill.updateContents(r,Pt.sources.USER),this.quill.setSelection(n.index,Pt.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Pt.events.SCROLL_OPTIMIZE,e=>{e.some(e=>!!["TD","TR","TBODY","TABLE"].includes(e.target.tagName)&&(this.quill.once(Pt.events.TEXT_CHANGE,(e,t,n)=>{n===Pt.sources.USER&&this.balanceTables()}),!0))})}},"modules/toolbar":vr,"themes/bubble":Pr,"themes/snow":Ur,"ui/icons":xr,"ui/picker":kr,"ui/icon-picker":Er,"ui/color-picker":Nr,"ui/tooltip":Sr},!0);const zr=Yn,$r=(e,t="image")=>{if("undefined"==typeof wp||!wp.media)return;const n=wp.media({title:(0,s.__)("Select or Upload Media","dokan-lite"),button:{text:(0,s.__)("Use this media","dokan-lite")},library:{type:t},multiple:!1});n.on("select",()=>{const t=n.state().get("selection").first().toJSON();e(t.url,t)}),n.open()},Hr=(0,o.forwardRef)((e,t)=>{const{value:n,onChange:r,readOnly:i=!1,theme:a="snow",modules:s,...d}=e,u=(0,o.useRef)(null),h=(0,o.useRef)(null),f=(0,o.useRef)(r),p=(0,o.useRef)(!1);return(0,o.useImperativeHandle)(t,()=>h.current,[]),(0,o.useEffect)(()=>{f.current=r},[r]),(0,o.useEffect)(()=>{if(!u.current)return;const e=u.current.appendChild(u.current.ownerDocument.createElement("div")),t={toolbar:{container:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{color:[]},{background:[]}],["link","image"],["clean"]],handlers:{image:()=>{const e=h.current;e&&$r((t,n)=>{const r=e.getSelection(!0),i=n.alt||n.title||"";e.clipboard.dangerouslyPasteHTML(r.index,(0,c.sanitizeHTML)(`<img src="${t}" alt="${i}" />`,{tags:["img"],attr:["src","alt"]}),"user"),e.setSelection(r.index+1,"silent")},"image")},video:()=>{const e=h.current;e&&$r(t=>{const n=e.getSelection(!0);e.clipboard.dangerouslyPasteHTML(n.index,(0,c.sanitizeHTML)(`<video class="ql-video" height="280" width="500" controls src="${t}"></video>`,{tags:["video"],attr:["src","height","width","controls","class"]}),"user"),e.setSelection(n.index+1,"silent")},"video")}}}},r={...t,...s,toolbar:{...t.toolbar,...s?.toolbar,handlers:{...t.toolbar?.handlers,...s?.toolbar?.handlers}}},o=new zr(e,{theme:a,modules:r,readOnly:i,...d});return h.current=o,n&&o.clipboard.dangerouslyPasteHTML((0,c.sanitizeHTML)(n)),o.on("text-change",(e,t,n)=>{if("user"===n&&f.current){const e=o.root.innerHTML;p.current=!0,f.current("<p><br></p>"===e?"":e)}}),()=>{h.current=null,u.current&&(u.current.innerHTML="")}},[]),(0,o.useEffect)(()=>{if(p.current)return void(p.current=!1);const e=h.current;if(e&&n!==e.root.innerHTML){const t=e.getSelection();e.clipboard.dangerouslyPasteHTML((0,c.sanitizeHTML)(n||"")),t&&e.setSelection(t.index,t.length,"silent")}},[n]),(0,o.useEffect)(()=>{h.current?.enable(!i)},[i]),(0,l.jsx)("div",{ref:u})});Hr.displayName="Editor";const Vr=Hr,Wr=function(e){var t,n,r,i,a,o;const s=(()=>{if("undefined"==typeof document)return;const e="dokan-select-menu-portal";let t=document.getElementById(e);return t||(t=document.createElement("div"),t.id=e,t.className="dokan-layout",document.body.appendChild(t)),t})();return(0,l.jsx)(X.SearchableSelect,{components:{Control:re,DropdownIndicator:ae,SingleValue:ne,ValueContainer:Q,MultiValue:te,Option:ee,...e?.components?e.components:{}},styles:oe,className:"shadow-none",classNamePrefix:null!==(t=e.classNamePrefix)&&void 0!==t?t:"react-select",blurInputOnSelect:null===(n=e.blurInputOnSelect)||void 0===n||n,closeMenuOnSelect:null===(r=e.closeMenuOnSelect)||void 0===r||r,hideSelectedOptions:null!==(i=e.hideSelectedOptions)&&void 0!==i&&i,menuPortalTarget:null!==(a=e.menuPortalTarget)&&void 0!==a?a:s,menuPosition:null!==(o=e.menuPosition)&&void 0!==o?o:"fixed",...e})},Gr=({onSelect:e,children:t,multiple:n=!1,className:r,title:i,buttonText:a,uploaderParams:o,...c})=>{const d=()=>{const t=wp.media({title:i||(0,s.__)("Select or Upload Media","dokan-lite"),button:{text:a||(0,s.__)("Use this media")},multiple:n});o&&t.on("ready",()=>{const e=t.uploader;e&&(e.uploader?e.uploader.param({...o}):e.options.uploader.params={...e.options.uploader.params,...o})}),t.on("select",()=>{const r=t.state().get("selection");if(n)return void e(r.map(e=>e.toJSON()));const i=r.first().toJSON();i&&e(i)}),t.open()};if(c.as){const e=c.as;return(0,l.jsx)(e,{...c,onClick:d,className:r,children:t})}return(0,l.jsx)("div",{role:"button",onClick:d,className:r,children:t})};n(8409),n(8537),n(7046),n(891);const Zr={total_sales:"#7047EB",net_sales:"#4CA772",commissions:"#4EB9FA"};(0,s.__)("Total Sales","dokan-lite"),Zr.total_sales,(0,s.__)("Net Sales","dokan-lite"),Zr.net_sales,(0,s.__)("Commissions","dokan-lite"),Zr.commissions},4991(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(1609),i=n(3552),a=n(576);const o=(0,r.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:s="",children:l,iconNode:c,...d},u)=>(0,r.createElement)("svg",{ref:u,...i.A,width:t,height:t,stroke:e,strokeWidth:o?24*Number(n)/Number(t):n,className:(0,a.zP)("lucide",s),...!l&&!(0,a.m$)(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(l)?l:[l]]))},5098(e,t,n){"use strict";n.d(t,{a:()=>a});var r=n(1635),i=n(7482);function a(e,t){return void 0===t&&(t={}),(0,i.W)(e,(0,r.Cl)({delimiter:"."},t))}},5107(e,t,n){"use strict";n.d(t,{A:()=>r});const r=(0,n(6203).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},5315(e,t,n){"use strict";function r(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function i(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function a(){}n.d(t,{Ay:()=>w,Qh:()=>N});var o=.7,s=1/o,l="\\s*([+-]?\\d+)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",d="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3,8})$/,h=new RegExp(`^rgb\\(${l},${l},${l}\\)$`),f=new RegExp(`^rgb\\(${d},${d},${d}\\)$`),p=new RegExp(`^rgba\\(${l},${l},${l},${c}\\)$`),m=new RegExp(`^rgba\\(${d},${d},${d},${c}\\)$`),g=new RegExp(`^hsl\\(${c},${d},${d}\\)$`),v=new RegExp(`^hsla\\(${c},${d},${d},${c}\\)$`),y={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function b(){return this.rgb().formatHex()}function x(){return this.rgb().formatRgb()}function w(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=u.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?_(t):3===n?new E(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?k(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?k(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=h.exec(e))?new E(t[1],t[2],t[3],1):(t=f.exec(e))?new E(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=p.exec(e))?k(t[1],t[2],t[3],t[4]):(t=m.exec(e))?k(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=g.exec(e))?L(t[1],t[2]/100,t[3]/100,1):(t=v.exec(e))?L(t[1],t[2]/100,t[3]/100,t[4]):y.hasOwnProperty(e)?_(y[e]):"transparent"===e?new E(NaN,NaN,NaN,0):null}function _(e){return new E(e>>16&255,e>>8&255,255&e,1)}function k(e,t,n,r){return r<=0&&(e=t=n=NaN),new E(e,t,n,r)}function N(e,t,n,r){return 1===arguments.length?((i=e)instanceof a||(i=w(i)),i?new E((i=i.rgb()).r,i.g,i.b,i.opacity):new E):new E(e,t,n,null==r?1:r);var i}function E(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function S(){return`#${T(this.r)}${T(this.g)}${T(this.b)}`}function j(){const e=C(this.opacity);return`${1===e?"rgb(":"rgba("}${A(this.r)}, ${A(this.g)}, ${A(this.b)}${1===e?")":`, ${e})`}`}function C(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function A(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function T(e){return((e=A(e))<16?"0":"")+e.toString(16)}function L(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new R(e,t,n,r)}function O(e){if(e instanceof R)return new R(e.h,e.s,e.l,e.opacity);if(e instanceof a||(e=w(e)),!e)return new R;if(e instanceof R)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,l=o-i,c=(o+i)/2;return l?(s=t===o?(n-r)/l+6*(n<r):n===o?(r-t)/l+2:(t-n)/l+4,l/=c<.5?o+i:2-o-i,s*=60):l=c>0&&c<1?0:s,new R(s,l,c,e.opacity)}function R(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function D(e){return(e=(e||0)%360)<0?e+360:e}function M(e){return Math.max(0,Math.min(1,e||0))}function q(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}r(a,w,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:b,formatHex:b,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return O(this).formatHsl()},formatRgb:x,toString:x}),r(E,N,i(a,{brighter(e){return e=null==e?s:Math.pow(s,e),new E(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?o:Math.pow(o,e),new E(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new E(A(this.r),A(this.g),A(this.b),C(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:S,formatHex:S,formatHex8:function(){return`#${T(this.r)}${T(this.g)}${T(this.b)}${T(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:j,toString:j})),r(R,function(e,t,n,r){return 1===arguments.length?O(e):new R(e,t,n,null==r?1:r)},i(a,{brighter(e){return e=null==e?s:Math.pow(s,e),new R(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?o:Math.pow(o,e),new R(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new E(q(e>=240?e-240:e+120,i,r),q(e,i,r),q(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new R(D(this.h),M(this.s),M(this.l),C(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=C(this.opacity);return`${1===e?"hsl(":"hsla("}${D(this.h)}, ${100*M(this.s)}%, ${100*M(this.l)}%${1===e?")":`, ${e})`}`}}))},5606(e){var t=-1;function n(e,f,p,m,g){if(e===f)return e?[[0,e]]:[];if(null!=p){var y=function(e,t,n){var r="number"==typeof n?{index:n,length:0}:n.oldRange,i="number"==typeof n?null:n.newRange,a=e.length,o=t.length;if(0===r.length&&(null===i||0===i.length)){var s=r.index,l=e.slice(0,s),c=e.slice(s),d=i?i.index:null,u=s+o-a;if((null===d||d===u)&&!(u<0||u>o)){var h=t.slice(0,u);if((m=t.slice(u))===c){var f=Math.min(s,u);if((y=l.slice(0,f))===(x=h.slice(0,f)))return v(y,l.slice(f),h.slice(f),c)}}if(null===d||d===s){var p=s,m=(h=t.slice(0,p),t.slice(p));if(h===l){var g=Math.min(a-p,o-p);if((b=c.slice(c.length-g))===(w=m.slice(m.length-g)))return v(l,c.slice(0,c.length-g),m.slice(0,m.length-g),b)}}}if(r.length>0&&i&&0===i.length){var y=e.slice(0,r.index),b=e.slice(r.index+r.length);if(!(o<(f=y.length)+(g=b.length))){var x=t.slice(0,f),w=t.slice(o-g);if(y===x&&b===w)return v(y,e.slice(f,a-g),t.slice(f,o-g),b)}}return null}(e,f,p);if(y)return y}var b=i(e,f),x=e.substring(0,b);b=o(e=e.substring(b),f=f.substring(b));var w=e.substring(e.length-b),_=function(e,a){var s;if(!e)return[[1,a]];if(!a)return[[t,e]];var l=e.length>a.length?e:a,c=e.length>a.length?a:e,d=l.indexOf(c);if(-1!==d)return s=[[1,l.substring(0,d)],[0,c],[1,l.substring(d+c.length)]],e.length>a.length&&(s[0][0]=s[2][0]=t),s;if(1===c.length)return[[t,e],[1,a]];var u=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;function a(e,t,n){for(var r,a,s,l,c=e.substring(n,n+Math.floor(e.length/4)),d=-1,u="";-1!==(d=t.indexOf(c,d+1));){var h=i(e.substring(n),t.substring(d)),f=o(e.substring(0,n),t.substring(0,d));u.length<f+h&&(u=t.substring(d-f,d)+t.substring(d,d+h),r=e.substring(0,n-f),a=e.substring(n+h),s=t.substring(0,d-f),l=t.substring(d+h))}return 2*u.length>=e.length?[r,a,s,l,u]:null}var s,l,c,d,u,h=a(n,r,Math.ceil(n.length/4)),f=a(n,r,Math.ceil(n.length/2));return h||f?(s=f?h&&h[4].length>f[4].length?h:f:h,e.length>t.length?(l=s[0],c=s[1],d=s[2],u=s[3]):(d=s[0],u=s[1],l=s[2],c=s[3]),[l,c,d,u,s[4]]):null}(e,a);if(u){var h=u[0],f=u[1],p=u[2],m=u[3],g=u[4],v=n(h,p),y=n(f,m);return v.concat([[0,g]],y)}return function(e,n){for(var i=e.length,a=n.length,o=Math.ceil((i+a)/2),s=o,l=2*o,c=new Array(l),d=new Array(l),u=0;u<l;u++)c[u]=-1,d[u]=-1;c[s+1]=0,d[s+1]=0;for(var h=i-a,f=h%2!=0,p=0,m=0,g=0,v=0,y=0;y<o;y++){for(var b=-y+p;b<=y-m;b+=2){for(var x=s+b,w=(S=b===-y||b!==y&&c[x-1]<c[x+1]?c[x+1]:c[x-1]+1)-b;S<i&&w<a&&e.charAt(S)===n.charAt(w);)S++,w++;if(c[x]=S,S>i)m+=2;else if(w>a)p+=2;else if(f&&(N=s+h-b)>=0&&N<l&&-1!==d[N]&&S>=(k=i-d[N]))return r(e,n,S,w)}for(var _=-y+g;_<=y-v;_+=2){for(var k,N=s+_,E=(k=_===-y||_!==y&&d[N-1]<d[N+1]?d[N+1]:d[N-1]+1)-_;k<i&&E<a&&e.charAt(i-k-1)===n.charAt(a-E-1);)k++,E++;if(d[N]=k,k>i)v+=2;else if(E>a)g+=2;else if(!f){var S;if((x=s+h-_)>=0&&x<l&&-1!==c[x])if(w=s+(S=c[x])-x,S>=(k=i-k))return r(e,n,S,w)}}}return[[t,e],[1,n]]}(e,a)}(e=e.substring(0,e.length-b),f=f.substring(0,f.length-b));return x&&_.unshift([0,x]),w&&_.push([0,w]),h(_,g),m&&function(e){for(var n=!1,r=[],i=0,f=null,p=0,m=0,g=0,v=0,y=0;p<e.length;)0==e[p][0]?(r[i++]=p,m=v,g=y,v=0,y=0,f=e[p][1]):(1==e[p][0]?v+=e[p][1].length:y+=e[p][1].length,f&&f.length<=Math.max(m,g)&&f.length<=Math.max(v,y)&&(e.splice(r[i-1],0,[t,f]),e[r[i-1]+1][0]=1,i--,p=--i>0?r[i-1]:-1,m=0,g=0,v=0,y=0,f=null,n=!0)),p++;for(n&&h(e),function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(s),a=r.match(s),o=i&&n.match(l),h=a&&r.match(l),f=o&&n.match(c),p=h&&r.match(c),m=f&&e.match(d),g=p&&t.match(u);return m||g?5:f||p?4:i&&!o&&h?3:o||h?2:i||a?1:0}for(var n=1;n<e.length-1;){if(0==e[n-1][0]&&0==e[n+1][0]){var r=e[n-1][1],i=e[n][1],a=e[n+1][1],h=o(r,i);if(h){var f=i.substring(i.length-h);r=r.substring(0,r.length-h),i=f+i.substring(0,i.length-h),a=f+a}for(var p=r,m=i,g=a,v=t(r,i)+t(i,a);i.charAt(0)===a.charAt(0);){r+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var y=t(r,i)+t(i,a);y>=v&&(v=y,p=r,m=i,g=a)}e[n-1][1]!=p&&(p?e[n-1][1]=p:(e.splice(n-1,1),n--),e[n][1]=m,g?e[n+1][1]=g:(e.splice(n+1,1),n--))}n++}}(e),p=1;p<e.length;){if(e[p-1][0]==t&&1==e[p][0]){var b=e[p-1][1],x=e[p][1],w=a(b,x),_=a(x,b);w>=_?(w>=b.length/2||w>=x.length/2)&&(e.splice(p,0,[0,x.substring(0,w)]),e[p-1][1]=b.substring(0,b.length-w),e[p+1][1]=x.substring(w),p++):(_>=b.length/2||_>=x.length/2)&&(e.splice(p,0,[0,b.substring(0,_)]),e[p-1][0]=1,e[p-1][1]=x.substring(0,x.length-_),e[p+1][0]=t,e[p+1][1]=b.substring(_),p++),p++}p++}}(_),_}function r(e,t,r,i){var a=e.substring(0,r),o=t.substring(0,i),s=e.substring(r),l=t.substring(i),c=n(a,o),d=n(s,l);return c.concat(d)}function i(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?a=n=i:r=i,i=Math.floor((r-n)/2+n);return f(e.charCodeAt(i-1))&&i--,i}function a(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),l=t.indexOf(s);if(-1==l)return a;o+=l,0!=l&&e.substring(i-o)!=t.substring(0,o)||(a=o,o++)}}function o(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?a=n=i:r=i,i=Math.floor((r-n)/2+n);return p(e.charCodeAt(e.length-i))&&i--,i}var s=/[^a-zA-Z0-9]/,l=/\s/,c=/[\r\n]/,d=/\n\r?\n$/,u=/^\r?\n\r?\n/;function h(e,n){e.push([0,""]);for(var r,a=0,s=0,l=0,c="",d="";a<e.length;)if(a<e.length-1&&!e[a][1])e.splice(a,1);else switch(e[a][0]){case 1:l++,d+=e[a][1],a++;break;case t:s++,c+=e[a][1],a++;break;case 0:var u=a-l-s-1;if(n){if(u>=0&&g(e[u][1])){var f=e[u][1].slice(-1);if(e[u][1]=e[u][1].slice(0,-1),c=f+c,d=f+d,!e[u][1]){e.splice(u,1),a--;var p=u-1;e[p]&&1===e[p][0]&&(l++,d=e[p][1]+d,p--),e[p]&&e[p][0]===t&&(s++,c=e[p][1]+c,p--),u=p}}m(e[a][1])&&(f=e[a][1].charAt(0),e[a][1]=e[a][1].slice(1),c+=f,d+=f)}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(c.length>0||d.length>0){c.length>0&&d.length>0&&(0!==(r=i(d,c))&&(u>=0?e[u][1]+=d.substring(0,r):(e.splice(0,0,[0,d.substring(0,r)]),a++),d=d.substring(r),c=c.substring(r)),0!==(r=o(d,c))&&(e[a][1]=d.substring(d.length-r)+e[a][1],d=d.substring(0,d.length-r),c=c.substring(0,c.length-r)));var v=l+s;0===c.length&&0===d.length?(e.splice(a-v,v),a-=v):0===c.length?(e.splice(a-v,v,[1,d]),a=a-v+1):0===d.length?(e.splice(a-v,v,[t,c]),a=a-v+1):(e.splice(a-v,v,[t,c],[1,d]),a=a-v+2)}0!==a&&0===e[a-1][0]?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,l=0,s=0,c="",d=""}""===e[e.length-1][1]&&e.pop();var y=!1;for(a=1;a<e.length-1;)0===e[a-1][0]&&0===e[a+1][0]&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),y=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),y=!0)),a++;y&&h(e,n)}function f(e){return e>=55296&&e<=56319}function p(e){return e>=56320&&e<=57343}function m(e){return p(e.charCodeAt(0))}function g(e){return f(e.charCodeAt(e.length-1))}function v(e,n,r,i){return g(e)||m(i)?null:function(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}([[0,e],[t,n],[1,r],[0,i]])}function y(e,t,r,i){return n(e,t,r,i,!0)}y.INSERT=1,y.DELETE=t,y.EQUAL=0,e.exports=y},5620(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(6087),i=n(8395),a=n(790);const o=({price:e=0,currencySymbol:t="",precision:n=null,thousand:o="",decimal:s="",format:l=""})=>(0,a.jsx)(r.RawHTML,{children:(0,i.formatPrice)(e,t,n,o,s,l)})},5654(e,t,n){"use strict";n.d(t,{useWindowDimensions:()=>i});var r=n(6087);function i(){const e=(0,r.useCallback)(()=>({width:"undefined"!=typeof window?window.innerWidth:null,height:"undefined"!=typeof window?window.innerHeight:null}),[]),[t,n]=(0,r.useState)(e());return(0,r.useEffect)(()=>{if("undefined"==typeof window)return;const t=()=>{window.requestAnimationFrame(()=>{n(e())})};return window.addEventListener("resize",t),t(),()=>{window.removeEventListener("resize",t)}},[e]),t}n(7143),n(1455),n(3832),window.dokan.productCategoriesStore,window.dokan.productsStore},5759(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.length=function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"object"==typeof e.retain&&null!==e.retain?1:"string"==typeof e.insert?e.insert.length:1}}(n||(n={})),t.default=n},5773(e,t,n){"use strict";n.d(t,{A:()=>r});const r=(0,n(6203).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},5795(e){"use strict";e.exports=window.ReactDOM},6087(e){"use strict";e.exports=window.wp.element},6203(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(1609),i=n(576),a=n(4991);const o=(e,t)=>{const n=(0,r.forwardRef)(({className:n,...o},s)=>(0,r.createElement)(a.A,{ref:s,iconNode:t,className:(0,i.zP)(`lucide-${(0,i.fX)((0,i.MX)(e))}`,`lucide-${e}`,n),...o}));return n.displayName=(0,i.MX)(e),n}},6427(e){"use strict";e.exports=window.wp.components},6541(e,t,n){"use strict";function r(e){return function(){return this.matches(e)}}function i(e){return function(t){return t.matches(e)}}n.d(t,{A:()=>r,j:()=>i})},6650(e,t,n){"use strict";n.d(t,{A:()=>l,O:()=>s});var r=n(856),i=n(8446),a=n(790);const o={primary:{color:"purple",className:"dokan-btn"},secondary:{color:"blue",className:"dokan-btn-secondary"},tertiary:{color:"purple",className:"dokan-btn-tertiary"},info:{color:"blue",className:"dokan-btn-info"},success:{color:"green",className:"dokan-btn-success"},warning:{color:"yellow",className:"dokan-btn-warning"},danger:{color:"red",className:"dokan-btn-danger"},ghost:{color:"gray",className:"dokan-btn-ghost"}},s=({className:e="",variant:t="primary",...n})=>{const s=o[t];return(0,a.jsx)(i.Button,{color:s.color,className:(0,r.QP)(s.className,e),...n})},l=s},6747(e,t,n){"use strict";function r(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}n.d(t,{A:()=>r})},7046(e,t,n){"use strict";n(1455)},7143(e){"use strict";e.exports=window.wp.data},7193(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",o="[object Boolean]",s="[object Date]",l="[object Function]",c="[object GeneratorFunction]",d="[object Map]",u="[object Number]",h="[object Object]",f="[object Promise]",p="[object RegExp]",m="[object Set]",g="[object String]",v="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",_="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",E="[object Int32Array]",S="[object Uint8Array]",j="[object Uint8ClampedArray]",C="[object Uint16Array]",A="[object Uint32Array]",T=/\w*$/,L=/^\[object .+?Constructor\]$/,O=/^(?:0|[1-9]\d*)$/,R={};R[a]=R["[object Array]"]=R[b]=R[x]=R[o]=R[s]=R[w]=R[_]=R[k]=R[N]=R[E]=R[d]=R[u]=R[h]=R[p]=R[m]=R[g]=R[v]=R[S]=R[j]=R[C]=R[A]=!0,R["[object Error]"]=R[l]=R[y]=!1;var D="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,M="object"==typeof self&&self&&self.Object===Object&&self,q=D||M||Function("return this")(),P=t&&!t.nodeType&&t,I=P&&e&&!e.nodeType&&e,B=I&&I.exports===P;function F(e,t){return e.set(t[0],t[1]),e}function U(e,t){return e.add(t),e}function z(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function $(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function V(e,t){return function(n){return e(t(n))}}function W(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var G,Z=Array.prototype,K=Function.prototype,Y=Object.prototype,X=q["__core-js_shared__"],Q=(G=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",J=K.toString,ee=Y.hasOwnProperty,te=Y.toString,ne=RegExp("^"+J.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=B?q.Buffer:void 0,ie=q.Symbol,ae=q.Uint8Array,oe=V(Object.getPrototypeOf,Object),se=Object.create,le=Y.propertyIsEnumerable,ce=Z.splice,de=Object.getOwnPropertySymbols,ue=re?re.isBuffer:void 0,he=V(Object.keys,Object),fe=qe(q,"DataView"),pe=qe(q,"Map"),me=qe(q,"Promise"),ge=qe(q,"Set"),ve=qe(q,"WeakMap"),ye=qe(Object,"create"),be=Ue(fe),xe=Ue(pe),we=Ue(me),_e=Ue(ge),ke=Ue(ve),Ne=ie?ie.prototype:void 0,Ee=Ne?Ne.valueOf:void 0;function Se(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function je(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ce(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){this.__data__=new je(e)}function Te(e,t,n){var r=e[t];ee.call(e,t)&&ze(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Le(e,t){for(var n=e.length;n--;)if(ze(e[n][0],t))return n;return-1}function Oe(e,t,n,r,i,f,y){var L;if(r&&(L=f?r(e,i,f,y):r(e)),void 0!==L)return L;if(!Ge(e))return e;var O=$e(e);if(O){if(L=function(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!t)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,L)}else{var D=Ie(e),M=D==l||D==c;if(Ve(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(D==h||D==a||M&&!f){if($(e))return f?e:{};if(L=function(e){return"function"!=typeof e.constructor||Fe(e)?{}:Ge(t=oe(e))?se(t):{};var t}(M?{}:e),!t)return function(e,t){return De(e,Pe(e),t)}(e,function(e,t){return e&&De(t,Ze(t),e)}(L,e))}else{if(!R[D])return f?e:{};L=function(e,t,n,r){var i,a=e.constructor;switch(t){case b:return Re(e);case o:case s:return new a(+e);case x:return function(e,t){var n=t?Re(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case _:case k:case N:case E:case S:case j:case C:case A:return function(e,t){var n=t?Re(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case d:return function(e,t,n){return z(t?n(H(e),!0):H(e),F,new e.constructor)}(e,r,n);case u:case g:return new a(e);case p:return function(e){var t=new e.constructor(e.source,T.exec(e));return t.lastIndex=e.lastIndex,t}(e);case m:return function(e,t,n){return z(t?n(W(e),!0):W(e),U,new e.constructor)}(e,r,n);case v:return i=e,Ee?Object(Ee.call(i)):{}}}(e,D,Oe,t)}}y||(y=new Ae);var q=y.get(e);if(q)return q;if(y.set(e,L),!O)var P=n?function(e){return function(e,t,n){var r=t(e);return $e(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,Ze,Pe)}(e):Ze(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n););}(P||e,function(i,a){P&&(i=e[a=i]),Te(L,a,Oe(i,t,n,r,a,e,y))}),L}function Re(e){var t=new e.constructor(e.byteLength);return new ae(t).set(new ae(e)),t}function De(e,t,n,r){n||(n={});for(var i=-1,a=t.length;++i<a;){var o=t[i],s=r?r(n[o],e[o],o,n,e):void 0;Te(n,o,void 0===s?e[o]:s)}return n}function Me(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function qe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ge(e)||(t=e,Q&&Q in t))&&(We(e)||$(e)?ne:L).test(Ue(e));var t}(n)?n:void 0}Se.prototype.clear=function(){this.__data__=ye?ye(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(ye){var n=t[e];return n===r?void 0:n}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?r:t,this},je.prototype.clear=function(){this.__data__=[]},je.prototype.delete=function(e){var t=this.__data__,n=Le(t,e);return!(n<0||(n==t.length-1?t.pop():ce.call(t,n,1),0))},je.prototype.get=function(e){var t=this.__data__,n=Le(t,e);return n<0?void 0:t[n][1]},je.prototype.has=function(e){return Le(this.__data__,e)>-1},je.prototype.set=function(e,t){var n=this.__data__,r=Le(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ce.prototype.clear=function(){this.__data__={hash:new Se,map:new(pe||je),string:new Se}},Ce.prototype.delete=function(e){return Me(this,e).delete(e)},Ce.prototype.get=function(e){return Me(this,e).get(e)},Ce.prototype.has=function(e){return Me(this,e).has(e)},Ce.prototype.set=function(e,t){return Me(this,e).set(e,t),this},Ae.prototype.clear=function(){this.__data__=new je},Ae.prototype.delete=function(e){return this.__data__.delete(e)},Ae.prototype.get=function(e){return this.__data__.get(e)},Ae.prototype.has=function(e){return this.__data__.has(e)},Ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof je){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ce(r)}return n.set(e,t),this};var Pe=de?V(de,Object):function(){return[]},Ie=function(e){return te.call(e)};function Be(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||O.test(e))&&e>-1&&e%1==0&&e<t}function Fe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Y)}function Ue(e){if(null!=e){try{return J.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function ze(e,t){return e===t||e!=e&&t!=t}(fe&&Ie(new fe(new ArrayBuffer(1)))!=x||pe&&Ie(new pe)!=d||me&&Ie(me.resolve())!=f||ge&&Ie(new ge)!=m||ve&&Ie(new ve)!=y)&&(Ie=function(e){var t=te.call(e),n=t==h?e.constructor:void 0,r=n?Ue(n):void 0;if(r)switch(r){case be:return x;case xe:return d;case we:return f;case _e:return m;case ke:return y}return t});var $e=Array.isArray;function He(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}(e.length)&&!We(e)}var Ve=ue||function(){return!1};function We(e){var t=Ge(e)?te.call(e):"";return t==l||t==c}function Ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ze(e){return He(e)?function(e,t){var n=$e(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&He(e)}(e)&&ee.call(e,"callee")&&(!le.call(e,"callee")||te.call(e)==a)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var o in e)!t&&!ee.call(e,o)||i&&("length"==o||Be(o,r))||n.push(o);return n}(e):function(e){if(!Fe(e))return he(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Oe(e,!0,!0)}},7268(e,t,n){"use strict";n.d(t,{A:()=>i});var r=n(7947);function i(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),r.A.hasOwnProperty(t)?{space:r.A[t],local:e}:e}},7374(e){"use strict";e.exports=window.wc.date},7482(e,t,n){"use strict";function r(e){return e.toLowerCase()}n.d(t,{W:()=>o});var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function o(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?i:n,l=t.stripRegexp,c=void 0===l?a:l,d=t.transform,u=void 0===d?r:d,h=t.delimiter,f=void 0===h?" ":h,p=s(s(e,o,"$1\0$2"),c,"\0"),m=0,g=p.length;"\0"===p.charAt(m);)m++;for(;"\0"===p.charAt(g-1);)g--;return p.slice(m,g).split("\0").map(u).join(f)}function s(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce(function(e,t){return e.replace(t,n)},e)}},7512(e){"use strict";e.exports=window.dokan.pluginUI},7710(e,t,n){"use strict";n.d(t,{kW:()=>r.c});var r=n(9728)},7723(e){"use strict";e.exports=window.wp.i18n},7737(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(8981),i=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,a=new RegExp(i.source,"g");function o(e,t){var n,o,s,l=i.lastIndex=a.lastIndex=0,c=-1,d=[],u=[];for(e+="",t+="";(n=i.exec(e))&&(o=a.exec(t));)(s=o.index)>l&&(s=t.slice(l,s),d[c]?d[c]+=s:d[++c]=s),(n=n[0])===(o=o[0])?d[c]?d[c]+=o:d[++c]=o:(d[++c]=null,u.push({i:c,x:(0,r.A)(n,o)})),l=a.lastIndex;return l<t.length&&(s=t.slice(l),d[c]?d[c]+=s:d[++c]=s),d.length<2?u[0]?function(e){return function(t){return e(t)+""}}(u[0].x):function(e){return function(){return e}}(t):(t=u.length,function(e){for(var n,r=0;r<t;++r)d[(n=u[r]).i]=n.x(e);return d.join("")})}},7947(e,t,n){"use strict";n.d(t,{A:()=>i,g:()=>r});var r="http://www.w3.org/1999/xhtml";const i={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},8142(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",o="[object Array]",s="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",u="[object Map]",h="[object Number]",f="[object Object]",p="[object Promise]",m="[object RegExp]",g="[object Set]",v="[object String]",y="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",w=/^\[object .+?Constructor\]$/,_=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[a]=k[o]=k[b]=k[s]=k[x]=k[l]=k[c]=k[d]=k[u]=k[h]=k[f]=k[m]=k[g]=k[v]=k[y]=!1;var N="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,E="object"==typeof self&&self&&self.Object===Object&&self,S=N||E||Function("return this")(),j=t&&!t.nodeType&&t,C=j&&e&&!e.nodeType&&e,A=C&&C.exports===j,T=A&&N.process,L=function(){try{return T&&T.binding&&T.binding("util")}catch(e){}}(),O=L&&L.isTypedArray;function R(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function D(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function M(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var q,P,I,B=Array.prototype,F=Function.prototype,U=Object.prototype,z=S["__core-js_shared__"],$=F.toString,H=U.hasOwnProperty,V=(q=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",W=U.toString,G=RegExp("^"+$.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Z=A?S.Buffer:void 0,K=S.Symbol,Y=S.Uint8Array,X=U.propertyIsEnumerable,Q=B.splice,J=K?K.toStringTag:void 0,ee=Object.getOwnPropertySymbols,te=Z?Z.isBuffer:void 0,ne=(P=Object.keys,I=Object,function(e){return P(I(e))}),re=Ce(S,"DataView"),ie=Ce(S,"Map"),ae=Ce(S,"Promise"),oe=Ce(S,"Set"),se=Ce(S,"WeakMap"),le=Ce(Object,"create"),ce=Oe(re),de=Oe(ie),ue=Oe(ae),he=Oe(oe),fe=Oe(se),pe=K?K.prototype:void 0,me=pe?pe.valueOf:void 0;function ge(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ve(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ye(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function be(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ye;++t<n;)this.add(e[t])}function xe(e){var t=this.__data__=new ve(e);this.size=t.size}function we(e,t){for(var n=e.length;n--;)if(Re(e[n][0],t))return n;return-1}function _e(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":J&&J in Object(e)?function(e){var t=H.call(e,J),n=e[J];try{e[J]=void 0;var r=!0}catch(e){}var i=W.call(e);return r&&(t?e[J]=n:delete e[J]),i}(e):function(e){return W.call(e)}(e)}function ke(e){return Fe(e)&&_e(e)==a}function Ne(e,t,n,r,i){return e===t||(null==e||null==t||!Fe(e)&&!Fe(t)?e!=e&&t!=t:function(e,t,n,r,i,d){var p=Me(e),y=Me(t),w=p?o:Te(e),_=y?o:Te(t),k=(w=w==a?f:w)==f,N=(_=_==a?f:_)==f,E=w==_;if(E&&qe(e)){if(!qe(t))return!1;p=!0,k=!1}if(E&&!k)return d||(d=new xe),p||Ue(e)?Ee(e,t,n,r,i,d):function(e,t,n,r,i,a,o){switch(n){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!a(new Y(e),new Y(t)));case s:case l:case h:return Re(+e,+t);case c:return e.name==t.name&&e.message==t.message;case m:case v:return e==t+"";case u:var d=D;case g:var f=1&r;if(d||(d=M),e.size!=t.size&&!f)return!1;var p=o.get(e);if(p)return p==t;r|=2,o.set(e,t);var y=Ee(d(e),d(t),r,i,a,o);return o.delete(e),y;case"[object Symbol]":if(me)return me.call(e)==me.call(t)}return!1}(e,t,w,n,r,i,d);if(!(1&n)){var S=k&&H.call(e,"__wrapped__"),j=N&&H.call(t,"__wrapped__");if(S||j){var C=S?e.value():e,A=j?t.value():t;return d||(d=new xe),i(C,A,n,r,d)}}return!!E&&(d||(d=new xe),function(e,t,n,r,i,a){var o=1&n,s=Se(e),l=s.length;if(l!=Se(t).length&&!o)return!1;for(var c=l;c--;){var d=s[c];if(!(o?d in t:H.call(t,d)))return!1}var u=a.get(e);if(u&&a.get(t))return u==t;var h=!0;a.set(e,t),a.set(t,e);for(var f=o;++c<l;){var p=e[d=s[c]],m=t[d];if(r)var g=o?r(m,p,d,t,e,a):r(p,m,d,e,t,a);if(!(void 0===g?p===m||i(p,m,n,r,a):g)){h=!1;break}f||(f="constructor"==d)}if(h&&!f){var v=e.constructor,y=t.constructor;v==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof y&&y instanceof y||(h=!1)}return a.delete(e),a.delete(t),h}(e,t,n,r,i,d))}(e,t,n,r,Ne,i))}function Ee(e,t,n,r,i,a){var o=1&n,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var c=a.get(e);if(c&&a.get(t))return c==t;var d=-1,u=!0,h=2&n?new be:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var f=e[d],p=t[d];if(r)var m=o?r(p,f,d,t,e,a):r(f,p,d,e,t,a);if(void 0!==m){if(m)continue;u=!1;break}if(h){if(!R(t,function(e,t){if(o=t,!h.has(o)&&(f===e||i(f,e,n,r,a)))return h.push(t);var o})){u=!1;break}}else if(f!==p&&!i(f,p,n,r,a)){u=!1;break}}return a.delete(e),a.delete(t),u}function Se(e){return function(e,t,n){var r=t(e);return Me(e)?r:function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}(r,n(e))}(e,ze,Ae)}function je(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Ce(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Be(e)||function(e){return!!V&&V in e}(e))&&(Pe(e)?G:w).test(Oe(e))}(n)?n:void 0}ge.prototype.clear=function(){this.__data__=le?le(null):{},this.size=0},ge.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ge.prototype.get=function(e){var t=this.__data__;if(le){var n=t[e];return n===r?void 0:n}return H.call(t,e)?t[e]:void 0},ge.prototype.has=function(e){var t=this.__data__;return le?void 0!==t[e]:H.call(t,e)},ge.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=le&&void 0===t?r:t,this},ve.prototype.clear=function(){this.__data__=[],this.size=0},ve.prototype.delete=function(e){var t=this.__data__,n=we(t,e);return!(n<0||(n==t.length-1?t.pop():Q.call(t,n,1),--this.size,0))},ve.prototype.get=function(e){var t=this.__data__,n=we(t,e);return n<0?void 0:t[n][1]},ve.prototype.has=function(e){return we(this.__data__,e)>-1},ve.prototype.set=function(e,t){var n=this.__data__,r=we(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ye.prototype.clear=function(){this.size=0,this.__data__={hash:new ge,map:new(ie||ve),string:new ge}},ye.prototype.delete=function(e){var t=je(this,e).delete(e);return this.size-=t?1:0,t},ye.prototype.get=function(e){return je(this,e).get(e)},ye.prototype.has=function(e){return je(this,e).has(e)},ye.prototype.set=function(e,t){var n=je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},be.prototype.add=be.prototype.push=function(e){return this.__data__.set(e,r),this},be.prototype.has=function(e){return this.__data__.has(e)},xe.prototype.clear=function(){this.__data__=new ve,this.size=0},xe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},xe.prototype.get=function(e){return this.__data__.get(e)},xe.prototype.has=function(e){return this.__data__.has(e)},xe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ve){var r=n.__data__;if(!ie||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ye(r)}return n.set(e,t),this.size=n.size,this};var Ae=ee?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o)&&(a[i++]=o)}return a}(ee(e),function(t){return X.call(e,t)}))}:function(){return[]},Te=_e;function Le(e,t){return!!(t=null==t?i:t)&&("number"==typeof e||_.test(e))&&e>-1&&e%1==0&&e<t}function Oe(e){if(null!=e){try{return $.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Re(e,t){return e===t||e!=e&&t!=t}(re&&Te(new re(new ArrayBuffer(1)))!=x||ie&&Te(new ie)!=u||ae&&Te(ae.resolve())!=p||oe&&Te(new oe)!=g||se&&Te(new se)!=y)&&(Te=function(e){var t=_e(e),n=t==f?e.constructor:void 0,r=n?Oe(n):"";if(r)switch(r){case ce:return x;case de:return u;case ue:return p;case he:return g;case fe:return y}return t});var De=ke(function(){return arguments}())?ke:function(e){return Fe(e)&&H.call(e,"callee")&&!X.call(e,"callee")},Me=Array.isArray,qe=te||function(){return!1};function Pe(e){if(!Be(e))return!1;var t=_e(e);return t==d||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ie(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Be(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Fe(e){return null!=e&&"object"==typeof e}var Ue=O?function(e){return function(t){return e(t)}}(O):function(e){return Fe(e)&&Ie(e.length)&&!!k[_e(e)]};function ze(e){return null!=(t=e)&&Ie(t.length)&&!Pe(t)?function(e,t){var n=Me(e),r=!n&&De(e),i=!n&&!r&&qe(e),a=!n&&!r&&!i&&Ue(e),o=n||r||i||a,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!H.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Le(c,l))||s.push(c);return s}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||U))return ne(e);var t,n,r=[];for(var i in Object(e))H.call(e,i)&&"constructor"!=i&&r.push(i);return r}(e);var t}e.exports=function(e,t){return Ne(e,t)}},8227(e,t,n){"use strict";n.d(t,{LN:()=>ae,Ay:()=>se});var r=n(574),i=n(747);var a=n(6541),o=Array.prototype.find;function s(){return this.firstElementChild}var l=Array.prototype.filter;function c(){return Array.from(this.children)}function d(e){return new Array(e.length)}function u(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function h(e,t,n,r,i,a){for(var o,s=0,l=t.length,c=a.length;s<c;++s)(o=t[s])?(o.__data__=a[s],r[s]=o):n[s]=new u(e,a[s]);for(;s<l;++s)(o=t[s])&&(i[s]=o)}function f(e,t,n,r,i,a,o){var s,l,c,d=new Map,h=t.length,f=a.length,p=new Array(h);for(s=0;s<h;++s)(l=t[s])&&(p[s]=c=o.call(l,l.__data__,s,t)+"",d.has(c)?i[s]=l:d.set(c,l));for(s=0;s<f;++s)c=o.call(e,a[s],s,a)+"",(l=d.get(c))?(r[s]=l,l.__data__=a[s],d.delete(c)):n[s]=new u(e,a[s]);for(s=0;s<h;++s)(l=t[s])&&d.get(p[s])===l&&(i[s]=l)}function p(e){return e.__data__}function m(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function g(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}u.prototype={constructor:u,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var v=n(7268);function y(e){return function(){this.removeAttribute(e)}}function b(e){return function(){this.removeAttributeNS(e.space,e.local)}}function x(e,t){return function(){this.setAttribute(e,t)}}function w(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function _(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function k(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}var N=n(3683);function E(e){return function(){delete this[e]}}function S(e,t){return function(){this[e]=t}}function j(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function C(e){return e.trim().split(/^|\s+/)}function A(e){return e.classList||new T(e)}function T(e){this._node=e,this._names=C(e.getAttribute("class")||"")}function L(e,t){for(var n=A(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function O(e,t){for(var n=A(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function R(e){return function(){L(this,e)}}function D(e){return function(){O(this,e)}}function M(e,t){return function(){(t.apply(this,arguments)?L:O)(this,e)}}function q(){this.textContent=""}function P(e){return function(){this.textContent=e}}function I(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function B(){this.innerHTML=""}function F(e){return function(){this.innerHTML=e}}function U(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function z(){this.nextSibling&&this.parentNode.appendChild(this)}function $(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}T.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var H=n(7947);function V(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===H.g&&t.documentElement.namespaceURI===H.g?t.createElement(e):t.createElementNS(n,e)}}function W(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function G(e){var t=(0,v.A)(e);return(t.local?W:V)(t)}function Z(){return null}function K(){var e=this.parentNode;e&&e.removeChild(this)}function Y(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function X(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Q(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?t.length=i:delete this.__on}}}function J(e,t,n){return function(){var r,i=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(i)for(var o=0,s=i.length;o<s;++o)if((r=i[o]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=t);this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},i?i.push(r):this.__on=[r]}}var ee=n(6747);function te(e,t,n){var r=(0,ee.A)(e),i=r.CustomEvent;"function"==typeof i?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function ne(e,t){return function(){return te(this,e,t)}}function re(e,t){return function(){return te(this,e,t.apply(this,arguments))}}var ie=[null];function ae(e,t){this._groups=e,this._parents=t}function oe(){return new ae([[document.documentElement]],ie)}ae.prototype=oe.prototype={constructor:ae,select:function(e){"function"!=typeof e&&(e=(0,r.A)(e));for(var t=this._groups,n=t.length,i=new Array(n),a=0;a<n;++a)for(var o,s,l=t[a],c=l.length,d=i[a]=new Array(c),u=0;u<c;++u)(o=l[u])&&(s=e.call(o,o.__data__,u,l))&&("__data__"in o&&(s.__data__=o.__data__),d[u]=s);return new ae(i,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(e):(0,i.A)(e);for(var t=this._groups,n=t.length,r=[],a=[],o=0;o<n;++o)for(var s,l=t[o],c=l.length,d=0;d<c;++d)(s=l[d])&&(r.push(e.call(s,s.__data__,d,l)),a.push(s));return new ae(r,a)},selectChild:function(e){return this.select(null==e?s:function(e){return function(){return o.call(this.children,e)}}("function"==typeof e?e:(0,a.j)(e)))},selectChildren:function(e){return this.selectAll(null==e?c:function(e){return function(){return l.call(this.children,e)}}("function"==typeof e?e:(0,a.j)(e)))},filter:function(e){"function"!=typeof e&&(e=(0,a.A)(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o,s=t[i],l=s.length,c=r[i]=[],d=0;d<l;++d)(o=s[d])&&e.call(o,o.__data__,d,s)&&c.push(o);return new ae(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,p);var n,r=t?f:h,i=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var o=a.length,s=new Array(o),l=new Array(o),c=new Array(o),d=0;d<o;++d){var u=i[d],g=a[d],v=g.length,y=m(e.call(u,u&&u.__data__,d,i)),b=y.length,x=l[d]=new Array(b),w=s[d]=new Array(b);r(u,g,x,w,c[d]=new Array(v),y,t);for(var _,k,N=0,E=0;N<b;++N)if(_=x[N]){for(N>=E&&(E=N+1);!(k=w[E])&&++E<b;);_._next=k||null}}return(s=new ae(s,i))._enter=l,s._exit=c,s},enter:function(){return new ae(this._enter||this._groups.map(d),this._parents)},exit:function(){return new ae(this._exit||this._groups.map(d),this._parents)},join:function(e,t,n){var r=this.enter(),i=this,a=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(i=t(i))&&(i=i.selection()),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=new Array(i),l=0;l<o;++l)for(var c,d=n[l],u=r[l],h=d.length,f=s[l]=new Array(h),p=0;p<h;++p)(c=d[p]||u[p])&&(f[p]=c);for(;l<i;++l)s[l]=n[l];return new ae(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,i=e[t],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=g);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o,s=n[a],l=s.length,c=i[a]=new Array(l),d=0;d<l;++d)(o=s[d])&&(c[d]=o);c.sort(t)}return new ae(i,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i,a=t[n],o=0,s=a.length;o<s;++o)(i=a[o])&&e.call(i,i.__data__,o,a);return this},attr:function(e,t){var n=(0,v.A)(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?b:y:"function"==typeof t?n.local?k:_:n.local?w:x)(n,t))},style:N.A,property:function(e,t){return arguments.length>1?this.each((null==t?E:"function"==typeof t?j:S)(e,t)):this.node()[e]},classed:function(e,t){var n=C(e+"");if(arguments.length<2){for(var r=A(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof t?M:t?R:D)(n,t))},text:function(e){return arguments.length?this.each(null==e?q:("function"==typeof e?I:P)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?B:("function"==typeof e?U:F)(e)):this.node().innerHTML},raise:function(){return this.each(z)},lower:function(){return this.each($)},append:function(e){var t="function"==typeof e?e:G(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:G(e),i=null==t?Z:"function"==typeof t?t:(0,r.A)(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(K)},clone:function(e){return this.select(e?X:Y)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,i,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),o=a.length;if(!(arguments.length<2)){for(s=t?J:Q,r=0;r<o;++r)this.each(s(a[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,d=s.length;c<d;++c)for(r=0,l=s[c];r<o;++r)if((i=a[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?re:ne)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,i=e[t],a=0,o=i.length;a<o;++a)(r=i[a])&&(yield r)}};const se=oe},8317(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5759);t.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);const t=this.ops[this.index];if(t){const n=this.offset,i=r.default.length(t);if(e>=i-n?(e=i-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};{const r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"object"==typeof t.retain&&null!==t.retain?r.retain=t.retain:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?r.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const e=this.ops[this.index];return e?"number"==typeof e.delete?"delete":"number"==typeof e.retain||"object"==typeof e.retain&&null!==e.retain?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);{const e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}return[]}}},8395(e){"use strict";e.exports=window.dokan.utilities},8409(e,t,n){"use strict";n(4960),n(6087),n(2956),n(790)},8443(e){"use strict";e.exports=window.wp.date},8446(e){"use strict";e.exports=window.dokan.dokanUI},8448(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(790);const i=({className:e="",color:t="text-primary-500"})=>(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"221",height:"86",viewBox:"0 0 221 86",fill:"none",className:`${e} ${t}`,children:[(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.6666 85.6258H57.8382V70.3622H64.039L68.3319 56.5295H57.8382V0.721863H35.4197L0.122559 55.5756V70.3622H40.6666V85.6258ZM16.8173 57.0065H40.6667V18.3704L16.8173 57.0065Z",fill:"currentColor"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M193.303 85.6258H210.475V70.3622H216.676L220.968 56.5295H210.475V0.721863H188.056L152.759 55.5756V70.3622H193.303V85.6258ZM169.454 57.0065H193.303V18.3704L169.454 57.0065Z",fill:"currentColor"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M109.353 79.902C129.637 79.902 146.081 63.4582 146.081 43.1739C146.081 22.8895 129.637 6.44572 109.353 6.44572C89.0686 6.44572 72.6249 22.8895 72.6249 43.1739C72.6249 63.4582 89.0686 79.902 109.353 79.902ZM109.353 64.6383C121.207 64.6383 130.817 55.0283 130.817 43.1738C130.817 31.3193 121.207 21.7093 109.353 21.7093C97.4984 21.7093 87.8885 31.3193 87.8885 43.1738C87.8885 55.0283 97.4984 64.6383 109.353 64.6383Z",fill:"currentColor"})]});var a=n(7723),o=n(6650),s=n(6427),l=n(856);const c=({children:e,navigateButton:t,title:n=(0,a.__)("Sorry, the page can’t be found","dokan-lite"),message:c=(0,a.__)("The page you were looking for appears to have been moved, deleted or does not exist","dokan-lite"),className:d="",backToDashboardUrl:u=null})=>{var h;const f=null!==(h=window.dokan?.urls?.dashboardUrl)&&void 0!==h?h:"#";return(0,r.jsx)(r.Fragment,{children:e||(0,r.jsxs)("div",{className:(0,l.QP)("bg-[url('/assets/images/error-page-bg.png')] bg-no-repeat bg-center w-full bg-cover h-[21rem]",d),children:[(0,r.jsx)(s.Slot,{name:"before-dokan-not-found"}),(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[(0,r.jsx)(i,{color:"text-dokan-link"}),(0,r.jsxs)("div",{className:"flex flex-col gap-4 justify-center items-center",children:[(0,r.jsx)("h1",{className:"text-xl font-bold text-center tracking-wide leading-6",children:n}),(0,r.jsx)("p",{className:"max-w-[23rem] text-center font-normal leading-5 text-[#637381]",children:c}),null!=t?t:(0,r.jsx)(o.O,{link:!0,href:null!=u?u:f,variant:"primary",className:"w-[10.5rem] mt-2 py-2 text-center",children:(0,a.__)("Back to Dashboard","dokan-lite")})]})]}),(0,r.jsx)(s.Slot,{name:"after-dokan-not-found"})]})})}},8468(e){"use strict";e.exports=window.lodash},8537(e){"use strict";e.exports=window.wp.htmlEntities},8697(e,t,n){"use strict";n.d(t,{A:()=>r});const r=(0,n(6203).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},8981(e,t,n){"use strict";function r(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}n.d(t,{A:()=>r})},9106(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7193),i=n(8142);var a;!function(e){e.compose=function(e={},t={},n=!1){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});let i=r(t);n||(i=Object.keys(i).reduce((e,t)=>(null!=i[t]&&(e[t]=i[t]),e),{}));for(const n in e)void 0!==e[n]&&void 0===t[n]&&(i[n]=e[n]);return Object.keys(i).length>0?i:void 0},e.diff=function(e={},t={}){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});const n=Object.keys(e).concat(Object.keys(t)).reduce((n,r)=>(i(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n),{});return Object.keys(n).length>0?n:void 0},e.invert=function(e={},t={}){e=e||{};const n=Object.keys(t).reduce((n,r)=>(t[r]!==e[r]&&void 0!==e[r]&&(n[r]=t[r]),n),{});return Object.keys(e).reduce((n,r)=>(e[r]!==t[r]&&void 0===t[r]&&(n[r]=null),n),n)},e.transform=function(e,t,n=!1){if("object"!=typeof e)return t;if("object"!=typeof t)return;if(!n)return t;const r=Object.keys(t).reduce((n,r)=>(void 0===e[r]&&(n[r]=t[r]),n),{});return Object.keys(r).length>0?r:void 0}}(a||(a={})),t.default=a},9284(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(7723),i=n(790);const a=({className:e="",color:t="text-primary-500"})=>(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"105",viewBox:"0 0 80 105",fill:"none",className:`${e} ${t}`,children:[(0,i.jsx)("path",{d:"M0.988037 18.91C0.988037 14.9902 3.46537 11.4984 7.16516 10.2035L34.8384 0.517873C36.8113 -0.172625 38.9601 -0.172624 40.933 0.517874L68.6062 10.2035C72.306 11.4984 74.7834 14.9902 74.7834 18.91V67.712C74.7834 72.8065 70.6534 76.9364 65.5589 76.9364H10.2125C5.11795 76.9364 0.988037 72.8065 0.988037 67.712V18.91Z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M43.4201 14.2104C43.4201 17.2671 40.9422 19.745 37.8855 19.745C34.8288 19.745 32.3508 17.2671 32.3508 14.2104C32.3508 11.1537 34.8288 8.67574 37.8855 8.67574C40.9422 8.67574 43.4201 11.1537 43.4201 14.2104Z",fill:"#C8D1EA"}),(0,i.jsx)("path",{d:"M14.9194 59.2575C14.9194 56.2008 17.3974 53.7228 20.4541 53.7228H57.3517C60.4084 53.7228 62.8864 56.2008 62.8864 59.2575V74.0165C62.8864 87.2622 52.1486 98 38.9029 98C25.6572 98 14.9194 87.2622 14.9194 74.0165V59.2575Z",fill:"#C8D1EA"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.5337 88.1632L27.9548 53.7228H35.3344L25.5072 93.9134C23.1987 92.3561 21.1758 90.4077 19.5337 88.1632ZM32.125 97.0289C30.96 96.6863 29.8318 96.2577 28.7478 95.7504L39.0241 53.7228H42.7139L32.125 97.0289Z",fill:"white"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.1191 36.5593C31.7139 33.9644 35.2333 32.5067 38.903 32.5067C42.5727 32.5067 46.0921 33.9644 48.687 36.5593C51.2819 39.1542 52.7397 42.6736 52.7397 46.3433C52.7397 47.8716 51.5007 49.1106 49.9723 49.1106C48.444 49.1106 47.205 47.8716 47.205 46.3433C47.205 44.1415 46.3303 42.0298 44.7734 40.4729C43.2165 38.916 41.1048 38.0413 38.903 38.0413C36.7012 38.0413 34.5896 38.916 33.0326 40.4729C31.4757 42.0298 30.6011 44.1415 30.6011 46.3433C30.6011 47.8716 29.3621 49.1106 27.8337 49.1106C26.3054 49.1106 25.0664 47.8716 25.0664 46.3433C25.0664 42.6736 26.5242 39.1542 29.1191 36.5593Z",fill:"#C8D1EA"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.2295 76.2528C42.0382 75.488 42.3784 74.7056 42.9207 74.1334C43.861 73.1414 44.4377 71.8014 44.4377 70.3268C44.4377 67.2701 41.9598 64.7921 38.9031 64.7921C35.8464 64.7921 33.3684 67.2701 33.3684 70.3268C33.3684 71.8014 33.9452 73.1414 34.8854 74.1334C35.4277 74.7056 35.7679 75.488 35.5767 76.2528L33.9415 82.7935C33.6504 83.9579 34.5311 85.0858 35.7313 85.0858H42.0748C43.2751 85.0858 44.1557 83.9579 43.8646 82.7935L42.2295 76.2528Z",fill:"currentColor"})]});var o=n(6427),s=n(4960);const l=({children:e,navigateButton:t,title:n=(0,r.__)("Permission Denied","dokan-lite"),message:l=(0,r.__)("Sorry, you don’t have permission to access this page","dokan-lite")})=>{var c;const d=null!==(c=window.dokan?.urls?.dashboardUrl)&&void 0!==c?c:"#";return(0,i.jsx)(i.Fragment,{children:e||(0,i.jsxs)("div",{className:"bg-[url('/assets/images/error-page-bg.png')] bg-no-repeat bg-center w-full bg-cover h-[21rem] ",children:[(0,i.jsx)(o.Slot,{name:"before-dokan-forbidden"}),(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[(0,i.jsx)(a,{color:"text-dokan-link"}),(0,i.jsxs)("div",{className:"flex flex-col gap-1 justify-center items-center",children:[(0,i.jsx)("h1",{className:"text-xl font-bold text-center tracking-wide",children:n}),(0,i.jsx)("p",{className:"max-w-[24rem] text-center font-normal leading-6 text-[#637381]",children:l}),null!=t?t:(0,i.jsx)(s.DokanButton,{link:!0,href:d,variant:"primary",className:"w-[10.5rem] mt-2 py-2",children:(0,r.__)("Back to Dashboard","dokan-lite")})]})]}),(0,i.jsx)(o.Slot,{name:"after-dokan-forbidden"})]})})}},9491(e){"use strict";e.exports=window.wp.compose},9728(e,t,n){"use strict";n.d(t,{c:()=>a});var r=n(1635),i=n(5098);function a(e,t){return void 0===t&&(t={}),(0,i.a)(e,(0,r.Cl)({delimiter:"-"},t))}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={id:r,loaded:!1,exports:{}};return e[r](a,a.exports,n),a.loaded=!0,a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e=n(6087);const t=window.wp.domReady;var r=n.n(t),i=n(2619),a=n(7723),o=n(6203);const s=(0,o.A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var l=n(6427);const c=window.dokan.components;var d,u=n(1609);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(d||(d={}));const f="popstate";function p(e){return void 0===e&&(e={}),function(e,t,n,r){void 0===r&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=d.Pop,l=null,c=u();function u(){return(o.state||{idx:null}).idx}function p(){s=d.Pop;let e=u(),t=null==e?null:e-c;c=e,l&&l({action:s,location:x.location,delta:t})}function g(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof e?e:b(e);return n=n.replace(/ $/,"%20"),m(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==c&&(c=0,o.replaceState(h({},o.state,{idx:c}),""));let x={get action(){return s},get location(){return e(i,o)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(f,p),l=e,()=>{i.removeEventListener(f,p),l=null}},createHref:e=>t(i,e),createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){s=d.Push;let r=y(x.location,e,t);n&&n(r,e),c=u()+1;let h=v(r,c),f=x.createHref(r);try{o.pushState(h,"",f)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(f)}a&&l&&l({action:s,location:x.location,delta:1})},replace:function(e,t){s=d.Replace;let r=y(x.location,e,t);n&&n(r,e),c=u();let i=v(r,c),h=x.createHref(r);o.replaceState(i,"",h),a&&l&&l({action:s,location:x.location,delta:0})},go:e=>o.go(e)};return x}(function(e,t){let{pathname:n="/",search:r="",hash:i=""}=x(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),y("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:b(t))},function(e,t){g("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function m(e,t){if(!1===e||null==e)throw new Error(t)}function g(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function v(e,t){return{usr:e.state,key:e.key,idx:t}}function y(e,t,n,r){return void 0===n&&(n=null),h({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?x(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function b(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function x(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var w;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(w||(w={}));const _=new Set(["lazy","caseSensitive","path","id","index","children"]);function k(e,t,n,r){return void 0===n&&(n=[]),void 0===r&&(r={}),e.map((e,i)=>{let a=[...n,String(i)],o="string"==typeof e.id?e.id:a.join("-");if(m(!0!==e.index||!e.children,"Cannot specify children on an index route"),m(!r[o],'Found a route id collision on id "'+o+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=h({},e,t(e),{id:o});return r[o]=n,n}{let n=h({},e,t(e),{id:o,children:void 0});return r[o]=n,e.children&&(n.children=k(e.children,t,a,r)),n}})}function N(e,t,n){return void 0===n&&(n="/"),E(e,t,n,!1)}function E(e,t,n,r){let i=F(("string"==typeof t?x(t):t).pathname||"/",n);if(null==i)return null;let a=j(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(a);let o=null;for(let e=0;null==o&&e<a.length;++e){let t=B(i);o=P(a[e],t,r)}return o}function S(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function j(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let i=(e,i,a)=>{let o={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};o.relativePath.startsWith("/")&&(m(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(r.length));let s=G([r,o.relativePath]),l=n.concat(o);e.children&&e.children.length>0&&(m(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),j(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:q(s,e.index),routesMeta:l})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of C(e.path))i(e,t,n);else i(e,t)}),t}function C(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return i?[a,""]:[a];let o=C(r.join("/")),s=[];return s.push(...o.map(e=>""===e?a:[a,e].join("/"))),i&&s.push(...o),s.map(t=>e.startsWith("/")&&""===t?"/":t)}const A=/^:[\w-]+$/,T=3,L=2,O=1,R=10,D=-2,M=e=>"*"===e;function q(e,t){let n=e.split("/"),r=n.length;return n.some(M)&&(r+=D),t&&(r+=L),n.filter(e=>!M(e)).reduce((e,t)=>e+(A.test(t)?T:""===t?O:R),r)}function P(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,i={},a="/",o=[];for(let e=0;e<r.length;++e){let s=r[e],l=e===r.length-1,c="/"===a?t:t.slice(a.length)||"/",d=I({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},c),u=s.route;if(!d&&l&&n&&!r[r.length-1].route.index&&(d=I({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:G([a,d.pathname]),pathnameBase:Z(G([a,d.pathnameBase])),route:u}),"/"!==d.pathnameBase&&(a=G([a,d.pathnameBase]))}return o}function I(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),g("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),s=i.slice(1),l=r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=s[n]||"";o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{});return{params:l,pathname:a,pathnameBase:o,pattern:e}}function B(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return g(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function F(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}const U=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function z(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function $(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function H(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function V(e,t){let n=H(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function W(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=x(e):(i=h({},e),m(!i.pathname||!i.pathname.includes("?"),$("?","pathname","search",i)),m(!i.pathname||!i.pathname.includes("#"),$("#","pathname","hash",i)),m(!i.search||!i.search.includes("#"),$("#","search","hash",i)));let a,o=""===e||""===i.pathname,s=o?"/":i.pathname;if(null==s)a=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let n,{pathname:r,search:i="",hash:a=""}="string"==typeof e?x(e):e;if(r)if(o=r,U.test(o))n=r;else{if(r.includes("//")){let e=r;r=r.replace(/\/\/+/g,"/"),g(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+r)}n=r.startsWith("/")?z(r.substring(1),"/"):z(r,t)}else n=t;var o;return{pathname:n,search:K(i),hash:Y(a)}}(i,a),c=s&&"/"!==s&&s.endsWith("/"),d=(o||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!d||(l.pathname+="/"),l}const G=e=>e.join("/").replace(/\/\/+/g,"/"),Z=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),K=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Y=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const X=function(e,t){void 0===t&&(t=302);let n=t;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let r=new Headers(n.headers);return r.set("Location",e),new Response(null,h({},n,{headers:r}))},Q=(e,t)=>{let n=X(e,t);return n.headers.set("X-Remix-Replace","true"),n};class J{constructor(e,t,n,r){void 0===r&&(r=!1),this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function ee(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const te=["post","put","patch","delete"],ne=new Set(te),re=["get",...te],ie=new Set(re),ae=new Set([301,302,303,307,308]),oe=new Set([307,308]),se={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},le={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ce={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},de=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ue=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),he="remix-router-transitions";function fe(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,n=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,r=!n;let i;if(m(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=ue;let a,o,s,l={},c=k(e.routes,i,void 0,l),u=e.basename||"/",f=e.dataStrategy||ke,p=e.patchRoutesOnNavigation,v=h({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),b=null,x=new Set,j=null,C=null,A=null,T=null!=e.hydrationData,L=N(c,e.history.location,u),O=!1,R=null;if(null==L&&!p){let t=Me(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=De(c);L=n,R={[r.id]:t}}if(L&&!e.hydrationData&&dt(L,c,e.history.location.pathname).active&&(L=null),L)if(L.some(e=>e.route.lazy))o=!1;else if(L.some(e=>e.route.loader))if(v.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=L.findIndex(e=>void 0!==n[e.route.id]);o=L.slice(0,e+1).every(e=>!ye(e.route,t,n))}else o=L.every(e=>!ye(e.route,t,n))}else o=null!=e.hydrationData;else o=!0;else if(o=!1,L=[],v.v7_partialHydration){let t=dt(null,c,e.history.location.pathname);t.active&&t.matches&&(O=!0,L=t.matches)}let D,M,q={historyAction:e.history.action,location:e.history.location,matches:L,initialized:o,navigation:se,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||R,fetchers:new Map,blockers:new Map},P=d.Pop,I=!1,B=!1,U=new Map,z=null,$=!1,H=!1,V=[],W=new Set,G=new Map,Z=0,K=-1,Y=new Map,X=new Set,Q=new Map,J=new Map,te=new Set,ne=new Map,re=new Map;function ie(e,t){void 0===t&&(t={}),q=h({},q,e);let n=[],r=[];v.v7_fetcherPersist&&q.fetchers.forEach((e,t)=>{"idle"===e.state&&(te.has(t)?r.push(t):n.push(t))}),te.forEach(e=>{q.fetchers.has(e)||G.has(e)||r.push(e)}),[...x].forEach(e=>e(q,{deletedFetchers:r,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),v.v7_fetcherPersist?(n.forEach(e=>q.fetchers.delete(e)),r.forEach(e=>$e(e))):r.forEach(e=>te.delete(e))}function ae(t,n,r){var i,o;let s,{flushSync:l}=void 0===r?{}:r,u=null!=q.actionData&&null!=q.navigation.formMethod&&He(q.navigation.formMethod)&&"loading"===q.navigation.state&&!0!==(null==(i=t.state)?void 0:i._isRedirect);s=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:u?q.actionData:null;let f=n.loaderData?Le(q.loaderData,n.loaderData,n.matches||[],n.errors):q.loaderData,p=q.blockers;p.size>0&&(p=new Map(p),p.forEach((e,t)=>p.set(t,ce)));let m,g=!0===I||null!=q.navigation.formMethod&&He(q.navigation.formMethod)&&!0!==(null==(o=t.state)?void 0:o._isRedirect);if(a&&(c=a,a=void 0),$||P===d.Pop||(P===d.Push?e.history.push(t,t.state):P===d.Replace&&e.history.replace(t,t.state)),P===d.Pop){let e=U.get(q.location.pathname);e&&e.has(t.pathname)?m={currentLocation:q.location,nextLocation:t}:U.has(t.pathname)&&(m={currentLocation:t,nextLocation:q.location})}else if(B){let e=U.get(q.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),U.set(q.location.pathname,e)),m={currentLocation:q.location,nextLocation:t}}ie(h({},n,{actionData:s,loaderData:f,historyAction:P,location:t,initialized:!0,navigation:se,revalidation:"idle",restoreScrollPosition:ct(t,n.matches||q.matches),preventScrollReset:g,blockers:p}),{viewTransitionOpts:m,flushSync:!0===l}),P=d.Pop,I=!1,B=!1,$=!1,H=!1,V=[]}async function fe(t,n,r){D&&D.abort(),D=null,P=t,$=!0===(r&&r.startUninterruptedRevalidation),function(e,t){if(j&&A){let n=lt(e,t);j[n]=A()}}(q.location,q.matches),I=!0===(r&&r.preventScrollReset),B=!0===(r&&r.enableViewTransition);let i=a||c,o=r&&r.overrideNavigation,s=null!=r&&r.initialHydration&&q.matches&&q.matches.length>0&&!O?q.matches:N(i,n,u),l=!0===(r&&r.flushSync);if(s&&q.initialized&&!H&&(f=q.location,p=n,f.pathname===p.pathname&&f.search===p.search&&(""===f.hash?""!==p.hash:f.hash===p.hash||""!==p.hash))&&!(r&&r.submission&&He(r.submission.formMethod)))return void ae(n,{matches:s},{flushSync:l});var f,p;let m=dt(s,i,n.pathname);if(m.active&&m.matches&&(s=m.matches),!s){let{error:e,notFoundMatches:t,route:r}=ot(n.pathname);return void ae(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:l})}D=new AbortController;let g,y=je(e.history,n,D.signal,r&&r.submission);if(r&&r.pendingError)g=[Re(s).route.id,{type:w.error,error:r.pendingError}];else if(r&&r.submission&&He(r.submission.formMethod)){let t=await async function(e,t,n,r,i,a){void 0===a&&(a={}),Ce();let o,s=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,n);if(ie({navigation:s},{flushSync:!0===a.flushSync}),i){let n=await ut(r,t.pathname,e.signal);if("aborted"===n.type)return{shortCircuited:!0};if("error"===n.type){let e=Re(n.partialMatches).route.id;return{matches:n.partialMatches,pendingActionResult:[e,{type:w.error,error:n.error}]}}if(!n.matches){let{notFoundMatches:e,error:n,route:r}=ot(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:w.error,error:n}]}}r=n.matches}let l=Ke(r,t);if(l.route.action||l.route.lazy){if(o=(await xe("action",q,e,[l],r,null))[l.route.id],e.signal.aborted)return{shortCircuited:!0}}else o={type:w.error,error:Me(405,{method:e.method,pathname:t.pathname,routeId:l.route.id})};if(Ue(o)){let t;return t=a&&null!=a.replace?a.replace:Se(o.response.headers.get("Location"),new URL(e.url),u)===q.location.pathname+q.location.search,await be(e,o,!0,{submission:n,replace:t}),{shortCircuited:!0}}if(Be(o))throw Me(400,{type:"defer-action"});if(Fe(o)){let e=Re(r,l.route.id);return!0!==(a&&a.replace)&&(P=d.Push),{matches:r,pendingActionResult:[e.route.id,o]}}return{matches:r,pendingActionResult:[l.route.id,o]}}(y,n,r.submission,s,m.active,{replace:r.replace,flushSync:l});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Fe(r)&&ee(r.error)&&404===r.error.status)return D=null,void ae(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}s=t.matches||s,g=t.pendingActionResult,o=Xe(n,r.submission),l=!1,m.active=!1,y=je(e.history,y.url,y.signal)}let{shortCircuited:b,matches:x,loaderData:_,errors:k}=await async function(t,n,r,i,o,s,l,d,f,p,m){let g=o||Xe(n,s),y=s||l||Ye(g),b=!($||v.v7_partialHydration&&f);if(i){if(b){let e=ge(m);ie(h({navigation:g},void 0!==e?{actionData:e}:{}),{flushSync:p})}let e=await ut(r,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=Re(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=ot(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}r=e.matches}let x=a||c,[w,_]=ve(e.history,q,r,y,n,v.v7_partialHydration&&!0===f,v.v7_skipActionErrorRevalidation,H,V,W,te,Q,X,x,u,m);if(st(e=>!(r&&r.some(t=>t.route.id===e))||w&&w.some(t=>t.route.id===e)),K=++Z,0===w.length&&0===_.length){let e=tt();return ae(n,h({matches:r,loaderData:{},errors:m&&Fe(m[1])?{[m[0]]:m[1].error}:null},Oe(m),e?{fetchers:new Map(q.fetchers)}:{}),{flushSync:p}),{shortCircuited:!0}}if(b){let e={};if(!i){e.navigation=g;let t=ge(m);void 0!==t&&(e.actionData=t)}_.length>0&&(e.fetchers=function(e){return e.forEach(e=>{let t=q.fetchers.get(e.key),n=Qe(void 0,t?t.data:void 0);q.fetchers.set(e.key,n)}),new Map(q.fetchers)}(_)),ie(e,{flushSync:p})}_.forEach(e=>{Ze(e.key),e.controller&&G.set(e.key,e.controller)});let k=()=>_.forEach(e=>Ze(e.key));D&&D.signal.addEventListener("abort",k);let{loaderResults:N,fetcherResults:E}=await _e(q,r,w,_,t);if(t.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",k),_.forEach(e=>G.delete(e.key));let S=qe(N);if(S)return await be(t,S.result,!0,{replace:d}),{shortCircuited:!0};if(S=qe(E),S)return X.add(S.key),await be(t,S.result,!0,{replace:d}),{shortCircuited:!0};let{loaderData:j,errors:C}=Te(q,r,N,m,_,E,ne);ne.forEach((e,t)=>{e.subscribe(n=>{(n||e.done)&&ne.delete(t)})}),v.v7_partialHydration&&f&&q.errors&&(C=h({},q.errors,C));let A=tt(),T=nt(K),L=A||T||_.length>0;return h({matches:r,loaderData:j,errors:C},L?{fetchers:new Map(q.fetchers)}:{})}(y,n,s,m.active,o,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&!0===r.initialHydration,l,g);b||(D=null,ae(n,h({matches:x||s},Oe(g),{loaderData:_,errors:k})))}function ge(e){return e&&!Fe(e[1])?{[e[0]]:e[1].data}:q.actionData?0===Object.keys(q.actionData).length?null:q.actionData:void 0}async function be(r,i,a,o){let{submission:s,fetcherSubmission:l,preventScrollReset:c,replace:f}=void 0===o?{}:o;i.response.headers.has("X-Remix-Revalidate")&&(H=!0);let p=i.response.headers.get("Location");m(p,"Expected a Location header on the redirect Response"),p=Se(p,new URL(r.url),u);let g=y(q.location,p,{_isRedirect:!0});if(n){let n=!1;if(i.response.headers.has("X-Remix-Reload-Document"))n=!0;else if(de.test(p)){const r=e.history.createURL(p);n=r.origin!==t.location.origin||null==F(r.pathname,u)}if(n)return void(f?t.location.replace(p):t.location.assign(p))}D=null;let v=!0===f||i.response.headers.has("X-Remix-Replace")?d.Replace:d.Push,{formMethod:b,formAction:x,formEncType:w}=q.navigation;!s&&!l&&b&&x&&w&&(s=Ye(q.navigation));let _=s||l;if(oe.has(i.response.status)&&_&&He(_.formMethod))await fe(v,g,{submission:h({},_,{formAction:p}),preventScrollReset:c||I,enableViewTransition:a?B:void 0});else{let e=Xe(g,s);await fe(v,g,{overrideNavigation:e,fetcherSubmission:l,preventScrollReset:c||I,enableViewTransition:a?B:void 0})}}async function xe(e,t,n,r,a,o){let s,c={};try{s=await async function(e,t,n,r,i,a,o,s,l,c){let d=a.map(e=>e.route.lazy?async function(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];m(i,"No route found in manifest");let a={};for(let e in r){let t=void 0!==i[e]&&"hasErrorBoundary"!==e;g(!t,'Route "'+i.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||_.has(e)||(a[e]=r[e])}Object.assign(i,a),Object.assign(i,h({},t(i),{lazy:void 0}))}(e.route,l,s):void 0),u=a.map((e,n)=>{let a=d[n],o=i.some(t=>t.route.id===e.route.id);return h({},e,{shouldLoad:o,resolve:async n=>(n&&"GET"===r.method&&(e.route.lazy||e.route.loader)&&(o=!0),o?async function(e,t,n,r,i,a){let o,s,l=r=>{let o,l=new Promise((e,t)=>o=t);s=()=>o(),t.signal.addEventListener("abort",s);let c=i=>"function"!=typeof r?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+n.route.id+"]")):r({request:t,params:n.params,context:a},...void 0!==i?[i]:[]),d=(async()=>{try{return{type:"data",result:await(i?i(e=>c(e)):c())}}catch(e){return{type:"error",result:e}}})();return Promise.race([d,l])};try{let i=n.route[e];if(r)if(i){let e,[t]=await Promise.all([l(i).catch(t=>{e=t}),r]);if(void 0!==e)throw e;o=t}else{if(await r,i=n.route[e],!i){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw Me(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:w.data,result:void 0}}o=await l(i)}else{if(!i){let e=new URL(t.url);throw Me(404,{pathname:e.pathname+e.search})}o=await l(i)}m(void 0!==o.result,"You defined "+("action"===e?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){return{type:w.error,result:e}}finally{s&&t.signal.removeEventListener("abort",s)}return o}(t,r,e,a,n,c):Promise.resolve({type:w.data,result:void 0}))})}),f=await e({matches:u,request:r,params:a[0].params,fetcherKey:o,context:c});try{await Promise.all(d)}catch(e){}return f}(f,e,0,n,r,a,o,l,i)}catch(e){return r.forEach(t=>{c[t.route.id]={type:w.error,error:e}}),c}for(let[e,t]of Object.entries(s))if(Ie(t)){let r=t.result;c[e]={type:w.redirect,response:Ee(r,n,e,a,u,v.v7_relativeSplatPath)}}else c[e]=await Ne(t);return c}async function _e(t,n,r,i,a){let o=t.matches,s=xe("loader",0,a,r,n,null),l=Promise.all(i.map(async t=>{if(t.matches&&t.match&&t.controller){let n=(await xe("loader",0,je(e.history,t.path,t.controller.signal),[t.match],t.matches,t.key))[t.match.route.id];return{[t.key]:n}}return Promise.resolve({[t.key]:{type:w.error,error:Me(404,{pathname:t.path})}})})),c=await s,d=(await l).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([Ve(n,c,a.signal,o,t.loaderData),We(n,d,i)]),{loaderResults:c,fetcherResults:d}}function Ce(){H=!0,V.push(...st()),Q.forEach((e,t)=>{G.has(t)&&W.add(t),Ze(t)})}function Ae(e,t,n){void 0===n&&(n={}),q.fetchers.set(e,t),ie({fetchers:new Map(q.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Pe(e,t,n,r){void 0===r&&(r={});let i=Re(q.matches,t);$e(e),ie({errors:{[i.route.id]:n},fetchers:new Map(q.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function ze(e){return J.set(e,(J.get(e)||0)+1),te.has(e)&&te.delete(e),q.fetchers.get(e)||le}function $e(e){let t=q.fetchers.get(e);!G.has(e)||t&&"loading"===t.state&&Y.has(e)||Ze(e),Q.delete(e),Y.delete(e),X.delete(e),v.v7_fetcherPersist&&te.delete(e),W.delete(e),q.fetchers.delete(e)}function Ze(e){let t=G.get(e);t&&(t.abort(),G.delete(e))}function et(e){for(let t of e){let e=Je(ze(t).data);q.fetchers.set(t,e)}}function tt(){let e=[],t=!1;for(let n of X){let r=q.fetchers.get(n);m(r,"Expected fetcher: "+n),"loading"===r.state&&(X.delete(n),e.push(n),t=!0)}return et(e),t}function nt(e){let t=[];for(let[n,r]of Y)if(r<e){let e=q.fetchers.get(n);m(e,"Expected fetcher: "+n),"loading"===e.state&&(Ze(n),Y.delete(n),t.push(n))}return et(t),t.length>0}function rt(e){q.blockers.delete(e),re.delete(e)}function it(e,t){let n=q.blockers.get(e)||ce;m("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,"Invalid blocker state transition: "+n.state+" -> "+t.state);let r=new Map(q.blockers);r.set(e,t),ie({blockers:r})}function at(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(0===re.size)return;re.size>1&&g(!1,"A router only supports one blocker at a time");let i=Array.from(re.entries()),[a,o]=i[i.length-1],s=q.blockers.get(a);return s&&"proceeding"===s.state?void 0:o({currentLocation:t,nextLocation:n,historyAction:r})?a:void 0}function ot(e){let t=Me(404,{pathname:e}),n=a||c,{matches:r,route:i}=De(n);return st(),{notFoundMatches:r,route:i,error:t}}function st(e){let t=[];return ne.forEach((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),ne.delete(r))}),t}function lt(e,t){return C&&C(e,t.map(e=>S(e,q.loaderData)))||e.key}function ct(e,t){if(j){let n=lt(e,t),r=j[n];if("number"==typeof r)return r}return null}function dt(e,t,n){if(p){if(!e)return{active:!0,matches:E(t,n,u,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:E(t,n,u,!0)}}return{active:!1,matches:null}}async function ut(e,t,n,r){if(!p)return{type:"success",matches:e};let o=e;for(;;){let e=null==a,s=a||c,d=l;try{await p({signal:n,path:t,matches:o,fetcherKey:r,patch:(e,t)=>{n.aborted||we(e,t,s,d,i)}})}catch(e){return{type:"error",error:e,partialMatches:o}}finally{e&&!n.aborted&&(c=[...c])}if(n.aborted)return{type:"aborted"};let h=N(s,t,u);if(h)return{type:"success",matches:h};let f=E(s,t,u,!0);if(!f||o.length===f.length&&o.every((e,t)=>e.route.id===f[t].route.id))return{type:"success",matches:null};o=f}}return s={get basename(){return u},get future(){return v},get state(){return q},get routes(){return c},get window(){return t},initialize:function(){if(b=e.history.listen(t=>{let{action:n,location:r,delta:i}=t;if(M)return M(),void(M=void 0);g(0===re.size||null!=i,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let a=at({currentLocation:q.location,nextLocation:r,historyAction:n});if(a&&null!=i){let t=new Promise(e=>{M=e});return e.history.go(-1*i),void it(a,{state:"blocked",location:r,proceed(){it(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(i))},reset(){let e=new Map(q.blockers);e.set(a,ce),ie({blockers:e})}})}return fe(n,r)}),n){!function(e,t){try{let n=e.sessionStorage.getItem(he);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(e){}}(t,U);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(he,JSON.stringify(n))}catch(e){g(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,U);t.addEventListener("pagehide",e),z=()=>t.removeEventListener("pagehide",e)}return q.initialized||fe(d.Pop,q.location,{initialHydration:!0}),s},subscribe:function(e){return x.add(e),()=>x.delete(e)},enableScrollRestoration:function(e,t,n){if(j=e,A=t,C=n||null,!T&&q.navigation===se){T=!0;let e=ct(q.location,q.matches);null!=e&&ie({restoreScrollPosition:e})}return()=>{j=null,A=null,C=null}},navigate:async function t(n,r){if("number"==typeof n)return void e.history.go(n);let i=pe(q.location,q.matches,u,v.v7_prependBasename,n,v.v7_relativeSplatPath,null==r?void 0:r.fromRouteId,null==r?void 0:r.relative),{path:a,submission:o,error:s}=me(v.v7_normalizeFormMethod,!1,i,r),l=q.location,c=y(q.location,a,r&&r.state);c=h({},c,e.history.encodeLocation(c));let f=r&&null!=r.replace?r.replace:void 0,p=d.Push;!0===f?p=d.Replace:!1===f||null!=o&&He(o.formMethod)&&o.formAction===q.location.pathname+q.location.search&&(p=d.Replace);let m=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,g=!0===(r&&r.flushSync),b=at({currentLocation:l,nextLocation:c,historyAction:p});if(!b)return await fe(p,c,{submission:o,pendingError:s,preventScrollReset:m,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:g});it(b,{state:"blocked",location:c,proceed(){it(b,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),t(n,r)},reset(){let e=new Map(q.blockers);e.set(b,ce),ie({blockers:e})}})},fetch:function(t,n,i,o){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ze(t);let s=!0===(o&&o.flushSync),l=a||c,d=pe(q.location,q.matches,u,v.v7_prependBasename,i,v.v7_relativeSplatPath,n,null==o?void 0:o.relative),h=N(l,d,u),f=dt(h,l,d);if(f.active&&f.matches&&(h=f.matches),!h)return void Pe(t,n,Me(404,{pathname:d}),{flushSync:s});let{path:p,submission:g,error:y}=me(v.v7_normalizeFormMethod,!0,d,o);if(y)return void Pe(t,n,y,{flushSync:s});let b=Ke(h,p),x=!0===(o&&o.preventScrollReset);g&&He(g.formMethod)?async function(t,n,r,i,o,s,l,d,h){function f(e){if(!e.route.action&&!e.route.lazy){let e=Me(405,{method:h.formMethod,pathname:r,routeId:n});return Pe(t,n,e,{flushSync:l}),!0}return!1}if(Ce(),Q.delete(t),!s&&f(i))return;let p=q.fetchers.get(t);Ae(t,function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(h,p),{flushSync:l});let g=new AbortController,y=je(e.history,r,g.signal,h);if(s){let e=await ut(o,new URL(y.url).pathname,y.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void Pe(t,n,e.error,{flushSync:l});if(!e.matches)return void Pe(t,n,Me(404,{pathname:r}),{flushSync:l});if(f(i=Ke(o=e.matches,r)))return}G.set(t,g);let b=Z,x=(await xe("action",0,y,[i],o,t))[i.route.id];if(y.signal.aborted)return void(G.get(t)===g&&G.delete(t));if(v.v7_fetcherPersist&&te.has(t)){if(Ue(x)||Fe(x))return void Ae(t,Je(void 0))}else{if(Ue(x))return G.delete(t),K>b?void Ae(t,Je(void 0)):(X.add(t),Ae(t,Qe(h)),be(y,x,!1,{fetcherSubmission:h,preventScrollReset:d}));if(Fe(x))return void Pe(t,n,x.error)}if(Be(x))throw Me(400,{type:"defer-action"});let w=q.navigation.location||q.location,_=je(e.history,w,g.signal),k=a||c,E="idle"!==q.navigation.state?N(k,q.navigation.location,u):q.matches;m(E,"Didn't find any matches after fetcher action");let S=++Z;Y.set(t,S);let j=Qe(h,x.data);q.fetchers.set(t,j);let[C,A]=ve(e.history,q,E,h,w,!1,v.v7_skipActionErrorRevalidation,H,V,W,te,Q,X,k,u,[i.route.id,x]);A.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=q.fetchers.get(t),r=Qe(void 0,n?n.data:void 0);q.fetchers.set(t,r),Ze(t),e.controller&&G.set(t,e.controller)}),ie({fetchers:new Map(q.fetchers)});let T=()=>A.forEach(e=>Ze(e.key));g.signal.addEventListener("abort",T);let{loaderResults:L,fetcherResults:O}=await _e(q,E,C,A,_);if(g.signal.aborted)return;g.signal.removeEventListener("abort",T),Y.delete(t),G.delete(t),A.forEach(e=>G.delete(e.key));let R=qe(L);if(R)return be(_,R.result,!1,{preventScrollReset:d});if(R=qe(O),R)return X.add(R.key),be(_,R.result,!1,{preventScrollReset:d});let{loaderData:M,errors:I}=Te(q,E,L,void 0,A,O,ne);if(q.fetchers.has(t)){let e=Je(x.data);q.fetchers.set(t,e)}nt(S),"loading"===q.navigation.state&&S>K?(m(P,"Expected pending action"),D&&D.abort(),ae(q.navigation.location,{matches:E,loaderData:M,errors:I,fetchers:new Map(q.fetchers)})):(ie({errors:I,loaderData:Le(q.loaderData,M,E,I),fetchers:new Map(q.fetchers)}),H=!1)}(t,n,p,b,h,f.active,s,x,g):(Q.set(t,{routeId:n,path:p}),async function(t,n,r,i,a,o,s,l,c){let d=q.fetchers.get(t);Ae(t,Qe(c,d?d.data:void 0),{flushSync:s});let u=new AbortController,h=je(e.history,r,u.signal);if(o){let e=await ut(a,new URL(h.url).pathname,h.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void Pe(t,n,e.error,{flushSync:s});if(!e.matches)return void Pe(t,n,Me(404,{pathname:r}),{flushSync:s});i=Ke(a=e.matches,r)}G.set(t,u);let f=Z,p=(await xe("loader",0,h,[i],a,t))[i.route.id];if(Be(p)&&(p=await Ge(p,h.signal,!0)||p),G.get(t)===u&&G.delete(t),!h.signal.aborted){if(!te.has(t))return Ue(p)?K>f?void Ae(t,Je(void 0)):(X.add(t),void await be(h,p,!1,{preventScrollReset:l})):void(Fe(p)?Pe(t,n,p.error):(m(!Be(p),"Unhandled fetcher deferred data"),Ae(t,Je(p.data))));Ae(t,Je(void 0))}}(t,n,p,b,h,f.active,s,x,g))},revalidate:function(){Ce(),ie({revalidation:"loading"}),"submitting"!==q.navigation.state&&("idle"!==q.navigation.state?fe(P||q.historyAction,q.navigation.location,{overrideNavigation:q.navigation,enableViewTransition:!0===B}):fe(q.historyAction,q.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:ze,deleteFetcher:function(e){let t=(J.get(e)||0)-1;t<=0?(J.delete(e),te.add(e),v.v7_fetcherPersist||$e(e)):J.set(e,t),ie({fetchers:new Map(q.fetchers)})},dispose:function(){b&&b(),z&&z(),x.clear(),D&&D.abort(),q.fetchers.forEach((e,t)=>$e(t)),q.blockers.forEach((e,t)=>rt(t))},getBlocker:function(e,t){let n=q.blockers.get(e)||ce;return re.get(e)!==t&&re.set(e,t),n},deleteBlocker:rt,patchRoutes:function(e,t){let n=null==a;we(e,t,a||c,l,i),n&&(c=[...c],ie({}))},_internalFetchControllers:G,_internalActiveDeferreds:ne,_internalSetRoutes:function(e){l={},a=k(e,i,void 0,l)}},s}function pe(e,t,n,r,i,a,o,s){let l,c;if(o){l=[];for(let e of t)if(l.push(e),e.route.id===o){c=e;break}}else l=t,c=t[t.length-1];let d=W(i||".",V(l,a),F(e.pathname,n)||e.pathname,"path"===s);if(null==i&&(d.search=e.search,d.hash=e.hash),(null==i||""===i||"."===i)&&c){let e=Ze(d.search);if(c.route.index&&!e)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&e){let e=new URLSearchParams(d.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();d.search=n?"?"+n:""}}return r&&"/"!==n&&(d.pathname="/"===d.pathname?n:G([n,d.pathname])),b(d)}function me(e,t,n,r){if(!r||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(r))return{path:n};if(r.formMethod&&(i=r.formMethod,!ie.has(i.toLowerCase())))return{path:n,error:Me(405,{method:r.formMethod})};var i;let a,o,s=()=>({path:n,error:Me(400,{type:"invalid-body"})}),l=r.formMethod||"get",c=e?l.toUpperCase():l.toLowerCase(),d=Pe(n);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!He(c))return s();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,t)=>{let[n,r]=t;return""+e+n+"="+r+"\n"},""):String(r.body);return{path:n,submission:{formMethod:c,formAction:d,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!He(c))return s();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:c,formAction:d,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return s()}}}if(m("function"==typeof FormData,"FormData is not available in this environment"),r.formData)a=Ce(r.formData),o=r.formData;else if(r.body instanceof FormData)a=Ce(r.body),o=r.body;else if(r.body instanceof URLSearchParams)a=r.body,o=Ae(a);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=Ae(a)}catch(e){return s()}let u={formMethod:c,formAction:d,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(He(u.formMethod))return{path:n,submission:u};let h=x(n);return t&&h.search&&Ze(h.search)&&a.append("index",""),h.search="?"+a,{path:b(h),submission:u}}function ge(e,t,n){void 0===n&&(n=!1);let r=e.findIndex(e=>e.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function ve(e,t,n,r,i,a,o,s,l,c,d,u,f,p,m,g){let v=g?Fe(g[1])?g[1].error:g[1].data:void 0,y=e.createURL(t.location),b=e.createURL(i),x=n;a&&t.errors?x=ge(n,Object.keys(t.errors)[0],!0):g&&Fe(g[1])&&(x=ge(n,g[0]));let w=g?g[1].statusCode:void 0,_=o&&w&&w>=400,k=x.filter((e,n)=>{let{route:i}=e;if(i.lazy)return!0;if(null==i.loader)return!1;if(a)return ye(i,t.loaderData,t.errors);if(function(e,t,n){let r=!t||n.route.id!==t.route.id,i=void 0===e[n.route.id];return r||i}(t.loaderData,t.matches[n],e)||l.some(t=>t===e.route.id))return!0;let o=t.matches[n],c=e;return xe(e,h({currentUrl:y,currentParams:o.params,nextUrl:b,nextParams:c.params},r,{actionResult:v,actionStatus:w,defaultShouldRevalidate:!_&&(s||y.pathname+y.search===b.pathname+b.search||y.search!==b.search||be(o,c))}))}),E=[];return u.forEach((e,i)=>{if(a||!n.some(t=>t.route.id===e.routeId)||d.has(i))return;let o=N(p,e.path,m);if(!o)return void E.push({key:i,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let l=t.fetchers.get(i),u=Ke(o,e.path),g=!1;f.has(i)?g=!1:c.has(i)?(c.delete(i),g=!0):g=l&&"idle"!==l.state&&void 0===l.data?s:xe(u,h({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:n[n.length-1].params},r,{actionResult:v,actionStatus:w,defaultShouldRevalidate:!_&&s})),g&&E.push({key:i,routeId:e.routeId,path:e.path,matches:o,match:u,controller:new AbortController})}),[k,E]}function ye(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=null!=t&&void 0!==t[e.id],i=null!=n&&void 0!==n[e.id];return!(!r&&i)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!r&&!i)}function be(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function xe(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"==typeof n)return n}return t.defaultShouldRevalidate}function we(e,t,n,r,i){var a;let o;if(e){let t=r[e];m(t,"No route found to patch children into: routeId = "+e),t.children||(t.children=[]),o=t.children}else o=n;let s=k(t.filter(e=>!o.some(t=>_e(e,t))),i,[e||"_","patch",String((null==(a=o)?void 0:a.length)||"0")],r);o.push(...s)}function _e(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every((e,n)=>{var r;return null==(r=t.children)?void 0:r.some(t=>_e(e,t))}))}async function ke(e){let{matches:t}=e,n=t.filter(e=>e.shouldLoad);return(await Promise.all(n.map(e=>e.resolve()))).reduce((e,t,r)=>Object.assign(e,{[n[r].route.id]:t}),{})}async function Ne(e){let{result:t,type:n}=e;if($e(t)){let e;try{let n=t.headers.get("Content-Type");e=n&&/\bapplication\/json\b/.test(n)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:w.error,error:e}}return n===w.error?{type:w.error,error:new J(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:w.data,data:e,statusCode:t.status,headers:t.headers}}var r,i,a,o,s,l,c,d;return n===w.error?ze(t)?t.data instanceof Error?{type:w.error,error:t.data,statusCode:null==(a=t.init)?void 0:a.status,headers:null!=(o=t.init)&&o.headers?new Headers(t.init.headers):void 0}:{type:w.error,error:new J((null==(r=t.init)?void 0:r.status)||500,void 0,t.data),statusCode:ee(t)?t.status:void 0,headers:null!=(i=t.init)&&i.headers?new Headers(t.init.headers):void 0}:{type:w.error,error:t,statusCode:ee(t)?t.status:void 0}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(t)?{type:w.deferred,deferredData:t,statusCode:null==(s=t.init)?void 0:s.status,headers:(null==(l=t.init)?void 0:l.headers)&&new Headers(t.init.headers)}:ze(t)?{type:w.data,data:t.data,statusCode:null==(c=t.init)?void 0:c.status,headers:null!=(d=t.init)&&d.headers?new Headers(t.init.headers):void 0}:{type:w.data,data:t}}function Ee(e,t,n,r,i,a){let o=e.headers.get("Location");if(m(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!de.test(o)){let s=r.slice(0,r.findIndex(e=>e.route.id===n)+1);o=pe(new URL(t.url),s,i,!0,o,a),e.headers.set("Location",o)}return e}function Se(e,t,n){if(de.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),a=null!=F(i.pathname,n);if(i.origin===t.origin&&a)return i.pathname+i.search+i.hash}return e}function je(e,t,n,r){let i=e.createURL(Pe(t)).toString(),a={signal:n};if(r&&He(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):"text/plain"===t?a.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?a.body=Ce(r.formData):a.body=r.formData}return new Request(i,a)}function Ce(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,"string"==typeof r?r:r.name);return t}function Ae(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Te(e,t,n,r,i,a,o){let{loaderData:s,errors:l}=function(e,t,n,r,i){let a,o={},s=null,l=!1,c={},d=n&&Fe(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let u=n.route.id,h=t[u];if(m(!Ue(h),"Cannot handle redirect results in processLoaderData"),Fe(h)){let t=h.error;if(void 0!==d&&(t=d,d=void 0),s=s||{},i)s[u]=t;else{let n=Re(e,u);null==s[n.route.id]&&(s[n.route.id]=t)}o[u]=void 0,l||(l=!0,a=ee(h.error)?h.error.status:500),h.headers&&(c[u]=h.headers)}else Be(h)?(r.set(u,h.deferredData),o[u]=h.deferredData.data,null==h.statusCode||200===h.statusCode||l||(a=h.statusCode),h.headers&&(c[u]=h.headers)):(o[u]=h.data,h.statusCode&&200!==h.statusCode&&!l&&(a=h.statusCode),h.headers&&(c[u]=h.headers))}),void 0!==d&&n&&(s={[n[0]]:d},o[n[0]]=void 0),{loaderData:o,errors:s,statusCode:a||200,loaderHeaders:c}}(t,n,r,o,!1);return i.forEach(t=>{let{key:n,match:r,controller:i}=t,o=a[n];if(m(o,"Did not find corresponding fetcher result"),!i||!i.signal.aborted)if(Fe(o)){let t=Re(e.matches,null==r?void 0:r.route.id);l&&l[t.route.id]||(l=h({},l,{[t.route.id]:o.error})),e.fetchers.delete(n)}else if(Ue(o))m(!1,"Unhandled fetcher revalidation redirect");else if(Be(o))m(!1,"Unhandled fetcher deferred data");else{let t=Je(o.data);e.fetchers.set(n,t)}}),{loaderData:s,errors:l}}function Le(e,t,n,r){let i=h({},t);for(let a of n){let n=a.route.id;if(t.hasOwnProperty(n)?void 0!==t[n]&&(i[n]=t[n]):void 0!==e[n]&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Oe(e){return e?Fe(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Re(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function De(e){let t=1===e.length?e[0]:e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Me(e,t){let{pathname:n,routeId:r,method:i,type:a,message:o}=void 0===t?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but did not provide a `loader` for route "'+r+'", so there is no way to handle the request.':"defer-action"===a?l="defer() is not supported in actions":"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):404===e?(s="Not Found",l='No route matches URL "'+n+'"'):405===e&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but did not provide an `action` for route "'+r+'", so there is no way to handle the request.':i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new J(e||500,s,new Error(l),!0)}function qe(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Ue(r))return{key:n,result:r}}}function Pe(e){return b(h({},"string"==typeof e?x(e):e,{hash:""}))}function Ie(e){return $e(e.result)&&ae.has(e.result.status)}function Be(e){return e.type===w.deferred}function Fe(e){return e.type===w.error}function Ue(e){return(e&&e.type)===w.redirect}function ze(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function $e(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function He(e){return ne.has(e.toLowerCase())}async function Ve(e,t,n,r,i){let a=Object.entries(t);for(let o=0;o<a.length;o++){let[s,l]=a[o],c=e.find(e=>(null==e?void 0:e.route.id)===s);if(!c)continue;let d=r.find(e=>e.route.id===c.route.id),u=null!=d&&!be(d,c)&&void 0!==(i&&i[c.route.id]);Be(l)&&u&&await Ge(l,n,!1).then(e=>{e&&(t[s]=e)})}}async function We(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:a,controller:o}=n[r],s=t[i];e.find(e=>(null==e?void 0:e.route.id)===a)&&Be(s)&&(m(o,"Expected an AbortController for revalidating fetcher deferred result"),await Ge(s,o.signal,!0).then(e=>{e&&(t[i]=e)}))}}async function Ge(e,t,n){if(void 0===n&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:w.data,data:e.deferredData.unwrappedData}}catch(e){return{type:w.error,error:e}}return{type:w.data,data:e.deferredData.data}}}function Ze(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function Ke(e,t){let n="string"==typeof t?x(t).search:t.search;if(e[e.length-1].route.index&&Ze(n||""))return e[e.length-1];let r=H(e);return r[r.length-1]}function Ye(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r)return null!=i?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i}:null!=a?{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0}:void 0!==o?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}:void 0}function Xe(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qe(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Je(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(this,arguments)}Symbol("deferred");const tt=u.createContext(null),nt=u.createContext(null),rt=u.createContext(null),it=u.createContext(null),at=u.createContext({outlet:null,matches:[],isDataRoute:!1}),ot=u.createContext(null);function st(){return null!=u.useContext(it)}function lt(){return st()||m(!1),u.useContext(it).location}function ct(e){u.useContext(rt).static||u.useLayoutEffect(e)}function dt(){let{isDataRoute:e}=u.useContext(at);return e?function(){let{router:e}=function(){let e=u.useContext(tt);return e||m(!1),e}(vt.UseNavigateStable),t=xt(yt.UseNavigateStable),n=u.useRef(!1);ct(()=>{n.current=!0});let r=u.useCallback(function(r,i){void 0===i&&(i={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,et({fromRouteId:t},i)))},[e,t]);return r}():function(){st()||m(!1);let e=u.useContext(tt),{basename:t,future:n,navigator:r}=u.useContext(rt),{matches:i}=u.useContext(at),{pathname:a}=lt(),o=JSON.stringify(V(i,n.v7_relativeSplatPath)),s=u.useRef(!1);ct(()=>{s.current=!0});let l=u.useCallback(function(n,i){if(void 0===i&&(i={}),!s.current)return;if("number"==typeof n)return void r.go(n);let l=W(n,JSON.parse(o),a,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:G([t,l.pathname])),(i.replace?r.replace:r.push)(l,i.state,i)},[t,r,o,a,e]);return l}()}function ut(){let{matches:e}=u.useContext(at),t=e[e.length-1];return t?t.params:{}}function ht(e,t,n,r){st()||m(!1);let{navigator:i}=u.useContext(rt),{matches:a}=u.useContext(at),o=a[a.length-1],s=o?o.params:{},l=(o&&o.pathname,o?o.pathnameBase:"/");o&&o.route;let c,h=lt();if(t){var f;let e="string"==typeof t?x(t):t;"/"===l||(null==(f=e.pathname)?void 0:f.startsWith(l))||m(!1),c=e}else c=h;let p=c.pathname||"/",g=p;if("/"!==l){let e=l.replace(/^\//,"").split("/");g="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=N(e,{pathname:g}),y=function(e,t,n,r){var i;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==e){var a;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(a=r)&&a.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let o=e,s=null==(i=n)?void 0:i.errors;if(null!=s){let e=o.findIndex(e=>e.route.id&&void 0!==(null==s?void 0:s[e.route.id]));e>=0||m(!1),o=o.slice(0,Math.min(o.length,e+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||i){l=!0,o=c>=0?o.slice(0,c+1):[o[0]];break}}}return o.reduceRight((e,r,i)=>{let a,d=!1,h=null,f=null;var p;n&&(a=s&&r.route.id?s[r.route.id]:void 0,h=r.route.errorElement||pt,l&&(c<0&&0===i?(kt[p="route-fallback"]||(kt[p]=!0),d=!0,f=null):c===i&&(d=!0,f=r.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,i+1)),g=()=>{let t;return t=a?h:d?f:r.route.Component?u.createElement(r.route.Component,null):r.route.element?r.route.element:e,u.createElement(gt,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===i)?u.createElement(mt,{location:n.location,revalidation:n.revalidation,component:h,error:a,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()},null)}(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:G([l,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?l:G([l,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&y?u.createElement(it.Provider,{value:{location:et({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:d.Pop}},y):y}function ft(){let e=function(){var e;let t=u.useContext(ot),n=bt(yt.UseRouteError),r=xt(yt.UseRouteError);return void 0!==t?t:null==(e=n.errors)?void 0:e[r]}(),t=ee(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},t),n?u.createElement("pre",{style:r},n):null,null)}const pt=u.createElement(ft,null);class mt extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?u.createElement(at.Provider,{value:this.props.routeContext},u.createElement(ot.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function gt(e){let{routeContext:t,match:n,children:r}=e,i=u.useContext(tt);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),u.createElement(at.Provider,{value:t},r)}var vt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(vt||{}),yt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(yt||{});function bt(e){let t=u.useContext(nt);return t||m(!1),t}function xt(e){let t=function(){let e=u.useContext(at);return e||m(!1),e}(),n=t.matches[t.matches.length-1];return n.route.id||m(!1),n.route.id}function wt(){return bt(yt.UseNavigation).navigation}function _t(){let{matches:e,loaderData:t}=bt(yt.UseMatches);return u.useMemo(()=>e.map(e=>S(e,t)),[e,t])}const kt={};function Nt(e){let{basename:t="/",children:n=null,location:r,navigationType:i=d.Pop,navigator:a,static:o=!1,future:s}=e;st()&&m(!1);let l=t.replace(/^\/*/,"/"),c=u.useMemo(()=>({basename:l,navigator:a,static:o,future:et({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);"string"==typeof r&&(r=x(r));let{pathname:h="/",search:f="",hash:p="",state:g=null,key:v="default"}=r,y=u.useMemo(()=>{let e=F(h,l);return null==e?null:{location:{pathname:e,search:f,hash:p,state:g,key:v},navigationType:i}},[l,h,f,p,g,v,i]);return null==y?null:u.createElement(rt.Provider,{value:c},u.createElement(it.Provider,{children:n,value:y}))}function Et(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:u.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:u.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:u.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}u.startTransition,new Promise(()=>{}),u.Component;var St=n(5795);function jt(){return jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jt.apply(this,arguments)}function Ct(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(aa){}function At(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=jt({},t,{errors:Tt(t.errors)})),t}function Tt(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&"RouteErrorResponse"===r.__type)n[e]=new J(r.status,r.statusText,r.data,!0===r.internal);else if(r&&"Error"===r.__type){if(r.__subType){let t=window[r.__subType];if("function"==typeof t)try{let i=new t(r.message);i.stack="",n[e]=i}catch(e){}}if(null==n[e]){let t=new Error(r.message);t.stack="",n[e]=t}}else n[e]=r;return n}const Lt=u.createContext({isTransitioning:!1}),Ot=u.createContext(new Map),Rt=u.startTransition,Dt=St.flushSync;function Mt(e){Dt?Dt(e):e()}u.useId;class qt{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}}function Pt(e){let{fallbackElement:t,router:n,future:r}=e,[i,a]=u.useState(n.state),[o,s]=u.useState(),[l,c]=u.useState({isTransitioning:!1}),[d,h]=u.useState(),[f,p]=u.useState(),[m,g]=u.useState(),v=u.useRef(new Map),{v7_startTransition:y}=r||{},b=u.useCallback(e=>{y?function(e){Rt?Rt(e):e()}(e):e()},[y]),x=u.useCallback((e,t)=>{let{deletedFetchers:r,flushSync:i,viewTransitionOpts:o}=t;e.fetchers.forEach((e,t)=>{void 0!==e.data&&v.current.set(t,e.data)}),r.forEach(e=>v.current.delete(e));let l=null==n.window||null==n.window.document||"function"!=typeof n.window.document.startViewTransition;if(o&&!l){if(i){Mt(()=>{f&&(d&&d.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})});let t=n.window.document.startViewTransition(()=>{Mt(()=>a(e))});return t.finished.finally(()=>{Mt(()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})})}),void Mt(()=>p(t))}f?(d&&d.resolve(),f.skipTransition(),g({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(s(e),c({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else i?Mt(()=>a(e)):b(()=>a(e))},[n.window,f,d,v,b]);u.useLayoutEffect(()=>n.subscribe(x),[n,x]),u.useEffect(()=>{l.isTransitioning&&!l.flushSync&&h(new qt)},[l]),u.useEffect(()=>{if(d&&o&&n.window){let e=o,t=d.promise,r=n.window.document.startViewTransition(async()=>{b(()=>a(e)),await t});r.finished.finally(()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})}),p(r)}},[b,o,d,n.window]),u.useEffect(()=>{d&&o&&i.location.key===o.location.key&&d.resolve()},[d,f,i.location,o]),u.useEffect(()=>{!l.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),g(void 0))},[l.isTransitioning,m]),u.useEffect(()=>{},[]);let w=u.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})}),[n]),_=n.basename||"/",k=u.useMemo(()=>({router:n,navigator:w,static:!1,basename:_}),[n,w,_]),N=u.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return u.useEffect(()=>function(e,t){null==e||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}(r,n.future),[r,n.future]),u.createElement(u.Fragment,null,u.createElement(tt.Provider,{value:k},u.createElement(nt.Provider,{value:i},u.createElement(Ot.Provider,{value:v.current},u.createElement(Lt.Provider,{value:l},u.createElement(Nt,{basename:_,location:i.location,navigationType:i.historyAction,navigator:w,future:N},i.initialized||n.future.v7_partialHydration?u.createElement(It,{routes:n.routes,future:n.future,state:i}):t))))),null)}const It=u.memo(Bt);function Bt(e){let{routes:t,future:n,state:r}=e;return ht(t,void 0,r,n)}var Ft,Ut;function zt(e){let t=u.useRef(Ct(e)),n=u.useRef(!1),r=lt(),i=u.useMemo(()=>function(e,t){let n=Ct(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}(r.search,n.current?null:t.current),[r.search]),a=dt(),o=u.useCallback((e,t)=>{const r=Ct("function"==typeof e?e(i):e);n.current=!0,a("?"+r,t)},[a,i]);return[i,o]}"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(Ft||(Ft={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ut||(Ut={}));var $t=n(8395),Ht=n(790);const Vt=({route:e})=>{let{title:t="",backUrl:n="",id:r}=e;const i=dt(),o=ut(),d=lt(),u=_t(),h=wt(),f={navigate:i,params:o,location:d,redirect:X,replace:Q,matches:u,navigation:h,createSearchParams:Ct};return t=wp.hooks.applyFilters("dokan-vendor-dashboard-header-title",t),n=wp.hooks.applyFilters(`dokan-vendor-${(0,$t.kebabCase)(r)}-dashboard-header-backUrl`,n),(0,Ht.jsxs)("div",{className:"@container/header flex flex-col gap-4",children:[(0,Ht.jsx)("div",{className:"@container/before-header grid grid-cols-4 gap-4",children:(0,Ht.jsx)(l.Slot,{name:"dokan-before-header"})}),(0,Ht.jsxs)("div",{className:"dokan-header-title-section @container/header-title-section flex gap-y-4 justify-between items-center flex-wrap",children:[(0,Ht.jsx)("div",{className:"dokan-header-title w-full md:!w-1/2 flex flex-wrap",children:t&&(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)("h3",{className:"text-2xl font-semibold text-gray-800 md:text-4xl lg:text-3xl",children:t})," ",(0,Ht.jsx)(l.Slot,{name:"dokan-header-after-title",fillProps:{title:t,...f}})]})}),(0,Ht.jsxs)("div",{className:"dokan-header-actions w-full md:!w-1/2 flex flex-wrap gap-2.5 md:!justify-end",children:[n&&(0,Ht.jsxs)(c.DokanButton,{variant:"secondary",onClick:()=>i(n.replace(/:(\w+)/g,(e,t)=>o[t])),children:[(0,Ht.jsx)(s,{className:"text-dokan-link",size:16}),(0,a.__)("Back","dokan-lite")]}),(0,Ht.jsx)(l.Slot,{name:"dokan-header-actions",fillProps:{...f}})]})]}),(0,Ht.jsx)("div",{className:"@container/after-header grid grid-cols-4 gap-4",children:(0,Ht.jsx)(l.Slot,{name:"dokan-after-header",fillProps:{...f}})})]})},Wt=()=>(0,Ht.jsx)(Ht.Fragment,{children:(0,Ht.jsx)(l.Slot,{name:"dokan-footer-area"})}),Gt=()=>(0,Ht.jsx)(Ht.Fragment,{}),Zt=({children:e})=>(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)(Gt,{}),(0,Ht.jsxs)("div",{className:"dokan-layout-content-area",children:[(0,Ht.jsx)(l.Slot,{name:"dokan-layout-content-area-before"}),e,(0,Ht.jsx)(l.Slot,{name:"dokan-layout-content-area-after"})]})]}),Kt=window.wp.plugins;var Yt=n(8446),Xt=n(7512);const Qt=(0,e.createContext)(null),Jt={primary:"var(--dokan-button-background-color, #7047EB)",primaryForeground:"var(--dokan-button-text-color, #ffffff)",success:"var(--dokan-success-color, #16A34A)",successForeground:"var(--dokan-success-text-color, #ffffff)"},en=({children:t})=>{const[n,r]=(0,e.useState)("light");return(0,Ht.jsx)(Qt.Provider,{value:{theme:n,setTheme:r},children:(0,Ht.jsx)(Xt.ThemeProvider,{pluginId:"dokan-lite",tokens:Jt,children:t})})},tn=({children:e,route:t,headerComponent:n,footerComponent:r})=>{const i=lt();return(e=>{const t=e.replace(/^\//,""),n=document.querySelector(`.dokan-dashboard-menu li[data-react-route='${t}']`)||null;if(!n)return;document.querySelectorAll(".dokan-dashboard-menu li").forEach(e=>{e.classList.remove("active"),e.querySelectorAll(".navigation-submenu li").forEach(e=>{e.classList.remove("current")})});const r=n.closest(".dokan-dashboard-menu > li");r&&r.classList.add("active");const i=document.querySelector(`.navigation-submenu li[data-react-route='${t}']`);i&&i.classList.add("current")})(i?.pathname),(0,Ht.jsx)(en,{children:(0,Ht.jsxs)(l.SlotFillProvider,{children:[(0,Ht.jsxs)("div",{className:"dokan-dashboard-layout",children:[n||(0,Ht.jsx)(Vt,{route:t}),(0,Ht.jsx)(Zt,{children:e}),r||(0,Ht.jsx)(Wt,{})]}),(0,Ht.jsx)(Kt.PluginArea,{scope:t.id}),(0,Ht.jsx)(Yt.DokanToaster,{containerClassName:"dokan-toaster"})]})})};var nn=n(8448),rn=n(1455),an=n.n(rn);const on=()=>{const[t,n]=(0,e.useState)(null),[r,i]=(0,e.useState)(!0),[a,o]=(0,e.useState)(null),s=(0,e.useCallback)(async()=>{try{i(!0),o(null);const e=await an()({path:"/dokan/v1/withdraw/balance",method:"GET"});n(e)}catch(e){o(e instanceof Error?e:new Error("Failed to fetch balance")),console.error("Error fetching balance:",e)}finally{i(!1)}},[]);return(0,e.useEffect)(()=>{s()},[s]),{data:t,isLoading:r,error:a,refresh:(0,e.useCallback)(()=>{s()},[s])}},sn=()=>{const[t,n]=(0,e.useState)(null),[r,i]=(0,e.useState)(!0),[a,o]=(0,e.useState)(null),s=(0,e.useCallback)(async()=>{try{i(!0),o(null);const e=await an()({path:"/dokan/v2/withdraw/settings",method:"GET"});n(e)}catch(e){o(e instanceof Error?e:new Error("Failed to fetch withdraw settings")),console.error("Error fetching withdraw settings:",e)}finally{i(!1)}},[]);(0,e.useEffect)(()=>{s()},[s]);const l=(0,e.useCallback)(()=>{s()},[s]);return{data:t,setData:n,isLoading:r,error:a,refresh:l}};var ln=n(3832),cn=n(5620),dn=n(8537);const un=()=>{const[t,n]=(0,e.useState)(!1),[r,i]=(0,e.useState)(null);return{isLoading:t,error:r,createWithdraw:(0,e.useCallback)(async e=>{try{n(!0),i(null),await an()({path:"/dokan/v1/withdraw",method:"POST",data:e})}catch(e){throw i(e instanceof Error?e:new Error("Failed to create withdraw")),e}finally{n(!1)}},[]),updateWithdraw:(0,e.useCallback)(async(e,t)=>{try{n(!0),i(null),await an()({path:`/dokan/v1/withdraw/${e}`,method:"PUT",data:t})}catch(e){throw i(e instanceof Error?e:new Error("Failed to update withdraw")),e}finally{n(!1)}},[])}};var hn=n(181);function fn(e,t=500,n){const r=(0,u.useRef)();!function(e){const t=(0,u.useRef)(e);t.current=e,(0,u.useEffect)(()=>()=>{t.current()},[])}(()=>{r.current&&r.current.cancel()});const i=(0,u.useMemo)(()=>{const i=hn(e,t,n),a=(...e)=>i(...e);return a.cancel=()=>{i.cancel()},a.isPending=()=>!!r.current,a.flush=()=>i.flush(),a},[e,t,n]);return(0,u.useEffect)(()=>{r.current=hn(e,t,n)},[e,t,n]),i}"undefined"!=typeof window?u.useLayoutEffect:u.useEffect;const pn=function({settings:t,withdrawRequests:n,balanceData:r}){const[i,o]=(0,e.useState)(!1),[s,d]=(0,e.useState)(""),u=un(),h=(0,Yt.useToast)(),[f,p]=(0,e.useState)(""),{fetchCharge:m,isLoading:g,data:v,error:y}=(()=>{const[t,n]=(0,e.useState)(null),[r,i]=(0,e.useState)(!1),[a,o]=(0,e.useState)(null);return{data:t,isLoading:r,error:a,fetchCharge:(0,e.useCallback)(async(e,t)=>{if(e&&t)try{i(!0),o(null);const r=await an()({path:`/dokan/v1/withdraw/charge?method=${e}&amount=${t}`,method:"GET"});n(r)}catch(e){var r;o(e),n(null!==(r=e?.data)&&void 0!==r?r:null)}finally{i(!1)}else n(null)},[])}})(),b=n?.data&&Array.isArray(n?.data)&&n?.data?.length>0,x=t?.data?.payment_methods&&Array.isArray(t?.data?.payment_methods)&&t?.data?.payment_methods.length>0,w=Number(r?.data?.current_balance)>=Number(r?.data?.withdraw_limit);function _(e,t){m(e,t)}const k=()=>{const t={method:f,amount:(0,$t.unformatNumber)(s)};t.amount?u.createWithdraw(t).then(()=>{o(!1),h({title:(0,a.__)("Withdraw request created.","dokan-lite"),type:"success"}),n.refresh()}).catch(t=>{let n=(0,a.__)("Failed to create withdraw.","dokan-lite");t?.message&&(n=(0,Ht.jsx)(e.RawHTML,{children:t?.message})),h({title:n,type:"error"})}):h({title:(0,a.__)("Withdraw amount is required","dokan-lite"),type:"error"})},N=fn(function(e,t){d(e),_(f,t)},500);(0,e.useEffect)(()=>{y&&y?.message&&y?.message.length>0&&h({title:y?.message,type:"error"})},[y]),(0,e.useEffect)(()=>{var e,n;if(!i)return;const r=null!==(e=t?.data?.payment_methods)&&void 0!==e?e:[],a=null!==(n=t?.data?.withdraw_method)&&void 0!==n?n:"",o=r.some(e=>e.value===a);a&&o?p(a):r.length>0&&p(r[0].value)},[i,t]);const E=x?(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)("div",{children:(0,Ht.jsx)(Yt.SearchableSelect,{label:(0,a.__)("Withdraw method","dokan-lite"),value:(j=f,t?.data?.payment_methods.find(e=>e.value===j)),onChange:e=>{p(e.value),_(e.value,(0,$t.unformatNumber)(s))},options:t?.data?.payment_methods})}),(0,Ht.jsx)("div",{className:"mt-3",children:(0,Ht.jsx)(c.DokanPriceInput,{namespace:"withdraw-request",label:(0,a.__)("Withdraw amount","dokan-lite"),value:s,onChange:(e,t)=>{N(e,t)},input:{id:"withdraw-amount",name:"withdraw-amount",placeholder:(0,a.__)("Enter amount","dokan-lite")}})}),(0,Ht.jsx)("div",{className:"mt-3",children:(0,Ht.jsx)(Yt.SimpleInput,{label:(0,a.__)("Withdraw charge","dokan-lite"),value:g?(0,a.__)("Calculating…","dokan-lite"):(0,dn.decodeEntities)((()=>{let e="";if(!s)return(0,$t.formatPrice)(0);const t=v?.charge_data?.fixed?Number(v?.charge_data?.fixed):"",n=v?.charge_data?.percentage?Number(v?.charge_data?.percentage):"";return t&&(e+=(0,$t.formatPrice)(t)),n&&(e+=e?" + ":"",e+=`${n}%`,e+=` = ${(0,$t.formatPrice)(v?.charge)}`),e||(e=(0,$t.formatPrice)(v?.charge).toString()),e})()),input:{id:"withdraw-charge",name:"withdraw-charge",type:"text",placeholder:"",disabled:!0}})}),(0,Ht.jsx)("div",{className:"mt-3",children:(0,Ht.jsx)(Yt.SimpleInput,{label:(0,a.__)("Receivable amount","dokan-lite"),value:g?(0,a.__)("Calculating…","dokan-lite"):(0,dn.decodeEntities)(s?(0,$t.formatPrice)(null!==(S=v?.receivable)&&void 0!==S?S:0):(0,$t.formatPrice)(0)),input:{id:"receivable-amount",name:"receivable-amount",type:"text",placeholder:"",disabled:!0}})})]}):(0,Ht.jsx)(c.DokanAlert,{variant:"warning",label:(0,a.__)("No payment methods found to submit a withdrawal request.","dokan-lite"),children:(0,Ht.jsx)("div",{className:"text-sm mt-1 font-light",children:(0,Ht.jsx)(e.RawHTML,{children:(0,a.sprintf)((0,a.__)("Please set up your %1$spayment methods%2$s first.","dokan-lite"),`<a href="${window?.dokanFrontend?.withdraw?.paymentSettingUrl}" class="dokan-link">`,"</a>")})})});var S,j;const C=b?(0,Ht.jsx)(Yt.SimpleAlert,{type:"danger",color:"red",label:(0,a.__)("You already have pending withdraw request(s). Please submit your request after approval or cancellation of your previous request.","dokan-lite")}):w?E:(0,Ht.jsx)(Yt.SimpleAlert,{type:"danger",color:"red",label:(0,a.__)("You don't have sufficient balance for a withdraw request!","dokan-lite")}),A=()=>(0,Ht.jsxs)("div",{className:"flex flex-row gap-3 justify-end",children:[(0,Ht.jsx)(c.DokanButton,{onClick:()=>o(!1),variant:"secondary",children:(0,a.__)("Close","dokan-lite")}),!b&&w&&x&&(0,Ht.jsx)(c.DokanButton,{onClick:k,disabled:g||u?.isLoading,loading:u?.isLoading,children:u?.isLoading?(0,a.__)("Creating…","dokan-lite"):(0,a.__)("Submit request","dokan-lite")})]}),T=()=>window?.dokanFrontend?.withdraw?.isManualWithdrawEnable&&(0,Ht.jsx)(c.DokanButton,{onClick:()=>o(!0),children:(0,a.__)("Request Withdraw","dokan-lite")});return(0,Ht.jsxs)(Ht.Fragment,{children:["/withdraw-requests"!==lt()?.pathname?(0,Ht.jsx)(T,{}):(0,Ht.jsx)(l.Fill,{name:"dokan-header-actions",children:(0,Ht.jsx)(T,{})}),(0,Ht.jsx)(c.DokanModal,{isOpen:i,namespace:"withdraw-request",onClose:()=>o(!1),onConfirm:k,dialogTitle:(0,a.__)("Send Withdraw Request","dokan-lite"),dialogContent:C,dialogFooterContent:(0,Ht.jsx)(A,{}),className:"min-w-[600px] dokan-withdraw-style-reset",modalClassName:"dokan-layout",hideCancelButton:!0,confirmButtonText:(0,a.__)("Submit request","dokan-lite"),loading:g||u?.isLoading})]})},mn=()=>(0,Ht.jsxs)(Yt.Card,{children:[(0,Ht.jsx)(Yt.Card.Header,{children:(0,Ht.jsx)("div",{className:"h-6 w-24 bg-gray-200 rounded animate-pulse"})}),(0,Ht.jsx)(Yt.Card.Body,{children:(0,Ht.jsx)("div",{className:"space-y-4",children:(0,Ht.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ht.jsxs)("div",{className:"space-y-2",children:[(0,Ht.jsx)("div",{className:"h-4 w-32 bg-gray-200 rounded animate-pulse"}),(0,Ht.jsx)("div",{className:"h-4 w-48 bg-gray-200 rounded animate-pulse"})]}),(0,Ht.jsx)("div",{className:"h-10 w-32 bg-gray-200 rounded animate-pulse"})]})})})]}),gn=function({bodyData:e,settings:t,masterLoading:n,withdrawRequests:r}){var i,o;return!e||!e.hasOwnProperty("isLoading")||e.isLoading||n?(0,Ht.jsx)(mn,{}):(0,Ht.jsx)(Ht.Fragment,{children:(0,Ht.jsxs)(Yt.Card,{className:"dokan-withdraw-style-reset dokan-layout",children:[(0,Ht.jsx)(Yt.Card.Header,{children:(0,Ht.jsx)(Yt.Card.Title,{className:"p-0 m-0",children:(0,a.__)("Balance","dokan-lite")})}),(0,Ht.jsx)(Yt.Card.Body,{children:(0,Ht.jsxs)("div",{className:"flex flex-col md:!flex-row sm:!items-center justify-between",children:[(0,Ht.jsxs)("div",{className:"flex flex-col",children:[(0,Ht.jsxs)("div",{className:"text-gray-700 md:mb-4 sm:mb-0 flex",children:[(0,Ht.jsx)("span",{children:(0,a.__)("Your Balance:","dokan-lite")})," ",(0,Ht.jsx)("span",{className:"font-semibold",children:(0,Ht.jsx)(cn.A,{price:null!==(i=e?.data?.current_balance)&&void 0!==i?i:""})})]}),(0,Ht.jsxs)("div",{className:"text-gray-700 md:mb-4 sm:mb-0 flex",children:[(0,Ht.jsx)("span",{children:(0,a.__)("Minimum Withdraw Amount: ","dokan-lite")})," ",(0,Ht.jsx)("span",{className:"font-semibold",children:(0,Ht.jsx)(cn.A,{price:null!==(o=e?.data?.withdraw_limit)&&void 0!==o?o:""})})]})]}),window?.dokanFrontend?.withdraw?.isManualWithdrawEnable&&(0,Ht.jsx)(pn,{settings:t,withdrawRequests:r,balanceData:e})]})})]})})};var vn=n(2106);const yn={table:{density:"comfortable"},list:{}},bn={pending:(0,a.__)("Pending Review","dokan-lite"),approved:(0,a.__)("Approved","dokan-lite"),cancelled:(0,a.__)("Cancelled","dokan-lite")},xn=[{id:"amount",label:(0,a.__)("Amount","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)(cn.A,{price:e?.amount})},{id:"method_title",label:(0,a.__)("Method","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("span",{children:e?.method_title})},{id:"created",label:(0,a.__)("Date","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)(vn.A,{date:e?.created})},{id:"charge",label:(0,a.__)("Charge","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)(cn.A,{price:e?.charge})},{id:"receivable",label:(0,a.__)("Receivable","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)(cn.A,{price:e?.receivable})}],wn={id:"status",label:(0,a.__)("Status","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("span",{children:bn[e?.status]})},_n={id:"note",label:(0,a.__)("Note","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("span",{children:e?.note})},kn=e=>[...xn,..."pending"===e?[wn]:[],..."cancelled"===e?[_n]:[]],Nn=[...xn,wn],En=function({withdrawRequests:t,loading:n=!0}){var r;const i=un(),o=(0,Yt.useToast)(),s=(0,e.useMemo)(()=>[{id:"withdraw-cancel",isEligible:()=>!0,label:()=>(0,a.__)("Cancel","dokan-lite"),isDestructive:!0,confirmButtonLabel:(0,a.__)("Cancel Withdraw","dokan-lite"),callback:([e])=>{i.updateWithdraw(e.id,{status:"cancelled"}).then(()=>{o({type:"success",title:(0,a.__)("Request cancelled successfully","dokan-lite")}),t.refresh()}).catch(()=>{o({type:"error",title:(0,a.__)("Failed to cancel request","dokan-lite")})})}}],[i.updateWithdraw,t.refresh]),l=(0,e.useCallback)(e=>{var n;t.setView(e),t.fetchWithdrawRequests({...t.lastPayload,page:e.page,status:"pending",per_page:e.perPage,user_id:null!==(n=t.lastPayload?.user_id)&&void 0!==n?n:0})},[t.setView,t.fetchWithdrawRequests,t.lastPayload]);return(0,Ht.jsx)(c.DataViews,{namespace:"dokan-pending-requests-data-view",data:null!==(r=t?.data)&&void 0!==r?r:[],defaultLayouts:yn,fields:Nn,getItemId:e=>String(e.id),onChangeView:l,search:!1,paginationInfo:{totalItems:t?.totalItems,totalPages:t?.totalPages},view:{...t?.view,fields:Nn.map(e=>e.id)},actions:s,isLoading:n})},Sn=()=>(0,Ht.jsxs)(Yt.Card,{children:[(0,Ht.jsx)(Yt.Card.Header,{children:(0,Ht.jsx)("div",{className:"h-6 w-32 bg-gray-200 rounded animate-pulse"})}),(0,Ht.jsx)(Yt.Card.Body,{children:(0,Ht.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ht.jsxs)("div",{className:"space-y-2",children:[(0,Ht.jsx)("div",{className:"h-5 w-28 bg-gray-200 rounded animate-pulse"}),(0,Ht.jsx)("div",{className:"h-4 w-64 bg-gray-200 rounded animate-pulse"})]}),(0,Ht.jsx)("div",{className:"h-10 w-32 bg-gray-200 rounded animate-pulse"})]})})]}),jn=function({bodyData:e,masterLoading:t,withdrawRequests:n,settings:r}){var i,o,s;const d=dt();return!e||!e.hasOwnProperty("isLoading")||e.isLoading||t?(0,Ht.jsx)(Sn,{}):(0,Ht.jsxs)(l.SlotFillProvider,{children:[(0,Ht.jsxs)(Yt.Card,{children:[(0,Ht.jsx)(Yt.Card.Header,{children:(0,Ht.jsx)(Yt.Card.Title,{className:"p-0 m-0",children:(0,a.__)("Payment Details","dokan-lite")})}),(0,Ht.jsx)(Yt.Card.Body,{children:(0,Ht.jsxs)("div",{className:"space-y-4",children:[(0,Ht.jsxs)("div",{className:"flex flex-col md:!flex-row sm:!items-center justify-between",children:[(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("span",{className:"text-gray-700 mb-2",children:(0,a.__)("Last Payment","dokan-lite")}),e?.data?.last_withdraw?.id?(0,Ht.jsxs)("div",{className:"flex",children:[(0,Ht.jsx)("strong",{children:(0,Ht.jsx)(cn.A,{price:null!==(i=e?.data?.last_withdraw?.amount)&&void 0!==i?i:""})})," ",(0,a.__)("on","dokan-lite")," ",(0,Ht.jsx)("strong",{children:(0,Ht.jsx)("em",{children:(0,Ht.jsx)(vn.A.Date,{date:null!==(o=e?.data?.last_withdraw?.date)&&void 0!==o?o:""})})})," ",(0,a.__)("to","dokan-lite")," ",(0,Ht.jsx)("strong",{children:null!==(s=e?.data?.last_withdraw?.method_title)&&void 0!==s?s:""})]}):(0,Ht.jsx)("p",{className:"text-gray-600",children:(0,a.__)("You do not have any approved withdraw yet.","dokan-lite")})]}),(0,Ht.jsx)(c.DokanButton,{onClick:()=>{d("/withdraw-requests")},children:(0,a.__)("View Payments","dokan-lite")})]}),(0,Ht.jsx)(l.Slot,{name:"dokan-vendor-dashboard-withdraw-payment-details",fillProps:{withdrawRequests:n,bodyData:e,masterLoading:t,settings:r}}),!n?.isLoading&&n?.data&&Array.isArray(n?.data)&&n?.data.length>0&&(0,Ht.jsxs)("div",{className:"flex flex-col border-t pt-4",children:[(0,Ht.jsx)("h4",{className:"font-medium text-gray-900 mb-2",children:(0,a.__)("Pending Requests","dokan-lite")}),(0,Ht.jsx)(En,{withdrawRequests:n,loading:t||n.isLoading||r.isLoading})]})]})})]}),(0,Ht.jsx)(Kt.PluginArea,{})]})};var Cn=n(856);const An=()=>(0,Ht.jsxs)(Yt.Card,{children:[(0,Ht.jsx)(Yt.Card.Header,{children:(0,Ht.jsx)("div",{className:"h-6 w-36 bg-gray-200 rounded animate-pulse"})}),(0,Ht.jsx)(Yt.Card.Body,{children:(0,Ht.jsxs)("div",{className:"space-y-4",children:[(0,Ht.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ht.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,Ht.jsx)("div",{className:"h-8 w-8 bg-gray-200 rounded animate-pulse"}),(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("div",{className:"h-4 w-16 bg-gray-200 rounded animate-pulse mb-2"}),(0,Ht.jsx)("div",{className:"h-4 w-36 bg-gray-200 rounded animate-pulse"})]})]}),(0,Ht.jsx)("div",{className:"h-10 w-20 bg-gray-200 rounded animate-pulse"})]}),(0,Ht.jsxs)("div",{className:"flex items-center justify-between border-t pt-4",children:[(0,Ht.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,Ht.jsx)("div",{className:"h-8 w-8 bg-gray-200 rounded animate-pulse"}),(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("div",{className:"h-4 w-24 bg-gray-200 rounded animate-pulse mb-2"}),(0,Ht.jsx)("div",{className:"h-4 w-48 bg-gray-200 rounded animate-pulse"})]})]}),(0,Ht.jsx)("div",{className:"h-10 w-20 bg-gray-200 rounded animate-pulse"})]})]})})]}),Tn=function({bodyData:t,masterLoading:n}){const r=(()=>{const[t,n]=(0,e.useState)(!1),[r,i]=(0,e.useState)(null),[a,o]=(0,e.useState)("");return{isLoading:t,error:r,makeDefaultMethod:(0,e.useCallback)(async e=>{try{n(!0),i(null),o(e),await an()({path:"/dokan/v2/withdraw/make-default-method",method:"POST",data:{method:e}})}catch(e){i(e instanceof Error?e:new Error("Failed to make default method")),console.error("Error making default method:",e)}finally{n(!1),o("")}},[]),makingDefault:a}})(),i=(0,Yt.useToast)();return!t||!t.hasOwnProperty("isLoading")||t.isLoading||n?(0,Ht.jsx)(An,{}):(0,Ht.jsxs)(Yt.Card,{children:[(0,Ht.jsx)(Yt.Card.Header,{children:(0,Ht.jsx)(Yt.Card.Title,{className:"p-0 m-0",children:(0,a.__)("Payment Methods","dokan-lite")})}),(0,Ht.jsx)(Yt.Card.Body,{children:(0,Ht.jsx)("div",{className:"space-y-4",children:t?.data?.active_methods&&Object.values(t?.data?.active_methods).map((e,n)=>{var o,s,l,d;return(0,Ht.jsxs)("div",{className:(0,Cn.QP)("flex flex-col md:!flex-row sm:!items-center justify-between",0!==n?"border-t pt-4":""),children:[(0,Ht.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,Ht.jsx)("img",{src:null!==(o=e?.icon)&&void 0!==o?o:"",alt:"icon",className:"w-8 h-8"}),(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("span",{className:"font-medium",children:null!==(s=e?.label)&&void 0!==s?s:""}),(0,Ht.jsx)("span",{className:"text-gray-500 ml-2",children:null!==(l=e?.info)&&void 0!==l?l:""})]})]}),(d=e,d.has_information&&d?.value===t?.data?.withdraw_method?(0,Ht.jsx)(c.DokanButton,{disabled:!0,variant:"secondary",children:(0,a.__)("Default","dokan-lite")}):d.has_information&&d?.value!==t?.data?.withdraw_method?(0,Ht.jsx)(c.DokanButton,{onClick:()=>{r.makeDefaultMethod(d.value).then(()=>{i({type:"success",title:(0,a.__)("Default method updated","dokan-lite")}),t.setData({...t.data,withdraw_method:d.value})})},disabled:r.isLoading,loading:r.isLoading&&r.makingDefault===d.value,children:(0,a.__)("Make Default","dokan-lite")}):(0,Ht.jsx)("a",{href:t?.data?.setup_url,className:"dokan-btn",children:(0,a.__)("Setup","dokan-lite")}))]},e.value)})})})]})};var Ln=n(2816);const On=()=>{const t=((t=!1)=>{const[n,r]=(0,e.useState)(null),[i,a]=(0,e.useState)(0),[o,s]=(0,e.useState)(0),[l,c]=(0,e.useState)({perPage:10,page:1,search:"",type:"table",layout:{styles:{amount:{width:"16%"},method_title:{width:"20%"},created:{width:"16%"},charge:{width:"16%"},receivable:{width:"16%"},status:{width:"16%"}}}}),[d,u]=(0,e.useState)(t),[h,f]=(0,e.useState)(null),p=(0,e.useRef)(null),m=(0,e.useCallback)(async e=>{try{u(!0),f(null),p.current?p.current=Object.assign({},p.current,e):p.current=e;const t=(0,ln.addQueryArgs)("/dokan/v1/withdraw",e),n=await an()({path:t,parse:!1}),i=await n.json(),o=n.headers,l=o.get("X-WP-Total"),c=o.get("X-WP-TotalPages");a(Number(l)),s(Number(c)),r(i)}catch(e){f(e instanceof Error?e:new Error("Failed to fetch withdraw requests")),console.error("Error fetching withdraw requests:",e)}finally{u(!1)}},[]),g=(0,e.useCallback)(()=>{p.current&&m(p.current)},[m]);return{data:n,isLoading:d,error:h,fetchWithdrawRequests:m,refresh:g,totalItems:i,totalPages:o,lastPayload:p.current,view:l,setView:c,setData:r}})(!0),n=sn(),r=(0,Ln.useCurrentUser)(),i=on();return(0,e.useEffect)(()=>{var e;r&&t.fetchWithdrawRequests({per_page:10,page:1,status:"pending",user_id:null!==(e=r?.id)&&void 0!==e?e:0})},[r]),(0,Ht.jsx)(Ht.Fragment,{children:(0,Ht.jsxs)("div",{className:"dokan-withdraw-wrapper dokan-react-withdraw space-y-6",children:[(0,Ht.jsx)(gn,{masterLoading:t.isLoading,bodyData:i,settings:n,withdrawRequests:t}),(0,Ht.jsx)(jn,{masterLoading:t.isLoading,bodyData:i,withdrawRequests:t,settings:n}),(0,Ht.jsx)(Tn,{masterLoading:t.isLoading,bodyData:n})]})})};var Rn=n(8443);const Dn=(0,o.A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Mn=function(){const t=sn(),n=on(),r=(0,Ln.useCurrentUser)(),i=un(),o=(0,Yt.useToast)(),[s,l]=(0,e.useState)([]),[d,u]=(0,e.useState)(!0),[h,f]=(0,e.useState)(0),[p,m]=(0,e.useState)(0),[g,v]=(0,e.useState)({total:0,pending:0,approved:0,cancelled:0}),[y,b]=(0,e.useState)(""),[x,w]=(0,e.useState)(""),[_,k]=(0,e.useState)(""),[N,E]=(0,e.useState)(""),[S,j]=(0,e.useState)("startDate"),[C,A]=(0,e.useState)({start_date:"",end_date:""}),[T,L]=(0,e.useState)({perPage:10,page:1,search:"",type:"table",status:"pending",fields:kn("pending").map(e=>e.id),layout:{styles:{amount:{width:"20%"},method_title:{width:"20%"},created:{width:"20%"},charge:{width:"20%"},receivable:{width:"20%"}}}}),O=T.status,R=(0,e.useMemo)(()=>kn(O),[O]),D=(0,e.useCallback)(async()=>{try{const e=await an()({path:"/dokan/v2/withdraw/summary",method:"GET"});v(e)}catch(e){console.error("Failed to fetch withdraw summary:",e)}},[]),M=(0,e.useCallback)(async()=>{if(r?.id){u(!0);try{var e,t;const n={per_page:T.perPage,page:T.page,status:T.status,user_id:r.id};C.start_date&&C.end_date&&(n.start_date=C.start_date,n.end_date=C.end_date);const i=await an()({path:(0,ln.addQueryArgs)("/dokan/v1/withdraw",n),parse:!1}),a=await i.json(),o=parseInt(null!==(e=i.headers.get("X-WP-Total"))&&void 0!==e?e:"0"),s=parseInt(null!==(t=i.headers.get("X-WP-TotalPages"))&&void 0!==t?t:"0");f(o),m(s),l(a)}catch(e){o({type:"error",title:(0,a.__)("Failed to fetch withdraw requests","dokan-lite")})}finally{u(!1)}}},[T.perPage,T.page,T.status,r?.id,C.start_date,C.end_date]),q=(0,e.useMemo)(()=>({data:s,isLoading:d,refresh:()=>M(),totalItems:h,totalPages:p,view:{perPage:10,page:1,search:"",type:"table"},setView:()=>{},setData:()=>{},error:null,fetchWithdrawRequests:()=>{},lastPayload:null}),[s,d,h,p,M]),P=(0,e.useMemo)(()=>"pending"!==O?[]:[{id:"withdraw-cancel",isEligible:()=>!0,label:()=>(0,a.__)("Cancel","dokan-lite"),isDestructive:!0,confirmButtonLabel:(0,a.__)("Cancel Withdraw","dokan-lite"),callback:([e])=>{i.updateWithdraw(e.id,{status:"cancelled"}).then(()=>{o({type:"success",title:(0,a.__)("Request cancelled successfully","dokan-lite")}),M(),D()}).catch(()=>{o({type:"error",title:(0,a.__)("Failed to cancel request","dokan-lite")})})}}],[O,i.updateWithdraw,M,D]);(0,e.useEffect)(()=>{M()},[M]),(0,e.useEffect)(()=>{D()},[D]);const I=(0,e.useCallback)(()=>{b(""),w(""),k(""),E(""),j("startDate"),A({start_date:"",end_date:""}),L(e=>({...e,page:1}))},[]),B=(0,e.useCallback)((e,t)=>{const n=(0,Rn.getSettings)().formats.date;return(0,a.sprintf)((0,a.__)("%1$s - %2$s","dokan-lite"),(0,Rn.dateI18n)(n,e),(0,Rn.dateI18n)(n,t))},[]),F=(0,e.useMemo)(()=>({fields:[{id:"date-range",label:(0,a.__)("Date Range","dokan-lite"),field:(0,Ht.jsx)(c.DateRangePicker,{after:y,afterText:x,before:_,beforeText:N,focusedInput:S,onUpdate:e=>{void 0!==e.after&&b(e.after),void 0!==e.afterText&&w(e.afterText),void 0!==e.before&&k(e.before),void 0!==e.beforeText&&E(e.beforeText),e.focusedInput&&(j(e.focusedInput),"endDate"===e.focusedInput&&(e.after||y)&&(k(""),E("")))},shortDateFormat:"MM/DD/YYYY",isInvalidDate:()=>!1,onClear:I,onOk:()=>{y&&_&&(A({start_date:y,end_date:_}),L(e=>({...e,page:1})))},children:(0,Ht.jsx)(Yt.SimpleInput,{addOnLeft:(0,Ht.jsx)(Dn,{size:"16"}),className:"border rounded px-3 py-1.5 w-full bg-white",onChange:()=>{},input:{type:"text",value:y&&_?B(y,_):"",placeholder:(0,a.__)("Enter Date","dokan-lite"),readOnly:!0}})},"date-range-select")}],onReset:I,onFilterRemove:e=>{"date-range"===e&&I()}}),[y,x,_,N,S,I,B]),U={items:[{label:(0,a.__)("Pending Requests","dokan-lite"),value:"pending",count:g.pending},{label:(0,a.__)("Approved Requests","dokan-lite"),value:"approved",count:g.approved},{label:(0,a.__)("Cancelled Requests","dokan-lite"),value:"cancelled",count:g.cancelled}],viewKey:"status",onSelect:e=>{const t=kn(e);u(!0),l([]),L(n=>({...n,page:1,search:"",status:e,fields:t.map(e=>e.id)}))}},z={totalItems:h,totalPages:p},$=(0,e.useCallback)(e=>{L(e)},[]);return(0,Ht.jsxs)("div",{className:"dokan-withdraw-wrapper dokan-react-withdraw space-y-6",children:[(0,Ht.jsx)(pn,{settings:t,withdrawRequests:q,balanceData:n}),(0,Ht.jsx)(c.DataViews,{namespace:"dokan-withdraw-request-data-view",data:s,defaultLayouts:yn,fields:R,getItemId:e=>String(e.id),onChangeView:$,paginationInfo:z,view:T,actions:P,isLoading:d,search:!1,tabs:U,filter:F})]})};var qn=n(4960);const Pn=window.dokan.productEditor,In=(0,o.A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var Bn=n(7143);const Fn=window.dokan.productEditorStore;var Un=n.n(Fn);const zn=(0,o.A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),$n=e=>{if(e)return"invalid"===e.custom?.type?e.custom.message||(0,a.__)("This field is invalid.","dokan-lite"):"invalid"===e.required?.type?e.required.message||(0,a.__)("Please fill out this field.","dokan-lite"):"invalid"===e.elements?.type?e.elements.message||(0,a.__)("Value must be one of the elements.","dokan-lite"):void 0},Hn=({label:t,field:n,children:r,error:o,className:s=""})=>{const[l,c]=(0,e.useState)(!1),d=(0,e.useCallback)(()=>{l||c(!0)},[l]),u=`dokan-form-field-${n.id}`,h=`flex flex-col gap-1 ${u} ${s}`,f=l&&o,p=()=>t?(0,Ht.jsx)("span",{children:t}):"string"==typeof n.rawLabel?(0,Ht.jsx)(e.RawHTML,{className:"dokan-form-field-label",children:(0,dn.decodeEntities)(n.rawLabel)}):n.label;return(0,Ht.jsxs)("div",{id:u,className:h,children:[(0,Ht.jsxs)("div",{className:`${u}-label flex gap-1 items-center`,children:[(0,Ht.jsx)(p,{}),n.required&&(0,Ht.jsx)("span",{className:"dokan-form-field-label",children:(0,a.__)("(REQUIRED)","dokan-lite")}),n.tooltip&&(0,Ht.jsx)(qn.DokanTooltip,{content:n.tooltip,children:(0,Ht.jsx)(zn,{size:16})})]}),(0,Ht.jsx)("div",{onBlur:d,children:r}),n.description&&(0,Ht.jsx)("div",{className:"dokan-form-field-description",children:"string"==typeof n.description?(0,Ht.jsx)(e.RawHTML,{children:n.description}):n.description}),(0,i.applyFilters)("dokan_product_editor_after_ui_field",null,n),f&&(0,Ht.jsxs)("p",{className:"components-validated-control__indicator is-invalid",children:[(0,Ht.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"components-validated-control__indicator-icon","aria-hidden":"true",focusable:"false",children:(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})}),o]})]})};function Vn(e){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vn(e)}function Wn(e,t,n){return(t=function(e){var t=function(e){if("object"!=Vn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Vn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vn(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gn(Object(n),!0).forEach(function(t){Wn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Kn(){return Kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kn.apply(null,arguments)}var Yn=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Xn=Math.abs,Qn=String.fromCharCode,Jn=Object.assign;function er(e){return e.trim()}function tr(e,t,n){return e.replace(t,n)}function nr(e,t){return e.indexOf(t)}function rr(e,t){return 0|e.charCodeAt(t)}function ir(e,t,n){return e.slice(t,n)}function ar(e){return e.length}function or(e){return e.length}function sr(e,t){return t.push(e),e}var lr=1,cr=1,dr=0,ur=0,hr=0,fr="";function pr(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:lr,column:cr,length:o,return:""}}function mr(e,t){return Jn(pr("",null,null,"",null,null,0),e,{length:-e.length},t)}function gr(){return hr=ur>0?rr(fr,--ur):0,cr--,10===hr&&(cr=1,lr--),hr}function vr(){return hr=ur<dr?rr(fr,ur++):0,cr++,10===hr&&(cr=1,lr++),hr}function yr(){return rr(fr,ur)}function br(){return ur}function xr(e,t){return ir(fr,e,t)}function wr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _r(e){return lr=cr=1,dr=ar(fr=e),ur=0,[]}function kr(e){return fr="",e}function Nr(e){return er(xr(ur-1,jr(91===e?e+2:40===e?e+1:e)))}function Er(e){for(;(hr=yr())&&hr<33;)vr();return wr(e)>2||wr(hr)>3?"":" "}function Sr(e,t){for(;--t&&vr()&&!(hr<48||hr>102||hr>57&&hr<65||hr>70&&hr<97););return xr(e,br()+(t<6&&32==yr()&&32==vr()))}function jr(e){for(;vr();)switch(hr){case e:return ur;case 34:case 39:34!==e&&39!==e&&jr(hr);break;case 40:41===e&&jr(e);break;case 92:vr()}return ur}function Cr(e,t){for(;vr()&&e+hr!==57&&(e+hr!==84||47!==yr()););return"/*"+xr(t,ur-1)+"*"+Qn(47===e?e:vr())}function Ar(e){for(;!wr(yr());)vr();return xr(e,ur)}var Tr="-ms-",Lr="-moz-",Or="-webkit-",Rr="comm",Dr="rule",Mr="decl",qr="@keyframes";function Pr(e,t){for(var n="",r=or(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Ir(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Mr:return e.return=e.return||e.value;case Rr:return"";case qr:return e.return=e.value+"{"+Pr(e.children,r)+"}";case Dr:e.value=e.props.join(",")}return ar(n=Pr(e.children,r))?e.return=e.value+"{"+n+"}":""}function Br(e){return kr(Fr("",null,null,null,[""],e=_r(e),0,[0],e))}function Fr(e,t,n,r,i,a,o,s,l){for(var c=0,d=0,u=o,h=0,f=0,p=0,m=1,g=1,v=1,y=0,b="",x=i,w=a,_=r,k=b;g;)switch(p=y,y=vr()){case 40:if(108!=p&&58==rr(k,u-1)){-1!=nr(k+=tr(Nr(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:k+=Nr(y);break;case 9:case 10:case 13:case 32:k+=Er(p);break;case 92:k+=Sr(br()-1,7);continue;case 47:switch(yr()){case 42:case 47:sr(zr(Cr(vr(),br()),t,n),l);break;default:k+="/"}break;case 123*m:s[c++]=ar(k)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+d:-1==v&&(k=tr(k,/\f/g,"")),f>0&&ar(k)-u&&sr(f>32?$r(k+";",r,n,u-1):$r(tr(k," ","")+";",r,n,u-2),l);break;case 59:k+=";";default:if(sr(_=Ur(k,t,n,c,d,i,s,b,x=[],w=[],u),a),123===y)if(0===d)Fr(k,t,_,_,x,a,u,s,w);else switch(99===h&&110===rr(k,3)?100:h){case 100:case 108:case 109:case 115:Fr(e,_,_,r&&sr(Ur(e,_,_,0,0,i,s,b,i,x=[],u),w),i,w,u,s,r?x:w);break;default:Fr(k,_,_,_,[""],w,0,s,w)}}c=d=f=0,m=v=1,b=k="",u=o;break;case 58:u=1+ar(k),f=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==gr())continue;switch(k+=Qn(y),y*m){case 38:v=d>0?1:(k+="\f",-1);break;case 44:s[c++]=(ar(k)-1)*v,v=1;break;case 64:45===yr()&&(k+=Nr(vr())),h=yr(),d=u=ar(b=k+=Ar(br())),y++;break;case 45:45===p&&2==ar(k)&&(m=0)}}return a}function Ur(e,t,n,r,i,a,o,s,l,c,d){for(var u=i-1,h=0===i?a:[""],f=or(h),p=0,m=0,g=0;p<r;++p)for(var v=0,y=ir(e,u+1,u=Xn(m=o[p])),b=e;v<f;++v)(b=er(m>0?h[v]+" "+y:tr(y,/&\f/g,h[v])))&&(l[g++]=b);return pr(e,t,n,0===i?Dr:s,l,c,d)}function zr(e,t,n){return pr(e,t,n,Rr,Qn(hr),ir(e,2,-2),0)}function $r(e,t,n,r){return pr(e,t,n,Mr,ir(e,0,r),ir(e,r+1,-1),r)}var Hr=function(e,t,n){for(var r=0,i=0;r=i,i=yr(),38===r&&12===i&&(t[n]=1),!wr(i);)vr();return xr(e,ur)},Vr=new WeakMap,Wr=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Vr.get(n))&&!r){Vr.set(e,!0);for(var i=[],a=function(e,t){return kr(function(e,t){var n=-1,r=44;do{switch(wr(r)){case 0:38===r&&12===yr()&&(t[n]=1),e[n]+=Hr(ur-1,t,n);break;case 2:e[n]+=Nr(r);break;case 4:if(44===r){e[++n]=58===yr()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Qn(r)}}while(r=vr());return e}(_r(e),t))}(t,i),o=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<o.length;c++,l++)e.props[l]=i[s]?a[s].replace(/&\f/g,o[c]):o[c]+" "+a[s]}}},Gr=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Zr(e,t){switch(function(e,t){return 45^rr(e,0)?(((t<<2^rr(e,0))<<2^rr(e,1))<<2^rr(e,2))<<2^rr(e,3):0}(e,t)){case 5103:return Or+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Or+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Or+e+Lr+e+Tr+e+e;case 6828:case 4268:return Or+e+Tr+e+e;case 6165:return Or+e+Tr+"flex-"+e+e;case 5187:return Or+e+tr(e,/(\w+).+(:[^]+)/,Or+"box-$1$2"+Tr+"flex-$1$2")+e;case 5443:return Or+e+Tr+"flex-item-"+tr(e,/flex-|-self/,"")+e;case 4675:return Or+e+Tr+"flex-line-pack"+tr(e,/align-content|flex-|-self/,"")+e;case 5548:return Or+e+Tr+tr(e,"shrink","negative")+e;case 5292:return Or+e+Tr+tr(e,"basis","preferred-size")+e;case 6060:return Or+"box-"+tr(e,"-grow","")+Or+e+Tr+tr(e,"grow","positive")+e;case 4554:return Or+tr(e,/([^-])(transform)/g,"$1"+Or+"$2")+e;case 6187:return tr(tr(tr(e,/(zoom-|grab)/,Or+"$1"),/(image-set)/,Or+"$1"),e,"")+e;case 5495:case 3959:return tr(e,/(image-set\([^]*)/,Or+"$1$`$1");case 4968:return tr(tr(e,/(.+:)(flex-)?(.*)/,Or+"box-pack:$3"+Tr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Or+e+e;case 4095:case 3583:case 4068:case 2532:return tr(e,/(.+)-inline(.+)/,Or+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ar(e)-1-t>6)switch(rr(e,t+1)){case 109:if(45!==rr(e,t+4))break;case 102:return tr(e,/(.+:)(.+)-([^]+)/,"$1"+Or+"$2-$3$1"+Lr+(108==rr(e,t+3)?"$3":"$2-$3"))+e;case 115:return~nr(e,"stretch")?Zr(tr(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==rr(e,t+1))break;case 6444:switch(rr(e,ar(e)-3-(~nr(e,"!important")&&10))){case 107:return tr(e,":",":"+Or)+e;case 101:return tr(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Or+(45===rr(e,14)?"inline-":"")+"box$3$1"+Or+"$2$3$1"+Tr+"$2box$3")+e}break;case 5936:switch(rr(e,t+11)){case 114:return Or+e+Tr+tr(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Or+e+Tr+tr(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Or+e+Tr+tr(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Or+e+Tr+e+e}return e}var Kr=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Mr:e.return=Zr(e.value,e.length);break;case qr:return Pr([mr(e,{value:tr(e.value,"@","@"+Or)})],r);case Dr:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Pr([mr(e,{props:[tr(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Pr([mr(e,{props:[tr(t,/:(plac\w+)/,":"+Or+"input-$1")]}),mr(e,{props:[tr(t,/:(plac\w+)/,":-moz-$1")]}),mr(e,{props:[tr(t,/:(plac\w+)/,Tr+"input-$1")]})],r)}return""})}}],Yr=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,i,a=e.stylisPlugins||Kr,o={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)o[t[n]]=!0;s.push(e)});var l,c,d,u,h=[Ir,(u=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&u(e)})],f=(c=[Wr,Gr].concat(a,h),d=or(c),function(e,t,n,r){for(var i="",a=0;a<d;a++)i+=c[a](e,t,n,r)||"";return i});i=function(e,t,n,r){l=n,Pr(Br(e?e+"{"+t.styles+"}":t.styles),f),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new Yn({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:i};return p.sheet.hydrate(s),p},Xr=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Qr={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Jr(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var ei=/[A-Z]|^ms/g,ti=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ni=function(e){return 45===e.charCodeAt(1)},ri=function(e){return null!=e&&"boolean"!=typeof e},ii=Jr(function(e){return ni(e)?e:e.replace(ei,"-$&").toLowerCase()}),ai=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(ti,function(e,t,n){return si={name:t,styles:n,next:si},t})}return 1===Qr[e]||ni(e)||"number"!=typeof t||0===t?t:t+"px"};function oi(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return si={name:i.name,styles:i.styles,next:si},i.name;var a=n;if(void 0!==a.styles){var o=a.next;if(void 0!==o)for(;void 0!==o;)si={name:o.name,styles:o.styles,next:si},o=o.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=oi(e,t,n[i])+";";else for(var a in n){var o=n[a];if("object"!=typeof o){var s=o;null!=t&&void 0!==t[s]?r+=a+"{"+t[s]+"}":ri(s)&&(r+=ii(a)+":"+ai(a,s)+";")}else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var l=oi(e,t,o);switch(a){case"animation":case"animationName":r+=ii(a)+":"+l+";";break;default:r+=a+"{"+l+"}"}}else for(var c=0;c<o.length;c++)ri(o[c])&&(r+=ii(a)+":"+ai(a,o[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=si,l=n(e);return si=s,oi(e,t,l)}}var c=n;if(null==t)return c;var d=t[c];return void 0!==d?d:c}var si,li=/label:\s*([^\s;{]+)\s*(;|$)/g;function ci(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";si=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,i+=oi(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=oi(n,t,e[o]),r&&(i+=a[o]);li.lastIndex=0;for(var s,l="";null!==(s=li.exec(i));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:si}}var di,ui,hi=!!u.useInsertionEffect&&u.useInsertionEffect,fi=hi||function(e){return e()},pi=(hi||u.useLayoutEffect,u.createContext("undefined"!=typeof HTMLElement?Yr({key:"css"}):null)),mi=(pi.Provider,function(e){return(0,u.forwardRef)(function(t,n){var r=(0,u.useContext)(pi);return e(t,r,n)})}),gi=u.createContext({}),vi={}.hasOwnProperty,yi="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",bi=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Xr(t,n,r),fi(function(){return function(e,t,n){Xr(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,n,r)}),null},xi=mi(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var i=e[yi],a=[r],o="";"string"==typeof e.className?o=function(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}(t.registered,a,e.className):null!=e.className&&(o=e.className+" ");var s=ci(a,void 0,u.useContext(gi));o+=t.key+"-"+s.name;var l={};for(var c in e)vi.call(e,c)&&"css"!==c&&c!==yi&&(l[c]=e[c]);return l.className=o,n&&(l.ref=n),u.createElement(u.Fragment,null,u.createElement(bi,{cache:t,serialized:s,isStringTag:"string"==typeof i}),u.createElement(i,l))}),wi=(n(4146),function(e,t){var n=arguments;if(null==t||!vi.call(t,"css"))return u.createElement.apply(void 0,n);var r=n.length,i=new Array(r);i[0]=xi,i[1]=function(e,t){var n={};for(var r in t)vi.call(t,r)&&(n[r]=t[r]);return n[yi]=e,n}(e,t);for(var a=2;a<r;a++)i[a]=n[a];return u.createElement.apply(null,i)});function _i(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ci(t)}function ki(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ni(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ki(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ki(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ei(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}di=wi||(wi={}),ui||(ui=di.JSX||(di.JSX={}));const Si=Math.min,ji=Math.max,Ci=Math.round,Ai=Math.floor,Ti=e=>({x:e,y:e});function Li(){return"undefined"!=typeof window}function Oi(e){return Mi(e)?(e.nodeName||"").toLowerCase():"#document"}function Ri(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Di(e){var t;return null==(t=(Mi(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Mi(e){return!!Li()&&(e instanceof Node||e instanceof Ri(e).Node)}function qi(e){return!!Li()&&(e instanceof Element||e instanceof Ri(e).Element)}function Pi(e){return!!Li()&&(e instanceof HTMLElement||e instanceof Ri(e).HTMLElement)}function Ii(e){return!(!Li()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ri(e).ShadowRoot)}function Bi(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ui(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}let Fi;function Ui(e){return Ri(e).getComputedStyle(e)}function zi(e){const t=function(e){if("html"===Oi(e))return e;const t=e.assignedSlot||e.parentNode||Ii(e)&&e.host||Di(e);return Ii(t)?t.host:t}(e);return function(e){return/^(html|body|#document)$/.test(Oi(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pi(t)&&Bi(t)?t:zi(t)}function $i(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=zi(e),a=i===(null==(r=e.ownerDocument)?void 0:r.body),o=Ri(i);if(a){const e=Hi(o);return t.concat(o,o.visualViewport||[],Bi(i)?i:[],e&&n?$i(e):[])}return t.concat(i,$i(i,[],n))}function Hi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vi(e){return qi(e)?e:e.contextElement}function Wi(e){const t=Vi(e);if(!Pi(t))return Ti(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=function(e){const t=Ui(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Pi(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ci(n)!==a||Ci(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}(t);let o=(a?Ci(n.width):n.width)/r,s=(a?Ci(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}const Gi=Ti(0);function Zi(e){const t=Ri(e);return null==Fi&&(Fi="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fi&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Gi}function Ki(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),a=Vi(e);let o=Ti(1);t&&(r?qi(r)&&(o=Wi(r)):o=Wi(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Ri(e))&&t}(a,n,r)?Zi(a):Ti(0);let l=(i.left+s.x)/o.x,c=(i.top+s.y)/o.y,d=i.width/o.x,u=i.height/o.y;if(a){const e=Ri(a),t=r&&qi(r)?Ri(r):r;let n=e,i=Hi(n);for(;i&&r&&t!==n;){const e=Wi(i),t=i.getBoundingClientRect(),r=Ui(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=a,c+=o,n=Ri(i),i=Hi(n)}}return function(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}({width:d,height:u,x:l,y:c})}function Yi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}var Xi=u.useLayoutEffect,Qi=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ji=function(){},ea=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,Zn({},Ei(e,Qi))},ta=function(e,t,n){var r=e.cx,i=e.getStyles,a=e.getClassNames,o=e.className;return{css:i(t,e),className:r(null!=n?n:{},a(t,e),o)}},na={get passive(){return!0}},ra="undefined"!=typeof window?window:{};ra.addEventListener&&ra.removeEventListener&&(ra.addEventListener("p",Ji,na),ra.removeEventListener("p",Ji,!1));var ia,aa,oa,sa=["children","innerProps"],la=["children","innerProps"],ca=(0,u.createContext)(null),da=["size"],ua=["innerProps","isRtl","size"],ha={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},fa=function(e){var t=e.size,n=Ei(e,da);return wi("svg",Kn({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ha},n))},pa=function(e){return wi(fa,Kn({size:20},e),wi("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},ma=function(e){return wi(fa,Kn({size:20},e),wi("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ga=function(){var e=_i.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(ia||(aa=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],oa||(oa=aa.slice(0)),ia=Object.freeze(Object.defineProperties(aa,{raw:{value:Object.freeze(oa)}})))),va=function(e){var t=e.delay,n=e.offset;return wi("span",{css:_i({animation:"".concat(ga," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},ya=["data"],ba=["innerRef","isDisabled","isHidden","inputClassName"],xa={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},wa=(Zn({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},xa),function(e){return Zn({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},xa)}),_a=function(e){var t=e.children,n=e.innerProps;return wi("div",n,t)},ka={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return wi("div",Kn({},ta(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||wi(pa,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,i=e.innerRef,a=e.innerProps,o=e.menuIsOpen;return wi("div",Kn({ref:i},ta(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":o}),a,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return wi("div",Kn({},ta(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||wi(ma,null))},DownChevron:ma,CrossIcon:pa,Group:function(e){var t=e.children,n=e.cx,r=e.getStyles,i=e.getClassNames,a=e.Heading,o=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,d=e.selectProps;return wi("div",Kn({},ta(e,"group",{group:!0}),s),wi(a,Kn({},o,{selectProps:d,theme:c,getStyles:r,getClassNames:i,cx:n}),l),wi("div",null,t))},GroupHeading:function(e){var t=ea(e);t.data;var n=Ei(t,ya);return wi("div",Kn({},ta(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return wi("div",Kn({},ta(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return wi("span",Kn({},t,ta(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=ea(e),i=r.innerRef,a=r.isDisabled,o=r.isHidden,s=r.inputClassName,l=Ei(r,ba);return wi("div",Kn({},ta(e,"input",{"input-container":!0}),{"data-value":n||""}),wi("input",Kn({className:t({input:!0},s),ref:i,style:wa(o),disabled:a},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,i=void 0===r?4:r,a=Ei(e,ua);return wi("div",Kn({},ta(Zn(Zn({},a),{},{innerProps:t,isRtl:n,size:i}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),wi(va,{delay:0,offset:n}),wi(va,{delay:160,offset:!0}),wi(va,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return wi("div",Kn({},ta(e,"menu",{menu:!0}),{ref:n},r),t)},MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,i=e.isMulti;return wi("div",Kn({},ta(e,"menuList",{"menu-list":!0,"menu-list--is-multi":i}),{ref:r},n),t)},MenuPortal:function(e){var t,n=e.appendTo,r=e.children,i=e.controlElement,a=e.innerProps,o=e.menuPlacement,s=e.menuPosition,l=(0,u.useRef)(null),c=(0,u.useRef)(null),d=Ni((0,u.useState)("auto"===(t=o)?"bottom":t),2),h=d[0],f=d[1],p=(0,u.useMemo)(function(){return{setPortalPlacement:f}},[]),m=Ni((0,u.useState)(null),2),g=m[0],v=m[1],y=(0,u.useCallback)(function(){if(i){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(i),t="fixed"===s?0:window.pageYOffset,n=e[h]+t;n===(null==g?void 0:g.offset)&&e.left===(null==g?void 0:g.rect.left)&&e.width===(null==g?void 0:g.rect.width)||v({offset:n,rect:e})}},[i,s,h,null==g?void 0:g.offset,null==g?void 0:g.rect.left,null==g?void 0:g.rect.width]);Xi(function(){y()},[y]);var b=(0,u.useCallback)(function(){"function"==typeof c.current&&(c.current(),c.current=null),i&&l.current&&(c.current=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Vi(e),d=i||a?[...c?$i(c):[],...t?$i(t):[]]:[];d.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const u=c&&s?function(e,t){let n,r=null;const i=Di(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:f}=c;if(s||t(),!h||!f)return;const p={rootMargin:-Ai(u)+"px "+-Ai(i.clientWidth-(d+h))+"px "+-Ai(i.clientHeight-(u+f))+"px "+-Ai(d)+"px",threshold:ji(0,Si(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return o();r?o(!1,r):n=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==r||Yi(c,e.getBoundingClientRect())||o(),m=!1}try{r=new IntersectionObserver(g,{...p,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),a}(c,n):null;let h,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),c&&!l&&p.observe(c),t&&p.observe(t));let m=l?Ki(e):null;return l&&function t(){const r=Ki(e);m&&!Yi(m,r)&&n(),m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}(i,l.current,y,{elementResize:"ResizeObserver"in window}))},[i,y]);Xi(function(){b()},[b]);var x=(0,u.useCallback)(function(e){l.current=e,b()},[b]);if(!n&&"fixed"!==s||!g)return null;var w=wi("div",Kn({ref:x},ta(Zn(Zn({},e),{},{offset:g.offset,position:s,rect:g.rect}),"menuPortal",{"menu-portal":!0}),a),r);return wi(ca.Provider,{value:p},n?(0,St.createPortal)(w,n):w)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,i=Ei(e,la);return wi("div",Kn({},ta(Zn(Zn({},i),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,r=e.innerProps,i=Ei(e,sa);return wi("div",Kn({},ta(Zn(Zn({},i),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},MultiValue:function(e){var t=e.children,n=e.components,r=e.data,i=e.innerProps,a=e.isDisabled,o=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,d=n.Remove;return wi(l,{data:r,innerProps:Zn(Zn({},ta(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),i),selectProps:s},wi(c,{data:r,innerProps:Zn({},ta(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),wi(d,{data:r,innerProps:Zn(Zn({},ta(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},o),selectProps:s}))},MultiValueContainer:_a,MultiValueLabel:_a,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return wi("div",Kn({role:"button"},n),t||wi(pa,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,i=e.isSelected,a=e.innerRef,o=e.innerProps;return wi("div",Kn({},ta(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":i}),{ref:a,"aria-disabled":n},o),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return wi("div",Kn({},ta(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,i=e.isRtl;return wi("div",Kn({},ta(e,"container",{"--is-disabled":r,"--is-rtl":i}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return wi("div",Kn({},ta(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,r=e.isMulti,i=e.hasValue;return wi("div",Kn({},ta(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":i}),n),t)}};const Na=(0,o.A)("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Ea=(0,o.A)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var Sa=n(9491);const ja=e=>e&&"string"==typeof e.label?{...e,label:(0,dn.decodeEntities)(e.label)}:e,Ca=e=>Array.isArray(e)?e.map(ja):ja(e),Aa=async(e,t="")=>{if(!e)return[];try{const n=await an()({path:(0,ln.addQueryArgs)(e,{search:t,per_page:20})});return Array.isArray(n)?n.map(e=>({value:e.id,label:(0,dn.decodeEntities)(e.name)})):[]}catch{return[]}},Ta=(e,t=0)=>e.reduce((e,n)=>(e.push({...n,level:t}),n.children?.length&&e.push(...Ta(n.children,t+1)),e),[]),La=e=>{const{data:t,isSelected:n,children:r}=e;return(0,Ht.jsx)(ka.Option,{...e,children:(0,Ht.jsxs)("div",{style:{paddingLeft:20*(t.level||0)+10+"px"},className:"flex items-center gap-2",children:[n?(0,Ht.jsx)(Na,{size:16}):(0,Ht.jsx)(Ea,{size:16}),r]})})},Oa=(e,t)=>(n,r,a)=>{const o=n.trim(),s=e=>String(e?.label).trim().toLowerCase()===o.toLowerCase(),l=!!o&&!r.some(s)&&!a.some(s);return(0,i.applyFilters)("dokan_product_editor_is_valid_new_option",l,n,e,t)},Ra=e=>(0,Sa.debounce)((...t)=>e(...t),300),Da=({data:t,field:n,onChange:r,validity:i})=>{var a;const[o,s]=(0,e.useState)([]);(0,e.useEffect)(()=>{let e=!0;return an()({path:n.api_endpoint}).then(t=>e&&s(Ta(Array.isArray(t)?t:[]).map(ja))).catch(()=>{}),()=>{e=!1}},[n.api_endpoint]);const l=Array.isArray(t[n.id])?t[n.id].map(ja):[],c=n.multiple?l:null!==(a=l[0])&&void 0!==a?a:null;return(0,Ht.jsx)(Hn,{field:n,error:$n(i),children:(0,Ht.jsx)(qn.Select,{isMulti:n.multiple,options:o,value:c,placeholder:n.placeholder,closeMenuOnSelect:!!n.multiple,hideSelectedOptions:!1,components:{Option:La},onChange:e=>{let t=[];n.multiple?t=null!=e?e:[]:e&&(t=[e]),r({[n.id]:t})}})})},Ma=({data:t,field:n,onChange:r,validity:i})=>{var a;const[o,s]=(0,e.useState)([]),l=(0,e.useMemo)(()=>Ra(e=>Aa(n.api_endpoint,e).then(s)),[n.api_endpoint]);return(0,e.useEffect)(()=>{let e=!0;return Aa(n.api_endpoint).then(t=>e&&s(t)),()=>{e=!1,l.cancel()}},[n.api_endpoint,l]),(0,Ht.jsx)(Hn,{field:n,error:$n(i),children:(0,Ht.jsx)(Yt.TaggableSelect,{isMulti:n.multiple,options:o,value:Ca(null!==(a=t[n.id])&&void 0!==a?a:[]),placeholder:n.placeholder,filterOption:null,isValidNewOption:Oa(n,t),onInputChange:(e,t)=>{"input-change"===t.action&&l(e)},onChange:e=>r({[n.id]:null!=e?e:[]})})})},qa=({data:t,field:n,onChange:r,validity:i})=>{const a=(0,e.useMemo)(()=>Ra((e,t)=>Aa(n.api_endpoint,e).then(t)),[n.api_endpoint]);return(0,e.useEffect)(()=>()=>a.cancel(),[a]),(0,Ht.jsx)(Hn,{field:n,error:$n(i),children:(0,Ht.jsx)(qn.AsyncSelect,{isMulti:n.multiple,cacheOptions:!0,defaultOptions:!0,value:Ca(t[n.id]),loadOptions:a,onChange:e=>r({[n.id]:e}),placeholder:n.placeholder,components:{MultiValue:ka.MultiValue,ValueContainer:ka.ValueContainer}})})},Pa=e=>e.field.tree?(0,Ht.jsx)(Da,{...e}):e.field.creatable?(0,Ht.jsx)(Ma,{...e}):(0,Ht.jsx)(qa,{...e});var Ia=n(231);const Ba=(0,o.A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),Fa=({attr:t,onUpdate:n,onRemove:r,productType:i,cardExpanded:o,index:s,isDragOver:l,onDragStart:c,onDragEnter:d,onDragOver:u,onDrop:h,onDragEnd:f})=>{var p;const[m,g]=(0,e.useState)(o),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)(!1),[w,_]=(0,e.useState)(""),[k,N]=(0,e.useState)(!1),[E,S]=(0,e.useState)(!1),j=Boolean(window.dokanProductEditor?.can_add_new_attribute),C=(e,r)=>{n({...t,[e]:r})},A=`/dokan/v1/products/attributes/${t.id}/terms`,T=e=>({value:e.value,label:e.label}),L=(0,e.useCallback)(async e=>{if(!t.is_taxonomy||!t.id)return[];try{const t=await an()({path:(0,ln.addQueryArgs)(A,{search:e||"",per_page:20})});return Array.isArray(t)?t.map(T):[]}catch{return[]}},[t.id,t.is_taxonomy]),O=(0,e.useMemo)(()=>(0,Sa.debounce)((...e)=>{const t=e[0]||"",n=e[1];L(t).then(n)},300),[L]);(0,e.useEffect)(()=>()=>O.cancel(),[O]);const R=e=>{const r=Array.isArray(e)?e:[],i=r.map(e=>e.value);n({...t,options:i,terms:r})},D=()=>{g(!m)};return(0,Ht.jsxs)("div",{className:"border rounded bg-white overflow-hidden transition-[border-color,opacity] duration-200 "+(l?"border-primary border-dashed":""),draggable:v,onDragStart:()=>c(s),onDragEnter:()=>d(s),onDragOver:u,onDrop:h,onDragEnd:()=>{y(!1),f()},children:[(0,Ht.jsxs)("div",{role:"button",tabIndex:0,className:"flex justify-between items-center p-3 bg-gray-50 border-b cursor-pointer select-none",onClick:D,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),D())},children:[(0,Ht.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ht.jsx)("button",{type:"button",className:"cursor-grab text-gray-400 hover:text-gray-600 bg-transparent border-none",onMouseDown:e=>{e.stopPropagation(),y(!0)},onMouseUp:()=>y(!1),onClick:e=>e.stopPropagation(),children:(0,Ht.jsx)(Ba,{size:16})}),(0,Ht.jsx)("span",{className:"font-semibold text-gray-700 text-sm",children:t.name||(0,a.__)("New Attribute","dokan-lite")})]}),(0,Ht.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ht.jsx)("button",{type:"button",onClick:r,className:"text-red-500 hover:text-red-700 text-xs font-medium bg-transparent border-none",children:(0,a.__)("Remove","dokan-lite")}),(0,Ht.jsx)("span",{className:"transform transition-transform duration-200 "+(m?"rotate-180":""),children:(0,Ht.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,Ht.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),m&&(0,Ht.jsxs)("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4 bg-white",children:[(0,Ht.jsx)("div",{children:(0,Ht.jsx)(Ia.A,{label:(0,a.__)("Name","dokan-lite"),value:t.name,onChange:e=>C("name",e),disabled:!!t.is_taxonomy,className:"w-full px-3 py-2 border rounded text-sm disabled:bg-gray-100 disabled:text-gray-500",input:{placeholder:(0,a.__)("e.g. Color or Size","dokan-lite")}})}),(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",htmlFor:`dokan-attr-values-${t.id}`,children:(0,a.__)("Value(s)","dokan-lite")}),t.is_taxonomy?(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)(qn.AsyncSelect,{isMulti:!0,cacheOptions:!0,defaultOptions:!0,closeMenuOnSelect:!1,value:null!==(p=t.terms)&&void 0!==p?p:[],loadOptions:O,onChange:e=>R(e),placeholder:(0,a.__)("Select terms","dokan-lite")}),(0,Ht.jsxs)("div",{className:"flex justify-start gap-2 items-center mt-2",children:[(0,Ht.jsx)(qn.DokanButton,{type:"button",variant:"secondary",onClick:async()=>{if(t.is_taxonomy&&t.id){S(!0);try{const e=1e3,t=await an()({path:(0,ln.addQueryArgs)(A,{per_page:e})});R(Array.isArray(t)?t.map(T):[])}catch{}finally{S(!1)}}},disabled:E,loading:E,children:(0,a.__)("Select all","dokan-lite")}),(0,Ht.jsx)(qn.DokanButton,{type:"button",variant:"secondary",onClick:()=>{R([])},children:(0,a.__)("Select none","dokan-lite")}),j&&(0,Ht.jsx)(qn.DokanButton,{type:"button",variant:"secondary",onClick:()=>x(!0),children:(0,a.__)("Add New","dokan-lite")})]}),j&&(0,Ht.jsx)(qn.DokanModal,{isOpen:b,namespace:"add-attribute-term",dialogTitle:(0,a.__)("Add New Term","dokan-lite"),onClose:()=>{x(!1),_("")},onConfirm:async()=>{if(w.trim()&&t.is_taxonomy){N(!0);try{var e;const n=await an()({path:`/dokan/v1/products/attributes/${t.id}/terms`,method:"POST",data:{name:w.trim()}}),r={value:n.id,label:n.name},i=null!==(e=t.terms)&&void 0!==e?e:[];R([...i,r]),_(""),x(!1)}catch{}finally{N(!1)}}},loading:k,confirmButtonDisabled:!w.trim(),dialogContent:(0,Ht.jsx)("div",{children:(0,Ht.jsx)(Yt.SimpleInput,{label:(0,a.__)("Term Name","dokan-lite"),value:w,onChange:e=>_(e.target.value),className:"w-full px-3 py-2 border rounded text-sm",input:{id:`dokan-new-term-${t.id}`,placeholder:(0,a.__)("Enter term name","dokan-lite"),autoFocus:!0}})})})]}):(0,Ht.jsx)(Yt.TaggableSelect,{isMulti:!0,value:(t.options||[]).map(e=>({value:e,label:e})),onChange:e=>R(e),placeholder:(0,a.__)("Enter values","dokan-lite")})]}),(0,Ht.jsxs)("div",{className:"col-span-1 md:col-span-2 mt-2 text-sm text-gray-600 flex flex-col md:flex-row gap-4",children:[(0,Ht.jsxs)("label",{className:"inline-flex items-center",htmlFor:`dokan-attr-visible-${t.id}`,children:[(0,Ht.jsx)(Yt.SimpleCheckbox,{checked:t.visible,onChange:e=>C("visible",e.target.checked),input:{id:`dokan-attr-visible-${t.id}`}}),(0,a.__)("Visible on the product page","dokan-lite")]}),i?.includes("variable")&&(0,Ht.jsxs)("label",{className:"inline-flex items-center",htmlFor:`dokan-attr-variation-${t.id}`,children:[(0,Ht.jsx)(Yt.SimpleCheckbox,{checked:t.variation,onChange:e=>C("variation",e.target.checked),input:{id:`dokan-attr-variation-${t.id}`}}),(0,a.__)("Used for variations","dokan-lite")]})]})]})]})},Ua=({data:t,field:n,onChange:r,validity:o})=>{const s=(0,e.useMemo)(()=>t[n.id]||[],[t,n.id]),{isLoading:l,submitHandler:c,getDefaultValue:d,handleDefaultChange:u}=Po(t.id),{type:h}=t,[f,p]=(0,e.useState)(!1),m=(0,e.useRef)(null),[g,v]=(0,e.useState)(null),y=(0,e.useCallback)(e=>{m.current=e},[]),b=(0,e.useCallback)(e=>{v(e)},[]),x=(0,e.useCallback)(e=>{e.preventDefault()},[]),w=(0,e.useCallback)(()=>{const e=m.current,t=g;if(null===e||null===t||e===t)return m.current=null,void v(null);const i=[...s],[a]=i.splice(e,1);i.splice(t,0,a);const o=i.map((e,t)=>({...e,position:t}));r({[n.id]:o}),m.current=null,v(null)},[s,g,r,n.id]),_=(0,e.useCallback)(()=>{m.current=null,v(null)},[]),[k,N]=(0,e.useState)(null),E=(0,e.useCallback)(async e=>{const t={label:(0,a.__)("Custom Attribute","dokan-lite"),value:""};let n=[];try{const e=await an()({path:"/dokan/v1/products/attributes"});n=Array.isArray(e)?e:[]}catch{n=[]}const r=(e||"").toLowerCase(),i=n.map(e=>({label:e.name,value:e.id,slug:e.slug})).filter(e=>!s.some(t=>t.is_taxonomy&&Number(t.id)===Number(e.value))).filter(e=>!r||e.label.toLowerCase().includes(r));return!r||t.label.toLowerCase().includes(r)?[t,...i]:i},[s]),S=(0,e.useMemo)(()=>s.filter(e=>e.variation),[s]),j=(0,e.useCallback)(e=>e.is_taxonomy&&e.terms?e.terms.map(e=>({label:e.label,value:e.label})):(e.options||[]).map(e=>({label:String(e),value:String(e)})),[]);return(0,Ht.jsx)(Hn,{field:n,error:$n(o),children:(0,Ht.jsxs)("div",{className:"flex flex-col gap-4",children:[s.map((e,t)=>(0,Ht.jsx)(Fa,{attr:e,productType:h,cardExpanded:f,onUpdate:e=>((e,t)=>{const i=[...s];i[e]=t,r({[n.id]:i})})(t,e),onRemove:e=>{e.stopPropagation(),(e=>{const t=[...s];t.splice(e,1),r({[n.id]:t})})(t)},index:t,isDragOver:g===t,onDragStart:y,onDragEnter:b,onDragOver:x,onDrop:w,onDragEnd:_},e.position)),(0,Ht.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Ht.jsx)("div",{className:"grow",children:(0,Ht.jsx)(qn.AsyncSelect,{cacheOptions:!0,defaultOptions:!0,value:k,loadOptions:E,onChange:e=>N(e),placeholder:(0,a.__)("Add existing attribute or custom","dokan-lite"),isClearable:!1},s.length)}),(0,Ht.jsx)(qn.DokanButton,{type:"button",variant:"secondary",onClick:()=>{const e={id:0,name:"",options:[],visible:!0,variation:!1,position:s.length,is_taxonomy:!1,value:""};k&&""!==k.value?(e.id=parseInt(k.value,10),e.name=k.label,e.is_taxonomy=!0):e.name=(0,a.__)("Custom Attribute","dokan-lite");const t=[...s,e];r({[n.id]:t}),N(null),p(!0)},children:(0,a.__)("Add New","dokan-lite")})]}),h.includes("variable")&&S.length>0&&(0,Ht.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Ht.jsx)("div",{className:"text-sm font-medium text-gray-700",children:(0,a.__)("Default Form Values","dokan-lite")}),(0,Ht.jsx)("div",{className:"grid md:grid-cols-3 sm:grid-cols-2 gap-4",children:S.map(e=>(0,Ht.jsx)(qn.Select,{options:j(e),placeholder:`${(0,a.__)("No default","dokan-lite")} ${e.name}…`,value:d(e),onChange:t=>u(e,t),isClearable:!0},e.name))})]}),s.length>0&&(0,Ht.jsx)("div",{children:(0,Ht.jsx)(qn.DokanButton,{type:"button",variant:"secondary",onClick:c,disabled:l,loading:l,label:(0,a.__)("Save Attributes","dokan-lite")})}),(0,i.applyFilters)("dokan_product_editor_after_attributes",null,t,s)]})})},za=({data:e,field:t,onChange:n,validity:r})=>(0,Ht.jsx)(Hn,{field:t,error:$n(r),children:(0,Ht.jsx)(qn.DateTimePicker,{placeholder:t.placeholder,currentDate:e[t.id],onChange:e=>{n({[t.id]:e})}})}),$a=(0,o.A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);var Ha=n(8697);const Va=({images:e,onRemove:t,children:n,itemClassName:r=""})=>{const i=Array.isArray(e)?e:[e];return 0!==i.length||n?(0,Ht.jsxs)("div",{className:"flex flex-wrap gap-3",children:[i.map((e,n)=>(0,Ht.jsxs)("div",{className:`relative group border border-gray-200 rounded-md overflow-hidden ${r}`,children:[(0,Ht.jsx)("img",{src:e.url,alt:e.alt||"product",className:"w-full h-full object-cover"}),(0,Ht.jsx)("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors duration-200 flex items-center justify-center",children:(0,Ht.jsx)("button",{type:"button",className:"bg-white rounded-full p-1 shadow-sm opacity-0 group-hover:opacity-100 transition-opacity duration-200 hover:text-red-500",onClick:e=>{e.preventDefault(),t(n)},children:(0,Ht.jsx)(Ha.A,{size:16})})})]},e.url)),n]}):null},Wa=({data:t,field:n,onChange:r,validity:o})=>{const[s,l]=(0,e.useState)(t[n.id]),c=e=>{r({[n.id]:e}),l({id:e.id,url:e.url,alt:e.alt})},d="dokan-product-image_id "+(n.is_custom?"is-custom":"");return(0,Ht.jsxs)(Hn,{field:n,error:$n(o),children:[s?.url?(0,Ht.jsx)(Va,{itemClassName:d,images:s,onRemove:()=>{r({[n.id]:null}),l(null)}}):(0,Ht.jsx)(qn.MediaUploader,{onSelect:c,className:d,children:(0,Ht.jsxs)(qn.DokanButton,{variant:"secondary",className:"uppercase",children:[(0,Ht.jsx)($a,{size:16}),(0,a.__)("Upload","dokan-lite")]})}),(0,i.applyFilters)("dokan_product_editor_after_ui_image_id",null,t,n,c)]})},Ga=(0,o.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Za={type:"downloadable_product"},Ka=({field:t,onChange:n,validity:r})=>{const[o,s]=(0,e.useState)(t.value?.length>0?t.value:[{id:"",name:"",file:""}]);(0,e.useEffect)(()=>{t.value?.length>0&&s(t.value)},[t.value]);const l=Boolean((0,i.applyFilters)("dokan_product_editor_file_field_read_only","downloads"!==t?.id,t)),d=(0,i.applyFilters)("dokan_product_editor_file_field_uploader_params","downloads"===t?.id?Za:void 0,t),u=(e,r,i)=>{const a=o.map((t,n)=>n===e?{...t,[r]:i}:t);s(a),n({[t.id]:a})};return(0,Ht.jsx)(Hn,{field:t,error:$n(r),children:(0,Ht.jsxs)("div",{className:"flex flex-col gap-3",children:[o.map((e,r)=>(0,Ht.jsx)("div",{className:"flex flex-col gap-2 p-3 border border-gray-200 rounded relative bg-white",children:(0,Ht.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,Ht.jsx)("div",{className:"min-w-0 flex-1 basis-0",children:(0,Ht.jsx)(Yt.SimpleInput,{value:e.name||"",onChange:e=>u(r,"name",e.target.value),input:{placeholder:(0,a.__)("Enter name","dokan-lite"),readOnly:l,disabled:l}})}),(0,Ht.jsx)("div",{className:"min-w-0 flex-2 basis-0",children:(0,Ht.jsx)(Yt.SimpleInput,{value:e.file||"",onChange:e=>u(r,"file",e.target.value),input:{placeholder:(0,a.__)("Enter URL or select file","dokan-lite"),readOnly:l,disabled:l}})}),(0,Ht.jsxs)("div",{className:"flex gap-2 shrink-0 items-center",children:[(0,Ht.jsx)(qn.MediaUploader,{uploaderParams:d,onSelect:e=>((e,r)=>{const i=Array.isArray(e)?e[0]:e,a=[...o];a[r]={...a[r],id:String(i.id),file:i.url,name:i.title||i.name},s(a),n({[t.id]:a})})(e,r),children:(0,Ht.jsx)(c.DokanButton,{icon:$a,variant:"secondary",label:(0,a.__)("Choose","dokan-lite"),className:"whitespace-nowrap"})}),(0,Ht.jsx)(c.DokanButton,{type:"button",variant:"secondary",onClick:()=>(e=>{const r=o.filter((t,n)=>n!==e);s(r),n({[t.id]:r})})(r),children:(0,Ht.jsx)(Ha.A,{size:16})})]})]})},r)),(0,Ht.jsx)(c.DokanButton,{icon:Ga,variant:"secondary",label:(0,a.__)("Add New","dokan-lite"),onClick:()=>{const e=[...o,{id:"",name:"",file:""}];s(e),n({[t.id]:e})},className:"self-start"})]})})},Ya=({field:t,onChange:n,validity:r})=>{const[i,a]=(0,e.useState)(t.value||[]);return(0,Ht.jsx)(Hn,{field:t,error:$n(r),children:(0,Ht.jsx)(Va,{images:i,onRemove:e=>{const r=i.filter((t,n)=>n!==e);n({[t.id]:r.map(e=>e.id)}),a(r)},itemClassName:`dokan-product-${t.id}`,children:(0,Ht.jsx)(qn.MediaUploader,{onSelect:e=>{const r=[...i,...e].filter((e,t,n)=>t===n.findIndex(t=>t.id===e.id));n({[t.id]:r.map(e=>e.id)}),a(r)},className:`dokan-product-${t.id}`,multiple:!0,children:(0,Ht.jsx)($a,{size:16})})})})};var Xa=n(2956);const Qa=({data:t,field:n,onChange:r,validity:i})=>{var o;const[s,l]=(0,e.useState)(Number(t.vendor_earning)),c=null!==(o=t[n.id])&&void 0!==o?o:"",[d,u]=(0,e.useState)(()=>(0,Xa.formatNumber)(c));(0,e.useEffect)(()=>{u(e=>Number((0,Xa.unformatNumber)(e))===Number(c)?e:(0,Xa.formatNumber)(c))},[c,n.id]);const h=()=>"regular_price"===n.id?(0,Ht.jsxs)("div",{className:"flex gap-1 items-center",children:[n.label," ",s>0&&(0,Ht.jsxs)("span",{className:"text-xs font-normal text-gray-500",children:["( ",(0,a.__)("Your Earn:","dokan-lite")," ",(0,dn.decodeEntities)((0,Xa.formatPrice)(s))," ",")"]})]}):n.label;return(0,Ht.jsx)(Hn,{field:n,label:(0,Ht.jsx)(h,{}),error:$n(i),children:(0,Ht.jsx)(qn.DokanPriceInput,{label:"",value:d,namespace:`dokan-field-${n.id}`,className:"product-editor-price-input",input:{id:n.id,placeholder:n.placeholder||""},onChange:(e,i)=>{u(e);const a=i>0?Number(i):"";r({[n.id]:a}),(async e=>{if("regular_price"===n.id)try{const n=await an()({path:(0,ln.addQueryArgs)("/dokan/v1/commission",{amount:e,product_id:t.id,category_ids:t.category_ids||[],context:"seller"})});l(Number(n))}catch(e){l(0)}})(Number(a))}})})},Ja=({data:e,field:t,onChange:n,validity:r})=>(0,Ht.jsx)(Hn,{field:t,error:$n(r),children:(0,Ht.jsx)(qn.RichText,{placeholder:t.placeholder,value:e[t.id],onChange:e=>{n({[t.id]:e})}})}),eo=({data:e,field:t,onChange:n,validity:r})=>(0,Ht.jsx)(Hn,{field:t,error:$n(r),children:(0,Ht.jsx)(Yt.TextArea,{input:{id:`textarea-${t.id}`,placeholder:t.placeholder,rows:5},value:e[t.id]||"",onChange:e=>{n({[t.id]:e.target.value})}})}),to=({children:e,...t})=>{const{data:n,isSelected:r}=t,i=20*(n.level||0)+10;return(0,Ht.jsx)(ka.Option,{...t,children:(0,Ht.jsxs)("div",{style:{paddingLeft:`${i}px`},className:"flex items-center gap-2",children:[r?(0,Ht.jsx)(Na,{size:16}):(0,Ht.jsx)(Ea,{size:16}),e]})})},no=(e,t=0)=>e.reduce((e,n)=>{const r={...n,level:t};return e.push(r),n.children&&n.children.length>0&&e.push(...no(n.children,t+1)),e},[]),ro=({data:e,field:t,onChange:n,validity:r})=>{const a=(0,u.useMemo)(()=>{let n=t.elements||[];if(t.options_map&&t.dependencies?.length){const r=t.dependencies.find(e=>"options"===e.type);if(r){const i=e[r.key];i&&t.options_map[i]&&(n=t.options_map[i])}}return(0,i.applyFilters)("dokan_product_editor_select_options",n,t,e)},[t,e]),o=no(a),s=e[t.id],l=o.some(e=>e.children&&e.children.length>0),c=t.multiple||Array.isArray(s),d=t.placeholder,h=()=>null==s?c?[]:null:Array.isArray(s)?s.length>0&&"object"==typeof s[0]&&"value"in s[0]?s:s.map(e=>{const t=o.find(t=>t.value===e);if(t)return t;const n="string"==typeof e?e:String(e);return{value:e,label:n}}):o.find(e=>e.value===s)||null,f=l?{Option:to}:void 0,p=e=>{if(c){const r=Array.isArray(e)?e.map(e=>e.value):[];n({[t.id]:r})}else{const r=e?e.value:"";n({[t.id]:r})}},m=t.creatable&&c,g=Boolean(t.creatable);return(0,Ht.jsx)(Hn,{field:t,error:$n(r),children:m?(0,Ht.jsx)("div",{onKeyDown:e=>{"Enter"!==e.key||g||e.preventDefault()},children:(0,Ht.jsx)(Yt.TaggableSelect,{isMulti:!0,options:o,placeholder:d,value:h(),isValidNewOption:(n,r,a)=>{const o=n.trim(),s=e=>String(e?.label).trim().toLowerCase()===o.toLowerCase(),l=g&&!!o&&!r.some(s)&&!a.some(s);return(0,i.applyFilters)("dokan_product_editor_is_valid_new_option",l,n,t,e)},onChange:p})}):(0,Ht.jsx)(qn.Select,{options:o,isMulti:c,placeholder:d,value:h(),components:f,onChange:p})})},io=(e,t="simple")=>{var n;return null!==(n=e.labels?.[t])&&void 0!==n?n:e.label},ao=(e,t="simple")=>{var n,r;return null===(n=null!==(r=e.visibilities?.[t])&&void 0!==r?r:e.visibility)||void 0===n||n},oo=(e,t="simple")=>{var n,r;return null!==(n=null!==(r=e.requireds?.[t])&&void 0!==r?r:e.required)&&void 0!==n&&n},so=(e,t)=>{const n=((e,t)=>{var n;return null!==(n=e.find(e=>e.id===t))&&void 0!==n?n:null})(e,t);return n?{label:n.label,description:n.description}:{}};function lo(e){return null==e||("string"==typeof e?""===e.trim():!!Array.isArray(e)&&0===e.length)}function co(e){return"on"===e||"yes"===e||!0===e||1===e||"off"!==e&&"no"!==e&&!1!==e&&e}const uo=(e,t)=>!e.dependencies?.length||e.dependencies.filter(e=>"options"!==e.type).every(e=>function(e,t){if(!e.key)return!0;const{key:n,comparison:r,value:i}=e,a=t[n];switch(r){case"empty":return lo(a);case"not_empty":return!lo(a);case"==":case"equal":return co(a)==co(i);case"===":return co(a)===co(i);case"!=":case"not_equal":return co(a)!=co(i);case"!==":return co(a)!==co(i);case"contains":return!("string"!=typeof a&&!Array.isArray(a))&&a.includes(i);default:return!0}}(e,t)),ho=(e,t=[],n)=>{const r=n?.type||"simple";return e.map(e=>{if("string"==typeof e){const a=(i=e,t.find(e=>"field"===e.type&&e.id===i));return a&&ao(a,r)&&uo(a,n)?e:null}var i;const a={...e};return"card"===a.layout?.type&&a.description&&(a.label=(0,Ht.jsxs)("div",{className:"dokan-form-card-header-content",children:[(0,Ht.jsx)("div",{className:"dokan-form-card-title",children:a.label}),(0,Ht.jsx)("div",{className:"dokan-form-card-description",dangerouslySetInnerHTML:{__html:(0,Xa.sanitizeHTML)(a.description)}})]}),delete a.description),a.children&&(a.children=ho(a.children,t,n)),a.layout&&!a.children?.length?null:a}).filter(Boolean)},fo=(e,t,n)=>e.map(e=>"string"!=typeof e&&e.id===n?{...e,children:[...e.children||[],...t]}:"string"!=typeof e&&e.children?{...e,children:fo(e.children,t,n)}:e),po=(e,t=new Set)=>(e.forEach(e=>{"string"!=typeof e?e.children&&po(e.children,t):t.add(e)}),t),mo=(e,t=null)=>e.filter(e=>e.parent_id===t).map(t=>{var n;const r=mo(e,t.id),i=[...null!==(n=t.children)&&void 0!==n?n:[]],a=[];r.forEach(t=>{const n=e.find(e=>e.id===t.id);if(n?.after){const e=i.findIndex(e=>e===n.after);-1!==e?i.splice(e+1,0,t):a.push(t)}else a.push(t)}),i.push(...a);const o={id:t.id};return t.layout&&(o.layout=t.layout),t.label&&(o.label=t.label),t.description&&(o.description=t.description),i.length>0&&(o.children=i),o}),go=(e,t)=>e.map(e=>{if("string"==typeof e)return e;const n={...e};return n.id&&t[n.id]&&(n.children=[...n.children||[],...t[n.id]],delete t[n.id]),n.children&&(n.children=go(n.children,t)),n});function vo(e,t){if("string"==typeof e)return e;const n={...e};if(n.layout?.withHeader&&!n.label){const e=so(t,n.id);e.label&&(n.label=e.label),e.description&&(n.description=e.description)}return n.children&&(n.children=n.children.map(e=>vo(e,t))),n}const yo=e=>null==e||("string"==typeof e?0===e.trim().length:!!Array.isArray(e)&&0===e.length),bo=(e,t)=>!e||0===e.length||uo({dependencies:e},t),xo=(e,t,n)=>{const{rules:r,message:i,params:a}=e;switch(r){case"required":case"not_empty":return yo(t)?i:null;case"empty":return yo(t)?null:i;case"greater_than":case">":{if(yo(t))return null;const e=parseFloat(t);if(isNaN(e))return null;if(a.field){const t=parseFloat(n[a.field]);return!isNaN(t)&&e<=t?i:null}return void 0!==a.value?e>Number(a.value)?null:i:null}case">=":case"greater_than_or_equal":{if(yo(t))return null;const e=parseFloat(t);if(isNaN(e))return null;if(a.field){const t=parseFloat(n[a.field]);return!isNaN(t)&&e<t?i:null}return void 0!==a.value?e>=Number(a.value)?null:i:null}case"less_than":case"<":{if(yo(t))return null;const e=parseFloat(t);if(isNaN(e))return null;if(a.field){const t=parseFloat(n[a.field]);return!isNaN(t)&&e>=t?i:null}return void 0!==a.value?e<Number(a.value)?null:i:null}case"<=":case"less_than_or_equal":{if(yo(t))return null;const e=parseFloat(t);if(isNaN(e))return null;if(a.field){const t=parseFloat(n[a.field]);return!isNaN(t)&&e>t?i:null}return void 0!==a.value?e<=Number(a.value)?null:i:null}default:return null}},wo=t=>{const n={...t,readOnly:t.disabled||!1,label:(0,Ht.jsxs)("div",{className:"flex gap-1 items-center",children:[(0,Ht.jsx)(e.RawHTML,{className:"dokan-form-field-label",children:(0,dn.decodeEntities)(t.label)}),t.tooltip&&(0,Ht.jsx)(qn.DokanTooltip,{content:t.tooltip,children:(0,Ht.jsx)(zn,{size:16})})]}),type:t.variant,placeholder:t.placeholder,elements:(e=>{const{options:t}=e||{};if(!t)return[];const n=e=>({...e,label:(0,dn.decodeEntities)(e.label),...Array.isArray(e.children)?{children:e.children.map(n)}:{}});return Array.isArray(t)?t.map(n):Object.entries(t).map(([e,t])=>({label:(0,dn.decodeEntities)(t),value:e}))})(t),isValid:{required:t.required||!1,elements:!1,custom:e=>{const n=!1!==t.visibility&&uo(t,e);if(t.required&&n&&yo(e?.[t.id]))return(0,a.__)("Please fill out this field.","dokan-lite");if(!n)return null;const r=((e,t)=>{if(!e.validations||0===e.validations.length)return null;const n=t?.[e.id];for(const r of e.validations){if(!bo(r.dependencies,t))continue;const e=xo(r,n,t);if(e)return e}return null})(t,e);return r||null}},isVisible:e=>!1!==t.visibility&&uo(t,e)},r=qo(t);if(Object.assign(n,r),t.prefix&&!r.Edit){const e=t.prefix,r=()=>(0,Ht.jsx)(l.__experimentalInputControlPrefixWrapper,{children:(0,Ht.jsx)("span",{title:e,className:"text-gray-500 whitespace-nowrap",children:e})});n.Edit={control:"text",prefix:r}}t.description&&(n.description=(0,Ht.jsx)("span",{dangerouslySetInnerHTML:{__html:t.description}}));const i={...t,rawLabel:t.label,multiple:r.multiple||!1},o=n.Edit;return"function"==typeof o?{...n,Edit:e=>(0,Ht.jsx)(o,{...e,field:{...i,...e.field}})}:n},_o=()=>({Edit:eo,type:"text"}),ko=()=>({Edit:Ja,type:"text"}),No=()=>({type:"boolean",Edit:"checkbox",render:()=>null}),Eo=()=>({Edit:"radio"}),So=()=>({type:"integer"}),jo=()=>({type:"datetime",Edit:za}),Co=e=>{const t={Edit:ro,multiple:!1};return Array.isArray(e?.value)&&(t.multiple=!0),t},Ao=e=>{const t={Edit:Pa,multiple:!1};return"boolean"==typeof e?.multiple?t.multiple=e.multiple:Array.isArray(e?.value)&&(t.multiple=!0),t},To=()=>({Edit:ro,multiple:!0}),Lo=()=>({Edit:Wa}),Oo=()=>({Edit:Ka}),Ro=()=>({Edit:Ua}),Do=()=>({Edit:Ya}),Mo=e=>{const t={};return e?.id.includes("price")&&(t.Edit=Qa),t},qo=e=>{var t;let n={textarea:_o,editor:ko,checkbox:No,radio:Eo,number:So,datetime:jo,select:Co,async_select:Ao,multiselect:To,image:Lo,gallery:Do,attribute:Ro,file:Oo};return n=(0,i.applyFilters)("dokan_product_editor_ui_variant",n,e),(n[null!==(t=e.variant)&&void 0!==t?t:""]||Mo)(e)};function Po(t,n=!1){const r=(0,Yt.useToast)(),{product:o,formItems:s,isLoading:l}=(0,Bn.useSelect)(e=>({product:e(Un()).getProduct(t),formItems:e(Un()).getFormItems(t),isLoading:e(Un()).isSubmitting(t)}),[t]),{updateProduct:c,saveProduct:d}=(0,Bn.useDispatch)(Un()),u=o?.type||"simple",h=(0,e.useMemo)(()=>s?s.filter(e=>"field"===e.type).map(e=>{const t={...e,label:io(e,u),visibility:ao(e,u),required:oo(e,u)};return wo(t)}):[],[s,u]),f=(0,e.useCallback)(e=>{c(t,e),(0,i.doAction)("dokan_product_editor_field_changed",{productId:t,newData:e})},[t,c]),p=(0,e.useMemo)(()=>o?.attributes||[],[o?.attributes]),m=(0,e.useMemo)(()=>p.filter(e=>e.variation),[p]);(0,e.useEffect)(()=>{if(void 0!==o?.default_attributes)return;if(!m.length)return;const e=m.filter(e=>e.default).map(e=>({id:e.id,name:e.name,option:e.default}));f({default_attributes:e})},[o?.default_attributes,m,f]);const g=(0,e.useMemo)(()=>o?.default_attributes||[],[o?.default_attributes]),v=(0,e.useCallback)(e=>{const t=g.find(t=>t.name===e.name);return t&&t.option?{label:t.option,value:t.option}:null},[g]),y=(0,e.useCallback)((e,t)=>{const n=t?"string"==typeof t?t:t.label||t.value||"":"";let r;if(n){const t=g.findIndex(t=>t.name===e.name);t>=0?(r=[...g],r[t]={id:e.id,name:e.name,option:n}):r=[...g,{id:e.id,name:e.name,option:n}]}else r=g.filter(t=>t.name!==e.name);f({default_attributes:r})},[g,f]),b=(0,e.useCallback)(async e=>{e?.preventDefault&&(e.preventDefault(),e.stopPropagation());try{await d(t),(0,i.doAction)("dokan_product_editor_after_save",t),r({type:"success",title:(0,a.__)("Product saved successfully.","dokan-lite")}),n&&(window.location.href=window.dokanProductEditor.products_url)}catch(e){throw r({type:"error",title:e.message||(0,a.__)("Error saving product.","dokan-lite")}),e}},[t,d,r,n]);return{product:o||{},fields:h,formItems:s||[],onChange:f,submitHandler:b,isLoading:l,defaultAttributes:g,getDefaultValue:v,handleDefaultChange:y}}function Io(t,n,r){const{initForm:i}=(0,Bn.useDispatch)(Un());(0,e.useEffect)(()=>{n.length>0&&i(t,n,r)},[t,n,r,i])}var Bo=n(5654);function Fo(t,n,r=[]){const{width:i}=(0,Bo.useWindowDimensions)(),a=(0,e.useMemo)(()=>i?r.map(e=>{if(!e.responsive?.length)return e;const t=function(e,t){if(e.responsive?.length&&t){const n=[...e.responsive].sort((e,t)=>e.maxWidth-t.maxWidth);for(const e of n)if(t<=e.maxWidth)return e.layout}return e.layout}(e,i);return{...e,layout:t}}):r,[r,i]),o=(0,e.useMemo)(()=>{const e=mo(a,null).map(e=>vo(e,t)),n=po(e),r=((e,t)=>{const n={};return e.forEach(e=>{var r;if("field"!==e.type)return;if(t.has(e.id))return;const i=null!==(r=e.section_id)&&void 0!==r?r:"";i&&(n[i]||(n[i]=[]),n[i].push(e.id))}),n})(t,n);let i=go(e,r);const o=Object.keys(r).map(e=>{const n=so(t,e);return{id:e,layout:{type:"card",withHeader:!0},children:r[e],...n}});return o.length>0&&(i=fo(i,o,"primary_column")),i},[a,t]);return{formLayouts:(0,e.useMemo)(()=>({fields:ho(o,t,n)}),[o,t,n]),width:i}}var Uo=n(3078);const zo=async(e,t={})=>(await an()({path:"/dokan/v1/ai/generate",method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},data:{prompt:e,payload:t}})).response,$o=(e,t)=>{try{let n=!1;const r=t=>(t.value=e,t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})),!0),i=t=>{if(window.tinymce){const n=window.tinymce.get(t);if(n){n.setContent(e),n.fire("change"),n.fire("input");const i=document.getElementById(t);return i&&r(i),!0}}return!1},a=(e=>{const t=[`input[name="${e}"]`,`#${e}`,`textarea[name="${e}"]`,`[data-id="${e}"]`];for(const e of t){const t=document.querySelector(e);if(t)return t}return null})(t);return a&&(null!==a.closest(".wp-editor-wrap")?(n=i(t),!n&&a instanceof HTMLTextAreaElement&&(n=r(a))):(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement)&&(n=r(a))),n}catch(e){return!1}},Ho=({prev:e,next:t,history:n,loading:r})=>!n||r?null:(0,Ht.jsxs)("div",{className:"flex gap-1 items-center",children:[(0,Ht.jsx)("svg",{onClick:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-4 cursor-pointer",children:(0,Ht.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})}),(0,Ht.jsx)("span",{className:"text-sm",children:n}),(0,Ht.jsx)("svg",{onClick:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-4 cursor-pointer",children:(0,Ht.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})]}),Vo=({type:e="textarea",loading:t,element:n})=>t?"text"===e?(0,Ht.jsxs)("div",{className:"flex flex-col gap-2 animate-pulse",children:[(0,Ht.jsx)("div",{className:"h-4 w-1/2 bg-gray-200 rounded"}),(0,Ht.jsx)("div",{className:"h-4 w-full bg-gray-200 rounded"})]}):(0,Ht.jsxs)("div",{className:"flex flex-col gap-2 animate-pulse mb-3",children:[(0,Ht.jsx)("div",{className:"h-4 w-1/2 bg-gray-200 rounded"}),(0,Ht.jsx)("div",{className:"h-4 w-full bg-gray-200 rounded"}),(0,Ht.jsx)("div",{className:"h-4 w-3/4 bg-gray-200 rounded"}),(0,Ht.jsx)("div",{className:"h-4 w-full bg-gray-200 rounded"})]}):n,Wo={post_title:0,post_excerpt:0,post_content:0},Go={post_title:[],post_excerpt:[],post_content:[]},Zo=({className:t,value:n,onChange:r})=>{const[i,o]=(0,e.useState)(!1),[s,l]=(0,e.useState)({post_title:!1,post_excerpt:!1,post_content:!1}),[d,u]=(0,e.useState)(!1),[h,f]=(0,e.useState)(""),[p,m]=(0,e.useState)(""),[g,v]=(0,e.useState)(!1),[y,b]=(0,e.useState)(Go),[x,w]=(0,e.useState)(!1),[_,k]=(0,e.useState)(Wo),[N,E]=(0,e.useState)(!1),S=()=>{k(Wo)},j=(e,t)=>{const n=document.getElementById(e),r=n.contentDocument||n.contentWindow?.document;return r?.querySelector(`[data-id="${t}"]`)||document.querySelector(`#${t}`)},C=()=>{f(""),m(""),v(!1),b(Go),S()},A=()=>{o(!1),C()},T=async()=>{if(m(""),h.trim()){E(!0);try{const e=await zo(h,{json_format:"true"});e?b({post_title:[e.title],post_excerpt:[e.short_description],post_content:[e.long_description]}):m((0,a.__)("No content generated, please try again.","dokan-lite")),S()}catch(e){m(e.message)}finally{E(!1)}}else m((0,a.__)("Please enter a prompt.","dokan"))},L=e=>s[e]||d,O=async e=>{m("");let t=y[e][_[e]];if(t?.trim()||(t={post_excerpt:"generate short description",post_content:"generate long description"}[e]||""),"post_title"!==e&&(t=`${t} \n\n product title is ${y.post_title[_.post_title]}`),t?.trim()){E(!0),l(t=>({...t,[e]:!0}));try{const n=await zo(t,{field:e});b(t=>({...t,[e]:[n,...t[e]]})),k(t=>({...t,[e]:0}))}catch(e){m(e.message)}finally{E(!1),l(t=>({...t,[e]:!1}))}}else m((0,a.__)("Please enter a prompt.","dokan-lite"))},R=(e,t)=>{b(n=>({...n,[t]:y[t].map((n,r)=>r===_[t]?e:n)}))},D=e=>{0!==_[e]&&k(t=>({...t,[e]:t[e]-1}))},M=e=>{_[e]<y[e].length-1&&k(t=>({...t,[e]:t[e]+1}))},q=e=>{const t=y[e].length;return 0===t?"":`${_[e]+1}/${t}`},P=e=>y[e][_[e]],I=(e=!1)=>{const t=y.post_title[_.post_title],n=y.post_excerpt[_.post_excerpt],i=y.post_content[_.post_content];return r?(r({name:t,short_description:n,description:i}),void A()):document.getElementById("post_title").value&&!e?(o(!1),void v(!0)):void(x?($o(t,"post_title"),$o(n,"post_excerpt"),$o(i,"post_content"),A()):m((0,a.__)("Invalid input data","dokan")))};return(0,e.useEffect)(()=>{const e=y.post_title.length>0||y.post_content.length>0||y.post_excerpt.length>0;w(e)},[y.post_title,y.post_content,y.post_excerpt]),(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)("button",{type:"button",className:(0,Cn.QP)("dokan-btn p-0 !min-h-[max-content]",t),onClick:e=>{if(e.preventDefault(),e.stopPropagation(),o(!0),n){b(n);const e=n.post_title.length>0||n.post_content.length>0||n.post_excerpt.length>0;return w(e),f(n.post_title?.[0]||""),void S()}const t=document.querySelector("#post_title"),r=j("post_excerpt_ifr","post_excerpt"),i=document.querySelector("#post_excerpt"),a=j("post_content_ifr","post_content"),s=document.querySelector("#post_content"),l={...Go};(i.value||s.value)&&(l.post_title=[t.value||""],f(t.value)),r?.innerHTML&&i.value&&(l.post_excerpt=[r.innerHTML]),a?.innerHTML&&s.value&&(l.post_content=[a.innerHTML]),b(l),S()},children:(0,Ht.jsx)(Uo.A,{content:(0,a.__)("AI Assistant","dokan-lite"),children:(0,Ht.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ht.jsx)("path",{d:"M18.0064 11.0266C18.2625 9.98897 19.7376 9.98897 19.9938 11.0266V11.0266C21.0872 15.4557 24.5455 18.9139 28.9747 20.0073V20.0073C30.0123 20.2634 30.0123 21.7386 28.9747 21.9947V21.9947C24.5455 23.0881 21.0872 26.5463 19.9938 30.9754V30.9754C19.7376 32.0131 18.2625 32.0131 18.0064 30.9754V30.9754C16.9129 26.5463 13.4546 23.0881 9.02549 21.9947V21.9947C7.98784 21.7386 7.98784 20.2634 9.02549 20.0073V20.0073C13.4546 18.9139 16.9129 15.4557 18.0064 11.0266V11.0266Z",fill:"white"}),(0,Ht.jsx)("path",{d:"M28.9309 6.62922C29.0345 6.20923 29.6316 6.20923 29.7353 6.62922V6.62922C30.1779 8.42196 31.5777 9.82171 33.3704 10.2643V10.2643C33.7904 10.3679 33.7904 10.965 33.3704 11.0687V11.0687C31.5777 11.5113 30.1779 12.911 29.7353 14.7037V14.7037C29.6316 15.1237 29.0345 15.1237 28.9309 14.7037V14.7037C28.4883 12.911 27.0885 11.5113 25.2957 11.0687V11.0687C24.8757 10.965 24.8757 10.3679 25.2957 10.2643V10.2643C27.0885 9.82171 28.4883 8.42196 28.9309 6.62922V6.62922Z",fill:"white"})]})})}),(0,Ht.jsx)(c.DokanModal,{namespace:"dokan-ai-new-prompt-modal",isOpen:i,onClose:A,onConfirm:()=>{},modalClassName:"max-w-2xl",isDismissible:!1,dialogHeader:(0,Ht.jsxs)("div",{className:"p-4 font-semibold border-b flex justify-between items-center",children:[(0,Ht.jsx)("div",{children:(0,a.__)("Craft your product information","dokan-lite")}),x&&(0,Ht.jsxs)(c.DokanButton,{variant:"secondary",onClick:C,disabled:N,className:"flex gap-2 items-center",children:[(0,Ht.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-4 w-4",children:(0,Ht.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),(0,a.__)("Start Over","dokan-lite")]})]}),dialogContent:(0,Ht.jsxs)(Ht.Fragment,{children:[p&&(0,Ht.jsx)(c.DokanAlert,{label:(0,a.__)("Error","dokan-lite"),variant:"danger",className:"mb-4 [&_*_p]:m-0",children:p}),x?(0,Ht.jsxs)("div",{children:[(0,Ht.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,Ht.jsx)("div",{className:"font-semibold text-gray-800",children:(0,a.__)("Title:","dokan-lite")}),(0,Ht.jsx)(Ho,{loading:L("post_title"),history:q("post_title"),prev:()=>D("post_title"),next:()=>M("post_title")})]}),(0,Ht.jsx)("div",{className:"mb-3",children:(0,Ht.jsx)(Vo,{type:"text",loading:L("post_title"),element:(0,Ht.jsx)(Yt.SimpleInput,{className:"focus:outline-none",onChange:e=>{R(e.target.value,"post_title")},value:P("post_title")})})}),(0,Ht.jsx)(c.DokanButton,{variant:"secondary",onClick:()=>O("post_title"),disabled:L("post_title"),children:(0,a.__)("Refine","dokan-lite")}),(0,Ht.jsxs)("div",{className:"my-4",children:[(0,Ht.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,Ht.jsx)("div",{className:"font-semibold text-gray-800",children:(0,a.__)("Short Description:","dokan-lite")}),(0,Ht.jsx)(Ho,{loading:L("post_excerpt"),history:q("post_excerpt"),prev:()=>D("post_excerpt"),next:()=>M("post_excerpt")})]}),(0,Ht.jsx)(Vo,{loading:L("post_excerpt"),element:(0,Ht.jsx)("div",{className:"mb-3 focus:outline-dokan-btn-border h-36 border rounded p-2.5 overflow-auto",contentEditable:!0,onBlur:e=>{R(e.target.innerHTML,"post_excerpt")},dangerouslySetInnerHTML:{__html:P("post_excerpt")}})}),(0,Ht.jsx)(c.DokanButton,{variant:"secondary",onClick:()=>O("post_excerpt"),disabled:L("post_excerpt"),children:(0,a.__)("Refine","dokan-lite")})]}),(0,Ht.jsxs)("div",{className:"mt-4",children:[(0,Ht.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,Ht.jsx)("div",{className:"font-semibold text-gray-800",children:(0,a.__)("Long Description:","dokan-lite")}),(0,Ht.jsx)(Ho,{loading:L("post_content"),history:q("post_content"),prev:()=>D("post_content"),next:()=>M("post_content")})]}),(0,Ht.jsx)(Vo,{loading:L("post_content"),element:(0,Ht.jsx)("div",{className:"mb-3 h-48 focus:outline-dokan-btn-border border rounded p-2.5 overflow-auto",contentEditable:!0,onBlur:e=>{R(e.target.innerHTML,"post_content")},dangerouslySetInnerHTML:{__html:P("post_content")}})}),(0,Ht.jsx)(c.DokanButton,{variant:"secondary",onClick:()=>O("post_content"),disabled:L("post_content"),children:(0,a.__)("Refine","dokan-lite")})]}),(0,Ht.jsxs)("p",{className:"text-sm mt-4 mb-3",children:[(0,a.__)("** If you think the outcome doesn’t match your choice then you can","dokan-lite"),(0,Ht.jsx)("span",{tabIndex:0,role:"button",onClick:async()=>{u(!0),await T(),u(!1)},className:"text-dokan-link mx-1 underline",children:(0,a.__)("regenerate all again.","dokan-lite")})]})]}):(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("p",{className:"text-sm mb-3",children:(0,a.__)("You can generate your product title, short description, long description all at once with this prompt. Type your prompt below","dokan-lite")}),(0,Ht.jsx)(Yt.TextArea,{disabled:N,className:"min-h-48",onChange:e=>f(e.target.value),input:{id:"dokan-ai-prompt",value:h,placeholder:(0,a.__)("Enter prompt","dokan-lite")}})]})]}),dialogFooter:(0,Ht.jsxs)("div",{className:"p-4 border-t flex gap-4 justify-end",children:[(0,Ht.jsx)(c.DokanButton,{variant:"secondary",disabled:N,onClick:A,children:(0,a.__)("Cancel","dokan-lite")}),x?(0,Ht.jsx)(c.DokanButton,{disabled:N,onClick:()=>I(),children:(0,a.__)("Insert","dokan-lite")}):(0,Ht.jsx)(c.DokanButton,{disabled:N||!h,onClick:T,children:N?(0,a.__)("Generating…","dokan-lite"):(0,a.__)("Generate","dokan-lite")})]})}),(0,Ht.jsx)(c.DokanModal,{namespace:"dokan-ai-new-prompt-modal",isOpen:g,onClose:()=>v(!1),onConfirm:()=>{},modalClassName:"max-w-md",isDismissible:!1,dialogHeader:!1,dialogContent:(0,Ht.jsxs)("div",{className:"text-center p-5",children:[(0,Ht.jsx)("div",{className:"text-xl font-semibold mb-4",children:(0,a.__)("Insert Generated Information?","dokan-lite")}),(0,Ht.jsx)("p",{children:(0,a.__)("Are you sure you want to insert the generated information? If you insert then your current product information will be updated with the generated content.","dokan-lite")}),(0,Ht.jsxs)("div",{className:"mt-4 flex gap-4 justify-center",children:[(0,Ht.jsx)(c.DokanButton,{variant:"secondary",onClick:()=>v(!1),children:(0,a.__)("Cancel","dokan-lite")}),(0,Ht.jsx)(c.DokanButton,{onClick:()=>I(!0),children:(0,a.__)("Yes, Insert","dokan-lite")})]})]}),dialogFooter:!1})]})},Ko=()=>(0,Ht.jsx)("div",{className:"dokan-product-product-editor dokan-layout animate-pulse",children:(0,Ht.jsxs)("div",{className:"flex flex-col md:flex-row gap-6",children:[(0,Ht.jsxs)("div",{className:"flex-1 bg-white p-6 rounded-lg shadow-sm border border-gray-100",children:[(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/4 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/6 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/4 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/4 mb-4"}),(0,Ht.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Ht.jsx)("div",{className:"w-5 h-5 bg-gray-100 rounded"}),(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-32"})]}),(0,Ht.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ht.jsx)("div",{className:"w-5 h-5 bg-gray-100 rounded"}),(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-24"})]})]}),(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/4 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/6 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/5 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]})]}),(0,Ht.jsxs)("div",{className:"w-75 flex flex-col gap-6",children:[(0,Ht.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-sm border border-gray-100",children:[(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-4"}),(0,Ht.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Ht.jsx)("div",{className:"w-4 h-4 bg-gray-100 rounded-full"}),(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-16"})]}),(0,Ht.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ht.jsx)("div",{className:"w-4 h-4 bg-gray-100 rounded-full"}),(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-12"})]})]}),(0,Ht.jsxs)("div",{className:"mb-2",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]})]}),(0,Ht.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-sm border border-gray-100",children:[(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full aspect-video"})]}),(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-20 h-20"})]})]}),(0,Ht.jsxs)("div",{className:"bg-white p-6 rounded-lg shadow-sm border border-gray-100",children:[(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-4"}),(0,Ht.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Ht.jsx)("div",{className:"w-4 h-4 bg-gray-100 rounded-full"}),(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-16"})]}),(0,Ht.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ht.jsx)("div",{className:"w-4 h-4 bg-gray-100 rounded-full"}),(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-12"})]})]}),(0,Ht.jsxs)("div",{className:"mb-2",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]})]})]})]})}),Yo=({params:t})=>{const[n,r]=(0,e.useState)(null),i=Number(n?.product_id),o=n?.is_new_product||!1,[s,c]=(0,e.useState)(null),[d,u]=(0,e.useState)(!0),{product:h,fields:f,onChange:p,formItems:m,isLoading:g,submitHandler:v}=Po(i,o),{formLayouts:y}=Fo(m,h,n?.form_layouts),{validity:b,isValid:x}=(0,Pn.useFormValidity)(h,f,y);Io(i,n?.form_items||[],n?.vendor_earning||0);const w=(0,e.useMemo)(()=>({post_title:[h.name],post_content:[h.description],post_excerpt:[h.short_description]}),[h.name,h.description,h.short_description]),_=n?.view_product_url,k=(0,e.useCallback)(async()=>{var e,n;const i=Number(t.productId),o=null!==(e=new URLSearchParams(null!==(n=window.location.hash.split("?")[1])&&void 0!==n?n:"").get("type"))&&void 0!==e?e:"";u(!0);try{const e=await an()({path:`/dokan/v3/products/init/fields?id=${i||""}${o?`&type=${encodeURIComponent(o)}`:""}`});r(e),window.dokanProductEditor=e}catch(e){c(e?.message||(0,a.__)("An unknown error occurred","dokan-lite")),r(null)}finally{u(!1)}},[t.productId]),N=(0,e.useCallback)(()=>s||d?null:(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)(l.Fill,{name:"dokan-header-after-title",children:(0,Ht.jsx)("div",{className:"flex items-center gap-2 ml-2",children:!o&&_&&(0,Ht.jsx)("span",{className:"flex gap-3",children:(0,Ht.jsx)(qn.DokanTooltip,{content:(0,a.__)("Visit Product","dokan-lite"),children:(0,Ht.jsx)("a",{href:_,target:"_blank",className:"font-normal self-center active-title text-xl",rel:"noreferrer",children:(0,Ht.jsx)(In,{className:"dokan-link stroke-[2.5]",size:16})})})})})}),(0,Ht.jsxs)(l.Fill,{name:"dokan-header-actions",children:[(0,Ht.jsx)(qn.DokanButton,{type:"button",variant:"primary",loading:g,disabled:!x||g,onClick:v,label:o?(0,a.__)("Save Changes","dokan-lite"):(0,a.__)("Update Product","dokan-lite")}),n?.ai_settings.ai_text_enable&&(0,Ht.jsx)(Zo,{className:"px-2",value:w,onChange:e=>{p({name:e.name,short_description:e.short_description,description:e.description})}})]})]}),[n?.ai_settings.ai_text_enable,g,o,x,p,d,s,_,v,w]);return(0,e.useEffect)(()=>((0,Kt.registerPlugin)("dokan-product-editor-create",{render:N,scope:"dokan-product-editor-create"}),(0,Kt.registerPlugin)("dokan-product-editor-edit",{render:N,scope:"dokan-product-editor-edit"}),()=>{(0,Kt.unregisterPlugin)("dokan-product-editor-create"),(0,Kt.unregisterPlugin)("dokan-product-editor-edit")}),[N]),(0,e.useEffect)(()=>{k()},[k]),d?(0,Ht.jsx)(Ko,{}):s?(0,Ht.jsx)(qn.InternalError,{title:(0,a.__)("Failed to load product data","dokan-lite"),message:s,onRefresh:k}):(0,Ht.jsxs)("div",{className:"dokan-product-product-editor dokan-layout",children:[(0,Ht.jsxs)("form",{onSubmit:v,children:[(0,Ht.jsx)(Pn.DataForm,{data:h,fields:f,form:y,onChange:p,validity:b}),(0,Ht.jsx)("button",{type:"submit",className:"hidden",children:(0,a.__)("Submit","dokan-lite")})]}),(0,Ht.jsx)(Yt.DokanToaster,{})]})},Xo=(0,o.A)("boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]),Qo=(0,o.A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),Jo=(0,o.A)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),es=e=>{switch(e){case"publish":return"success";case"draft":return"secondary";case"pending":return"warning";default:return"info"}},ts=e=>{switch(e){case"publish":return(0,a.__)("Published","dokan-lite");case"draft":return(0,a.__)("Draft","dokan-lite");case"pending":return(0,a.__)("Pending Review","dokan-lite");case"future":return(0,a.__)("Scheduled","dokan-lite");default:return e}},ns=({product:e,onClose:t})=>{var n,r;return e?(0,Ht.jsx)(c.DokanModal,{isOpen:!0,namespace:"product-quick-view",className:"!w-[350px] sm:!w-[500px]",onClose:t,onConfirm:t,confirmButtonText:(0,a.__)("Close","dokan-lite"),confirmButtonVariant:"primary",hideCancelButton:!0,dialogHeader:(0,Ht.jsxs)("div",{className:"px-6 py-4 border-b border-gray-200 flex items-center gap-4",children:[(0,Ht.jsx)("div",{className:"w-14 h-14 rounded-lg overflow-hidden bg-gray-100 shrink-0",children:e.images?.[0]?.src?(0,Ht.jsx)("img",{src:e.images[0].src,alt:e.images[0].alt||e.name,className:"w-full h-full object-cover"}):(0,Ht.jsx)("div",{className:"w-full h-full bg-gray-100"})}),(0,Ht.jsxs)("div",{className:"flex-1 min-w-0 pr-6",children:[(0,Ht.jsx)("h2",{className:"text-lg font-semibold text-dokan-link truncate",children:e.name}),(0,Ht.jsxs)("p",{className:"text-sm text-gray-500",children:[(0,a.__)("SKU:","dokan-lite")," ",e.sku||(0,a.__)("N/A","dokan-lite")]})]})]}),dialogContent:(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("p",{className:"font-semibold text-gray-900 mb-3",children:(0,a.__)("Product info:","dokan-lite")}),(0,Ht.jsx)("table",{className:"w-full text-sm",children:(0,Ht.jsxs)("tbody",{className:"divide-y divide-gray-100",children:[(0,Ht.jsxs)("tr",{children:[(0,Ht.jsx)("td",{className:"py-2 text-gray-500",children:(0,a.__)("Type","dokan-lite")}),(0,Ht.jsx)("td",{className:"py-2 text-right text-gray-900",children:(r=e,"grouped"===r.type?(0,a.__)("Grouped","dokan-lite"):"external"===r.type?(0,a.__)("External/Affiliate","dokan-lite"):"variable"===r.type?(0,a.__)("Variable","dokan-lite"):(0,a.__)("Simple","dokan-lite"))})]}),(0,Ht.jsxs)("tr",{children:[(0,Ht.jsx)("td",{className:"py-2 text-gray-500",children:(0,a.__)("Stock","dokan-lite")}),(0,Ht.jsx)("td",{className:"py-2 text-right text-gray-900",children:e.manage_stock&&null!==e.stock_quantity?e.stock_quantity:e.in_stock?(0,a.__)("In stock","dokan-lite"):(0,a.__)("Out of stock","dokan-lite")})]}),(0,Ht.jsxs)("tr",{children:[(0,Ht.jsx)("td",{className:"py-2 text-gray-500",children:(0,a.__)("Status","dokan-lite")}),(0,Ht.jsx)("td",{className:"py-2 text-right",children:(0,Ht.jsx)(c.DokanBadge,{variant:es(e.status),label:ts(e.status)})})]}),(0,Ht.jsxs)("tr",{children:[(0,Ht.jsx)("td",{className:"py-2 text-gray-500",children:(0,a.__)("Price","dokan-lite")}),(0,Ht.jsx)("td",{className:"py-2 text-right text-gray-900",children:e.price?(0,Ht.jsx)(cn.A,{price:e.price}):"—"})]}),(0,Ht.jsxs)("tr",{children:[(0,Ht.jsx)("td",{className:"py-2 text-gray-500",children:(0,a.__)("Earning","dokan-lite")}),(0,Ht.jsx)("td",{className:"py-2 text-right text-gray-900",children:null!==e.earning&&void 0!==e.earning?(0,Ht.jsx)(cn.A,{price:String(e.earning)}):"—"})]}),(0,Ht.jsxs)("tr",{children:[(0,Ht.jsx)("td",{className:"py-2 text-gray-500",children:(0,a.__)("Date created","dokan-lite")}),(0,Ht.jsx)("td",{className:"py-2 text-right text-gray-900",children:(0,Ht.jsx)(vn.A.Date,{date:e.date_created})})]}),(0,Ht.jsxs)("tr",{children:[(0,Ht.jsx)("td",{className:"py-2 text-gray-500",children:(0,a.__)("Last Modified","dokan-lite")}),(0,Ht.jsx)("td",{className:"py-2 text-right text-gray-900",children:(0,Ht.jsx)(vn.A.Date,{date:e.date_modified})})]}),(0,Ht.jsxs)("tr",{children:[(0,Ht.jsx)("td",{className:"py-2 text-gray-500",children:(0,a.__)("Views","dokan-lite")}),(0,Ht.jsx)("td",{className:"py-2 text-right text-gray-900",children:null!==(n=e.page_view)&&void 0!==n?n:0})]})]})})]})}):null},rs=[{id:"root-layout",layout:{type:"row",alignment:"start",styles:{image_gallery:{flex:"0 0 200px"}}},children:[{id:"image_gallery",layout:{type:"column",alignment:"start"},children:["image_id","gallery_image_ids"]},{id:"other-fields",layout:{type:"column",alignment:"start"},children:["name","regular_price","sale_price","create_schedule_for_discount","date_on_sale_from","date_on_sale_to"]}]},"category_ids","short_description"],is=()=>(0,Ht.jsxs)("div",{role:"status",className:"animate-pulse",children:[(0,Ht.jsx)("span",{className:"sr-only",children:(0,a.__)("Loading…","dokan-lite")}),(0,Ht.jsxs)("div",{className:"flex gap-6 mb-6","aria-hidden":"true",children:[(0,Ht.jsxs)("div",{className:"w-50 shrink-0",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/2 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full aspect-square mb-3"}),(0,Ht.jsxs)("div",{className:"flex gap-2",children:[(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-12 h-12"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-12 h-12"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-12 h-12"})]})]}),(0,Ht.jsxs)("div",{className:"flex-1",children:[(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/4 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/5 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{className:"mb-6",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/5 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ht.jsx)("div",{className:"w-5 h-5 bg-gray-100 rounded"}),(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-40"})]})]})]}),(0,Ht.jsxs)("div",{className:"mb-6","aria-hidden":"true",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/6 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-10"})]}),(0,Ht.jsxs)("div",{"aria-hidden":"true",children:[(0,Ht.jsx)("div",{className:"h-4 bg-gray-200 rounded w-1/4 mb-3"}),(0,Ht.jsx)("div",{className:"bg-gray-100 rounded w-full h-24"})]})]}),as=({isOpen:t,onClose:n,onCreated:r})=>{const o=(0,Yt.useToast)(),[s,l]=(0,e.useState)([]),[c,d]=(0,e.useState)(0),[u,h]=(0,e.useState)(!1),[f,p]=(0,e.useState)(null),m=(0,e.useCallback)(async()=>{h(!0),p(null);try{const e=await an()({path:"/dokan/v3/products/init/fields?id="});l(e.form_items||[]),d(e.vendor_earning||0)}catch(e){p(e?.message||(0,a.__)("Failed to load the product form.","dokan-lite"))}finally{h(!1)}},[]);(0,e.useEffect)(()=>{!t||s.length||u||f||m()},[t,s.length,u,f,m]),Io(0,s,c);const{product:g,fields:v,isLoading:y}=Po(0,!0),{updateProduct:b,saveProduct:x}=(0,Bn.useDispatch)(Un()),w=(0,e.useMemo)(()=>({fields:rs}),[]),{validity:_,isValid:k}=(0,Pn.useFormValidity)(g,v,w),N=(0,e.useCallback)(e=>{b(0,e),(0,i.doAction)("dokan_product_editor_field_changed",{productId:0,newData:e})},[b]),E=(0,e.useCallback)(async()=>{b(0,{type:"simple",status:"draft"});try{await x(0),(0,i.doAction)("dokan_product_editor_after_save",0)}catch(e){throw o({type:"error",title:e?.message||(0,a.__)("Failed to create product.","dokan-lite")}),e}o({type:"success",title:(0,a.__)("Draft product created.","dokan-lite")}),r?.()},[b,x,o,r]),S=(0,e.useMemo)(()=>u?(0,Ht.jsx)(is,{}):f?(0,Ht.jsx)("p",{className:"text-sm text-red-600",children:f}):v.length?(0,Ht.jsx)("div",{className:"dokan-product-product-editor dokan-layout quick-create-product-editor",children:(0,Ht.jsx)("form",{onSubmit:e=>e.preventDefault(),children:(0,Ht.jsx)(Pn.DataForm,{data:g,fields:v,form:w,onChange:N,validity:_})})}):(0,Ht.jsx)(Ht.Fragment,{}),[u,f,v,g,w,N,_]);return(0,Ht.jsx)(qn.DokanModal,{isOpen:t,onClose:n,namespace:"quick-create-product",className:"min-w-160 min-h-60",dialogTitle:(0,a.__)("Add New Product","dokan-lite"),dialogContent:S,onConfirm:E,confirmButtonText:(0,a.__)("Create & Continue","dokan-lite"),confirmButtonDisabled:!k||u||!!f||!v.length,loading:y})},os=e=>{let t;switch(e){case"publish":t="success";break;case"draft":t="secondary";break;case"pending":t="warning";break;default:t="info"}return(0,i.applyFilters)("dokan_product_status_badge_variant",t,e)},ss=e=>{let t;switch(e){case"publish":t=(0,a.__)("Published","dokan-lite");break;case"draft":t=(0,a.__)("Draft","dokan-lite");break;case"pending":t=(0,a.__)("Pending Review","dokan-lite");break;case"future":t=(0,a.__)("Scheduled","dokan-lite");break;default:t=e}return(0,i.applyFilters)("dokan_product_status_label",t,e)},ls=e=>"grouped"===e.type?(0,a.__)("Grouped","dokan-lite"):"external"===e.type?(0,a.__)("External/Affiliate","dokan-lite"):"variable"===e.type?(0,a.__)("Variable","dokan-lite"):(0,a.__)("Simple","dokan-lite"),cs=({item:e})=>{const t="w-5 h-5 text-gray-500";return"variable"===e.type?(0,Ht.jsx)(Xo,{className:t}):"grouped"===e.type?(0,Ht.jsx)(Qo,{className:t}):"external"===e.type?(0,Ht.jsx)(In,{className:t}):(0,Ht.jsx)(Jo,{className:t})},ds=[{value:"simple",label:(0,a.__)("Simple","dokan-lite")},{value:"variable",label:(0,a.__)("Variable","dokan-lite")},{value:"grouped",label:(0,a.__)("Grouped","dokan-lite")},{value:"external",label:(0,a.__)("External/Affiliate","dokan-lite")}],us=function(){var t,n,r;const o=(0,Yt.useToast)(),s=dt(),[d,u]=(0,e.useState)([]),[h,f]=(0,e.useState)(null),[p,m]=(0,e.useState)(!1),[g,v]=(0,e.useState)({page:1,per_page:10,status:"all",search:"",category:"",type:"",year_month:""}),{data:y,isLoading:b,totalItems:x,totalPages:w,statusCounts:_,instockCount:k,outstockCount:N,monthOptions:E,subscriptionRemaining:S,fetchProducts:j,fetchStatusCounts:C,deleteProduct:A,deleteProducts:T,updateProductsStatus:L}=(t=>{const[n,r]=(0,e.useState)([]),[o,s]=(0,e.useState)(!0),[l,c]=(0,e.useState)(0),[d,u]=(0,e.useState)(0),[h,f]=(0,e.useState)(""),[p,m]=(0,e.useState)(0),[g,v]=(0,e.useState)(0),[y,b]=(0,e.useState)(null),[x,w]=(0,e.useState)([]),[_,k]=(0,e.useState)([{value:"all",label:(0,a.__)("All","dokan-lite"),count:0},{value:"publish",label:(0,a.__)("Published","dokan-lite"),count:0},{value:"draft",label:(0,a.__)("Draft","dokan-lite"),count:0},{value:"pending",label:(0,a.__)("Pending Review","dokan-lite"),count:0},{value:"future",label:(0,a.__)("Scheduled","dokan-lite"),count:0}]),N=(0,e.useCallback)(async()=>{s(!0);try{const e={per_page:t.per_page,page:t.page,include_hidden_products:!0,exclude_types:(0,i.applyFilters)("dokan_product_list_exclude_types",["booking"])};"all"!==t.status&&(e.status=t.status),t.search&&(e.search=t.search),t.category&&(e.category=t.category),t.type&&(e.type=t.type),t.year_month&&(e.year_month=t.year_month),void 0!==t.in_stock&&(e.in_stock=t.in_stock),t.product_brand&&(e.product_brand=t.product_brand),t.filter_by_other&&(e.filter_by_other=t.filter_by_other);const n=await an()({path:(0,ln.addQueryArgs)("/dokan/v1/products",e),parse:!1}),a=await n.json(),o=n.headers.get("X-WP-Total"),s=n.headers.get("X-WP-TotalPages");r(a),c(parseInt(null!=o?o:"0",10)),u(parseInt(null!=s?s:"0",10))}catch(e){console.error("Error fetching products:",e),r([])}finally{s(!1)}},[t.page,t.per_page,t.status,t.search,t.category,t.type,t.year_month,t.in_stock,t.product_brand,t.filter_by_other]),E=(0,e.useCallback)(async()=>{try{var e,t,n,r,o,s,l,c,d,u,h,p,g;const y={exclude_types:(0,i.applyFilters)("dokan_product_list_exclude_types",["booking"])},x=await an()({path:(0,ln.addQueryArgs)("/dokan/v1/products/summary",y)}),_=null!==(e=x.post_counts)&&void 0!==e?e:{},N=(null!==(t=_.publish)&&void 0!==t?t:0)+(null!==(n=_.draft)&&void 0!==n?n:0)+(null!==(r=_.pending)&&void 0!==r?r:0)+(null!==(o=_.future)&&void 0!==o?o:0),E=[{value:"all",label:(0,a.__)("All","dokan-lite"),count:N},{value:"publish",label:(0,a.__)("Published","dokan-lite"),count:null!==(s=_.publish)&&void 0!==s?s:0},{value:"draft",label:(0,a.__)("Draft","dokan-lite"),count:null!==(l=_.draft)&&void 0!==l?l:0},{value:"pending",label:(0,a.__)("Pending Review","dokan-lite"),count:null!==(c=_.pending)&&void 0!==c?c:0}],S=(0,i.applyFilters)("dokan_product_status_counts",E,_);k(S),f(null!==(d=x.products_url)&&void 0!==d?d:""),m(null!==(u=x.instock_count)&&void 0!==u?u:0),v(null!==(h=x.outofstock_count)&&void 0!==h?h:0),w(null!==(p=x.months)&&void 0!==p?p:[]),b(null!==(g=x.subscription_remaining)&&void 0!==g?g:null)}catch(e){console.error("Error fetching product summary:",e)}},[]),S=(0,e.useCallback)(async e=>{await an()({path:`/dokan/v1/products/${e}`,method:"DELETE",data:{force:!0}})},[]),j=(0,e.useCallback)(async e=>{await Promise.all(e.map(e=>an()({path:`/dokan/v1/products/${e}`,method:"DELETE",data:{force:!0}})))},[]),C=(0,e.useCallback)(async(e,t)=>{await an()({path:`/dokan/v1/products/${e}`,method:"PUT",data:{status:t}})},[]),A=(0,e.useCallback)(async(e,t)=>{await Promise.all(e.map(e=>an()({path:`/dokan/v1/products/${e}`,method:"PUT",data:{status:t}})))},[]);return(0,e.useEffect)(()=>{N()},[N]),(0,e.useEffect)(()=>{E()},[E]),{data:n,isLoading:o,totalItems:l,totalPages:d,statusCounts:_,productsUrl:h,instockCount:p,outstockCount:g,monthOptions:x,subscriptionRemaining:y,fetchProducts:N,fetchStatusCounts:E,deleteProduct:S,deleteProducts:j,updateProductStatus:C,updateProductsStatus:A}})(g),{options:O}=(()=>{const[t,n]=(0,e.useState)([]),[r,i]=(0,e.useState)(!0);return(0,e.useEffect)(()=>{an()({path:"/dokan/v1/products/multistep-categories"}).then(e=>{e&&"object"==typeof e&&!Array.isArray(e)?n(function(e){const t=[];return function n(r,i){const a=Object.values(e).filter(e=>e.parent_id===r).map(e=>({...e,name:(0,dn.decodeEntities)(e.name)})).sort((e,t)=>e.name.localeCompare(t.name));for(const e of a)t.push({value:e.term_id,label:" ".repeat(i)+e.name}),n(e.term_id,i+1)}(0,0),t}(e)):n([])}).finally(()=>i(!1))},[]),{options:t,isLoading:r}})(),R=window.dokanFrontend?.product_listing?.subscription,D=null!==(t=S?.remaining_products)&&void 0!==t?t:R?.remaining_products,M=null===(n=null!==(r=S?.can_post_product)&&void 0!==r?r:R?.can_post_product)||void 0===n||n,q=void 0!==R&&(0===D||!M),P=[{id:"name",label:(0,a.__)("Products","dokan-lite"),enableSorting:!1,isPrimary:!0,render:({item:e})=>(0,Ht.jsxs)("div",{className:"flex items-center gap-3 min-w-xs",children:[(0,Ht.jsx)("div",{className:"w-12 h-12 overflow-hidden bg-gray-100 rounded-lg shrink-0",children:e.images?.[0]?.src?(0,Ht.jsx)("img",{src:e.images[0].src,alt:e.images[0].alt||e.name,className:"object-cover w-full h-full"}):(0,Ht.jsx)("div",{className:"w-full h-full bg-gray-100"})}),(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("a",{href:e.edit_url,className:"font-medium text-dokan-link cursor-pointer block focus:outline-none!",children:(0,Ht.jsx)(c.ShortContent,{content:e.name,maxLength:32})}),(0,Ht.jsx)("span",{className:"block text-xs text-gray-500",children:(0,a.sprintf)((0,a.__)("SKU: %s","dokan"),e.sku||"—")})]})]})},{id:"type",label:(0,a.__)("Type","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)(c.DokanTooltip,{content:ls(e),children:(0,Ht.jsx)("span",{className:"inline-flex items-center",children:(0,Ht.jsx)(cs,{item:e})})})},{id:"stock",label:(0,a.__)("Stock","dokan-lite"),enableSorting:!1,render:({item:e})=>{if(e.manage_stock&&null!==e.stock_quantity){const t=e.stock_quantity,n=t<=10;return(0,Ht.jsx)("span",{className:n?"text-red-600 font-medium":"text-green-600 font-medium",children:t})}return(0,Ht.jsx)("span",{className:e.in_stock?"text-green-600":"text-red-600",children:e.in_stock?(0,a.__)("In stock","dokan-lite"):(0,a.__)("Out of stock","dokan-lite")})}},{id:"status",label:(0,a.__)("Status","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)(c.DokanBadge,{variant:os(e.status),label:ss(e.status)})},{id:"price",label:(0,a.__)("Price","dokan-lite"),enableSorting:!1,render:({item:e})=>e.price?e.on_sale&&e.regular_price&&e.sale_price?(0,Ht.jsxs)("div",{className:"flex flex-col",children:[(0,Ht.jsx)("span",{className:"text-red-400 line-through",children:(0,Ht.jsx)(cn.A,{price:e.regular_price})}),(0,Ht.jsx)("span",{className:"font-medium text-green-600",children:(0,Ht.jsx)(cn.A,{price:e.sale_price})})]}):(0,Ht.jsx)(cn.A,{price:e.price}):(0,Ht.jsx)("span",{className:"text-gray-400",children:"—"})},{id:"earning",label:(0,a.__)("Earning","dokan-lite"),enableSorting:!1,render:({item:e})=>null!==e.earning&&void 0!==e.earning?(0,Ht.jsx)(cn.A,{price:String(e.earning)}):(0,Ht.jsx)("span",{className:"text-gray-400",children:"—"})},{id:"views",label:(0,a.__)("Views","dokan-lite"),enableSorting:!1,render:({item:e})=>{var t;return(0,Ht.jsx)("span",{children:null!==(t=e.page_view)&&void 0!==t?t:0})}}],[I,B]=(0,e.useState)({perPage:10,page:1,search:"",type:"table",status:"all",titleField:"name",fields:["type","stock","status","price","earning","advertise","views"]}),F=(0,i.applyFilters)("dokan_product_list_table_fields",P,g),U=e=>{v("instock"===e?e=>({...e,status:"all",in_stock:!0,page:1,search:""}):"outofstock"===e?e=>({...e,status:"all",in_stock:!1,page:1,search:""}):t=>({...t,status:e,in_stock:void 0,page:1,search:""})),B(t=>({...t,page:1,status:e,search:""})),u([])},z=(0,e.useMemo)(()=>{var e;const t=null!==(e=window.dokanFrontend?.product_listing)&&void 0!==e?e:{},n=R&&void 0!==D?{...t,subscription:{...R,remaining_products:D,can_post_product:M}}:t;return(0,i.applyFilters)("dokan_product_list_page_notices",[],n)},[D,M,R]),$=(0,e.useMemo)(()=>{var e;const t=null!==(e=window.dokanFrontend?.product_listing)&&void 0!==e?e:{},n=R&&void 0!==D?{...t,subscription:{...R,remaining_products:D,can_post_product:M}}:t;if(q)return[];const r=[];if(n.can_add_product){const e=n.is_legacy_editor_preferred&&!!n.new_product_url,t=!e&&n.is_quick_create_enabled;r.push((0,Ht.jsxs)(c.DokanButton,{onClick:()=>{e?window.location.href=n.new_product_url:t?m(!0):s("/products/create")},children:[(0,Ht.jsx)(Ga,{size:16}),(0,a.__)("Add new product","dokan-lite")]},"add-product"))}return(0,i.applyFilters)("dokan_product_list_header_buttons",r,n)},[D,M,q,R,s]),H=(0,e.useMemo)(()=>{var e,t,n,r;const o={};_.forEach(e=>{o[e.value]=e.count});const s=[{value:"all",label:(0,a.__)("All","dokan-lite"),count:null!==(e=o.all)&&void 0!==e?e:0},{value:"publish",label:(0,a.__)("Published","dokan-lite"),count:null!==(t=o.publish)&&void 0!==t?t:0},{value:"pending",label:(0,a.__)("Pending Review","dokan-lite"),count:null!==(n=o.pending)&&void 0!==n?n:0},{value:"draft",label:(0,a.__)("Draft","dokan-lite"),count:null!==(r=o.draft)&&void 0!==r?r:0},{value:"instock",label:(0,a.__)("In stock","dokan-lite"),count:k},{value:"outofstock",label:(0,a.__)("Out of stock","dokan-lite"),count:N}];return{items:(0,i.applyFilters)("dokan_product_list_table_tabs",s,{statusCounts:_,filterArgs:g}),onSelect:U}},[_,k,N,g]),V=(0,e.useMemo)(()=>(0,i.applyFilters)("dokan_product_list_type_options",ds),[]),W=(0,e.useMemo)(()=>{var e,t,n;return[{id:"year_month",label:(0,a.__)("Date","dokan-lite"),field:(0,Ht.jsx)(c.Select,{isClearable:!0,placeholder:(0,a.__)("All dates","dokan-lite"),options:E,value:null!==(e=E.find(e=>e.value===g.year_month))&&void 0!==e?e:null,onChange:e=>{v(t=>{var n;return{...t,year_month:null!==(n=e?.value)&&void 0!==n?n:"",page:1}})}},"month-select")},{id:"category",label:(0,a.__)("Category","dokan-lite"),field:(0,Ht.jsx)(c.Select,{isClearable:!0,placeholder:(0,a.__)("All categories","dokan-lite"),options:O,value:null!==(t=O.find(e=>e.value===g.category))&&void 0!==t?t:null,onChange:e=>{v(t=>{var n;return{...t,category:null!==(n=e?.value)&&void 0!==n?n:"",page:1}})}},"category-select")},{id:"type",label:(0,a.__)("Product Type","dokan-lite"),field:(0,Ht.jsx)(c.Select,{isClearable:!0,placeholder:(0,a.__)("All types","dokan-lite"),options:V,value:null!==(n=V.find(e=>e.value===g.type))&&void 0!==n?n:null,onChange:e=>{v(t=>{var n;return{...t,type:null!==(n=e?.value)&&void 0!==n?n:"",page:1}})}},"type-select")}]},[E,O,V,g.year_month,g.category,g.type]),G=(0,e.useMemo)(()=>(0,i.applyFilters)("dokan_product_list_filter_fields",W,g,v),[W,g]),Z=(0,e.useMemo)(()=>[{id:"edit-details",label:()=>(0,a.__)("Edit details","dokan-lite"),isEligible:e=>!!e.edit_url,callback:([e])=>{e.edit_url&&(window.location.href=e.edit_url)}},{id:"quick-view",label:()=>(0,a.__)("Quick view","dokan-lite"),callback:([e])=>{f(e)}},{id:"view-in-site",label:()=>(0,a.__)("View in site","dokan-lite"),callback:([e])=>{e.permalink&&window.open(e.permalink,"_blank")}},{id:"delete",label:(0,a.__)("Delete Permanently","dokan-lite"),isDestructive:!0,supportsBulk:!0,callback:async e=>{try{1===e.length?await A(e[0].id):await T(e.map(e=>e.id)),o({type:"success",title:1===e.length?(0,a.__)("Product deleted successfully.","dokan-lite"):(0,a.__)("Products deleted successfully.","dokan-lite")}),u([]),j(),C()}catch{o({type:"error",title:1===e.length?(0,a.__)("Failed to delete product.","dokan-lite"):(0,a.__)("Failed to delete products.","dokan-lite")})}}},{id:"bulk-publish",label:e=>e.length>1?(0,a.__)("Publish Products","dokan-lite"):(0,a.__)("Publish Product","dokan-lite"),supportsBulk:!0,isEligible:e=>"publish"!==e.status&&!(q&&!["publish","pending"].includes(e.status)),callback:async e=>{let t=e,n=0;if(R&&void 0!==D&&!0!==D){const r=D;if(r<=0)return void o({type:"error",title:(0,a.__)("You have reached your subscription product limit.","dokan")});e.length>r&&(t=e.slice(0,r),n=e.length-r)}try{await L(t.map(e=>e.id),"publish"),o(n>0?{type:"warning",title:(0,a.sprintf)((0,a.__)("%1$d product(s) published. %2$d product(s) could not be published due to your subscription limit.","dokan"),t.length,n)}:{type:"success",title:1===t.length?(0,a.__)("Product published successfully.","dokan-lite"):(0,a.__)("Products published successfully.","dokan-lite")}),u([]),j(),C()}catch{o({type:"error",title:1===e.length?(0,a.__)("Failed to publish product.","dokan-lite"):(0,a.__)("Failed to publish products.","dokan-lite")})}}}],[A,T,L,j,C,o,R,D,q]),K=(0,e.useMemo)(()=>(0,i.applyFilters)("dokan_product_list_table_actions",Z,{fetchProducts:j,fetchStatusCounts:C,selection:d,setSelection:u}),[Z,d,j,C,u]);return(0,e.useEffect)(()=>((0,i.addAction)("dokan_product_list_refresh","dokan/product-list",()=>{j(),C(),u([])}),()=>{(0,i.removeAction)("dokan_product_list_refresh","dokan/product-list")}),[j,C,u]),(0,Ht.jsxs)(Ht.Fragment,{children:[$.length>0&&(0,Ht.jsx)(l.Fill,{name:"dokan-header-actions",children:$}),z.length>0&&(0,Ht.jsx)(l.Fill,{name:"dokan-before-header",children:z.map((e,t)=>(0,Ht.jsx)("div",{className:"col-span-4",children:e},t))}),(0,Ht.jsx)(c.DataViews,{namespace:"dokan-products-data-view",data:y,fields:F,view:I,onChangeView:e=>{B(e),v(t=>{var n;return{...t,page:e.page,per_page:e.perPage,search:null!==(n=e.search)&&void 0!==n?n:""}})},getItemId:e=>e.id,isLoading:b,paginationInfo:{totalItems:x,totalPages:w},tabs:H,filter:{fields:G,onFilterRemove:e=>{v(t=>({...t,[e]:"",page:1}))},onReset:()=>{v(e=>({...e,category:"",type:"",year_month:"",product_brand:"",filter_by_other:"",page:1}))}},search:!0,actions:K,selection:d,onChangeSelection:e=>u(e)}),(0,Ht.jsx)(ns,{product:h,onClose:()=>f(null)}),p&&(0,Ht.jsx)(as,{isOpen:!0,onClose:()=>m(!1),onCreated:()=>{m(!1),j(),C()}}),(0,i.applyFilters)("dokan_product_list_after_content",null,{fetchProducts:j,fetchStatusCounts:C,selection:d,setSelection:u,data:y})]})},hs=(0,o.A)("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),fs=(0,o.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var ps=n(5107);const ms=()=>{const e=window?.dokan?.orderStatuses;return Array.isArray(e)&&e.length>0?e.map(e=>({value:e.value,label:e.label,count:0})):[{value:"all",label:(0,a.__)("All","dokan-lite"),count:0}]},gs=e=>{switch(e){case"completed":return"success";case"processing":return"info";case"on-hold":return"warning";case"pending":case"failed":return"danger";default:return"secondary"}},vs=e=>{const t=window?.dokan?.orderStatuses;if(Array.isArray(t)){const n=`wc-${e}`,r=t.find(t=>t.value===n||t.value===e);if(r)return r.label}return e},ys=e=>{if(!e||"--"===e)return"secondary";switch(e){case"received":case"shipped":return"success";case"partially":return"info";default:return"secondary"}},bs=e=>{switch(e){case"received":return(0,a.__)("Received","dokan-lite");case"shipped":return(0,a.__)("Delivered","dokan-lite");case"partially":return(0,a.__)("Partially Delivered","dokan-lite");case"not_shipped":return(0,a.__)("Not-Delivered","dokan-lite");default:return e}},xs=e=>{var t,n;const r=null!==(t=window?.dokan?.urls?.legacyOrdersUrl)&&void 0!==t?t:"",i=null!==(n=window?.dokan?.nonces?.viewOrder)&&void 0!==n?n:"";if(!r)return"#";const a=new URL(r);return a.searchParams.set("order_id",String(e)),i&&a.searchParams.set("_wpnonce",i),a.toString()},ws=e=>{const{billing:t}=e;return t?.first_name||t?.last_name?`${t.first_name} ${t.last_name}`.trim():e.customer_id?(0,a.__)("Customer","dokan-lite"):(0,a.__)("Guest","dokan-lite")};function _s({open:e,onToggle:t,onExportAll:n,onExportFiltered:r}){return(0,Ht.jsxs)("div",{className:"relative",children:[(0,Ht.jsxs)(c.DokanButton,{variant:"secondary",onClick:t,className:"flex items-center gap-1",children:[(0,Ht.jsx)(fs,{className:"w-4 h-4"}),(0,a.__)("Export All","dokan-lite"),(0,Ht.jsx)(ps.A,{className:"w-3 h-3"})]}),e&&(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)("div",{className:"fixed inset-0 z-10",onClick:t}),(0,Ht.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-20 bg-white border border-gray-200 rounded-md shadow-lg py-1 min-w-[160px]",children:[(0,Ht.jsx)("button",{type:"button",className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",onClick:n,children:(0,a.__)("Export All","dokan-lite")}),(0,Ht.jsx)("button",{type:"button",className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",onClick:r,children:(0,a.__)("Export Filtered","dokan-lite")})]})]})]})}const ks=function(){var t;const n=(0,Yt.useToast)(),[r,i]=(0,e.useState)([]),[o,s]=(0,e.useState)(!1),d=(0,e.useRef)(null),[u,h]=(0,e.useState)(""),[f,p]=(0,e.useState)(""),[m,g]=(0,e.useState)(""),[v,y]=(0,e.useState)(""),[b,x]=(0,e.useState)("startDate"),[w,_]=(0,e.useState)(null),[k,N]=(0,e.useState)({page:1,per_page:10,status:"all",search:""}),E="on"===window?.dokan?.allow_shipment&&window?.dokan?.wc_shipping_enabled&&Boolean(window?.dokan?.has_shipment_func),S=["order","order_total","earning","status","customer"];E&&S.push("shipment");const[j,C]=(0,e.useState)({perPage:10,page:1,search:"",type:"table",status:"all",fields:S,layout:{styles:{order:{width:"20%"},order_total:{width:"15%"},earning:{width:"15%"},status:{width:"15%"},customer:{width:"15%"},shipment:{width:"20%"}}}}),{data:A,isLoading:T,hasError:L,totalItems:O,totalPages:R,statusCounts:D,fetchOrders:M,fetchStatusCounts:q,updateOrderStatus:P}=(t=>{const[n,r]=(0,e.useState)([]),[i,a]=(0,e.useState)(!0),[o,s]=(0,e.useState)(!1),[l,c]=(0,e.useState)(0),[d,u]=(0,e.useState)(0),[h,f]=(0,e.useState)(()=>ms()),p=(0,e.useCallback)(async()=>{a(!0),s(!1);try{var e,n;const i={per_page:t.per_page,page:t.page};t.status&&"all"!==t.status&&(i.status=t.status),t.search&&(i.search=t.search),t.customer_id&&(i.customer_id=t.customer_id),t.after&&(i.after=t.after),t.before&&(i.before=t.before);const a=await an()({path:(0,ln.addQueryArgs)("/dokan/v1/orders",i),parse:!1}),o=await a.json();r(o),c(parseInt(null!==(e=a.headers.get("X-WP-Total"))&&void 0!==e?e:"0",10)),u(parseInt(null!==(n=a.headers.get("X-WP-TotalPages"))&&void 0!==n?n:"0",10))}catch{r([]),s(!0)}finally{a(!1)}},[t.page,t.per_page,t.status,t.search,t.customer_id,t.after,t.before]),m=(0,e.useCallback)(async()=>{try{const e=await an()({path:"/dokan/v1/orders/summary"}),t=ms();f(t.map(t=>{var n,r;return{...t,count:"all"===t.value?null!==(n=e?.total)&&void 0!==n?n:0:null!==(r=e?.[t.value])&&void 0!==r?r:0}}))}catch{}},[]),g=(0,e.useCallback)(async(e,t)=>{await an()({path:`/dokan/v1/orders/${e}`,method:"PUT",data:{status:t}})},[]);return(0,e.useEffect)(()=>{p()},[p]),(0,e.useEffect)(()=>{m()},[m]),{data:n,isLoading:i,hasError:o,totalItems:l,totalPages:d,statusCounts:h,fetchOrders:p,fetchStatusCounts:m,updateOrderStatus:g}})(k);(0,e.useEffect)(()=>{L&&n({type:"error",title:(0,a.__)("Failed to load orders","dokan-lite")})},[L,n]);const I=[{id:"order",label:(0,a.__)("Order","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("a",{href:xs(e.id),className:"font-medium text-primary",onClick:t=>{t.preventDefault(),window.location.href=xs(e.id)},children:`#${e.number||e.id}`}),(0,Ht.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:(0,Ht.jsx)(c.DateTimeHtml.Date,{date:e.date_created})})]})},{id:"order_total",label:(0,a.__)("Order Total","dokan-lite"),enableSorting:!1,render:({item:e})=>{if(!(Array.isArray(e.refunds)&&e.refunds.length>0))return(0,Ht.jsx)(c.PriceHtml,{price:e.total});let t=parseFloat(e.total)||0;for(const n of e.refunds)t+=parseFloat(n.total)||0;return(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)("span",{style:{textDecoration:"line-through",opacity:.6},children:(0,Ht.jsx)(c.PriceHtml,{price:e.total})}),(0,Ht.jsx)("div",{className:"mt-0.5",children:(0,Ht.jsx)(c.PriceHtml,{price:String(t)})})]})}},{id:"earning",label:(0,a.__)("Earning","dokan-lite"),enableSorting:!1,render:({item:e})=>e.earning?(0,Ht.jsx)(c.PriceHtml,{price:e.earning}):(0,Ht.jsx)("span",{children:"–"})},{id:"status",label:(0,a.__)("Status","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)(c.DokanBadge,{variant:gs(e.status),label:vs(e.status)})},{id:"customer",label:(0,a.__)("Customer","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("span",{children:ws(e)})},{id:"shipment",label:(0,a.__)("Shipment","dokan-lite"),enableSorting:!1,render:({item:e})=>{const t=e.order_shipment;return t&&"--"!==t?(0,Ht.jsx)(c.DokanBadge,{variant:ys(t),label:bs(t)}):(0,Ht.jsx)("span",{children:"–"})}}],B=I.filter(e=>"shipment"!==e.id||E),F={items:D,onSelect:e=>{N(t=>({...t,status:e,page:1,search:""})),C(e=>({...e,page:1,search:""}))}},U=()=>{h(""),p(""),g(""),y(""),x("startDate"),N(e=>({...e,page:1,after:"",before:""}))},z={fields:[{id:"customer-filter",label:(0,a.__)("Customer","dokan-lite"),field:(0,Ht.jsx)(c.CustomerFilter,{placeholder:(0,a.__)("Filter by Customer","dokan-lite"),value:w,onChange:e=>{_(e),N(t=>{var n;return{...t,page:1,customer_id:null!==(n=e?.value)&&void 0!==n?n:0}})},className:"min-w-48 shadow-none",menuPortalTarget:document.querySelector("body")})},{id:"date-range",label:(0,a.__)("Date Range","dokan-lite"),field:(0,Ht.jsx)(c.DateRangePicker,{after:u,afterText:f,before:m,beforeText:v,focusedInput:b,onUpdate:e=>{e.after&&h(e.after),e.afterText&&p(e.afterText),e.before&&g(e.before),e.beforeText&&y(e.beforeText),e.focusedInput&&(x(e.focusedInput),"endDate"===e.focusedInput&&u&&(g(""),y("")))},shortDateFormat:"MM/DD/YYYY",isInvalidDate:()=>!1,onClear:U,onOk:()=>{N(e=>({...e,page:1,after:u,before:m}))},children:(0,Ht.jsx)(Yt.SimpleInput,{addOnLeft:(0,Ht.jsx)(Dn,{size:"16"}),className:"border rounded px-3 py-1.5 w-full bg-white",onChange:()=>{},input:{type:"text",value:u&&m?`${f} - ${v}`:"",placeholder:(0,a.__)("Enter Date","dokan-lite"),readOnly:!0}})},"date-range-select")}],onReset:()=>{_(null),U()},onFilterRemove:e=>{"customer-filter"===e&&(_(null),N(e=>({...e,page:1,customer_id:0}))),"date-range"===e&&U()}},$=(0,e.useCallback)(e=>{var t;s(!1);const n=d.current;if(!n)return;n.innerHTML="";const r=(e,t)=>{const r=document.createElement("input");r.type="hidden",r.name=e,r.value=t,n.appendChild(r)};r("dokan_vendor_order_export_nonce",null!==(t=window?.dokan?.nonces?.orderExport)&&void 0!==t?t:""),e&&(r("dokan_order_export_filtered","1"),r("order_status",k.status),r("search",k.search),k.customer_id&&r("customer_id",String(k.customer_id)),k.after&&r("order_date_start",String(k.after)),k.before&&r("order_date_end",String(k.before))),n.submit()},[k]),H=(0,e.useCallback)(async(e,t)=>{const r=await Promise.allSettled(e.map(e=>P(e.id,t))),o=r.filter(e=>"rejected"===e.status).length,s=r.length-o;s>0&&(M(),q()),i([]),n(0===o?{type:"success",title:1===e.length?(0,a.__)("Order status updated","dokan-lite"):(0,a.__)("Orders status updated","dokan-lite")}:0===s?{type:"error",title:(0,a.__)("Failed to update order status","dokan-lite")}:{type:"warning",title:`${s} updated, ${o} failed`})},[P,M,q,n]),V=(0,e.useMemo)(()=>[{id:"view",label:(0,a.__)("View","dokan-lite"),callback:e=>{const t=e[0],n=xs(t.id);n&&"#"!==n&&(window.location.href=n)}},{id:"mark-on-hold",label:(0,a.__)("Change status to on-hold","dokan-lite"),supportsBulk:!0,isDestructive:!0,isEligible:e=>"on-hold"!==e.status,callback:async e=>{await H(e,"wc-on-hold")}},{id:"mark-processing",label:(0,a.__)("Change status to processing","dokan-lite"),supportsBulk:!0,isDestructive:!0,isEligible:e=>"processing"!==e.status,callback:async e=>{await H(e,"wc-processing")}},{id:"mark-completed",label:(0,a.__)("Change status to completed","dokan-lite"),supportsBulk:!0,isDestructive:!0,isEligible:e=>"completed"!==e.status,callback:async e=>{await H(e,"wc-completed")}}],[H]);return new URLSearchParams(window.location.search).get("order_id")?null:(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsx)(l.Fill,{name:"dokan-header-actions",children:(0,Ht.jsx)(_s,{open:o,onToggle:()=>s(e=>!e),onExportAll:()=>$(!1),onExportFiltered:()=>$(!0)})}),(0,Ht.jsx)(c.DataViews,{namespace:"dokan-orders-data-view",data:A,fields:B,view:j,onChangeView:e=>{C(e),N(t=>({...t,page:e.page,per_page:e.perPage,search:e.search}))},getItemId:e=>String(e.id),isLoading:T,paginationInfo:{totalItems:O,totalPages:R},tabs:F,filter:z,search:!0,searchPlaceholder:(0,a.__)("Search Orders","dokan-lite"),actions:V,selection:r,onChangeSelection:e=>i(e),onClickItem:e=>{const t=xs(e.id);t&&"#"!==t&&(window.location.href=t)},isItemClickable:()=>!0,emptyIcon:(0,Ht.jsx)(hs,{className:"w-12 h-12 text-gray-300"}),emptyTitle:(0,a.__)("No Order Yet","dokan-lite"),emptyDescription:(0,a.__)("All your orders will be listed here","dokan-lite")}),(0,Ht.jsx)("form",{ref:d,method:"POST",action:null!==(t=window?.dokan?.urls?.ordersUrl)&&void 0!==t?t:"",style:{display:"none"}})]})},Ns=()=>(0,Ht.jsx)("div",{className:"dokan-orders-wrapper dokan-react-orders space-y-6",children:(0,Ht.jsx)(ks,{})}),Es=()=>(0,Ht.jsxs)(Yt.Card,{children:[(0,Ht.jsx)(Yt.Card.Header,{children:(0,Ht.jsx)("div",{className:"h-6 w-48 bg-gray-200 rounded animate-pulse"})}),(0,Ht.jsx)(Yt.Card.Body,{children:(0,Ht.jsxs)("div",{className:"space-y-4",children:[(0,Ht.jsx)("div",{className:"h-4 w-64 bg-gray-200 rounded animate-pulse"}),(0,Ht.jsx)("div",{className:"h-4 w-48 bg-gray-200 rounded animate-pulse"})]})})]}),Ss=function({dueStatus:t,addToCartHook:n}){const r=(0,Yt.useToast)(),[i,o]=(0,e.useState)(!1);if(!t||t.isLoading)return(0,Ht.jsx)(Es,{});const s=t.data;return s?(0,Ht.jsxs)(Ht.Fragment,{children:[(0,Ht.jsxs)(Yt.Card,{className:"dokan-layout",children:[(0,Ht.jsx)(Yt.Card.Header,{children:(0,Ht.jsx)(Yt.Card.Title,{className:"p-0 m-0",children:(0,a.__)("Reverse Withdrawal Balance","dokan-lite")})}),(0,Ht.jsx)(Yt.Card.Body,{children:(0,Ht.jsxs)("div",{className:"flex flex-col md:flex-row! sm:items-center! justify-between",children:[(0,Ht.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Ht.jsxs)("div",{className:"text-gray-700 flex gap-1",children:[(0,Ht.jsx)("span",{children:(0,a.__)("Reverse Pay Balance:","dokan-lite")}),(0,Ht.jsxs)("span",{className:"font-semibold",children:[s.balance<0?"( ":"",(0,Ht.jsx)("span",{className:"inline-flex",children:(0,dn.decodeEntities)((0,$t.formatPrice)(Math.abs(s.balance)))}),s.balance<0?" )":""]})]}),"by_amount"===s.billing_type&&(0,Ht.jsxs)("div",{className:"text-gray-700 flex gap-1",children:[(0,Ht.jsx)("span",{children:(0,a.__)("Threshold:","dokan-lite")}),(0,Ht.jsx)("span",{className:"font-semibold",children:(0,Ht.jsx)("span",{className:"inline-flex",children:(0,dn.decodeEntities)((0,$t.formatPrice)(s.threshold))})})]}),"by_month"===s.billing_type&&(0,Ht.jsxs)("div",{className:"text-gray-700 flex gap-1",children:[(0,Ht.jsx)("span",{children:(0,a.__)("Payable Amount:","dokan-lite")}),(0,Ht.jsxs)("span",{className:"font-semibold",children:[s.payable_amount<0?"( ":"",(0,Ht.jsx)("span",{className:"inline-flex",children:(0,dn.decodeEntities)((0,$t.formatPrice)(Math.abs(s.payable_amount)))}),s.payable_amount<0?" )":""]})]})]}),s.payable_amount>0&&(0,Ht.jsx)(c.DokanButton,{variant:"primary",label:(0,a.__)("Pay Now","dokan-lite"),onClick:()=>o(!0),loading:n.isLoading})]})})]}),(0,Ht.jsx)(c.DokanModal,{namespace:"reverse-withdrawal-pay",isOpen:i,onClose:()=>o(!1),dialogTitle:(0,a.__)("Reverse Withdrawal Payment","dokan-lite"),onConfirm:async()=>{try{await n.addToCart(s.payable_amount);const e=window.dokan?.reverse_withdrawal?.checkout_url;e&&(window.location.href=e)}catch(e){r({type:"error",title:e instanceof Error?e.message:(0,a.__)("Failed to process payment","dokan-lite")})}finally{o(!1)}},confirmationTitle:(0,a.__)("Are you sure you want to pay this amount?","dokan-lite"),confirmationDescription:s.formatted_payable_amount,confirmButtonText:(0,a.__)("Pay Now","dokan-lite"),cancelButtonText:(0,a.__)("Cancel","dokan-lite"),loading:n.isLoading})]}):null},js=function({transactionsHook:t}){var n;const[r,i]=(0,e.useState)(""),[o,s]=(0,e.useState)(""),[l,d]=(0,e.useState)(""),[u,h]=(0,e.useState)(""),[f,p]=(0,e.useState)("startDate"),m=[{id:"trn_id",label:(0,a.__)("Transaction ID","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("div",{children:e.trn_url?(0,Ht.jsx)("a",{href:e.trn_url,target:"_blank",rel:"noreferrer",className:"text-dokan-link",children:e.trn_id}):e.trn_id})},{id:"trn_date",label:(0,a.__)("Date","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("div",{children:e.trn_date})},{id:"trn_type",label:(0,a.__)("Transaction Type","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("div",{children:e.trn_type})},{id:"note",label:(0,a.__)("Note","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("div",{children:e.note})},{id:"debit",label:(0,a.__)("Debit","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("div",{children:""===e.debit||"--"===e.debit?"--":(0,Ht.jsx)("span",{className:"inline-flex",children:(0,dn.decodeEntities)((0,$t.formatPrice)(e.debit))})})},{id:"credit",label:(0,a.__)("Credit","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("div",{children:""===e.credit||"--"===e.credit?"--":(0,Ht.jsx)("span",{className:"inline-flex",children:(0,dn.decodeEntities)((0,$t.formatPrice)(e.credit))})})},{id:"balance",label:(0,a.__)("Balance","dokan-lite"),enableSorting:!1,render:({item:e})=>(0,Ht.jsx)("div",{children:(0,Ht.jsxs)("span",{children:[Number(e.balance)<0?"(":"",(0,Ht.jsx)("span",{className:"inline-flex",children:(0,dn.decodeEntities)((0,$t.formatPrice)(Math.abs(Number(e.balance))))}),Number(e.balance)<0?")":""]})})}],g=()=>{i(""),s(""),d(""),h(""),t.fetchTransactions({per_page:t.view.perPage,page:1})},v={fields:[{id:"date-range",label:(0,a.__)("Date Range","dokan-lite"),field:(0,Ht.jsx)(c.DateRangePicker,{after:r,afterText:o,before:l,beforeText:u,onUpdate:e=>{e.after&&i(e.after),e.afterText&&s(e.afterText),e.before&&d(e.before),e.beforeText&&h(e.beforeText),e.focusedInput&&(p(e.focusedInput),"endDate"===e.focusedInput&&r&&(d(""),h("")))},shortDateFormat:"MM/DD/YYYY",focusedInput:f,isInvalidDate:()=>!1,wrapperClassName:"w-full",pickerToggleClassName:"block",wpPopoverClassName:"dokan-layout",onClear:()=>{i(""),s(""),d(""),h(""),t.fetchTransactions({per_page:t.view.perPage,page:1})},onOk:()=>{const e={per_page:t.view.perPage,page:1};(r||l)&&(e.trn_date={},r&&(e.trn_date.from=(0,Rn.dateI18n)("Y-m-d 00:00:00",r)),l&&(e.trn_date.to=(0,Rn.dateI18n)("Y-m-d 23:59:59",l))),t.fetchTransactions(e)},children:(0,Ht.jsx)(Yt.SimpleInput,{addOnLeft:(0,Ht.jsx)(Dn,{size:"16"}),className:"border rounded px-3 py-1.5 w-full bg-white",onChange:()=>{},input:{type:"text",value:r&&l?(y=r,b=l,(0,a.sprintf)((0,a.__)("%s - %s","dokan-lite"),(0,Rn.dateI18n)((0,Rn.getSettings)().formats.date,y),(0,Rn.dateI18n)((0,Rn.getSettings)().formats.date,b))):"",placeholder:(0,a.__)("Date","dokan-lite"),readOnly:!0}})},"reverse-withdraw-date-range")}],onReset:g,onFilterRemove:e=>(e=>{"date-range"===e&&g()})(e)};var y,b;return(0,Ht.jsxs)("div",{children:[(0,Ht.jsx)(c.DataViews,{namespace:"dokan-reverse-withdrawal-transactions",data:null!==(n=t.data)&&void 0!==n?n:[],fields:m,view:t.view,filter:v,search:!1,onChangeView:e=>{const n=e.page!==t.view.page||e.perPage!==t.view.perPage;t.setView(e),n&&t.fetchTransactions({...t.lastPayload,page:e.page,per_page:e.perPage})},getItemId:e=>e.id,paginationInfo:{totalItems:t.totalItems,totalPages:t.totalPages},isLoading:t.isLoading}),!t.isLoading&&t.data&&t.data.length>0&&(0,Ht.jsxs)("div",{className:"flex justify-end items-center gap-2 px-4 py-3 border-t border-gray-200 bg-gray-50 rounded-b",children:[(0,Ht.jsx)("span",{className:"font-semibold text-gray-700",children:(0,a.__)("Balance:","dokan-lite")}),(0,Ht.jsx)("span",{className:"font-semibold inline-flex",children:(0,dn.decodeEntities)((0,$t.formatPrice)(t.summaryBalance))})]})]})},Cs=()=>{const t=(()=>{const[t,n]=(0,e.useState)(null),[r,i]=(0,e.useState)(!0),[a,o]=(0,e.useState)(null),s=(0,e.useCallback)(async()=>{try{i(!0),o(null);const e=await an()({path:"/dokan/v1/reverse-withdrawal/vendor-due-status",method:"GET"});n(e)}catch(e){o(e instanceof Error?e:new Error("Failed to fetch vendor due status"))}finally{i(!1)}},[]);return(0,e.useEffect)(()=>{s()},[s]),{data:t,isLoading:r,error:a,refresh:s}})(),n=((t=!1)=>{const[n,r]=(0,e.useState)(null),[i,a]=(0,e.useState)(t),[o,s]=(0,e.useState)(null),[l,c]=(0,e.useState)(0),[d,u]=(0,e.useState)(0),[h,f]=(0,e.useState)(0),[p,m]=(0,e.useState)(0),[g,v]=(0,e.useState)(0),[y,b]=(0,e.useState)({perPage:10,page:1,type:"table",fields:["trn_id","trn_date","trn_type","note","debit","credit","balance"],layout:{styles:{trn_id:{width:"14%"},trn_date:{width:"14%"},trn_type:{width:"14%"},note:{width:"14%"},debit:{width:"14%"},credit:{width:"14%"},balance:{width:"14%"}}}}),x=(0,e.useRef)(null),w=(0,e.useCallback)(async e=>{try{a(!0),s(null),x.current?x.current=Object.assign({},x.current,e):x.current=e;const t={per_page:e.per_page,page:e.page};e.trn_date?.from&&(t["trn_date[from]"]=e.trn_date.from),e.trn_date?.to&&(t["trn_date[to]"]=e.trn_date.to);const n=(0,ln.addQueryArgs)("/dokan/v1/reverse-withdrawal/transactions",t),i=await an()({path:n,parse:!1}),o=await i.json(),l=i.headers;r(o),c(Number(l.get("X-WP-Total")||"0")),u(Number(l.get("X-WP-TotalPages")||"0")),f(Number(l.get("X-Status-Debit")||"0")),m(Number(l.get("X-Status-Credit")||"0")),v(Number(l.get("X-Status-Balance")||"0"))}catch(e){s(e instanceof Error?e:new Error("Failed to fetch transactions"))}finally{a(!1)}},[]),_=(0,e.useCallback)(()=>{x.current&&w(x.current)},[w]);return{data:n,isLoading:i,error:o,totalItems:l,totalPages:d,summaryDebit:h,summaryCredit:p,summaryBalance:g,fetchTransactions:w,refresh:_,view:y,setView:b,lastPayload:x.current}})(!0),r=(()=>{const[t,n]=(0,e.useState)(!1),[r,i]=(0,e.useState)(null);return{addToCart:async e=>{try{n(!0),i(null);const t=window.dokan;if(!t?.reverse_withdrawal?.nonce)throw new Error((0,a.__)("Reverse withdrawal payment data is not available. Please reload the page.","dokan-lite"));const r=t.reverse_withdrawal.nonce,o=t.ajaxurl||"/wp-admin/admin-ajax.php",s=new FormData;s.append("action","dokan_reverse_withdrawal_payment_to_cart"),s.append("price",String(e)),s.append("_reverse_withdrawal_nonce",r);const l=await fetch(o,{method:"POST",body:s,credentials:"same-origin"}),c=await l.text();let d;try{d=JSON.parse(c)}catch{throw new Error((0,a.__)("Unexpected server response. Please reload the page and try again.","dokan-lite"))}if(!d.success){const e=d.data?.message||("string"==typeof d.data?d.data:"")||(0,a.__)("Something went wrong. Please try again.","dokan-lite");throw new Error(e)}}catch(e){const t=e instanceof Error?e:new Error((0,a.__)("Failed to add to cart","dokan-lite"));throw i(t),t}finally{n(!1)}},isLoading:t,error:r}})();return(0,e.useEffect)(()=>{n.fetchTransactions({per_page:10,page:1})},[]),(0,Ht.jsxs)("div",{className:"dokan-withdraw-wrapper dokan-react-withdraw space-y-6",children:[(0,Ht.jsx)(Ss,{dueStatus:t,addToCartHook:r}),(0,Ht.jsx)(js,{transactionsHook:n}),(0,Ht.jsx)(Yt.DokanToaster,{})]})},As=[{id:"dokan-products",title:(0,a.__)("Products","dokan-lite"),element:()=>(0,Ht.jsx)("div",{className:"dokan-products-wrapper dokan-react-products space-y-6",children:(0,Ht.jsx)(us,{})}),path:"/products",exact:!0,order:5,capabilities:["dokan_view_product_menu"]},{id:"dokan-orders",title:(0,a.__)("Orders","dokan-lite"),element:(0,Ht.jsx)(Ns,{}),path:"/orders",exact:!0,order:5,capabilities:["dokan_view_order_menu"]},{id:"dokan-withdraw",title:(0,a.__)("Withdraw","dokan-lite"),element:(0,Ht.jsx)(On,{}),path:"/withdraw",exact:!0,order:10,capabilities:["dokan_view_withdraw_menu"]},{id:"dokan-withdraw-requests",title:(0,a.__)("Withdraw","dokan-lite"),element:(0,Ht.jsx)(Mn,{}),path:"/withdraw-requests",backUrl:"/withdraw",exact:!0,order:10,capabilities:["dokan_view_withdraw_menu"]},{id:"dokan-product-editor-create",title:(0,a.__)("Add New Product","dokan-lite"),element:Yo,path:"/products/create",exact:!0,order:10,capabilities:["dokan_view_product_menu"]},{id:"dokan-product-editor-edit",title:(0,a.__)("Edit Product","dokan-lite"),element:Yo,path:"/products/:productId/edit",exact:!0,order:10,capabilities:["dokan_view_product_menu"]},{id:"dokan-reverse-withdrawal",title:(0,a.__)("Reverse Withdrawal","dokan-lite"),element:(0,Ht.jsx)(Cs,{}),path:"/reverse-withdrawal",exact:!0,order:11,capabilities:["dokan_view_withdraw_menu"]}],Ts=window.dokan.coreStore;var Ls=n.n(Ts),Os=n(9284);const Rs=()=>{const e=wp.hooks.applyFilters("dokan-dashboard-routes",As);return e.push({id:"dokan-404",element:(0,Ht.jsx)(nn.A,{}),path:"*"}),e},Ds=()=>(0,Ht.jsxs)("div",{className:"h-48 flex justify-center items-center",role:"status",children:[(0,Ht.jsxs)("svg",{"aria-hidden":"true",className:"inline w-10 h-10 text-gray-200 animate-spin dark:text-gray-600",viewBox:"0 0 100 101",fill:"var(--colors-primary-600)",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ht.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,Ht.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),(0,Ht.jsx)("span",{className:"sr-only",children:"Loading..."})]});(0,i.addFilter)("i18n.gettext_default","dokan-lite/dataviews-actions-label",(e,t)=>"Actions"!==t?e:(0,a.__)("Actions","dokan-lite"));const Ms=()=>{const t=Rs(),n=(0,Bn.useSelect)(e=>(e(Ls()).getCurrentUser(),e(Ls()).getResolutionState("getCurrentUser")),[]),r=function(e){return fe({basename:void 0,future:jt({},void 0,{v7_prependBasename:!0}),history:p({window:void 0}),hydrationData:At(),routes:e,mapRouteProperties:Et,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}(t.map(t=>{const n=function(t,n=[]){return function(r){const i=(0,Bn.useSelect)(e=>{const t=e(Ls());return!(n?.length>0)||n.every(e=>t.hasCap(e))},[]),a=dt(),o=ut(),s=lt(),l=_t(),c=wt(),d={navigate:a,params:o,location:s,redirect:X,replace:Q,matches:l,navigation:c,useParams:ut,createSearchParams:Ct,useSearchParams:zt};return i?(0,e.isValidElement)(t)?(0,e.cloneElement)(t,{...r,...d}):(0,e.createElement)(t,{...r,...d}):(0,e.createElement)(Os.A,{...r,...d})}}(t.element,t?.capabilities||["dokandar"]);return{path:t.path,element:(0,Ht.jsx)(tn,{headerComponent:t?.header,footerComponent:t?.footer,route:t,title:t?.title,backUrl:t?.backUrl,children:(0,Ht.jsx)(n,{})})}}));return n&&"finished"===n?.status?(0,Ht.jsx)(Ht.Fragment,{children:(0,Ht.jsx)(Pt,{router:r})}):(0,Ht.jsx)(Ds,{})};r()(function(){const t=document.querySelector("#dokan-vendor-dashboard-root");t&&((0,e.createRoot)(t).render((0,Ht.jsx)(Ms,{})),(()=>{const e=document.documentElement,t=getComputedStyle(e).getPropertyValue("--dokan-button-background-color").trim();if(!t)return;const n=(0,$t.generateColorVariants)(t);Object.entries(n).forEach(([t,n])=>{e.style.setProperty(`--colors-primary-${t}`,n)})})())})})()})();