250 lines
88 KiB
JavaScript
250 lines
88 KiB
JavaScript
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=19)}([function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.wc.wcSettings},,function(e,t){e.exports=window.ReactDOM},function(e,t){e.exports=window.wp.url},,function(e,t,n){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,a;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,a[o]))return!1;for(o=r;0!=o--;){var i=a[o];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},function(e,t){e.exports=window.wp.primitives},,function(e,t,n){"use strict";var r=n(17),o={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},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function l(e){return r.isMemo(e)?i:c[e.$$typeof]||o}c[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[r.Memo]=i;var s=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,b=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(b){var o=f(n);o&&o!==b&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var c=l(t),g=l(n),h=0;h<i.length;++h){var m=i[h];if(!(a[m]||r&&r[m]||g&&g[m]||c&&c[m])){var v=p(n,m);try{s(t,m,v)}catch(e){}}}}return t}},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.data},,function(e,t){function n(){return e.exports=n=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},e.exports.__esModule=!0,e.exports.default=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";e.exports=n(18)},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,b=r?Symbol.for("react.suspense"):60113,g=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case p:case i:case l:case c:case b:return e;default:switch(e=e&&e.$$typeof){case u:case f:case m:case h:case s:return e;default:return t}}case a:return t}}}function j(e){return x(e)===p}t.AsyncMode=d,t.ConcurrentMode=p,t.ContextConsumer=u,t.ContextProvider=s,t.Element=o,t.ForwardRef=f,t.Fragment=i,t.Lazy=m,t.Memo=h,t.Portal=a,t.Profiler=l,t.StrictMode=c,t.Suspense=b,t.isAsyncMode=function(e){return j(e)||x(e)===d},t.isConcurrentMode=j,t.isContextConsumer=function(e){return x(e)===u},t.isContextProvider=function(e){return x(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return x(e)===f},t.isFragment=function(e){return x(e)===i},t.isLazy=function(e){return x(e)===m},t.isMemo=function(e){return x(e)===h},t.isPortal=function(e){return x(e)===a},t.isProfiler=function(e){return x(e)===l},t.isStrictMode=function(e){return x(e)===c},t.isSuspense=function(e){return x(e)===b},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===l||e===c||e===b||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===s||e.$$typeof===u||e.$$typeof===f||e.$$typeof===y||e.$$typeof===O||e.$$typeof===w||e.$$typeof===v)},t.typeOf=x},function(e,t,n){"use strict";n.r(t);var r=n(1),o=(n(16),n(0)),a=n.n(o),i=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}},c=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,l=i((function(e){return c.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));function s(){return s=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},s.apply(this,arguments)}var u=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){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),d="-ms-",p="-moz-",f="-webkit-",b="comm",g="rule",h="decl",m="@keyframes",v=Math.abs,y=String.fromCharCode,O=Object.assign;function w(e){return e.trim()}function x(e,t,n){return e.replace(t,n)}function j(e,t){return e.indexOf(t)}function k(e,t){return 0|e.charCodeAt(t)}function E(e,t,n){return e.slice(t,n)}function C(e){return e.length}function S(e){return e.length}function _(e,t){return t.push(e),e}var R=1,D=1,M=0,A=0,T=0,P="";function N(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:R,column:D,length:i,return:""}}function I(e,t){return O(N("",null,null,"",null,null,0),e,{length:-e.length},t)}function L(){return T=A>0?k(P,--A):0,D--,10===T&&(D=1,R--),T}function $(){return T=A<M?k(P,A++):0,D++,10===T&&(D=1,R++),T}function z(){return k(P,A)}function B(){return A}function F(e,t){return E(P,e,t)}function U(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 V(e){return R=D=1,M=C(P=e),A=0,[]}function G(e){return P="",e}function H(e){return w(F(A-1,X(91===e?e+2:40===e?e+1:e)))}function W(e){for(;(T=z())&&T<33;)$();return U(e)>2||U(T)>3?"":" "}function q(e,t){for(;--t&&$()&&!(T<48||T>102||T>57&&T<65||T>70&&T<97););return F(e,B()+(t<6&&32==z()&&32==$()))}function X(e){for(;$();)switch(T){case e:return A;case 34:case 39:34!==e&&39!==e&&X(T);break;case 40:41===e&&X(e);break;case 92:$()}return A}function Y(e,t){for(;$()&&e+T!==57&&(e+T!==84||47!==z()););return"/*"+F(t,A-1)+"*"+y(47===e?e:$())}function K(e){for(;!U(z());)$();return F(e,A)}function J(e){return G(Z("",null,null,null,[""],e=V(e),0,[0],e))}function Z(e,t,n,r,o,a,i,c,l){for(var s=0,u=0,d=i,p=0,f=0,b=0,g=1,h=1,m=1,v=0,O="",w=o,k=a,E=r,S=O;h;)switch(b=v,v=$()){case 40:if(108!=b&&58==S.charCodeAt(d-1)){-1!=j(S+=x(H(v),"&","&\f"),"&\f")&&(m=-1);break}case 34:case 39:case 91:S+=H(v);break;case 9:case 10:case 13:case 32:S+=W(b);break;case 92:S+=q(B()-1,7);continue;case 47:switch(z()){case 42:case 47:_(ee(Y($(),B()),t,n),l);break;default:S+="/"}break;case 123*g:c[s++]=C(S)*m;case 125*g:case 59:case 0:switch(v){case 0:case 125:h=0;case 59+u:f>0&&C(S)-d&&_(f>32?te(S+";",r,n,d-1):te(x(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(_(E=Q(S,t,n,s,u,o,c,O,w=[],k=[],d),a),123===v)if(0===u)Z(S,t,E,E,w,a,d,c,k);else switch(p){case 100:case 109:case 115:Z(e,E,E,r&&_(Q(e,E,E,0,0,o,c,O,o,w=[],d),k),o,k,d,c,r?w:k);break;default:Z(S,E,E,E,[""],k,0,c,k)}}s=u=f=0,g=m=1,O=S="",d=i;break;case 58:d=1+C(S),f=b;default:if(g<1)if(123==v)--g;else if(125==v&&0==g++&&125==L())continue;switch(S+=y(v),v*g){case 38:m=u>0?1:(S+="\f",-1);break;case 44:c[s++]=(C(S)-1)*m,m=1;break;case 64:45===z()&&(S+=H($())),p=z(),u=d=C(O=S+=K(B())),v++;break;case 45:45===b&&2==C(S)&&(g=0)}}return a}function Q(e,t,n,r,o,a,i,c,l,s,u){for(var d=o-1,p=0===o?a:[""],f=S(p),b=0,h=0,m=0;b<r;++b)for(var y=0,O=E(e,d+1,d=v(h=i[b])),j=e;y<f;++y)(j=w(h>0?p[y]+" "+O:x(O,/&\f/g,p[y])))&&(l[m++]=j);return N(e,t,n,0===o?g:c,l,s,u)}function ee(e,t,n){return N(e,t,n,b,y(T),E(e,2,-2),0)}function te(e,t,n,r){return N(e,t,n,h,E(e,0,r),E(e,r+1,-1),r)}function ne(e,t){switch(function(e,t){return(((t<<2^k(e,0))<<2^k(e,1))<<2^k(e,2))<<2^k(e,3)}(e,t)){case 5103:return f+"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 f+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return f+e+p+e+d+e+e;case 6828:case 4268:return f+e+d+e+e;case 6165:return f+e+d+"flex-"+e+e;case 5187:return f+e+x(e,/(\w+).+(:[^]+)/,f+"box-$1$2"+d+"flex-$1$2")+e;case 5443:return f+e+d+"flex-item-"+x(e,/flex-|-self/,"")+e;case 4675:return f+e+d+"flex-line-pack"+x(e,/align-content|flex-|-self/,"")+e;case 5548:return f+e+d+x(e,"shrink","negative")+e;case 5292:return f+e+d+x(e,"basis","preferred-size")+e;case 6060:return f+"box-"+x(e,"-grow","")+f+e+d+x(e,"grow","positive")+e;case 4554:return f+x(e,/([^-])(transform)/g,"$1"+f+"$2")+e;case 6187:return x(x(x(e,/(zoom-|grab)/,f+"$1"),/(image-set)/,f+"$1"),e,"")+e;case 5495:case 3959:return x(e,/(image-set\([^]*)/,f+"$1$`$1");case 4968:return x(x(e,/(.+:)(flex-)?(.*)/,f+"box-pack:$3"+d+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+f+e+e;case 4095:case 3583:case 4068:case 2532:return x(e,/(.+)-inline(.+)/,f+"$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(C(e)-1-t>6)switch(k(e,t+1)){case 109:if(45!==k(e,t+4))break;case 102:return x(e,/(.+:)(.+)-([^]+)/,"$1"+f+"$2-$3$1"+p+(108==k(e,t+3)?"$3":"$2-$3"))+e;case 115:return~j(e,"stretch")?ne(x(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==k(e,t+1))break;case 6444:switch(k(e,C(e)-3-(~j(e,"!important")&&10))){case 107:return x(e,":",":"+f)+e;case 101:return x(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+f+(45===k(e,14)?"inline-":"")+"box$3$1"+f+"$2$3$1"+d+"$2box$3")+e}break;case 5936:switch(k(e,t+11)){case 114:return f+e+d+x(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return f+e+d+x(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return f+e+d+x(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return f+e+d+e+e}return e}function re(e,t){for(var n="",r=S(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function oe(e,t,n,r){switch(e.type){case"@import":case h:return e.return=e.return||e.value;case b:return"";case m:return e.return=e.value+"{"+re(e.children,r)+"}";case g:e.value=e.props.join(",")}return C(n=re(e.children,r))?e.return=e.value+"{"+n+"}":""}function ae(e){return function(t){t.root||(t=t.return)&&e(t)}}var ie=function(e,t,n){for(var r=0,o=0;r=o,o=z(),38===r&&12===o&&(t[n]=1),!U(o);)$();return F(e,A)},ce=new WeakMap,le=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)||ce.get(n))&&!r){ce.set(e,!0);for(var o=[],a=function(e,t){return G(function(e,t){var n=-1,r=44;do{switch(U(r)){case 0:38===r&&12===z()&&(t[n]=1),e[n]+=ie(A-1,t,n);break;case 2:e[n]+=H(r);break;case 4:if(44===r){e[++n]=58===z()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=y(r)}}while(r=$());return e}(V(e),t))}(t,o),i=n.props,c=0,l=0;c<a.length;c++)for(var s=0;s<i.length;s++,l++)e.props[l]=o[c]?a[c].replace(/&\f/g,i[s]):i[s]+" "+a[c]}}},se=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},ue=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case h:e.return=ne(e.value,e.length);break;case m:return re([I(e,{value:x(e.value,"@","@"+f)})],r);case g:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return re([I(e,{props:[x(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return re([I(e,{props:[x(t,/:(plac\w+)/,":"+f+"input-$1")]}),I(e,{props:[x(t,/:(plac\w+)/,":-moz-$1")]}),I(e,{props:[x(t,/:(plac\w+)/,d+"input-$1")]})],r)}return""}))}}],de=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,o,a=e.stylisPlugins||ue,i={},c=[];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++)i[t[n]]=!0;c.push(e)}));var l,s=[le,se],d=[oe,ae((function(e){l.insert(e)}))],p=function(e){var t=S(e);return function(n,r,o,a){for(var i="",c=0;c<t;c++)i+=e[c](n,r,o,a)||"";return i}}(s.concat(a,d));o=function(e,t,n,r){l=n,re(J(e?e+"{"+t.styles+"}":t.styles),p),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new u({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:o};return f.sheet.hydrate(c),f};n(12);var pe=Object(o.createContext)("undefined"!=typeof HTMLElement?de({key:"css"}):null);pe.Provider;var fe=Object(o.createContext)({});o.useInsertionEffect&&o.useInsertionEffect;var be=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},ge=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=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(o){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)},he={animationIterationCount: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,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},me=/[A-Z]|^ms/g,ve=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ye=function(e){return 45===e.charCodeAt(1)},Oe=function(e){return null!=e&&"boolean"!=typeof e},we=i((function(e){return ye(e)?e:e.replace(me,"-$&").toLowerCase()})),xe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(ve,(function(e,t,n){return ke={name:t,styles:n,next:ke},t}))}return 1===he[e]||ye(e)||"number"!=typeof t||0===t?t:t+"px"};function je(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return ke={name:n.name,styles:n.styles,next:ke},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)ke={name:r.name,styles:r.styles,next:ke},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=je(e,t,n[o])+";";else for(var a in n){var i=n[a];if("object"!=typeof i)null!=t&&void 0!==t[i]?r+=a+"{"+t[i]+"}":Oe(i)&&(r+=we(a)+":"+xe(a,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var c=je(e,t,i);switch(a){case"animation":case"animationName":r+=we(a)+":"+c+";";break;default:r+=a+"{"+c+"}"}}else for(var l=0;l<i.length;l++)Oe(i[l])&&(r+=we(a)+":"+xe(a,i[l])+";")}return r}(e,t,n);case"function":if(void 0!==e){var o=ke,a=n(e);return ke=o,je(e,t,a)}}if(null==t)return n;var i=t[n];return void 0!==i?i:n}var ke,Ee=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Ce=!!o.useInsertionEffect&&o.useInsertionEffect,Se=Ce||function(e){return e()},_e=(Ce||o.useLayoutEffect,l),Re=function(e){return"theme"!==e},De=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?_e:Re},Me=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Ae=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return be(t,n,r),Se((function(){return function(e,t,n){be(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,r)})),null},Te=function e(t,n){var r,a,i=t.__emotion_real===t,c=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,a=n.target);var l=Me(t,n,i),u=l||De(c),d=!u("as");return function(){var p=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==p[0]||void 0===p[0].raw)f.push.apply(f,p);else{f.push(p[0][0]);for(var b=p.length,g=1;g<b;g++)f.push(p[g],p[0][g])}var h,m=(h=function(e,t,n){var r,i,s,p,b=d&&e.as||c,g="",h=[],m=e;if(null==e.theme){for(var v in m={},e)m[v]=e[v];m.theme=Object(o.useContext)(fe)}"string"==typeof e.className?(r=t.registered,i=h,s=e.className,p="",s.split(" ").forEach((function(e){void 0!==r[e]?i.push(r[e]+";"):p+=e+" "})),g=p):null!=e.className&&(g=e.className+" ");var y=function(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,o="";ke=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,o+=je(n,t,a)):o+=a[0];for(var i=1;i<e.length;i++)o+=je(n,t,e[i]),r&&(o+=a[i]);Ee.lastIndex=0;for(var c,l="";null!==(c=Ee.exec(o));)l+="-"+c[1];return{name:ge(o)+l,styles:o,next:ke}}(f.concat(h),t.registered,m);g+=t.key+"-"+y.name,void 0!==a&&(g+=" "+a);var O=d&&void 0===l?De(b):u,w={};for(var x in e)d&&"as"===x||O(x)&&(w[x]=e[x]);return w.className=g,w.ref=n,Object(o.createElement)(o.Fragment,null,Object(o.createElement)(Ae,{cache:t,serialized:y,isStringTag:"string"==typeof b}),Object(o.createElement)(b,w))},Object(o.forwardRef)((function(e,t){var n=Object(o.useContext)(pe);return h(e,n,t)})));return m.displayName=void 0!==r?r:"Styled("+("string"==typeof c?c:c.displayName||c.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=c,m.__emotion_styles=f,m.__emotion_forwardProp=l,Object.defineProperty(m,"toString",{value:function(){return"."+a}}),m.withComponent=function(t,r){return e(t,s({},n,r,{shouldForwardProp:Me(m,r,!0)})).apply(void 0,f)},m}}.bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Te[e]=Te(e)}));var Pe,Ne=Te,Ie=n(2),Le=n(4);const $e=Object(Le.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),ze=($e.pluginUrl,$e.pluginUrl,$e.buildPhase,null===(Pe=Le.STORE_PAGES.shop)||void 0===Pe||Pe.permalink,Le.STORE_PAGES.checkout.id),Be=(Le.STORE_PAGES.checkout.permalink,Le.STORE_PAGES.privacy.permalink,Le.STORE_PAGES.privacy.title,Le.STORE_PAGES.terms.permalink,Le.STORE_PAGES.terms.title,Le.STORE_PAGES.cart.id,Le.STORE_PAGES.cart.permalink,Le.STORE_PAGES.myaccount.permalink?Le.STORE_PAGES.myaccount.permalink:Object(Le.getSetting)("wpLoginUrl","/wp-login.php"),Object(Le.getSetting)("localPickupEnabled",!1),Object(Le.getSetting)("countries",{})),Fe=Object(Le.getSetting)("countryData",{});Object.fromEntries(Object.keys(Fe).filter((e=>!0===Fe[e].allowBilling)).map((e=>[e,Be[e]||""]))),Object.fromEntries(Object.keys(Fe).filter((e=>!0===Fe[e].allowBilling)).map((e=>[e,Fe[e].states||[]]))),Object.fromEntries(Object.keys(Fe).filter((e=>!0===Fe[e].allowShipping)).map((e=>[e,Be[e]||""]))),Object.fromEntries(Object.keys(Fe).filter((e=>!0===Fe[e].allowShipping)).map((e=>[e,Fe[e].states||[]]))),Object.fromEntries(Object.keys(Fe).map((e=>[e,Fe[e].locale||[]])));var Ue=n(3);const Ve=Ne.div`
|
|
display: flex;
|
|
flex-flow: column;
|
|
margin-bottom: 24px;
|
|
&:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
@media ( min-width: 800px ) {
|
|
flex-flow: row;
|
|
}
|
|
.components-base-control {
|
|
label {
|
|
text-transform: none !important;
|
|
}
|
|
}
|
|
`,Ge=Ne.div`
|
|
flex: 0 1 auto;
|
|
margin-bottom: 24px;
|
|
@media ( min-width: 800px ) {
|
|
flex: 0 0 250px;
|
|
margin: 0 32px 0 0;
|
|
}
|
|
h2 {
|
|
font-size: 16px;
|
|
line-height: 24px;
|
|
}
|
|
p {
|
|
font-size: 13px;
|
|
line-height: 17.89px;
|
|
margin: 12px 0;
|
|
}
|
|
> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
`,He=Ne.div`
|
|
flex: 1 1 auto;
|
|
margin-bottom: 12px;
|
|
`;var We=({Description:e=(()=>null),children:t,...n})=>Object(r.createElement)(Ve,{...n},Object(r.createElement)(Ge,null,Object(r.createElement)(e,null)),Object(r.createElement)(He,null,t));const qe=Ne(Ue.Card)`
|
|
border-radius: 3px;
|
|
`,Xe=Ne(Ue.CardBody)`
|
|
padding: 24px;
|
|
|
|
// increasing the specificity of the styles to override the Gutenberg ones
|
|
&.is-size-medium.is-size-medium {
|
|
padding: 24px;
|
|
}
|
|
|
|
h4 {
|
|
margin-top: 0;
|
|
margin-bottom: 1em;
|
|
}
|
|
|
|
> * {
|
|
margin-top: 0;
|
|
margin-bottom: 1.5em;
|
|
|
|
// fixing the spacing on the inputs and their help text, to ensure it is consistent
|
|
&:last-child {
|
|
margin-bottom: 0;
|
|
|
|
> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
input,
|
|
select {
|
|
margin: 0;
|
|
}
|
|
|
|
// spacing adjustment on "Express checkouts > Show express checkouts on" list
|
|
ul > li:last-child {
|
|
margin-bottom: 0;
|
|
|
|
.components-base-control__field {
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
`;var Ye=({children:e,...t})=>Object(r.createElement)(qe,null,Object(r.createElement)(Xe,{...t},e)),Ke=n(7),Je=n(13),Ze=n.n(Je),Qe=n(14),et=n(9),tt=n.n(et);const nt=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,rt={enabled:!1,title:Object(Ie.__)("Local Pickup","woocommerce"),tax_status:"taxable",cost:""},ot={hasLegacyPickup:!1,storeCountry:"",storeState:""},at=()=>{const e=hydratedScreenSettings.pickupLocationSettings;return{enabled:null!=e&&e.enabled?"yes"===(null==e?void 0:e.enabled):rt.enabled,title:(null==e?void 0:e.title)||rt.title,tax_status:(null==e?void 0:e.tax_status)||rt.tax_status,cost:(null==e?void 0:e.cost)||rt.cost}},it=()=>(hydratedScreenSettings.pickupLocations||[]).map(((e,t)=>({...e,id:Object(Ke.cleanForSlug)(e.name)+"-"+t}))),ct=hydratedScreenSettings.readonlySettings||ot,lt=Object(Le.getSetting)("countries",[]),st=Object(Le.getSetting)("countryStates",[]),ut={options:Object.keys(lt).map((e=>{const t=st[e]||{};if(0===Object.keys(t).length)return{options:[{value:e,label:lt[e]}]};const n=Object.keys(t).map((n=>({value:`${e}:${n}`,label:`${lt[e]} — ${t[n]}`})));return{label:lt[e],options:[...n]}}))},dt=Object(r.createContext)({settings:rt,readOnlySettings:ot,setSettingField:()=>()=>{},pickupLocations:[],setPickupLocations:()=>{},toggleLocation:()=>{},updateLocation:()=>{},isSaving:!1,save:()=>{}}),pt=()=>Object(r.useContext)(dt),ft=({children:e})=>{const[t,n]=Object(r.useState)(!1),[o,a]=Object(r.useState)(it),[i,c]=Object(r.useState)(at),l=Object(r.useCallback)((e=>t=>{c((n=>({...n,[e]:t})))}),[]),s=Object(r.useCallback)((e=>{a((t=>{const n=t.findIndex((({id:t})=>t===e)),r=[...t];return r[n].enabled=!t[n].enabled,r}))}),[]),u=Object(r.useCallback)((()=>{const e={pickup_location_settings:{enabled:i.enabled?"yes":"no",title:i.title,tax_status:["taxable","none"].includes(i.tax_status)?i.tax_status:"taxable",cost:i.cost},pickup_locations:o.map((e=>({name:e.name,address:e.address,details:e.details,enabled:e.enabled})))};n(!0),Ze()({path:"/wp/v2/settings",method:"POST",data:e}).then((t=>{n(!1),tt()(t.pickup_location_settings,e.pickup_location_settings)&&tt()(t.pickup_locations,e.pickup_locations)&&Object(Qe.dispatch)("core/notices").createSuccessNotice(Object(Ie.__)("Local Pickup settings have been saved.","woocommerce"))}))}),[i,o]),d={settings:i,setSettingField:l,readOnlySettings:ct,pickupLocations:o,setPickupLocations:a,toggleLocation:s,updateLocation:(e,t)=>{a((n=>"new"===e?[...n,{...t,id:Object(Ke.cleanForSlug)(t.name)+"-"+n.length}]:n.map((n=>n.id===e?t:n)).filter(Boolean)))},isSaving:t,save:u};return Object(r.createElement)(dt.Provider,{value:d},e)},bt=()=>Object(r.createElement)(r.Fragment,null,Object(r.createElement)("h2",null,Object(Ie.__)("General","woocommerce")),Object(r.createElement)("p",null,Object(Ie.__)("Enable or disable local pickup on your store, and define costs. Local pickup is only available from the block checkout.","woocommerce")),Object(r.createElement)(Ue.ExternalLink,{href:`${Le.ADMIN_URL}post.php?post=${ze}&action=edit`},Object(Ie.__)("View checkout page","woocommerce"))),gt=Ne(Ue.Notice)`
|
|
margin-left: 0;
|
|
margin-right: 0;
|
|
`;var ht=()=>{const{settings:e,setSettingField:t,readOnlySettings:n}=pt(),[o,a]=Object(r.useState)(!!e.cost),i=Object(Le.getSetting)("shippingCostRequiresAddress",!1);return Object(r.createElement)(We,{Description:bt},Object(r.createElement)(Ye,null,n.hasLegacyPickup&&Object(r.createElement)(gt,{status:"warning",isDismissible:!1},Object(r.createInterpolateElement)(Object(Ie.__)("Enabling this will produce duplicate options at checkout. Remove the local pickup shipping method from your <a>shipping zones</a>.","woocommerce"),{a:Object(r.createElement)("a",{href:`${Le.ADMIN_URL}admin.php?page=wc-settings&tab=shipping`,target:"_blank",rel:"noopener noreferrer"})})),Object(r.createElement)(Ue.CheckboxControl,{checked:e.enabled,name:"local_pickup_enabled",onChange:t("enabled"),label:Object(Ie.__)("Enable local pickup","woocommerce"),help:Object(r.createElement)("span",null,Object(Ie.__)("When enabled, local pickup will appear as an option on the block based checkout.","woocommerce"),i?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("br",null),Object(Ie.__)('If local pickup is enabled, the "Hide shipping costs until an address is entered" setting will be ignored.',"woocommerce")):null)}),Object(r.createElement)(Ue.TextControl,{label:Object(Ie.__)("Title","woocommerce"),name:"local_pickup_title",help:Object(Ie.__)("This is the shipping method title shown to customers.","woocommerce"),placeholder:Object(Ie.__)("Local Pickup","woocommerce"),value:e.title,onChange:t("title"),disabled:!1,autoComplete:"off",required:!0,onInvalid:e=>{e.target.setCustomValidity(Object(Ie.__)("Local pickup title is required","woocommerce"))},onInput:e=>{e.target.setCustomValidity("")}}),Object(r.createElement)(Ue.CheckboxControl,{checked:o,onChange:()=>{a(!o),t("cost")("")},label:Object(Ie.__)("Add a price for customers who choose local pickup","woocommerce"),help:Object(Ie.__)("By default, the local pickup shipping method is free.","woocommerce")}),o?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Ue.TextControl,{label:Object(Ie.__)("Cost","woocommerce"),name:"local_pickup_cost",help:Object(Ie.__)("Optional cost to charge for local pickup.","woocommerce"),placeholder:Object(Ie.__)("Free","woocommerce"),type:"number",pattern:"[0-9]+\\.?[0-9]*",min:0,value:e.cost,onChange:t("cost"),disabled:!1,autoComplete:"off"}),Object(r.createElement)(Ue.SelectControl,{label:Object(Ie.__)("Taxes","woocommerce"),name:"local_pickup_tax_status",help:Object(Ie.__)("If a cost is defined, this controls if taxes are applied to that cost.","woocommerce"),options:[{label:Object(Ie.__)("Taxable","woocommerce"),value:"taxable"},{label:Object(Ie.__)("Not taxable","woocommerce"),value:"none"}],value:e.tax_status,onChange:t("tax_status"),disabled:!1})):null))},mt=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})},vt=n(10),yt=Object(r.createElement)(vt.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},Object(r.createElement)(vt.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"})),Ot=n(6);const wt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function xt(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function jt(e){return"nodeType"in e}function kt(e){var t,n;return e?xt(e)?e:jt(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Et(e){const{Document:t}=kt(e);return e instanceof t}function Ct(e){return!xt(e)&&e instanceof kt(e).HTMLElement}function St(e){return e?xt(e)?e.document:jt(e)?Et(e)?e:Ct(e)?e.ownerDocument:document:document:document}const _t=wt?o.useLayoutEffect:o.useEffect;function Rt(e){const t=Object(o.useRef)(e);return _t((()=>{t.current=e})),Object(o.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function Dt(e,t){void 0===t&&(t=[e]);const n=Object(o.useRef)(e);return _t((()=>{n.current!==e&&(n.current=e)}),t),n}function Mt(e,t){const n=Object(o.useRef)();return Object(o.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function At(e){const t=Rt(e),n=Object(o.useRef)(null),r=Object(o.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function Tt(e){const t=Object(o.useRef)();return Object(o.useEffect)((()=>{t.current=e}),[e]),t.current}let Pt={};function Nt(e,t){return Object(o.useMemo)((()=>{if(t)return t;const n=null==Pt[e]?0:Pt[e]+1;return Pt[e]=n,e+"-"+n}),[e,t])}function It(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const Lt=It(1),$t=It(-1);function zt(e){if(!e)return!1;const{KeyboardEvent:t}=kt(e.target);return t&&e instanceof t}function Bt(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=kt(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}const Ft=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ft.Translate.toString(e),Ft.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ut="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Vt(e){return e.matches(Ut)?e:e.querySelector(Ut)}const Gt={display:"none"};function Ht(e){let{id:t,value:n}=e;return a.a.createElement("div",{id:t,style:Gt},n)}const Wt={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function qt(e){let{id:t,announcement:n}=e;return a.a.createElement("div",{id:t,style:Wt,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const Xt=Object(o.createContext)(null),Yt={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Kt={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Jt(e){let{announcements:t=Kt,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Yt}=e;const{announce:c,announcement:l}=function(){const[e,t]=Object(o.useState)("");return{announce:Object(o.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),s=Nt("DndLiveRegion"),[u,d]=Object(o.useState)(!1);if(Object(o.useEffect)((()=>{d(!0)}),[]),function(e){const t=Object(o.useContext)(Xt);Object(o.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(Object(o.useMemo)((()=>({onDragStart(e){let{active:n}=e;c(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&c(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;c(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;c(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;c(t.onDragCancel({active:n,over:r}))}})),[c,t])),!u)return null;const p=a.a.createElement(a.a.Fragment,null,a.a.createElement(Ht,{id:r,value:i.draggable}),a.a.createElement(qt,{id:s,announcement:l}));return n?Object(Ot.createPortal)(p,n):p}var Zt;function Qt(){}function en(e,t){return Object(o.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!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"}(Zt||(Zt={}));const tn=Object.freeze({x:0,y:0});function nn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function rn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function on(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const an=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=on(t,t.left,t.top),a=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=(i=on(r),c=o,Math.sqrt(Math.pow(i.x-c.x,2)+Math.pow(i.y-c.y,2)));a.push({id:t,data:{droppableContainer:e,value:n}})}}var i,c;return a.sort(nn)};function cn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-r,c=a-n;if(r<o&&n<a){const n=t.width*t.height,r=e.width*e.height,o=i*c;return Number((o/(n+r-o)).toFixed(4))}return 0}const ln=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,a=n.get(r);if(a){const n=cn(a,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(rn)};function sn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:tn}function un(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const dn=un(1);const pn={ignoreTransform:!1};function fn(e,t){void 0===t&&(t=pn);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=kt(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:a,x:i,y:c}=r,l=e.left-i-(1-o)*parseFloat(n),s=e.top-c-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:s,right:l+u,bottom:s+d,left:l}}(n,t,r))}const{top:r,left:o,width:a,height:i,bottom:c,right:l}=n;return{top:r,left:o,width:a,height:i,bottom:c,right:l}}function bn(e){return fn(e,{ignoreTransform:!0})}function gn(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(Et(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ct(o)||function(e){return e instanceof kt(e).SVGElement}(o))return n;if(n.includes(o))return n;const a=kt(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=kt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&n.push(o),function(e,t){return void 0===t&&(t=kt(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function hn(e){const[t]=gn(e,1);return null!=t?t:null}function mn(e){return wt&&e?xt(e)?e:jt(e)?Et(e)||e===St(e).scrollingElement?window:Ct(e)?e:null:null:null}function vn(e){return xt(e)?e.scrollX:e.scrollLeft}function yn(e){return xt(e)?e.scrollY:e.scrollTop}function On(e){return{x:vn(e),y:yn(e)}}var wn;function xn(e){return!(!wt||!e)&&e===document.scrollingElement}function jn(e){const t={x:0,y:0},n=xn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(wn||(wn={}));const kn={x:.2,y:.2};function En(e,t,n,r,o){let{top:a,left:i,right:c,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=kn);const{isTop:s,isBottom:u,isLeft:d,isRight:p}=jn(e),f={x:0,y:0},b={x:0,y:0},g=t.height*o.y,h=t.width*o.x;return!s&&a<=t.top+g?(f.y=wn.Backward,b.y=r*Math.abs((t.top+g-a)/g)):!u&&l>=t.bottom-g&&(f.y=wn.Forward,b.y=r*Math.abs((t.bottom-g-l)/g)),!p&&c>=t.right-h?(f.x=wn.Forward,b.x=r*Math.abs((t.right-h-c)/h)):!d&&i<=t.left+h&&(f.x=wn.Backward,b.x=r*Math.abs((t.left+h-i)/h)),{direction:f,speed:b}}function Cn(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Sn(e){return e.reduce(((e,t)=>Lt(e,On(t))),tn)}const Rn=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+vn(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+yn(t)),0)}]];class Dn{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=gn(t),r=Sn(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Rn)for(const a of t)Object.defineProperty(this,a,{get:()=>{const t=o(n),i=r[e]-t;return this.rect[a]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Mn{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 An(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}var Tn,Pn;function Nn(e){e.preventDefault()}function In(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"}(Tn||(Tn={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Pn||(Pn={}));const Ln={start:[Pn.Space,Pn.Enter],cancel:[Pn.Esc],end:[Pn.Space,Pn.Enter]},$n=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Pn.Right:return{...n,x:n.x+25};case Pn.Left:return{...n,x:n.x-25};case Pn.Down:return{...n,y:n.y+25};case Pn.Up:return{...n,y:n.y-25}}};class zn{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Mn(St(t)),this.windowListeners=new Mn(kt(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tn.Resize,this.handleCancel),this.windowListeners.add(Tn.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(Tn.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=fn),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);hn(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(tn)}handleKeyDown(e){if(zt(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Ln,coordinateGetter:a=$n,scrollBehavior:i="smooth"}=r,{code:c}=e;if(o.end.includes(c))return void this.handleEnd(e);if(o.cancel.includes(c))return void this.handleCancel(e);const{collisionRect:l}=n.current,s=l?{x:l.left,y:l.top}:tn;this.referenceCoordinates||(this.referenceCoordinates=s);const u=a(e,{active:t,context:n.current,currentCoordinates:s});if(u){const t=$t(u,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:a,isRight:c,isLeft:l,isBottom:s,maxScroll:d,minScroll:p}=jn(n),f=Cn(n),b={x:Math.min(o===Pn.Right?f.right-f.width/2:f.right,Math.max(o===Pn.Right?f.left:f.left+f.width/2,u.x)),y:Math.min(o===Pn.Down?f.bottom-f.height/2:f.bottom,Math.max(o===Pn.Down?f.top:f.top+f.height/2,u.y))},g=o===Pn.Right&&!c||o===Pn.Left&&!l,h=o===Pn.Down&&!s||o===Pn.Up&&!a;if(g&&b.x!==u.x){const e=n.scrollLeft+t.x,a=o===Pn.Right&&e<=d.x||o===Pn.Left&&e>=p.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:i});r.x=a?n.scrollLeft-e:o===Pn.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:i});break}if(h&&b.y!==u.y){const e=n.scrollTop+t.y,a=o===Pn.Down&&e<=d.y||o===Pn.Up&&e>=p.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:i});r.y=a?n.scrollTop-e:o===Pn.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:i});break}}this.handleMove(e,Lt($t(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Bn(e){return Boolean(e&&"distance"in e)}function Fn(e){return Boolean(e&&"delay"in e)}zn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Ln,onActivation:o}=t,{active:a}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const t=a.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Un{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=kt(e);return e instanceof t?e:St(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:o}=e,{target:a}=o;this.props=e,this.events=t,this.document=St(a),this.documentListeners=new Mn(this.document),this.listeners=new Mn(n),this.windowListeners=new Mn(kt(a)),this.initialCoordinates=null!=(r=Bt(o))?r:tn,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}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Tn.Resize,this.handleCancel),this.windowListeners.add(Tn.DragStart,Nn),this.windowListeners.add(Tn.VisibilityChange,this.handleCancel),this.windowListeners.add(Tn.ContextMenu,Nn),this.documentListeners.add(Tn.Keydown,this.handleKeydown),t){if(Bn(t))return;if(Fn(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Tn.Click,In,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tn.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:i}}=o;if(!r)return;const c=null!=(t=Bt(e))?t:tn,l=$t(r,c);if(!n&&i){if(Fn(i))return An(l,i.tolerance)?this.handleCancel():void 0;if(Bn(i))return null!=i.tolerance&&An(l,i.tolerance)?this.handleCancel():An(l,i.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Pn.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Vn={move:{name:"pointermove"},end:{name:"pointerup"}};class Gn extends Un{constructor(e){const{event:t}=e,n=St(t.target);super(e,Vn,n)}}Gn.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 Hn={move:{name:"mousemove"},end:{name:"mouseup"}};var Wn;!function(e){e[e.RightClick=2]="RightClick"}(Wn||(Wn={}));class qn extends Un{constructor(e){super(e,Hn,St(e.event.target))}}qn.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Wn.RightClick&&(null==r||r({event:n}),!0)}}];const Xn={move:{name:"touchmove"},end:{name:"touchend"}};class Yn extends Un{constructor(e){super(e,Xn)}static setup(){return window.addEventListener(Xn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Xn.move.name,e)};function e(){}}}var Kn,Jn;Yn.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Kn||(Kn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Jn||(Jn={}));const Zn={x:{[wn.Backward]:!1,[wn.Forward]:!1},y:{[wn.Backward]:!1,[wn.Forward]:!1}};var Qn,er;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Qn||(Qn={})),function(e){e.Optimized="optimized"}(er||(er={}));const tr=new Map;function nr(e,t){return Mt((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function rr(e){let{callback:t,disabled:n}=e;const r=Rt(t),a=Object(o.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return Object(o.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}function or(e){return new Dn(fn(e),e)}function ar(e,t,n){void 0===t&&(t=or);const[r,a]=Object(o.useReducer)((function(r){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const a=t(e);return JSON.stringify(r)===JSON.stringify(a)?r:a}),null),i=function(e){let{callback:t,disabled:n}=e;const r=Rt(t),a=Object(o.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return Object(o.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),c=rr({callback:a});return _t((()=>{a(),e?(null==c||c.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==c||c.disconnect(),null==i||i.disconnect())}),[e]),r}const ir=[];function cr(e,t){void 0===t&&(t=[]);const n=Object(o.useRef)(null);return Object(o.useEffect)((()=>{n.current=null}),t),Object(o.useEffect)((()=>{const t=e!==tn;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?$t(e,n.current):tn}function lr(e){return Object(o.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const sr=[];const ur=[{sensor:Gn,options:{}},{sensor:zn,options:{}}],dr={current:{}},pr={draggable:{measure:bn},droppable:{measure:bn,strategy:Qn.WhileDragging,frequency:er.Optimized},dragOverlay:{measure:fn}};class fr extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const br={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:pr,measureDroppableContainers:Qt,windowRect:null,measuringScheduled:!1},gr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qt,draggableNodes:new Map,over:null,measureDroppableContainers:Qt},hr=Object(o.createContext)(gr),mr=Object(o.createContext)(br);function vr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fr}}}function yr(e,t){switch(t.type){case Zt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Zt.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Zt.DragEnd:case Zt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Zt.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new fr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Zt.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const i=new fr(e.droppable.containers);return i.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case Zt.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new fr(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Or(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=Object(o.useContext)(hr),i=Tt(r),c=Tt(null==n?void 0:n.id);return Object(o.useEffect)((()=>{if(!t&&!r&&i&&null!=c){if(!zt(i))return;if(document.activeElement===i.target)return;const e=a.get(c);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Vt(e);if(t){t.focus();break}}}))}}),[r,t,a,c,i]),null}const wr=Object(o.createContext)({...tn,scaleX:1,scaleY:1});var xr;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(xr||(xr={}));const jr=Object(o.memo)((function(e){var t,n,r,i;let{id:c,accessibility:l,autoScroll:s=!0,children:u,sensors:d=ur,collisionDetection:p=ln,measuring:f,modifiers:b,...g}=e;const h=Object(o.useReducer)(yr,void 0,vr),[m,v]=h,[y,O]=function(){const[e]=Object(o.useState)((()=>new Set)),t=Object(o.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[Object(o.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]),t]}(),[w,x]=Object(o.useState)(xr.Uninitialized),j=w===xr.Initialized,{draggable:{active:k,nodes:E,translate:C},droppable:{containers:S}}=m,_=k?E.get(k):null,R=Object(o.useRef)({initial:null,translated:null}),D=Object(o.useMemo)((()=>{var e;return null!=k?{id:k,data:null!=(e=null==_?void 0:_.data)?e:dr,rect:R}:null}),[k,_]),M=Object(o.useRef)(null),[A,T]=Object(o.useState)(null),[P,N]=Object(o.useState)(null),I=Dt(g,Object.values(g)),L=Nt("DndDescribedBy",c),$=Object(o.useMemo)((()=>S.getEnabled()),[S]),z=(B=f,Object(o.useMemo)((()=>({draggable:{...pr.draggable,...null==B?void 0:B.draggable},droppable:{...pr.droppable,...null==B?void 0:B.droppable},dragOverlay:{...pr.dragOverlay,...null==B?void 0:B.dragOverlay}})),[null==B?void 0:B.draggable,null==B?void 0:B.droppable,null==B?void 0:B.dragOverlay]));var B;const{droppableRects:F,measureDroppableContainers:U,measuringScheduled:V}=function(e,t){let{dragging:n,dependencies:r,config:a}=t;const[i,c]=Object(o.useState)(null),{frequency:l,measure:s,strategy:u}=a,d=Object(o.useRef)(e),p=function(){switch(u){case Qn.Always:return!1;case Qn.BeforeDragging:return n;default:return!n}}(),f=Dt(p),b=Object(o.useCallback)((function(e){void 0===e&&(e=[]),f.current||c((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[f]),g=Object(o.useRef)(null),h=Mt((t=>{if(p&&!n)return tr;if(!t||t===tr||d.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new Dn(s(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,i,n,p,s]);return Object(o.useEffect)((()=>{d.current=e}),[e]),Object(o.useEffect)((()=>{p||b()}),[n,p]),Object(o.useEffect)((()=>{i&&i.length>0&&c(null)}),[JSON.stringify(i)]),Object(o.useEffect)((()=>{p||"number"!=typeof l||null!==g.current||(g.current=setTimeout((()=>{b(),g.current=null}),l))}),[l,p,b,...r]),{droppableRects:h,measureDroppableContainers:b,measuringScheduled:null!=i}}($,{dragging:j,dependencies:[C.x,C.y],config:z.droppable}),G=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return Mt((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(E,k),H=Object(o.useMemo)((()=>P?Bt(P):null),[P]),W=function(){const e=!1===(null==A?void 0:A.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=j&&!e&&!t;return"object"==typeof s?{...s,enabled:n}:{enabled:n}}(),q=function(e,t){return nr(e,t)}(G,z.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e;const i=Object(o.useRef)(!1),{x:c,y:l}="boolean"==typeof a?{x:a,y:a}:a;_t((()=>{if(!c&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=sn(n(e),r);if(c||(o.x=0),l||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=hn(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,c,l,r,n])}({activeNode:k?E.get(k):null,config:W.layoutShiftCompensation,initialRect:q,measure:z.draggable.measure});const X=ar(G,z.draggable.measure,q),Y=ar(G?G.parentElement:null),K=Object(o.useRef)({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=S.getNodeFor(null==(t=K.current.over)?void 0:t.id),Z=function(e){let{measure:t}=e;const[n,r]=Object(o.useState)(null),a=rr({callback:Object(o.useCallback)((e=>{for(const{target:n}of e)if(Ct(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),i=Object(o.useCallback)((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ct(t)?t:e}(e);null==a||a.disconnect(),n&&(null==a||a.observe(n)),r(n?t(n):null)}),[t,a]),[c,l]=At(i);return Object(o.useMemo)((()=>({nodeRef:c,rect:n,setRef:l})),[n,c,l])}({measure:z.dragOverlay.measure}),Q=null!=(n=Z.nodeRef.current)?n:G,ee=j?null!=(r=Z.rect)?r:X:null,te=Boolean(Z.nodeRef.current&&Z.rect),ne=sn(re=te?null:X,nr(re));var re;const oe=lr(Q?kt(Q):null),ae=function(e){const t=Object(o.useRef)(e),n=Mt((n=>e?n&&n!==ir&&e&&t.current&&e.parentNode===t.current.parentNode?n:gn(e):ir),[e]);return Object(o.useEffect)((()=>{t.current=e}),[e]),n}(j?null!=J?J:G:null),ie=function(e,t){void 0===t&&(t=fn);const[n]=e,r=lr(n?kt(n):null),[a,i]=Object(o.useReducer)((function(){return e.length?e.map((e=>xn(e)?r:new Dn(t(e),e))):sr}),sr),c=rr({callback:i});return e.length>0&&a===sr&&i(),_t((()=>{e.length?e.forEach((e=>null==c?void 0:c.observe(e))):(null==c||c.disconnect(),i())}),[e]),a}(ae),ce=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(b,{transform:{x:C.x-ne.x,y:C.y-ne.y,scaleX:1,scaleY:1},activatorEvent:P,active:D,activeNodeRect:X,containerNodeRect:Y,draggingNodeRect:ee,over:K.current.over,overlayNodeRect:Z.rect,scrollableAncestors:ae,scrollableAncestorRects:ie,windowRect:oe}),le=H?Lt(H,C):null,se=function(e){const[t,n]=Object(o.useState)(null),r=Object(o.useRef)(e),a=Object(o.useCallback)((e=>{const t=mn(e.target);t&&n((e=>e?(e.set(t,On(t)),new Map(e)):null))}),[]);return Object(o.useEffect)((()=>{const t=r.current;if(e!==t){o(t);const i=e.map((e=>{const t=mn(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,On(t)]):null})).filter((e=>null!=e));n(i.length?new Map(i):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach((e=>{const t=mn(e);null==t||t.removeEventListener("scroll",a)}))}}),[a,e]),Object(o.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>Lt(e,t)),tn):Sn(e):tn),[e,t])}(ae),ue=cr(se),de=cr(se,[X]),pe=Lt(ce,ue),fe=ee?dn(ee,ce):null,be=D&&fe?p({active:D,collisionRect:fe,droppableRects:F,droppableContainers:$,pointerCoordinates:le}):null,ge=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(be,"id"),[he,me]=Object(o.useState)(null),ve=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(te?ce:Lt(ce,de),null!=(i=null==he?void 0:he.rect)?i:null,X),ye=Object(o.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==M.current)return;const o=E.get(M.current);if(!o)return;const a=e.nativeEvent,i=new n({active:M.current,activeNode:o,event:a,options:r,context:K,onStart(e){const t=M.current;if(null==t)return;const n=E.get(t);if(!n)return;const{onDragStart:r}=I.current,o={active:{id:t,data:n.data,rect:R}};Object(Ot.unstable_batchedUpdates)((()=>{null==r||r(o),x(xr.Initializing),v({type:Zt.DragStart,initialCoordinates:e,active:t}),y({type:"onDragStart",event:o})}))},onMove(e){v({type:Zt.DragMove,coordinates:e})},onEnd:c(Zt.DragEnd),onCancel:c(Zt.DragCancel)});function c(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=K.current;let i=null;if(t&&o){const{cancelDrop:c}=I.current;i={activatorEvent:a,active:t,collisions:n,delta:o,over:r},e===Zt.DragEnd&&"function"==typeof c&&await Promise.resolve(c(i))&&(e=Zt.DragCancel)}M.current=null,Object(Ot.unstable_batchedUpdates)((()=>{v({type:e}),x(xr.Uninitialized),me(null),T(null),N(null);const t=e===Zt.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=I.current[t];null==e||e(i),y({type:t,event:i})}}))}}Object(Ot.unstable_batchedUpdates)((()=>{T(i),N(e.nativeEvent)}))}),[E]),Oe=Object(o.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,a=E.get(r);if(null!==M.current||!a||o.dndKit||o.defaultPrevented)return;const i={active:a};!0===e(n,t.options,i)&&(o.dndKit={capturedBy:t.sensor},M.current=r,ye(n,t))}),[E,ye]),we=function(e,t){return Object(o.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(d,Oe);!function(e){Object(o.useEffect)((()=>{if(!wt)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(d),_t((()=>{X&&w===xr.Initializing&&x(xr.Initialized)}),[X,w]),Object(o.useEffect)((()=>{const{onDragMove:e}=I.current,{active:t,activatorEvent:n,collisions:r,over:o}=K.current;if(!t||!n)return;const a={active:t,activatorEvent:n,collisions:r,delta:{x:pe.x,y:pe.y},over:o};Object(Ot.unstable_batchedUpdates)((()=>{null==e||e(a),y({type:"onDragMove",event:a})}))}),[pe.x,pe.y]),Object(o.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=K.current;if(!e||null==M.current||!t||!o)return;const{onDragOver:a}=I.current,i=r.get(ge),c=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:c};Object(Ot.unstable_batchedUpdates)((()=>{me(c),null==a||a(l),y({type:"onDragOver",event:l})}))}),[ge]),_t((()=>{K.current={activatorEvent:P,active:D,activeNode:G,collisionRect:fe,collisions:be,droppableRects:F,draggableNodes:E,draggingNode:Q,draggingNodeRect:ee,droppableContainers:S,over:he,scrollableAncestors:ae,scrollAdjustedTranslate:pe},R.current={initial:ee,translated:fe}}),[D,G,be,fe,E,Q,ee,F,S,he,ae,pe]),function(e){let{acceleration:t,activator:n=Kn.Pointer,canScroll:r,draggingRect:a,enabled:i,interval:c=5,order:l=Jn.TreeOrder,pointerCoordinates:s,scrollableAncestors:u,scrollableAncestorRects:d,delta:p,threshold:f}=e;const b=function(e){let{delta:t,disabled:n}=e;const r=Tt(t);return Mt((e=>{if(n||!r||!e)return Zn;const o=Math.sign(t.x-r.x),a=Math.sign(t.y-r.y);return{x:{[wn.Backward]:e.x[wn.Backward]||-1===o,[wn.Forward]:e.x[wn.Forward]||1===o},y:{[wn.Backward]:e.y[wn.Backward]||-1===a,[wn.Forward]:e.y[wn.Forward]||1===a}}}),[n,t,r])}({delta:p,disabled:!i}),[g,h]=function(){const e=Object(o.useRef)(null);return[Object(o.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),Object(o.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),m=Object(o.useRef)({x:0,y:0}),v=Object(o.useRef)({x:0,y:0}),y=Object(o.useMemo)((()=>{switch(n){case Kn.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case Kn.DraggableRect:return a}}),[n,a,s]),O=Object(o.useRef)(null),w=Object(o.useCallback)((()=>{const e=O.current;if(!e)return;const t=m.current.x*v.current.x,n=m.current.y*v.current.y;e.scrollBy(t,n)}),[]),x=Object(o.useMemo)((()=>l===Jn.TreeOrder?[...u].reverse():u),[l,u]);Object(o.useEffect)((()=>{if(i&&u.length&&y){for(const e of x){if(!1===(null==r?void 0:r(e)))continue;const n=u.indexOf(e),o=d[n];if(!o)continue;const{direction:a,speed:i}=En(e,o,y,t,f);for(const e of["x","y"])b[e][a[e]]||(i[e]=0,a[e]=0);if(i.x>0||i.y>0)return h(),O.current=e,g(w,c),m.current=i,void(v.current=a)}m.current={x:0,y:0},v.current={x:0,y:0},h()}else h()}),[t,w,r,h,i,c,JSON.stringify(y),JSON.stringify(b),g,u,x,d,JSON.stringify(f)])}({...W,delta:C,draggingRect:fe,pointerCoordinates:le,scrollableAncestors:ae,scrollableAncestorRects:ie});const xe=Object(o.useMemo)((()=>({active:D,activeNode:G,activeNodeRect:X,activatorEvent:P,collisions:be,containerNodeRect:Y,dragOverlay:Z,draggableNodes:E,droppableContainers:S,droppableRects:F,over:he,measureDroppableContainers:U,scrollableAncestors:ae,scrollableAncestorRects:ie,measuringConfiguration:z,measuringScheduled:V,windowRect:oe})),[D,G,X,P,be,Y,Z,E,S,F,he,U,ae,ie,z,V,oe]),je=Object(o.useMemo)((()=>({activatorEvent:P,activators:we,active:D,activeNodeRect:X,ariaDescribedById:{draggable:L},dispatch:v,draggableNodes:E,over:he,measureDroppableContainers:U})),[P,we,D,X,v,L,E,he,U]);return a.a.createElement(Xt.Provider,{value:O},a.a.createElement(hr.Provider,{value:je},a.a.createElement(mr.Provider,{value:xe},a.a.createElement(wr.Provider,{value:ve},u)),a.a.createElement(Or,{disabled:!1===(null==l?void 0:l.restoreFocus)})),a.a.createElement(Jt,{...l,hiddenTextDescribedById:L}))})),kr=Object(o.createContext)(null),Er="button",Cr="Droppable";const Sr={timeout:25},_r=({transform:e})=>({...e,x:0});function Rr(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Dr(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function Mr(e){return null!==e&&e>=0}const Ar=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=Rr(t,r,n),i=t[o],c=a[o];return c&&i?{x:c.left-i.left,y:c.top-i.top,scaleX:c.width/i.width,scaleY:c.height/i.height}:null},Tr={scaleX:1,scaleY:1},Pr=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:a,overIndex:i}=e;const c=null!=(t=a[n])?t:r;if(!c)return null;if(o===n){const e=a[i];return e?{x:0,y:n<i?e.top+e.height-(c.top+c.height):e.top-c.top,...Tr}:null}const l=function(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];return r?n<t?o?r.top-(o.top+o.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}(a,o,n);return o>n&&o<=i?{x:0,y:-c.height-l,...Tr}:o<n&&o>=i?{x:0,y:c.height+l,...Tr}:{x:0,y:0,...Tr}},Nr="Sortable",Ir=a.a.createContext({activeIndex:-1,containerId:Nr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ar,disabled:{draggable:!1,droppable:!1}});function Lr(e){let{children:t,id:n,items:r,strategy:i=Ar,disabled:c=!1}=e;const{active:l,dragOverlay:s,droppableRects:u,over:d,measureDroppableContainers:p}=Object(o.useContext)(mr),f=Nt(Nr,n),b=Boolean(null!==s.rect),g=Object(o.useMemo)((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),h=null!=l,m=l?g.indexOf(l.id):-1,v=d?g.indexOf(d.id):-1,y=Object(o.useRef)(g),O=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(g,y.current),w=-1!==v&&-1===m||O,x=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);_t((()=>{O&&h&&p(g)}),[O,g,h,p]),Object(o.useEffect)((()=>{y.current=g}),[g]);const j=Object(o.useMemo)((()=>({activeIndex:m,containerId:f,disabled:x,disableTransforms:w,items:g,overIndex:v,useDragOverlay:b,sortedRects:Dr(g,u),strategy:i})),[m,f,x.draggable,x.droppable,w,g,v,u,b,i]);return a.a.createElement(Ir.Provider,{value:j},t)}const $r=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Rr(n,r,o).indexOf(t)},zr=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:i,previousItems:c,previousContainerId:l,transition:s}=e;return!(!s||!r||c!==a&&o===i||!n&&(i===o||t!==l))},Br={duration:200,easing:"ease"},Fr="transform",Ur=Ft.Transition.toString({property:Fr,duration:0,easing:"linear"}),Vr={roleDescription:"sortable"};function Gr(e){let{animateLayoutChanges:t=zr,attributes:n,disabled:r,data:a,getNewIndex:i=$r,id:c,strategy:l,resizeObserverConfig:s,transition:u=Br}=e;const{items:d,containerId:p,activeIndex:f,disabled:b,disableTransforms:g,sortedRects:h,overIndex:m,useDragOverlay:v,strategy:y}=Object(o.useContext)(Ir),O=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,b),w=d.indexOf(c),x=Object(o.useMemo)((()=>({sortable:{containerId:p,index:w,items:d},...a})),[p,a,w,d]),j=Object(o.useMemo)((()=>d.slice(d.indexOf(c))),[d,c]),{rect:k,node:E,isOver:C,setNodeRef:S}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const i=Nt("Droppable"),{active:c,dispatch:l,over:s,measureDroppableContainers:u}=Object(o.useContext)(hr),d=Object(o.useRef)({disabled:n}),p=Object(o.useRef)(!1),f=Object(o.useRef)(null),b=Object(o.useRef)(null),{disabled:g,updateMeasurementsFor:h,timeout:m}={...Sr,...a},v=Dt(null!=h?h:r),y=rr({callback:Object(o.useCallback)((()=>{p.current?(null!=b.current&&clearTimeout(b.current),b.current=setTimeout((()=>{u(Array.isArray(v.current)?v.current:[v.current]),b.current=null}),m)):p.current=!0}),[m]),disabled:g||!c}),O=Object(o.useCallback)(((e,t)=>{y&&(t&&(y.unobserve(t),p.current=!1),e&&y.observe(e))}),[y]),[w,x]=At(O),j=Dt(t);return Object(o.useEffect)((()=>{y&&w.current&&(y.disconnect(),p.current=!1,y.observe(w.current))}),[w,y]),_t((()=>(l({type:Zt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:f,data:j}}),()=>l({type:Zt.UnregisterDroppable,key:i,id:r}))),[r]),Object(o.useEffect)((()=>{n!==d.current.disabled&&(l({type:Zt.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)}),[r,i,n,l]),{active:c,rect:f,isOver:(null==s?void 0:s.id)===r,node:w,over:s,setNodeRef:x}}({id:c,data:x,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...s}}),{active:_,activatorEvent:R,activeNodeRect:D,attributes:M,setNodeRef:A,listeners:T,isDragging:P,over:N,setActivatorNodeRef:I,transform:L}=function(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const i=Nt(Cr),{activators:c,activatorEvent:l,active:s,activeNodeRect:u,ariaDescribedById:d,draggableNodes:p,over:f}=Object(o.useContext)(hr),{role:b=Er,roleDescription:g="draggable",tabIndex:h=0}=null!=a?a:{},m=(null==s?void 0:s.id)===t,v=Object(o.useContext)(m?wr:kr),[y,O]=At(),[w,x]=At(),j=function(e,t){return Object(o.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(c,t),k=Dt(n);return _t((()=>(p.set(t,{id:t,key:i,node:y,activatorNode:w,data:k}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]),{active:s,activatorEvent:l,activeNodeRect:u,attributes:Object(o.useMemo)((()=>({role:b,tabIndex:h,"aria-disabled":r,"aria-pressed":!(!m||b!==Er)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable})),[r,b,h,m,g,d.draggable]),isDragging:m,listeners:r?void 0:j,node:y,over:f,setNodeRef:O,setActivatorNodeRef:x,transform:v}}({id:c,data:x,attributes:{...Vr,...n},disabled:O.draggable}),$=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object(o.useMemo)((()=>e=>{t.forEach((t=>t(e)))}),t)}(S,A),z=Boolean(_),B=z&&!g&&Mr(f)&&Mr(m),F=!v&&P,U=F&&B?L:null,V=B?null!=U?U:(null!=l?l:y)({rects:h,activeNodeRect:D,activeIndex:f,overIndex:m,index:w}):null,G=Mr(f)&&Mr(m)?i({id:c,items:d,activeIndex:f,overIndex:m}):w,H=null==_?void 0:_.id,W=Object(o.useRef)({activeId:H,items:d,newIndex:G,containerId:p}),q=d!==W.current.items,X=t({active:_,containerId:p,isDragging:P,isSorting:z,id:c,index:w,items:d,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:u,wasDragging:null!=W.current.activeId}),Y=function(e){let{disabled:t,index:n,node:r,rect:a}=e;const[i,c]=Object(o.useState)(null),l=Object(o.useRef)(n);return _t((()=>{if(!t&&n!==l.current&&r.current){const e=a.current;if(e){const t=fn(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&c(n)}}n!==l.current&&(l.current=n)}),[t,n,r,a]),Object(o.useEffect)((()=>{i&&c(null)}),[i]),i}({disabled:!X,index:w,node:E,rect:k});return Object(o.useEffect)((()=>{z&&W.current.newIndex!==G&&(W.current.newIndex=G),p!==W.current.containerId&&(W.current.containerId=p),d!==W.current.items&&(W.current.items=d)}),[z,G,p,d]),Object(o.useEffect)((()=>{if(H===W.current.activeId)return;if(H&&!W.current.activeId)return void(W.current.activeId=H);const e=setTimeout((()=>{W.current.activeId=H}),50);return()=>clearTimeout(e)}),[H]),{active:_,activeIndex:f,attributes:M,data:x,rect:k,index:w,newIndex:G,items:d,isOver:C,isSorting:z,isDragging:P,listeners:T,node:E,overIndex:m,over:N,setNodeRef:$,setActivatorNodeRef:I,setDroppableNodeRef:S,setDraggableNodeRef:A,transform:null!=Y?Y:V,transition:Y||q&&W.current.newIndex===w?Ur:F&&!zt(R)||!u?void 0:z||X?Ft.Transition.toString({...u,property:Fr}):void 0}}Pn.Down,Pn.Right,Pn.Up,Pn.Left;const Hr=({children:e,id:t})=>{const{attributes:n,listeners:o,transform:a,transition:i,setNodeRef:c}=Gr({id:t}),l={transform:Ft.Transform.toString(a),transition:i};return Object(r.createElement)("tr",{ref:c,style:l},Object(r.createElement)(r.Fragment,null,Object(r.createElement)("td",{style:{width:"1%"}},Object(r.createElement)(mt,{icon:yt,size:14,className:"sortable-table__handle",...n,...o})),e))},Wr=Ne.table`
|
|
background: #fff;
|
|
border: 0;
|
|
border-radius: 3px;
|
|
box-shadow: 0 0 0 1px rgb( 0 0 0 / 10% );
|
|
border-spacing: 0;
|
|
width: 100%;
|
|
clear: both;
|
|
margin: 0;
|
|
font-size: 14px;
|
|
|
|
.align-left {
|
|
text-align: left;
|
|
.components-flex {
|
|
justify-content: flex-start;
|
|
gap: 0;
|
|
}
|
|
}
|
|
.align-right {
|
|
text-align: right;
|
|
.components-flex {
|
|
justify-content: flex-end;
|
|
gap: 0;
|
|
}
|
|
}
|
|
.align-center {
|
|
text-align: center;
|
|
> * {
|
|
margin: 0 auto;
|
|
}
|
|
.components-flex {
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
.sortable-table__handle {
|
|
cursor: move;
|
|
}
|
|
|
|
th {
|
|
position: relative;
|
|
color: #2c3338;
|
|
text-align: left;
|
|
vertical-align: middle;
|
|
vertical-align: top;
|
|
word-wrap: break-word;
|
|
}
|
|
|
|
tbody {
|
|
td {
|
|
vertical-align: top;
|
|
margin-bottom: 9px;
|
|
}
|
|
}
|
|
|
|
tfoot {
|
|
td {
|
|
text-align: left;
|
|
vertical-align: middle;
|
|
}
|
|
}
|
|
|
|
thead,
|
|
tfoot,
|
|
tbody {
|
|
td,
|
|
th {
|
|
border-top: 1px solid rgb( 0 0 0 / 10% );
|
|
border-bottom: 1px solid rgb( 0 0 0 / 10% );
|
|
padding: 16px 0 16px 24px;
|
|
line-height: 1.5;
|
|
|
|
&:last-child {
|
|
padding-right: 24px;
|
|
}
|
|
|
|
> svg,
|
|
> .components-base-control {
|
|
margin: 3px 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
thead th {
|
|
border-top: 0;
|
|
}
|
|
|
|
tfoot td {
|
|
border-bottom: 0;
|
|
}
|
|
`,qr=({columns:e,data:t,setData:n,className:a,footerContent:i,placeholder:c})=>{const l=Object(r.useMemo)((()=>t.map((({id:e})=>e))),[t]),s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object(o.useMemo)((()=>[...t].filter((e=>null!=e))),[...t])}(en(qn,{}),en(Yn,{}),en(zn,{})),u=(e,t)=>{const n=(null==e?void 0:e.align)||"left",r=(null==e?void 0:e.width)||"auto";return{className:`${t}-${e.name} align-${n}`,style:{width:r}}};return Object(r.createElement)(jr,{sensors:s,onDragEnd:function(e){const{active:r,over:o}=e;if(null!==r&&null!==o&&(null==r?void 0:r.id)!==(null==o?void 0:o.id)){const e=Rr(t,l.indexOf(r.id),l.indexOf(o.id));n(e)}},collisionDetection:an,modifiers:[_r]},Object(r.createElement)(Wr,{className:`${a} sortable-table`},Object(r.createElement)("thead",null,Object(r.createElement)("tr",null,e.map(((e,t)=>Object(r.createElement)("th",{key:e.name,...u(e,"sortable-table__column"),colSpan:0===t?2:1},e.label))))),i&&Object(r.createElement)("tfoot",null,Object(r.createElement)("tr",null,Object(r.createElement)("td",{colSpan:e.length+1},Object(r.createElement)(i,null)))),Object(r.createElement)("tbody",null,Object(r.createElement)(Lr,{items:l,strategy:Pr},t.length?t.map((t=>t&&Object(r.createElement)(Hr,{key:t.id,id:t.id,className:a},e.map((e=>{return Object(r.createElement)("td",{key:`${t.id}-${e.name}`,...u(e,"sortable-table__column")},e.renderCallback?e.renderCallback(t):Object(r.createElement)(r.Fragment,null,(n=t,o=e.name,nt(n)&&o in n&&t[e.name])));var n,o}))))):Object(r.createElement)("tr",null,Object(r.createElement)("td",{colSpan:e.length+1},c))))))},Xr=Ne(Ue.Modal)`
|
|
max-width: 600px;
|
|
border-radius: 4px;
|
|
@media ( min-width: 600px ) {
|
|
min-width: 560px;
|
|
}
|
|
|
|
.components-modal__header {
|
|
padding: 12px 24px;
|
|
border-bottom: 1px solid #e0e0e0;
|
|
position: relative;
|
|
height: auto;
|
|
width: auto;
|
|
margin: 0 -24px 16px;
|
|
|
|
@media ( max-width: 599px ) {
|
|
button {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
.components-modal__content {
|
|
margin: 0;
|
|
padding: 0 24px;
|
|
|
|
@media ( max-width: 599px ) {
|
|
display: flex;
|
|
flex-direction: column;
|
|
|
|
hr:last-of-type {
|
|
margin-top: auto;
|
|
}
|
|
}
|
|
|
|
.components-base-control {
|
|
label {
|
|
margin-top: 8px;
|
|
text-transform: none !important;
|
|
}
|
|
}
|
|
}
|
|
`,Yr=Ne.div`
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
border-top: 1px solid #e0e0e0;
|
|
margin: 24px -24px 0;
|
|
padding: 24px;
|
|
|
|
> * {
|
|
&:not( :first-of-type ) {
|
|
margin-left: 8px;
|
|
}
|
|
}
|
|
|
|
.button-link-delete {
|
|
margin-right: auto;
|
|
color: #d63638;
|
|
}
|
|
`;var Kr=({children:e,actions:t,title:n,onRequestClose:o,...a})=>Object(r.createElement)(Xr,{title:n,onRequestClose:o,...a},e,Object(r.createElement)(Yr,null,t)),Jr=({formRef:e,values:t,setValues:n})=>{const{country:o,state:a}=t.address,i=e=>t=>{n((n=>({...n,[e]:t})))},c=e=>t=>{n((n=>({...n,address:{...n.address,[e]:t}})))},l=st[o]&&Object.keys(st[o]).length>0;return Object(r.createElement)("form",{ref:e},Object(r.createElement)(Ue.TextControl,{label:Object(Ie.__)("Location name","woocommerce"),name:"location_name",value:t.name,onChange:i("name"),autoComplete:"off",required:!0,onInvalid:e=>{e.target.setCustomValidity(Object(Ie.__)("A Location title is required","woocommerce"))},onInput:e=>{e.target.setCustomValidity("")}}),Object(r.createElement)(Ue.TextControl,{label:Object(Ie.__)("Address","woocommerce"),name:"location_address",placeholder:Object(Ie.__)("Address","woocommerce"),value:t.address.address_1,onChange:c("address_1"),autoComplete:"off"}),Object(r.createElement)(Ue.TextControl,{label:Object(Ie.__)("City","woocommerce"),name:"location_city",hideLabelFromVision:!0,placeholder:Object(Ie.__)("City","woocommerce"),value:t.address.city,onChange:c("city"),autoComplete:"off"}),Object(r.createElement)(Ue.TextControl,{label:Object(Ie.__)("Postcode / ZIP","woocommerce"),name:"location_postcode",hideLabelFromVision:!0,placeholder:Object(Ie.__)("Postcode / ZIP","woocommerce"),value:t.address.postcode,onChange:c("postcode"),autoComplete:"off"}),!l&&Object(r.createElement)(Ue.TextControl,{placeholder:Object(Ie.__)("State","woocommerce"),value:a,onChange:c("state")}),Object(r.createElement)(Ue.SelectControl,{name:"location_country_state",label:Object(Ie.__)("Country / State","woocommerce"),hideLabelFromVision:!0,placeholder:Object(Ie.__)("Country / State","woocommerce"),value:!a&&l?`${o}:${Object.keys(st[o])[0]}`:`${o}${a&&null!==(s=st[o])&&void 0!==s&&s[a]?":"+a:""}`,onChange:e=>{const[t,n=""]=e.split(":");c("country")(t),c("state")(n)}},ut.options.map((e=>e.label?Object(r.createElement)("optgroup",{key:e.label,label:e.label},e.options.map((e=>Object(r.createElement)("option",{key:e.value,value:e.value},e.label)))):Object(r.createElement)("option",{key:e.options[0].value,value:e.options[0].value},e.options[0].label)))),Object(r.createElement)(Ue.TextControl,{label:Object(Ie.__)("Pickup details","woocommerce"),name:"pickup_details",value:t.details,onChange:i("details"),autoComplete:"off"}));var s},Zr=({locationData:e,editingLocation:t,onClose:n,onSave:o,onDelete:a})=>{const i=Object(r.useRef)(null),[c,l]=Object(r.useState)(e);return e?Object(r.createElement)(Kr,{onRequestClose:n,title:"new"===t?Object(Ie.__)("Pickup location","woocommerce"):Object(Ie.__)("Edit pickup location","woocommerce"),actions:Object(r.createElement)(r.Fragment,null,"new"!==t&&Object(r.createElement)(Ue.Button,{variant:"link",className:"button-link-delete",onClick:()=>{a(),n()}},Object(Ie.__)("Delete location","woocommerce")),Object(r.createElement)(Ue.Button,{variant:"secondary",onClick:n},Object(Ie.__)("Cancel","woocommerce")),Object(r.createElement)(Ue.Button,{variant:"primary",onClick:()=>{(null==i?void 0:i.current).reportValidity()&&(o(c),n())}},Object(Ie.__)("Done","woocommerce")))},Object(r.createElement)(Jr,{formRef:i,values:c,setValues:l})):null};const Qr=()=>Object(r.createElement)(r.Fragment,null,Object(r.createElement)("h2",null,Object(Ie.__)("Pickup locations","woocommerce")),Object(r.createElement)("p",null,Object(Ie.__)("Define pickup locations for your customers to choose from during checkout.","woocommerce")),Object(r.createElement)(Ue.ExternalLink,{href:"https://woocommerce.com/document/local-pickup/"},Object(Ie.__)("Learn more","woocommerce"))),eo=Ne.address`
|
|
color: #757575;
|
|
font-style: normal;
|
|
display: inline;
|
|
margin-left: 12px;
|
|
`;var to=()=>{const{pickupLocations:e,setPickupLocations:t,toggleLocation:n,updateLocation:o,readOnlySettings:a}=pt(),[i,c]=Object(r.useState)(""),l=[{name:"name",label:Object(Ie.__)("Pickup location","woocommerce"),width:"50%",renderCallback:e=>Object(r.createElement)(r.Fragment,null,e.name,Object(r.createElement)(eo,null,(e=>{var t;const n=nt(e)&&{...e,country:"string"==typeof e.country&<[e.country],state:"string"==typeof e.country&&"string"==typeof e.state&&null!==(t=st[e.country])&&void 0!==t&&t[e.state]?st[e.country][e.state]:e.state};return Object.values(n).filter((e=>""!==e)).join(", ")})(e.address)))},{name:"enabled",label:Object(Ie.__)("Enabled","woocommerce"),align:"right",renderCallback:e=>{return Object(r.createElement)(Ue.ToggleControl,{checked:(t=e.enabled,"boolean"==typeof t&&e.enabled),onChange:()=>n(e.id)});var t}},{name:"edit",label:"",align:"center",width:"1%",renderCallback:e=>Object(r.createElement)("button",{type:"button",className:"button-link-edit button-link",onClick:()=>{c(e.id)}},Object(Ie.__)("Edit","woocommerce"))}];return Object(r.createElement)(We,{Description:Qr},Object(r.createElement)(qr,{className:"pickup-locations",columns:l,data:e,setData:e=>{t(e)},placeholder:Object(Ie.__)("When you add a pickup location, it will appear here.","woocommerce"),footerContent:()=>Object(r.createElement)(Ue.Button,{variant:"secondary",onClick:()=>{c("new")}},Object(Ie.__)("Add pickup location","woocommerce"))}),i&&Object(r.createElement)(Zr,{locationData:"new"===i?{name:"",details:"",enabled:!0,address:{address_1:"",city:"",state:a.storeState,postcode:"",country:a.storeCountry}}:e.find((({id:e})=>e===i))||null,editingLocation:i,onSave:e=>{o(i,e)},onClose:()=>c(""),onDelete:()=>{o(i,null),c("")}}))};const no=Ne(We)`
|
|
text-align: right;
|
|
padding-top: 0;
|
|
margin-top: 0;
|
|
`;var ro=()=>{const{isSaving:e,save:t}=pt();return Object(r.createElement)(no,{className:"submit"},Object(r.createElement)(Ue.Button,{variant:"primary",isBusy:e,disabled:e,onClick:e=>{var n;e.preventDefault();const r=e.target;null!=r&&null!==(n=r.form)&&void 0!==n&&n.reportValidity()&&t()},type:"submit"},Object(Ie.__)("Save changes","woocommerce")))};const oo=Ne.form`
|
|
margin: 48px auto 0;
|
|
max-width: 1032px;
|
|
display: flex;
|
|
flex-flow: column;
|
|
|
|
@media ( min-width: 960px ) {
|
|
padding: 0 56px;
|
|
}
|
|
`;const ao=document.getElementById("wc-shipping-method-pickup-location-settings-container");ao&&Object(r.render)(Object(r.createElement)((()=>Object(r.createElement)(oo,{id:"local-pickup-settings"},Object(r.createElement)(ft,null,Object(r.createElement)(ht,null),Object(r.createElement)(to,null),Object(r.createElement)(ro,null)))),null),ao)}]); |