whoami7 - Manager
:
/
home
/
qbizpnmr
/
preflap.com
/
wp-content
/
plugins
/
templately
/
assets
/
js
/
Upload File:
files >> /home/qbizpnmr/preflap.com/wp-content/plugins/templately/assets/js/templately.js
(()=>{var e,t,n={47:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1635),o=n(1609),i=r.__importDefault(n(9905));t.default=function(e){var t=o.useRef(0),n=o.useState(e),r=n[0],a=n[1],l=o.useCallback(function(e){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){a(e)})},[]);return i.default(function(){cancelAnimationFrame(t.current)}),[r,l]}},76:e=>{"use strict";e.exports=Function.prototype.call},124:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkValuesAgainstBoundaries=t.relativeValue=t.useThumbOverlap=t.Direction=t.getTrackBackground=t.Range=void 0;var o=r(n(465));t.Range=o.default;var i=n(1813);Object.defineProperty(t,"getTrackBackground",{enumerable:!0,get:function(){return i.getTrackBackground}}),Object.defineProperty(t,"useThumbOverlap",{enumerable:!0,get:function(){return i.useThumbOverlap}}),Object.defineProperty(t,"relativeValue",{enumerable:!0,get:function(){return i.relativeValue}}),Object.defineProperty(t,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return i.checkValuesAgainstBoundaries}});var a=n(8105);Object.defineProperty(t,"Direction",{enumerable:!0,get:function(){return a.Direction}})},251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.populateSlidesOnMouseTouchMove=function(e,t,n,r,o,i){var a,l,s=e.itemWidth,c=e.slidesToShow,u=e.totalItems,d=e.currentSlide,p=t.infinite,h=!1,f=Math.round((n-r)/s),m=Math.round((r-n)/s),g=n<o;if(o<n&&f<=c){a="right";var v=Math.abs(-s*(u-c)),y=i-(r-o),b=d===u-c;(Math.abs(y)<=v||b&&p)&&(l=y,h=!0)}return g&&m<=c&&(a="left",((y=i+(o-r))<=0||0===d&&p)&&(h=!0,l=y)),{direction:a,nextPosition:l,canContinue:h}}},308:(e,t,n)=>{var r=n(1609),o=n(840),i=n(4958),a=i.setStyleProp,l=i.canTextBeChildOfNode;function s(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&i.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var i,c,u,d,p,h=(n=n||{}).library||r,f=h.cloneElement,m=h.createElement,g=h.isValidElement,v=[],y="function"==typeof n.replace,b=n.trim,w=0,k=t.length;w<k;w++)if(i=t[w],y&&g(u=n.replace(i)))k>1&&(u=f(u,{key:u.key||w})),v.push(u);else if("text"!==i.type){switch(d=i.attribs,s(i)?a(d.style,d):d&&(d=o(d,i.name)),p=null,i.type){case"script":case"style":i.children[0]&&(d.dangerouslySetInnerHTML={__html:i.children[0].data});break;case"tag":"textarea"===i.name&&i.children[0]?d.defaultValue=i.children[0].data:i.children&&i.children.length&&(p=e(i.children,n));break;default:continue}k>1&&(d.key=w),v.push(m(i.name,d,p))}else{if((c=!i.data.trim().length)&&i.parent&&!l(i.parent))continue;if(b&&c)continue;v.push(i.data)}return 1===v.length?v[0]:v}},312:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(1720))&&r.__esModule?r:{default:r};t.default=o.default,e.exports=t.default},411:(e,t,n)=>{var r;!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},414:e=>{"use strict";e.exports=Math.round},453:(e,t,n)=>{"use strict";var r,o=n(9612),i=n(9383),a=n(1237),l=n(9290),s=n(9538),c=n(8068),u=n(9675),d=n(5345),p=n(1514),h=n(8968),f=n(6188),m=n(8002),g=n(5880),v=n(414),y=n(3093),b=Function,w=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},k=n(8176),E=n(655),O=function(){throw new u},x=k?function(){try{return O}catch(e){try{return k(arguments,"callee").get}catch(e){return O}}}():O,S=n(4039)(),_=n(3628),C=n(1064),P=n(8648),T=n(1002),A=n(76),M={},N="undefined"!=typeof Uint8Array&&_?_(Uint8Array):r,D={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":S&&_?_([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":M,"%AsyncGenerator%":M,"%AsyncGeneratorFunction%":M,"%AsyncIteratorPrototype%":M,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":M,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&_?_(_([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&S&&_?_((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":k,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":l,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&S&&_?_((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&_?_(""[Symbol.iterator]()):r,"%Symbol%":S?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":x,"%TypedArray%":N,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":T,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":C,"%Math.abs%":p,"%Math.floor%":h,"%Math.max%":f,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":v,"%Math.sign%":y,"%Reflect.getPrototypeOf%":P};if(_)try{null.error}catch(e){var I=_(_(e));D["%Error.prototype%"]=I}var L=function e(t){var n;if("%AsyncFunction%"===t)n=w("async function () {}");else if("%GeneratorFunction%"===t)n=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=w("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&_&&(n=_(o.prototype))}return D[t]=n,n},R={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},j=n(6743),F=n(9957),z=j.call(A,Array.prototype.concat),B=j.call(T,Array.prototype.splice),W=j.call(A,String.prototype.replace),U=j.call(A,String.prototype.slice),V=j.call(A,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,Q=function(e,t){var n,r=e;if(F(R,r)&&(r="%"+(n=R[r])[0]+"%"),F(D,r)){var o=D[r];if(o===M&&(o=L(r)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=U(e,0,1),n=U(e,-1);if("%"===t&&"%"!==n)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return W(e,H,function(e,t,n,o){r[r.length]=n?W(o,q,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=Q("%"+r+"%",t),i=o.name,a=o.value,l=!1,s=o.alias;s&&(r=s[0],B(n,z([0,1],s)));for(var d=1,p=!0;d<n.length;d+=1){var h=n[d],f=U(h,0,1),m=U(h,-1);if(('"'===f||"'"===f||"`"===f||'"'===m||"'"===m||"`"===m)&&f!==m)throw new c("property names with quotes must have matching quotes");if("constructor"!==h&&p||(l=!0),F(D,i="%"+(r+="."+h)+"%"))a=D[i];else if(null!=a){if(!(h in a)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(k&&d+1>=n.length){var g=k(a,h);a=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[h]}else p=F(a,h),a=a[h];p&&!l&&(D[i]=a)}}return a}},465:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return a(t,e),t},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var c=l(n(1609)),u=n(1813),d=n(8105),p=["ArrowRight","ArrowUp","k","PageUp"],h=["ArrowLeft","ArrowDown","j","PageDown"],f=function(e){function t(t){var n=e.call(this,t)||this;if(n.trackRef=c.createRef(),n.thumbRefs=[],n.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(n.props.values.length).fill(0).map(function(e,t){return t}),isChanged:!1,markOffsets:[]},n.getOffsets=function(){var e=n.props,t=e.direction,r=e.values,o=e.min,i=e.max,a=n.trackRef.current;if(!a)return console.warn("No track element found."),[];var l=a.getBoundingClientRect(),s=(0,u.getPaddingAndBorder)(a);return n.getThumbs().map(function(e,n){var a={x:0,y:0},c=e.getBoundingClientRect(),p=(0,u.getMargin)(e);switch(t){case d.Direction.Right:return a.x=-1*(p.left+s.left),a.y=-1*((c.height-l.height)/2+s.top),a.x+=l.width*(0,u.relativeValue)(r[n],o,i)-c.width/2,a;case d.Direction.Left:return a.x=-1*(p.right+s.right),a.y=-1*((c.height-l.height)/2+s.top),a.x+=l.width-l.width*(0,u.relativeValue)(r[n],o,i)-c.width/2,a;case d.Direction.Up:return a.x=-1*((c.width-l.width)/2+p.left+s.left),a.y=-s.left,a.y+=l.height-l.height*(0,u.relativeValue)(r[n],o,i)-c.height/2,a;case d.Direction.Down:return a.x=-1*((c.width-l.width)/2+p.left+s.left),a.y=-s.left,a.y+=l.height*(0,u.relativeValue)(r[n],o,i)-c.height/2,a;default:return(0,u.assertUnreachable)(t)}})},n.getThumbs=function(){return n.trackRef&&n.trackRef.current?Array.from(n.trackRef.current.children).filter(function(e){return e.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},n.getTargetIndex=function(e){return n.getThumbs().findIndex(function(t){return t===e.target||t.contains(e.target)})},n.addTouchEvents=function(e){document.addEventListener("touchmove",n.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",n.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",n.schdOnEnd,{passive:!1})},n.addMouseEvents=function(e){document.addEventListener("mousemove",n.schdOnMouseMove),document.addEventListener("mouseup",n.schdOnEnd)},n.onMouseDownTrack=function(e){var t;if(0===e.button&&!(0,u.isIOS)())if(e.persist(),e.preventDefault(),n.addMouseEvents(e.nativeEvent),n.props.values.length>1&&n.props.draggableTrack){if(n.thumbRefs.some(function(t){var n;return null===(n=t.current)||void 0===n?void 0:n.contains(e.target)}))return;n.setState({draggedTrackPos:[e.clientX,e.clientY]},function(){return n.onMove(e.clientX,e.clientY)})}else{var r=(0,u.getClosestThumbIndex)(n.thumbRefs.map(function(e){return e.current}),e.clientX,e.clientY,n.props.direction);null===(t=n.thumbRefs[r].current)||void 0===t||t.focus(),n.setState({draggedThumbIndex:r},function(){return n.onMove(e.clientX,e.clientY)})}},n.onResize=function(){(0,u.translateThumbs)(n.getThumbs(),n.getOffsets(),n.props.rtl),n.calculateMarkOffsets()},n.onTouchStartTrack=function(e){var t;if(e.persist(),n.addTouchEvents(e.nativeEvent),n.props.values.length>1&&n.props.draggableTrack){if(n.thumbRefs.some(function(t){var n;return null===(n=t.current)||void 0===n?void 0:n.contains(e.target)}))return;n.setState({draggedTrackPos:[e.touches[0].clientX,e.touches[0].clientY]},function(){return n.onMove(e.touches[0].clientX,e.touches[0].clientY)})}else{var r=(0,u.getClosestThumbIndex)(n.thumbRefs.map(function(e){return e.current}),e.touches[0].clientX,e.touches[0].clientY,n.props.direction);null===(t=n.thumbRefs[r].current)||void 0===t||t.focus(),n.setState({draggedThumbIndex:r},function(){return n.onMove(e.touches[0].clientX,e.touches[0].clientY)})}},n.onMouseOrTouchStart=function(e){if(!n.props.disabled){var t=(0,u.isTouchEvent)(e);if(t||0===e.button){var r=n.getTargetIndex(e);-1!==r&&(t?n.addTouchEvents(e):n.addMouseEvents(e),n.setState({draggedThumbIndex:r,thumbZIndexes:n.state.thumbZIndexes.map(function(e,t){return t===r?Math.max.apply(Math,n.state.thumbZIndexes):e<=n.state.thumbZIndexes[r]?e:e-1})}))}}},n.onMouseMove=function(e){e.preventDefault(),n.onMove(e.clientX,e.clientY)},n.onTouchMove=function(e){e.preventDefault(),n.onMove(e.touches[0].clientX,e.touches[0].clientY)},n.onKeyDown=function(e){var t=n.props,r=t.values,o=t.onChange,i=t.step,a=t.rtl,l=t.direction,s=n.state.isChanged,c=n.getTargetIndex(e.nativeEvent),f=a||l===d.Direction.Left||l===d.Direction.Down?-1:1;-1!==c&&(p.includes(e.key)?(e.preventDefault(),n.setState({draggedThumbIndex:c,isChanged:!0}),o((0,u.replaceAt)(r,c,n.normalizeValue(r[c]+f*("PageUp"===e.key?10*i:i),c)))):h.includes(e.key)?(e.preventDefault(),n.setState({draggedThumbIndex:c,isChanged:!0}),o((0,u.replaceAt)(r,c,n.normalizeValue(r[c]-f*("PageDown"===e.key?10*i:i),c)))):"Tab"===e.key?n.setState({draggedThumbIndex:-1},function(){s&&n.fireOnFinalChange()}):s&&n.fireOnFinalChange())},n.onKeyUp=function(e){var t=n.state.isChanged;n.setState({draggedThumbIndex:-1},function(){t&&n.fireOnFinalChange()})},n.onMove=function(e,t){var r=n.state,o=r.draggedThumbIndex,i=r.draggedTrackPos,a=n.props,l=a.direction,s=a.min,c=a.max,p=a.onChange,h=a.values,f=a.step,m=a.rtl;if(-1===o&&-1===i[0]&&-1===i[1])return null;var g=n.trackRef.current;if(!g)return null;var v=g.getBoundingClientRect(),y=(0,u.isVertical)(l)?v.height:v.width;if(-1!==i[0]&&-1!==i[1]){var b=e-i[0],w=t-i[1],k=0;switch(l){case d.Direction.Right:case d.Direction.Left:k=b/y*(c-s);break;case d.Direction.Down:case d.Direction.Up:k=w/y*(c-s);break;default:(0,u.assertUnreachable)(l)}if(m&&(k*=-1),Math.abs(k)>=f/2){for(var E=0;E<n.thumbRefs.length;E++){if(h[E]===c&&1===Math.sign(k)||h[E]===s&&-1===Math.sign(k))return;var O=h[E]+k;O>c?k=c-h[E]:O<s&&(k=s-h[E])}var x=h.slice(0);for(E=0;E<n.thumbRefs.length;E++)x=(0,u.replaceAt)(x,E,n.normalizeValue(h[E]+k,E));n.setState({draggedTrackPos:[e,t]}),p(x)}}else{var S=0;switch(l){case d.Direction.Right:S=(e-v.left)/y*(c-s)+s;break;case d.Direction.Left:S=(y-(e-v.left))/y*(c-s)+s;break;case d.Direction.Down:S=(t-v.top)/y*(c-s)+s;break;case d.Direction.Up:S=(y-(t-v.top))/y*(c-s)+s;break;default:(0,u.assertUnreachable)(l)}m&&(S=c+s-S),Math.abs(h[o]-S)>=f/2&&p((0,u.replaceAt)(h,o,n.normalizeValue(S,o)))}},n.normalizeValue=function(e,t){var r=n.props,o=r.min,i=r.max,a=r.step,l=r.allowOverlap,s=r.values;return(0,u.normalizeValue)(e,t,o,i,a,l,s)},n.onEnd=function(e){if(e.preventDefault(),document.removeEventListener("mousemove",n.schdOnMouseMove),document.removeEventListener("touchmove",n.schdOnTouchMove),document.removeEventListener("mouseup",n.schdOnEnd),document.removeEventListener("touchend",n.schdOnEnd),document.removeEventListener("touchcancel",n.schdOnEnd),-1===n.state.draggedThumbIndex&&-1===n.state.draggedTrackPos[0]&&-1===n.state.draggedTrackPos[1])return null;n.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){n.fireOnFinalChange()})},n.fireOnFinalChange=function(){n.setState({isChanged:!1});var e=n.props,t=e.onFinalChange,r=e.values;t&&t(r)},n.updateMarkRefs=function(e){if(!e.renderMark)return n.numOfMarks=void 0,void(n.markRefs=void 0);n.numOfMarks=(e.max-e.min)/n.props.step,n.markRefs=[];for(var t=0;t<n.numOfMarks+1;t++)n.markRefs[t]=c.createRef()},n.calculateMarkOffsets=function(){if(n.props.renderMark&&n.trackRef&&n.numOfMarks&&n.markRefs&&null!==n.trackRef.current){for(var e=window.getComputedStyle(n.trackRef.current),t=parseInt(e.width,10),r=parseInt(e.height,10),o=parseInt(e.paddingLeft,10),i=parseInt(e.paddingTop,10),a=[],l=0;l<n.numOfMarks+1;l++){var s=9999,c=9999;if(n.markRefs[l].current){var u=n.markRefs[l].current.getBoundingClientRect();s=u.height,c=u.width}n.props.direction===d.Direction.Left||n.props.direction===d.Direction.Right?a.push([Math.round(t/n.numOfMarks*l+o-c/2),-Math.round((s-r)/2)]):a.push([Math.round(r/n.numOfMarks*l+i-s/2),-Math.round((c-t)/2)])}n.setState({markOffsets:a})}},0===t.step)throw new Error('"step" property should be a positive number');return n.schdOnMouseMove=(0,u.schd)(n.onMouseMove),n.schdOnTouchMove=(0,u.schd)(n.onTouchMove),n.schdOnEnd=(0,u.schd)(n.onEnd),n.thumbRefs=t.values.map(function(){return c.createRef()}),n.updateMarkRefs(t),n}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.values,r=t.min,o=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",e.onResize)},unobserve:function(){return window.removeEventListener("resize",e.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,u.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(t){return(0,u.checkBoundaries)(t,e.props.min,e.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,u.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),n.forEach(function(e){(0,u.isStepDivisible)(r,e,o)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},t.prototype.componentDidUpdate=function(e,t){var n=this.props,r=n.max,o=n.min,i=n.step,a=n.values,l=n.rtl;e.max===r&&e.min===o&&e.step===i||this.updateMarkRefs(this.props),(0,u.translateThumbs)(this.getThumbs(),this.getOffsets(),l),e.max===r&&e.min===o&&e.step===i&&t.markOffsets.length===this.state.markOffsets.length||(this.calculateMarkOffsets(),a.forEach(function(e){(0,u.isStepDivisible)(o,e,i)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},t.prototype.componentWillUnmount=function(){document.removeEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},t.prototype.render=function(){var e=this,t=this.props,n=t.label,r=t.labelledBy,o=t.renderTrack,i=t.renderThumb,a=t.renderMark,l=void 0===a?function(){return null}:a,c=t.values,p=t.min,h=t.max,f=t.allowOverlap,m=t.disabled,g=this.state,v=g.draggedThumbIndex,y=g.thumbZIndexes,b=g.markOffsets;return o({props:{style:{transform:"scale(1)",cursor:v>-1?"grabbing":this.props.draggableTrack?(0,u.isVertical)(this.props.direction)?"ns-resize":"ew-resize":1!==c.length||m?"inherit":"pointer"},onMouseDown:m?u.voidFn:this.onMouseDownTrack,onTouchStart:m?u.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:m,children:s(s([],b.map(function(t,n,r){return l({props:{style:e.props.direction===d.Direction.Left||e.props.direction===d.Direction.Right?{position:"absolute",left:"".concat(t[0],"px"),marginTop:"".concat(t[1],"px")}:{position:"absolute",top:"".concat(t[0],"px"),marginLeft:"".concat(t[1],"px")},key:"mark".concat(n),ref:e.markRefs[n]},index:n})}),!0),c.map(function(t,o){var a=e.state.draggedThumbIndex===o;return i({index:o,value:t,isDragged:a,props:{style:{position:"absolute",zIndex:y[o],cursor:m?"inherit":a?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:o,tabIndex:m?void 0:0,"aria-valuemax":f?h:c[o+1]||h,"aria-valuemin":f?p:c[o-1]||p,"aria-valuenow":t,draggable:!1,ref:e.thumbRefs[o],"aria-label":n,"aria-labelledby":r,role:"slider",onKeyDown:m?u.voidFn:e.onKeyDown,onKeyUp:m?u.voidFn:e.onKeyUp}})}),!0)})},t.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:d.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},t}(c.Component);t.default=f},507:(e,t,n)=>{"use strict";var r=n(453),o=n(6556),i=n(8859),a=n(9675),l=r("%Map%",!0),s=o("Map.prototype.get",!0),c=o("Map.prototype.set",!0),u=o("Map.prototype.has",!0),d=o("Map.prototype.delete",!0),p=o("Map.prototype.size",!0);e.exports=!!l&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a("Side channel does not contain "+i(e))},delete:function(t){if(e){var n=d(e,t);return 0===p(e)&&(e=void 0),n}return!1},get:function(t){if(e)return s(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,n){e||(e=new l),c(e,t,n)}};return t}},582:(e,t,n)=>{var r=n(1642);t.encode=function(e){var t,n="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),n+=r.encode(t)}while(o>0);return n},t.decode=function(e,t,n){var o,i,a,l,s=e.length,c=0,u=0;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),c+=(i&=31)<<u,u+=5}while(o);n.value=(l=(a=c)>>1,1&~a?l:-l),n.rest=t}},655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r,o=((r=n(411))&&r.__esModule?r:{default:r}).default,i=o.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=o.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=o.canUseDOM?window.NodeList:{},t.canUseDOM=o.canUseDOM,t.default=i},840:(e,t,n)=>{var r=n(4210),o=n(4958),i=["checked","value"],a=["input","select","textarea"],l={reset:!0,submit:!0};function s(e){return r.possibleStandardNames[e]}e.exports=function(e,t){var n,c,u,d,p,h={},f=(e=e||{}).type&&l[e.type];for(n in e)if(u=e[n],r.isCustomAttribute(n))h[n]=u;else if(d=s(c=n.toLowerCase()))switch(p=r.getPropertyInfo(d),-1===i.indexOf(d)||-1===a.indexOf(t)||f||(d=s("default"+c)),h[d]=u,p&&p.type){case r.BOOLEAN:h[d]=!0;break;case r.OVERLOADED_BOOLEAN:""===u&&(h[d]=!0)}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(h[n]=u);return o.setStyleProp(e.style,h),h}},920:(e,t,n)=>{"use strict";var r=n(9675),o=n(8859),i=n(4803),a=n(507),l=n(2271)||a||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r("Side channel does not contain "+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||(e=l()),e.set(t,n)}};return t}},1002:e=>{"use strict";e.exports=Function.prototype.apply},1020:(e,t,n)=>{"use strict";var r=n(1609),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:l.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},1064:(e,t,n)=>{"use strict";var r=n(9612);e.exports=r.getPrototypeOf||null},1141:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(5413),a=n(6957);o(n(6957),t);var l={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=function(){function e(e,t,n){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=l),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:l,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,r=new a.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===i.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new a.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new a.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new a.Text(""),t=new a.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new a.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=s,t.default=s},1237:e=>{"use strict";e.exports=EvalError},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},1345:(e,t,n)=>{"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==l){var s=e.displayName||e.name,c="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var u=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:()=>a}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},1514:e=>{"use strict";e.exports=Math.abs},1519:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609),o=n(7035);t.default=function(e){var t=e.props,n=e.state,i=e.goToSlide,a=e.clones,l=e.notEnoughChildren,s=n.itemWidth,c=t.children,u=t.infinite,d=t.itemClass,p=t.itemAriaLabel,h=t.partialVisbile,f=t.partialVisible,m=o.getInitialState(n,t),g=m.flexBisis,v=m.shouldRenderOnSSR,y=m.domFullyLoaded,b=m.partialVisibilityGutter;return m.shouldRenderAtAll?(h&&console.warn('WARNING: Please correct props name: "partialVisible" as old typo will be removed in future versions!'),r.createElement(r.Fragment,null,(u?a:r.Children.toArray(c)).map(function(e,a){return r.createElement("li",{key:a,"data-index":a,onClick:function(){t.focusOnSelect&&i(a)},"aria-hidden":o.getIfSlideIsVisbile(a,n)?"false":"true","aria-label":p||(e.props.ariaLabel?e.props.ariaLabel:null),style:{flex:v?"1 0 "+g+"%":"auto",position:"relative",width:y?((h||f)&&b&&!l?s-b:s)+"px":"auto"},className:"react-multi-carousel-item "+(o.getIfSlideIsVisbile(a,n)?"react-multi-carousel-item--active":"")+" "+d},e)}))):null}},1527:(e,t,n)=>{var r=n(582),o=n(8829),i=n(4361).C,a=n(6260).P;function l(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=o.getArg(e,"ignoreInvalidMapping",!1),this._sources=new i,this._names=new i,this._mappings=new a,this._sourcesContents=null}l.prototype._version=3,l.fromSourceMap=function(e,t){var n=e.sourceRoot,r=new l(Object.assign(t||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=o.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var i=t;null!==n&&(i=o.relative(n,t)),r._sources.has(i)||r._sources.add(i);var a=e.sourceContentFor(t);null!=a&&r.setSourceContent(t,a)}),r},l.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);(this._skipValidation||!1!==this._validateMapping(t,n,r,i))&&(null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i}))},l.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},l.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var a=this._sourceRoot;null!=a&&(r=o.relative(a,r));var l=new i,s=new i;this._mappings.unsortedForEach(function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=o.join(n,t.source)),null!=a&&(t.source=o.relative(a,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var c=t.source;null==c||l.has(c)||l.add(c);var u=t.name;null==u||s.has(u)||s.add(u)},this),this._sources=l,this._names=s,e.sources.forEach(function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=a&&(t=o.relative(a,t)),this.setSourceContent(t,r))},this)},l.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column){var o="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return"undefined"!=typeof console&&console.warn&&console.warn(o),!1;throw new Error(o)}if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)){if(o="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}),this._ignoreInvalidMapping)return"undefined"!=typeof console&&console.warn&&console.warn(o),!1;throw new Error(o)}},l.prototype._serializeMappings=function(){for(var e,t,n,i,a=0,l=1,s=0,c=0,u=0,d=0,p="",h=this._mappings.toArray(),f=0,m=h.length;f<m;f++){if(e="",(t=h[f]).generatedLine!==l)for(a=0;t.generatedLine!==l;)e+=";",l++;else if(f>0){if(!o.compareByGeneratedPositionsInflated(t,h[f-1]))continue;e+=","}e+=r.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=r.encode(i-d),d=i,e+=r.encode(t.originalLine-1-c),c=t.originalLine-1,e+=r.encode(t.originalColumn-s),s=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-u),u=n)),p+=e}return p},l.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},l.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},l.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.x=l},1609:e=>{"use strict";e.exports=window.React},1635:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>L,__assign:()=>i,__asyncDelegator:()=>S,__asyncGenerator:()=>x,__asyncValues:()=>_,__await:()=>O,__awaiter:()=>f,__classPrivateFieldGet:()=>N,__classPrivateFieldIn:()=>I,__classPrivateFieldSet:()=>D,__createBinding:()=>g,__decorate:()=>l,__disposeResources:()=>j,__esDecorate:()=>c,__exportStar:()=>v,__extends:()=>o,__generator:()=>m,__importDefault:()=>M,__importStar:()=>A,__makeTemplateObject:()=>C,__metadata:()=>h,__param:()=>s,__propKey:()=>d,__read:()=>b,__rest:()=>a,__rewriteRelativeImportExtension:()=>F,__runInitializers:()=>u,__setFunctionName:()=>p,__spread:()=>w,__spreadArray:()=>E,__spreadArrays:()=>k,__values:()=>y,default:()=>z});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function l(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,s=r.kind,c="getter"===s?"get":"setter"===s?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[h])("accessor"===s?{get:d.get,set:d.set}:d[c],f);if("accessor"===s){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(l=a(g.get))&&(d.get=l),(l=a(g.set))&&(d.set=l),(l=a(g.init))&&o.unshift(l)}else(l=a(g))&&("field"===s?o.unshift(l):d[c]=l)}u&&Object.defineProperty(u,r.name,d),p=!0}function u(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((r=r.apply(e,t||[])).next())})}function m(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}var g=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function v(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||g(t,e,n)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function k(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r}function E(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function O(e){return this instanceof O?(this.v=e,this):new O(e)}function x(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||l(e,t)})},t&&(r[e]=t(r[e])))}function l(e,t){try{(n=o[e](t)).value instanceof O?Promise.resolve(n.value.v).then(s,c):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function s(e){l("next",e)}function c(e){l("throw",e)}function u(e,t){e(t),i.shift(),i.length&&l(i[0][0],i[0][1])}}function S(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:O(e[r](t)),done:!1}:o?o(t):t}:o}}function _(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=y(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,o,(t=e[n](t)).done,t.value)})}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},T=function(e){return T=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},T(e)};function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=T(e),r=0;r<n.length;r++)"default"!==n[r]&&g(t,e,n[r]);return P(t,e),t}function M(e){return e&&e.__esModule?e:{default:e}}function N(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function D(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function I(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function L(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var R="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function j(e){function t(t){e.error=e.hasError?new R(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,r=0;return function o(){for(;n=e.stack.pop();)try{if(!n.async&&1===r)return r=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(i).then(o,function(e){return t(e),o()})}else r|=1}catch(e){t(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function F(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,n,r,o,i){return n?t?".jsx":".js":!r||o&&i?r+o+"."+i.toLowerCase()+"js":e}):e}const z={__extends:o,__assign:i,__rest:a,__decorate:l,__param:s,__esDecorate:c,__runInitializers:u,__propKey:d,__setFunctionName:p,__metadata:h,__awaiter:f,__generator:m,__createBinding:g,__exportStar:v,__values:y,__read:b,__spread:w,__spreadArrays:k,__spreadArray:E,__await:O,__asyncGenerator:x,__asyncDelegator:S,__asyncValues:_,__makeTemplateObject:C,__importStar:A,__importDefault:M,__classPrivateFieldGet:N,__classPrivateFieldSet:D,__classPrivateFieldIn:I,__addDisposableResource:L,__disposeResources:j,__rewriteRelativeImportExtension:F}},1642:(e,t)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},1720:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||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},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1609),a=f(i),l=f(n(5795)),s=f(n(5556)),c=f(n(9090)),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(6462)),d=n(834),p=f(d),h=n(1345);function f(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=t.portalClassName="ReactModalPortal",v=t.bodyOpenClassName="ReactModal__Body--open",y=d.canUseDOM&&void 0!==l.default.createPortal,b=function(e){return document.createElement(e)},w=function(){return y?l.default.createPortal:l.default.unstable_renderSubtreeIntoContainer};function k(e){return e()}var E=function(e){function t(){var e,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,s=Array(i),u=0;u<i;u++)s[u]=arguments[u];return n=o=m(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),o.removePortal=function(){!y&&l.default.unmountComponentAtNode(o.node);var e=k(o.props.parentSelector);e&&e.contains(o.node)?e.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(e){o.portal=e},o.renderPortal=function(e){var n=w()(o,a.default.createElement(c.default,r({defaultStyles:t.defaultStyles},e)),o.node);o.portalRef(n)},m(o,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){d.canUseDOM&&(y||(this.node=b("div")),this.node.className=this.props.portalClassName,k(this.props.parentSelector).appendChild(this.node),!y&&this.renderPortal(this.props))}},{key:"getSnapshotBeforeUpdate",value:function(e){return{prevParent:k(e.parentSelector),nextParent:k(this.props.parentSelector)}}},{key:"componentDidUpdate",value:function(e,t,n){if(d.canUseDOM){var r=this.props,o=r.isOpen,i=r.portalClassName;e.portalClassName!==i&&(this.node.className=i);var a=n.prevParent,l=n.nextParent;l!==a&&(a.removeChild(this.node),l.appendChild(this.node)),(e.isOpen||o)&&!y&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(d.canUseDOM&&this.node&&this.portal){var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,n-t)):this.removePortal()}}},{key:"render",value:function(){return d.canUseDOM&&y?(!this.node&&y&&(this.node=b("div")),w()(a.default.createElement(c.default,r({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)):null}}],[{key:"setAppElement",value:function(e){u.setElement(e)}}]),t}(i.Component);E.propTypes={isOpen:s.default.bool.isRequired,style:s.default.shape({content:s.default.object,overlay:s.default.object}),portalClassName:s.default.string,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,className:s.default.oneOfType([s.default.string,s.default.shape({base:s.default.string.isRequired,afterOpen:s.default.string.isRequired,beforeClose:s.default.string.isRequired})]),overlayClassName:s.default.oneOfType([s.default.string,s.default.shape({base:s.default.string.isRequired,afterOpen:s.default.string.isRequired,beforeClose:s.default.string.isRequired})]),appElement:s.default.oneOfType([s.default.instanceOf(p.default),s.default.instanceOf(d.SafeHTMLCollection),s.default.instanceOf(d.SafeNodeList),s.default.arrayOf(s.default.instanceOf(p.default))]),onAfterOpen:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,ariaHideApp:s.default.bool,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,parentSelector:s.default.func,aria:s.default.object,data:s.default.object,role:s.default.string,contentLabel:s.default.string,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func},E.defaultProps={isOpen:!1,portalClassName:g,bodyOpenClassName:v,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,t){return a.default.createElement("div",e,t)},contentElement:function(e,t){return a.default.createElement("div",e,t)}},E.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,h.polyfill)(E),t.default=E},1811:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9189),o=n(6802);t.getLookupTableForNextSlides=function(e,t,n,i){var a={},l=o.getSlidesToSlide(t,n);return Array(e).fill(0).forEach(function(e,n){var o=r.getOriginalCounterPart(n,t,i);if(0===n)a[0]=o;else{var s=a[n-1]+l;a[n]=s}}),a}},1813:function(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.isIOS=t.useThumbOverlap=t.assertUnreachable=t.voidFn=t.getTrackBackground=t.replaceAt=t.schd=t.translate=t.getClosestThumbIndex=t.translateThumbs=t.getPaddingAndBorder=t.getMargin=t.checkInitialOverlap=t.checkValuesAgainstBoundaries=t.checkBoundaries=t.isVertical=t.relativeValue=t.normalizeValue=t.isStepDivisible=t.isTouchEvent=t.getStepDecimals=void 0;var o=n(1609),i=n(8105);function a(e){return e===i.Direction.Up||e===i.Direction.Down}function l(e,t,n){e.style.transform="translate(".concat(t,"px, ").concat(n,"px)")}t.getStepDecimals=function(e){var t=e.toString().split(".")[1];return t?t.length:0},t.isTouchEvent=function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length},t.isStepDivisible=function(e,t,n){var r=Number(((t-e)/n).toFixed(8));return parseInt(r.toString(),10)===r},t.normalizeValue=function(e,n,r,o,i,a,l){var s=1e11;if(e=Math.round(e*s)/s,!a){var c=l[n-1],u=l[n+1];if(c&&c>e)return c;if(u&&u<e)return u}if(e>o)return o;if(e<r)return r;var d=Math.floor(e*s-r*s)%Math.floor(i*s),p=Math.floor(e*s-Math.abs(d)),h=0===d?e:p/s,f=Math.abs(d/s)<i/2?h:h+i,m=(0,t.getStepDecimals)(i);return parseFloat(f.toFixed(m))},t.relativeValue=function(e,t,n){return(e-t)/(n-t)},t.isVertical=a,t.checkBoundaries=function(e,t,n){if(t>=n)throw new RangeError("min (".concat(t,") is equal/bigger than max (").concat(n,")"));if(e<t)throw new RangeError("value (".concat(e,") is smaller than min (").concat(t,")"));if(e>n)throw new RangeError("value (".concat(e,") is bigger than max (").concat(n,")"))},t.checkValuesAgainstBoundaries=function(e,t,n){return e<t?t:e>n?n:e},t.checkInitialOverlap=function(e){if(!(e.length<2||e.slice(1).every(function(t,n){return e[n]<=t})))throw new RangeError("values={[".concat(e,"]} needs to be sorted when allowOverlap={false}"))},t.getMargin=function(e){var t=window.getComputedStyle(e);return{top:parseInt(t["margin-top"],10),bottom:parseInt(t["margin-bottom"],10),left:parseInt(t["margin-left"],10),right:parseInt(t["margin-right"],10)}},t.getPaddingAndBorder=function(e){var t=window.getComputedStyle(e);return{top:parseInt(t["padding-top"],10)+parseInt(t["border-top-width"],10),bottom:parseInt(t["padding-bottom"],10)+parseInt(t["border-bottom-width"],10),left:parseInt(t["padding-left"],10)+parseInt(t["border-left-width"],10),right:parseInt(t["padding-right"],10)+parseInt(t["border-right-width"],10)}},t.translateThumbs=function(e,t,n){var r=n?-1:1;e.forEach(function(e,n){return l(e,r*t[n].x,t[n].y)})},t.getClosestThumbIndex=function(e,t,n,r){for(var o=0,i=c(e[0],t,n,r),a=1;a<e.length;a++){var l=c(e[a],t,n,r);l<i&&(i=l,o=a)}return o},t.translate=l,t.schd=function(e){var t=[],n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];t=r,n||(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))}},t.replaceAt=function(e,t,n){var r=e.slice(0);return r[t]=n,r},t.getTrackBackground=function(e){var t=e.values,n=e.colors,r=e.min,o=e.max,a=e.direction,l=void 0===a?i.Direction.Right:a,s=e.rtl,c=void 0!==s&&s;c&&l===i.Direction.Right?l=i.Direction.Left:c&&i.Direction.Left&&(l=i.Direction.Right);var u=t.slice(0).sort(function(e,t){return e-t}).map(function(e){return(e-r)/(o-r)*100}).reduce(function(e,t,r){return"".concat(e,", ").concat(n[r]," ").concat(t,"%, ").concat(n[r+1]," ").concat(t,"%")},"");return"linear-gradient(".concat(l,", ").concat(n[0]," 0%").concat(u,", ").concat(n[n.length-1]," 100%)")},t.voidFn=function(){},t.assertUnreachable=function(e){throw new Error("Didn't expect to get here")};var s=function(e,t,n,o,i){return void 0===i&&(i=function(e){return e}),Math.ceil(r([e],Array.from(e.children),!0).reduce(function(e,r){var a=Math.ceil(r.getBoundingClientRect().width);if(r.innerText&&r.innerText.includes(n)&&0===r.childElementCount){var l=r.cloneNode(!0);l.innerHTML=i(t.toFixed(o)),l.style.visibility="hidden",document.body.appendChild(l),a=Math.ceil(l.getBoundingClientRect().width),document.body.removeChild(l)}return a>e?a:e},e.getBoundingClientRect().width))};function c(e,t,n,r){var o=e.getBoundingClientRect(),i=o.left,l=o.top,s=o.width,c=o.height;return a(r)?Math.abs(n-(l+c/2)):Math.abs(t-(i+s/2))}t.useThumbOverlap=function(e,n,i,a,l,c){void 0===a&&(a=.1),void 0===l&&(l=" - "),void 0===c&&(c=function(e){return e});var u=(0,t.getStepDecimals)(a),d=(0,o.useState)({}),p=d[0],h=d[1],f=(0,o.useState)(c(n[i].toFixed(u))),m=f[0],g=f[1];return(0,o.useEffect)(function(){if(e){var t=e.getThumbs();if(t.length<1)return;var o={},a=e.getOffsets(),d=function(e,t,n,o,i,a,l){void 0===l&&(l=function(e){return e});var c=[],u=function(e){var d=s(n[e],o[e],i,a,l),p=t[e].x;t.forEach(function(t,h){var f=t.x,m=s(n[h],o[h],i,a,l);e!==h&&(p>=f&&p<=f+m||p+d>=f&&p+d<=f+m)&&(c.includes(h)||(c.push(e),c.push(h),c=r(r([],c,!0),[e,h],!1),u(h)))})};return u(e),Array.from(new Set(c.sort()))}(i,a,t,n,l,u,c),p=c(n[i].toFixed(u));if(d.length){var f=d.reduce(function(e,t,n,o){return e.length?r(r([],e,!0),[a[o[n]].x],!1):[a[o[n]].x]},[]);if(Math.min.apply(Math,f)===a[i].x){var m=[];d.forEach(function(e){m.push(n[e].toFixed(u))}),p=Array.from(new Set(m.sort(function(e,t){return parseFloat(e)-parseFloat(t)}))).map(c).join(l);var v=Math.min.apply(Math,f),y=Math.max.apply(Math,f),b=t[d[f.indexOf(y)]].getBoundingClientRect().width;o.left="".concat(Math.abs(v-(y+b))/2,"px"),o.transform="translate(-50%, 0)"}else o.visibility="hidden"}g(p),h(o)}},[e,n]),[m,p]},t.isIOS=function(){var e,t=(null===(e=navigator.userAgentData)||void 0===e?void 0:e.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(t)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}},1921:(e,t,n)=>{(()=>{var t={296:(e,t,n)=>{var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")(),d=Object.prototype.toString,p=Math.max,h=Math.min,f=function(){return u.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]"==d.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=i.test(e);return n||a.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,l,s,c=0,u=!1,d=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function b(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=i}function w(){var e=f();if(b(e))return k(e);l=setTimeout(w,function(e){var n=t-(e-s);return d?h(n,i-(e-c)):n}(e))}function k(e){return l=void 0,v&&r?y(e):(r=o=void 0,a)}function E(){var e=f(),n=b(e);if(r=arguments,o=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(w,t),u?y(e):a}(s);if(d)return l=setTimeout(w,t),y(s)}return void 0===l&&(l=setTimeout(w,t)),a}return t=g(t)||0,m(n)&&(u=!!n.leading,i=(d="maxWait"in n)?p(g(n.maxWait)||0,t):i,v="trailing"in n?!!n.trailing:v),E.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=o=l=void 0},E.flush=function(){return void 0===l?a:k(f())},E}},96:(e,t,n)=>{var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return g(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,a,l,s,c,u=0,d=!1,p=!1,y=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,u=t,l=e.apply(r,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-u>=a}function k(){var e=m();if(w(e))return E(e);s=setTimeout(k,function(e){var n=t-(e-c);return p?f(n,a-(e-u)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,l)}function O(){var e=m(),n=w(e);if(o=arguments,i=this,c=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(k,t),d?b(e):l}(c);if(p)return s=setTimeout(k,t),b(c)}return void 0===s&&(s=setTimeout(k,t)),l}return t=v(t)||0,g(n)&&(d=!!n.leading,a=(p="maxWait"in n)?h(v(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),O.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=c=i=s=void 0},O.flush=function(){return void 0===s?l:E(m())},O}(e,t,{leading:o,maxWait:t,trailing:i})}},703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";o.r(i),o.d(i,{LazyLoadComponent:()=>H,LazyLoadImage:()=>te,trackWindowScroll:()=>D});const e=n(1609);var t=o.n(e),r=o(697);function a(){return"undefined"!=typeof window&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}function l(e){return l="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},l(e)}function s(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 c(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e){if("object"!==l(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===l(t)?t:String(t)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}var f=function(e){e.forEach(function(e){e.isIntersecting&&e.target.onVisible()})},m={},g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(g,e);var n,r,o,i,d=(o=g,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=h(o);if(i){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function g(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),(t=d.call(this,e)).supportsObserver=!e.scrollPosition&&e.useIntersectionObserver&&a(),t.supportsObserver){var n=e.threshold;t.observer=function(e){return m[e]=m[e]||new IntersectionObserver(f,{rootMargin:e+"px"}),m[e]}(n)}return t}return n=g,r=[{key:"componentDidMount",value:function(){this.placeholder&&this.observer&&(this.placeholder.onVisible=this.props.onVisible,this.observer.observe(this.placeholder)),this.supportsObserver||this.updateVisibility()}},{key:"componentWillUnmount",value:function(){this.observer&&this.placeholder&&this.observer.unobserve(this.placeholder)}},{key:"componentDidUpdate",value:function(){this.supportsObserver||this.updateVisibility()}},{key:"getPlaceholderBoundingBox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.scrollPosition,t=this.placeholder.getBoundingClientRect(),n=this.placeholder.style,r=parseInt(n.getPropertyValue("margin-left"),10)||0,o=parseInt(n.getPropertyValue("margin-top"),10)||0;return{bottom:e.y+t.bottom+o,left:e.x+t.left+r,right:e.x+t.right+r,top:e.y+t.top+o}}},{key:"isPlaceholderInViewport",value:function(){if("undefined"==typeof window||!this.placeholder)return!1;var e=this.props,t=e.scrollPosition,n=e.threshold,r=this.getPlaceholderBoundingBox(t),o=t.y+window.innerHeight,i=t.x,a=t.x+window.innerWidth,l=t.y;return Boolean(l-n<=r.bottom&&o+n>=r.top&&i-n<=r.right&&a+n>=r.left)}},{key:"updateVisibility",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:"render",value:function(){var e=this,n=this.props,r=n.className,o=n.height,i=n.placeholder,a=n.style,l=n.width;if(i&&"function"!=typeof i.type)return t().cloneElement(i,{ref:function(t){return e.placeholder=t}});var u=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({display:"inline-block"},a);return void 0!==l&&(u.width=l),void 0!==o&&(u.height=o),t().createElement("span",{className:r,ref:function(t){return e.placeholder=t},style:u},i)}}],r&&u(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),g}(t().Component);g.propTypes={onVisible:r.PropTypes.func.isRequired,className:r.PropTypes.string,height:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string]),placeholder:r.PropTypes.element,threshold:r.PropTypes.number,useIntersectionObserver:r.PropTypes.bool,scrollPosition:r.PropTypes.shape({x:r.PropTypes.number.isRequired,y:r.PropTypes.number.isRequired}),width:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string])},g.defaultProps={className:"",placeholder:null,threshold:100,useIntersectionObserver:!0};const v=g;var y=o(296),b=o.n(y),w=o(96),k=o.n(w),E=function(e){var t=getComputedStyle(e,null);return t.getPropertyValue("overflow")+t.getPropertyValue("overflow-y")+t.getPropertyValue("overflow-x")};const O=function(e){if(!(e instanceof HTMLElement))return window;for(var t=e;t&&t instanceof HTMLElement;){if(/(scroll|auto)/.test(E(t)))return t;t=t.parentNode}return window};function x(e){return x="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},x(e)}var S=["delayMethod","delayTime"];function _(){return _=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},_.apply(this,arguments)}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function P(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}var M=function(){return"undefined"==typeof window?0:window.scrollX||window.pageXOffset},N=function(){return"undefined"==typeof window?0:window.scrollY||window.pageYOffset};const D=function(e){var n=function(n){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(c,n);var r,o,i,l,s=(i=c,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=A(i);if(l){var n=A(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return P(this,e)});function c(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(n=s.call(this,e)).useIntersectionObserver=e.useIntersectionObserver&&a(),n.useIntersectionObserver)return P(n);var r=n.onChangeScroll.bind(T(n));return"debounce"===e.delayMethod?n.delayedScroll=b()(r,e.delayTime):"throttle"===e.delayMethod&&(n.delayedScroll=k()(r,e.delayTime)),n.state={scrollPosition:{x:M(),y:N()}},n.baseComponentRef=t().createRef(),n}return r=c,(o=[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"componentDidUpdate",value:function(){"undefined"==typeof window||this.useIntersectionObserver||O(this.baseComponentRef.current)!==this.scrollElement&&(this.removeListeners(),this.addListeners())}},{key:"addListeners",value:function(){"undefined"==typeof window||this.useIntersectionObserver||(this.scrollElement=O(this.baseComponentRef.current),this.scrollElement.addEventListener("scroll",this.delayedScroll,{passive:!0}),window.addEventListener("resize",this.delayedScroll,{passive:!0}),this.scrollElement!==window&&window.addEventListener("scroll",this.delayedScroll,{passive:!0}))}},{key:"removeListeners",value:function(){"undefined"==typeof window||this.useIntersectionObserver||(this.scrollElement.removeEventListener("scroll",this.delayedScroll),window.removeEventListener("resize",this.delayedScroll),this.scrollElement!==window&&window.removeEventListener("scroll",this.delayedScroll))}},{key:"onChangeScroll",value:function(){this.useIntersectionObserver||this.setState({scrollPosition:{x:M(),y:N()}})}},{key:"render",value:function(){var n=this.props,r=(n.delayMethod,n.delayTime,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,S)),o=this.useIntersectionObserver?null:this.state.scrollPosition;return t().createElement(e,_({forwardRef:this.baseComponentRef,scrollPosition:o},r))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=function(e){if("object"!==x(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===x(o)?o:String(o)),r)}var o}(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(t().Component);return n.propTypes={delayMethod:r.PropTypes.oneOf(["debounce","throttle"]),delayTime:r.PropTypes.number,useIntersectionObserver:r.PropTypes.bool},n.defaultProps={delayMethod:"throttle",delayTime:300,useIntersectionObserver:!0},n};function I(e){return I="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},I(e)}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}(l,e);var n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=R(o);if(i){var n=R(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===I(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),a.call(this,e)}return n=l,(r=[{key:"render",value:function(){return t().createElement(v,this.props)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=function(e){if("object"!==I(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===I(o)?o:String(o)),r)}var o}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),l}(t().Component);const F=D(j);function z(e){return z="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},z(e)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B(e,t)}function W(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},U(e)}var V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}(s,e);var n,r,o,i,l=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=U(o);if(i){var n=U(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return W(e)}(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=l.call(this,e);var n=e.afterLoad,r=e.beforeLoad,o=e.scrollPosition,i=e.visibleByDefault;return t.state={visible:i},i&&(r(),n()),t.onVisible=t.onVisible.bind(W(t)),t.isScrollTracked=Boolean(o&&Number.isFinite(o.x)&&o.x>=0&&Number.isFinite(o.y)&&o.y>=0),t}return n=s,(r=[{key:"componentDidUpdate",value:function(e,t){t.visible!==this.state.visible&&this.props.afterLoad()}},{key:"onVisible",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:"render",value:function(){if(this.state.visible)return this.props.children;var e=this.props,n=e.className,r=e.delayMethod,o=e.delayTime,i=e.height,l=e.placeholder,s=e.scrollPosition,c=e.style,u=e.threshold,d=e.useIntersectionObserver,p=e.width;return this.isScrollTracked||d&&a()?t().createElement(v,{className:n,height:i,onVisible:this.onVisible,placeholder:l,scrollPosition:s,style:c,threshold:u,useIntersectionObserver:d,width:p}):t().createElement(F,{className:n,delayMethod:r,delayTime:o,height:i,onVisible:this.onVisible,placeholder:l,style:c,threshold:u,width:p})}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=function(e){if("object"!==z(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===z(o)?o:String(o)),r)}var o}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);V.propTypes={afterLoad:r.PropTypes.func,beforeLoad:r.PropTypes.func,useIntersectionObserver:r.PropTypes.bool,visibleByDefault:r.PropTypes.bool},V.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const H=V;function q(e){return q="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},q(e)}var Q=["afterLoad","beforeLoad","delayMethod","delayTime","effect","placeholder","placeholderSrc","scrollPosition","threshold","useIntersectionObserver","visibleByDefault","wrapperClassName","wrapperProps"];function $(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 G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Y(e,t,n){return(t=K(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X(){return X=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},X.apply(this,arguments)}function K(e){var t=function(e){if("object"!==q(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===q(t)?t:String(t)}function Z(e,t){return Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Z(e,t)}function J(e){return J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},J(e)}var ee=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z(e,t)}(l,e);var n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=J(o);if(i){var n=J(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=a.call(this,e)).state={loaded:!1},t}return n=l,(r=[{key:"onImageLoad",value:function(){var e=this;return this.state.loaded?null:function(t){e.props.onLoad(t),e.props.afterLoad(),e.setState({loaded:!0})}}},{key:"getImg",value:function(){var e=this.props,n=(e.afterLoad,e.beforeLoad,e.delayMethod,e.delayTime,e.effect,e.placeholder,e.placeholderSrc,e.scrollPosition,e.threshold,e.useIntersectionObserver,e.visibleByDefault,e.wrapperClassName,e.wrapperProps,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Q));return t().createElement("img",X({},n,{onLoad:this.onImageLoad()}))}},{key:"getLazyLoadImage",value:function(){var e=this.props,n=e.beforeLoad,r=e.className,o=e.delayMethod,i=e.delayTime,a=e.height,l=e.placeholder,s=e.scrollPosition,c=e.style,u=e.threshold,d=e.useIntersectionObserver,p=e.visibleByDefault,h=e.width;return t().createElement(H,{beforeLoad:n,className:r,delayMethod:o,delayTime:i,height:a,placeholder:l,scrollPosition:s,style:c,threshold:u,useIntersectionObserver:d,visibleByDefault:p,width:h},this.getImg())}},{key:"getWrappedLazyLoadImage",value:function(e){var n=this.props,r=n.effect,o=n.height,i=n.placeholderSrc,a=n.width,l=n.wrapperClassName,s=n.wrapperProps,c=this.state.loaded,u=c?" lazy-load-image-loaded":"",d=c||!i?{}:{backgroundImage:"url(".concat(i,")"),backgroundSize:"100% 100%"};return t().createElement("span",X({className:l+" lazy-load-image-background "+r+u,style:G(G({},d),{},{color:"transparent",display:"inline-block",height:o,width:a})},s),e)}},{key:"render",value:function(){var e=this.props,t=e.effect,n=e.placeholderSrc,r=e.visibleByDefault,o=e.wrapperClassName,i=e.wrapperProps,a=this.getLazyLoadImage();return(t||n)&&!r||o||i?this.getWrappedLazyLoadImage(a):a}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,K(r.key),r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),l}(t().Component);ee.propTypes={onLoad:r.PropTypes.func,afterLoad:r.PropTypes.func,beforeLoad:r.PropTypes.func,delayMethod:r.PropTypes.string,delayTime:r.PropTypes.number,effect:r.PropTypes.string,placeholderSrc:r.PropTypes.string,threshold:r.PropTypes.number,useIntersectionObserver:r.PropTypes.bool,visibleByDefault:r.PropTypes.bool,wrapperClassName:r.PropTypes.string,wrapperProps:r.PropTypes.object},ee.defaultProps={onLoad:function(){},afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:"throttle",delayTime:300,effect:"",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:""};const te=ee})(),e.exports=i})()},1928:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},2012:(e,t,n)=>{"use strict";var r=n(9516),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}},2259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r;return function(){var o=arguments;r||(e.apply(this,o),r=!0,"function"==typeof n&&n(!0),setTimeout(function(){r=!1,"function"==typeof n&&n(!1)},t))}}},2271:(e,t,n)=>{"use strict";var r=n(453),o=n(6556),i=n(8859),a=n(507),l=n(9675),s=r("%WeakMap%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),p=o("WeakMap.prototype.delete",!0);e.exports=s?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new l("Side channel does not contain "+i(e))},delete:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return s&&n&&("object"==typeof n||"function"==typeof n)&&e?c(e,n):t&&t.get(n)},has:function(n){return s&&n&&("object"==typeof n||"function"==typeof n)&&e?d(e,n):!!t&&t.has(n)},set:function(n,r){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),u(e,n,r)):a&&(t||(t=a()),t.set(n,r))}};return n}:a},2411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){return[].slice.call(t.querySelectorAll("*"),0).reduce(function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])},[]).filter(a)};var n="none",r="contents",o=/^(input|select|textarea|button|object|iframe)$/;function i(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var o=window.getComputedStyle(e),i=o.getPropertyValue("display");return t?i!==r&&function(e,t){return"visible"!==t.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0}(e,o):i===n}catch(e){return console.warn("Failed to inspect element style"),!1}}function a(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var n=isNaN(t);return(n||t>=0)&&function(e,t){var n=e.nodeName.toLowerCase();return(o.test(n)&&!e.disabled||"a"===n&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),i(t))return!1;t=t.parentNode}return!0}(e)}(e,!n)}e.exports=t.default},2424:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(1609);t.isMouseMoveEvent=function(e){return"clientY"in e};var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(i.Component);t.default=a},2471:(e,t,n)=>{var r=n(5496),o=n(7731).formatDOM,i=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(i);return n&&n[1]&&(t=n[1]),o(r(e),null,t)}},2505:(e,t,n)=>{e.exports=n(8015)},2634:()=>{},2642:(e,t,n)=>{"use strict";var r=n(7720),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},l=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},c=function(e,t,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/g,c=n.depth>0&&/(\[[^[\]]*])/.exec(a),u=c?a.slice(0,c.index):a,d=[];if(u){if(!n.plainObjects&&o.call(Object.prototype,u)&&!n.allowPrototypes)return;d.push(u)}for(var p=0;n.depth>0&&null!==(c=l.exec(a))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;d.push(c[1])}if(c){if(!0===n.strictDepth)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");d.push("["+a.slice(c.index)+"]")}return function(e,t,n,o){var i=0;if(e.length>0&&"[]"===e[e.length-1]){var a=e.slice(0,-1).join("");i=Array.isArray(t)&&t[a]?t[a].length:0}for(var l=o?t:s(t,n,i),c=e.length-1;c>=0;--c){var u,d=e[c];if("[]"===d&&n.parseArrays)u=n.allowEmptyArrays&&(""===l||n.strictNullHandling&&null===l)?[]:r.combine([],l);else{u=n.plainObjects?{__proto__:null}:{};var p="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,h=n.decodeDotInKeys?p.replace(/%2E/g,"."):p,f=parseInt(h,10);n.parseArrays||""!==h?!isNaN(f)&&d!==h&&String(f)===h&&f>=0&&n.parseArrays&&f<=n.arrayLimit?(u=[])[f]=l:"__proto__"!==h&&(u[h]=l):u={0:l}}l=u}return l}(d,t,n,i)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?a.charset:e.charset,n=void 0===e.duplicates?a.duplicates:e.duplicates;if("combine"!==n&&"first"!==n&&"last"!==n)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||a.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:a.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,duplicates:n,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:a.strictDepth,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return n.plainObjects?{__proto__:null}:{};for(var u="string"==typeof e?function(e,t){var n={__proto__:null},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,d=c.split(t.delimiter,t.throwOnLimitExceeded?u+1:u);if(t.throwOnLimitExceeded&&d.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var p,h=-1,f=t.charset;if(t.charsetSentinel)for(p=0;p<d.length;++p)0===d[p].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[p]?f="utf-8":"utf8=%26%2310003%3B"===d[p]&&(f="iso-8859-1"),h=p,p=d.length);for(p=0;p<d.length;++p)if(p!==h){var m,g,v=d[p],y=v.indexOf("]="),b=-1===y?v.indexOf("="):y+1;-1===b?(m=t.decoder(v,a.decoder,f,"key"),g=t.strictNullHandling?null:""):(m=t.decoder(v.slice(0,b),a.decoder,f,"key"),g=r.maybeMap(s(v.slice(b+1),t,i(n[m])?n[m].length:0),function(e){return t.decoder(e,a.decoder,f,"value")})),g&&t.interpretNumericEntities&&"iso-8859-1"===f&&(g=l(String(g))),v.indexOf("[]=")>-1&&(g=i(g)?[g]:g);var w=o.call(n,m);w&&"combine"===t.duplicates?n[m]=r.combine(n[m],g):w&&"last"!==t.duplicates||(n[m]=g)}return n}(e,n):e,d=n.plainObjects?{__proto__:null}:{},p=Object.keys(u),h=0;h<p.length;++h){var f=p[h],m=c(f,u[f],n,"string"==typeof e);d=r.merge(d,m,n)}return!0===n.allowSparse?d:r.compact(d)}},2694:(e,t,n)=>{"use strict";var r=n(6925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},2877:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609);t.default=function(e){r.useEffect(e,[])}},2881:(e,t,n)=>{"use strict";var r=n(9516),o=n(7412);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,function(n){e=n.call(i,e,t)}),e}},3072:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,f=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,w=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case l:case a:case h:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case s:return e;default:return t}}case o:return t}}}function E(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=a,t.Suspense=h,t.isAsyncMode=function(e){return E(e)||k(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===i},t.isLazy=function(e){return k(e)===g},t.isMemo=function(e){return k(e)===m},t.isPortal=function(e){return k(e)===o},t.isProfiler=function(e){return k(e)===l},t.isStrictMode=function(e){return k(e)===a},t.isSuspense=function(e){return k(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===l||e===a||e===h||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===y||e.$$typeof===b||e.$$typeof===w||e.$$typeof===v)},t.typeOf=k},3093:(e,t,n)=>{"use strict";var r=n(4459);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},3126:(e,t,n)=>{"use strict";var r=n(6743),o=n(9675),i=n(76),a=n(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(r,i,e)}},3144:(e,t,n)=>{"use strict";var r=n(6743),o=n(1002),i=n(76),a=n(7119);e.exports=a||r.call(i,o)},3191:(e,t,n)=>{"use strict";var r=n(1928);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;this.promise.then(function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}}),this.promise.then=function(e){var t,r=new Promise(function(e){n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e){n.reason||(n.reason=new r(e),t(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},3404:(e,t,n)=>{"use strict";e.exports=n(3072)},3471:(e,t,n)=>{"use strict";var r=n(9516);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},3628:(e,t,n)=>{"use strict";var r=n(8648),o=n(1064),i=n(7176);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},3864:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},3948:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var l=[];l.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),r.isString(o)&&l.push("path="+o),r.isString(i)&&l.push("domain="+i),!0===a&&l.push("secure"),document.cookie=l.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},4039:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(1333);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},4145:(e,t,n)=>{e.exports=n(5961)},4146:(e,t,n)=>{"use strict";var r=n(3404),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?a:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(f){var o=h(n);o&&o!==f&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var l=s(t),m=s(n),g=0;g<a.length;++g){var v=a[g];if(!(i[v]||r&&r[v]||m&&m[v]||l&&l[v])){var y=p(n,v);try{c(t,v,y)}catch(e){}}}}return t}},4169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609),o=n(9189),i=n(1811),a=n(6802);t.default=function(e){var t=e.props,n=e.state,l=e.goToSlide,s=e.getState,c=t.showDots,u=t.customDot,d=t.dotListClass,p=t.infinite,h=t.children;if(!c||a.notEnoughChildren(n))return null;var f,m=n.currentSlide,g=n.slidesToShow,v=a.getSlidesToSlide(n,t),y=r.Children.toArray(h);f=p?Math.ceil(y.length/v):Math.ceil((y.length-g)/v)+1;var b=i.getLookupTableForNextSlides(f,n,t,y),w=o.getOriginalIndexLookupTableByClones(g,y),k=w[m];return r.createElement("ul",{className:"react-multi-carousel-dot-list "+d},Array(f).fill(0).map(function(e,t){var n,o;if(p){o=b[t];var i=w[o];n=k===i||i<=k&&k<i+v}else{var a=y.length-g,c=t*v;n=(o=a<c?a:c)===m||o<m&&m<o+v&&m<y.length-g}return u?r.cloneElement(u,{index:t,active:n,key:t,onClick:function(){return l(o)},carouselState:s()}):r.createElement("li",{"data-index":t,key:t,className:"react-multi-carousel-dot "+(n?"react-multi-carousel-dot--active":"")},r.createElement("button",{"aria-label":"Go to slide "+(t+1),onClick:function(){return l(o)}}))}))}},4202:(e,t,n)=>{"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},4210:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}Object.defineProperty(t,"__esModule",{value:!0});var i={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(function(e){i[e]=new o(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t,n,a=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}}(t,n)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.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)?r(e,t):void 0}}(t,n)||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.")}()),l=a[0],s=a[1];i[l]=new o(l,1,!1,s,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){i[e]=new o(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){i[e]=new o(e,2,!1,e,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(e){i[e]=new o(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){i[e]=new o(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){i[e]=new o(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){i[e]=new o(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){i[e]=new o(e,5,!1,e.toLowerCase(),null,!1,!1)});var a=/[\-\:]([a-z])/g,l=function(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(e){var t=e.replace(a,l);i[t]=new o(t,1,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(e){var t=e.replace(a,l);i[t]=new o(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(a,l);i[t]=new o(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){i[e]=new o(e,1,!1,e.toLowerCase(),null,!1,!1)}),i.xlinkHref=new o("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){i[e]=new o(e,1,!1,e.toLowerCase(),null,!0,!0)});var s=n(6811),c=s.CAMELCASE,u=s.SAME,d=s.possibleStandardNames,p=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),h=Object.keys(d).reduce(function(e,t){var n=d[t];return n===u?e[t]=t:n===c?e[t.toLowerCase()]=t:e[t]=n,e},{});t.BOOLEAN=3,t.BOOLEANISH_STRING=2,t.NUMERIC=5,t.OVERLOADED_BOOLEAN=4,t.POSITIVE_NUMERIC=6,t.RESERVED=0,t.STRING=1,t.getPropertyInfo=function(e){return i.hasOwnProperty(e)?i[e]:null},t.isCustomAttribute=p,t.possibleStandardNames=h},4361:(e,t,n)=>{var r=n(8829),o=Object.prototype.hasOwnProperty,i="undefined"!=typeof Map;function a(){this._array=[],this._set=i?new Map:Object.create(null)}a.fromArray=function(e,t){for(var n=new a,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},a.prototype.size=function(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length},a.prototype.add=function(e,t){var n=i?e:r.toSetString(e),a=i?this.has(e):o.call(this._set,n),l=this._array.length;a&&!t||this._array.push(e),a||(i?this._set.set(e,l):this._set[n]=l)},a.prototype.has=function(e){if(i)return this._set.has(e);var t=r.toSetString(e);return o.call(this._set,t)},a.prototype.indexOf=function(e){if(i){var t=this._set.get(e);if(t>=0)return t}else{var n=r.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},a.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},a.prototype.toArray=function(){return this._array.slice()},t.C=a},4364:(e,t,n)=>{"use strict";var r=n(1635),o=n(1609),i=r.__importDefault(n(47)),a=n(6691);t.A=function(e){var t=void 0===e?{}:e,n=t.initialWidth,r=void 0===n?1/0:n,l=t.initialHeight,s=void 0===l?1/0:l,c=t.onChange,u=i.default({width:a.isBrowser?window.innerWidth:r,height:a.isBrowser?window.innerHeight:s}),d=u[0],p=u[1];return o.useEffect(function(){if(a.isBrowser){var e=function(){var e=window.innerWidth,t=window.innerHeight;p({width:e,height:t}),c&&c(e,t)};return a.on(window,"resize",e),function(){a.off(window,"resize",e)}}},[]),d}},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4490:(e,t,n)=>{"use strict";var r=n(9516),o=n(2881),i=n(3864),a=n(7412),l=n(1928);function s(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new l("canceled")}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||a.adapter)(e).then(function(t){return s(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(s(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},4552:e=>{"use strict";var t={linear:function(e,t,n,r){return(n-t)*e/r+t},easeInQuad:function(e,t,n,r){return(n-t)*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){return-(n-t)*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e+t:-o/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){return(n-t)*(e/=r)*e*e+t},easeOutCubic:function(e,t,n,r){return(n-t)*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,r){return(n-t)*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,n,r){return-(n-t)*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e*e+t:-o/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,r){return(n-t)*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,n,r){return(n-t)*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e*e*e+t:o/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,r){var o=n-t;return-o*Math.cos(e/r*(Math.PI/2))+o+t},easeOutSine:function(e,t,n,r){return(n-t)*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,n,r){return-(n-t)/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,n,r){return 0==e?t:(n-t)*Math.pow(2,10*(e/r-1))+t},easeOutExpo:function(e,t,n,r){var o=n-t;return e==r?t+o:o*(1-Math.pow(2,-10*e/r))+t},easeInOutExpo:function(e,t,n,r){var o=n-t;return 0===e?t:e===r?t+o:(e/=r/2)<1?o/2*Math.pow(2,10*(e-1))+t:o/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,n,r){return-(n-t)*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,n,r){return(n-t)*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?-o/2*(Math.sqrt(1-e*e)-1)+t:o/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,n,r){var o,i,a,l=n-t;return a=1.70158,0===e?t:1===(e/=r)?t+l:((i=0)||(i=.3*r),(o=l)<Math.abs(l)?(o=l,a=i/4):a=i/(2*Math.PI)*Math.asin(l/o),-o*Math.pow(2,10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i)+t)},easeOutElastic:function(e,t,n,r){var o,i,a,l=n-t;return a=1.70158,0===e?t:1===(e/=r)?t+l:((i=0)||(i=.3*r),(o=l)<Math.abs(l)?(o=l,a=i/4):a=i/(2*Math.PI)*Math.asin(l/o),o*Math.pow(2,-10*e)*Math.sin((e*r-a)*(2*Math.PI)/i)+l+t)},easeInOutElastic:function(e,t,n,r){var o,i,a,l=n-t;return a=1.70158,0===e?t:2==(e/=r/2)?t+l:((i=0)||(i=r*(.3*1.5)),(o=l)<Math.abs(l)?(o=l,a=i/4):a=i/(2*Math.PI)*Math.asin(l/o),e<1?o*Math.pow(2,10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i)*-.5+t:o*Math.pow(2,-10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i)*.5+l+t)},easeInBack:function(e,t,n,r,o){return void 0===o&&(o=1.70158),(n-t)*(e/=r)*e*((o+1)*e-o)+t},easeOutBack:function(e,t,n,r,o){return void 0===o&&(o=1.70158),(n-t)*((e=e/r-1)*e*((o+1)*e+o)+1)+t},easeInOutBack:function(e,t,n,r,o){var i=n-t;return void 0===o&&(o=1.70158),(e/=r/2)<1?i/2*(e*e*((1+(o*=1.525))*e-o))+t:i/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},easeInBounce:function(e,n,r,o){var i=r-n;return i-t.easeOutBounce(o-e,0,i,o)+n},easeOutBounce:function(e,t,n,r){var o=n-t;return(e/=r)<1/2.75?o*(7.5625*e*e)+t:e<2/2.75?o*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?o*(7.5625*(e-=2.25/2.75)*e+.9375)+t:o*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(e,n,r,o){var i=r-n;return e<o/2?.5*t.easeInBounce(2*e,0,i,o)+n:.5*t.easeOutBounce(2*e-o,0,i,o)+.5*i+n}};e.exports=t},4680:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4713:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t.partialVisbile,r=t.partialVisible,o=t.centerMode,i=t.ssr,a=t.responsive;if((n||r)&&o)throw new Error("center mode can not be used at the same time with partialVisible");if(!a)throw i?new Error("ssr mode need to be used in conjunction with responsive prop"):new Error("Responsive prop is needed for deciding the amount of items to show on the screen");if(a&&"object"!=typeof a)throw new Error("responsive prop must be an object")}},4737:(e,t,n)=>{"use strict";e.exports=n(8989)},4765:()=>{},4803:(e,t,n)=>{"use strict";var r=n(8859),o=n(9675),i=function(e,t,n){for(var r,o=e;null!=(r=o.next);o=r)if(r.key===t)return o.next=r.next,n||(r.next=e.next,e.next=r),r};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+r(e))},delete:function(t){var n=e&&e.next,r=function(e,t){if(e)return i(e,t,!0)}(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return function(e,t){if(e){var n=i(e,t);return n&&n.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!i(e,t)}(e,t)},set:function(t,n){e||(e={next:void 0}),function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(e,t,n)}};return t}},4838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)o(e,n[t]);var i=document.body;for(var a in r)o(i,r[a]);n={},r={}},t.log=function(){};var n={},r={};function o(e,t){e.classList.remove(t)}t.add=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach(function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),o.add(e)});var o,i},t.remove=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach(function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&o.remove(e)});var o,i}},4841:(e,t,n)=>{"use strict";var r=n(9641).version,o={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var l=e[i],s=void 0===l||a(l,i,e);if(!0!==s)throw new TypeError("option "+i+" must be "+s)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},4848:(e,t,n)=>{"use strict";e.exports=n(1020)},4867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPartialVisibilityGutter=function(e,t,n,r){var o=0,i=r||n;return t&&i&&(o=e[i].partialVisibilityGutter||e[i].paritialVisibilityGutter),o},t.getWidthFromDeviceType=function(e,t){var n;return t[e]&&(n=(100/t[e].items).toFixed(1)),n},t.getItemClientSideWidth=function(e,t,n){return Math.round(n/(t+(e.centerMode?1:0)))}},4896:e=>{"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},4958:(e,t,n)=>{var r=n(1609),o=n(5229).default,i={reactCompat:!0},a=r.version.split(".")[0]>=16,l=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,o="function"==typeof t,i={},a={};for(n in e)r=e[n],o&&(i=t(n,r))&&2===i.length?a[i[0]]=i[1]:"string"==typeof r&&(a[r]=n);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){if(null!=e)try{t.style=o(e,i)}catch(e){t.style={}}},canTextBeChildOfNode:function(e){return!l.has(e.name)},elementsWithNoTextChildren:l}},5019:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},5155:(e,t,n)=>{"use strict";var r=n(9516),o=n(9106),i=n(3471),a=n(4490),l=n(5343),s=n(4841),c=s.validators;function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=l(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&s.assertOptions(n,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,r.unshift(e.fulfilled,e.rejected))});var i,u=[];if(this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)}),!o){var d=[a,void 0];for(Array.prototype.unshift.apply(d,r),d=d.concat(u),i=Promise.resolve(t);d.length;)i=i.then(d.shift(),d.shift());return i}for(var p=t;r.length;){var h=r.shift(),f=r.shift();try{p=h(p)}catch(e){f(e);break}}try{i=a(p)}catch(e){return Promise.reject(e)}for(;u.length;)i=i.then(u.shift(),u.shift());return i},u.prototype.getUri=function(e){return e=l(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(e){u.prototype[e]=function(t,n){return this.request(l(n||{},{method:e,url:t,data:(n||{}).data}))}}),r.forEach(["post","put","patch"],function(e){u.prototype[e]=function(t,n,r){return this.request(l(r||{},{method:e,url:t,data:n}))}}),e.exports=u},5229:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=r(n(9108)),i=n(8917);t.default=function(e,t){var n={};return e&&"string"==typeof e?((0,o.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n):n}},5270:(e,t)=>{t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]},5343:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function a(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function l(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function s(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var c={url:a,method:a,data:a,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s};return r.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=c[e]||i,o=t(e);r.isUndefined(o)&&t!==s||(n[e]=o)}),n}},5345:e=>{"use strict";e.exports=URIError},5373:(e,t,n)=>{"use strict";var r=n(8636),o=n(2642),i=n(7146);e.exports={formats:i,parse:o,stringify:r}},5413:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},5449:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},5496:e=>{var t="html",n="head",r="body",o=/<([a-zA-Z]+[0-9]?)/,i=/<head[^]*>/i,a=/<body[^]*>/i,l=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},s=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},c="object"==typeof window&&window.DOMParser;if("function"==typeof c){var u=new c;l=s=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),u.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var d=document.implementation.createHTMLDocument();l=function(e,t){return t?(d.documentElement.querySelector(t).innerHTML=e,d):(d.documentElement.innerHTML=e,d)}}var p,h="object"==typeof document?document.createElement("template"):{};h.content&&(p=function(e){return h.innerHTML=e,h.content.childNodes}),e.exports=function(e){var c,u,d,h,f=e.match(o);switch(f&&f[1]&&(c=f[1].toLowerCase()),c){case t:return u=s(e),i.test(e)||(d=u.querySelector(n))&&d.parentNode.removeChild(d),a.test(e)||(d=u.querySelector(r))&&d.parentNode.removeChild(d),u.querySelectorAll(t);case n:case r:return h=(u=l(e)).querySelectorAll(c),a.test(e)&&i.test(e)?h[0].parentNode.childNodes:h;default:return p?p(e):(d=l(e,r).querySelector(r)).childNodes}}},5556:(e,t,n)=>{e.exports=n(2694)()},5592:(e,t,n)=>{"use strict";var r=n(9516),o=n(7522),i=n(3948),a=n(9106),l=n(9615),s=n(2012),c=n(4202),u=n(7763),d=n(4896),p=n(1928);e.exports=function(e){return new Promise(function(t,n){var h,f=e.data,m=e.headers,g=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}r.isFormData(f)&&delete m["Content-Type"];var y=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(b+":"+w)}var k=l(e.baseURL,e.url);function E(){if(y){var r="getAllResponseHeaders"in y?s(y.getAllResponseHeaders()):null,i={data:g&&"text"!==g&&"json"!==g?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y};o(function(e){t(e),v()},function(e){n(e),v()},i),y=null}}if(y.open(e.method.toUpperCase(),a(k,e.params,e.paramsSerializer),!0),y.timeout=e.timeout,"onloadend"in y?y.onloadend=E:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(E)},y.onabort=function(){y&&(n(u("Request aborted",e,"ECONNABORTED",y)),y=null)},y.onerror=function(){n(u("Network Error",e,null,y)),y=null},y.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||d;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(u(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},r.isStandardBrowserEnv()){var O=(e.withCredentials||c(k))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;O&&(m[e.xsrfHeaderName]=O)}"setRequestHeader"in y&&r.forEach(m,function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete m[t]:y.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),g&&"json"!==g&&(y.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&y.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){y&&(n(!e||e&&e.type?new p("canceled"):e),y.abort(),y=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),f||(f=null),y.send(f)})}},5795:e=>{"use strict";e.exports=window.ReactDOM},5880:e=>{"use strict";e.exports=Math.pow},5961:(e,t,n)=>{"use strict";var r=n(6163);t.default=r.default},6163:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(1609),a=n(7035),l=n(2424),s=n(4169),c=n(8371),u=n(1519),d=n(6802),p=400,h="transform 400ms ease-in-out",f=function(e){function t(t){var n=e.call(this,t)||this;return n.containerRef=i.createRef(),n.listRef=i.createRef(),n.state={itemWidth:0,slidesToShow:0,currentSlide:0,totalItems:i.Children.count(t.children),deviceType:"",domLoaded:!1,transform:0,containerWidth:0},n.onResize=n.onResize.bind(n),n.handleDown=n.handleDown.bind(n),n.handleMove=n.handleMove.bind(n),n.handleOut=n.handleOut.bind(n),n.onKeyUp=n.onKeyUp.bind(n),n.handleEnter=n.handleEnter.bind(n),n.setIsInThrottle=n.setIsInThrottle.bind(n),n.next=a.throttle(n.next.bind(n),t.transitionDuration||p,n.setIsInThrottle),n.previous=a.throttle(n.previous.bind(n),t.transitionDuration||p,n.setIsInThrottle),n.goToSlide=a.throttle(n.goToSlide.bind(n),t.transitionDuration||p,n.setIsInThrottle),n.onMove=!1,n.initialX=0,n.lastX=0,n.isAnimationAllowed=!1,n.direction="",n.initialY=0,n.isInThrottle=!1,n.transformPlaceHolder=0,n}return o(t,e),t.prototype.resetTotalItems=function(){var e=this,t=i.Children.count(this.props.children),n=a.notEnoughChildren(this.state)?0:Math.max(0,Math.min(this.state.currentSlide,t));this.setState({totalItems:t,currentSlide:n},function(){e.setContainerAndItemWidth(e.state.slidesToShow,!0)})},t.prototype.setIsInThrottle=function(e){void 0===e&&(e=!1),this.isInThrottle=e},t.prototype.setTransformDirectly=function(e,t){var n=this.props.additionalTransfrom;this.transformPlaceHolder=e;var r=d.getTransform(this.state,this.props,this.transformPlaceHolder);this.listRef&&this.listRef.current&&(this.setAnimationDirectly(t),this.listRef.current.style.transform="translate3d("+(r+n)+"px,0,0)")},t.prototype.setAnimationDirectly=function(e){this.listRef&&this.listRef.current&&(this.listRef.current.style.transition=e?this.props.customTransition||h:"none")},t.prototype.componentDidMount=function(){this.setState({domLoaded:!0}),this.setItemsToShow(),window.addEventListener("resize",this.onResize),this.onResize(!0),this.props.keyBoardControl&&window.addEventListener("keyup",this.onKeyUp),this.props.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed))},t.prototype.setClones=function(e,t,n,r){var o=this;void 0===r&&(r=!1),this.isAnimationAllowed=!1;var l=i.Children.toArray(this.props.children),s=a.getInitialSlideInInfiniteMode(e||this.state.slidesToShow,l),c=a.getClones(this.state.slidesToShow,l),u=l.length<this.state.slidesToShow?0:this.state.currentSlide;this.setState({totalItems:c.length,currentSlide:n&&!r?u:s},function(){o.correctItemsPosition(t||o.state.itemWidth)})},t.prototype.setItemsToShow=function(e,t){var n=this,r=this.props.responsive;Object.keys(r).forEach(function(o){var i=r[o],a=i.breakpoint,l=i.items,s=a.max,c=a.min,u=[window.innerWidth];window.screen&&window.screen.width&&u.push(window.screen.width);var d=Math.min.apply(Math,u);c<=d&&d<=s&&(n.setState({slidesToShow:l,deviceType:o}),n.setContainerAndItemWidth(l,e,t))})},t.prototype.setContainerAndItemWidth=function(e,t,n){var r=this;if(this.containerRef&&this.containerRef.current){var o=this.containerRef.current.offsetWidth,i=a.getItemClientSideWidth(this.props,e,o);this.setState({containerWidth:o,itemWidth:i},function(){r.props.infinite&&r.setClones(e,i,t,n)}),t&&this.correctItemsPosition(i)}},t.prototype.correctItemsPosition=function(e,t,n){t&&(this.isAnimationAllowed=!0),!t&&this.isAnimationAllowed&&(this.isAnimationAllowed=!1);var r=this.state.totalItems<this.state.slidesToShow?0:-e*this.state.currentSlide;n&&this.setTransformDirectly(r,!0),this.setState({transform:r})},t.prototype.onResize=function(e){var t;t=!(!this.props.infinite||"boolean"==typeof e&&e),this.setItemsToShow(t)},t.prototype.componentDidUpdate=function(e,n){var r=this,o=e.keyBoardControl,i=e.autoPlay,l=e.children,s=n.containerWidth,c=n.domLoaded,u=n.currentSlide;if(this.containerRef&&this.containerRef.current&&this.containerRef.current.offsetWidth!==s&&(this.itemsToShowTimeout&&clearTimeout(this.itemsToShowTimeout),this.itemsToShowTimeout=setTimeout(function(){r.setItemsToShow(!0)},this.props.transitionDuration||p)),o&&!this.props.keyBoardControl&&window.removeEventListener("keyup",this.onKeyUp),!o&&this.props.keyBoardControl&&window.addEventListener("keyup",this.onKeyUp),i&&!this.props.autoPlay&&this.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0),i||!this.props.autoPlay||this.autoPlay||(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed)),l.length!==this.props.children.length?t.clonesTimeout=setTimeout(function(){r.props.infinite?r.setClones(r.state.slidesToShow,r.state.itemWidth,!0,!0):r.resetTotalItems()},this.props.transitionDuration||p):this.props.infinite&&this.state.currentSlide!==u&&this.correctClonesPosition({domLoaded:c}),this.transformPlaceHolder!==this.state.transform&&(this.transformPlaceHolder=this.state.transform),this.props.autoPlay&&this.props.rewind&&!this.props.infinite&&a.isInRightEnd(this.state)){var d=this.props.transitionDuration||p;t.isInThrottleTimeout=setTimeout(function(){r.setIsInThrottle(!1),r.resetAutoplayInterval(),r.goToSlide(0,void 0,!!r.props.rewindWithAnimation)},d+this.props.autoPlaySpeed)}},t.prototype.correctClonesPosition=function(e){var n=this,r=e.domLoaded,o=i.Children.toArray(this.props.children),l=a.checkClonesPosition(this.state,o,this.props),s=l.isReachingTheEnd,c=l.isReachingTheStart,u=l.nextSlide,d=l.nextPosition;this.state.domLoaded&&r&&(s||c)&&(this.isAnimationAllowed=!1,t.transformTimeout=setTimeout(function(){n.setState({transform:d,currentSlide:u})},this.props.transitionDuration||p))},t.prototype.next=function(e){var n=this;void 0===e&&(e=0);var r=this.props,o=r.afterChange,i=r.beforeChange;if(!a.notEnoughChildren(this.state)){var l=a.populateNextSlides(this.state,this.props,e),s=l.nextSlides,c=l.nextPosition,u=this.state.currentSlide;void 0!==s&&void 0!==c&&("function"==typeof i&&i(s,this.getState()),this.isAnimationAllowed=!0,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({transform:c,currentSlide:s},function(){"function"==typeof o&&(t.afterChangeTimeout=setTimeout(function(){o(u,n.getState())},n.props.transitionDuration||p))}))}},t.prototype.previous=function(e){var n=this;void 0===e&&(e=0);var r=this.props,o=r.afterChange,i=r.beforeChange;if(!a.notEnoughChildren(this.state)){var l=a.populatePreviousSlides(this.state,this.props,e),s=l.nextSlides,c=l.nextPosition;if(void 0!==s&&void 0!==c){var u=this.state.currentSlide;"function"==typeof i&&i(s,this.getState()),this.isAnimationAllowed=!0,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({transform:c,currentSlide:s},function(){"function"==typeof o&&(t.afterChangeTimeout2=setTimeout(function(){o(u,n.getState())},n.props.transitionDuration||p))})}}},t.prototype.resetAutoplayInterval=function(){this.props.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed))},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.onResize),this.props.keyBoardControl&&window.removeEventListener("keyup",this.onKeyUp),this.props.autoPlay&&this.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0),this.itemsToShowTimeout&&clearTimeout(this.itemsToShowTimeout),t.clonesTimeout&&clearTimeout(t.clonesTimeout),t.isInThrottleTimeout&&clearTimeout(t.isInThrottleTimeout),t.transformTimeout&&clearTimeout(t.transformTimeout),t.afterChangeTimeout&&clearTimeout(t.afterChangeTimeout),t.afterChangeTimeout2&&clearTimeout(t.afterChangeTimeout2),t.afterChangeTimeout3&&clearTimeout(t.afterChangeTimeout3)},t.prototype.resetMoveStatus=function(){this.onMove=!1,this.initialX=0,this.lastX=0,this.direction="",this.initialY=0},t.prototype.getCords=function(e){var t=e.clientX,n=e.clientY;return{clientX:d.parsePosition(this.props,t),clientY:d.parsePosition(this.props,n)}},t.prototype.handleDown=function(e){if(!(!l.isMouseMoveEvent(e)&&!this.props.swipeable||l.isMouseMoveEvent(e)&&!this.props.draggable||this.isInThrottle)){var t=this.getCords(l.isMouseMoveEvent(e)?e:e.touches[0]),n=t.clientX,r=t.clientY;this.onMove=!0,this.initialX=n,this.initialY=r,this.lastX=n,this.isAnimationAllowed=!1}},t.prototype.handleMove=function(e){if(!(!l.isMouseMoveEvent(e)&&!this.props.swipeable||l.isMouseMoveEvent(e)&&!this.props.draggable||a.notEnoughChildren(this.state))){var t=this.getCords(l.isMouseMoveEvent(e)?e:e.touches[0]),n=t.clientX,r=t.clientY,o=this.initialX-n,i=this.initialY-r;if(this.onMove){if(!(Math.abs(o)>Math.abs(i)))return;var s=a.populateSlidesOnMouseTouchMove(this.state,this.props,this.initialX,this.lastX,n,this.transformPlaceHolder),c=s.direction,u=s.nextPosition,d=s.canContinue;c&&(this.direction=c,d&&void 0!==u&&this.setTransformDirectly(u)),this.lastX=n}}},t.prototype.handleOut=function(e){this.props.autoPlay&&!this.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed));var t="touchend"===e.type&&!this.props.swipeable,n=("mouseleave"===e.type||"mouseup"===e.type)&&!this.props.draggable;if(!t&&!n&&this.onMove){if(this.setAnimationDirectly(!0),"right"===this.direction)if(this.initialX-this.lastX>=this.props.minimumTouchDrag){var r=Math.round((this.initialX-this.lastX)/this.state.itemWidth);this.next(r)}else this.correctItemsPosition(this.state.itemWidth,!0,!0);"left"===this.direction&&(this.lastX-this.initialX>this.props.minimumTouchDrag?(r=Math.round((this.lastX-this.initialX)/this.state.itemWidth),this.previous(r)):this.correctItemsPosition(this.state.itemWidth,!0,!0)),this.resetMoveStatus()}},t.prototype.isInViewport=function(e){var t=e.getBoundingClientRect(),n=t.top,r=void 0===n?0:n,o=t.left,i=void 0===o?0:o,a=t.bottom,l=void 0===a?0:a,s=t.right,c=void 0===s?0:s;return 0<=r&&0<=i&&l<=(window.innerHeight||document.documentElement.clientHeight)&&c<=(window.innerWidth||document.documentElement.clientWidth)},t.prototype.isChildOfCarousel=function(e){return!!(e instanceof Element&&this.listRef&&this.listRef.current)&&this.listRef.current.contains(e)},t.prototype.onKeyUp=function(e){var t=e.target;switch(e.keyCode){case 37:if(this.isChildOfCarousel(t))return this.previous();break;case 39:if(this.isChildOfCarousel(t))return this.next();break;case 9:if(this.isChildOfCarousel(t)&&t instanceof HTMLInputElement&&this.isInViewport(t))return this.next()}},t.prototype.handleEnter=function(e){l.isMouseMoveEvent(e)&&this.autoPlay&&this.props.autoPlay&&this.props.pauseOnHover&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},t.prototype.goToSlide=function(e,n,r){var o=this;if(void 0===r&&(r=!0),!this.isInThrottle){var i=this.state.itemWidth,a=this.props,l=a.afterChange,s=a.beforeChange,c=this.state.currentSlide;"function"!=typeof s||n&&("object"!=typeof n||n.skipBeforeChange)||s(e,this.getState()),this.isAnimationAllowed=r,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({currentSlide:e,transform:-i*e},function(){o.props.infinite&&o.correctClonesPosition({domLoaded:!0}),"function"!=typeof l||n&&("object"!=typeof n||n.skipAfterChange)||(t.afterChangeTimeout3=setTimeout(function(){l(c,o.getState())},o.props.transitionDuration||p))})}},t.prototype.getState=function(){return this.state},t.prototype.renderLeftArrow=function(e){var t=this,n=this.props,r=n.customLeftArrow,o=n.rtl;return i.createElement(c.LeftArrow,{customLeftArrow:r,getState:function(){return t.getState()},previous:this.previous,disabled:e,rtl:o})},t.prototype.renderRightArrow=function(e){var t=this,n=this.props,r=n.customRightArrow,o=n.rtl;return i.createElement(c.RightArrow,{customRightArrow:r,getState:function(){return t.getState()},next:this.next,disabled:e,rtl:o})},t.prototype.renderButtonGroups=function(){var e=this,t=this.props.customButtonGroup;return t?i.cloneElement(t,{previous:function(){return e.previous()},next:function(){return e.next()},goToSlide:function(t,n){return e.goToSlide(t,n)},carouselState:this.getState()}):null},t.prototype.renderDotsList=function(){var e=this;return i.createElement(s.default,{state:this.state,props:this.props,goToSlide:this.goToSlide,getState:function(){return e.getState()}})},t.prototype.renderCarouselItems=function(){var e=[];if(this.props.infinite){var t=i.Children.toArray(this.props.children);e=a.getClones(this.state.slidesToShow,t)}return i.createElement(u.default,{clones:e,goToSlide:this.goToSlide,state:this.state,notEnoughChildren:a.notEnoughChildren(this.state),props:this.props})},t.prototype.render=function(){var e=this.props,t=e.deviceType,n=e.arrows,r=e.renderArrowsWhenDisabled,o=e.removeArrowOnDeviceType,l=e.infinite,s=e.containerClass,c=e.sliderClass,u=e.customTransition,p=e.additionalTransfrom,f=e.renderDotsOutside,m=e.renderButtonGroupOutside,g=e.className,v=e.rtl,y=a.getInitialState(this.state,this.props),b=y.shouldRenderOnSSR,w=y.shouldRenderAtAll,k=a.isInLeftEnd(this.state),E=a.isInRightEnd(this.state),O=n&&!(o&&(t&&-1<o.indexOf(t)||this.state.deviceType&&-1<o.indexOf(this.state.deviceType)))&&!a.notEnoughChildren(this.state)&&w,x=!l&&k,S=!l&&E,_=d.getTransform(this.state,this.props);return i.createElement(i.Fragment,null,i.createElement("div",{className:"react-multi-carousel-list "+s+" "+g,dir:v?"rtl":"ltr",ref:this.containerRef},i.createElement("ul",{ref:this.listRef,className:"react-multi-carousel-track "+c,style:{transition:this.isAnimationAllowed?u||h:"none",overflow:b?"hidden":"unset",transform:"translate3d("+(_+p)+"px,0,0)"},onMouseMove:this.handleMove,onMouseDown:this.handleDown,onMouseUp:this.handleOut,onMouseEnter:this.handleEnter,onMouseLeave:this.handleOut,onTouchStart:this.handleDown,onTouchMove:this.handleMove,onTouchEnd:this.handleOut},this.renderCarouselItems()),O&&(!x||r)&&this.renderLeftArrow(x),O&&(!S||r)&&this.renderRightArrow(S),w&&!m&&this.renderButtonGroups(),w&&!f&&this.renderDotsList()),w&&f&&this.renderDotsList(),w&&m&&this.renderButtonGroups())},t.defaultProps={slidesToSlide:1,infinite:!1,draggable:!0,swipeable:!0,arrows:!0,renderArrowsWhenDisabled:!1,containerClass:"",sliderClass:"",itemClass:"",keyBoardControl:!0,autoPlaySpeed:3e3,showDots:!1,renderDotsOutside:!1,renderButtonGroupOutside:!1,minimumTouchDrag:80,className:"",dotListClass:"",focusOnSelect:!1,centerMode:!1,additionalTransfrom:0,pauseOnHover:!0,shouldResetAutoplay:!0,rewind:!1,rtl:!1,rewindWithAnimation:!1},t}(i.Component);t.default=f},6188:e=>{"use strict";e.exports=Math.max},6260:(e,t,n)=>{var r=n(8829);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,n,o,i,a,l;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,a=t.generatedColumn,l=n.generatedColumn,i>o||i==o&&l>=a||r.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.P=o},6462:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){a&&(a.removeAttribute?a.removeAttribute("aria-hidden"):null!=a.length?a.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(a).forEach(function(e){return e.removeAttribute("aria-hidden")})),a=null},t.log=function(){},t.assertNodeList=l,t.setElement=function(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);l(n,t),t=n}return a=t||a},t.validateElement=s,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=s(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.setAttribute("aria-hidden","true")}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=s(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.removeAttribute("aria-hidden")}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){a=null};var r,o=(r=n(9771))&&r.__esModule?r:{default:r},i=n(834),a=null;function l(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function s(e){var t=e||a;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,o.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,n)=>{"use strict";var r=n(453),o=n(3126),i=o([r("%String.prototype.indexOf%")]);e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o([n]):n}},6614:(e,t,n)=>{var r=n(1141),o=n(2471),i=n(840),a=n(308);o="function"==typeof o.default?o.default:o;var l={lowerCaseAttributeNames:!1};function s(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:a(o(e,(t=t||{}).htmlparser2||l),t)}s.domToReact=a,s.htmlToDOM=o,s.attributesToProps=i,s.Comment=r.Comment,s.Element=r.Element,s.ProcessingInstruction=r.ProcessingInstruction,s.Text=r.Text,e.exports=s,s.default=s},6650:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6802);t.populateNextSlides=function(e,t,n){void 0===n&&(n=0);var o,i,a=e.slidesToShow,l=e.currentSlide,s=e.itemWidth,c=e.totalItems,u=r.getSlidesToSlide(e,t),d=l+1+n+a+(0<n?0:u);return i=d<=c?-s*(o=l+n+(0<n?0:u)):c<d&&l!==c-a?-s*(o=c-a):o=void 0,{nextSlides:o,nextPosition:i}}},6691:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNavigator=t.isBrowser=t.off=t.on=t.noop=void 0,t.noop=function(){},t.on=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)},t.off=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)},t.isBrowser="undefined"!=typeof window,t.isNavigator="undefined"!=typeof navigator},6743:(e,t,n)=>{"use strict";var r=n(9353);e.exports=Function.prototype.bind||r},6802:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4867);function o(e){var t=e.slidesToShow;return e.totalItems<t}function i(e,t,n){var r=n||e.transform;return!t.infinite&&0===e.currentSlide||o(e)?r:r+e.itemWidth/2}function a(e){var t=e.currentSlide,n=e.totalItems;return!(t+e.slidesToShow<n)}function l(e,t,n,r){void 0===t&&(t=0);var i=e.currentSlide,l=e.slidesToShow,s=a(e),c=!n.infinite&&s,u=r||e.transform;if(o(e))return u;var d=u+i*t;return c?d+(e.containerWidth-(e.itemWidth-t)*l):d}function s(e,t){return e.rtl?-1*t:t}t.notEnoughChildren=o,t.getInitialState=function(e,t){var n,o=e.domLoaded,i=e.slidesToShow,a=e.containerWidth,l=e.itemWidth,s=t.deviceType,c=t.responsive,u=t.ssr,d=t.partialVisbile,p=t.partialVisible,h=Boolean(o&&i&&a&&l);u&&s&&!h&&(n=r.getWidthFromDeviceType(s,c));var f=Boolean(u&&s&&!h&&n);return{shouldRenderOnSSR:f,flexBisis:n,domFullyLoaded:h,partialVisibilityGutter:r.getPartialVisibilityGutter(c,d||p,s,e.deviceType),shouldRenderAtAll:f||h}},t.getIfSlideIsVisbile=function(e,t){var n=t.currentSlide,r=t.slidesToShow;return n<=e&&e<n+r},t.getTransformForCenterMode=i,t.isInLeftEnd=function(e){return!(0<e.currentSlide)},t.isInRightEnd=a,t.getTransformForPartialVsibile=l,t.parsePosition=s,t.getTransform=function(e,t,n){var o=t.partialVisbile,a=t.partialVisible,c=t.responsive,u=t.deviceType,d=t.centerMode,p=n||e.transform,h=r.getPartialVisibilityGutter(c,o||a,u,e.deviceType);return s(t,a||o?l(e,h,t,n):d?i(e,t,n):p)},t.getSlidesToSlide=function(e,t){var n=e.domLoaded,r=e.slidesToShow,o=e.containerWidth,i=e.itemWidth,a=t.deviceType,l=t.responsive,s=t.slidesToSlide||1,c=Boolean(n&&r&&o&&i);return t.ssr&&t.deviceType&&!c&&Object.keys(l).forEach(function(e){var t=l[e].slidesToSlide;a===e&&t&&(s=t)}),c&&Object.keys(l).forEach(function(e){var t=l[e],n=t.breakpoint,r=t.slidesToSlide,o=n.max,i=n.min;r&&window.innerWidth>=i&&window.innerWidth<=o&&(s=r)}),s}},6811:(e,t)=>{t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},6862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609),o=n(6802),i=n(6802);t.populatePreviousSlides=function(e,t,n){void 0===n&&(n=0);var a,l,s=e.currentSlide,c=e.itemWidth,u=e.slidesToShow,d=t.children,p=t.showDots,h=t.infinite,f=o.getSlidesToSlide(e,t),m=s-n-(0<n?0:f),g=(r.Children.toArray(d).length-u)%f;return l=0<=m?(a=m,p&&!h&&0<g&&i.isInRightEnd(e)&&(a=s-g),-c*a):a=m<0&&0!==s?0:void 0,{nextSlides:a,nextPosition:l}}},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6942:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},6957:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.hasChildren=t.isDocument=t.isDirective=t.isComment=t.isText=t.isCDATA=t.isTag=t.Element=t.Document=t.CDATA=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var a=n(5413),l=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),E(this,e)},e}();t.Node=l;var s=function(e){function t(t){var n=e.call(this)||this;return n.data=t,n}return o(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(l);t.DataNode=s;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.Text,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(s);t.Text=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.Comment,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(s);t.Comment=u;var d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=a.ElementType.Directive,r}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(s);t.ProcessingInstruction=d;var p=function(e){function t(t){var n=e.call(this)||this;return n.children=t,n}return o(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(l);t.NodeWithChildren=p;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=h;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=f;var m=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?a.ElementType.Script:"style"===t?a.ElementType.Style:a.ElementType.Tag);var i=e.call(this,r)||this;return i.name=t,i.attribs=n,i.type=o,i}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}})},enumerable:!1,configurable:!0}),t}(p);function g(e){return(0,a.isTag)(e)}function v(e){return e.type===a.ElementType.CDATA}function y(e){return e.type===a.ElementType.Text}function b(e){return e.type===a.ElementType.Comment}function w(e){return e.type===a.ElementType.Directive}function k(e){return e.type===a.ElementType.Root}function E(e,t){var n;if(void 0===t&&(t=!1),y(e))n=new c(e.data);else if(b(e))n=new u(e.data);else if(g(e)){var r=t?O(e.children):[],o=new m(e.name,i({},e.attribs),r);r.forEach(function(e){return e.parent=o}),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=i({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=i({},e["x-attribsPrefix"])),n=o}else if(v(e)){r=t?O(e.children):[];var a=new h(r);r.forEach(function(e){return e.parent=a}),n=a}else if(k(e)){r=t?O(e.children):[];var l=new f(r);r.forEach(function(e){return e.parent=l}),e["x-mode"]&&(l["x-mode"]=e["x-mode"]),n=l}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var s=new d(e.name,e.data);null!=e["x-name"]&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),n=s}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function O(e){for(var t=e.map(function(e){return E(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=m,t.isTag=g,t.isCDATA=v,t.isText=y,t.isComment=b,t.isDirective=w,t.isDocument=k,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=E},7018:(e,t,n)=>{"use strict";var r=n(9516);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},7035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9189);t.getOriginalCounterPart=r.getOriginalCounterPart,t.getClones=r.getClones,t.checkClonesPosition=r.checkClonesPosition,t.getInitialSlideInInfiniteMode=r.getInitialSlideInInfiniteMode;var o=n(4867);t.getWidthFromDeviceType=o.getWidthFromDeviceType,t.getPartialVisibilityGutter=o.getPartialVisibilityGutter,t.getItemClientSideWidth=o.getItemClientSideWidth;var i=n(6802);t.getInitialState=i.getInitialState,t.getIfSlideIsVisbile=i.getIfSlideIsVisbile,t.getTransformForCenterMode=i.getTransformForCenterMode,t.getTransformForPartialVsibile=i.getTransformForPartialVsibile,t.isInLeftEnd=i.isInLeftEnd,t.isInRightEnd=i.isInRightEnd,t.notEnoughChildren=i.notEnoughChildren,t.getSlidesToSlide=i.getSlidesToSlide;var a=n(2259);t.throttle=a.default;var l=n(4713);t.throwError=l.default;var s=n(6650);t.populateNextSlides=s.populateNextSlides;var c=n(6862);t.populatePreviousSlides=c.populatePreviousSlides;var u=n(251);t.populateSlidesOnMouseTouchMove=u.populateSlidesOnMouseTouchMove},7067:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e);if(n.length){var r=void 0,a=t.shiftKey,l=n[0],s=n[n.length-1],c=i();if(e===c){if(!a)return;r=s}if(s!==c||a||(r=l),l===c&&a&&(r=s),r)return t.preventDefault(),void r.focus();var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null!=u&&"Chrome"!=u[1]&&null==/\biPod\b|\biPad\b/g.exec(navigator.userAgent)){var d=n.indexOf(c);if(d>-1&&(d+=a?-1:1),void 0===(r=n[d]))return t.preventDefault(),void(r=a?s:l).focus();t.preventDefault(),r.focus()}}else t.preventDefault()};var r,o=(r=n(2411))&&r.__esModule?r:{default:r};function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?i(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7146:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},7176:(e,t,n)=>{"use strict";var r,o=n(3126),i=n(8176);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!r&&i&&i(Object.prototype,"__proto__"),l=Object,s=l.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof s&&function(e){return s(null==e?e:l(e))}},7412:(e,t,n)=>{"use strict";var r=n(9516),o=n(7018),i=n(5449),a=n(4896),l={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(5592)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){u.headers[e]={}}),r.forEach(["post","put","patch"],function(e){u.headers[e]=r.merge(l)}),e.exports=u},7522:(e,t,n)=>{"use strict";var r=n(7763);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},7720:(e,t,n)=>{"use strict";var r=n(7146),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),l=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},s=1024;e.exports={arrayToObject:l,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],l=Object.keys(a),s=0;s<l.length;++s){var c=l[s],u=a[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:c}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var l=e;if("symbol"==typeof e?l=Symbol.prototype.toString.call(e):"string"!=typeof e&&(l=String(e)),"iso-8859-1"===n)return escape(l).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",u=0;u<l.length;u+=s){for(var d=l.length>=s?l.slice(u,u+s):l,p=[],h=0;h<d.length;++h){var f=d.charCodeAt(h);45===f||46===f||95===f||126===f||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===r.RFC1738&&(40===f||41===f)?p[p.length]=d.charAt(h):f<128?p[p.length]=a[f]:f<2048?p[p.length]=a[192|f>>6]+a[128|63&f]:f<55296||f>=57344?p[p.length]=a[224|f>>12]+a[128|f>>6&63]+a[128|63&f]:(h+=1,f=65536+((1023&f)<<10|1023&d.charCodeAt(h)),p[p.length]=a[240|f>>18]+a[128|f>>12&63]+a[128|f>>6&63]+a[128|63&f])}c+=p.join("")}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n&&"function"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=l(t,r)),i(t)&&i(n)?(n.forEach(function(n,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n}),t):Object.keys(n).reduce(function(t,i){var a=n[i];return o.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t},a)}}},7727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[i,a],t=0;t<e.length;t++){var n=e[t];n&&n.parentNode&&n.parentNode.removeChild(n)}i=a=null,l=[]},t.log=function(){console.log("bodyTrap ----------"),console.log(l.length);for(var e=[i,a],t=0;t<e.length;t++){var n=e[t]||{};console.log(n.nodeName,n.className,n.id)}console.log("edn bodyTrap ----------")};var r,o=(r=n(9628))&&r.__esModule?r:{default:r},i=void 0,a=void 0,l=[];function s(){0!==l.length&&l[l.length-1].focusContent()}o.default.subscribe(function(e,t){i||a||((i=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),i.style.position="absolute",i.style.opacity="0",i.setAttribute("tabindex","0"),i.addEventListener("focus",s),(a=i.cloneNode()).addEventListener("focus",s)),(l=t).length>0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==a&&document.body.appendChild(a)):(i.parentElement&&i.parentElement.removeChild(i),a.parentElement&&a.parentElement.removeChild(a))})},7731:(e,t,n)=>{for(var r,o=n(1141),i=n(5270).CASE_SENSITIVE_TAG_NAMES,a=o.Comment,l=o.Element,s=o.ProcessingInstruction,c=o.Text,u={},d=0,p=i.length;d<p;d++)r=i[d],u[r.toLowerCase()]=r;function h(e){for(var t,n={},r=0,o=e.length;r<o;r++)n[(t=e[r]).name]=t.value;return n}function f(e){return function(e){return u[e]}(e=e.toLowerCase())||e}t.formatAttributes=h,t.formatDOM=function e(t,n,r){n=n||null;for(var o,i=[],u=0,d=t.length;u<d;u++){var p,m=t[u];switch(m.nodeType){case 1:o=f(m.nodeName),(p=new l(o,h(m.attributes))).children=e("template"===o?m.content.childNodes:m.childNodes,p);break;case 3:p=new c(m.nodeValue);break;case 8:p=new a(m.nodeValue);break;default:continue}var g=i[u-1]||null;g&&(g.next=p),p.parent=n,p.prev=g,p.next=null,i.push(p)}return r&&((p=new s(r.substring(0,r.indexOf(" ")).toLowerCase(),r)).next=i[0]||null,p.parent=n,i.unshift(p),i[1]&&(i[1].prev=i[0])),i}},7763:(e,t,n)=>{"use strict";var r=n(5449);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},7791:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){i=[]},t.log=function(){},t.handleBlur=s,t.handleFocus=c,t.markForFocusLater=function(){i.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==i.length&&(t=i.pop()).focus({preventScroll:e}))}catch(e){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){i.length>0&&i.pop()},t.setupScopedFocus=function(e){a=e,window.addEventListener?(window.addEventListener("blur",s,!1),document.addEventListener("focus",c,!0)):(window.attachEvent("onBlur",s),document.attachEvent("onFocus",c))},t.teardownScopedFocus=function(){a=null,window.addEventListener?(window.removeEventListener("blur",s),document.removeEventListener("focus",c)):(window.detachEvent("onBlur",s),document.detachEvent("onFocus",c))};var r,o=(r=n(2411))&&r.__esModule?r:{default:r},i=[],a=null,l=!1;function s(){l=!0}function c(){if(l){if(l=!1,!a)return;setTimeout(function(){a.contains(document.activeElement)||((0,o.default)(a)[0]||a).focus()},0)}}},7918:(e,t,n)=>{"use strict";var r=n(8907).Y,o="undefined"!=typeof window?window.matchMedia:null;function i(e,t,n){var i,a=this;function l(e){a.matches=e.matches,a.media=e.media}o&&!n&&(i=o.call(window,e)),i?(this.matches=i.matches,this.media=i.media,i.addListener(l)):(this.matches=r(e,t),this.media=e),this.addListener=function(e){i&&i.addListener(e)},this.removeListener=function(e){i&&i.removeListener(e)},this.dispose=function(){i&&i.removeListener(l)}}e.exports=function(e,t,n){return new i(e,t,n)}},7980:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},8002:e=>{"use strict";e.exports=Math.min},8015:(e,t,n)=>{"use strict";var r=n(9516),o=n(9012),i=n(5155),a=n(5343),l=function e(t){var n=new i(t),l=o(i.prototype.request,n);return r.extend(l,i.prototype,n),r.extend(l,n),l.create=function(n){return e(a(t,n))},l}(n(7412));l.Axios=i,l.Cancel=n(1928),l.CancelToken=n(3191),l.isCancel=n(3864),l.VERSION=n(9641).version,l.all=function(e){return Promise.all(e)},l.spread=n(7980),l.isAxiosError=n(5019),e.exports=l,e.exports.default=l},8068:e=>{"use strict";e.exports=SyntaxError},8105:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Direction=void 0,function(e){e.Right="to right",e.Left="to left",e.Down="to bottom",e.Up="to top"}(n||(t.Direction=n={}))},8176:(e,t,n)=>{"use strict";var r=n(6549);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},8371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609);t.LeftArrow=function(e){var t=e.customLeftArrow,n=e.getState,o=e.previous,i=e.disabled,a=e.rtl;if(t)return r.cloneElement(t,{onClick:function(){return o()},carouselState:n(),disabled:i,rtl:a});var l=a?"rtl":"";return r.createElement("button",{"aria-label":"Go to previous slide",className:"react-multiple-carousel__arrow react-multiple-carousel__arrow--left "+l,onClick:function(){return o()},type:"button",disabled:i})},t.RightArrow=function(e){var t=e.customRightArrow,n=e.getState,o=e.next,i=e.disabled,a=e.rtl;if(t)return r.cloneElement(t,{onClick:function(){return o()},carouselState:n(),disabled:i,rtl:a});var l=a?"rtl":"";return r.createElement("button",{"aria-label":"Go to next slide",className:"react-multiple-carousel__arrow react-multiple-carousel__arrow--right "+l,onClick:function(){return o()},type:"button",disabled:i})}},8465:function(e){e.exports=function(){"use strict";const e="SweetAlert2:",t=e=>e.charAt(0).toUpperCase()+e.slice(1),n=e=>Array.prototype.slice.call(e),r=t=>{console.warn("".concat(e," ").concat("object"==typeof t?t.join(" "):t))},o=t=>{console.error("".concat(e," ").concat(t))},i=[],a=(e,t)=>{var n;n='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),i.includes(n)||(i.push(n),r(n))},l=e=>"function"==typeof e?e():e,s=e=>e&&"function"==typeof e.toPromise,c=e=>s(e)?e.toPromise():Promise.resolve(e),u=e=>e&&Promise.resolve(e)===e,d={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},p=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],h={},f=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],m=e=>Object.prototype.hasOwnProperty.call(d,e),g=e=>-1!==p.indexOf(e),v=e=>h[e],y=e=>{m(e)||r('Unknown parameter "'.concat(e,'"'))},b=e=>{f.includes(e)&&r('The parameter "'.concat(e,'" is incompatible with toasts'))},w=e=>{v(e)&&a(e,v(e))},k=e=>{const t={};for(const n in e)t[e[n]]="swal2-"+e[n];return t},E=k(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),O=k(["success","warning","info","question","error"]),x=()=>document.body.querySelector(".".concat(E.container)),S=e=>{const t=x();return t?t.querySelector(e):null},_=e=>S(".".concat(e)),C=()=>_(E.popup),P=()=>_(E.icon),T=()=>_(E.title),A=()=>_(E["html-container"]),M=()=>_(E.image),N=()=>_(E["progress-steps"]),D=()=>_(E["validation-message"]),I=()=>S(".".concat(E.actions," .").concat(E.confirm)),L=()=>S(".".concat(E.actions," .").concat(E.deny)),R=()=>S(".".concat(E.loader)),j=()=>S(".".concat(E.actions," .").concat(E.cancel)),F=()=>_(E.actions),z=()=>_(E.footer),B=()=>_(E["timer-progress-bar"]),W=()=>_(E.close),U=()=>{const e=n(C().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((e,t)=>{const n=parseInt(e.getAttribute("tabindex")),r=parseInt(t.getAttribute("tabindex"));return n>r?1:n<r?-1:0}),t=n(C().querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter(e=>"-1"!==e.getAttribute("tabindex"));return(e=>{const t=[];for(let n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t})(e.concat(t)).filter(e=>ae(e))},V=()=>$(document.body,E.shown)&&!$(document.body,E["toast-shown"])&&!$(document.body,E["no-backdrop"]),H=()=>C()&&$(C(),E.toast),q={previousBodyPadding:null},Q=(e,t)=>{if(e.textContent="",t){const r=(new DOMParser).parseFromString(t,"text/html");n(r.querySelector("head").childNodes).forEach(t=>{e.appendChild(t)}),n(r.querySelector("body").childNodes).forEach(t=>{e.appendChild(t)})}},$=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t<n.length;t++)if(!e.classList.contains(n[t]))return!1;return!0},G=(e,t,o)=>{if(((e,t)=>{n(e.classList).forEach(n=>{Object.values(E).includes(n)||Object.values(O).includes(n)||Object.values(t.showClass).includes(n)||e.classList.remove(n)})})(e,t),t.customClass&&t.customClass[o]){if("string"!=typeof t.customClass[o]&&!t.customClass[o].forEach)return r("Invalid type of customClass.".concat(o,'! Expected string or iterable object, got "').concat(typeof t.customClass[o],'"'));Z(e,t.customClass[o])}},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(E.popup," > .").concat(E[t]));case"checkbox":return e.querySelector(".".concat(E.popup," > .").concat(E.checkbox," input"));case"radio":return e.querySelector(".".concat(E.popup," > .").concat(E.radio," input:checked"))||e.querySelector(".".concat(E.popup," > .").concat(E.radio," input:first-child"));case"range":return e.querySelector(".".concat(E.popup," > .").concat(E.range," input"));default:return e.querySelector(".".concat(E.popup," > .").concat(E.input))}},X=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},K=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(t=>{Array.isArray(e)?e.forEach(e=>{n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)}))},Z=(e,t)=>{K(e,t,!0)},J=(e,t)=>{K(e,t,!1)},ee=(e,t)=>{const r=n(e.childNodes);for(let e=0;e<r.length;e++)if($(r[e],t))return r[e]},te=(e,t,n)=>{n==="".concat(parseInt(n))&&(n=parseInt(n)),n||0===parseInt(n)?e.style[t]="number"==typeof n?"".concat(n,"px"):n:e.style.removeProperty(t)},ne=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e.style.display=t},re=e=>{e.style.display="none"},oe=(e,t,n,r)=>{const o=e.querySelector(t);o&&(o.style[n]=r)},ie=(e,t,n)=>{t?ne(e,n):re(e)},ae=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),le=e=>!!(e.scrollHeight>e.clientHeight),se=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),r=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||r>0},ce=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=B();ae(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))},ue=()=>"undefined"==typeof window||"undefined"==typeof document,de={},pe=e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,r=window.scrollY;de.restoreFocusTimeout=setTimeout(()=>{de.previousActiveElement&&de.previousActiveElement.focus?(de.previousActiveElement.focus(),de.previousActiveElement=null):document.body&&document.body.focus(),t()},100),window.scrollTo(n,r)}),he='\n <div aria-labelledby="'.concat(E.title,'" aria-describedby="').concat(E["html-container"],'" class="').concat(E.popup,'" tabindex="-1">\n <button type="button" class="').concat(E.close,'"></button>\n <ul class="').concat(E["progress-steps"],'"></ul>\n <div class="').concat(E.icon,'"></div>\n <img class="').concat(E.image,'" />\n <h2 class="').concat(E.title,'" id="').concat(E.title,'"></h2>\n <div class="').concat(E["html-container"],'" id="').concat(E["html-container"],'"></div>\n <input class="').concat(E.input,'" />\n <input type="file" class="').concat(E.file,'" />\n <div class="').concat(E.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(E.select,'"></select>\n <div class="').concat(E.radio,'"></div>\n <label for="').concat(E.checkbox,'" class="').concat(E.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(E.label,'"></span>\n </label>\n <textarea class="').concat(E.textarea,'"></textarea>\n <div class="').concat(E["validation-message"],'" id="').concat(E["validation-message"],'"></div>\n <div class="').concat(E.actions,'">\n <div class="').concat(E.loader,'"></div>\n <button type="button" class="').concat(E.confirm,'"></button>\n <button type="button" class="').concat(E.deny,'"></button>\n <button type="button" class="').concat(E.cancel,'"></button>\n </div>\n <div class="').concat(E.footer,'"></div>\n <div class="').concat(E["timer-progress-bar-container"],'">\n <div class="').concat(E["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),fe=()=>{de.currentInstance.resetValidationMessage()},me=e=>{const t=(()=>{const e=x();return!!e&&(e.remove(),J([document.documentElement,document.body],[E["no-backdrop"],E["toast-shown"],E["has-column"]]),!0)})();if(ue())return void o("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=E.container,t&&Z(n,E["no-transition"]),Q(n,he);const r="string"==typeof(i=e.target)?document.querySelector(i):i;var i;r.appendChild(n),(e=>{const t=C();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&Z(x(),E.rtl)})(r),(()=>{const e=C(),t=ee(e,E.input),n=ee(e,E.file),r=e.querySelector(".".concat(E.range," input")),o=e.querySelector(".".concat(E.range," output")),i=ee(e,E.select),a=e.querySelector(".".concat(E.checkbox," input")),l=ee(e,E.textarea);t.oninput=fe,n.onchange=fe,i.onchange=fe,a.onchange=fe,l.oninput=fe,r.oninput=()=>{fe(),o.value=r.value},r.onchange=()=>{fe(),r.nextSibling.value=r.value}})()},ge=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?ve(e,t):e&&Q(t,e)},ve=(e,t)=>{e.jquery?ye(t,e):Q(t,e.toString())},ye=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},be=(()=>{if(ue())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),we=(e,t)=>{const n=F(),r=R();t.showConfirmButton||t.showDenyButton||t.showCancelButton?ne(n):re(n),G(n,t,"actions"),function(e,t,n){const r=I(),o=L(),i=j();ke(r,"confirm",n),ke(o,"deny",n),ke(i,"cancel",n),function(e,t,n,r){if(!r.buttonsStyling)return J([e,t,n],E.styled);Z([e,t,n],E.styled),r.confirmButtonColor&&(e.style.backgroundColor=r.confirmButtonColor,Z(e,E["default-outline"])),r.denyButtonColor&&(t.style.backgroundColor=r.denyButtonColor,Z(t,E["default-outline"])),r.cancelButtonColor&&(n.style.backgroundColor=r.cancelButtonColor,Z(n,E["default-outline"]))}(r,o,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,r),e.insertBefore(o,r)):(e.insertBefore(i,t),e.insertBefore(o,t),e.insertBefore(r,t)))}(n,r,t),Q(r,t.loaderHtml),G(r,t,"loader")};function ke(e,n,r){ie(e,r["show".concat(t(n),"Button")],"inline-block"),Q(e,r["".concat(n,"ButtonText")]),e.setAttribute("aria-label",r["".concat(n,"ButtonAriaLabel")]),e.className=E[n],G(e,r,"".concat(n,"Button")),Z(e,r["".concat(n,"ButtonClass")])}const Ee=(e,t)=>{const n=x();n&&(function(e,t){"string"==typeof t?e.style.background=t:t||Z([document.documentElement,document.body],E["no-backdrop"])}(n,t.backdrop),function(e,t){t in E?Z(e,E[t]):(r('The "position" parameter is not valid, defaulting to "center"'),Z(e,E.center))}(n,t.position),function(e,t){if(t&&"string"==typeof t){const n="grow-".concat(t);n in E&&Z(e,E[n])}}(n,t.grow),G(n,t,"container"))};var Oe={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const xe=["input","file","range","select","radio","checkbox","textarea"],Se=e=>{if(!Me[e.input])return o('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Ae(e.input),n=Me[e.input](t,e);ne(n),setTimeout(()=>{X(n)})},_e=(e,t)=>{const n=Y(C(),e);if(n){(e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["type","value","style"].includes(n)||e.removeAttribute(n)}})(n);for(const e in t)n.setAttribute(e,t[e])}},Ce=e=>{const t=Ae(e.input);e.customClass&&Z(t,e.customClass.input)},Pe=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Te=(e,t,n)=>{if(n.inputLabel){e.id=E.input;const r=document.createElement("label"),o=E["input-label"];r.setAttribute("for",e.id),r.className=o,Z(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",r)}},Ae=e=>{const t=E[e]?E[e]:E.input;return ee(C(),t)},Me={};Me.text=Me.email=Me.password=Me.number=Me.tel=Me.url=(e,t)=>("string"==typeof t.inputValue||"number"==typeof t.inputValue?e.value=t.inputValue:u(t.inputValue)||r('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue,'"')),Te(e,e,t),Pe(e,t),e.type=t.input,e),Me.file=(e,t)=>(Te(e,e,t),Pe(e,t),e),Me.range=(e,t)=>{const n=e.querySelector("input"),r=e.querySelector("output");return n.value=t.inputValue,n.type=t.input,r.value=t.inputValue,Te(n,e,t),e},Me.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");Q(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Te(e,e,t),e},Me.radio=e=>(e.textContent="",e),Me.checkbox=(e,t)=>{const n=Y(C(),"checkbox");n.value="1",n.id=E.checkbox,n.checked=Boolean(t.inputValue);const r=e.querySelector("span");return Q(r,t.inputPlaceholder),e},Me.textarea=(e,t)=>{e.value=t.inputValue,Pe(e,t),Te(e,e,t);return setTimeout(()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle(C()).width);new MutationObserver(()=>{const n=e.offsetWidth+(r=e,parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight));var r;C().style.width=n>t?"".concat(n,"px"):null}).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const Ne=(e,t)=>{const n=A();G(n,t,"htmlContainer"),t.html?(ge(t.html,n),ne(n,"block")):t.text?(n.textContent=t.text,ne(n,"block")):re(n),((e,t)=>{const n=C(),r=Oe.innerParams.get(e),o=!r||t.input!==r.input;xe.forEach(e=>{const r=E[e],i=ee(n,r);_e(e,t.inputAttributes),i.className=r,o&&re(i)}),t.input&&(o&&Se(t),Ce(t))})(e,t)},De=(e,t)=>{for(const n in O)t.icon!==n&&J(e,O[n]);Z(e,O[t.icon]),Re(e,t),Ie(),G(e,t,"icon")},Ie=()=>{const e=C(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},Le=(e,t)=>{e.textContent="",t.iconHtml?Q(e,je(t.iconHtml)):"success"===t.icon?Q(e,'\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n'):"error"===t.icon?Q(e,'\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n'):Q(e,je({question:"?",warning:"!",info:"i"}[t.icon]))},Re=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"backgroundColor",t.iconColor);oe(e,".swal2-success-ring","borderColor",t.iconColor)}},je=e=>'<div class="'.concat(E["icon-content"],'">').concat(e,"</div>"),Fe=(e,t)=>{const n=N();if(!t.progressSteps||0===t.progressSteps.length)return re(n);ne(n),n.textContent="",t.currentProgressStep>=t.progressSteps.length&&r("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach((e,r)=>{const o=(e=>{const t=document.createElement("li");return Z(t,E["progress-step"]),Q(t,e),t})(e);if(n.appendChild(o),r===t.currentProgressStep&&Z(o,E["active-progress-step"]),r!==t.progressSteps.length-1){const e=(e=>{const t=document.createElement("li");return Z(t,E["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t})(t);n.appendChild(e)}})},ze=(e,t)=>{e.className="".concat(E.popup," ").concat(ae(e)?t.showClass.popup:""),t.toast?(Z([document.documentElement,document.body],E["toast-shown"]),Z(e,E.toast)):Z(e,E.modal),G(e,t,"popup"),"string"==typeof t.customClass&&Z(e,t.customClass),t.icon&&Z(e,E["icon-".concat(t.icon)])},Be=(e,t)=>{((e,t)=>{const n=x(),r=C();t.toast?(te(n,"width",t.width),r.style.width="100%",r.insertBefore(R(),P())):te(r,"width",t.width),te(r,"padding",t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),re(D()),ze(r,t)})(0,t),Ee(0,t),Fe(0,t),((e,t)=>{const n=Oe.innerParams.get(e),r=P();n&&t.icon===n.icon?(Le(r,t),De(r,t)):t.icon||t.iconHtml?t.icon&&-1===Object.keys(O).indexOf(t.icon)?(o('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),re(r)):(ne(r),Le(r,t),De(r,t),Z(r,t.showClass.icon)):re(r)})(e,t),((e,t)=>{const n=M();if(!t.imageUrl)return re(n);ne(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),te(n,"width",t.imageWidth),te(n,"height",t.imageHeight),n.className=E.image,G(n,t,"image")})(0,t),((e,t)=>{const n=T();ie(n,t.title||t.titleText,"block"),t.title&&ge(t.title,n),t.titleText&&(n.innerText=t.titleText),G(n,t,"title")})(0,t),((e,t)=>{const n=W();Q(n,t.closeButtonHtml),G(n,t,"closeButton"),ie(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)})(0,t),Ne(e,t),we(0,t),((e,t)=>{const n=z();ie(n,t.footer),t.footer&&ge(t.footer,n),G(n,t,"footer")})(0,t),"function"==typeof t.didRender&&t.didRender(C())},We=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Ue=()=>{n(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},Ve=["swal-title","swal-html","swal-footer"],He=e=>{const t={};return n(e.querySelectorAll("swal-param")).forEach(e=>{Ke(e,["name","value"]);const n=e.getAttribute("name"),r=e.getAttribute("value");"boolean"==typeof d[n]&&"false"===r&&(t[n]=!1),"object"==typeof d[n]&&(t[n]=JSON.parse(r))}),t},qe=e=>{const r={};return n(e.querySelectorAll("swal-button")).forEach(e=>{Ke(e,["type","color","aria-label"]);const n=e.getAttribute("type");r["".concat(n,"ButtonText")]=e.innerHTML,r["show".concat(t(n),"Button")]=!0,e.hasAttribute("color")&&(r["".concat(n,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(r["".concat(n,"ButtonAriaLabel")]=e.getAttribute("aria-label"))}),r},Qe=e=>{const t={},n=e.querySelector("swal-image");return n&&(Ke(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},$e=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Ke(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Ge=e=>{const t={},r=e.querySelector("swal-input");r&&(Ke(r,["type","label","placeholder","value"]),t.input=r.getAttribute("type")||"text",r.hasAttribute("label")&&(t.inputLabel=r.getAttribute("label")),r.hasAttribute("placeholder")&&(t.inputPlaceholder=r.getAttribute("placeholder")),r.hasAttribute("value")&&(t.inputValue=r.getAttribute("value")));const o=e.querySelectorAll("swal-input-option");return o.length&&(t.inputOptions={},n(o).forEach(e=>{Ke(e,["value"]);const n=e.getAttribute("value"),r=e.innerHTML;t.inputOptions[n]=r})),t},Ye=(e,t)=>{const n={};for(const r in t){const o=t[r],i=e.querySelector(o);i&&(Ke(i,[]),n[o.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},Xe=e=>{const t=Ve.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);n(e.children).forEach(e=>{const n=e.tagName.toLowerCase();-1===t.indexOf(n)&&r("Unrecognized element <".concat(n,">"))})},Ke=(e,t)=>{n(e.attributes).forEach(n=>{-1===t.indexOf(n.name)&&r(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])})};var Ze={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function Je(e){(function(e){e.inputValidator||Object.keys(Ze).forEach(t=>{e.input===t&&(e.inputValidator=Ze[t])})})(e),e.showLoaderOnConfirm&&!e.preConfirm&&r("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(r('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),me(e)}class et{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const tt=()=>{null===q.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(q.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(q.previousBodyPadding+(()=>{const e=document.createElement("div");e.className=E["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})(),"px"))},nt=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);if(t&&n&&!e.match(/CriOS/i)){const e=44;C().scrollHeight>window.innerHeight-e&&(x().style.paddingBottom="".concat(e,"px"))}},rt=()=>{const e=x();let t;e.ontouchstart=e=>{t=ot(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},ot=e=>{const t=e.target,n=x();return!(it(e)||at(e)||t!==n&&(le(n)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||le(A())&&A().contains(t)))},it=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,at=e=>e.touches&&e.touches.length>1,lt=e=>{const t=x(),r=C();"function"==typeof e.willOpen&&e.willOpen(r);const o=window.getComputedStyle(document.body).overflowY;dt(t,r,e),setTimeout(()=>{ct(t,r)},10),V()&&(ut(t,e.scrollbarPadding,o),n(document.body.children).forEach(e=>{e===x()||e.contains(x())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})),H()||de.previousActiveElement||(de.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout(()=>e.didOpen(r)),J(t,E["no-transition"])},st=e=>{const t=C();if(e.target!==t)return;const n=x();t.removeEventListener(be,st),n.style.overflowY="auto"},ct=(e,t)=>{be&&se(t)?(e.style.overflowY="hidden",t.addEventListener(be,st)):e.style.overflowY="auto"},ut=(e,t,n)=>{(()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!$(document.body,E.iosfix)){const e=document.body.scrollTop;document.body.style.top="".concat(-1*e,"px"),Z(document.body,E.iosfix),rt(),nt()}})(),t&&"hidden"!==n&&tt(),setTimeout(()=>{e.scrollTop=0})},dt=(e,t,n)=>{Z(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),ne(t,"grid"),setTimeout(()=>{Z(t,n.showClass.popup),t.style.removeProperty("opacity")},10),Z([document.documentElement,document.body],E.shown),n.heightAuto&&n.backdrop&&!n.toast&&Z([document.documentElement,document.body],E["height-auto"])},pt=e=>{let t=C();t||new Sn,t=C();const n=R();H()?re(P()):ht(t,e),ne(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},ht=(e,t)=>{const n=F(),r=R();!t&&ae(I())&&(t=I()),ne(n),t&&(re(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),Z([e,n],E.loading)},ft=e=>e.checked?1:0,mt=e=>e.checked?e.value:null,gt=e=>e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,vt=(e,t)=>{const n=C(),r=e=>bt[t.input](n,wt(e),t);s(t.inputOptions)||u(t.inputOptions)?(pt(I()),c(t.inputOptions).then(t=>{e.hideLoading(),r(t)})):"object"==typeof t.inputOptions?r(t.inputOptions):o("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},yt=(e,t)=>{const n=e.getInput();re(n),c(t.inputValue).then(r=>{n.value="number"===t.input?parseFloat(r)||0:"".concat(r),ne(n),n.focus(),e.hideLoading()}).catch(t=>{o("Error in inputValue promise: ".concat(t)),n.value="",ne(n),n.focus(),e.hideLoading()})},bt={select:(e,t,n)=>{const r=ee(e,E.select),o=(e,t,r)=>{const o=document.createElement("option");o.value=r,Q(o,t),o.selected=kt(r,n.inputValue),e.appendChild(o)};t.forEach(e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,r.appendChild(e),n.forEach(t=>o(e,t[1],t[0]))}else o(r,n,t)}),r.focus()},radio:(e,t,n)=>{const r=ee(e,E.radio);t.forEach(e=>{const t=e[0],o=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=E.radio,i.value=t,kt(t,n.inputValue)&&(i.checked=!0);const l=document.createElement("span");Q(l,o),l.className=E.label,a.appendChild(i),a.appendChild(l),r.appendChild(a)});const o=r.querySelectorAll("input");o.length&&o[0].focus()}},wt=e=>{const t=[];return"undefined"!=typeof Map&&e instanceof Map?e.forEach((e,n)=>{let r=e;"object"==typeof r&&(r=wt(r)),t.push([n,r])}):Object.keys(e).forEach(n=>{let r=e[n];"object"==typeof r&&(r=wt(r)),t.push([n,r])}),t},kt=(e,t)=>t&&t.toString()===e.toString();function Et(){const e=Oe.innerParams.get(this);if(!e)return;const t=Oe.domCache.get(this);re(t.loader),H()?e.icon&&ne(P()):Ot(t),J([t.popup,t.actions],E.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Ot=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?ne(t[0],"inline-block"):!ae(I())&&!ae(L())&&!ae(j())&&re(e.actions)};var xt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const St=()=>I()&&I().click(),_t=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Ct=(e,t,n)=>{const r=U();if(r.length)return(t+=n)===r.length?t=0:-1===t&&(t=r.length-1),r[t].focus();C().focus()},Pt=["ArrowRight","ArrowDown"],Tt=["ArrowLeft","ArrowUp"],At=(e,t,n)=>{const r=Oe.innerParams.get(e);r&&(t.isComposing||229===t.keyCode||(r.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Mt(e,t,r):"Tab"===t.key?Nt(t,r):[...Pt,...Tt].includes(t.key)?Dt(t.key):"Escape"===t.key&&It(t,r,n)))},Mt=(e,t,n)=>{if(l(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;St(),t.preventDefault()}},Nt=(e,t)=>{const n=e.target,r=U();let o=-1;for(let e=0;e<r.length;e++)if(n===r[e]){o=e;break}e.shiftKey?Ct(0,o,-1):Ct(0,o,1),e.stopPropagation(),e.preventDefault()},Dt=e=>{if(![I(),L(),j()].includes(document.activeElement))return;const t=Pt.includes(e)?"nextElementSibling":"previousElementSibling";let n=document.activeElement;for(let e=0;e<F().children.length;e++){if(n=n[t],!n)return;if(ae(n)&&n instanceof HTMLButtonElement)break}n instanceof HTMLButtonElement&&n.focus()},It=(e,t,n)=>{l(t.allowEscapeKey)&&(e.preventDefault(),n(We.esc))};function Lt(e,t,n,r){H()?Ut(e,r):(pe(n).then(()=>Ut(e,r)),_t(de)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),V()&&(null!==q.previousBodyPadding&&(document.body.style.paddingRight="".concat(q.previousBodyPadding,"px"),q.previousBodyPadding=null),(()=>{if($(document.body,E.iosfix)){const e=parseInt(document.body.style.top,10);J(document.body,E.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Ue()),J([document.documentElement,document.body],[E.shown,E["height-auto"],E["no-backdrop"],E["toast-shown"]])}function Rt(e){e=zt(e);const t=xt.swalPromiseResolve.get(this),n=jt(this);this.isAwaitingPromise()?e.isDismissed||(Ft(this),t(e)):n&&t(e)}const jt=e=>{const t=C();if(!t)return!1;const n=Oe.innerParams.get(e);if(!n||$(t,n.hideClass.popup))return!1;J(t,n.showClass.popup),Z(t,n.hideClass.popup);const r=x();return J(r,n.showClass.backdrop),Z(r,n.hideClass.backdrop),Bt(e,t,n),!0};const Ft=e=>{e.isAwaitingPromise()&&(Oe.awaitingPromise.delete(e),Oe.innerParams.get(e)||e._destroy())},zt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Bt=(e,t,n)=>{const r=x(),o=be&&se(t);"function"==typeof n.willClose&&n.willClose(t),o?Wt(e,t,r,n.returnFocus,n.didClose):Lt(e,r,n.returnFocus,n.didClose)},Wt=(e,t,n,r,o)=>{de.swalCloseEventFinishedCallback=Lt.bind(null,e,n,r,o),t.addEventListener(be,function(e){e.target===t&&(de.swalCloseEventFinishedCallback(),delete de.swalCloseEventFinishedCallback)})},Ut=(e,t)=>{setTimeout(()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy()})};function Vt(e,t,n){const r=Oe.domCache.get(e);t.forEach(e=>{r[e].disabled=n})}function Ht(e,t){if(!e)return!1;if("radio"===e.type){const n=e.parentNode.parentNode.querySelectorAll("input");for(let e=0;e<n.length;e++)n[e].disabled=t}else e.disabled=t}const qt=e=>{const t={};return Object.keys(e).forEach(n=>{g(n)?t[n]=e[n]:r('Invalid parameter to update: "'.concat(n,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md'))}),t};const Qt=e=>{$t(e),delete e.params,delete de.keydownHandler,delete de.keydownTarget,delete de.currentInstance},$t=e=>{e.isAwaitingPromise()?(Gt(Oe,e),Oe.awaitingPromise.set(e,!0)):(Gt(xt,e),Gt(Oe,e))},Gt=(e,t)=>{for(const n in e)e[n].delete(t)};var Yt=Object.freeze({hideLoading:Et,disableLoading:Et,getInput:function(e){const t=Oe.innerParams.get(e||this),n=Oe.domCache.get(e||this);return n?Y(n.popup,t.input):null},close:Rt,isAwaitingPromise:function(){return!!Oe.awaitingPromise.get(this)},rejectPromise:function(e){const t=xt.swalPromiseReject.get(this);Ft(this),t&&t(e)},handleAwaitingPromise:Ft,closePopup:Rt,closeModal:Rt,closeToast:Rt,enableButtons:function(){Vt(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){Vt(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return Ht(this.getInput(),!1)},disableInput:function(){return Ht(this.getInput(),!0)},showValidationMessage:function(e){const t=Oe.domCache.get(this),n=Oe.innerParams.get(this);Q(t.validationMessage,e),t.validationMessage.className=E["validation-message"],n.customClass&&n.customClass.validationMessage&&Z(t.validationMessage,n.customClass.validationMessage),ne(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",E["validation-message"]),X(r),Z(r,E.inputerror))},resetValidationMessage:function(){const e=Oe.domCache.get(this);e.validationMessage&&re(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),J(t,E.inputerror))},getProgressSteps:function(){return Oe.domCache.get(this).progressSteps},update:function(e){const t=C(),n=Oe.innerParams.get(this);if(!t||$(t,n.hideClass.popup))return r("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const o=qt(e),i=Object.assign({},n,o);Be(this,i),Oe.innerParams.set(this,i),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){const e=Oe.domCache.get(this),t=Oe.innerParams.get(this);t?(e.popup&&de.swalCloseEventFinishedCallback&&(de.swalCloseEventFinishedCallback(),delete de.swalCloseEventFinishedCallback),de.deferDisposalTimer&&(clearTimeout(de.deferDisposalTimer),delete de.deferDisposalTimer),"function"==typeof t.didDestroy&&t.didDestroy(),Qt(this)):$t(this)}});const Xt=(e,n)=>{const r=Oe.innerParams.get(e);if(!r.input)return o('The "input" parameter is needed to be set when using returnInputValueOn'.concat(t(n)));const i=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return ft(n);case"radio":return mt(n);case"file":return gt(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,r);r.inputValidator?Kt(e,i,n):e.getInput().checkValidity()?"deny"===n?Zt(e,i):tn(e,i):(e.enableButtons(),e.showValidationMessage(r.validationMessage))},Kt=(e,t,n)=>{const r=Oe.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>c(r.inputValidator(t,r.validationMessage))).then(r=>{e.enableButtons(),e.enableInput(),r?e.showValidationMessage(r):"deny"===n?Zt(e,t):tn(e,t)})},Zt=(e,t)=>{const n=Oe.innerParams.get(e||void 0);n.showLoaderOnDeny&&pt(L()),n.preDeny?(Oe.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>c(n.preDeny(t,n.validationMessage))).then(n=>{!1===n?(e.hideLoading(),Ft(e)):e.closePopup({isDenied:!0,value:void 0===n?t:n})}).catch(t=>en(e||void 0,t))):e.closePopup({isDenied:!0,value:t})},Jt=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},en=(e,t)=>{e.rejectPromise(t)},tn=(e,t)=>{const n=Oe.innerParams.get(e||void 0);n.showLoaderOnConfirm&&pt(),n.preConfirm?(e.resetValidationMessage(),Oe.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>c(n.preConfirm(t,n.validationMessage))).then(n=>{ae(D())||!1===n?(e.hideLoading(),Ft(e)):Jt(e,void 0===n?t:n)}).catch(t=>en(e||void 0,t))):Jt(e,t)},nn=(e,t,n)=>{t.popup.onclick=()=>{const t=Oe.innerParams.get(e);t&&(rn(t)||t.timer||t.input)||n(We.close)}},rn=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let on=!1;const an=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(on=!0)}}},ln=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(on=!0)}}},sn=(e,t,n)=>{t.container.onclick=r=>{const o=Oe.innerParams.get(e);on?on=!1:r.target===t.container&&l(o.allowOutsideClick)&&n(We.backdrop)}},cn=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const un=()=>{if(de.timeout)return(()=>{const e=B(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.removeProperty("transition"),e.style.width="".concat(n,"%")})(),de.timeout.stop()},dn=()=>{if(de.timeout){const e=de.timeout.start();return ce(e),e}};let pn=!1;const hn={};const fn=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in hn){const n=t.getAttribute(e);if(n)return void hn[e].fire({template:n})}};var mn=Object.freeze({isValidParameter:m,isUpdatableParameter:g,isDeprecatedParameter:v,argsToParams:e=>{const t={};return"object"!=typeof e[0]||cn(e[0])?["title","html","icon"].forEach((n,r)=>{const i=e[r];"string"==typeof i||cn(i)?t[n]=i:void 0!==i&&o("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof i))}):Object.assign(t,e[0]),t},isVisible:()=>ae(C()),clickConfirm:St,clickDeny:()=>L()&&L().click(),clickCancel:()=>j()&&j().click(),getContainer:x,getPopup:C,getTitle:T,getHtmlContainer:A,getImage:M,getIcon:P,getInputLabel:()=>_(E["input-label"]),getCloseButton:W,getActions:F,getConfirmButton:I,getDenyButton:L,getCancelButton:j,getLoader:R,getFooter:z,getTimerProgressBar:B,getFocusableElements:U,getValidationMessage:D,isLoading:()=>C().hasAttribute("data-loading"),fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this(...t)},mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},showLoading:pt,enableLoading:pt,getTimerLeft:()=>de.timeout&&de.timeout.getTimerLeft(),stopTimer:un,resumeTimer:dn,toggleTimer:()=>{const e=de.timeout;return e&&(e.running?un():dn())},increaseTimer:e=>{if(de.timeout){const t=de.timeout.increase(e);return ce(t,!0),t}},isTimerRunning:()=>de.timeout&&de.timeout.isRunning(),bindClickHandler:function(){hn[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,pn||(document.body.addEventListener("click",fn),pn=!0)}});let gn;class vn{constructor(){if("undefined"==typeof window)return;gn=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=Object.freeze(this.constructor.argsToParams(t));Object.defineProperties(this,{params:{value:r,writable:!1,enumerable:!0,configurable:!0}});const o=this._main(this.params);Oe.promise.set(this,o)}_main(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(e=>{!e.backdrop&&e.allowOutsideClick&&r('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)y(t),e.toast&&b(t),w(t)})(Object.assign({},t,e)),de.currentInstance&&(de.currentInstance._destroy(),V()&&Ue()),de.currentInstance=this;const n=bn(e,t);Je(n),Object.freeze(n),de.timeout&&(de.timeout.stop(),delete de.timeout),clearTimeout(de.restoreFocusTimeout);const o=wn(this);return Be(this,n),Oe.innerParams.set(this,n),yn(this,o,n)}then(e){return Oe.promise.get(this).then(e)}finally(e){return Oe.promise.get(this).finally(e)}}const yn=(e,t,n)=>new Promise((r,o)=>{const i=t=>{e.closePopup({isDismissed:!0,dismiss:t})};xt.swalPromiseResolve.set(e,r),xt.swalPromiseReject.set(e,o),t.confirmButton.onclick=()=>(e=>{const t=Oe.innerParams.get(e);e.disableButtons(),t.input?Xt(e,"confirm"):tn(e,!0)})(e),t.denyButton.onclick=()=>(e=>{const t=Oe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Xt(e,"deny"):Zt(e,!1)})(e),t.cancelButton.onclick=()=>((e,t)=>{e.disableButtons(),t(We.cancel)})(e,i),t.closeButton.onclick=()=>i(We.close),((e,t,n)=>{Oe.innerParams.get(e).toast?nn(e,t,n):(an(t),ln(t),sn(e,t,n))})(e,t,i),((e,t,n,r)=>{_t(t),n.toast||(t.keydownHandler=t=>At(e,t,r),t.keydownTarget=n.keydownListenerCapture?window:C(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)})(e,de,n,i),((e,t)=>{"select"===t.input||"radio"===t.input?vt(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(s(t.inputValue)||u(t.inputValue))&&(pt(I()),yt(e,t))})(e,n),lt(n),kn(de,n,i),En(t,n),setTimeout(()=>{t.container.scrollTop=0})}),bn=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Xe(n),Object.assign(He(n),qe(n),Qe(n),$e(n),Ge(n),Ye(n,Ve))})(e),r=Object.assign({},d,t,n,e);return r.showClass=Object.assign({},d.showClass,r.showClass),r.hideClass=Object.assign({},d.hideClass,r.hideClass),r},wn=e=>{const t={popup:C(),container:x(),actions:F(),confirmButton:I(),denyButton:L(),cancelButton:j(),loader:R(),closeButton:W(),validationMessage:D(),progressSteps:N()};return Oe.domCache.set(e,t),t},kn=(e,t,n)=>{const r=B();re(r),t.timer&&(e.timeout=new et(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(ne(r),G(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ce(t.timer)})))},En=(e,t)=>{if(!t.toast)return l(t.allowEnterKey)?void(On(e,t)||Ct(0,-1,1)):xn()},On=(e,t)=>t.focusDeny&&ae(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ae(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ae(e.confirmButton)||(e.confirmButton.focus(),0)),xn=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};Object.assign(vn.prototype,Yt),Object.assign(vn,mn),Object.keys(Yt).forEach(e=>{vn[e]=function(){if(gn)return gn[e](...arguments)}}),vn.DismissReason=We,vn.version="11.4.8";const Sn=vn;return Sn.default=Sn,Sn}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}')},8636:(e,t,n)=>{"use strict";var r=n(920),o=n(7720),i=n(7146),a=Object.prototype.hasOwnProperty,l={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,s(t)?t:[t])},d=Date.prototype.toISOString,p=i.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},f={},m=function e(t,n,i,a,l,c,d,p,m,g,v,y,b,w,k,E,O,x){for(var S,_=t,C=x,P=0,T=!1;void 0!==(C=C.get(f))&&!T;){var A=C.get(t);if(P+=1,void 0!==A){if(A===P)throw new RangeError("Cyclic object value");T=!0}void 0===C.get(f)&&(P=0)}if("function"==typeof g?_=g(n,_):_ instanceof Date?_=b(_):"comma"===i&&s(_)&&(_=o.maybeMap(_,function(e){return e instanceof Date?b(e):e})),null===_){if(c)return m&&!E?m(n,h.encoder,O,"key",w):n;_=""}if("string"==typeof(S=_)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(_))return m?[k(E?n:m(n,h.encoder,O,"key",w))+"="+k(m(_,h.encoder,O,"value",w))]:[k(n)+"="+k(String(_))];var M,N=[];if(void 0===_)return N;if("comma"===i&&s(_))E&&m&&(_=o.maybeMap(_,m)),M=[{value:_.length>0?_.join(",")||null:void 0}];else if(s(g))M=g;else{var D=Object.keys(_);M=v?D.sort(v):D}var I=p?String(n).replace(/\./g,"%2E"):String(n),L=a&&s(_)&&1===_.length?I+"[]":I;if(l&&s(_)&&0===_.length)return L+"[]";for(var R=0;R<M.length;++R){var j=M[R],F="object"==typeof j&&j&&void 0!==j.value?j.value:_[j];if(!d||null!==F){var z=y&&p?String(j).replace(/\./g,"%2E"):String(j),B=s(_)?"function"==typeof i?i(L,z):L:L+(y?"."+z:"["+z+"]");x.set(t,P);var W=r();W.set(f,x),u(N,e(F,B,i,a,l,c,d,p,"comma"===i&&E&&s(_)?null:m,g,v,y,b,w,k,E,O,W))}}return N};e.exports=function(e,t){var n,o=e,c=function(e){if(!e)return h;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!a.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r,o=i.formatters[n],c=h.filter;if(("function"==typeof e.filter||s(e.filter))&&(c=e.filter),r=e.arrayFormat in l?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":h.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||h.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:r,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:h.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:c,format:n,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):s(c.filter)&&(n=c.filter);var d=[];if("object"!=typeof o||null===o)return"";var p=l[c.arrayFormat],f="comma"===p&&c.commaRoundTrip;n||(n=Object.keys(o)),c.sort&&n.sort(c.sort);for(var g=r(),v=0;v<n.length;++v){var y=n[v],b=o[y];c.skipNulls&&null===b||u(d,m(b,y,p,f,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var w=d.join(c.delimiter),k=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?k+="utf8=%26%2310003%3B&":k+="utf8=%E2%9C%93&"),w.length>0?k+w:""}},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8829:(e,t)=>{t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}t.urlParse=o,t.urlGenerate=i;var a,l,s=(a=function(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var a=t.isAbsolute(n),l=[],s=0,c=0;;){if(s=c,-1===(c=n.indexOf("/",s))){l.push(n.slice(s));break}for(l.push(n.slice(s,c));c<n.length&&"/"===n[c];)c++}var u,d=0;for(c=l.length-1;c>=0;c--)"."===(u=l[c])?l.splice(c,1):".."===u?d++:d>0&&(""===u?(l.splice(c+1,d),d=0):(l.splice(c,2),d--));return""===(n=l.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n},l=[],function(e){for(var t=0;t<l.length;t++)if(l[t].input===e){var n=l[0];return l[0]=l[t],l[t]=n,l[0].result}var r=a(e);return l.unshift({input:e,result:r}),l.length>32&&l.pop(),r});function c(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var l="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=l,i(a)):l}t.normalize=s,t.join=c,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function d(e){return e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function h(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=u?d:function(e){return p(e)?"$"+e:e},t.fromSetString=u?d:function(e){return p(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=h(e.source,t.source);return 0!==r||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:h(e.name,t.name)},t.compareByOriginalPositionsNoSource=function(e,t,n){var r;return 0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:h(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=h(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:h(e.name,t.name)},t.compareByGeneratedPositionsDeflatedNoLine=function(e,t,n){var r=e.generatedColumn-t.generatedColumn;return 0!==r||n||0!==(r=h(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:h(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=h(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:h(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var a=r.path.lastIndexOf("/");a>=0&&(r.path=r.path.substring(0,a+1))}t=c(i(r),t)}return s(t)}},8859:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,l="function"==typeof Set&&Set.prototype,s=Object.getOwnPropertyDescriptor&&l?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=l&&s&&"function"==typeof s.get?s.get:null,u=l&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,v=String.prototype.match,y=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,k=String.prototype.toLowerCase,E=RegExp.prototype.test,O=Array.prototype.concat,x=Array.prototype.join,S=Array.prototype.slice,_=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,P=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,A="function"==typeof Symbol&&"object"==typeof Symbol.iterator,M="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,D=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||E.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-_(-e):_(e);if(r!==e){var o=String(r),i=y.call(t,o.length+1);return b.call(o,n,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,n,"$&_")}var L=n(2634),R=L.custom,j=q(R)?R:null,F={__proto__:null,double:'"',single:"'"},z={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function B(e,t,n){var r=n.quoteStyle||t,o=F[r];return o+e+o}function W(e){return b.call(String(e),/"/g,""")}function U(e){return!M||!("object"==typeof e&&(M in e||void 0!==e[M]))}function V(e){return"[object Array]"===G(e)&&U(e)}function H(e){return"[object RegExp]"===G(e)&&U(e)}function q(e){if(A)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var l=n||{};if($(l,"quoteStyle")&&!$(F,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if($(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!$(l,"customInspect")||l.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if($(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return X(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return m?I(t,w):w}if("bigint"==typeof t){var E=String(t)+"n";return m?I(t,E):E}var _=void 0===l.depth?5:l.depth;if(void 0===r&&(r=0),r>=_&&_>0&&"object"==typeof t)return V(t)?"[Array]":"[Object]";var P,R=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=x.call(Array(e.indent+1)," ")}return{base:n,prev:x.call(Array(t+1),n)}}(l,r);if(void 0===o)o=[];else if(Y(o,t)>=0)return"[Circular]";function z(t,n,i){if(n&&(o=S.call(o)).push(n),i){var a={depth:l.depth};return $(l,"quoteStyle")&&(a.quoteStyle=l.quoteStyle),e(t,a,r+1,o)}return e(t,l,r+1,o)}if("function"==typeof t&&!H(t)){var Q=function(e){if(e.name)return e.name;var t=v.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),K=ne(t,z);return"[Function"+(Q?": "+Q:" (anonymous)")+"]"+(K.length>0?" { "+x.call(K,", ")+" }":"")}if(q(t)){var re=A?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!=typeof t||A?re:Z(re)}if((P=t)&&"object"==typeof P&&("undefined"!=typeof HTMLElement&&P instanceof HTMLElement||"string"==typeof P.nodeName&&"function"==typeof P.getAttribute)){for(var oe="<"+k.call(String(t.nodeName)),ie=t.attributes||[],ae=0;ae<ie.length;ae++)oe+=" "+ie[ae].name+"="+B(W(ie[ae].value),"double",l);return oe+=">",t.childNodes&&t.childNodes.length&&(oe+="..."),oe+"</"+k.call(String(t.nodeName))+">"}if(V(t)){if(0===t.length)return"[]";var le=ne(t,z);return R&&!function(e){for(var t=0;t<e.length;t++)if(Y(e[t],"\n")>=0)return!1;return!0}(le)?"["+te(le,R)+"]":"[ "+x.call(le,", ")+" ]"}if(function(e){return"[object Error]"===G(e)&&U(e)}(t)){var se=ne(t,z);return"cause"in Error.prototype||!("cause"in t)||N.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+x.call(se,", ")+" }":"{ ["+String(t)+"] "+x.call(O.call("[cause]: "+z(t.cause),se),", ")+" }"}if("object"==typeof t&&s){if(j&&"function"==typeof t[j]&&L)return L(t,{depth:_-r});if("symbol"!==s&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ce=[];return a&&a.call(t,function(e,n){ce.push(z(n,t,!0)+" => "+z(e,t))}),ee("Map",i.call(t),ce,R)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ue=[];return u&&u.call(t,function(e){ue.push(z(e,t))}),ee("Set",c.call(t),ue,R)}if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return J("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return J("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return J("WeakRef");if(function(e){return"[object Number]"===G(e)&&U(e)}(t))return Z(z(Number(t)));if(function(e){if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return Z(z(C.call(t)));if(function(e){return"[object Boolean]"===G(e)&&U(e)}(t))return Z(f.call(t));if(function(e){return"[object String]"===G(e)&&U(e)}(t))return Z(z(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof globalThis&&t===globalThis)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===G(e)&&U(e)}(t)&&!H(t)){var de=ne(t,z),pe=D?D(t)===Object.prototype:t instanceof Object||t.constructor===Object,he=t instanceof Object?"":"null prototype",fe=!pe&&M&&Object(t)===t&&M in t?y.call(G(t),8,-1):he?"Object":"",me=(pe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fe||he?"["+x.call(O.call([],fe||[],he||[]),": ")+"] ":"");return 0===de.length?me+"{}":R?me+"{"+te(de,R)+"}":me+"{ "+x.call(de,", ")+" }"}return String(t)};var Q=Object.prototype.hasOwnProperty||function(e){return e in this};function $(e,t){return Q.call(e,t)}function G(e){return m.call(e)}function Y(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function X(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return X(y.call(e,0,t.maxStringLength),t)+r}var o=z[t.quoteStyle||"single"];return o.lastIndex=0,B(b.call(b.call(e,o,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function Z(e){return"Object("+e+")"}function J(e){return e+" { ? }"}function ee(e,t,n,r){return e+" ("+t+") {"+(r?te(n,r):x.call(n,", "))+"}"}function te(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+x.call(e,","+n)+"\n"+t.prev}function ne(e,t){var n=V(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=$(e,o)?t(e[o],e):""}var i,a="function"==typeof P?P(e):[];if(A){i={};for(var l=0;l<a.length;l++)i["$"+a[l]]=a[l]}for(var s in e)$(e,s)&&(n&&String(Number(s))===s&&s<e.length||A&&i["$"+s]instanceof Symbol||(E.call(/[^\w$]/,s)?r.push(t(s,e)+": "+t(e[s],e)):r.push(s+": "+t(e[s],e))));if("function"==typeof P)for(var c=0;c<a.length;c++)N.call(e,a[c])&&r.push("["+t(a[c])+"]: "+t(e[a[c]],e));return r}},8907:(e,t)=>{"use strict";t.Y=function(e,t){return function(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),i=t[1],a=t[2],l=t[3]||"",s={};return s.inverse=!!i&&"not"===i.toLowerCase(),s.type=a?a.toLowerCase():"all",l=l.match(/\([^\)]+\)/g)||[],s.expressions=l.map(function(e){var t=e.match(r),n=t[1].toLowerCase().match(o);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}(e).some(function(e){var n=e.inverse,r="all"===e.type||t.type===e.type;if(r&&n||!r&&!n)return!1;var o=e.expressions.every(function(e){var n=e.feature,r=e.modifier,o=e.value,i=t[n];if(!i)return!1;switch(n){case"orientation":case"scan":return i.toLowerCase()===o.toLowerCase();case"width":case"height":case"device-width":case"device-height":o=c(o),i=c(i);break;case"resolution":o=s(o),i=s(i);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":o=l(o),i=l(i);break;case"grid":case"color":case"color-index":case"monochrome":o=parseInt(o,10)||1,i=parseInt(i,10)||0}switch(r){case"min":return i>=o;case"max":return i<=o;default:return i===o}});return o&&!n||!o&&n})};var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,r=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,o=/^(?:(min|max)-)?(.+)/,i=/(em|rem|px|cm|mm|in|pt|pc)?$/,a=/(dpi|dpcm|dppx)?$/;function l(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function s(e){var t=parseFloat(e);switch(String(e).match(a)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function c(e){var t=parseFloat(e);switch(String(e).match(i)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},8917:(e,t)=>{"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,o=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(e,t){return t.toUpperCase()},s=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||o.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(a,s):e.replace(i,s)).replace(r,l))}},8968:e=>{"use strict";e.exports=Math.floor},8989:(e,t)=>{"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,l=60109,s=60110,c=60112,u=60113,d=60120,p=60115,h=60116;if("function"==typeof Symbol&&Symbol.for){var f=Symbol.for;n=f("react.element"),r=f("react.portal"),o=f("react.fragment"),i=f("react.strict_mode"),a=f("react.profiler"),l=f("react.provider"),s=f("react.context"),c=f("react.forward_ref"),u=f("react.suspense"),d=f("react.suspense_list"),p=f("react.memo"),h=f("react.lazy"),f("react.block"),f("react.server.block"),f("react.fundamental"),f("react.debug_trace_mode"),f("react.legacy_hidden")}t.isContextConsumer=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case a:case i:case u:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case h:case p:case l:return e;default:return t}}case r:return t}}}(e)===s}},9012:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},9090:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||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},o="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},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1609),l=g(n(5556)),s=m(n(7791)),c=g(n(7067)),u=m(n(6462)),d=m(n(4838)),p=n(834),h=g(p),f=g(n(9628));function m(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function g(e){return e&&e.__esModule?e:{default:e}}n(7727);var v={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},y=0,b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setOverlayRef=function(e){n.overlay=e,n.props.overlayRef&&n.props.overlayRef(e)},n.setContentRef=function(e){n.content=e,n.props.contentRef&&n.props.contentRef(e)},n.afterClose=function(){var e=n.props,t=e.appElement,r=e.ariaHideApp,o=e.htmlOpenClassName,i=e.bodyOpenClassName,a=e.parentSelector,l=a&&a().ownerDocument||document;i&&d.remove(l.body,i),o&&d.remove(l.getElementsByTagName("html")[0],o),r&&y>0&&0==(y-=1)&&u.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(s.returnFocus(n.props.preventScroll),s.teardownScopedFocus()):s.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),f.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(s.setupScopedFocus(n.node),s.markForFocusLater()),n.setState({isOpen:!0},function(){n.openAnimationFrame=requestAnimationFrame(function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})})}))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())})},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){(function(e){return"Tab"===e.code||9===e.keyCode})(e)&&(0,c.default)(n.content,e),n.props.shouldCloseOnEsc&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var r="object"===(void 0===t?"undefined":o(t))?t:{base:v[e],afterOpen:v[e]+"--after-open",beforeClose:v[e]+"--before-close"},i=r.base;return n.state.afterOpen&&(i=i+" "+r.afterOpen),n.state.beforeClose&&(i=i+" "+r.beforeClose),"string"==typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce(function(n,r){return n[e+"-"+r]=t[r],n},{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,o=e.bodyOpenClassName,i=e.parentSelector,a=i&&i().ownerDocument||document;o&&d.add(a.body,o),r&&d.add(a.getElementsByTagName("html")[0],r),n&&(y+=1,u.hide(t)),f.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,o=e.overlayClassName,i=e.defaultStyles,a=e.children,l=n?{}:i.content,s=o?{}:i.overlay;if(this.shouldBeClosed())return null;var c={ref:this.setOverlayRef,className:this.buildClassName("overlay",o),style:r({},s,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},u=r({id:t,ref:this.setContentRef,style:r({},l,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(u,a);return this.props.overlayElement(c,d)}}]),t}(a.Component);b.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},b.propTypes={isOpen:l.default.bool.isRequired,defaultStyles:l.default.shape({content:l.default.object,overlay:l.default.object}),style:l.default.shape({content:l.default.object,overlay:l.default.object}),className:l.default.oneOfType([l.default.string,l.default.object]),overlayClassName:l.default.oneOfType([l.default.string,l.default.object]),parentSelector:l.default.func,bodyOpenClassName:l.default.string,htmlOpenClassName:l.default.string,ariaHideApp:l.default.bool,appElement:l.default.oneOfType([l.default.instanceOf(h.default),l.default.instanceOf(p.SafeHTMLCollection),l.default.instanceOf(p.SafeNodeList),l.default.arrayOf(l.default.instanceOf(h.default))]),onAfterOpen:l.default.func,onAfterClose:l.default.func,onRequestClose:l.default.func,closeTimeoutMS:l.default.number,shouldFocusAfterRender:l.default.bool,shouldCloseOnOverlayClick:l.default.bool,shouldReturnFocusAfterClose:l.default.bool,preventScroll:l.default.bool,role:l.default.string,contentLabel:l.default.string,aria:l.default.object,data:l.default.object,children:l.default.node,shouldCloseOnEsc:l.default.bool,overlayRef:l.default.func,contentRef:l.default.func,id:l.default.string,overlayElement:l.default.func,contentElement:l.default.func,testId:l.default.string},t.default=b,e.exports=t.default},9106:(e,t,n)=>{"use strict";var r=n(9516);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))}))}),i=a.join("&")}if(i){var l=e.indexOf("#");-1!==l&&(e=e.slice(0,l)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},9108:(e,t,n)=>{var r=n(9788);function o(e,t){var n,o=null;if(!e||"string"!=typeof e)return o;for(var i,a,l=r(e),s="function"==typeof t,c=0,u=l.length;c<u;c++)i=(n=l[c]).property,a=n.value,s?t(i,a,n):a&&(o||(o={}),o[i]=a);return o}e.exports=o,e.exports.default=o},9137:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},9189:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOriginalCounterPart=function(e,t,n){var r=t.slidesToShow,o=t.currentSlide;return n.length>2*r?e+2*r:o>=n.length?n.length+e:e},t.getOriginalIndexLookupTableByClones=function(e,t){if(t.length>2*e){for(var n={},r=t.length-2*e,o=t.length-r,i=r,a=0;a<o;a++)n[a]=i,i++;var l=t.length+o,s=l+t.slice(0,2*e).length,c=0;for(a=l;a<=s;a++)n[a]=c,c++;var u=l,d=0;for(a=o;a<u;a++)n[a]=d,d++;return n}n={};var p=3*t.length,h=0;for(a=0;a<p;a++)n[a]=h,++h===t.length&&(h=0);return n},t.getClones=function(e,t){return t.length<e?t:t.length>2*e?t.slice(t.length-2*e,t.length).concat(t,t.slice(0,2*e)):t.concat(t,t)},t.getInitialSlideInInfiniteMode=function(e,t){return t.length>2*e?2*e:t.length},t.checkClonesPosition=function(e,t,n){var r,o=e.currentSlide,i=e.slidesToShow,a=e.itemWidth,l=e.totalItems,s=0,c=0,u=0===o,d=t.length-(t.length-2*i);return t.length<i?(c=s=0,u=r=!1):t.length>2*i?((r=o>=d+t.length)&&(c=-a*(s=o-t.length)),u&&(c=-a*(s=d+(t.length-2*i)))):((r=o>=2*t.length)&&(c=-a*(s=o-t.length)),u&&(c=n.showDots?-a*(s=t.length):-a*(s=l/3))),{isReachingTheEnd:r,isReachingTheStart:u,nextSlide:s,nextPosition:c}}},9290:e=>{"use strict";e.exports=RangeError},9353:e=>{"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),l=n(0,o.length-a.length),s=[],c=0;c<l;c++)s[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=",");return t}(s)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,r(a,arguments));return Object(t)===t?t:this}return o.apply(e,r(a,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},9383:e=>{"use strict";e.exports=Error},9516:(e,t,n)=>{"use strict";var r=n(9012),o=Object.prototype.toString;function i(e){return Array.isArray(e)}function a(e){return void 0===e}function l(e){return"[object ArrayBuffer]"===o.call(e)}function s(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===o.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isPlainObject:c,isUndefined:a,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return s(e)&&u(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===o.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:d,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t}),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},9538:e=>{"use strict";e.exports=ReferenceError},9612:e=>{"use strict";e.exports=Object},9615:(e,t,n)=>{"use strict";var r=n(9137),o=n(4680);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},9628:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(r.openInstances.length),r.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")},t.resetState=function(){r=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach(function(n){return n(e,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},r=new n;t.default=r},9641:e=>{e.exports={version:"0.26.1"}},9644:function(e,t,n){e.exports=function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e),o=n(t);const i=[{key:"title",getter:e=>e.getTitle()},{key:"html",getter:e=>e.getHtmlContainer()},{key:"confirmButtonText",getter:e=>e.getConfirmButton()},{key:"denyButtonText",getter:e=>e.getDenyButton()},{key:"cancelButtonText",getter:e=>e.getCancelButton()},{key:"footer",getter:e=>e.getFooter()},{key:"closeButtonHtml",getter:e=>e.getCloseButton()},{key:"iconHtml",getter:e=>e.getIcon().querySelector(".swal2-icon-content")},{key:"loaderHtml",getter:e=>e.getLoader()}],a=()=>{};return function(e){function t(e){const t={},n={},o=i.map(e=>e.key);return Object.entries(e).forEach(([e,i])=>{o.includes(e)&&r.default.isValidElement(i)?(t[e]=i,n[e]=" "):n[e]=i}),[t,n]}function n(t,n){Object.entries(n).forEach(([n,r])=>{const a=i.find(e=>e.key===n).getter(e);o.default.render(r,a),t.__mountedDomElements.push(a)})}function l(e){e.__mountedDomElements.forEach(e=>{o.default.unmountComponentAtNode(e)}),e.__mountedDomElements=[]}return class extends e{static argsToParams(t){if(r.default.isValidElement(t[0])||r.default.isValidElement(t[1])){const e={};return["title","html","icon"].forEach((n,r)=>{void 0!==t[r]&&(e[n]=t[r])}),e}return e.argsToParams(t)}_main(e,r){this.__mountedDomElements=[],this.__params=Object.assign({},r,e);const[o,i]=t(this.__params),s=i.didOpen||a,c=i.didDestroy||a;return super._main(Object.assign({},i,{didOpen:e=>{n(this,o),s(e)},didDestroy:e=>{c(e),l(this)}}))}update(e){Object.assign(this.__params,e),l(this);const[r,o]=t(this.__params);super.update(o),n(this,r)}}}}(n(1609),n(5795))},9675:e=>{"use strict";e.exports=TypeError},9771:e=>{"use strict";e.exports=function(){}},9788:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(s,c):c}e.exports=function(e,s){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};var d=1,p=1;function h(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function f(){var e={line:d,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=s.source}m.prototype.content=e;var g=[];function v(t){var n=new Error(s.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=s.source,n.line=d,n.column=p,n.source=e,!s.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function b(){y(r)}function w(e){var t;for(e=e||[];t=k();)!1!==t&&e.push(t);return e}function k(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return p+=2,h(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function E(){var e=f(),n=y(o);if(n){if(k(),!y(i))return v("property missing ':'");var r=y(a),s=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return y(l),s}}return b(),function(){var e,t=[];for(w(t);e=E();)!1!==e&&(t.push(e),w(t));return t}()}},9905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1635),o=n(1609),i=r.__importDefault(n(2877));t.default=function(e){var t=o.useRef(e);t.current=e,i.default(function(){return function(){return t.current()}})}},9957:(e,t,n)=>{"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(6743);e.exports=i.call(r,o)}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e].call(i.exports,i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var l=2&r&&n;("object"==typeof l||"function"==typeof l)&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach(e=>a[e]=()=>n[e]);return a.default=()=>n,o.d(i,a),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e+"../"})(),o.nc=void 0,(()=>{"use strict";var e={};o.r(e),o.d(e,{safe:()=>S1,spec:()=>x1});var t={};o.r(t),o.d(t,{angle:()=>E2,decibel:()=>C2,flex:()=>_2,frequency:()=>x2,length:()=>k2,resolution:()=>S2,semitones:()=>P2,time:()=>O2});var n={};o.r(n),o.d(n,{getTrace:()=>l3,isKeyword:()=>u3,isProperty:()=>c3,isType:()=>s3});var r={};o.r(r),o.d(r,{generate:()=>U3,name:()=>z3,parse:()=>W3,structure:()=>B3});var i={};o.r(i),o.d(i,{generate:()=>Y3,name:()=>q3,parse:()=>G3,structure:()=>$3,walkContext:()=>Q3});var a={};o.r(a),o.d(a,{generate:()=>e5,name:()=>X3,parse:()=>J3,structure:()=>Z3,walkContext:()=>K3});var l={};o.r(l),o.d(l,{generate:()=>p5,name:()=>c5,parse:()=>d5,structure:()=>u5});var s={};o.r(s),o.d(s,{generate:()=>E5,name:()=>y5,parse:()=>k5,structure:()=>w5,walkContext:()=>b5});var c={};o.r(c),o.d(c,{generate:()=>_5,name:()=>O5,parse:()=>S5,structure:()=>x5});var u={};o.r(u),o.d(u,{generate:()=>A5,name:()=>C5,parse:()=>T5,structure:()=>P5});var d={};o.r(d),o.d(d,{generate:()=>I5,name:()=>M5,parse:()=>D5,structure:()=>N5});var p={};o.r(p),o.d(p,{generate:()=>z5,name:()=>R5,parse:()=>F5,structure:()=>j5});var h={};o.r(h),o.d(h,{generate:()=>$5,name:()=>H5,parse:()=>Q5,structure:()=>q5});var f={};o.r(f),o.d(f,{generate:()=>J5,name:()=>X5,parse:()=>Z5,structure:()=>K5});var m={};o.r(m),o.d(m,{generate:()=>a4,name:()=>t4,parse:()=>i4,structure:()=>n4});var g={};o.r(g),o.d(g,{generate:()=>k4,name:()=>v4,parse:()=>w4,structure:()=>b4,walkContext:()=>y4});var v={};o.r(v),o.d(v,{generate:()=>T4,name:()=>_4,parse:()=>P4,structure:()=>C4});var y={};o.r(y),o.d(y,{generate:()=>D4,name:()=>A4,parse:()=>N4,structure:()=>M4});var b={};o.r(b),o.d(b,{generate:()=>F4,name:()=>L4,parse:()=>j4,structure:()=>R4});var w={};o.r(w),o.d(w,{generate:()=>V4,name:()=>z4,parse:()=>U4,structure:()=>B4});var k={};o.r(k),o.d(k,{generate:()=>J4,name:()=>G4,parse:()=>Z4,structure:()=>Y4});var E={};o.r(E),o.d(E,{generate:()=>o6,name:()=>e6,parse:()=>r6,structure:()=>n6,walkContext:()=>t6});var O={};o.r(O),o.d(O,{generate:()=>s6,name:()=>i6,parse:()=>l6,structure:()=>a6});var x={};o.r(x),o.d(x,{generate:()=>h6,name:()=>u6,parse:()=>p6,structure:()=>d6,xxx:()=>c6});var S={};o.r(S),o.d(S,{generate:()=>v6,name:()=>f6,parse:()=>g6,structure:()=>m6});var _={};o.r(_),o.d(_,{generate:()=>k6,name:()=>y6,parse:()=>w6,structure:()=>b6});var C={};o.r(C),o.d(C,{generate:()=>_6,name:()=>O6,parse:()=>S6,structure:()=>x6});var P={};o.r(P),o.d(P,{generate:()=>A6,name:()=>C6,parse:()=>T6,structure:()=>P6});var T={};o.r(T),o.d(T,{generate:()=>I6,name:()=>M6,parse:()=>D6,structure:()=>N6});var A={};o.r(A),o.d(A,{generate:()=>F6,name:()=>L6,parse:()=>j6,structure:()=>R6});var M={};o.r(M),o.d(M,{generate:()=>V6,name:()=>B6,parse:()=>U6,structure:()=>W6});var N={};o.r(N),o.d(N,{generate:()=>$6,name:()=>H6,parse:()=>Q6,structure:()=>q6});var D={};o.r(D),o.d(D,{generate:()=>K6,name:()=>G6,parse:()=>X6,structure:()=>Y6});var I={};o.r(I),o.d(I,{generate:()=>t8,name:()=>Z6,parse:()=>e8,structure:()=>J6});var L={};o.r(L),o.d(L,{generate:()=>i8,name:()=>n8,parse:()=>o8,structure:()=>r8});var R={};o.r(R),o.d(R,{generate:()=>c8,name:()=>a8,parse:()=>s8,structure:()=>l8});var j={};o.r(j),o.d(j,{generate:()=>f8,name:()=>u8,parse:()=>h8,structure:()=>p8,walkContext:()=>d8});var F={};o.r(F),o.d(F,{generate:()=>b8,name:()=>m8,parse:()=>y8,structure:()=>v8,walkContext:()=>g8});var z={};o.r(z),o.d(z,{generate:()=>S8,name:()=>E8,parse:()=>x8,structure:()=>O8});var B={};o.r(B),o.d(B,{generate:()=>A8,name:()=>C8,parse:()=>T8,structure:()=>P8});var W={};o.r(W),o.d(W,{generate:()=>j8,name:()=>D8,parse:()=>R8,structure:()=>L8,walkContext:()=>I8});var U={};o.r(U),o.d(U,{generate:()=>W8,name:()=>F8,parse:()=>B8,structure:()=>z8});var V={};o.r(V),o.d(V,{generate:()=>q8,name:()=>U8,parse:()=>H8,structure:()=>V8});var H={};o.r(H),o.d(H,{generate:()=>X8,name:()=>Q8,parse:()=>Y8,structure:()=>G8,walkContext:()=>$8});var q={};o.r(q),o.d(q,{generate:()=>o7,name:()=>t7,parse:()=>r7,structure:()=>n7});var Q={};o.r(Q),o.d(Q,{generate:()=>d7,name:()=>l7,parse:()=>u7,structure:()=>c7,walkContext:()=>s7});var $={};o.r($),o.d($,{generate:()=>m7,name:()=>p7,parse:()=>f7,structure:()=>h7});var G={};o.r(G),o.d(G,{generate:()=>E7,name:()=>b7,parse:()=>k7,structure:()=>w7});var Y={};o.r(Y),o.d(Y,{generate:()=>D7,name:()=>A7,parse:()=>N7,structure:()=>M7});var X={};o.r(X),o.d(X,{generate:()=>V7,name:()=>B7,parse:()=>U7,structure:()=>W7});var K={};o.r(K),o.d(K,{generate:()=>$7,name:()=>H7,parse:()=>Q7,structure:()=>q7});var Z={};o.r(Z),o.d(Z,{generate:()=>Z7,name:()=>Y7,parse:()=>K7,structure:()=>X7});var J={};o.r(J),o.d(J,{AnPlusB:()=>r,Atrule:()=>i,AtrulePrelude:()=>a,AttributeSelector:()=>l,Block:()=>s,Brackets:()=>c,CDC:()=>u,CDO:()=>d,ClassSelector:()=>p,Combinator:()=>h,Comment:()=>f,Condition:()=>m,Declaration:()=>g,DeclarationList:()=>v,Dimension:()=>y,Feature:()=>b,FeatureFunction:()=>w,FeatureRange:()=>k,Function:()=>E,GeneralEnclosed:()=>O,Hash:()=>x,IdSelector:()=>_,Identifier:()=>S,Layer:()=>C,LayerList:()=>P,MediaQuery:()=>T,MediaQueryList:()=>A,NestingSelector:()=>M,Nth:()=>N,Number:()=>D,Operator:()=>I,Parentheses:()=>L,Percentage:()=>R,PseudoClassSelector:()=>j,PseudoElementSelector:()=>F,Ratio:()=>z,Raw:()=>B,Rule:()=>W,Scope:()=>U,Selector:()=>V,SelectorList:()=>H,String:()=>q,StyleSheet:()=>Q,SupportsDeclaration:()=>$,TypeSelector:()=>G,UnicodeRange:()=>Y,Url:()=>X,Value:()=>K,WhiteSpace:()=>Z});var ee={};o.r(ee),o.d(ee,{AtrulePrelude:()=>t9,Selector:()=>n9,Value:()=>o9});var te={};function ne(e){return ne="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},ne(e)}function re(){return re=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},re.apply(null,arguments)}o.r(te),o.d(te,{AnPlusB:()=>W3,Atrule:()=>G3,AtrulePrelude:()=>J3,AttributeSelector:()=>d5,Block:()=>k5,Brackets:()=>S5,CDC:()=>T5,CDO:()=>D5,ClassSelector:()=>F5,Combinator:()=>Q5,Comment:()=>Z5,Condition:()=>i4,Declaration:()=>w4,DeclarationList:()=>P4,Dimension:()=>N4,Feature:()=>j4,FeatureFunction:()=>U4,FeatureRange:()=>Z4,Function:()=>r6,GeneralEnclosed:()=>l6,Hash:()=>p6,IdSelector:()=>w6,Identifier:()=>g6,Layer:()=>S6,LayerList:()=>T6,MediaQuery:()=>D6,MediaQueryList:()=>j6,NestingSelector:()=>U6,Nth:()=>Q6,Number:()=>X6,Operator:()=>e8,Parentheses:()=>o8,Percentage:()=>s8,PseudoClassSelector:()=>h8,PseudoElementSelector:()=>y8,Ratio:()=>x8,Raw:()=>T8,Rule:()=>R8,Scope:()=>B8,Selector:()=>H8,SelectorList:()=>Y8,String:()=>r7,StyleSheet:()=>u7,SupportsDeclaration:()=>f7,TypeSelector:()=>k7,UnicodeRange:()=>N7,Url:()=>U7,Value:()=>Q7,WhiteSpace:()=>K7});var oe=o(1609),ie=o.t(oe,2),ae=o.n(oe),le=o(5795),se=o.n(le);const ce=window.wp.hooks;function ue(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 de(e,t){if(e){if("string"==typeof e)return ue(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)?ue(e,t):void 0}}function pe(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,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||de(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 he(){return he=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},he.apply(this,arguments)}var fe,me;function ge(e,t){if(!1===e||null==e)throw new Error(t)}function ve(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function ye(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 be(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}function we(e,t,n){return void 0===n&&(n="/"),function(e,t,n,r){let o=Ie(("string"==typeof t?be(t):t).pathname||"/",n);if(null==o)return null;let i=ke(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(i);let a=null;for(let e=0;null==a&&e<i.length;++e){let t=De(o);a=Me(i[e],t,r)}return a}(e,t,n,!1)}function ke(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let o=(e,o,i)=>{let a={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};a.relativePath.startsWith("/")&&(ge(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let l=We([r,a.relativePath]),s=n.concat(a);e.children&&e.children.length>0&&(ge(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),ke(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:Ae(l,e.index),routesMeta:s})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of Ee(e.path))o(e,t,n);else o(e,t)}),t}function Ee(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let a=Ee(r.join("/")),l=[];return l.push(...a.map(e=>""===e?i:[i,e].join("/"))),o&&l.push(...a),l.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(fe||(fe={})),function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(me||(me={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const Oe=/^:[\w-]+$/,xe=3,Se=2,_e=1,Ce=10,Pe=-2,Te=e=>"*"===e;function Ae(e,t){let n=e.split("/"),r=n.length;return n.some(Te)&&(r+=Pe),t&&(r+=Se),n.filter(e=>!Te(e)).reduce((e,t)=>e+(Oe.test(t)?xe:""===t?_e:Ce),r)}function Me(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let e=0;e<r.length;++e){let l=r[e],s=e===r.length-1,c="/"===i?t:t.slice(i.length)||"/",u=Ne({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},c),d=l.route;if(!u&&s&&n&&!r[r.length-1].route.index&&(u=Ne({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),a.push({params:o,pathname:We([i,u.pathname]),pathnameBase:Ue(We([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=We([i,u.pathnameBase]))}return a}function Ne(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),ve("*"===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=[],o="^"+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:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1),s=r.reduce((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=l[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[n];return e[r]=o&&!s?void 0:(s||"").replace(/%2F/g,"/"),e},{});return{params:s,pathname:i,pathnameBase:a,pattern:e}}function De(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return ve(!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 Ie(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 Le=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Re(e,t){void 0===t&&(t="/");let n,{pathname:r,search:o="",hash:i=""}="string"==typeof e?be(e):e;if(r)if(a=r,Le.test(a))n=r;else{if(r.includes("//")){let e=r;r=r.replace(/\/\/+/g,"/"),ve(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+r)}n=r.startsWith("/")?je(r.substring(1),"/"):je(r,t)}else n=t;var a;return{pathname:n,search:Ve(o),hash:He(i)}}function je(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 Fe(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 ze(e,t){let n=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Be(e,t,n,r){let o;void 0===r&&(r=!1),"string"==typeof e?o=be(e):(o=he({},e),ge(!o.pathname||!o.pathname.includes("?"),Fe("?","pathname","search",o)),ge(!o.pathname||!o.pathname.includes("#"),Fe("#","pathname","hash",o)),ge(!o.search||!o.search.includes("#"),Fe("#","search","hash",o)));let i,a=""===e||""===o.pathname,l=a?"/":o.pathname;if(null==l)i=n;else{let e=t.length-1;if(!r&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let s=Re(o,i),c=l&&"/"!==l&&l.endsWith("/"),u=(a||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}const We=e=>e.join("/").replace(/\/\/+/g,"/"),Ue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ve=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",He=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const qe=["post","put","patch","delete"],Qe=(new Set(qe),["get",...qe]);function $e(){return $e=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.apply(this,arguments)}new Set(Qe),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const Ge=oe.createContext(null),Ye=oe.createContext(null),Xe=oe.createContext(null),Ke=oe.createContext(null),Ze=oe.createContext({outlet:null,matches:[],isDataRoute:!1}),Je=oe.createContext(null);function et(){return null!=oe.useContext(Ke)}function tt(){return et()||ge(!1),oe.useContext(Ke).location}function nt(e){oe.useContext(Xe).static||oe.useLayoutEffect(e)}function rt(){let{isDataRoute:e}=oe.useContext(Ze);return e?function(){let{router:e}=function(){let e=oe.useContext(Ge);return e||ge(!1),e}(pt.UseNavigateStable),t=ft(ht.UseNavigateStable),n=oe.useRef(!1);nt(()=>{n.current=!0});let r=oe.useCallback(function(r,o){void 0===o&&(o={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,$e({fromRouteId:t},o)))},[e,t]);return r}():function(){et()||ge(!1);let e=oe.useContext(Ge),{basename:t,future:n,navigator:r}=oe.useContext(Xe),{matches:o}=oe.useContext(Ze),{pathname:i}=tt(),a=JSON.stringify(ze(o,n.v7_relativeSplatPath)),l=oe.useRef(!1);nt(()=>{l.current=!0});let s=oe.useCallback(function(n,o){if(void 0===o&&(o={}),!l.current)return;if("number"==typeof n)return void r.go(n);let s=Be(n,JSON.parse(a),i,"path"===o.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:We([t,s.pathname])),(o.replace?r.replace:r.push)(s,o.state,o)},[t,r,a,i,e]);return s}()}const ot=oe.createContext(null);function it(){let{matches:e}=oe.useContext(Ze),t=e[e.length-1];return t?t.params:{}}function at(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=oe.useContext(Xe),{matches:o}=oe.useContext(Ze),{pathname:i}=tt(),a=JSON.stringify(ze(o,r.v7_relativeSplatPath));return oe.useMemo(()=>Be(e,JSON.parse(a),i,"path"===n),[e,a,i,n])}function lt(e,t){return function(e,t,n,r){et()||ge(!1);let{navigator:o}=oe.useContext(Xe),{matches:i}=oe.useContext(Ze),a=i[i.length-1],l=a?a.params:{},s=(a&&a.pathname,a?a.pathnameBase:"/");a&&a.route;let c,u=tt();if(t){var d;let e="string"==typeof t?be(t):t;"/"===s||(null==(d=e.pathname)?void 0:d.startsWith(s))||ge(!1),c=e}else c=u;let p=c.pathname||"/",h=p;if("/"!==s){let e=s.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let f=we(e,{pathname:h}),m=function(e,t,n,r){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==e){var i;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(i=r)&&i.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let a=e,l=null==(o=n)?void 0:o.errors;if(null!=l){let e=a.findIndex(e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id]));e>=0||ge(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,o=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||o){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,o)=>{let i,u=!1,d=null,p=null;var h;n&&(i=l&&r.route.id?l[r.route.id]:void 0,d=r.route.errorElement||ct,s&&(c<0&&0===o?(mt[h="route-fallback"]||(mt[h]=!0),u=!0,p=null):c===o&&(u=!0,p=r.route.hydrateFallbackElement||null)));let f=t.concat(a.slice(0,o+1)),m=()=>{let t;return t=i?d:u?p:r.route.Component?oe.createElement(r.route.Component,null):r.route.element?r.route.element:e,oe.createElement(dt,{match:r,routeContext:{outlet:e,matches:f,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?oe.createElement(ut,{location:n.location,revalidation:n.revalidation,component:d,error:i,children:m(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):m()},null)}(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:We([s,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?s:We([s,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),i,n,r);return t&&m?oe.createElement(Ke.Provider,{value:{location:$e({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:fe.Pop}},m):m}(e,t)}function st(){let e=function(){var e;let t=oe.useContext(Je),n=function(){let e=oe.useContext(Ye);return e||ge(!1),e}(ht.UseRouteError),r=ft(ht.UseRouteError);return void 0!==t?t:null==(e=n.errors)?void 0:e[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(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 oe.createElement(oe.Fragment,null,oe.createElement("h2",null,"Unexpected Application Error!"),oe.createElement("h3",{style:{fontStyle:"italic"}},t),n?oe.createElement("pre",{style:r},n):null,null)}const ct=oe.createElement(st,null);class ut extends oe.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?oe.createElement(Ze.Provider,{value:this.props.routeContext},oe.createElement(Je.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dt(e){let{routeContext:t,match:n,children:r}=e,o=oe.useContext(Ge);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),oe.createElement(Ze.Provider,{value:t},r)}var pt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pt||{}),ht=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}(ht||{});function ft(e){let t=function(){let e=oe.useContext(Ze);return e||ge(!1),e}(),n=t.matches[t.matches.length-1];return n.route.id||ge(!1),n.route.id}const mt={};function gt(e){let{to:t,replace:n,state:r,relative:o}=e;et()||ge(!1);let{future:i,static:a}=oe.useContext(Xe),{matches:l}=oe.useContext(Ze),{pathname:s}=tt(),c=rt(),u=Be(t,ze(l,i.v7_relativeSplatPath),s,"path"===o),d=JSON.stringify(u);return oe.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:o}),[c,d,o,n,r]),null}function vt(e){return function(e){let t=oe.useContext(Ze).outlet;return t?oe.createElement(ot.Provider,{value:e},t):t}(e.context)}function yt(e){let{basename:t="/",children:n=null,location:r,navigationType:o=fe.Pop,navigator:i,static:a=!1,future:l}=e;et()&&ge(!1);let s=t.replace(/^\/*/,"/"),c=oe.useMemo(()=>({basename:s,navigator:i,static:a,future:$e({v7_relativeSplatPath:!1},l)}),[s,l,i,a]);"string"==typeof r&&(r=be(r));let{pathname:u="/",search:d="",hash:p="",state:h=null,key:f="default"}=r,m=oe.useMemo(()=>{let e=Ie(u,s);return null==e?null:{location:{pathname:e,search:d,hash:p,state:h,key:f},navigationType:o}},[s,u,d,p,h,f,o]);return null==m?null:oe.createElement(Xe.Provider,{value:c},oe.createElement(Ke.Provider,{children:n,value:m}))}function bt(){return bt=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},bt.apply(this,arguments)}function wt(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]])},[]))}oe.startTransition,new Promise(()=>{}),oe.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const kt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}new Map,oe.startTransition,le.flushSync,oe.useId;const Et="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ot=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xt=oe.forwardRef(function(e,t){let n,{onClick:r,relative:o,reloadDocument:i,replace:a,state:l,target:s,to:c,preventScrollReset:u,viewTransition:d}=e,p=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,kt),{basename:h}=oe.useContext(Xe),f=!1;if("string"==typeof c&&Ot.test(c)&&(n=c,Et))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=Ie(t.pathname,h);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:f=!0}catch(e){}let m=function(e,t){let{relative:n}=void 0===t?{}:t;et()||ge(!1);let{basename:r,navigator:o}=oe.useContext(Xe),{hash:i,pathname:a,search:l}=at(e,{relative:n}),s=a;return"/"!==r&&(s="/"===a?r:We([r,a])),o.createHref({pathname:s,search:l,hash:i})}(c,{relative:o}),g=function(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,viewTransition:l}=void 0===t?{}:t,s=rt(),c=tt(),u=at(e,{relative:a});return oe.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==r?r:ye(c)===ye(u);s(e,{replace:n,state:o,preventScrollReset:i,relative:a,viewTransition:l})}},[c,s,u,r,o,n,e,i,a,l])}(c,{replace:a,state:l,target:s,preventScrollReset:u,relative:o,viewTransition:d});return oe.createElement("a",bt({},p,{href:n||m,onClick:f||i?r:function(e){r&&r(e),e.defaultPrevented||g(e)},ref:t,target:s}))});var St,_t;function Ct(e){let t=oe.useRef(wt(e)),n=oe.useRef(!1),r=tt(),o=oe.useMemo(()=>function(e,t){let n=wt(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]),i=rt(),a=oe.useCallback((e,t)=>{const r=wt("function"==typeof e?e(o):e);n.current=!0,i("?"+r,t)},[i,o]);return[o,a]}function Pt(e){var t=function(e){if("object"!=ne(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ne(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ne(t)?t:t+""}function Tt(e,t,n){return(t=Pt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(St||(St={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(_t||(_t={}));const At=window.wp.i18n;var Mt=ae().createContext(null),Nt=function(e){e()},Dt=function(){return Nt},It={notify:function(){},get:function(){return[]}};function Lt(e,t){var n,r=It;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=Dt(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}var a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=It)},getListeners:function(){return r}};return a}var Rt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?oe.useLayoutEffect:oe.useEffect;const jt=function(e){var t=e.store,n=e.context,r=e.children,o=(0,oe.useMemo)(function(){var e=Lt(t);return{store:t,subscription:e}},[t]),i=(0,oe.useMemo)(function(){return t.getState()},[t]);Rt(function(){var e=o.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[o,i]);var a=n||Mt;return ae().createElement(a.Provider,{value:o},r)};function Ft(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}var zt=o(4146),Bt=o.n(zt),Wt=o(4737),Ut=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],Vt=["reactReduxForwardedRef"],Ht=[],qt=[null,null];function Qt(e,t){var n=e[1];return[t.payload,n+1]}function $t(e,t,n){Rt(function(){return e.apply(void 0,t)},n)}function Gt(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function Yt(e,t,n,r,o,i,a,l,s,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?a.current||s():(i.current=e,l.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=p,n.trySubscribe(),p(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var Xt=function(){return[null,0]};function Kt(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,i=n.methodName,a=void 0===i?"connectAdvanced":i,l=n.renderCountProp,s=void 0===l?void 0:l,c=n.shouldHandleStateChanges,u=void 0===c||c,d=n.storeKey,p=void 0===d?"store":d,h=(n.withRef,n.forwardRef),f=void 0!==h&&h,m=n.context,g=void 0===m?Mt:m,v=Ft(n,Ut),y=g;return function(t){var n=t.displayName||t.name||"Component",r=o(n),i=re({},v,{getDisplayName:o,methodName:a,renderCountProp:s,shouldHandleStateChanges:u,storeKey:p,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=v.pure,c=l?oe.useMemo:function(e){return e()};function d(n){var r=(0,oe.useMemo)(function(){var e=n.reactReduxForwardedRef,t=Ft(n,Vt);return[n.context,e,t]},[n]),o=r[0],a=r[1],l=r[2],s=(0,oe.useMemo)(function(){return o&&o.Consumer&&(0,Wt.isContextConsumer)(ae().createElement(o.Consumer,null))?o:y},[o,y]),d=(0,oe.useContext)(s),p=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(d)&&Boolean(d.store);var h=p?n.store:d.store,f=(0,oe.useMemo)(function(){return function(t){return e(t.dispatch,i)}(h)},[h]),m=(0,oe.useMemo)(function(){if(!u)return qt;var e=Lt(h,p?null:d.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[h,p,d]),g=m[0],v=m[1],b=(0,oe.useMemo)(function(){return p?d:re({},d,{subscription:g})},[p,d,g]),w=(0,oe.useReducer)(Qt,Ht,Xt),k=w[0][0],E=w[1];if(k&&k.error)throw k.error;var O=(0,oe.useRef)(),x=(0,oe.useRef)(l),S=(0,oe.useRef)(),_=(0,oe.useRef)(!1),C=c(function(){return S.current&&l===x.current?S.current:f(h.getState(),l)},[h,k,l]);$t(Gt,[x,O,_,l,C,S,v]),$t(Yt,[u,h,g,f,x,O,_,S,v,E],[h,g,f]);var P=(0,oe.useMemo)(function(){return ae().createElement(t,re({},C,{ref:a}))},[a,t,C]);return(0,oe.useMemo)(function(){return u?ae().createElement(s.Provider,{value:b},P):P},[s,P,b])}var h=l?ae().memo(d):d;if(h.WrappedComponent=t,h.displayName=d.displayName=r,f){var m=ae().forwardRef(function(e,t){return ae().createElement(h,re({},e,{reactReduxForwardedRef:t}))});return m.displayName=r,m.WrappedComponent=t,Bt()(m,t)}return Bt()(h,t)}}function Zt(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Jt(e,t){if(Zt(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Zt(e[n[o]],t[n[o]]))return!1;return!0}function en(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function tn(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function nn(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=tn(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=tn(o),o=r(t,n)),o},r}}const rn=[function(e){return"function"==typeof e?nn(e):void 0},function(e){return e?void 0:en(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?en(function(t){return function(e,t){var n={},r=function(r){var o=e[r];"function"==typeof o&&(n[r]=function(){return t(o.apply(void 0,arguments))})};for(var o in e)r(o);return n}(e,t)}):void 0}],on=[function(e){return"function"==typeof e?nn(e):void 0},function(e){return e?void 0:en(function(){return{}})}];function an(e,t,n){return re({},n,e,t)}const ln=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,l){var s=e(t,n,l);return a?o&&i(s,r)||(r=s):(a=!0,r=s),r}}}(e):void 0},function(e){return e?void 0:function(){return an}}];var sn=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function cn(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function un(e,t,n,r,o){var i,a,l,s,c,u=o.areStatesEqual,d=o.areOwnPropsEqual,p=o.areStatePropsEqual,h=!1;return function(o,f){return h?function(o,h){var f,m,g=!d(h,a),v=!u(o,i,h,a);return i=o,a=h,g&&v?(l=e(i,a),t.dependsOnOwnProps&&(s=t(r,a)),c=n(l,s,a)):g?(e.dependsOnOwnProps&&(l=e(i,a)),t.dependsOnOwnProps&&(s=t(r,a)),c=n(l,s,a)):v?(f=e(i,a),m=!p(f,l),l=f,m&&(c=n(l,s,a)),c):c}(o,f):(l=e(i=o,a=f),s=t(r,a),c=n(l,s,a),h=!0,c)}}function dn(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=Ft(t,sn),a=n(e,i),l=r(e,i),s=o(e,i);return(i.pure?un:cn)(a,l,s,e,i)}var pn=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function hn(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function fn(e,t){return e===t}function mn(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?Kt:n,o=t.mapStateToPropsFactories,i=void 0===o?on:o,a=t.mapDispatchToPropsFactories,l=void 0===a?rn:a,s=t.mergePropsFactories,c=void 0===s?ln:s,u=t.selectorFactory,d=void 0===u?dn:u;return function(e,t,n,o){void 0===o&&(o={});var a=o,s=a.pure,u=void 0===s||s,p=a.areStatesEqual,h=void 0===p?fn:p,f=a.areOwnPropsEqual,m=void 0===f?Jt:f,g=a.areStatePropsEqual,v=void 0===g?Jt:g,y=a.areMergedPropsEqual,b=void 0===y?Jt:y,w=Ft(a,pn),k=hn(e,i,"mapStateToProps"),E=hn(t,l,"mapDispatchToProps"),O=hn(n,c,"mergeProps");return r(d,re({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:k,initMapDispatchToProps:E,initMergeProps:O,pure:u,areStatesEqual:h,areOwnPropsEqual:m,areStatePropsEqual:v,areMergedPropsEqual:b},w))}}const gn=mn();function vn(){return(0,oe.useContext)(Mt)}function yn(e){void 0===e&&(e=Mt);var t=e===Mt?vn:function(){return(0,oe.useContext)(e)};return function(){return t().store}}var bn=yn();function wn(e){void 0===e&&(e=Mt);var t=e===Mt?bn:yn(e);return function(){return t().dispatch}}var kn=wn(),En=function(e,t){return e===t};function On(e){void 0===e&&(e=Mt);var t=e===Mt?vn:function(){return(0,oe.useContext)(e)};return function(e,n){void 0===n&&(n=En);var r=t(),o=function(e,t,n,r){var o,i=(0,oe.useReducer)(function(e){return e+1},0)[1],a=(0,oe.useMemo)(function(){return Lt(n,r)},[n,r]),l=(0,oe.useRef)(),s=(0,oe.useRef)(),c=(0,oe.useRef)(),u=(0,oe.useRef)(),d=n.getState();try{if(e!==s.current||d!==c.current||l.current){var p=e(d);o=void 0!==u.current&&t(p,u.current)?u.current:p}else o=u.current}catch(e){throw l.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+l.current.stack+"\n\n"),e}return Rt(function(){s.current=e,c.current=d,u.current=o,l.current=void 0}),Rt(function(){function e(){try{var e=n.getState();if(e===c.current)return;var r=s.current(e);if(t(r,u.current))return;u.current=r,c.current=e}catch(e){l.current=e}i()}return a.onStateChange=e,a.trySubscribe(),e(),function(){return a.tryUnsubscribe()}},[n,a]),o}(e,n,r.store,r.subscription);return(0,oe.useDebugValue)(o),o}}var xn,Sn=On();xn=le.unstable_batchedUpdates,Nt=xn;const Cn=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22"},ae().createElement("path",{d:"M11 12.778L18.778 5 21 7.222l-10 10-10-10L3.222 5 11 12.778z"}))},Pn=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},ae().createElement("g",null,ae().createElement("path",{d:"M76.8 76.5H11.6C5.2 76.5 0 81.7 0 88.1s5.2 11.6 11.6 11.6h65.2c6.4 0 11.6-5.2 11.6-11.6.1-6.4-5.1-11.6-11.6-11.6zM71 93.4c-2.9 0-5.2-2.3-5.2-5.2S68.1 83 71 83s5.2 2.3 5.2 5.2c.1 2.8-2.3 5.2-5.2 5.2zM90.2 21.4C88.9 12.7 81.3 6 72.3 6H71C67.4 2.3 62.2.2 57 .2 46.1.2 37.2 9 37 19.8c-4.8 3.8-7.7 9.6-7.7 15.7 0 11 9 20 20 20h32.6c10 0 18.1-8.1 18.1-18.1 0-6.8-3.8-13-9.8-16zm-8.3 24.8H49.3c-5.9 0-10.7-4.8-10.7-10.7 0-3.8 2.1-7.4 5.4-9.3l2.7-1.6-.4-3.2c-.1-.4-.1-.9-.1-1.3 0-5.9 4.8-10.7 10.7-10.7 3.4 0 6.6 1.6 8.6 4.3l1.8 2.5 3-.7c.6-.2 1.3-.2 2-.2 4.8 0 8.8 3.9 8.8 8.7l-.1 4 3.4 1c3.7 1.1 6.3 4.6 6.3 8.4 0 4.9-3.9 8.8-8.8 8.8z"}),ae().createElement("path",{d:"M76.8 71.8c4.2 0 8 1.6 10.9 4.2L82 59H49.3c-12.7 0-23.1-10.3-23.4-23h-2c-5.1 0-8.4 2.6-11.4 9.3L.3 76.5c2.9-2.9 7-4.7 11.4-4.7z"})))},Tn=function(e){return ae().createElement("svg",re({viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg"},e),ae().createElement("g",{fill:"#29c581"},ae().createElement("path",{d:"M123 0H36.6c-2.8 0-5.1 2.3-5.1 5.1v26.3H5.1c-2.8 0-5.1 2.3-5.1 5.1v86.3c0 2.8 2.3 5.1 5.1 5.1h86.3c2.8 0 5.1-2.3 5.1-5.1V96.7h26.3c2.8 0 5.1-2.3 5.1-5.1V5.3c.2-3-2.1-5.3-4.9-5.3zM86.3 117.7h-76V41.8h21.2v49.6c0 2.8 2.3 5.1 5.1 5.1h49.6v21.2zm31.4-31.4H41.8V10.4h75.9z"}),ae().createElement("path",{d:"M58.5 53.5h16.2v16.2c0 .9.8 1.8 1.8 1.8h6.9c.9 0 1.8-.8 1.8-1.8V53.5h16.2c.9 0 1.8-.8 1.8-1.8v-6.9c0-.9-.8-1.8-1.8-1.8H85.1V27c0-.9-.8-1.8-1.8-1.8h-6.9c-.9 0-1.8.8-1.8 1.8v16.2H58.5c-.9 0-1.8.8-1.8 1.8v6.9c0 .8.8 1.6 1.8 1.6z"})))},An=function(e){return ae().createElement("svg",re({viewBox:"0 0 500 500",xmlns:"http://www.w3.org/2000/svg"},e),ae().createElement("g",{fill:"#f82626"},ae().createElement("path",{d:"M463.9 71.6h-97.7l-19.4-38.2C336.5 12.7 315.3-.3 292.2 0h-85.6c-23.1-.3-44.3 12.7-54.6 33.4l-18.8 38.2H35.5c-13.4 0-24.3 10.9-24.3 24.3s10.9 24.3 24.3 24.3h34V415c0 46.9 38 85 85 85h191.1c46.9 0 85-38 85-85V120.1h34c13.4 0 24.3-10.9 24.3-24.3S478 71.5 464.6 71.5h-.7zM195.7 55.2c2.1-4.1 6.3-6.7 10.9-6.7h86.2c4.6 0 8.8 2.6 10.9 6.7l7.9 16.4H187.8zM382 415c0 20.1-16.3 36.4-36.4 36.4H153.8c-20.1 0-36.4-16.3-36.4-36.4V120.1H382z"}),ae().createElement("path",{d:"M303.1 401.7c13.4 0 24.3-10.9 24.3-24.3V199.6c0-13.4-10.9-24.3-24.3-24.3s-24.3 10.9-24.3 24.3v177.8c0 13.4 10.9 24.3 24.3 24.3zM196.3 401.7c13.4 0 24.3-10.9 24.3-24.3V199.6c0-13.4-10.9-24.3-24.3-24.3S172 186.2 172 199.6v177.8c0 13.4 10.9 24.3 24.3 24.3z"})))},Mn=function(e){return ae().createElement("svg",re({viewBox:"0 0 500 500",xmlns:"http://www.w3.org/2000/svg"},e),ae().createElement("g",{clipRule:"evenodd",fill:"#1dc27a",fillRule:"evenodd"},ae().createElement("path",{d:"M355.3 500H47.7c-24.2 0-43.8-19.6-43.8-43.8V148.6c0-24.2 19.9-43.8 44-43.8h251.9l-43.9 43.9H47.8v307.4h307.4V235.7l43.9-43.9v264.4c0 24.2-19.6 43.8-43.8 43.8z"}),ae().createElement("path",{d:"M455.5 104.1 393.4 42 207.1 228.3l62.1 62.1zM248.9 308.8 184.1 327c-8.3 2.3-15.9-5.3-13.5-13.5l18.2-64.8c.5-1.8 1.5-3.5 2.8-4.8l62.1 62.1c-1.3 1.3-3 2.3-4.8 2.8zM494.3 65.3c4.3-4.3 4.3-11.2 0-15.5L447.8 3.2c-4.3-4.3-11.2-4.3-15.5 0L409 26.5l62 62.1z"})))};var Nn=function(e){return ae().createElement("svg",re({viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},e),ae().createElement("circle",{cx:90.5,cy:454.8,fill:"#ffb45a",r:57.2}),ae().createElement("circle",{cx:256,cy:454.8,fill:"#ff7b8e",r:57.2}),ae().createElement("circle",{cx:421.5,cy:454.8,fill:"#5ac0ff",r:57.2}),ae().createElement("path",{d:"M356.5 94.5c-3.1 0-6.1.2-9.1.4C335 40.6 286.4 0 228.3 0c-15.3 0-29.9 2.8-43.4 8 0 15.3.1 32.9.2 40.4 15.6.1 45.8.2 59.1.2v57.8h-58.8v97.7h60.5c-1.7 4.3-4.3 10.7-5.4 13.2-11 26.5-38.3 41.3-66.6 36.2-26.9-4.9-46.9-27.8-48.4-55.9-.4-8.2-.2-16.5-.2-24.7V106h-20.7c-41.8 19.4-70.9 61.7-70.9 110.8 0 67.5 54.7 122.2 122.2 122.2h202c66.9-.7 120.8-55.1 120.8-122.2 0-67.5-54.7-122.3-122.2-122.3z",fill:"#5633d1"}))},Dn=function(e){return ae().createElement("svg",re({viewBox:"0 0 143 28",xmlns:"http://www.w3.org/2000/svg"},e),ae().createElement("g",{fill:"#424c5e"},ae().createElement("path",{d:"M6.6 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4V6.3H4.3l-.6-3H.8v14.2c0 2.8 1.3 4.1 3.8 4.1H8v-3.1zM17.3 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.7-2.3-7.1-6.9-7.1zM14 12.6c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1zM44.4 6.3c-1.7 0-3.3.7-4.9 2.1-.7-1.4-2-2.1-4-2.1-1.9 0-3.6.7-4.9 2.2l-.5-2.2h-3v15.3H31V11c1-1 2.1-1.5 3.2-1.5 1.4 0 2.1.9 2.1 2.6v9.6h3.9V11.1c1.1-1 2.2-1.5 3.3-1.5 1.5 0 2.3.8 2.3 2.6v9.6h3.9v-9.5c0-4.1-1.8-6-5.3-6zM59.8 6.3c-2.3 0-4.4.2-6.4.6V28h3.9v-7.1c1 .5 2.1.7 3.1.7 4.8 0 7.3-2.7 7.3-8-.1-4.9-2.7-7.3-7.9-7.3zm.5 12.1c-1.1 0-2.1-.3-3.1-.8v-8c.7-.1 1.6-.2 2.7-.2 2.5 0 3.8 1.4 3.8 4.1.1 3.3-1.1 4.9-3.4 4.9zM70.5.7h3.9v20.8h-3.9zM84.1 6.3c-1.7 0-3.5.2-5.6.7v3.1c2-.5 3.9-.7 5.6-.7 2 0 3 .7 3 2.1v1.2c-1-.2-2.1-.3-3.1-.3-4.4 0-6.6 1.5-6.6 4.6 0 3.2 1.9 4.8 5.6 4.8 1.6 0 3.1-.5 4.4-1.4l1.4 1.4H91V11.5c-.1-3.6-2.4-5.2-6.9-5.2zm-.6 12.5c-1.6 0-2.3-.7-2.3-2s.9-1.9 2.8-1.9c1.1 0 2.1.1 3.1.3v2.4c-1.2.8-2.4 1.2-3.6 1.2zM100 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4V6.3h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1zM110.7 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.8-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1zM120.6.7h3.9v20.8h-3.9zM138 6.2l-3.8 11-3.9-11h-4.1l5.9 15.4c-.8 1.7-2 2.9-3.7 3.7l1.9 2.6c2.5-1.2 4.3-3.2 5.4-5.9L142 6.2z"})))};const In=function(e){return ae().createElement("svg",re({viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg"},e),ae().createElement("g",{fill:"#2ec2fa"},ae().createElement("path",{d:"M123 0H36.7c-2.8 0-5.1 2.3-5.1 5.1v26.3H5.1c-2.8 0-5.1 2.3-5.1 5.1v86.3c0 2.8 2.3 5.1 5.1 5.1h86.3c2.8 0 5.1-2.3 5.1-5.1V96.7h26.3c2.8 0 5.1-2.3 5.1-5.1V5.3c.2-3-2.1-5.3-4.9-5.3zM86.3 117.7H10.4V41.8h21.2v49.6c0 2.8 2.3 5.1 5.1 5.1h49.6zm31.4-31.4H41.8V10.4h75.9z"}),ae().createElement("path",{d:"M74.5 49.7 91 33.1c2-2 5.1-2 7.1 0s2 5.1 0 7.1L81.6 56.8h8c2.8 0 5 2.3 5 5s-2.3 5-5 5H69.4c-2.8 0-5-2.3-5-5V41.7c0-2.8 2.3-5 5-5s5 2.3 5 5v8z"})))},Ln=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14"},ae().createElement("mask",{id:"mask0_1828_1726",style:{maskType:"alpha"},width:"14",height:"14",x:"0",y:"0",maskUnits:"userSpaceOnUse"},ae().createElement("path",{d:"M0 0H14V14H0z"})),ae().createElement("g",{mask:"url(#mask0_1828_1726)"},ae().createElement("path",{d:"M2.917 11.083h.83L9.45 5.381l-.831-.831-5.702 5.702v.831zM1.75 12.25V9.77l7.7-7.685a1.31 1.31 0 01.386-.248 1.206 1.206 0 01.897 0c.146.059.273.146.38.263l.802.817a.954.954 0 01.255.379 1.263 1.263 0 010 .882c-.054.141-.139.27-.255.387L4.229 12.25H1.75zm7.277-7.277L8.62 4.55l.831.831-.423-.408z"})))},Rn=function(e){return ae().createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},e),ae().createElement("g",{fill:"#5453fd"},ae().createElement("path",{d:"M50 0C35.7 0 24 11.7 24 26s11.7 26 26 26 26-11.7 26-26S64.3 0 50 0zM94.6 72.7c-.7-1.7-1.6-3.3-2.6-4.8-5.2-7.7-13.3-12.8-22.3-14.1-1.1-.1-2.4.1-3.3.8C61.6 58.2 55.9 60 50 60s-11.6-1.8-16.3-5.3c-.9-.7-2.2-1-3.3-.8-9.1 1.2-17.2 6.3-22.3 14.1-1 1.5-1.9 3.2-2.6 4.8-.3.7-.2 1.5.1 2.2.9 1.6 2 3.2 3.1 4.5 1.6 2.2 3.3 4.1 5.2 5.9 1.6 1.6 3.4 3.1 5.2 4.5 9 6.7 19.7 10.2 30.8 10.2s21.9-3.5 30.8-10.2c1.8-1.4 3.6-2.9 5.2-4.5 1.8-1.8 3.6-3.7 5.2-5.9 1.1-1.5 2.2-2.9 3.1-4.5.6-.9.7-1.6.4-2.3z"})))},jn=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},ae().createElement("g",null,ae().createElement("path",{d:"M70.5 40.9c-11.3 0-21 6.3-26 15.6l-10.2-5.4c1.9-4.9 1.6-10.5-1-15.1l15.8-11.5c9 7.6 22.8 1.1 22.8-10.6C71.8 6.2 65.6 0 58 0 47.7 0 41.1 10.7 45.5 19.8L29.6 31.4C18.2 21.2 0 29.3 0 44.6c0 9.8 8 17.8 17.8 17.8 5.4 0 10.3-2.4 13.5-6.3l11 5.8c-.8 2.7-1.2 5.5-1.2 8.5 0 5.7 1.6 11.1 4.5 15.6.3-1.9.9-3.7 1.6-5.4 1.3-3 3.2-5.8 5.5-8.1l.9-.9c-.5-1.3-.9-2.6-1.1-3.9-.5-3.3-.1-6.8 1.2-9.9C55 54.6 57.2 52 60 50c3-2.1 6.5-3.2 10.3-3.2 9.9 0 18 8.1 18 18 0 2.3-.4 4.5-1.2 6.6l.9.9c2.5 2.3 4.4 5.1 5.7 8.2.8 1.9 1.4 3.8 1.7 5.8 2.9-4.6 4.6-10 4.6-15.8 0-16.4-13.2-29.6-29.5-29.6z"}),ae().createElement("path",{d:"M65.2 75.8c8 3.7 17.2-2.2 17.2-11 0-6.7-5.4-12.2-12.1-12.2-10.7 0-16.1 13-8.7 20.6-.1 0 1.5 1.6 3.6 2.6z"}),ae().createElement("path",{d:"M90 90.7c0 .7 0 1.4-.1 2-5.2 4.6-12 7.4-19.5 7.4s-14.3-2.8-19.5-7.4c-.1-.7-.1-1.3-.1-2 0-5.4 2.2-10.4 5.8-13.9 3.3 3.7 8.1 6.1 13.5 6.1 5.5 0 10.4-2.5 13.7-6.3C87.7 80 90 85.1 90 90.7z"})))},Fn=function(e){return ae().createElement("svg",re({width:28,viewBox:"0 0 512 338",xmlns:"http://www.w3.org/2000/svg"},e),ae().createElement("g",{fill:"none"},ae().createElement("path",{d:"M357.74 291.15c-85.88 0-155.499-69.619-155.499-155.499 0-47.336 21.156-89.725 54.523-118.245C236.367 6.039 213.419.056 189.853.056c-75.901 0-137.65 61.75-137.65 137.65 0 3.896.167 7.81.497 11.709C20.377 166.672 0 200.199 0 237.457c0 55.056 44.792 99.848 99.848 99.848H359.06c49.056 0 89.963-35.561 98.296-82.259-26.981 22.537-61.712 36.104-99.616 36.104z",fill:"#a3b0c0"}),ae().createElement("g",{fill:"#6d7988"},ae().createElement("path",{d:"M331.409 125.365c-5.149-.234-10.317-.044-16.028-.044.77-25.252 10.37-45.087 30.462-58.479 21.943-14.626 43.882-16.65 65.44-7.828l16.061-27.998c-19.512-8.663-43.811-11.42-64.794-5.614-49.805 13.781-75.191 48.182-79.428 99.25-2.572 0-4.796.005-7.02-.001-2.429-.007-4.861-.117-7.285-.02-7.518.303-10.035 4.264-6.208 10.621 9.825 16.317 19.826 32.532 30.05 48.601 4.071 6.399 9.574 6.356 13.822-.012a2546.495 2546.495 0 0 0 30.891-47.406c4.201-6.609 1.861-10.715-5.963-11.07zM510.088 106.992a2709.272 2709.272 0 0 0-29.423-47.666c-4.464-7.066-9.893-7.168-14.476-.301a2828.15 2828.15 0 0 0-30.321 46.435c-4.742 7.417-2.366 11.519 6.522 11.784 4.93.147 9.868.026 15.186.026-1.078 26.367-11.36 46.663-32.694 59.894-20.076 12.451-39.981 14.628-59.477 7.832l-16.036 27.955c19.301 8.094 39.797 9.856 61.332 4.011 49.675-13.483 74.817-48.093 79.01-98.99 4.881 0 9.533.111 14.178-.025 7.778-.228 10.221-4.288 6.199-10.955z"}))))},zn=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},ae().createElement("g",{clipPath:"url(#clip0_57_7571)"},ae().createElement("path",{stroke:"#F04438",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.333",d:"M7.999 5.334v2.667m0 2.666h.006m6.66-2.666A6.667 6.667 0 111.332 8a6.667 6.667 0 0113.333 0z"})),ae().createElement("defs",null,ae().createElement("clipPath",{id:"clip0_57_7571"},ae().createElement("path",{fill:"#fff",d:"M0 0H16V16H0z"}))))},Bn=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},ae().createElement("g",null,ae().createElement("path",{d:"M67.5 94.1h-8.4l-1.2-16H42.1l-1.2 16h-8.4c-1.6 0-3 1.3-3 3 0 1.6 1.3 3 3 3h35c1.6 0 3-1.3 3-3s-1.3-3-3-3zM88.4 22h-7.2L59.9 43.3c.5 4.6-1 9.3-4.4 12.7-4.8 4.8-19.9 7.2-26.7 7.9-2 .2-3.5-1.5-3.3-3.3.8-6.7 3.1-21.8 7.9-26.7 3.5-3.5 8.2-5 12.7-4.4l7.5-7.6h-42c-1.7 0-3 1.4-3 3V69c0 1.7 1.4 3 3 3h76.7c1.7 0 3-1.4 3-3V25c.1-1.6-1.3-3-2.9-3z"}),ae().createElement("path",{d:"M57.8 37c.8-.8 22.3-22.2 30.6-30.5 1.4-1.5 1.4-3.9-.1-5.3C86.9-.3 84.5-.4 83 1L52.5 31.6c2 1.3 3.9 3.2 5.3 5.4zM51.2 38.2c-3.8-3.8-9.9-3.7-13.6 0-2.4 2.5-4.6 11.8-5.7 19.4 4.3-.6 16.5-2.8 19.6-6 3.5-3.8 3.4-9.7-.3-13.4z"})))};function Wn(e,t){if(null==e)return{};var n,r,o=Ft(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Un=o(6942),Vn=o.n(Un),Hn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},qn=oe.createContext&&oe.createContext(Hn),Qn=["attr","size","title"];function $n(){return $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},$n.apply(this,arguments)}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 Yn(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){Xn(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 Xn(e,t,n){return t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kn(e){return e&&e.map((e,t)=>oe.createElement(e.tag,Yn({key:t},e.attr),Kn(e.child)))}function Zn(e){return t=>oe.createElement(Jn,$n({attr:Yn({},e.attr)},t),Kn(e.child))}function Jn(e){var t=t=>{var n,{attr:r,size:o,title:i}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Qn),l=o||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),oe.createElement("svg",$n({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,a,{className:n,style:Yn(Yn({color:e.color||t.color},t.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&oe.createElement("title",null,i),e.children)};return void 0!==qn?oe.createElement(qn.Consumer,null,e=>t(e)):t(Hn)}function er(e){return Zn({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"},child:[]}]})(e)}function tr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function nr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"},child:[]}]})(e)}function rr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"},child:[]}]})(e)}function or(e){return Zn({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M192 127.338v257.324c0 17.818-21.543 26.741-34.142 14.142L29.196 270.142c-7.81-7.81-7.81-20.474 0-28.284l128.662-128.662c12.599-12.6 34.142-3.676 34.142 14.142z"},child:[]}]})(e)}function ir(e){return Zn({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"},child:[]}]})(e)}function ar(e){return Zn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"},child:[]}]})(e)}function lr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M528 448H112c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h416c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm64-320c-26.5 0-48 21.5-48 48 0 7.1 1.6 13.7 4.4 19.8L476 239.2c-15.4 9.2-35.3 4-44.2-11.6L350.3 85C361 76.2 368 63 368 48c0-26.5-21.5-48-48-48s-48 21.5-48 48c0 15 7 28.2 17.7 37l-81.5 142.6c-8.9 15.6-28.9 20.8-44.2 11.6l-72.3-43.4c2.7-6 4.4-12.7 4.4-19.8 0-26.5-21.5-48-48-48S0 149.5 0 176s21.5 48 48 48c2.6 0 5.2-.4 7.7-.8L128 416h384l72.3-192.8c2.5.4 5.1.8 7.7.8 26.5 0 48-21.5 48-48s-21.5-48-48-48z"},child:[]}]})(e)}function sr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(e)}function cr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"},child:[]}]})(e)}function ur(e){return Zn({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"},child:[]}]})(e)}function dr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M16 288c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h112v-64zm489-183L407.1 7c-4.5-4.5-10.6-7-17-7H384v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-153 31V0H152c-13.3 0-24 10.7-24 24v264h128v-65.2c0-14.3 17.3-21.4 27.4-11.3L379 308c6.6 6.7 6.6 17.4 0 24l-95.7 96.4c-10.1 10.1-27.4 3-27.4-11.3V352H128v136c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H376c-13.2 0-24-10.8-24-24z"},child:[]}]})(e)}function pr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"},child:[]}]})(e)}function hr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function fr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function mr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}function gr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 32h192c13.255 0 24 10.745 24 24v160c0 13.255-10.745 24-24 24H296c-13.255 0-24-10.745-24-24V56c0-13.255 10.745-24 24-24zm-80 0H24C10.745 32 0 42.745 0 56v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24zM0 296v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zm296 184h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H296c-13.255 0-24 10.745-24 24v160c0 13.255 10.745 24 24 24z"},child:[]}]})(e)}function vr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function yr(e){return Zn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"},child:[]}]})(e)}var br="APPLICATION_SET_PLATFORM",wr="APPLICATION_SET_PLAN",kr="APPLICATION_ERROR_CLEANUP",Er="APPLICATION_IS_VERIFIED",Or="APPLICATION_IS_VERIFYING",xr="APPLICATION_LOGOUT",Sr="APPLICATION_LOGOUT_SUCCESS",_r="APPLICATION_SIGNIN",Cr="APPLICATION_SIGNIN_SUCCESS",Pr="APPLICATION_SIGNIN_FAILED",Tr="APPLICATION_SIGNUP",Ar="APPLICATION_SIGNUP_SUCCESS",Mr="APPLICATION_SIGNUP_FAILED",Nr="APPLICATION_COUNTS_SUCCESS",Dr="APPLICATION_SET_FILTER_META",Ir="APPLICATION_RESET_FILTER_META",Lr="APPLICATION_LOAD_DEPENDENCIES",Rr="APPLICATION_LOAD_DEPENDENCIES_SUCCESS",jr="APPLICATION_LOAD_TAGS",Fr="APPLICATION_LOAD_TAGS_SUCCESS",zr="APPLICATION_LOAD_TYPES",Br="APPLICATION_LOAD_TYPES_SUCCESS",Wr="APPLICATION_LOAD_PRICING_SUCCESS",Ur="APPLICATION_LOAD_PRICING_FAILED",Vr="APPLICATION_LOAD_CATEGORIES",Hr="APPLICATION_LOAD_CATEGORIES_SUCCESS",qr="APPLICATION_LOAD_CATEGORIES_FAILED",Qr="APPLICATION_SET_REDIRECT",$r="APPLICATION_LOAD_CONDITIONS",Gr="APPLICATION_LOAD_CONDITIONS_SUCCESS",Yr="APPLICATION_LOAD_CONDITIONS_BY_TEMPLATE_SUCCESS",Xr="APPLICATION_SAVE_CONDITIONS",Kr="APPLICATION_SET_CONDITIONS_FOR_TEMPLATE",Zr="APPLICATION_SET_HEADER_HEIGHT",Jr="PROFILE_SYNC",eo="PROFILE_IS_VERIFIED",to="PROFILE_LOAD",no="LOAD_FAVOURITES",ro="LOAD_FAVOURITES_SUCCESS",oo="LOAD_FAVOURITES_FAILED",io="FAVOURITES_FILTER",ao="FAVOURITES_SET_PAGE",lo="FAVOURITES_STARRED",so="MY_RATINGS",co="PROFILE_SET_FAVOURITE",uo="PROFILE_SET_FAVOURITE_SUCCESS",po="PROFILE_SET_FAVOURITE_FAILED",ho="PROFILE_SET_RATING",fo="PROFILE_SET_RATING_SUCCESS",mo="PROFILE_SET_RATING_FAILED",go="LOAD_DOWNLOADS",vo="LOAD_DOWNLOADS_SUCCESS",yo="LOAD_DOWNLOADS_FAILED",bo="DOWNLOADS_SET_PAGE",wo="LOAD_PURCHASED_ITEMS",ko="LOAD_ALL_PURCHASED_ITEMS",Eo="LOAD_PURCHASED_ITEMS_SUCCESS",Oo="LOAD_PURCHASED_ITEMS_FAILED",xo="PURCHASED_ITEMS_SET_PAGE",So="TEMPLATES_REQUESTED",_o="TEMPLATES_LOAD",Co="TEMPLATES_LOAD_SUCCESS",Po="TEMPLATES_LOAD_FAILED",To="TEMPLATES_SET_PAGE",Ao="TEMPLATES_GET_TEMPLATE",Mo="TEMPLATES_GET_TEMPLATE_SUCCESS",No="TEMPLATES_GET_TEMPLATE_FAILED",Do="TEMPLATES_FEATURED_TEMPLATES",Io="TEMPLATES_FEATURED_TEMPLATES_SUCCESS",Lo="TEMPLATES_FEATURED_TEMPLATES_FAILED",Ro="TEMPLATES_TRENDING_TEMPLATES",jo="TEMPLATES_TRENDING_TEMPLATES_SUCCESS",Fo="TEMPLATES_TRENDING_TEMPLATES_FAILED",zo="TEMPLATES_RELATED_TEMPLATES",Bo="TEMPLATES_RELATED_TEMPLATES_SUCCESS",Wo="TEMPLATES_RELATED_TEMPLATES_FAILED",Uo="SAVED_TEMPLATES_LOAD",Vo="SAVED_TEMPLATES_LOADED",Ho="SAVED_TEMPLATES_LOAD_SUCCESS",qo="SAVED_TEMPLATES_SET_PAGE",Qo="SAVED_TEMPLATES_DELETE",$o={REQUESTED:"CLOUDS_REQUESTED",LOAD:"CLOUDS_LOAD",LOAD_SUCCESS:"CLOUDS_LOAD_SUCCESS",LOAD_FAILED:"CLOUDS_LOAD_FAILED",STATUS_LOAD:"CLOUDS_STATUS_LOAD",STATUS_REQUEST:"CLOUDS_STATUS_REQUEST",STATUS_SUCCESS:"CLOUDS_STATUS_SUCCESS",STATUS_FAILED:"CLOUDS_STATUS_FAILED",SET_USAGES:"CLOUDS_SET_USAGES",SET_LIMIT:"CLOUDS_SET_LIMIT",SET_PAGE:"CLOUDS_SET_PAGE",SET_VIEW:"CLOUDS_SET_VIEW",DOWNLOAD:"CLOUDS_DOWNLOAD",DOWNLOAD_SUCCESS:"CLOUDS_DOWNLOAD_SUCCESS",COPY:"CLOUDS_COPY",COPY_SUCCESS:"CLOUDS_COPY_SUCCESS",MOVE:"CLOUDS_MOVE",MOVE_SUCCESS:"CLOUDS_MOVE_SUCCESS",DELETE:"CLOUDS_DELETE",DELETE_SUCCESS:"CLOUDS_DELETE_SUCCESS",PUSH:"CLOUDS_PUSH",CLEAR_PUSH2CLOUD:"CLEAR_PUSH2CLOUD",PUSHED:"CLOUDS_PUSHED",PUSH_SUCCESS:"CLOUDS_PUSH_SUCCESS",PUSH_FAILED:"CLOUDS_PUSH_FAILED",SEARCH:"CLOUDS_SEARCH",SEARCH_SUCCESS:"CLOUDS_SEARCH_SUCCESS",SEARCH_FAILED:"CLOUDS_SEARCH_FAILED"},Go={REQUESTED:"WORKSPACE_REQUESTED",LOAD:"WORKSPACE_LOAD",LOAD_SUCCESS:"WORKSPACE_LOAD_SUCCESS",LOAD_FAILED:"WORKSPACE_LOAD_FAILED",SET_VIEW:"WORKSPACE_SET_VIEW",LOAD_LISTS:"WORKSPACE_LOAD_LISTS",SET_LISTS:"WORKSPACE_SET_LISTS",CREATE:"WORKSPACE_CREATE",CREATE_SUCCESS:"WORKSPACE_CREATE_SUCCESS",SAVE:"WORKSPACE_SAVE",DELETE:"WORKSPACE_DELETE",DELETE_SUCCESS:"WORKSPACE_DELETE_SUCCESS",SET_PAGE:"WORKSPACE_SET_PAGE",SEARCH:"WORKSPACE_SEARCH",SEARCH_SUCCESS:"WORKSPACE_SEARCH_SUCCESS",SEARCH_FAILED:"WORKSPACE_SEARCH_FAILED"},Yo={REQUESTED:"SHARED_WORKSPACE_REQUESTED",LOAD:"SHARED_WORKSPACE_LOAD",LOAD_SUCCESS:"SHARED_WORKSPACE_LOAD_SUCCESS",LOAD_FAILED:"SHARED_WORKSPACE_LOAD_FAILED",SET_VIEW:"SHARED_WORKSPACE_SET_VIEW",LOAD_LISTS:"SHARED_WORKSPACE_LOAD_LISTS",SET_LISTS:"SHARED_WORKSPACE_SET_LISTS",SET_PAGE:"SHARED_WORKSPACE_SET_PAGE",SEARCH:"SHARED_WORKSPACE_SEARCH",SEARCH_SUCCESS:"SHARED_WORKSPACE_SEARCH_SUCCESS",SEARCH_FAILED:"SHARED_WORKSPACE_SEARCH_FAILED"},Xo={LOAD:"WORKSPACE_DETAILS_LOAD",REQUESTED:"WORKSPACE_DETAILS_REQUESTED",LOAD_FAILED:"WORKSPACE_DETAILS_LOAD_FAILED",LOAD_SUCCESS:"WORKSPACE_DETAILS_LOAD_SUCCESS",SET_VIEW:"WORKSPACE_DETAILS_SET_VIEW",SET:"WORKSPACE_DETAILS_SET",SAVE:"WORKSPACE_DETAILS_SAVE",DELETE:"WORKSPACE_DETAILS_DELETE",SET_PAGE:"WORKSPACE_DETAILS_SET_PAGE",SET_FILES:"WORKSPACE_DETAILS_SET_FILES",GET_FILES:"WORKSPACE_DETAILS_GET_FILES",GET_FILES_REQUESTED:"WORKSPACE_DETAILS_GET_FILES_REQUESTED",NO_FILES:"WORKSPACE_DETAILS_NO_FILES",ADD_FILE:"WORKSPACE_DETAILS_ADD_FILE",RESET_SEARCH:"WORKSPACE_DETAILS_RESET_SEARCH",SEARCH:"WORKSPACE_DETAILS_SEARCH",SEARCH_SUCCESS:"WORKSPACE_DETAILS_SEARCH_SUCCESS",SEARCH_FAILED:"WORKSPACE_DETAILS_SEARCH_FAILED"},Ko="FULL_SITE_IMPORT_CURRENT_STEP",Zo="FULL_SITE_IMPORT_CUSTOMIZER_STEP",Jo="FULL_SITE_IMPORT_FSI_CLOSED",ei="FULL_SITE_IMPORT_SET_RESULTS",ti="FULL_SITE_IMPORT_SET_FORMDATA",ni="FULL_SITE_IMPORT_SET_CACHE_DATA",ri="FULL_SITE_IMPORT_RESET_FULL_SITE_IMPORT",oi="FULL_SITE_IMPORT_UPDATE_PLUGIN_STATUS",ii="FULL_SITE_IMPORT_SET_AVAILABLE_CREDIT",ai="FULL_SITE_IMPORT_SHOW_AI_SIDEBAR",li="FULL_SITE_IMPORT_HIDE_AI_SIDEBAR",si="FULL_SITE_IMPORT_EXPAND_AI_SIDEBAR",ci="FULL_SITE_IMPORT_COLLAPSE_AI_SIDEBAR",ui="FULL_SITE_IMPORT_SHOW_FSI_MODAL",di="FULL_SITE_IMPORT_HIDE_FSI_MODAL",pi="FULL_SITE_IMPORT_FETCH_PACK_IMPORT_INFO_REQUEST",hi="FULL_SITE_IMPORT_FETCH_PACK_IMPORT_INFO_SUCCESS",fi="FULL_SITE_IMPORT_FETCH_PACK_IMPORT_INFO_FAILURE",mi="FULL_SITE_IMPORT_FETCH_GOOGLE_FONTS_REQUEST",gi="FULL_SITE_IMPORT_FETCH_GOOGLE_FONTS_SUCCESS",vi="FULL_SITE_IMPORT_FETCH_GOOGLE_FONTS_FAILURE",yi="FULL_SITE_IMPORT_RESET_PACK_INFO",bi="FULL_SITE_IMPORT_TRIGGER_FSI_HANDLE_CLICK",wi=Tt(Tt(Tt(Tt(Tt(Tt(Tt({SET_SETTINGS:"SETTINGS_PAGE_SET_SETTINGS",SET_PLATFORM:"SETTINGS_PAGE_SET_PLATFORM",SET_COLORS:"SETTINGS_PAGE_SET_COLORS",SET_SELECTED_TYPOGRAPHY:"SETTINGS_PAGE_SET_SELECTED_TYPOGRAPHY"},"SET_COLORS","SETTINGS_PAGE_SET_COLORS"),"SET_SCREEN","SETTINGS_PAGE_SET_SCREEN"),"SET_CUSTOM_CSS","SETTINGS_PAGE_SET_CUSTOM_CSS"),"SET_LOGO_IMAGE","SETTINGS_PAGE_SET_LOGO_IMAGE"),"SET_LOGO_SIZE","SETTINGS_PAGE_SET_LOGO_SIZE"),"SET_SITE_TITLE","SETTINGS_PAGE_SET_SITE_TITLE"),"SET_SITE_TAGLINE","SETTINGS_PAGE_SET_SITE_TAGLINE");function ki(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function Ei(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ki(i,r,o,a,l,"next",e)}function l(e){ki(i,r,o,a,l,"throw",e)}a(void 0)})}}const Oi=window.regeneratorRuntime;var xi=o.n(Oi);const Si=window.wp.apiFetch;var _i=o.n(Si);const Ci=window.wp.url;var Pi=o(2505),Ti=o.n(Pi);function Ai(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Mi(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)?Mi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function Mi(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}var Ni=function(e){return new Promise(function(t,n){var r=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(function(t){e[t]&&(r[t]=e[t])}),e.innerHTML&&r.appendChild(document.createTextNode(e.innerHTML)),r.onload=function(){return t(!0)},r.onerror=function(){return n(new Error("Error loading asset."))},document.body.appendChild(r),("link"===r.nodeName.toLowerCase()||"script"===r.nodeName.toLowerCase()&&!r.src)&&t()})};function Di(){return Ii.apply(this,arguments)}function Ii(){return Ii=Ei(xi().mark(function e(){var t,n,r,o,i,a,l,s;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Li(document.location.href);case 1:if(t=e.sent){e.next=2;break}return e.abrupt("return");case 2:n=(new window.DOMParser).parseFromString(t,"text/html"),r=["wp-blocks-js-after","essential-blocks-blocks-localize-js-extra","elementor-editor-js-before"],o=Array.from(n.querySelectorAll('link[rel="stylesheet"],script')).filter(function(e){return e.id&&(r.includes(e.id)||!document.getElementById(e.id))}),i=Ai(o),e.prev=3,i.s();case 4:if((a=i.n()).done){e.next=6;break}return l=a.value,e.next=5,Ni(l);case 5:e.next=4;break;case 6:e.next=8;break;case 7:e.prev=7,s=e.catch(3),i.e(s);case 8:return e.prev=8,i.f(),e.finish(8);case 9:case"end":return e.stop()}},e,null,[[3,7,8,9]])})),Ii.apply(this,arguments)}var Li=function(){var e=Ei(xi().mark(function e(t){var n,r,o,i;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(){return i=Ei(xi().mark(function e(t){var i,a,l;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,_i()({url:t,parse:!1,redirect:"manual"});case 1:return i=e.sent,e.abrupt("return",i.text());case 2:if(e.prev=2,l=e.catch(0),a=l.type,l.status,!("opaqueredirect"===a&&r<n)){e.next=3;break}return r++,e.abrupt("return",o(t));case 3:return e.abrupt("return",null);case 4:case"end":return e.stop()}},e,null,[[0,2]])})),i.apply(this,arguments)},o=function(e){return i.apply(this,arguments)},n=3,r=0,e.abrupt("return",o(t));case 1:case"end":return e.stop()}},e)}));return function(_x){return e.apply(this,arguments)}}();function Ri(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 ji(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ri(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ri(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Fi,zi=function(e){return ji({type:xr},e)},Bi=function(e){return ji({type:Sr},e)},Wi=function(e){return ji({type:Cr},e)},Ui=function(e){return ji({type:Pr},e)},Vi=function(e){return ji({type:Ar},e)},Hi=function(e){return ji({type:Mr},e)},qi=function(e){return ji({type:kr},e)},Qi=function(e){return ji({type:eo},e)},$i=function(e){return ji({type:Er},e)},Gi=function(e){return ji({type:no},e)},Yi=function(e){return ji({type:ro},e)},Xi=function(e){return ji({type:oo},e)},Ki=function(e){return ji({type:ko},e)},Zi=function(e){return ji({type:wo},e)},Ji=function(e){return ji({type:Eo},e)},ea=function(e){return ji({type:Oo},e)},ta=function(e){return ji({type:lo},e)},na=function(e){return ji({type:so},e)},ra=function(e){return ji({type:co},e)},oa=function(e){return ji({type:uo},e)},ia=function(e){return ji({type:po},e)},aa=function(e){return ji({type:fo},e)},la=function(e){return ji({type:mo},e)},sa=function(e){return ji({type:go},e)},ca=function(e){return ji({type:vo},e)},ua=function(e){return ji({type:yo},e)},da=["path"];function pa(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 ha(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pa(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var fa=window.templately.rest_args,ma=(window.templatelyDeveloper||{}).log,ga=void 0!==ma&&ma,va=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(function(e){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?e:204===e.status?null:e.json?e.json():Promise.reject(e)}(e,t)).catch(function(e){return ya(e,t)})};function ya(e){if(arguments.length>1&&void 0!==arguments[1]&&!arguments[1])throw e;return function(e){var t={code:"invalid_json",message:(0,At.__)("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(function(){throw t})}(e).then(function(e){var t={code:"unknown_error",message:(0,At.__)("An unknown error occurred.")};throw e||t})}fa&&(_i().use(_i().createNonceMiddleware(null==fa?void 0:fa.nonce)),_i().use(_i().createRootURLMiddleware(null==fa?void 0:fa.endpoint))),void 0===(null===(Fi=window)||void 0===Fi?void 0:Fi.fetch)&&_i().setFetchHandler(function(e){var t=e.url,n=e.path,r=e.data,o=e.method;return Ti()({url:t||n,method:o,data:r}).then(function(e){return null==e?void 0:e.data}).catch(function(e){return Promise.reject(e.response.data)})});var ba=function(){var e=Ei(xi().mark(function e(t,n){var r,o=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>2&&void 0!==o[2]?o[2]:{},e.next=1,wa(t,n,ha(ha({},r),{},{method:"GET"}));case 1:return e.abrupt("return",e.sent);case 2:case"end":return e.stop()}},e)}));return function(_x,t){return e.apply(this,arguments)}}(),wa=function(){var e=Ei(xi().mark(function e(t,n){var r,o,i,a=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&void 0!==a[2]?a[2]:{},o=a.length>3&&void 0!==a[3]&&a[3],e.prev=1,e.next=2,Oa(t,n,r,o);case 2:case 5:return e.abrupt("return",e.sent);case 3:if(e.prev=3,"retry_again"!==(null==(i=e.catch(1))?void 0:i.code)){e.next=6;break}return e.next=4,Di();case 4:return e.next=5,Oa(t,n,r,o);case 6:throw i;case 7:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}(),ka=function(e){if(e&&e.headers&&Kx&&Kx.dispatch)try{var t=e.headers.get("X-Templately-Verified");t&&["true","1","yes","on"].includes(t.toLowerCase())&&(Kx.dispatch($i({is_verified:!0})),ga&&console.log("User verification status updated via X-Templately-Verified header"))}catch(e){ga&&console.error("Error checking verification header:",e)}},Ea=function(){var e=Ei(xi().mark(function e(t){var n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.path,r=Wn(t,da),n){e.next=1;break}throw new Error('secureApiFetch: Request options must include a "path" property.');case 1:return o=ha(ha({},r),{},{path:n,parse:!1}),(n.startsWith("http")||n.includes("/wp-admin/admin-ajax.php"))&&(o.url=n,delete o.path),e.abrupt("return",_i()(o).then(function(e){return ka(e),Promise.resolve(e).then(function(e){if(e.status>=200&&e.status<300)return e;throw e}).catch(function(e){return ya(e,!0)}).then(function(e){return va(e,!0)})}).catch(function(e){return Promise.reject(e).catch(function(e){return ya(e,!0)}).then(function(e){return va(e,!0)})}));case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Oa=function(){var e=Ei(xi().mark(function e(t,n){var r,o,i,a,l,s,c=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=c.length>3&&void 0!==c[3]&&c[3],o={response:void 0,error:void 0},i=ha({path:t,method:"POST",headers:{"Content-Type":"application/json"}},c.length>2&&void 0!==c[2]?c[2]:{}),n&&"POST"===i.method&&(i.data=n),n&&"GET"===i.method&&(a=(0,Ci.addQueryArgs)(i.path,n),i.path=a),!r){e.next=2;break}return e.next=1,Ea(i);case 1:return e.abrupt("return",e.sent);case 2:return e.prev=2,e.next=3,Ea(i);case 3:l=e.sent,o=ha(ha({},o),{},{response:l}),e.next=5;break;case 4:e.prev=4,s=e.catch(2),o=ha(ha({},o),{},{error:s});case 5:return ga&&console.log("Templately API Return: ",t,o),e.abrupt("return",o);case 6:case"end":return e.stop()}},e,null,[[2,4]])}));return function(t,n){return e.apply(this,arguments)}}(),xa=function(){var e=Ei(xi().mark(function e(t){var n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(r=null===(n=t.headers)||void 0===n?void 0:n.get("content-type"))||!r.includes("application/json")){e.next=4;break}return e.next=1,t.json();case 1:if(!(o=e.sent).message){e.next=2;break}return e.abrupt("return",o.message);case 2:if(!o.error){e.next=3;break}return e.abrupt("return","string"==typeof o.error?o.error:o.error.message||(0,At.__)("Request failed","templately"));case 3:if(!o.data){e.next=4;break}return e.abrupt("return","string"==typeof o.data?o.data:o.data.message||(0,At.__)("Request failed","templately"));case 4:e.next=6;break;case 5:e.prev=5,e.catch(0);case 6:return e.abrupt("return","HTTP error! status: ".concat(t.status));case 7:case"end":return e.stop()}},e,null,[[0,5]])}));return function(t){return e.apply(this,arguments)}}(),Sa=function(){var e=Ei(xi().mark(function e(t,n){var r,o,i,a,l,s,c,u,d,p,h=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=h.length>2&&void 0!==h[2]?h[2]:{},t){e.next=1;break}throw new Error("URL is required for FormData API call");case 1:if(n instanceof FormData){e.next=2;break}throw new Error("Second parameter must be a FormData object");case 2:return(o=ha({method:"POST",body:n},r)).headers&&o.headers["Content-Type"]&&delete o.headers["Content-Type"],e.prev=3,e.next=4,window.fetch(t,o);case 4:if(i=e.sent,ka(i),i.ok){e.next=6;break}return e.next=5,xa(i);case 5:throw a=e.sent,new Error(a);case 6:return e.prev=6,e.next=7,i.json();case 7:return l=e.sent,ga&&console.log("Templately FormData API Return: ",t,l),e.abrupt("return",l);case 8:return e.prev=8,d=e.catch(6),e.prev=9,e.next=10,i.text();case 10:return s=e.sent,ga&&console.log("Templately FormData API Return: ",t,s),e.abrupt("return",s);case 11:throw e.prev=11,e.catch(9),d;case 12:if(e.prev=12,p=e.catch(3),e.prev=13,!p.response){e.next=15;break}if(!(u=null===(c=p.response.headers)||void 0===c?void 0:c.get("content-type"))||!u.includes("application/json")){e.next=15;break}return e.next=14,p.response.json();case 14:case 16:throw e.sent;case 15:if("function"!=typeof p.json){e.next=17;break}return e.next=16,p.json();case 17:throw p;case 18:throw e.prev=18,e.catch(13),{error:"Request and parsing failed",message:p.message||"Unknown error",originalError:p};case 19:case"end":return e.stop()}},e,null,[[3,12],[6,8],[9,11],[13,18]])}));return function(t,n){return e.apply(this,arguments)}}();const _a=window.lodash,Ca=o.p+"images/ratting.png",Pa=o.p+"images/trending.png",Ta=o.p+"images/new.png",Aa=o.p+"images/featured.png",Ma=o.p+"images/popular.png",Na=o.p+"images/exclusive.png";var Da,Ia;function La(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 Ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?La(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):La(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ja=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"packs";return"blocks"==e?"sections":e},Fa=function(e){return String(Math.floor(Number(e)))===e},za=function(e){return null!==e&&"object"===ne(e)&&!Ba(e)},Ba=function(e){return null!==e&&"object"===ne(e)&&Array.isArray(e)},Wa=function(e,t){return t?e+"_"+t.toUpperCase():e},Ua=function(e,t,n,r){void 0===r&&(r=0);for(var o=(0,_a.toPath)(t);e&&r<o.length;)e=e[o[r++]];return void 0===e?n:e},Va=function(e,t,n){for(var r=(0,_a.clone)(e),o=r,i=0,a=(0,_a.toPath)(t);i<a.length-1;i++){var l=a[i],s=Ua(e,a.slice(0,i+1));if(s&&(za(s)||Array.isArray(s)))o=o[l]=(0,_a.clone)(s);else{var c=a[i+1];o=o[l]=Fa(c)&&Number(c)>=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)},Ha=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())},qa=function(e){return/^[A-Za-z\s-]+$/.test(e=e||"")},Qa=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},$a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=[];return null!=e&&e.length>0&&"object"==ne(e)&&e.map(function(e){var a=r.length>0?Qa(e,r):Ra({},e),l=!1;o.indexOf(a[n])>-1&&(l=!0),i.push(Ra(Ra({},a),{},{value:a[n],label:a.name,shared:t,isDisabled:l}))}),i},Ga=function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.childNodes,r=n.length;r--;)if(1==n[r].nodeType)return!0;return!1},Ya=function(e,t){var n,r;if((null==t?void 0:t.length)>0)return null!==(n=null===(r=Ne(e,"/"+t))||void 0===r?void 0:r.params)&&void 0!==n?n:void 0},Xa=function(e){return e.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()})},Ka=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lifetime",n="https://templately.com/checkout/",r={};return null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.dev_api&&(n="https://templately.dev/checkout/"),"lifetime"===t&&(r=Ra(Ra({},r),{},{type:"one_time"})),r=Ra(Ra({},r),{},{utm_source:"plugin",utm_medium:"upgradePlan"}),(0,Ci.addQueryArgs)(n,r)},Za=function(e,t){var n,r="https://templately.com/"+t+"/";return null!==(n=window.templatelyDeveloper)&&void 0!==n&&n.dev_api&&(r="https://templately.dev/"+t+"/"),(r+=e)+"?utm_source=plugin&utm_medium=itemDetailsHeader"},Ja=null!==(Da=window.templatelyDeveloper)&&void 0!==Da&&Da.log?window.console.log.bind(window.console):function(){},el=(null!==(Ia=window.templatelyDeveloper)&&void 0!==Ia&&Ia.log&&window.console.trace.bind(window.console),function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t="",n=0;n<e;n++)t+="abcdefghijklmnopqrstuvwxyz".charAt(Math.floor(26*Math.random()));return t}),tl=[{key:"top_rated",title:"Top Rated",image:Ca,class:"ratting"},{key:"trending",title:"Trending",image:Pa,class:"trending"},{key:"popular",title:"Popular",image:Ma,class:"popular"},{key:"new_arrival",title:"New Arrival",image:Ta,class:"new"},{key:"exclusive",title:"Exclusive",image:Na,class:"exclusive"},{key:"featured",title:"Featured",image:Aa,class:"featured"}],nl=function(e,t){var n,r,o,i,a,l="",s=!0;if(null==(null==t?void 0:t[e])&&"email"!=e)return{isValid:s=!0};switch(e){case"email":0!=(null===(n=t.email)||void 0===n||null===(n=n.trim())||void 0===n?void 0:n.length)&&Ha(t.email)||(s=!1,l=(0,At.__)("Please enter a valid email address.","templately"));break;case"api_key":0==(null===(r=t.api_key)||void 0===r||null===(r=r.trim())||void 0===r?void 0:r.length)&&(s=!1),l=(0,At.__)("Please provide a valid API Key.","templately");break;case"first_name":0==(null===(o=t.first_name)||void 0===o||null===(o=o.trim())||void 0===o?void 0:o.length)?(s=!1,l=(0,At.__)("First name cannot be empty.","templately")):qa(t.first_name)||(s=!1,l=(0,At.__)("The First Name may only contain letters, dashes and spaces.","templately"));break;case"last_name":0==(null===(i=t.last_name)||void 0===i||null===(i=i.trim())||void 0===i?void 0:i.length)?(s=!1,l=(0,At.__)("Last name cannot be empty.","templately")):qa(t.last_name)||(s=!1,l=(0,At.__)("The Last Name may only contain letters, dashes and spaces.","templately"));break;case"password":l=(0,At.__)("Password cannot be empty.","templately"),null!=t.password&&((a=t.password).length<8||!/[A-Z]/g.test(a)||!/[a-z]/g.test(a)||!/[0-9]/g.test(a)||/["\\]/g.test(a))&&(s=!1,l=(0,At.__)("Password must contain at least 8 characters, uppercase, lowercase and numbers.","templately"));break;case"confirm_password":null!=(null==t?void 0:t.confirm_password)&&t.password!==t.confirm_password&&(s=!1,l=(0,At.__)("Password not matched!","templately"))}return{title:(0,At.__)("Oops...!","templately"),content:l,isValid:s}},rl=o(8465),ol=o.n(rl),il=o(9644),al=o.n(il);const ll=function(e){var t=e.header,n=e.className,r=void 0===n?"":n;return ae().createElement("div",{className:"templately-sweetalert-header ".concat(r)},ae().createElement("h3",null,t))},sl=function(e){var t=e.children;return ae().createElement("div",{className:"templately-sweetalert-body"},t)},cl=function(e){var t=e.icon,n=void 0===t?null:t,r=e.children,o=e.className,i=void 0===o?"":o,a=e.header,l=void 0===a?null:a,s=e.headerClass,c=void 0===s?"":s,u=e.hideHeader,d=void 0!==u&&u;return ae().createElement(ae().Fragment,null,n&&ae().createElement("span",{className:"templately-sweetalert-icon --shape-1"},n),ae().createElement("div",{className:"templately-sweetalert-container ".concat(i)},null!=l&&!d&&ae().createElement(ll,{className:c,header:l}),ae().createElement(sl,null,r)))},ul=function(e){var t=e.children,n=e.className,r=void 0===n?"":n;return ae().createElement("div",{className:"templately-row ".concat(r)},t)},dl=function(e){var t=e.wrapper,n=void 0!==t&&t,r=e.wrapperClass,o=void 0===r?"":r,i=e.children,a=e.className,l=void 0===a?"":a,s=e.column,c=void 0===s?null:s,u=Vn()(l,Tt({"templately-col":null==c},"templately-col-".concat(c),null!=c));return ae().createElement("div",{className:u},n&&ae().createElement("div",{className:o},i),!n&&i)},pl=function(e){var t=e.template,n="";return"lists"===t&&(n=ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"tph-col-4 small rounded"}),ae().createElement("div",{className:"tph-item small rounded"}),ae().createElement("div",{className:"tph-col-3 small rounded"}),ae().createElement("div",{className:"tph-col-7 small rounded"}))),"clouds_status"===t&&(n=ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"tph-col-10 medium"}),ae().createElement("div",{className:"tph-item small rounded"}),ae().createElement("div",{className:"tph-col-7 tiny"}))),"featuredItems"===t&&(n=ae().createElement("div",{className:"tph-row d-flex"},ae().createElement("div",{className:"tph-col-4 rounded",style:{height:"200px",margin:"0px 10px"}}),ae().createElement("div",{className:"tph-col-4 rounded",style:{height:"200px",margin:"0px 10px"}}),ae().createElement("div",{className:"tph-col-4 rounded",style:{height:"200px",margin:"0px 10px"}}))),ae().createElement("div",{className:"templately-ph-wrapper"},n)};var hl=["code","message","platform"];const fl=function(e){var t=e.code,n=e.message,r=e.platform,o=Wn(e,hl),i=rt();return(0,oe.useEffect)(function(){"invalid_api_key"!==t&&"is_signed_failed"!==t||(o.logout({isGloballySigned:o.isGloballySigned}),i(ub("sign-in",{platform:r}),{replace:!0,state:{signed_in_failed:!0}}))},[t]),React.createElement("div",{className:"templately-error-wrapper"},React.createElement("div",{className:"templately-error"},React.createElement("p",null,React.createElement("strong",null,t,":")," ",n)))},ml=function(e){var t,n=e.className,r=pe(Ct(),1)[0],o=pe((0,oe.useState)(null!==(t=null==r?void 0:r.get("q"))&&void 0!==t?t:""),2),i=o[0],a=o[1],l=pe((0,oe.useState)(!1),2),s=l[0],c=l[1],u=rt(),d=tt();(0,oe.useEffect)(function(){var e=(0,Ci.getQueryArgs)(d.search),t=e.path;i.length>=3&&!0===s&&(e.q=i,u(ub(t,e),{replace:!0}),c(!1)),"reset"===s&&(u(ub(t,e,["q"]),{replace:!0}),a(""),c(!1))},[s]);var p=Vn()("templately-search",n,{"search-active":null!==(null==r?void 0:r.get("q"))});return ae().createElement("div",{className:p},ae().createElement(bl,{wrapper:!1,onKeyDown:function(e){return c(13===(null==e?void 0:e.keyCode))},value:i,onChange:function(e){return a(e.currentTarget.value)},placeholder:(0,At.__)("Type and hit enter...","templately")}),ae().createElement(vl,{className:"templately-search-button",onClick:function(){null==r.get("q")?c(!0):c("reset")}},null!=r.get("q")?ae().createElement(vr,null):ae().createElement(fr,null)))};var gl=["label","onClick","className","children"];const vl=function(e){var t=e.label,n=void 0===t?"":t,r=e.onClick,o=void 0===r?function(e){}:r,i=e.className,a=void 0===i?"":i,l=e.children,s=Wn(e,gl);return ae().createElement("button",re({},s,{className:"templately-button ".concat(a),onClick:function(e){return o(e)}}),n,l)};var yl=["wrapper","className"];const bl=function(e){var t=e.wrapper,n=void 0===t||t,r=e.className,o=Wn(e,yl);return ae().createElement(ae().Fragment,null,n?ae().createElement("div",{className:r},ae().createElement("input",re({type:"text"},o))):ae().createElement("input",re({type:"text",className:r},o)))};var wl=["href","name","wrapper","children"];const kl=function(e){var t,n=e.href,r=e.name,o=e.wrapper,i=void 0!==o&&o,a=e.children,l=Wn(e,wl),s=ae().createElement(ae().Fragment,null,n&&(t=n,new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t))?ae().createElement("a",{target:"_blank",rel:"nofollow",href:n},r):r,a);return ae().createElement("label",l,i?ae().createElement("span",null,s):s)};var El={animation:"spin 2s linear infinite"};const Ol=function(e){return ae().createElement("svg",re({width:"154",height:"154",viewBox:"0 0 154 154",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:El},e),ae().createElement("style",null,"@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }"),ae().createElement("g",{filter:"url(#filter0_ii_267_161)"},ae().createElement("path",{d:"M146.804 76.976C150.752 76.976 153.986 73.7689 153.62 69.8383C152.084 53.3371 145.251 37.6999 134.045 25.3191C121.233 11.1647 103.617 2.27656 84.62 0.380621C65.6226 -1.51532 46.5984 3.71622 31.2416 15.0594C17.8091 24.9812 8.02095 38.9597 3.2538 54.8318C2.11826 58.6125 4.65527 62.3956 8.52501 63.1758L11.2711 63.7294C15.1408 64.5096 18.8694 61.9851 20.1048 58.2358C23.9668 46.5151 31.3798 36.2125 41.3995 28.8115C53.3454 19.9877 68.1442 15.9181 82.9222 17.3929C97.7002 18.8678 111.403 25.7818 121.369 36.7924C129.729 46.0277 134.959 57.5921 136.429 69.8449C136.899 73.7644 140.055 76.976 144.003 76.976H146.804Z",fill:"url(#paint0_radial_267_161)"})),ae().createElement("defs",null,ae().createElement("filter",{id:"filter0_ii_267_161",x:"1.9812",y:"-2",width:"155.667",height:"80.976",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},ae().createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),ae().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),ae().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),ae().createElement("feMorphology",{radius:"2",operator:"erode",in:"SourceAlpha",result:"effect1_innerShadow_267_161"}),ae().createElement("feOffset",{dx:"-1",dy:"-2"}),ae().createElement("feGaussianBlur",{stdDeviation:"1.5"}),ae().createElement("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),ae().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),ae().createElement("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_267_161"}),ae().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),ae().createElement("feMorphology",{radius:"1",operator:"dilate",in:"SourceAlpha",result:"effect2_innerShadow_267_161"}),ae().createElement("feOffset",{dx:"4",dy:"2"}),ae().createElement("feGaussianBlur",{stdDeviation:"4.5"}),ae().createElement("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),ae().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),ae().createElement("feBlend",{mode:"normal",in2:"effect1_innerShadow_267_161",result:"effect2_innerShadow_267_161"})),ae().createElement("radialGradient",{id:"paint0_radial_267_161",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(143.2 58.9146) rotate(135.264) scale(98.1544 195.02)"},ae().createElement("stop",{stopColor:"#361595"}),ae().createElement("stop",{offset:"0.354309",stopColor:"#73AAF6"}),ae().createElement("stop",{offset:"0.65428",stopColor:"#D7E8FF"}),ae().createElement("stop",{offset:"1",stopColor:"#D7E8FF",stopOpacity:"0"}))))};var xl=["style","template","text","description","className","isWhiteLabel"],Sl=window.templately.loadingImage;const _l=function(e){var t=e.style,n=void 0===t?"logo":t,r=e.template,o=void 0===r?null:r,i=e.text,a=void 0===i?"":i,l=e.description,s=void 0===l?"":l,c=e.className,u=void 0===c?"":c,d=e.isWhiteLabel,p=void 0!==d&&d,h=(Wn(e,xl),Vn()("templately-preloader",u,"templately-preloader-".concat(n)));return ae().createElement("div",{className:h},"logo"===n&&(p?ae().createElement(Ol,null):ae().createElement("img",{src:Sl,alt:"Templately"})),"placeholder"===n&&ae().createElement(pl,{template:o}),a&&ae().createElement("div",{className:"tp-waviy"},Array.from(a).map(function(e,t){return ae().createElement("span",{key:t,style:Tt({},"--i",t+1)},e)})),s&&ae().createElement("p",{className:"tp-description"},s))};function Cl(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 Pl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cl(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Tl=al()(ol()),Al=function(){var e,t,n,r,o,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={target:"#templately-wrapper",heightAuto:!1,showConfirmButton:!1,allowOutsideClick:!0,showCloseButton:!1,loaderHtml:ae().createElement(_l,null)},c={container:"templately-sweetalert ",popup:"templately-popup ",loader:"templately-sweetalert-loader ",closeButton:"templately-sweetalert-close ",htmlContainer:"templately-sweetalert-html "};return null!==(e=a=a!={}?Pl(Pl({},s),a):s)&&void 0!==e&&e.customClass&&(c.container+=null!==(t=a.customClass.container)&&void 0!==t?t:"",c.popup+=null!==(n=a.customClass.popup)&&void 0!==n?n:"",c.loader+=null!==(r=a.customClass.loader)&&void 0!==r?r:"",c.closeButton+=null!==(o=a.customClass.closeButton)&&void 0!==o?o:"",c.htmlContainer+=null!==(i=a.customClass.htmlContainer)&&void 0!==i?i:""),a.customClass=c,l&&(a.html=ae().createElement(jt,{store:Kx},a.html)),Tl.fire(a).then(function(e){var t,n;return e.isDismissed?((null===(n=a)||void 0===n?void 0:n.dispatch)&&a.dispatch((0,Sy.closeModal)()),e):(null!==(t=a)&&void 0!==t&&t.onConfirm&&a.onConfirm(e),e)}).catch(function(e){var t;return null!==(t=a)&&void 0!==t&&t.onError&&a.onError(e),e})},Ml=function(e,t){var n={icon:"success",timer:1500,html:null},r=null;if(!0===(null==t?void 0:t[e.key])){var o,i=Pl({},e.success);t.message&&(i.content=t.message),r=null!==(o=null==i?void 0:i.args)&&void 0!==o?o:null,n=Pl(Pl({},n),{},{html:ae().createElement(i_,re({},i,{contentArgs:null==t?void 0:t.contentArgs}))})}else if(!1===(null==t?void 0:t[e.key])){var a,l=Pl({},e.error);t.message&&(l.content=t.message),r=null!==(a=null==l?void 0:l.args)&&void 0!==a?a:null,n=Pl(Pl({},n),{},{icon:"error",html:ae().createElement(i_,re({},l,{contentArgs:null==t?void 0:t.contentArgs}))})}null!=r&&(n=Pl(Pl({},n),r)),null!=n.html&&Al(n)},Nl=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Tl.getCloseButton();e?(t.classList.add("is-disabled"),t.setAttribute("disabled",!0)):(t.removeAttribute("disabled"),t.classList.remove("is-disabled"))};function Dl(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 Il(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dl(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ll(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Rl="function"==typeof Symbol&&Symbol.observable||"@@observable",jl=function(){return Math.random().toString(36).substring(7).split("").join(".")},Fl={INIT:"@@redux/INIT"+jl(),REPLACE:"@@redux/REPLACE"+jl(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+jl()}};function zl(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Ll(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Ll(1));return n(zl)(e,t)}if("function"!=typeof e)throw new Error(Ll(2));var o=e,i=t,a=[],l=a,s=!1;function c(){l===a&&(l=a.slice())}function u(){if(s)throw new Error(Ll(3));return i}function d(e){if("function"!=typeof e)throw new Error(Ll(4));if(s)throw new Error(Ll(5));var t=!0;return c(),l.push(e),function(){if(t){if(s)throw new Error(Ll(6));t=!1,c();var n=l.indexOf(e);l.splice(n,1),a=null}}}function p(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(Ll(7));if(void 0===e.type)throw new Error(Ll(8));if(s)throw new Error(Ll(9));try{s=!0,i=o(i,e)}finally{s=!1}for(var t=a=l,n=0;n<t.length;n++)(0,t[n])();return e}return p({type:Fl.INIT}),(r={dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Ll(10));o=e,p({type:Fl.REPLACE})}})[Rl]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Ll(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[Rl]=function(){return this},e},r}function Bl(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:Fl.INIT}))throw new Error(Ll(12));if(void 0===n(void 0,{type:Fl.PROBE_UNKNOWN_ACTION()}))throw new Error(Ll(13))})}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},l=0;l<a.length;l++){var s=a[l],c=n[s],u=e[s],d=c(u,t);if(void 0===d)throw t&&t.type,new Error(Ll(14));o[s]=d,r=r||d!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}function Wl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function Ul(e){return function(e){if(Array.isArray(e))return ue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||de(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Vl,Hl,ql,Ql,$l=["type"];function Gl(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 Yl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gl(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Xl={isLoading:!0,items:[],error:null},Kl={isLoading:!0,items:[],error:null},Zl={dependencies:{include:[],exclude:[]},tags:[],results:{},doQuery:!1,prevQuery:!1},Jl={platform:"elementor",has_elementor:null!==(Vl=Boolean(window.templately.has_elementor))&&void 0!==Vl&&Vl,has_elementor_pro:null!==(Hl=Boolean(window.templately.has_elementor_pro))&&void 0!==Hl&&Hl,current_screen:null!==(ql=window.templately.current_screen)&&void 0!==ql?ql:"templately",ui_theme:null!==(Ql=window.templately.theme)&&void 0!==Ql?Ql:"light",plan:"all",headerHeight:0,categories:{isLoading:!0,lists:[]},templateTypes:{isLoading:!0,lists:[]},dependencies:{},tags:[],pricing:{isLoading:!0,error:null,data:[]},error:null,filter:Zl,counts:null,featured:Xl,trending:Kl,related:{isLoading:!0,items:[],error:null},redirect:null,fullSiteImport:{currentStep:1,results:null,aiSidebarContext:{id:null,show:!1,content:{},expanded:!1},fsiModalContext:{show:!1,aiTemplates:null},packInfo:{data:null,loading:!1,error:null},googleFonts:{data:null,loading:!1,error:null}}};var es=["type","current_page","total_page","platform","data","meta"],ts=["meta"];function ns(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 rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ns(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ns(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var os=window.templately.is_signed.user,is=null!=os?os:{},as=is.meta,ls=void 0===as?null:as,ss=Wn(is,["meta"]),cs={isLoading:!1,syncing:!1,error:null,prevData:null,favourites:{isLoading:!0,currentPage:1,totalPage:1,type:"all",plan:"all"},downloads:{isLoading:!0},purchasedItems:{isLoading:!0,all:null},data:null,favourite:{loading:!1,error:null},rating:{loading:!1,error:null}};Object.keys(ss).length>0&&(cs=rs(rs({},cs),{},{data:ss})),null!=ls&&(cs=rs(rs({},cs),ls));var us=["search"],ds=["type"],ps=["type"],hs=["type"];function fs(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 ms(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fs(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gs={isLoading:!0,limit:0,usage:0,error:null},vs={status:gs,isLoading:!0,view:"list",error:null,items:{},search:{},push2cloud:{isLoading:!1}};var ys=["type"];function bs(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 ws(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bs(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ks={isLoading:!0,currentPage:1,totalPage:1,error:null,view:"grid",lists:[],search:{keyword:"",context:"",data:[]}};function Es(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 Os(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Es(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Es(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xs={isLoading:!0,currentPage:1,totalPage:1,view:"list",error:null,lists:[],search:{keyword:"",context:"",data:[]}};var Ss=["type"];function _s(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 Cs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_s(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ps={isLoading:!1,keyword:"",context:"",data:{currentPage:1,totalPage:1,1:[]}},Ts={isLoading:!0,isFilesLoading:!0,view:"list",error:null,search:Ps};var As=["type","platform","currentPage","totalPage","data"];function Ms(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 Ns(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ms(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ms(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ds={isLoading:!0,elementor:{currentPage:1,totalPage:1}};var Is=["type"];function Ls(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 Rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ls(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ls(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var js={platform:"elementor",isLoading:!1,conditions:[],conditionsByTemplate:{},conditionsForSave:{}};var Fs,zs,Bs,Ws,Us=["type"];function Vs(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 Hs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vs(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var qs=(0,_a.cloneDeep)(null!==(Fs=null===(zs=window.templately)||void 0===zs?void 0:zs.settings)&&void 0!==Fs?Fs:{}),Qs={settings:qs,platform:(null==qs?void 0:qs.imported_platform)||(null!=qs&&qs.has_elementor?"elementor":"gutenberg"),logoImage:null!==(Bs=null==qs?void 0:qs.site_logo)&&void 0!==Bs?Bs:null,customCSS:null!==(Ws=null==qs?void 0:qs.customCSS)&&void 0!==Ws?Ws:null};var $s=Symbol.for("immer-nothing"),Gs=Symbol.for("immer-draftable"),Ys=Symbol.for("immer-state");function Xs(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ks=Object,Zs=Ks.getPrototypeOf,Js="constructor",ec="prototype",tc="configurable",nc="enumerable",rc="writable",oc="value",ic=e=>!!e&&!!e[Ys];function ac(e){return!!e&&(cc(e)||mc(e)||!!e[Gs]||!!e[Js]?.[Gs]||gc(e)||vc(e))}var lc=Ks[ec][Js].toString(),sc=new WeakMap;function cc(e){if(!e||!yc(e))return!1;const t=Zs(e);if(null===t||t===Ks[ec])return!0;const n=Ks.hasOwnProperty.call(t,Js)&&t[Js];if(n===Object)return!0;if(!bc(n))return!1;let r=sc.get(n);return void 0===r&&(r=Function.toString.call(n),sc.set(n,r)),r===lc}function uc(e,t,n=!0){0===dc(e)?(n?Reflect.ownKeys(e):Ks.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function dc(e){const t=e[Ys];return t?t.type_:mc(e)?1:gc(e)?2:vc(e)?3:0}var pc=(e,t,n=dc(e))=>2===n?e.has(t):Ks[ec].hasOwnProperty.call(e,t),hc=(e,t,n=dc(e))=>2===n?e.get(t):e[t],fc=(e,t,n,r=dc(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},mc=Array.isArray,gc=e=>e instanceof Map,vc=e=>e instanceof Set,yc=e=>"object"==typeof e,bc=e=>"function"==typeof e,wc=e=>"boolean"==typeof e,kc=e=>e.copy_||e.base_,Ec=e=>e.modified_?e.copy_:e.base_;function Oc(e,t){if(gc(e))return new Map(e);if(vc(e))return new Set(e);if(mc(e))return Array[ec].slice.call(e);const n=cc(e);if(!0===t||"class_only"===t&&!n){const t=Ks.getOwnPropertyDescriptors(e);delete t[Ys];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i[rc]&&(i[rc]=!0,i[tc]=!0),(i.get||i.set)&&(t[o]={[tc]:!0,[rc]:!0,[nc]:i[nc],[oc]:e[o]})}return Ks.create(Zs(e),t)}{const t=Zs(e);if(null!==t&&n)return{...e};const r=Ks.create(t);return Ks.assign(r,e)}}function xc(e,t=!1){return _c(e)||ic(e)||!ac(e)||(dc(e)>1&&Ks.defineProperties(e,{set:Sc,add:Sc,clear:Sc,delete:Sc}),Ks.freeze(e),t&&uc(e,(e,t)=>{xc(t,!0)},!1)),e}var Sc={[oc]:function(){Xs(2)}};function _c(e){return null===e||!yc(e)||Ks.isFrozen(e)}var Cc,Pc="MapSet",Tc="Patches",Ac={};function Mc(e){const t=Ac[e];return t||Xs(0),t}var Nc=()=>Cc;function Dc(e,t){t&&(e.patchPlugin_=Mc(Tc),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ic(e){Lc(e),e.drafts_.forEach(jc),e.drafts_=null}function Lc(e){e===Cc&&(Cc=e.parent_)}var Rc=e=>{return Cc={drafts_:[],parent_:Cc,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:(t=Pc,Ac[t]?Mc(Pc):void 0)};var t};function jc(e){const t=e[Ys];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Fc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[Ys].modified_&&(Ic(t),Xs(4)),ac(e)&&(e=zc(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Ys].base_,e,t)}else e=zc(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xc(t,n)}(t,e,!0),Ic(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==$s?e:void 0}function zc(e,t){if(_c(t))return t;const n=t[Ys];if(!n)return qc(t,e.handledSet_,e);if(!Wc(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Hc(n,e)}return n.copy_}function Bc(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Wc=(e,t)=>e.scope_===t,Uc=[];function Vc(e,t,n,r){const o=kc(e),i=e.type_;if(void 0!==r&&hc(o,r,i)===t)return void fc(o,r,n,i);if(!e.draftLocations_){const t=e.draftLocations_=new Map;uc(o,(e,n)=>{if(ic(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const a=e.draftLocations_.get(t)??Uc;for(const e of a)fc(o,e,n,i)}function Hc(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Bc(e)}}function qc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ic(e)||t.has(e)||!ac(e)||_c(e)||(t.add(e),uc(e,(r,o)=>{if(ic(o)){const t=o[Ys];if(Wc(t,n)){const n=Ec(t);fc(e,r,n,e.type_),Bc(t)}}else ac(o)&&qc(o,t,n)})),e}var Qc={get(e,t){if(t===Ys)return e;const n=kc(e);if(!pc(n,t,e.type_))return function(e,t,n){const r=Yc(t,n);return r?oc in r?r[oc]:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];if(e.finalized_||!ac(r))return r;if(r===Gc(e.base_,t)){Kc(e);const n=1===e.type_?+t:t,o=Zc(e.scope_,r,e,n);return e.copy_[n]=o}return r},has:(e,t)=>t in kc(e),ownKeys:e=>Reflect.ownKeys(kc(e)),set(e,t,n){const r=Yc(kc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Gc(kc(e),t),a=r?.[Ys];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||pc(e.base_,t,e.type_)))return!0;Kc(e),Xc(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),function(e,t,n){const{scope_:r}=e;if(ic(n)){const o=n[Ys];Wc(o,r)&&o.callbacks_.push(function(){Kc(e);const r=Ec(o);Vc(e,n,r,t)})}else ac(n)&&e.callbacks_.push(function(){const o=kc(e);hc(o,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&qc(hc(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>(Kc(e),void 0!==Gc(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),Xc(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=kc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[rc]:!0,[tc]:1!==e.type_||"length"!==t,[nc]:r[nc],[oc]:n[t]}:r},defineProperty(){Xs(11)},getPrototypeOf:e=>Zs(e.base_),setPrototypeOf(){Xs(12)}},$c={};function Gc(e,t){const n=e[Ys];return(n?kc(n):e)[t]}function Yc(e,t){if(!(t in e))return;let n=Zs(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Zs(n)}}function Xc(e){e.modified_||(e.modified_=!0,e.parent_&&Xc(e.parent_))}function Kc(e){e.copy_||(e.assigned_=new Map,e.copy_=Oc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Zc(e,t,n,r){const[o,i]=gc(t)?Mc(Pc).proxyMap_(t,n):vc(t)?Mc(Pc).proxySet_(t,n):function(e,t){const n=mc(e),r={type_:n?1:0,scope_:t?t.scope_:Nc(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=r,i=Qc;n&&(o=[r],i=$c);const{revoke:a,proxy:l}=Proxy.revocable(o,i);return r.draft_=l,r.revoke_=a,[l,r]}(t,n);return(n?.scope_??Nc()).drafts_.push(o),i.callbacks_=n?.callbacks_??[],i.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const o=t;if(!o||!Wc(o,r))return;r.mapSetPlugin_?.fixSetContents(o);const i=Ec(o);Vc(e,o.draft_??o,i,n),Hc(o,r)})}(n,i,r):i.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:t}=e;i.modified_&&t&&t.generatePatches_(i,[],e)}),o}function Jc(e){if(!ac(e)||_c(e))return e;const t=e[Ys];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Oc(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Oc(e,!0);return uc(n,(e,t)=>{fc(n,e,Jc(t))},r),t&&(t.finalized_=!1),n}uc(Qc,(e,t)=>{$c[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}),$c.deleteProperty=function(e,t){return $c.set.call(this,e,t,void 0)},$c.set=function(e,t,n){return Qc.set.call(this,e[0],t,n,e[0])};var eu=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(bc(e)&&!bc(t)){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if(bc(t)||Xs(6),void 0===n||bc(n)||Xs(7),ac(e)){const o=Rc(this),i=Zc(0,e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Ic(o):Lc(o)}return Dc(o,n),Fc(r,o)}if(!e||!yc(e)){if(r=t(e),void 0===r&&(r=e),r===$s&&(r=void 0),this.autoFreeze_&&xc(r,!0),n){const t=[],o=[];Mc(Tc).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:o}),n(t,o)}return r}Xs(1)},this.produceWithPatches=(e,t)=>{if(bc(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;const o=this.produce(e,t,(e,t)=>{n=e,r=t});return[o,n,r]},wc(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),wc(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),wc(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ac(e)||Xs(8),ic(e)&&(e=function(e){return ic(e)||Xs(10),Jc(e)}(e));const t=Rc(this),n=Zc(0,e,void 0);return n[Ys].isManual_=!0,Lc(t),n}finishDraft(e,t){const n=e&&e[Ys];n&&n.isManual_||Xs(9);const{scope_:r}=n;return Dc(r,t),Fc(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Mc(Tc).applyPatches_;return ic(e)?r(e,t):this.produce(e,e=>r(e,t))}},tu=eu.produce;"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function nu(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(ku(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}function ru(e){return ac(e)?tu(e,()=>{}):e}function ou(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function iu(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(ku(28));if(r in t)throw new Error(ku(29));return t[r]=n,o},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),o),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}Symbol.species;function au(...e){return t=>e.some(e=>((e,t)=>{return(n=e)&&"function"==typeof n.match?e.match(t):e(t);var n})(e,t))}var lu=["name","message","stack","code"],su=class{constructor(e,t){this.payload=e,this.meta=t}_type},cu=class{constructor(e,t){this.payload=e,this.meta=t}_type},uu=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of lu)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},du="External signal was aborted",pu=(()=>{function e(e,t,n){const r=nu(e+"/fulfilled",(e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}})),o=nu(e+"/pending",(e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}})),i=nu(e+"/rejected",(e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||uu)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}}));return Object.assign(function(e,{signal:a}={}){return(l,s,c)=>{const u=n?.idGenerator?n.idGenerator(e):((e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t})(),d=new AbortController;let p,h;function f(e){h=e,d.abort()}a&&(a.aborted?f(du):a.addEventListener("abort",()=>f(du),{once:!0}));const m=async function(){let a;try{let i=n?.condition?.(e,{getState:s,extra:c});if(function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.then}(i)&&(i=await i),!1===i||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const m=new Promise((e,t)=>{p=()=>{t({name:"AbortError",message:h||"Aborted"})},d.signal.addEventListener("abort",p,{once:!0})});l(o(u,e,n?.getPendingMeta?.({requestId:u,arg:e},{getState:s,extra:c}))),a=await Promise.race([m,Promise.resolve(t(e,{dispatch:l,getState:s,extra:c,requestId:u,signal:d.signal,abort:f,rejectWithValue:(e,t)=>new su(e,t),fulfillWithValue:(e,t)=>new cu(e,t)})).then(t=>{if(t instanceof su)throw t;return t instanceof cu?r(t.payload,u,e,t.meta):r(t,u,e)})])}catch(t){a=t instanceof su?i(null,u,e,t.payload,t.meta):i(t,u,e)}finally{p&&d.signal.removeEventListener("abort",p)}return n&&!n.dispatchConditionRejection&&i.match(a)&&a.meta.condition||l(a),a}();return Object.assign(m,{abort:f,requestId:u,arg:e,unwrap:()=>m.then(hu)})}},{pending:o,rejected:i,fulfilled:r,settled:au(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function hu(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var fu=Symbol.for("rtk-slice-createasyncthunk");function mu(e,t){return`${e}/${t}`}function gu({creators:e}={}){const t=e?.asyncThunk?.[fu];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(ku(11));const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(ku(12));if(n in a.sliceCaseReducersByType)throw new Error(ku(13));return a.sliceCaseReducersByType[n]=t,l},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),l),exposeAction:(e,t)=>(a.actionCreators[e]=t,l),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,l)};function s(){const[t={},n=[],r]="function"==typeof e.extraReducers?iu(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[i,l,s]=iu(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)});if("function"==typeof e)t=()=>ru(e());else{const n=ru(e);t=()=>n}function c(e=t(),n){let r=[i[n.type],...l.filter(({matcher:e})=>e(n)).map(({reducer:e})=>e)];return 0===r.filter(e=>!!e).length&&(r=[s]),r.reduce((e,t)=>{if(t){if(ic(e)){const r=t(e,n);return void 0===r?e:r}if(ac(e))return tu(e,e=>t(e,n));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e},e)}return c.getInitialState=t,c}(e.initialState)}i.forEach(r=>{const i=o[r],a={reducerName:r,type:mu(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(ku(17));i=r.reducer,a=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?nu(e,a):nu(e))}(a,i,l):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(ku(18));const{payloadCreator:i,fulfilled:a,pending:l,rejected:s,settled:c,options:u}=n,d=o(e,i,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),l&&r.addCase(d.pending,l),s&&r.addCase(d.rejected,s),c&&r.addMatcher(d.settled,c),r.exposeCaseReducer(t,{fulfilled:a||bu,pending:l||bu,rejected:s||bu,settled:c||bu})}(a,i,l,t)});const c=e=>e,u=new Map,d=new WeakMap;let p;function h(e,t){return p||(p=s()),p(e,t)}function f(){return p||(p=s()),p.getInitialState()}function m(t,n=!1){function r(e){let o=e[t];return void 0===o&&n&&(o=ou(d,r,f)),o}function o(t=c){const r=ou(u,n,()=>new WeakMap);return ou(r,t,()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=vu(i,t,()=>ou(d,t,f),n);return r})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const g={name:n,reducer:h,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:f,...m(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:h},n),{...g,...m(o,!0)}}};return g}}function vu(e,t,n,r){function o(o,...i){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...i)}return o.unwrapped=e,o}var yu=gu();function bu(){}var{assign:wu}=Object;function ku(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original");var Eu=pu("aiContent/generateLogo",function(){var e=Ei(xi().mark(function e(t,n){var r,o,i,a,l,s,c,u,d,p;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.businessName,o=void 0===r?"":r,i=t.description,a=t.logoType,l=n.rejectWithValue,e.prev=1,e.next=2,wa("/templately/v1/ai-content/generate-logo",{business_name:o,description:i,logo_type:a},{method:"POST"});case 2:if(c=e.sent,u=c.response,!(d=c.error)){e.next=3;break}return e.abrupt("return",l(d.message||"Failed to generate logo"));case 3:if(!(null!=u&&u.code||"error"===(null==u?void 0:u.status))){e.next=4;break}return e.abrupt("return",l((null==u?void 0:u.message)||"Failed to generate logo"));case 4:if("success"!==(null==u?void 0:u.status)||null==u||null===(s=u.data)||void 0===s||!s.url){e.next=5;break}return e.abrupt("return",{logoUrl:u.data.url,message:u.message});case 5:return e.abrupt("return",l("Failed to generate logo"));case 6:return e.prev=6,p=e.catch(1),e.abrupt("return",l(p.message||"An error occurred while generating logo"));case 7:case"end":return e.stop()}},e,null,[[1,6]])}));return function(_x,t){return e.apply(this,arguments)}}()),Ou=pu("aiContent/generateMeta",function(){var e=Ei(xi().mark(function e(t,n){var r,o,i,a,l,s,c,u;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.field,o=t.text,i=n.rejectWithValue,e.prev=1,e.next=2,wa("/templately/v1/ai-content/generate-meta",{field:r,text:o},{method:"POST"});case 2:if(l=e.sent,s=l.response,!(c=l.error)){e.next=3;break}return e.abrupt("return",i(c.message||"Failed to generate content"));case 3:if(!(null!=s&&s.code||"error"===(null==s?void 0:s.status))){e.next=4;break}return e.abrupt("return",i((null==s?void 0:s.message)||"Failed to generate content"));case 4:if("success"!==(null==s?void 0:s.status)||null==s||null===(a=s.data)||void 0===a||!a.content){e.next=5;break}return e.abrupt("return",{field:r,text:s.data.content,message:s.message});case 5:return e.abrupt("return",i("Failed to generate content"));case 6:return e.prev=6,u=e.catch(1),e.abrupt("return",i(u.message||"An error occurred while generating content"));case 7:case"end":return e.stop()}},e,null,[[1,6]])}));return function(t,n){return e.apply(this,arguments)}}()),xu=yu({name:"aiContent",initialState:{logo:{loading:!1,error:null,url:null},title:{loading:!1,error:null,text:null},tagline:{loading:!1,error:null,text:null}},reducers:{resetLogo:function(e){e.logo={loading:!1,error:null,url:null}},resetTitle:function(e){e.title={loading:!1,error:null,text:null}},resetTagline:function(e){e.tagline={loading:!1,error:null,text:null}},resetAll:function(e){e.logo={loading:!1,error:null,url:null},e.title={loading:!1,error:null,text:null},e.tagline={loading:!1,error:null,text:null}}},extraReducers:function(e){e.addCase(Eu.pending,function(e){e.logo.loading=!0,e.logo.error=null}).addCase(Eu.fulfilled,function(e,t){e.logo.loading=!1,e.logo.url=t.payload.logoUrl,e.logo.error=null}).addCase(Eu.rejected,function(e,t){e.logo.loading=!1,e.logo.error=t.payload||"Failed to generate logo"}),e.addCase(Ou.pending,function(e,t){var n=t.meta.arg.field;"title"===n?(e.title.loading=!0,e.title.error=null):"tag_line"===n&&(e.tagline.loading=!0,e.tagline.error=null)}).addCase(Ou.fulfilled,function(e,t){var n=t.payload.field;"title"===n?(e.title.loading=!1,e.title.text=t.payload.text,e.title.error=null):"tag_line"===n&&(e.tagline.loading=!1,e.tagline.text=t.payload.text,e.tagline.error=null)}).addCase(Ou.rejected,function(e,t){var n=t.meta.arg.field;"title"===n?(e.title.loading=!1,e.title.error=t.payload||"Failed to generate title"):"tag_line"===n&&(e.tagline.loading=!1,e.tagline.error=t.payload||"Failed to generate tagline")})}}),Su=xu.actions;Su.resetLogo,Su.resetTitle,Su.resetTagline,Su.resetAll;const _u=xu.reducer;var Cu=["type","plan","platform"],Pu=["itemType","key"],Tu=["itemType","key"];function Au(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 Mu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Au(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Au(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Nu={isLoading:!0};const Du=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nu,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=n.plan,i=n.platform,a=Wn(n,Cu),l=null!==a.search;switch(r){case Wa(So,e):return t=Va(t,[o,i],Ua(t,[o,i],{})),Va(t,["error"],null);case Wa(_o,e):return Mu(Mu({},t),{},{isLoading:!0});case Wa(To,e):var s=[o,i,"currentPage"];return a.filtering&&(s=[o,i,"filteredResults","currentPage"]),Va(t,s,a.page);case Wa(Co,e):if(t=Mu(Mu({},t),{},{isLoading:!1}),null!=a&&a.currentPage){var c=[o,i,"currentPage"];a.isFilterableQuery&&(c=[o,i,"filteredResults","currentPage"]),l&&(c=[o,i,"search","currentPage"]),t=Va(t,c,a.currentPage)}if(null!=a&&a.totalPage){var u=[o,i,"totalPage"];a.isFilterableQuery&&(u=[o,i,"filteredResults","totalPage"]),l&&(u=[o,i,"search","totalPage"]),t=Va(t,u,a.totalPage)}var d=[o,i,a.currentPage];return a.isFilterableQuery&&(d=[o,i,"filteredResults",a.currentPage]),l&&(d=[o,i,"search",a.currentPage]),Va(t,d,a.data);case Wa(Po,e):return Mu(Mu({},t),{},{isLoading:!1,error:null==a?void 0:a.error});case Wa(Ao,e):return Va(t,[i,"itemsDetails","isLoading"],!0);case Wa(Mo,e):var p=a.itemType,h=(a.key,Wn(a,Pu));return t=Va(t,[i,"itemsDetails","isLoading"],!1),Va(t,[i,"itemsDetails",h.slug],Mu(Mu({},h),{},{type:p}));case Wa(No,e):var f=a.itemType,m=(a.key,Wn(a,Tu));return t=Va(t,[i,"itemsDetails","isLoading"],!1),Va(t,[i,"itemsDetails","error"],Mu(Mu({},m),{},{type:f}))}return t}},Iu={profile:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cs,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.current_page,o=void 0===r?1:r,i=t.total_page,a=void 0===i?1:i,l=t.platform,s=t.data,c=void 0===s?[]:s,u=t.meta,d=void 0===u?null:u,p=Wn(t,es);switch(n){case Jr:return rs(rs({},e),{},{syncing:!0});case"APPLICATION_IS_SIGNED":case Tr:case _r:return rs(rs({},e),{},{isLoading:!0,error:null});case kr:return rs(rs({},e),{},{isLoading:!1,error:null,profile:rs(rs({},e.profile),{},{error:null})});case Ar:case Cr:var h=null!=d?rs(rs({},e),d):e;return rs(rs({},h),{},{isLoading:!1,syncing:!1,data:p,prevData:null,error:null});case Or:return rs(rs({},e),{},{isVerifying:!0});case Er:var f=rs(rs({},e),{},{isVerifying:!1,data:rs(rs({},e.data),{},{is_verified:null==p?void 0:p.is_verified})});return rs(rs({},f),{},{isLoading:!1,syncing:!1,prevData:null,error:null});case Sr:var m=rs(rs({},e),{},{data:null,is_globally_signed:!(null!=p&&p.isGloballySigned)});if(void 0!==(null==p?void 0:p.global_user)){var g=null==p?void 0:p.global_user,v=g.meta,y=Wn(g,ts);m=rs(rs({},m),{},{data:y},v)}return null!=p&&p.linking&&(m=rs(rs({},m),{},{prevData:e.data})),null!=p&&p.trying_logout&&(m=rs(rs({},m),{},{data:null,error:null})),m;case Mr:case Pr:return rs(rs({},e),{},{isLoading:!1,data:null,error:p});case io:var b=p.filter;return rs(rs({},e),{},{favourites:rs(rs({},e.favourites),{},Tt({},"".concat(b),c))});case xo:case bo:case ao:var w=p.page,k=p.states;return k.splice(0,1),w&&(e=Va(e,[].concat(Ul(k),["currentPage"]),w)),e;case no:var E=rs(rs({},e.favourites),{},{isLoading:!0,error:null});return rs(rs({},e),{},{favourites:E});case ro:var O=p.plan,x=p.itemType,S=rs(rs({},e.favourites),{},{isLoading:!1});return e=rs(rs({},e),{},{favourites:S}),o&&(e=Va(e,["favourites",O,l,x,"currentPage"],o)),a&&(e=Va(e,["favourites",O,l,x,"totalPage"],a)),c&&(e=Va(e,["favourites",O,l,x,o],c)),e;case oo:var _=rs(rs({},e.favourites),{},{isLoading:!1,error:null});return _=Va(_,"error",c),rs(rs({},e),{},{favourites:_});case go:var C=rs(rs({},e.downloads),{},{isLoading:!0,error:null});return rs(rs({},e),{},{downloads:C});case vo:var P=rs(rs({},e.downloads),{},{isLoading:!1,error:null});return P=Va(P,"currentPage",o),P=Va(P,"totalPage",a),P=Va(P,o,c),rs(rs({},e),{},{downloads:P});case yo:var T=rs(rs({},e.downloads),{},{isLoading:!1,error:null});return T=Va(T,"error",c),rs(rs({},e),{},{downloads:T});case wo:var A=rs(rs({},e.purchasedItems),{},{isLoading:!0,error:null});return rs(rs({},e),{},{purchasedItems:A});case Eo:var M=rs(rs({},e.purchasedItems),{},{isLoading:!1,error:null});return M=Va(M,"currentPage",o),M=Va(M,"totalPage",a),M=Va(M,o,c),rs(rs({},e),{},{purchasedItems:M});case ko:var N=rs(rs({},e.purchasedItems),{},{all:null,isLoading:!1,error:null});return N=Va(N,"all",c),rs(rs({},e),{},{purchasedItems:N});case Oo:var D=rs(rs({},e.purchasedItems),{},{isLoading:!1,error:null});return D=Va(D,"error",c),rs(rs({},e),{},{purchasedItems:D});case lo:var I=rs({},p.starred);return rs(rs({},e),{},{starred:I});case so:var L=rs({},p.reviews);return rs(rs({},e),{},{reviews:L});case co:return rs(rs({},e),{},{favourite:{loading:!0,error:null}});case uo:return rs(rs({},e),{},{favourite:{loading:!1,error:null}});case po:return rs(rs({},e),{},{favourite:{loading:!1,error:p.error||"Failed to update favourite"}});case ho:return rs(rs({},e),{},{rating:{loading:!0,error:null}});case fo:return rs(rs({},e),{},{rating:{loading:!1,error:null}});case mo:return rs(rs({},e),{},{rating:{loading:!1,error:p.error||"Failed to update rating"}})}return e},conditions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:js,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=Wn(t,Is);switch(n){case br:return Rs(Rs({},e),{},{platform:r.platform});case $r:return Rs(Rs({},e),{},{isLoading:!0});case Gr:return Rs(Rs({},e),{},{isLoading:!1,conditions:r});case Yr:return Rs(Rs({},e),{},{isLoading:!1,conditionsByTemplate:Rs(Rs({},e.conditionsByTemplate),{},Tt({},r.id,r.data))});case Kr:return Rs(Rs({},e),{},{isLoading:!1,conditionsForSave:null!=r?r:{}})}return e},general:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jl,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,$l);switch(r){case oi:return Yl(Yl({},t),{},{has_elementor:o.has_elementor,has_elementor_pro:o.has_elementor_pro});case Ko:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{currentStep:o.step})});case Zo:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{customizerStep:o.step})});case Jo:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{fsiClosed:o.payload})});case ei:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{results:o.payload})});case ti:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{formData:o.payload})});case ni:return t=Va(t,["fullSiteImport","cache_data","isLoading"],!1),Va(t,["fullSiteImport","cache_data",o.payload.type],o.payload.value);case"FULL_SITE_IMPORT_RESET_CACHE_DATA":return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{cache_data:null})});case ri:return Yl(Yl({},t),{},{fullSiteImport:{currentStep:1,results:null,aiSidebarContext:{id:null,show:!1,content:{},expanded:!1},fsiModalContext:{show:!1,aiTemplates:null},packInfo:{data:null,loading:!1,error:null},googleFonts:{data:null,loading:!1,error:null}}});case"FULL_SITE_IMPORT_SET_PROCESS_ID":return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{processId:o.payload})});case ii:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{availableCredit:o.payload})});case"FULL_SITE_IMPORT_SET_AI_PAGE_IDS":return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{AIPageIDs:o.payload})});case"FULL_SITE_IMPORT_SET_AI_SIDEBAR_CONTEXT":case ai:case li:case si:case ci:return Va(t,["fullSiteImport","aiSidebarContext"],Yl(Yl({},t.fullSiteImport.aiSidebarContext),o.payload));case ui:case di:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{fsiModalContext:o.payload})});case pi:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{packInfo:Yl(Yl({},t.fullSiteImport.packInfo),{},{loading:!0,error:null})})});case hi:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{packInfo:{data:o.payload,loading:!1,error:null}})});case fi:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{packInfo:{data:null,loading:!1,error:o.payload}})});case mi:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{googleFonts:Yl(Yl({},t.fullSiteImport.googleFonts),{},{loading:!0,error:null})})});case gi:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{googleFonts:{data:o.payload,loading:!1,error:null}})});case vi:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{googleFonts:{data:null,loading:!1,error:o.payload}})});case yi:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{packInfo:{data:null,loading:!1,error:null}})});case bi:return Yl(Yl({},t),{},{fullSiteImport:Yl(Yl({},t.fullSiteImport),{},{triggerHandleClick:{id:o.payload.id,isWithAI:o.payload.isWithAI,timestamp:Date.now()}})});case Qr:return Yl(Yl({},t),{},{redirect:Yl({},o)});case br:return Yl(Yl({},t),{},{platform:o.platform});case wr:return Yl(Yl({},t),{},{plan:o.plan});case Zr:return Yl(Yl({},t),{},{headerHeight:o.height});case"APPLICATION_META_REQUESTED":return Yl(Yl({},t),{},{isLoading:!0,error:null});case"APPLICATION_META_REQUEST_FAILED":return Yl(Yl({},t),{},{error:Yl(Yl({},t.error),o.error)});case Dr:return t=Yl({},t),Va(t,["filter",o.key],o.data);case Ir:return Va(t,["filter"],Zl);case Rr:t=Yl(Yl({},t),{},{isLoading:!1});var i=o.dependencies,a=i.elementor,l=void 0===a?[]:a,s=i.gutenberg,c=void 0===s?[]:s,u=i.unknown,d=void 0===u?[]:u;return Va(t,["dependencies"],{elementor:[].concat(Ul(l),Ul(d)),gutenberg:[].concat(Ul(c),Ul(d))});case Fr:return t=Yl(Yl({},t),{},{isLoading:!1}),Va(t,["tags"],o.tags);case zr:return Yl(Yl({},t),{},{templateTypes:{isLoading:!0,lists:[]}});case Br:return t=Yl(Yl({},t),{},{templateTypes:{isLoading:!1}}),Va(t,["templateTypes","lists"],o.types);case"APPLICATION_LOAD_TYPES_FAILED":return t=Va(t,["templateTypes","isLoading"],!1),Va(t,["error","templateTypes"],o.error);case"APPLICATION_LOAD_PRICING":return t=Va(t,["pricing","isLoading"],!0),Va(t,["pricing","error"],null);case Wr:return t=Va(t,["pricing","isLoading"],!1),t=Va(t,["pricing","data"],null!==(e=null==o?void 0:o.data)&&void 0!==e?e:[]),Va(t,["pricing","error"],null);case Ur:return t=Va(t,["pricing","isLoading"],!1),t=Va(t,["pricing","data"],[]),Va(t,["pricing","error"],null==o?void 0:o.error);case Vr:return Yl(Yl({},t),{},{categories:{isLoading:!0,lists:[]}});case Hr:return t=Va(t,["categories","isLoading"],!1),Va(t,["categories","lists"],o.categories);case qr:return t=Va(t,["categories","isLoading"],!1),Va(t,["error","categories"],o.error);case Nr:return Yl(Yl({},t),{},{counts:Yl({},o)});case Do:return Yl(Yl({},t),{},{featured:Yl(Yl({},Xl),{},{isLoading:!0})});case Io:return Yl(Yl({},t),{},{featured:{isLoading:!1,items:n.items}});case Lo:return Yl(Yl({},t),{},{featured:{isLoading:!1,items:[],error:n.error}});case Ro:return Yl(Yl({},t),{},{trending:Yl(Yl({},Kl),{},{isLoading:!0})});case jo:return Yl(Yl({},t),{},{trending:{isLoading:!1,items:n.items}});case Fo:return Yl(Yl({},t),{},{trending:{isLoading:!1,items:[],error:n.error}});case zo:return Yl(Yl({},t),{},{related:Yl(Yl({},o),{},{isLoading:!0})});case Bo:return Yl(Yl({},t),{},{related:{isLoading:!1,items:n.items}});case Wo:return Yl(Yl({},t),{},{related:{isLoading:!1,items:[],error:n.error}})}return t},settingsPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qs,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=Wn(t,Us);switch(n){case wi.SET_PLATFORM:return Hs(Hs({},e),{},{platform:r.platform});case wi.SET_COLORS:return Va(e,[e.platform,"colors"],r.colors);case wi.SET_SELECTED_TYPOGRAPHY:return Va(e,[e.platform,"selectedTypography"],r.typography);case wi.SET_SCREEN:return Va(e,[e.platform,"screen"],r.screen);case wi.SET_CUSTOM_CSS:return Va(e,["customCSS"],r.customCSS);case wi.SET_LOGO_IMAGE:return Va(e,["logoImage"],r.logoImage);case wi.SET_SITE_TITLE:return Hs(Hs({},e),{},{siteTitle:r.siteTitle});case wi.SET_SITE_TAGLINE:return Hs(Hs({},e),{},{siteTagline:r.siteTagline})}return e},savedTemplates:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ds,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.platform,o=void 0===r?"elementor":r,i=t.currentPage,a=t.totalPage,l=t.data,s=Wn(t,As);switch(n){case Uo:return Ns(Ns({},e),{},{isLoading:!0});case Vo:return Ns(Ns({},e),{},{isLoading:!1});case qo:return Va(e,[o,"currentPage"],s.page);case Ho:return e=Ns(Ns({},e),{},{isLoading:!1}),i&&(e=Va(e,[o,"currentPage"],i)),a&&(e=Va(e,[o,"totalPage"],a)),l&&(e=Va(e,[o,i],l)),e}return e},clouds:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vs,t=arguments.length>1?arguments[1]:void 0,n=t.search,r=Wn(t,us),o=null===n?"items":"search";switch(r.type){case $o.PUSH:return ms(ms({},e),{},{push2cloud:{isLoading:!0}});case $o.CLEAR_PUSH2CLOUD:return ms(ms({},e),{},{push2cloud:{isLoading:!1}});case $o.PUSH_SUCCESS:r.type;var i=Wn(r,ds);return ms(ms({},e),{},{push2cloud:ms({isLoading:!1},i)});case $o.PUSH_FAILED:r.type;var a=Wn(r,ps);return ms(ms({},e),{},{push2cloud:ms({isLoading:!1},a)});case $o.SET_VIEW:return ms(ms({},e),{},{view:r.view});case $o.SET_PAGE:return null!=r&&r.page&&(e=Va(e,[o,r.platform,"currentPage"],r.page)),e;case $o.LOAD:case $o.REQUESTED:return ms(ms({},e),{},{isLoading:!0,error:null});case $o.LOAD_SUCCESS:return e=ms(ms({},e),{},{isLoading:!1,push2cloud:{isLoading:null},error:null}),null!=r&&r.currentPage&&(e=Va(e,[o,r.platform,"currentPage"],r.currentPage)),null!=r&&r.totalPage&&(e=Va(e,[o,r.platform,"totalPage"],r.totalPage)),null!=r&&r.data&&(e=Va(e,[o,r.platform,r.currentPage],r.data)),e;case $o.LOAD_FAILED:r.type;var l=Wn(r,hs);return ms(ms({},e),{},{error:l,isLoading:!1});case $o.STATUS_REQUEST:return ms(ms({},e),{},{status:ms(ms({},gs),{},{isLoading:!0,error:null})});case $o.STATUS_SUCCESS:return ms(ms({},e),{},{status:ms(ms({},gs),{},{usage:r.usages,limit:r.limit,isLoading:!1,error:null})});case $o.STATUS_FAILED:return ms(ms({},e),{},{status:ms(ms({},gs),{},{isLoading:!1,error:r.error})});case $o.SEARCH:return ms(ms({},e),{},{search:ms(ms({},e.search),{},{isLoading:!0,context:null==r?void 0:r.context,keyword:null==r?void 0:r.search})});case $o.SEARCH_SUCCESS:return e=ms(ms({},e),{},{search:ms(ms({},e.search),{},{isLoading:!1})}),e=Va(e,["search","context"],r.context),Va(e,["search","data"],r.data)}return e},workspaces:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ks,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,ys);switch(r){case Go.SET_VIEW:return ws(ws({},t),{},{view:o.view});case Go.LOAD:case Go.LOAD_LISTS:return ws(ws({},t),{},{isLoading:!0});case Go.SET_LISTS:return ws(ws({},t),{},{isLoading:!1,lists:o.payload});case Go.SET_PAGE:return ws(ws({},t),{},{currentPage:o.page});case Go.DELETE_SUCCESS:if((t=ws({},t)).hasOwnProperty(o.page)){var i=Ul(t[o.page]).filter(function(e){return e.id!=o.id});t[o.page]=i}return t;case Go.CREATE_SUCCESS:var a=(t=ws(ws({},t),{},{isLoading:!1})).currentPage;if(t.hasOwnProperty(a)){var l=[];l=(e=l=[ws({},o)].concat(Ul(t[a])),e.reduce(function(e,t,n){var r=Math.floor(n/11)+1;return(e[r]||(e[r]=[])).push(t),e},[]))[1],t=Va(t,[a],l)}else t=Va(t,[a],[ws({},o)]);return t;case Go.LOAD_SUCCESS:return t=ws(ws({},t),{},{isLoading:!1,currentPage:o.currentPage,error:null}),o.totalPage&&(t=ws(ws({},t),{},{totalPage:o.totalPage})),Va(t,[o.currentPage],o.data);case Go.LOAD_FAILED:return ws(ws({},t),{},{error:o.error,isLoading:!1});case Go.SEARCH:return ws(ws({},t),{},{search:ws(ws({},t.search),{},{isLoading:!0,context:null==o?void 0:o.context,keyword:null==o?void 0:o.search})});case Go.SEARCH_SUCCESS:return t=ws(ws({},t),{},{search:ws(ws({},t.search),{},{isLoading:!1})}),t=Va(t,["search","context"],o.context),Va(t,["search","data"],o.data)}return t},sharedWorkspaces:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xs,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Yo.SET_VIEW:return Os(Os({},e),{},{view:t.view});case Yo.LOAD:case Yo.LOAD_LISTS:return Os(Os({},e),{},{isLoading:!0});case Yo.SET_LISTS:return Os(Os({},e),{},{isLoading:!1,lists:t.payload});case Yo.LOAD_SUCCESS:return e=Os(Os({},e),{},{isLoading:!1,currentPage:t.currentPage}),t.totalPage&&(e=Os(Os({},e),{},{totalPage:t.totalPage})),Va(e,[t.currentPage],t.data);case Yo.LOAD_FAILED:return Os(Os({},e),{},{isLoading:!1,error:t.error||t.payload});case Yo.SEARCH:return Os(Os({},e),{},{search:Os(Os({},e.search),{},{isLoading:!0,context:null==t?void 0:t.context,keyword:null==t?void 0:t.search})});case Yo.SEARCH_SUCCESS:return e=Os(Os({},e),{},{search:Os(Os({},e.search),{},{isLoading:!1})}),e=Va(e,["search","context"],t.context),Va(e,["search","data"],t.data)}return e},workspaceDetails:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ts,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,Ss);switch(r){case Xo.SET_VIEW:return Cs(Cs({},t),{},{view:o.view});case Xo.REQUESTED:return Cs(Cs({},t),{},{error:null});case Xo.LOAD:return Cs(Cs({},t),{},{isLoading:!0,isFilesLoading:!0,error:null});case Xo.SET:return Cs(Cs({},t),{},Tt({isLoading:!1,isFilesLoading:!0},o.slug,o));case Xo.DELETE:return null!==(e=t=Cs({},t))&&void 0!==e&&e[o.slug]&&delete t[o.slug],t;case Xo.SET_PAGE:return t=Cs(Cs({},t),{},{isFilesLoading:!0}),null!=o&&o.page&&(t=Va(t,[o.platform,o.slug,"currentPage"],o.page)),t;case Xo.LOAD_SUCCESS:return delete o.files,delete o.platform,delete o.args,Cs(Cs({},t),{},Tt({isLoading:!1},o.slug,o));case Xo.LOAD_FAILED:return Cs(Cs({},t),{},{error:o,isLoading:!1,isFilesLoading:!1});case Xo.GET_FILES_REQUESTED:return Cs(Cs({},t),{},{isFilesLoading:!0});case Xo.SET_FILES:return t=Cs(Cs({},t),{},{isLoading:!1,isFilesLoading:!1}),null!=o&&o.currentPage&&(t=Va(t,[o.platform,o.slug,"currentPage"],o.currentPage)),null!=o&&o.totalPage&&(t=Va(t,[o.platform,o.slug,"totalPage"],o.totalPage)),Va(t,[o.platform,o.slug,o.currentPage],o.data);case Xo.RESET_SEARCH:return Cs(Cs({},t),{},{search:Cs({},Ps)});case Xo.SEARCH:return Cs(Cs({},t),{},{search:Cs(Cs({},t.search),{},{isLoading:!0,context:null==n?void 0:n.context,keyword:null==n?void 0:n.search})});case Xo.SEARCH_SUCCESS:t=Cs(Cs({},t),{},{search:Cs(Cs({},t.search),{},{isLoading:!1})});var i=n.currentPage,a=n.totalPage;return t=Va(t,["search","context"],n.context),t=Va(t,["search","data",i],n.data),t=Va(t,["search","data","currentPage"],i),Va(t,["search","data","totalPage"],a)}return t},aiContent:_u};function Lu(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 Ru(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lu(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ju(e){return Ru(Ru({},Iu),e)}var Fu=function(e){var t={elementor:"https://assets.templately.com/frontend/Elementor.png",gutenberg:"https://assets.templately.com/frontend/Gutenberg.png"};return t.hasOwnProperty(e)&&t[e]},zu=["dispatch"],Bu=function(e,t){var n=e.ModalComponent,r=e.content,o={key:"isSaved",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong regarding changes in your WorkSpace. Try Later or Contact support.","templately")},success:{title:(0,At.__)("Successfully Saved","templately"),content:(0,At.__)("You have succesfully saved your WorkSpace changes.","templately")}};Al({showCloseButton:!0,onConfirm:function(e){return Ml(o,e)},html:React.createElement(n,re({},t,r))},!0)},Wu=function(e,t){var n=e.ModalComponent,r=e.content,o=t.dispatch,i=Wn(t,zu),a={key:"isDeleted",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong regarding deleting your WorkSpace. Try Later or Contact Support.","templately")},success:{redirectTo:-1,title:(0,At.__)("Successfully Deleted","templately"),content:(0,At.__)("You have deleted a WorkSpace from your account.","templately")}};Al({showCloseButton:!0,onConfirm:function(e){return Ml(a,e)},html:React.createElement(n,re({page:i.workspaces.currentPage},r,{dispatch:o}))},!0)},Uu=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return[{name:(0,At.__)("Edit","templately"),icon:React.createElement(Mn,null),disabled:e,action:Bu,ModalComponent:Gg},{name:(0,At.__)("Delete","templately"),icon:React.createElement(An,null),disabled:e,action:Wu,ModalComponent:Ad}]};const Vu=window.wp.blocks;function Hu(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 qu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hu(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Qu=gn(null,function(e){return{forceDelete:function(t){return e(Ny(qu(qu({},t),{},{force_delete_kit:!0})))}}})(function(e){return ae().createElement("div",{className:"t-kit-warning-modal"},ae().createElement("h4",null,(0,At.__)("Are you sure you want to delete your Site Settings?","elementor")),ae().createElement("p",null,(0,At.__)("By removing this template you will delete your entire Site Settings. If this template is deleted, all associated settings: Global Colors & Fonts, Theme Style, Layout, Background, and Lightbox settings will be removed from your existing site. This action can not be undone.","elementor")),ae().createElement("div",{className:"btns"},ae().createElement("button",{onClick:function(){e.forceDelete({id:e.id})},className:"templately-button force-delete"},(0,At.__)("Force Delete","templately")),ae().createElement("button",{className:"templately-button keep-settings"},(0,At.__)("Keep my settings","templately"))))}),$u=function(e){var t=e.id,n=e.isImport,r=e.setImport,o=pe((0,oe.useState)(!1),2),i=o[0],a=o[1];return(0,oe.useEffect)(function(){0!=n&&a(!i)},[n]),ae().createElement("div",{className:"templately-import tm-section"},ae().createElement("p",null,(0,At.__)("Import this template to your library to make it available in your Elementor Saved Templates(opens in a new tab) list for future use.","templately")),ae().createElement("button",{disabled:i,className:"templately-button tb-import",onClick:function(){return r(t)}},ae().createElement(dr,null),(0,At.__)("Import to Library","templately")))},Gu=function(e){var t=e.id,n=e.isCreate,r=e.createPage,o=e.setPageTitle,i=pe((0,oe.useState)(!0),2),a=i[0],l=i[1],s=pe((0,oe.useState)(""),2),c=s[0],u=s[1];return(0,oe.useEffect)(function(){0!=n||c.length>0?l(!1):l(!0),o(c)},[n,c]),ae().createElement("div",{className:"templately-create-page tm-section"},ae().createElement("p",null,(0,At.__)("Create a new page from this template to make it available as a draft page in your pages list.","templately")),ae().createElement("div",{className:"templately-create-page-form"},ae().createElement(bl,{wrapper:!1,placeholder:(0,At.__)("Type a title here...","templately"),value:c,onChange:function(e){return u(e.target.value)}}),ae().createElement(vl,{disabled:a,label:(0,At.__)("Create a Page","templately"),className:"tb-create-page",onClick:function(){return r(t)}})))};var Yu=["name","id","platform"];const Xu=function(e){var t=e.name,n=e.id,r=e.platform,o=Wn(e,Yu),i=pe((0,oe.useState)(!1),2),a=i[0],l=i[1],s=pe((0,oe.useState)(!1),2),c=s[0],u=s[1],d=pe((0,oe.useState)(null),2),p=d[0],h=d[1],f=pe((0,oe.useState)(!1),2),m=f[0],g=f[1],v=pe((0,oe.useState)(!1),2),y=v[0],b=v[1],w=pe((0,oe.useState)(""),2),k=w[0],E=w[1];return(0,oe.useEffect)(function(){0!=m&&"elementor"===r&&(Nl(),l(!0),Od({id:m,platform:r}).then(function(e){Nl(!1),l(!1),u(e)}).catch(function(e){Nl(!1),l(!1),h(e)}),g(!1))},[m]),(0,oe.useEffect)(function(){0!=y&&(Nl(),l(!0),Ed({id:y,title:k,platform:r}).then(function(e){Nl(!1),l(!1),u(e)}).catch(function(e){Nl(!1),l(!1),h(e)}),b(!1))},[y]),ae().createElement("div",{className:"templately-import-modal templately-modal"},!a&&!(0!=c||null!=p)&&ae().createElement("div",{className:"tm-header"},ae().createElement("h3",null,t)),a&&ae().createElement(_l,{text:(0,At.__)("Importing...","templately"),description:(0,At.__)("Your chosen template is being imported right now, please do not refresh or close this tab.","templately")}),!a&&ae().createElement("div",{className:"tm-body"},0==c&&null==p&&ae().createElement(ae().Fragment,null,ae().createElement(Gu,{id:n,isCreate:y,createPage:b,setPageTitle:E}),"elementor"===r&&ae().createElement($u,{isImport:m,id:n,setImport:g})),null!=p&&ae().createElement(dd,re({},p,{type:null==o?void 0:o.type,slug:null==o?void 0:o.slug})),0!=c&&null==p&&ae().createElement(bd,re({platform:r},c))))};function Ku(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 Zu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ku(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ku(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Ju=function(e){var t=e.requirement,n=e.completeCallback,r=e.setErrors,o=e.errors,i=pe((0,oe.useState)(!0),2),a=i[0],l=i[1],s=pe((0,oe.useState)(!1),2),c=s[0],u=s[1],d=pe((0,oe.useState)(!1),2),p=d[0],h=d[1],f=pe((0,oe.useState)({}),2),m=f[0],g=f[1];return t?((0,oe.useEffect)(function(){nv(t).then(function(e){l(e.loading),g(e.data)}).catch(function(e){var n=e;"invalid_requirements"===(null==e?void 0:e.code)&&(n={message:e.message}),u(n),r([].concat(Ul(o),[Zu(Zu({},n),t)])),l(!1)})},[]),(0,oe.useEffect)(function(){p&&(l(!0),u(!1),nv(t).then(function(e){g(e.data),l(e.loading)}).catch(function(e){var n=o.filter(function(e){return e.id!==t.id});if("invalid_requirements"===(null==e?void 0:e.code)){var i=Zu({message:e.message},t);n.push(i)}r(n),u(e),l(!1)}),h(!1))},[p]),(0,oe.useEffect)(function(){a||n(c)},[a]),(0,oe.useEffect)(function(){c&&r([].concat(Ul(o),[Zu(Zu({},c),t)]))},[c]),ae().createElement(ae().Fragment,null,a?ae().createElement(ed,{className:"t-info-installing",title:(0,At.__)("Installing...","templately")}):null,c?m&&m.errorMessage?ae().createElement(ed,{className:"t-info-error",icon:"no",title:m.errorMessage}):ae().createElement(vl,{className:"tb-retry-install",onClick:function(){return h(!0)}},ae().createElement("span",{className:"dashicons dashicons-no text-danger"}),(0,At.__)("Retry & Proceed to Import","templately")):null,a||c?null:ae().createElement(ed,{className:"t-info-success",icon:"yes-alt",title:(0,At.__)("Success","templately")}))):((0,oe.useEffect)(function(){n()},[]),ae().createElement("span",{className:"templately-warning"},ae().createElement("span",{className:"dashicons dashicons-warning"})," ",(0,At.__)("Ignored","templately")))};var ed=function(e){var t=e.icon,n=void 0===t?"update":t,r=e.title,o=void 0===r?"":r,i=e.iconStyle,a=void 0===i?null:i,l=e.hide;if(void 0!==l&&l)return null;var s=Vn()("templately-installation-info align-center d-flex",null==e?void 0:e.className);return ae().createElement("div",{className:s},ae().createElement("span",{className:"dashicons dashicons-".concat(n),style:a}),ae().createElement("p",null,o))},td=["dependencies"];function nd(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 rd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nd(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var od=o(6614);const id=function(e){var t=e.dependencies,n=void 0===t?[]:t,r=Wn(e,td),o=r.current_screen,i=r.clickCancel,a=r.setImportModal,l=r.setIsImporting,s=pe((0,oe.useState)({}),2),c=s[0],u=s[1],d=pe((0,oe.useState)(null),2),p=d[0],h=d[1],f=pe((0,oe.useState)([]),2),m=f[0],g=f[1],v=(0,oe.useMemo)(function(){return!(0,_a.isEmpty)(c)&&Object.values(c).every(function(e){return!e})},[c]),y=function(e){return void 0===c[e]||c[e]},b=function(){h(function(e){return e+1})};return(0,oe.useEffect)(function(){n.length&&n.map(function(e,t){var n=e.is_pro,r=e.is_active;void 0===c[t]&&u(function(e){return rd(rd({},e),{},Tt({},t,!r&&!n))})})},[n]),(0,oe.useEffect)(function(){n.length<=0&&("templately"==o?a(!0):l(!0))},[n]),(0,oe.useEffect)(function(){null!=p&&p>n.length-1&&0===m.length&&("templately"==o?a(!0):l(!0))},[p,m]),ae().createElement(ae().Fragment,null,ae().createElement("h4",null,(0,At.__)("Required Dependencies","templately")),ae().createElement("p",null,(0,At.__)("To import this item you need to install all the Plugin(s) listed below:","templately")),(null==n?void 0:n.length)>0&&ae().createElement("ul",{className:"templately-dependency-list"},n.map(function(e,t){var n=e.is_pro,r=e.link,o=e.name,i=e.slug,a=e.is_active;return ae().createElement("li",{className:"templately-dependency-item",key:t},ae().createElement("div",{className:"tdi-checkbox"},ae().createElement(bl,{wrapper:!1,className:"tdi-checkbox-input",type:"checkbox",id:"requirement".concat(t),value:"1",disabled:n,checked:a||"elementor"===i||y(t)&&!n,onChange:function(){return!a&&!n&&u(function(e){var n;return rd(rd({},e),{},Tt({},t,!(null===(n=e[t])||void 0===n||n)))})}}),ae().createElement(kl,{wrapper:!0,htmlFor:"requirement".concat(t),style:{marginLeft:"5px"},href:r,name:o},a&&ae().createElement(ae().Fragment,null," | ",ae().createElement("span",{className:"plugin-installed"},"Installed")))),p===t||p>t?ae().createElement(Ju,{key:"installing".concat(t),requirement:y(t)&&!n?e:null,completeCallback:b,errors:m,setErrors:function(e){g(e)}}):null)})),ae().createElement("p",null,ae().createElement("strong",null,(0,At.__)("Note","templately"),": "),od((0,At.sprintf)((0,At.__)("Make sure you have manually installed & activated the <em><strong>%s</strong></em> listed above","templately"),(0,At._n)("Pro Plugin","Pro Plugin's",n.length,"templately")))),ae().createElement("div",{className:"templately-buttons-group"},ae().createElement(vl,{label:(0,At.__)("Cancel","templately"),className:"tb-rd-btn bg-danger tm-btn-cancel",onClick:function(){return i(!0)},disabled:null!==p}),ae().createElement(vl,{label:v?(0,At.__)("Proceed to Import","templately"):(0,At.__)("Install & Proceed to Import","templately"),className:"tb-rd-btn tm-btn-confirm",onClick:function(){return h(0)},disabled:null!==p})))};function ad(e){return Zn({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"},child:[]}]})(e)}function ld(e){return Zn({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{fill:"#D9D9D9",d:"M911.9 283.9v.5L835.5 865c-1 8-7.9 14-15.9 14H204.5c-8.1 0-14.9-6.1-16-14l-76.4-580.6v-.6 1.6L188.5 866c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6c.1-.5.1-1 0-1.5z"},child:[]},{tag:"path",attr:{fill:"#D9D9D9",d:"M773.6 810.6l53.9-409.4-139.8 86.1L512 252.9 336.3 487.3l-139.8-86.1 53.8 409.4h523.3zm-374.2-189c0-62.1 50.5-112.6 112.6-112.6s112.6 50.5 112.6 112.6v1c0 62.1-50.5 112.6-112.6 112.6s-112.6-50.5-112.6-112.6v-1z"},child:[]},{tag:"path",attr:{d:"M512 734.2c61.9 0 112.3-50.2 112.6-112.1v-.5c0-62.1-50.5-112.6-112.6-112.6s-112.6 50.5-112.6 112.6v.5c.3 61.9 50.7 112.1 112.6 112.1zm0-160.9c26.6 0 48.2 21.6 48.2 48.3 0 26.6-21.6 48.3-48.2 48.3s-48.2-21.6-48.2-48.3c0-26.6 21.6-48.3 48.2-48.3z"},child:[]},{tag:"path",attr:{d:"M188.5 865c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6v-.5c.3-6.4-6.7-10.8-12.3-7.4L705 396.4 518.4 147.5a8.06 8.06 0 0 0-12.9 0L319 396.4 124.3 276.5c-5.5-3.4-12.6.9-12.2 7.3v.6L188.5 865zm147.8-377.7L512 252.9l175.7 234.4 139.8-86.1-53.9 409.4H250.3l-53.8-409.4 139.8 86.1z"},child:[]}]})(e)}var sd=["code","message","title","contentStyles"];function cd(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 ud(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cd(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const dd=function(e){var t=e.code,n=e.message,r=e.title,o=void 0===r?null:r,i=e.contentStyles,a=void 0===i?{}:i,l=Wn(e,sd);return ae().createElement("div",re({className:"tm-import-failed aligncenter"},l),null!=o?o:ae().createElement("h4",null,(0,At.__)("Importing Failed","templately")),Ga(n)?ae().createElement("p",{dangerouslySetInnerHTML:{__html:n}}):ae().createElement("p",{style:ud({},a)},n),"required_pro_templately"===t&&ae().createElement("div",{className:"templately-pro-required-btns"},ae().createElement("a",{className:"templately-button tb-import tb-upgrade-pro-btn",href:"https://templately.com?utm_source=plugin&utm_medium=importFailedPopup#pricing",target:"_blank"},ae().createElement(ld,null),(0,At.__)("Upgrade to Pro","templately")),ae().createElement("a",{className:"templately-button tb-import tb-upgrade-pro-btn",href:Za(l.slug,l.type),target:"_blank"},ae().createElement(ad,null),(0,At.__)("Purchase This Item","templately"))))},pd=window.wp.data;var hd=["dependencies","origin","hasElementorPro"];function fd(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 md(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fd(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gd=o(6614);const vd=gn(function(e){return{platform:e.general.platform,hasElementorPro:e.general.has_elementor_pro,current_screen:e.general.current_screen}},function(e){return{checkDependencies:function(t){return e(rv(t))}}})(function(e){var t=e.dependencies,n=e.origin,r=void 0===n?"remote":n,o=e.hasElementorPro,i=Wn(e,hd),a=pe((0,oe.useState)(!1),2),l=a[0],s=a[1],c=pe((0,oe.useState)(!0),2),u=c[0],d=c[1],p=pe((0,oe.useState)(null),2),h=p[0],f=p[1],m=pe((0,oe.useState)(!1),2),g=m[0],v=m[1],y=pe((0,oe.useState)(null),2),b=y[0],w=y[1],k=pe((0,oe.useState)(null),2),E=k[0],O=(k[1],(0,pd.useSelect)(function(e){return e("core/editor")},[]));return(0,oe.useEffect)(function(){var n,r,a,l;d(!0),"elementor"!==e.platform||"templately"!==templately.current_screen||!["header","footer"].includes(null==i||null===(n=i.template_type)||void 0===n?void 0:n.slug)||o?rv({dependencies:t,platform:e.platform}).then(function(e){d(!1),f(e.dependencies),0==e.dependencies.length&&("templately"==templately.current_screen?v(!0):w(!0))}).catch(function(e){d(!1),f([])}):Al({iconHtml:'<img width="100px" src="'.concat(null===(r=templately)||void 0===r||null===(r=r.icons)||void 0===r?void 0:r.warning,'" alt="warning"/>'),showCloseButton:!0,allowOutsideClick:!1,showClass:{icon:"templately-warning-icon"},html:ae().createElement(dd,{style:{textAlign:"center",marginTop:"-35px"},contentStyles:{backgroundColor:"#F7F7F7",padding:"15px",fontSize:"14px",borderRadius:"12px"},title:ae().createElement(ae().Fragment,null,ae().createElement("p",{style:{fontSize:"18px"}},gd((0,At.sprintf)((0,At.__)("Oops! Seems you don't have %s to import the %s Template","templately"),(0,At.sprintf)("<strong>%s</strong>","Elementor Pro"),Xa(null==i||null===(a=i.template_type)||void 0===a?void 0:a.slug))))),message:gd((0,At.sprintf)((0,At.__)("%6$s %1$s is a part of a %2$s which is available in %3$s. You need to install Elementor Pro to import %1$s template from here. %4$s, you can insert this template from %5$s on your single page.","templately"),Xa(null==i||null===(l=i.template_type)||void 0===l?void 0:l.slug),(0,At.sprintf)("<strong>%s</strong>","Elementor Theme Builder"),(0,At.sprintf)('<a target="_blank" href="https://wpdeveloper.com/go/elementor">%s</a>',"Elementor Pro"),(0,At.sprintf)("<strong>%s</strong>","Alternatively"),(0,At.sprintf)("<strong>%s</strong>","Elementor Editor"),(0,At.sprintf)('<span style="color: red;">%s:</span>',(0,At.__)("NOTE","templately"))))})},!0)},[]),(0,oe.useEffect)(function(){if(null!==b&&!0===b){var t=function(){var t=Ei(xi().mark(function t(){return xi().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(h.length>0)){t.next=2;break}if("gutenberg"!=templately.current_screen&&"elementor"!==templately.current_screen){t.next=2;break}return t.next=1,Di();case 1:void 0!==("undefined"==typeof elementor?"undefined":ne(elementor))&&"elementor"===templately.current_screen&&elementor.addWidgetsCache(elementor.getConfig().initial_document.widgets);case 2:Nl(),xd({id:e.id,postId:null==O?void 0:O.getCurrentPostId(),origin:r,platform:e.platform}).then(function(t){Nl(!1),Tl.close(md({insertCompleted:void 0===(null==t?void 0:t.error),platform:e.platform},t))});case 3:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}();t()}},[b]),(0,oe.useEffect)(function(){l&&(Tl.close({isDismissed:!0}),s(!1))},[l]),null!=b&&!0===b?ae().createElement(_l,{className:"align-center",text:(0,At.__)("Importing...","templately"),description:(0,At.__)("Your chosen template is being imported right now, please do not refresh or close this tab.","templately")}):1==u?ae().createElement(_l,{text:(0,At.__)("Checking...","templately"),description:(0,At.__)("Checking template dependencies are installed or not...","templately")}):ae().createElement("div",{className:"templately-dependency-installer-modal"},null===E&&g&&!u&&ae().createElement(Xu,re({},e,{platform:e.platform})),null===E&&!u&&!g&&ae().createElement(ae().Fragment,null,null!==h&&ae().createElement(id,{dependencies:h,clickCancel:function(e){return s(e)},current_screen:e.current_screen,setIsImporting:w,setImportModal:v})))});var yd=["platform"];const bd=function(e){var t=e.platform,n=Wn(e,yd);return ae().createElement("div",{className:"tm-import-success"},ae().createElement("h3",null,(0,At.__)("Imported successfully!","templately")),ae().createElement("p",null,(0,At.__)("You can now edit or preview the template or, you can push it to Templately Cloud to share with your team.","templately")),ae().createElement("div",{className:"tm-import-links"},"gutenberg"==t&&ae().createElement("a",{className:"templately-button templately-import-button tb-edit-link",href:n.edit_link},(0,At.__)("Edit Template","templately")),(null==n?void 0:n.elementor_edit_link)&&"elementor"===t&&ae().createElement("a",{className:"templately-button templately-import-button tb-edit-with-el",href:n.elementor_edit_link},(0,At.__)("Edit Template with Elementor","templately")),ae().createElement("a",{className:"templately-button templately-import-button tb-visit",href:n.visit},(0,At.__)("View Template","templately"))))};function wd(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 kd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wd(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ed=function(e){return wa("/templately/v1/import/page",e,{},!0)},Od=function(e){return wa("/templately/v1/import",e,{},!0)},xd=function(e){return wa("/templately/v1/insert",e,{},!0).then(function(t){return"elementor"===(null==e?void 0:e.platform)&&_d(t),"gutenberg"===(null==e?void 0:e.platform)&&Sd(t),kd(kd({},e),t)}).catch(function(t){return kd(kd({},e),t)})},Sd=function(e){var t=wp.data.dispatch("core/block-editor").insertBlocks;return!(null==e||!e.content||(t((0,Vu.parse)(e.content)),0))},_d=function(e){var t=window.elementor,n=window.$e;if(void 0!==t){var r=window.TemplatelyIndex;if(void 0!==n){for(var o=0;o<e.content.length;o++)n.run("document/elements/create",{container:t.getPreviewContainer(),model:e.content[o],options:r>=0?{at:r++}:{}});n.run("document/elements/settings",{container:t.getPreviewContainer(),settings:{template:e.page_settings.template}})}else{var i=new Backbone.Model({getTitle:function(){return"Templately Insert"}});t.channels.data.trigger("template:before:insert",i);for(var a=window.TemplatelyIndex,l=0;l<e.content.length;l++)t.getPreviewView().addChildElement(e.content[l],a>=0?{at:a++}:null);t.channels.data.trigger("template:after:insert",{})}return!0}return!1},Cd=function(e,t){var n=e.ModalComponent,r=e.content;r.my_cloud_id&&(r.id=r.my_cloud_id),Al({showCloseButton:!0,allowOutsideClick:!1,html:React.createElement(n,r)},!0).then(function(e){void 0===(null==e?void 0:e.code)?Pd(e.platform):Al({icon:"error",showCloseButton:!0,allowOutsideClick:!1,html:React.createElement(dd,e)},!0)})},Pd=function(e){"templately"!=window.templately.current_screen&&("gutenberg"!==e&&window.TemplatelyModal.destroy(),"gutenberg"===e&&window.TemplatelyAppManager.close("templately-gutenberg"))},Td=["dispatch","page","slug","id"],Ad=function(e){var t=e.dispatch,n=e.page,r=e.slug,o=e.id,i=(Wn(e,Td),pe((0,oe.useState)(!1),2)),a=i[0],l=i[1];return ae().createElement("div",{className:"templately-workspace-modal delete-workspace-modal"},ae().createElement("div",{className:"tm-container"},ae().createElement("h3",null,(0,At.__)("Are You Sure?","templately")),ae().createElement("p",null,ae().createElement("strong",null,(0,At.__)("Note","templately"),": "),(0,At.__)("The WorkSpace will be permanently deleted.","templately")),ae().createElement("p",null,ae().createElement("input",{type:"checkbox",name:"delete_files_too",id:"delete_files_too",onChange:function(){return l(!a)}}),ae().createElement("label",{htmlFor:"delete_files_too"},(0,At.__)("Want To Delete Files Too?","templately"))),ae().createElement("div",{className:"tm-row"},ae().createElement("div",{className:"tm-column"},ae().createElement("button",{className:"tm-btn-cancel",onClick:function(){Tl.hideLoading(),Tl.close({isDismissed:!0})}},(0,At.__)("Cancel","templately"))),ae().createElement("div",{className:"tm-column"},ae().createElement("button",{className:"tm-btn-confirm",onClick:function(){Tl.showLoading(),t(fy({id:o,slug:r,delete_files:a,page:n}))}},(0,At.__)("Delete","templately"))))))},Md=function(e){var t=e.dispatch,n=e.setTitle,r=pe((0,oe.useState)(!0),2),o=r[0],i=r[1],a=pe((0,oe.useState)(!1),2),l=a[0],s=a[1],c=pe((0,oe.useState)(""),2),u=c[0],d=c[1],p=pe((0,oe.useState)([]),2),h=p[0],f=p[1],m=pe((0,oe.useState)(!1),2),g=m[0],v=m[1],y=pe((0,oe.useState)(""),2),b=y[0],w=y[1],k=pe((0,oe.useState)(!1),2),E=k[0],O=k[1],x=pe((0,oe.useState)([]),2),S=x[0],_=x[1];return(0,oe.useEffect)(function(){if(g){var e=Ul(S),t=b.toLowerCase();Ha(t)&&(e.includes(t)||(e.push(t),_(e)),w("")),v(!1)}},[g]),(0,oe.useEffect)(function(){if(!1!==E){var e=Ul(S).filter(function(e){return E!=e});_(e),O(!1)}},[E]),(0,oe.useEffect)(function(){var e=[];S.length>0&&S.map(function(t,n){return e.push(ae().createElement("li",{key:n},t,ae().createElement("span",{onClick:function(){return O(t)}})))}),f(e)},[S]),(0,oe.useEffect)(function(){i(!(u.trim().length>0))},[u]),(0,oe.useEffect)(function(){l&&(Tl.showLoading(),t(py({title:u,share_with:S})),s(!1))},[l]),ae().createElement("div",{className:"templately-workspace-modal create-workspace-modal"},ae().createElement("div",{className:"tm-container"},ae().createElement("div",{className:"tm-row"},ae().createElement("div",{className:"tm-column tm-title"},ae().createElement("span",{className:"tm-title-icon"})),ae().createElement("div",{className:"tm-column bg-light"},ae().createElement("div",{className:"tmw-name"},ae().createElement(bl,{placeholder:(0,At.__)("Type workspace title here...","templately"),value:u,onChange:function(e){d(e.target.value),null==n||n(e.target.value)}})))),ae().createElement("div",{className:"tm-row"},ae().createElement("div",{className:"tm-column tm-title"},ae().createElement("p",null,(0,At.__)("Add People","templately"),": ")),ae().createElement("div",{className:"tm-column bg-light templately-new-shared"},h.length>0&&ae().createElement("ul",{className:"templately-wem-new-email-list"},h),ae().createElement("div",null,ae().createElement(bl,{onKeyUp:function(e){return v(13===e.keyCode)},onChange:function(e){return w(e.target.value)},value:b,placeholder:(0,At.__)("Type email to add","templately")}),ae().createElement(vl,{disabled:0===b.length||!Ha(b),onClick:function(){return v(!0)},label:(0,At.__)("Add","templately")})))),ae().createElement("div",{className:"tm-row"},ae().createElement("div",{className:"tm-column flex-end"},ae().createElement(vl,{disabled:o,onClick:function(){return s(!0)},label:(0,At.__)("Create Workspace","templately")})))))},Nd=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Dd(e){var t=e.defaultInputValue,n=void 0===t?"":t,r=e.defaultMenuIsOpen,o=void 0!==r&&r,i=e.defaultValue,a=void 0===i?null:i,l=e.inputValue,s=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,h=e.value,f=Wn(e,Nd),m=pe((0,oe.useState)(void 0!==l?l:n),2),g=m[0],v=m[1],y=pe((0,oe.useState)(void 0!==s?s:o),2),b=y[0],w=y[1],k=pe((0,oe.useState)(void 0!==h?h:a),2),E=k[0],O=k[1],x=(0,oe.useCallback)(function(e,t){"function"==typeof c&&c(e,t),O(e)},[c]),S=(0,oe.useCallback)(function(e,t){var n;"function"==typeof u&&(n=u(e,t)),v(void 0!==n?n:e)},[u]),_=(0,oe.useCallback)(function(){"function"==typeof p&&p(),w(!0)},[p]),C=(0,oe.useCallback)(function(){"function"==typeof d&&d(),w(!1)},[d]),P=void 0!==l?l:g,T=void 0!==s?s:b,A=void 0!==h?h:E;return Il(Il({},f),{},{inputValue:P,menuIsOpen:T,onChange:x,onInputChange:S,onMenuClose:C,onMenuOpen:_,value:A})}function Id(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ld(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Pt(r.key),r)}}function Rd(e,t,n){return t&&Ld(e.prototype,t),n&&Ld(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jd(e,t){return jd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jd(e,t)}function Fd(e){return Fd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fd(e)}function zd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(zd=function(){return!!e})()}function Bd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Wd=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}(),Ud=Math.abs,Vd=String.fromCharCode,Hd=Object.assign;function qd(e){return e.trim()}function Qd(e,t,n){return e.replace(t,n)}function $d(e,t){return e.indexOf(t)}function Gd(e,t){return 0|e.charCodeAt(t)}function Yd(e,t,n){return e.slice(t,n)}function Xd(e){return e.length}function Kd(e){return e.length}function Zd(e,t){return t.push(e),e}var Jd=1,ep=1,tp=0,np=0,rp=0,op="";function ip(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:Jd,column:ep,length:a,return:""}}function ap(e,t){return Hd(ip("",null,null,"",null,null,0),e,{length:-e.length},t)}function lp(){return rp=np>0?Gd(op,--np):0,ep--,10===rp&&(ep=1,Jd--),rp}function sp(){return rp=np<tp?Gd(op,np++):0,ep++,10===rp&&(ep=1,Jd++),rp}function cp(){return Gd(op,np)}function up(){return np}function dp(e,t){return Yd(op,e,t)}function pp(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 hp(e){return Jd=ep=1,tp=Xd(op=e),np=0,[]}function fp(e){return op="",e}function mp(e){return qd(dp(np-1,yp(91===e?e+2:40===e?e+1:e)))}function gp(e){for(;(rp=cp())&&rp<33;)sp();return pp(e)>2||pp(rp)>3?"":" "}function vp(e,t){for(;--t&&sp()&&!(rp<48||rp>102||rp>57&&rp<65||rp>70&&rp<97););return dp(e,up()+(t<6&&32==cp()&&32==sp()))}function yp(e){for(;sp();)switch(rp){case e:return np;case 34:case 39:34!==e&&39!==e&&yp(rp);break;case 40:41===e&&yp(e);break;case 92:sp()}return np}function bp(e,t){for(;sp()&&e+rp!==57&&(e+rp!==84||47!==cp()););return"/*"+dp(t,np-1)+"*"+Vd(47===e?e:sp())}function kp(e){for(;!pp(cp());)sp();return dp(e,np)}var Ep="-ms-",Op="-moz-",xp="-webkit-",Sp="comm",_p="rule",Cp="decl",Pp="@keyframes";function Tp(e,t){for(var n="",r=Kd(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Ap(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Cp:return e.return=e.return||e.value;case Sp:return"";case Pp:return e.return=e.value+"{"+Tp(e.children,r)+"}";case _p:e.value=e.props.join(",")}return Xd(n=Tp(e.children,r))?e.return=e.value+"{"+n+"}":""}function Mp(e){return fp(Np("",null,null,null,[""],e=hp(e),0,[0],e))}function Np(e,t,n,r,o,i,a,l,s){for(var c=0,u=0,d=a,p=0,h=0,f=0,m=1,g=1,v=1,y=0,b="",w=o,k=i,E=r,O=b;g;)switch(f=y,y=sp()){case 40:if(108!=f&&58==Gd(O,d-1)){-1!=$d(O+=Qd(mp(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:O+=mp(y);break;case 9:case 10:case 13:case 32:O+=gp(f);break;case 92:O+=vp(up()-1,7);continue;case 47:switch(cp()){case 42:case 47:Zd(Ip(bp(sp(),up()),t,n),s);break;default:O+="/"}break;case 123*m:l[c++]=Xd(O)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==v&&(O=Qd(O,/\f/g,"")),h>0&&Xd(O)-d&&Zd(h>32?Lp(O+";",r,n,d-1):Lp(Qd(O," ","")+";",r,n,d-2),s);break;case 59:O+=";";default:if(Zd(E=Dp(O,t,n,c,u,o,l,b,w=[],k=[],d),i),123===y)if(0===u)Np(O,t,E,E,w,i,d,l,k);else switch(99===p&&110===Gd(O,3)?100:p){case 100:case 108:case 109:case 115:Np(e,E,E,r&&Zd(Dp(e,E,E,0,0,o,l,b,o,w=[],d),k),o,k,d,l,r?w:k);break;default:Np(O,E,E,E,[""],k,0,l,k)}}c=u=h=0,m=v=1,b=O="",d=a;break;case 58:d=1+Xd(O),h=f;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==lp())continue;switch(O+=Vd(y),y*m){case 38:v=u>0?1:(O+="\f",-1);break;case 44:l[c++]=(Xd(O)-1)*v,v=1;break;case 64:45===cp()&&(O+=mp(sp())),p=cp(),u=d=Xd(b=O+=kp(up())),y++;break;case 45:45===f&&2==Xd(O)&&(m=0)}}return i}function Dp(e,t,n,r,o,i,a,l,s,c,u){for(var d=o-1,p=0===o?i:[""],h=Kd(p),f=0,m=0,g=0;f<r;++f)for(var v=0,y=Yd(e,d+1,d=Ud(m=a[f])),b=e;v<h;++v)(b=qd(m>0?p[v]+" "+y:Qd(y,/&\f/g,p[v])))&&(s[g++]=b);return ip(e,t,n,0===o?_p:l,s,c,u)}function Ip(e,t,n){return ip(e,t,n,Sp,Vd(rp),Yd(e,2,-2),0)}function Lp(e,t,n,r){return ip(e,t,n,Cp,Yd(e,0,r),Yd(e,r+1,-1),r)}var Rp=function(e,t,n){for(var r=0,o=0;r=o,o=cp(),38===r&&12===o&&(t[n]=1),!pp(o);)sp();return dp(e,np)},jp=new WeakMap,Fp=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)||jp.get(n))&&!r){jp.set(e,!0);for(var o=[],i=function(e,t){return fp(function(e,t){var n=-1,r=44;do{switch(pp(r)){case 0:38===r&&12===cp()&&(t[n]=1),e[n]+=Rp(np-1,t,n);break;case 2:e[n]+=mp(r);break;case 4:if(44===r){e[++n]=58===cp()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Vd(r)}}while(r=sp());return e}(hp(e),t))}(t,o),a=n.props,l=0,s=0;l<i.length;l++)for(var c=0;c<a.length;c++,s++)e.props[s]=o[l]?i[l].replace(/&\f/g,a[c]):a[c]+" "+i[l]}}},zp=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Bp(e,t){switch(function(e,t){return 45^Gd(e,0)?(((t<<2^Gd(e,0))<<2^Gd(e,1))<<2^Gd(e,2))<<2^Gd(e,3):0}(e,t)){case 5103:return xp+"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 xp+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return xp+e+Op+e+Ep+e+e;case 6828:case 4268:return xp+e+Ep+e+e;case 6165:return xp+e+Ep+"flex-"+e+e;case 5187:return xp+e+Qd(e,/(\w+).+(:[^]+)/,xp+"box-$1$2"+Ep+"flex-$1$2")+e;case 5443:return xp+e+Ep+"flex-item-"+Qd(e,/flex-|-self/,"")+e;case 4675:return xp+e+Ep+"flex-line-pack"+Qd(e,/align-content|flex-|-self/,"")+e;case 5548:return xp+e+Ep+Qd(e,"shrink","negative")+e;case 5292:return xp+e+Ep+Qd(e,"basis","preferred-size")+e;case 6060:return xp+"box-"+Qd(e,"-grow","")+xp+e+Ep+Qd(e,"grow","positive")+e;case 4554:return xp+Qd(e,/([^-])(transform)/g,"$1"+xp+"$2")+e;case 6187:return Qd(Qd(Qd(e,/(zoom-|grab)/,xp+"$1"),/(image-set)/,xp+"$1"),e,"")+e;case 5495:case 3959:return Qd(e,/(image-set\([^]*)/,xp+"$1$`$1");case 4968:return Qd(Qd(e,/(.+:)(flex-)?(.*)/,xp+"box-pack:$3"+Ep+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+xp+e+e;case 4095:case 3583:case 4068:case 2532:return Qd(e,/(.+)-inline(.+)/,xp+"$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(Xd(e)-1-t>6)switch(Gd(e,t+1)){case 109:if(45!==Gd(e,t+4))break;case 102:return Qd(e,/(.+:)(.+)-([^]+)/,"$1"+xp+"$2-$3$1"+Op+(108==Gd(e,t+3)?"$3":"$2-$3"))+e;case 115:return~$d(e,"stretch")?Bp(Qd(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Gd(e,t+1))break;case 6444:switch(Gd(e,Xd(e)-3-(~$d(e,"!important")&&10))){case 107:return Qd(e,":",":"+xp)+e;case 101:return Qd(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+xp+(45===Gd(e,14)?"inline-":"")+"box$3$1"+xp+"$2$3$1"+Ep+"$2box$3")+e}break;case 5936:switch(Gd(e,t+11)){case 114:return xp+e+Ep+Qd(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return xp+e+Ep+Qd(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return xp+e+Ep+Qd(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return xp+e+Ep+e+e}return e}var Wp=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Cp:e.return=Bp(e.value,e.length);break;case Pp:return Tp([ap(e,{value:Qd(e.value,"@","@"+xp)})],r);case _p: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 Tp([ap(e,{props:[Qd(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Tp([ap(e,{props:[Qd(t,/:(plac\w+)/,":"+xp+"input-$1")]}),ap(e,{props:[Qd(t,/:(plac\w+)/,":-moz-$1")]}),ap(e,{props:[Qd(t,/:(plac\w+)/,Ep+"input-$1")]})],r)}return""})}}],Up=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,i=e.stylisPlugins||Wp,a={},l=[];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++)a[t[n]]=!0;l.push(e)});var s,c,u,d,p=[Ap,(d=function(e){s.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],h=(c=[Fp,zp].concat(i,p),u=Kd(c),function(e,t,n,r){for(var o="",i=0;i<u;i++)o+=c[i](e,t,n,r)||"";return o});o=function(e,t,n,r){s=n,function(e){Tp(Mp(e),h)}(e?e+"{"+t.styles+"}":t.styles),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Wd({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return f.sheet.hydrate(l),f},Vp=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Hp={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 qp(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Qp=/[A-Z]|^ms/g,$p=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Gp=function(e){return 45===e.charCodeAt(1)},Yp=function(e){return null!=e&&"boolean"!=typeof e},Xp=qp(function(e){return Gp(e)?e:e.replace(Qp,"-$&").toLowerCase()}),Kp=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace($p,function(e,t,n){return Jp={name:t,styles:n,next:Jp},t})}return 1===Hp[e]||Gp(e)||"number"!=typeof t||0===t?t:t+"px"};function Zp(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 o=n;if(1===o.anim)return Jp={name:o.name,styles:o.styles,next:Jp},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)Jp={name:a.name,styles:a.styles,next:Jp},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Zp(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var l=a;null!=t&&void 0!==t[l]?r+=i+"{"+t[l]+"}":Yp(l)&&(r+=Xp(i)+":"+Kp(i,l)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=Zp(e,t,a);switch(i){case"animation":case"animationName":r+=Xp(i)+":"+s+";";break;default:r+=i+"{"+s+"}"}}else for(var c=0;c<a.length;c++)Yp(a[c])&&(r+=Xp(i)+":"+Kp(i,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var l=Jp,s=n(e);return Jp=l,Zp(e,t,s)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Jp,eh=/label:\s*([^\s;{]+)\s*(;|$)/g;function th(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="";Jp=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=Zp(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=Zp(n,t,e[a]),r&&(o+=i[a]);eh.lastIndex=0;for(var l,s="";null!==(l=eh.exec(o));)s+="-"+l[1];var c=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)}(o)+s;return{name:c,styles:o,next:Jp}}var nh=!!oe.useInsertionEffect&&oe.useInsertionEffect,rh=nh||function(e){return e()},oh=(nh||oe.useLayoutEffect,oe.createContext("undefined"!=typeof HTMLElement?Up({key:"css"}):null)),ih=(oh.Provider,function(e){return(0,oe.forwardRef)(function(t,n){var r=(0,oe.useContext)(oh);return e(t,r,n)})}),ah=oe.createContext({}),lh={}.hasOwnProperty,sh="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",ch=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Vp(t,n,r),rh(function(){return function(e,t,n){Vp(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},uh=ih(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var o=e[sh],i=[r],a="";"string"==typeof e.className?a=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,i,e.className):null!=e.className&&(a=e.className+" ");var l=th(i,void 0,oe.useContext(ah));a+=t.key+"-"+l.name;var s={};for(var c in e)lh.call(e,c)&&"css"!==c&&c!==sh&&(s[c]=e[c]);return s.className=a,n&&(s.ref=n),oe.createElement(oe.Fragment,null,oe.createElement(ch,{cache:t,serialized:l,isStringTag:"string"==typeof o}),oe.createElement(o,s))}),dh=uh,ph=function(e,t){var n=arguments;if(null==t||!lh.call(t,"css"))return oe.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=dh,o[1]=function(e,t){var n={};for(var r in t)lh.call(t,r)&&(n[r]=t[r]);return n[sh]=e,n}(e,t);for(var i=2;i<r;i++)o[i]=n[i];return oe.createElement.apply(null,o)};function hh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return th(t)}const fh=["top","right","bottom","left"],mh=Math.min,gh=Math.max,vh=Math.round,yh=Math.floor,bh=e=>({x:e,y:e}),wh={left:"right",right:"left",bottom:"top",top:"bottom"},kh={start:"end",end:"start"};function Eh(e,t,n){return gh(e,mh(t,n))}function Oh(e,t){return"function"==typeof e?e(t):e}function xh(e){return e.split("-")[0]}function Sh(e){return e.split("-")[1]}function _h(e){return"x"===e?"y":"x"}function Ch(e){return"y"===e?"height":"width"}const Ph=new Set(["top","bottom"]);function Th(e){return Ph.has(xh(e))?"y":"x"}function Ah(e){return _h(Th(e))}function Mh(e){return e.replace(/start|end/g,e=>kh[e])}const Nh=["left","right"],Dh=["right","left"],Ih=["top","bottom"],Lh=["bottom","top"];function Rh(e){return e.replace(/left|right|bottom|top/g,e=>wh[e])}function jh(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Fh(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function zh(e,t,n){let{reference:r,floating:o}=e;const i=Th(t),a=Ah(t),l=Ch(a),s=xh(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let h;switch(s){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Sh(t)){case"start":h[a]-=p*(n&&c?-1:1);break;case"end":h[a]+=p*(n&&c?-1:1)}return h}async function Bh(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Oh(t,e),f=jh(h),m=l[p?"floating"===d?"reference":"floating":d],g=Fh(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=Fh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:y,strategy:s}):v);return{top:(g.top-w.top+f.top)/b.y,bottom:(w.bottom-g.bottom+f.bottom)/b.y,left:(g.left-w.left+f.left)/b.x,right:(w.right-g.right+f.right)/b.x}}function Wh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Uh(e){return fh.some(t=>e[t]>=0)}const Vh=new Set(["left","top"]);function Hh(){return"undefined"!=typeof window}function qh(e){return Gh(e)?(e.nodeName||"").toLowerCase():"#document"}function Qh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $h(e){var t;return null==(t=(Gh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Gh(e){return!!Hh()&&(e instanceof Node||e instanceof Qh(e).Node)}function Yh(e){return!!Hh()&&(e instanceof Element||e instanceof Qh(e).Element)}function Xh(e){return!!Hh()&&(e instanceof HTMLElement||e instanceof Qh(e).HTMLElement)}function Kh(e){return!(!Hh()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Qh(e).ShadowRoot)}const Zh=new Set(["inline","contents"]);function Jh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=pf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Zh.has(o)}const ef=new Set(["table","td","th"]);function tf(e){return ef.has(qh(e))}const nf=[":popover-open",":modal"];function rf(e){return nf.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const of=["transform","translate","scale","rotate","perspective"],af=["transform","translate","scale","rotate","perspective","filter"],lf=["paint","layout","strict","content"];function sf(e){const t=cf(),n=Yh(e)?pf(e):e;return of.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||af.some(e=>(n.willChange||"").includes(e))||lf.some(e=>(n.contain||"").includes(e))}function cf(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const uf=new Set(["html","body","#document"]);function df(e){return uf.has(qh(e))}function pf(e){return Qh(e).getComputedStyle(e)}function hf(e){return Yh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ff(e){if("html"===qh(e))return e;const t=e.assignedSlot||e.parentNode||Kh(e)&&e.host||$h(e);return Kh(t)?t.host:t}function mf(e){const t=ff(e);return df(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xh(t)&&Jh(t)?t:mf(t)}function gf(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=mf(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Qh(o);if(i){const e=vf(a);return t.concat(a,a.visualViewport||[],Jh(o)?o:[],e&&n?gf(e):[])}return t.concat(o,gf(o,[],n))}function vf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yf(e){const t=pf(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xh(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=vh(n)!==i||vh(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function bf(e){return Yh(e)?e:e.contextElement}function wf(e){const t=bf(e);if(!Xh(t))return bh(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=yf(t);let a=(i?vh(n.width):n.width)/r,l=(i?vh(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const kf=bh(0);function Ef(e){const t=Qh(e);return cf()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:kf}function Of(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=bf(e);let a=bh(1);t&&(r?Yh(r)&&(a=wf(r)):a=wf(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Qh(e))&&t}(i,n,r)?Ef(i):bh(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=Qh(i),t=r&&Yh(r)?Qh(r):r;let n=e,o=vf(n);for(;o&&r&&t!==n;){const e=wf(o),t=o.getBoundingClientRect(),r=pf(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=i,c+=a,n=Qh(o),o=vf(n)}}return Fh({width:u,height:d,x:s,y:c})}function xf(e,t){const n=hf(e).scrollLeft;return t?t.left+n:Of($h(e)).left+n}function Sf(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xf(e,n),y:n.top+t.scrollTop}}const _f=new Set(["absolute","fixed"]);function Cf(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Qh(e),r=$h(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=cf();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}const c=xf(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=$h(e),n=hf(e),r=e.ownerDocument.body,o=gh(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=gh(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xf(e);const l=-n.scrollTop;return"rtl"===pf(r).direction&&(a+=gh(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}($h(e));else if(Yh(t))r=function(e,t){const n=Of(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Xh(e)?wf(e):bh(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Ef(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Fh(r)}function Pf(e,t){const n=ff(e);return!(n===t||!Yh(n)||df(n))&&("fixed"===pf(n).position||Pf(n,t))}function Tf(e,t,n){const r=Xh(t),o=$h(t),i="fixed"===n,a=Of(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=bh(0);function c(){s.x=xf(o)}if(r||!r&&!i)if(("body"!==qh(t)||Jh(o))&&(l=hf(t)),r){const e=Of(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?bh(0):Sf(o,l);return{x:a.left+l.scrollLeft-s.x-u.x,y:a.top+l.scrollTop-s.y-u.y,width:a.width,height:a.height}}function Af(e){return"static"===pf(e).position}function Mf(e,t){if(!Xh(e)||"fixed"===pf(e).position)return null;if(t)return t(e);let n=e.offsetParent;return $h(e)===n&&(n=n.ownerDocument.body),n}function Nf(e,t){const n=Qh(e);if(rf(e))return n;if(!Xh(e)){let t=ff(e);for(;t&&!df(t);){if(Yh(t)&&!Af(t))return t;t=ff(t)}return n}let r=Mf(e,t);for(;r&&tf(r)&&Af(r);)r=Mf(r,t);return r&&df(r)&&Af(r)&&!sf(r)?n:r||function(e){let t=ff(e);for(;Xh(t)&&!df(t);){if(sf(t))return t;if(rf(t))return null;t=ff(t)}return null}(e)||n}const Df={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=$h(r),l=!!t&&rf(t.floating);if(r===a||l&&i)return n;let s={scrollLeft:0,scrollTop:0},c=bh(1);const u=bh(0),d=Xh(r);if((d||!d&&!i)&&(("body"!==qh(r)||Jh(a))&&(s=hf(r)),Xh(r))){const e=Of(r);c=wf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?bh(0):Sf(a,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-s.scrollTop*c.y+u.y+p.y}},getDocumentElement:$h,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?rf(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=gf(e,[],!1).filter(e=>Yh(e)&&"body"!==qh(e)),o=null;const i="fixed"===pf(e).position;let a=i?ff(e):e;for(;Yh(a)&&!df(a);){const t=pf(a),n=sf(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&_f.has(o.position)||Jh(a)&&!n&&Pf(e,a))?r=r.filter(e=>e!==a):o=t,a=ff(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],l=a[0],s=a.reduce((e,n)=>{const r=Cf(t,n,o);return e.top=gh(r.top,e.top),e.right=mh(r.right,e.right),e.bottom=mh(r.bottom,e.bottom),e.left=gh(r.left,e.left),e},Cf(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Nf,getElementRects:async function(e){const t=this.getOffsetParent||Nf,n=this.getDimensions,r=await n(e.floating);return{reference:Tf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=yf(e);return{width:t,height:n}},getScale:wf,isElement:Yh,isRTL:function(e){return"rtl"===pf(e).direction}};function If(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Lf(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=bf(e),u=o||i?[...c?gf(c):[],...gf(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&l?function(e,t){let n,r=null;const o=$h(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(l||t(),!p||!h)return;const f={rootMargin:-yh(d)+"px "+-yh(o.clientWidth-(u+p))+"px "+-yh(o.clientHeight-(d+h))+"px "+-yh(u)+"px",threshold:gh(0,mh(1,s))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==s){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||If(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(c,n):null;let p,h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!s&&f.observe(c),f.observe(t));let m=s?Of(e):null;return s&&function t(){const r=Of(e);m&&!If(m,r)&&n(),m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(p)}}const Rf=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=xh(n),l=Sh(n),s="y"===Th(n),c=Vh.has(a)?-1:1,u=i&&s?-1:1,d=Oh(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof f&&(h="end"===l?-1*f:f),s?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}},jf=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=Oh(e,t),c={x:n,y:r},u=await Bh(t,s),d=Th(xh(o)),p=_h(d);let h=c[p],f=c[d];if(i){const e="y"===p?"bottom":"right";h=Eh(h+u["y"===p?"top":"left"],h,h-u[e])}if(a){const e="y"===d?"bottom":"right";f=Eh(f+u["y"===d?"top":"left"],f,f-u[e])}const m=l.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},Ff=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:s,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Oh(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=xh(o),y=Th(l),b=xh(l)===l,w=await(null==s.isRTL?void 0:s.isRTL(c.floating)),k=p||(b||!m?[Rh(l)]:function(e){const t=Rh(e);return[Mh(e),t,Mh(t)]}(l)),E="none"!==f;!p&&E&&k.push(...function(e,t,n,r){const o=Sh(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Dh:Nh:t?Nh:Dh;case"left":case"right":return t?Ih:Lh;default:return[]}}(xh(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Mh)))),i}(l,m,f,w));const O=[l,...k],x=await Bh(t,g),S=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(x[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Sh(e),o=Ah(e),i=Ch(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Rh(a)),[a,Rh(a)]}(o,a,w);S.push(x[e[0]],x[e[1]])}if(_=[..._,{placement:o,overflows:S}],!S.every(e=>e<=0)){var C,P;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=O[e];if(t&&("alignment"!==d||y===Th(t)||_.every(e=>Th(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(P=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(h){case"bestFit":{var T;const e=null==(T=_.filter(e=>{if(E){const t=Th(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},zf=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:l}=t,{apply:s=()=>{},...c}=Oh(e,t),u=await Bh(t,c),d=xh(o),p=Sh(o),h="y"===Th(o),{width:f,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(v=d,g="end"===p?"top":"bottom");const y=m-u.top-u.bottom,b=f-u.left-u.right,w=mh(m-u[g],y),k=mh(f-u[v],b),E=!t.middlewareData.shift;let O=w,x=k;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(x=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(O=y),E&&!p){const e=gh(u.left,0),t=gh(u.right,0),n=gh(u.top,0),r=gh(u.bottom,0);h?x=f-2*(0!==e||0!==t?e+t:gh(u.left,u.right)):O=m-2*(0!==n||0!==r?n+r:gh(u.top,u.bottom))}await s({...t,availableWidth:x,availableHeight:O});const S=await a.getDimensions(l.floating);return f!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},Bf=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Oh(e,t);switch(r){case"referenceHidden":{const e=Wh(await Bh(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Uh(e)}}}case"escaped":{const e=Wh(await Bh(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Uh(e)}}}default:return{}}}}},Wf=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:s}=t,{element:c,padding:u=0}=Oh(e,t)||{};if(null==c)return{};const d=jh(u),p={x:n,y:r},h=Ah(o),f=Ch(h),m=await a.getDimensions(c),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[h]-p[h]-i.floating[f],k=p[h]-i.reference[h],E=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let O=E?E[b]:0;O&&await(null==a.isElement?void 0:a.isElement(E))||(O=l.floating[b]||i.floating[f]);const x=w/2-k/2,S=O/2-m[f]/2-1,_=mh(d[v],S),C=mh(d[y],S),P=_,T=O-m[f]-C,A=O/2-m[f]/2+x,M=Eh(P,A,T),N=!s.arrow&&null!=Sh(o)&&A!==M&&i.reference[f]/2-(A<P?_:C)-m[f]/2<0,D=N?A<P?A-P:A-T:0;return{[h]:p[h]+D,data:{[h]:M,centerOffset:A-M-D,...N&&{alignmentOffset:D}},reset:N}}}),Uf=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:s=!0,crossAxis:c=!0}=Oh(e,t),u={x:n,y:r},d=Th(o),p=_h(d);let h=u[p],f=u[d];const m=Oh(l,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(s){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;h<t?h=t:h>n&&(h=n)}if(c){var v,y;const e="y"===p?"width":"height",t=Vh.has(xh(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[p]:h,[d]:f}}}},Vf=(e,t,n)=>{const r=new Map,o={platform:Df,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=zh(c,r,s),p=r,h={},f=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:g,y:v,data:y,reset:b}=await m({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,h={...h,[i]:{...h[i],...y}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=zh(c,p,s))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var Hf=oe.useLayoutEffect,qf=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Qf=function(){};function $f(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Gf(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat($f(e,a)));return i.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var Yf=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===ne(e)&&null!==e?[e]:[];var t},Xf=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,Il({},Wn(e,qf))},Kf=function(e,t,n){var r=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(t,e),className:r(null!=n?n:{},i(t,e),a)}};function Zf(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Jf(e){return Zf(e)?window.pageYOffset:e.scrollTop}function em(e,t){Zf(e)?window.scrollTo(0,t):e.scrollTop=t}function tm(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Qf,o=Jf(e),i=t-o,a=0;!function t(){var l=function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}(a+=10,o,i,n);em(e,l),a<n?window.requestAnimationFrame(t):r(e)}()}function nm(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?em(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&em(e,Math.max(t.offsetTop-o,0))}function rm(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var om=!1,im={get passive(){return om=!0}},am="undefined"!=typeof window?window:{};am.addEventListener&&am.removeEventListener&&(am.addEventListener("p",Qf,im),am.removeEventListener("p",Qf,!1));var lm=om;function sm(e){return null!=e}function cm(e,t,n){return e?t:n}var um=["children","innerProps"],dm=["children","innerProps"];var pm,hm=function(e){return"auto"===e?"bottom":e},fm=(0,oe.createContext)(null),mm=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,s=((0,oe.useContext)(fm)||{}).setPortalPlacement,c=(0,oe.useRef)(null),u=pe((0,oe.useState)(r),2),d=u[0],p=u[1],h=pe((0,oe.useState)(null),2),f=h[0],m=h[1],g=l.spacing.controlHeight;return Hf(function(){var e=c.current;if(e){var t="fixed"===i,l=function(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,s=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=s.getBoundingClientRect().height,p=n.getBoundingClientRect(),h=p.bottom,f=p.height,m=p.top,g=n.offsetParent.getBoundingClientRect().top,v=a||Zf(u=s)?window.innerHeight:u.clientHeight,y=Jf(s),b=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),k=g-w,E=v-m,O=k+y,x=d-y-m,S=h-v+y+b,_=y+m-w,C=160;switch(o){case"auto":case"bottom":if(E>=f)return{placement:"bottom",maxHeight:t};if(x>=f&&!a)return i&&tm(s,S,C),{placement:"bottom",maxHeight:t};if(!a&&x>=r||a&&E>=r)return i&&tm(s,S,C),{placement:"bottom",maxHeight:a?E-b:x-b};if("auto"===o||a){var P=t,T=a?k:O;return T>=r&&(P=Math.min(T-b-l,t)),{placement:"top",maxHeight:P}}if("bottom"===o)return i&&em(s,S),{placement:"bottom",maxHeight:t};break;case"top":if(k>=f)return{placement:"top",maxHeight:t};if(O>=f&&!a)return i&&tm(s,_,C),{placement:"top",maxHeight:t};if(!a&&O>=r||a&&k>=r){var A=t;return(!a&&O>=r||a&&k>=r)&&(A=a?k-w:O-w),i&&tm(s,_,C),{placement:"top",maxHeight:A}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}({maxHeight:r,menuEl:e,minHeight:n,placement:o,shouldScroll:a&&!t,isFixedPosition:t,controlHeight:g});p(l.maxHeight),m(l.placement),null==s||s(l.placement)}},[r,o,i,a,n,s,g]),t({ref:c,placerProps:Il(Il({},e),{},{placement:f||hm(o),maxHeight:d})})},gm=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return Il({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},vm=gm,ym=gm,bm=["size"],wm=["innerProps","isRtl","size"],km={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Em=function(e){var t=e.size,n=Wn(e,bm);return ph("svg",re({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:km},n))},Om=function(e){return ph(Em,re({size:20},e),ph("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"}))},xm=function(e){return ph(Em,re({size:20},e),ph("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"}))},Sm=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return Il({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*o,":hover":{color:n?i.neutral80:i.neutral40}})},_m=Sm,Cm=Sm,Pm=function(){var e=hh.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_"}}}(pm||(pm=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]))),Tm=function(e){var t=e.delay,n=e.offset;return ph("span",{css:hh({animation:"".concat(Pm," 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"},"","")})},Am=["data"],Mm=["innerRef","isDisabled","isHidden","inputClassName"],Nm={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Dm={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Il({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Nm)},Im=function(e){return Il({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Nm)},Lm=function(e){var t=e.children,n=e.innerProps;return ph("div",n,t)},Rm={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return ph("div",re({},Kf(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ph(Om,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return ph("div",re({ref:o},Kf(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return ph("div",re({},Kf(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ph(xm,null))},DownChevron:xm,CrossIcon:Om,Group:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return ph("div",re({},Kf(e,"group",{group:!0}),l),ph(i,re({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),ph("div",null,t))},GroupHeading:function(e){var t=Xf(e);t.data;var n=Wn(t,Am);return ph("div",re({},Kf(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return ph("div",re({},Kf(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ph("span",re({},t,Kf(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=Xf(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=Wn(r,Mm);return ph("div",re({},Kf(e,"input",{"input-container":!0}),{"data-value":n||""}),ph("input",re({className:t({input:!0},l),ref:o,style:Im(a),disabled:i},s)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=void 0===r?4:r,i=Wn(e,wm);return ph("div",re({},Kf(Il(Il({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ph(Tm,{delay:0,offset:n}),ph(Tm,{delay:160,offset:!0}),ph(Tm,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return ph("div",re({},Kf(e,"menu",{menu:!0}),{ref:n},r),t)},MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return ph("div",re({},Kf(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,r=e.controlElement,o=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=(0,oe.useRef)(null),s=(0,oe.useRef)(null),c=pe((0,oe.useState)(hm(i)),2),u=c[0],d=c[1],p=(0,oe.useMemo)(function(){return{setPortalPlacement:d}},[]),h=pe((0,oe.useState)(null),2),f=h[0],m=h[1],g=(0,oe.useCallback)(function(){if(r){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}}(r),t="fixed"===a?0:window.pageYOffset,n=e[u]+t;n===(null==f?void 0:f.offset)&&e.left===(null==f?void 0:f.rect.left)&&e.width===(null==f?void 0:f.rect.width)||m({offset:n,rect:e})}},[r,a,u,null==f?void 0:f.offset,null==f?void 0:f.rect.left,null==f?void 0:f.rect.width]);Hf(function(){g()},[g]);var v=(0,oe.useCallback)(function(){"function"==typeof s.current&&(s.current(),s.current=null),r&&l.current&&(s.current=Lf(r,l.current,g,{elementResize:"ResizeObserver"in window}))},[r,g]);Hf(function(){v()},[v]);var y=(0,oe.useCallback)(function(e){l.current=e,v()},[v]);if(!t&&"fixed"!==a||!f)return null;var b=ph("div",re({ref:y},Kf(Il(Il({},e),{},{offset:f.offset,position:a,rect:f.rect}),"menuPortal",{"menu-portal":!0}),o),n);return ph(fm.Provider,{value:p},t?(0,le.createPortal)(b,t):b)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,o=Wn(e,dm);return ph("div",re({},Kf(Il(Il({},o),{},{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,o=Wn(e,um);return ph("div",re({},Kf(Il(Il({},o),{},{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,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return ph(s,{data:r,innerProps:Il(Il({},Kf(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},ph(c,{data:r,innerProps:Il({},Kf(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),ph(u,{data:r,innerProps:Il(Il({},Kf(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},MultiValueContainer:Lm,MultiValueLabel:Lm,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return ph("div",re({role:"button"},n),t||ph(Om,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return ph("div",re({},Kf(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return ph("div",re({},Kf(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return ph("div",re({},Kf(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return ph("div",re({},Kf(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,o=e.hasValue;return ph("div",re({},Kf(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},jm=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Fm(e,t){return e===t||!(!jm(e)||!jm(t))}function zm(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Fm(e[n],t[n]))return!1;return!0}for(var Bm={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Wm=function(e){return ph("span",re({css:Bm},e))},Um={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=void 0===n?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(r,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=void 0===o?"":o,a=e.selectValue,l=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if("menu"===t&&c){var d=l?" disabled":"",p="".concat(s?" selected":"").concat(d);return"".concat(i).concat(p,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Vm=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,s=e.id,c=e.isAppleDevice,u=l.ariaLiveMessages,d=l.getOptionLabel,p=l.inputValue,h=l.isMulti,f=l.isOptionDisabled,m=l.isSearchable,g=l.menuIsOpen,v=l.options,y=l.screenReaderStatus,b=l.tabSelectsValue,w=l.isLoading,k=l["aria-label"],E=l["aria-live"],O=(0,oe.useMemo)(function(){return Il(Il({},Um),u||{})},[u]),x=(0,oe.useMemo)(function(){var e,n="";if(t&&O.onChange){var r=t.option,o=t.options,i=t.removedValue,l=t.removedValues,s=t.value,c=i||r||(e=s,Array.isArray(e)?null:e),u=c?d(c):"",p=o||l||void 0,h=p?p.map(d):[],m=Il({isDisabled:c&&f(c,a),label:u,labels:h},t);n=O.onChange(m)}return n},[t,O,f,a,d]),S=(0,oe.useMemo)(function(){var e="",t=n||r,i=!!(n&&a&&a.includes(n));if(t&&O.onFocus){var l={focused:t,label:d(t),isDisabled:f(t,a),isSelected:i,options:o,context:t===n?"menu":"value",selectValue:a,isAppleDevice:c};e=O.onFocus(l)}return e},[n,r,d,f,O,o,a,c]),_=(0,oe.useMemo)(function(){var e="";if(g&&v.length&&!w&&O.onFilter){var t=y({count:o.length});e=O.onFilter({inputValue:p,resultsMessage:t})}return e},[o,p,g,O,v,y,w]),C="initial-input-focus"===(null==t?void 0:t.action),P=(0,oe.useMemo)(function(){var e="";if(O.guidance){var t=r?"value":g?"menu":"input";e=O.guidance({"aria-label":k,context:t,isDisabled:n&&f(n,a),isMulti:h,isSearchable:m,tabSelectsValue:b,isInitialFocus:C})}return e},[k,n,r,h,f,m,g,O,a,b,C]),T=ph(oe.Fragment,null,ph("span",{id:"aria-selection"},x),ph("span",{id:"aria-focused"},S),ph("span",{id:"aria-results"},_),ph("span",{id:"aria-guidance"},P));return ph(oe.Fragment,null,ph(Wm,{id:s},C&&T),ph(Wm,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!C&&T))},Hm=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],qm=new RegExp("["+Hm.map(function(e){return e.letters}).join("")+"]","g"),Qm={},$m=0;$m<Hm.length;$m++)for(var Gm=Hm[$m],Ym=0;Ym<Gm.letters.length;Ym++)Qm[Gm.letters[Ym]]=Gm.base;var Xm=function(e){return e.replace(qm,function(e){return Qm[e]})},Km=function(e,t){void 0===t&&(t=zm);var n=null;function r(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}(Xm),Zm=function(e){return e.replace(/^\s+|\s+$/g,"")},Jm=function(e){return"".concat(e.label," ").concat(e.value)},eg=["innerRef"];function tg(e){var t=e.innerRef,n=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];var o=Object.entries(e).filter(function(e){var t=pe(e,1)[0];return!n.includes(t)});return o.reduce(function(e,t){var n=pe(t,2),r=n[0],o=n[1];return e[r]=o,e},{})}(Wn(e,eg),"onExited","in","enter","exit","appear");return ph("input",re({ref:t},n,{css:hh({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var ng=["boxSizing","height","overflow","paddingRight","position"],rg={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function og(e){e.cancelable&&e.preventDefault()}function ig(e){e.stopPropagation()}function ag(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function lg(){return"ontouchstart"in window||navigator.maxTouchPoints}var sg=!("undefined"==typeof window||!window.document||!window.document.createElement),cg=0,ug={capture:!1,passive:!1},dg=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},pg={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function hg(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=function(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,a=(0,oe.useRef)(!1),l=(0,oe.useRef)(!1),s=(0,oe.useRef)(0),c=(0,oe.useRef)(null),u=(0,oe.useCallback)(function(e,t){if(null!==c.current){var s=c.current,u=s.scrollTop,d=s.scrollHeight,p=s.clientHeight,h=c.current,f=t>0,m=d-p-u,g=!1;m>t&&a.current&&(r&&r(e),a.current=!1),f&&l.current&&(i&&i(e),l.current=!1),f&&t>m?(n&&!a.current&&n(e),h.scrollTop=d,g=!0,a.current=!0):!f&&-t>u&&(o&&!l.current&&o(e),h.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,r,o,i]),d=(0,oe.useCallback)(function(e){u(e,e.deltaY)},[u]),p=(0,oe.useCallback)(function(e){s.current=e.changedTouches[0].clientY},[]),h=(0,oe.useCallback)(function(e){var t=s.current-e.changedTouches[0].clientY;u(e,t)},[u]),f=(0,oe.useCallback)(function(e){if(e){var t=!!lm&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",h,t)}},[h,p,d]),m=(0,oe.useCallback)(function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",h,!1))},[h,p,d]);return(0,oe.useEffect)(function(){if(t){var e=c.current;return f(e),function(){m(e)}}},[t,f,m]),function(e){c.current=e}}({isEnabled:void 0===r||r,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,n=e.accountForScrollbars,r=void 0===n||n,o=(0,oe.useRef)({}),i=(0,oe.useRef)(null),a=(0,oe.useCallback)(function(e){if(sg){var t=document.body,n=t&&t.style;if(r&&ng.forEach(function(e){var t=n&&n[e];o.current[e]=t}),r&&cg<1){var i=parseInt(o.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,l=window.innerWidth-a+i||0;Object.keys(rg).forEach(function(e){var t=rg[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(l,"px"))}t&&lg()&&(t.addEventListener("touchmove",og,ug),e&&(e.addEventListener("touchstart",ag,ug),e.addEventListener("touchmove",ig,ug))),cg+=1}},[r]),l=(0,oe.useCallback)(function(e){if(sg){var t=document.body,n=t&&t.style;cg=Math.max(cg-1,0),r&&cg<1&&ng.forEach(function(e){var t=o.current[e];n&&(n[e]=t)}),t&&lg()&&(t.removeEventListener("touchmove",og,ug),e&&(e.removeEventListener("touchstart",ag,ug),e.removeEventListener("touchmove",ig,ug)))}},[r]);return(0,oe.useEffect)(function(){if(t){var e=i.current;return a(e),function(){l(e)}}},[t,a,l]),function(e){i.current=e}}({isEnabled:n});return ph(oe.Fragment,null,n&&ph("div",{onClick:dg,css:pg}),t(function(e){o(e),i(e)}))}var fg={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},mg=function(e){var t=e.name,n=e.onFocus;return ph("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:fg,value:"",onChange:function(){}})};function gg(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function vg(){return gg(/^Mac/i)}var yg=function(e){return e.label},bg=function(e){return e.value},wg={clearIndicator:Cm,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius;return Il({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},dropdownIndicator:_m,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return Il({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return Il({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return Il(Il({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},Dm),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return Il({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*a})},loadingMessage:ym,menu:function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return Il((Tt(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),Tt(n,"position","absolute"),Tt(n,"width","100%"),Tt(n,"zIndex",1),n),t?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return Il({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return Il({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return Il({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return Il({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:vm,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Il({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?l.primary:l.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return Il({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return Il({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Il({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},kg={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Eg={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:rm(),captureMenuScroll:!rm(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=Il({ignoreCase:!0,ignoreAccents:!0,stringify:Jm,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,l=n.matchFrom,s=a?Zm(t):t,c=a?Zm(i(e)):i(e);return r&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=Km(s),c=Xm(c)),"start"===l?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:yg,getOptionValue:bg,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Og(e,t,n,r){return{type:"option",data:t,isDisabled:Mg(e,t,n),isSelected:Ng(e,t,n),label:Tg(e,t),value:Ag(e,t),index:r}}function xg(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(n,r){return Og(e,n,t,r)}).filter(function(t){return Cg(e,t)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Og(e,n,t,r);return Cg(e,i)?i:void 0}).filter(sm)}function Sg(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,Ul(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function _g(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,Ul(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function Cg(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!Ig(e)||!i)&&Dg(e,{label:a,value:l,data:o},r)}var Pg=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},Tg=function(e,t){return e.getOptionLabel(t)},Ag=function(e,t){return e.getOptionValue(t)};function Mg(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Ng(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=Ag(e,t);return n.some(function(t){return Ag(e,t)===r})}function Dg(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Ig=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Lg=1,Rg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jd(e,t)}(n,e);var t=function(e){var t=zd();return function(){var n,r=Fd(e);if(t){var o=Fd(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==ne(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Bd(e)}(this,n)}}(n);function n(e){var r;if(Id(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,o=n.onChange,i=n.name;t.name=i,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,i=o.closeMenuOnSelect,a=o.isMulti,l=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:l}),i&&(r.setState({inputIsHiddenAfterUpdate:!a}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,o=t.isMulti,i=t.name,a=r.state.selectValue,l=o&&r.isOptionSelected(e,a),s=r.isOptionDisabled(e,a);if(l){var c=r.getOptionValue(e);r.setValue(a.filter(function(e){return r.getOptionValue(e)!==c}),"deselect-option",e)}else{if(s)return void r.ariaOnChange(e,{action:"select-option",option:e,name:i});o?r.setValue([].concat(Ul(a),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,o=r.getOptionValue(e),i=n.filter(function(e){return r.getOptionValue(e)!==o}),a=cm(t,i,i[0]||null);r.onChange(a,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(cm(r.props.isMulti,[],null),{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),i=cm(e,o,o[0]||null);n&&r.onChange(i,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return Pg(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return _g(xg(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Gf.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return Tg(r.props,e)},r.getOptionValue=function(e){return Ag(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,o=wg[e](t,n);o.boxSizing="border-box";var i=r.props.styles[e];return i?i(o,t):o},r.getClassNames=function(e,t){var n,o;return null===(n=(o=r.props.classNames)[e])||void 0===n?void 0:n.call(o,t)},r.getElementId=function(e){return"".concat(r.state.instancePrefix,"-").concat(e)},r.getComponents=function(){return e=r.props,Il(Il({},Rm),e.components);var e},r.buildCategorizedOptions=function(){return xg(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Sg(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:Il({value:e},t)})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,o=t.menuIsOpen;r.focusInput(),o?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu("first"),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Zf(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var o=Math.abs(n.clientX-r.initialTouchX),i=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=o>5||i>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){if(!r.blockOptionHover&&r.state.focusedOption!==e){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return Ig(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,a=t.inputValue,l=t.isClearable,s=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,h=r.state,f=h.focusedOption,m=h.focusedValue,g=h.selectValue;if(!(s||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||a)return;r.focusValue("previous");break;case"ArrowRight":if(!n||a)return;r.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(m)r.removeValue(m);else{if(!o)return;n?r.popValue():l&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!c||!d||!f||p&&r.isOptionSelected(f,g))return;r.selectOption(f);break;case"Enter":if(229===e.keyCode)break;if(c){if(!f)return;if(r.isComposing)return;r.selectOption(f);break}return;case"Escape":c?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:a}),r.onMenuClose()):l&&i&&r.clearValue();break;case" ":if(a)return;if(!c){r.openMenu("first");break}if(!f)return;r.selectOption(f);break;case"ArrowUp":c?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":c?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!c)return;r.focusOption("pageup");break;case"PageDown":if(!c)return;r.focusOption("pagedown");break;case"Home":if(!c)return;r.focusOption("first");break;case"End":if(!c)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++Lg),r.state.selectValue=Yf(e.value),e.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),a=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=i[a],r.state.focusedOptionId=Pg(o,i[a])}return r}return Rd(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&nm(this.menuListRef,this.focusedOptionRef),(vg()||gg(/^iPhone/i)||gg(/^iPad/i)||vg()&&navigator.maxTouchPoints>1)&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&r&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(nm(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,o=n.isFocused,i=this.buildFocusableOptions(),a="first"===e?0:i.length-1;if(!this.props.isMulti){var l=i.indexOf(r[0]);l>-1&&(a=l)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a],focusedOptionId:this.getFocusedOptionId(i[a])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o<i&&(a=o+1)}this.setState({inputIsHidden:-1!==a,focusedValue:n[a]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[o])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(kg):Il(Il({},kg),this.props.theme):kg}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,o=this.getValue,i=this.selectOption,a=this.setValue,l=this.props,s=l.isMulti,c=l.isRtl,u=l.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:o,hasValue:this.hasValue(),isMulti:s,isRtl:c,options:u,selectOption:i,selectProps:l,setValue:a,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return Mg(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Ng(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Dg(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,o=e.inputValue,i=e.tabIndex,a=e.form,l=e.menuIsOpen,s=e.required,c=this.getComponents().Input,u=this.state,d=u.inputIsHidden,p=u.ariaSelection,h=this.commonProps,f=r||this.getElementId("input"),m=Il(Il(Il({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":s,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==p?void 0:p.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?oe.createElement(c,re({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:f,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:a,type:"text",value:o},m)):oe.createElement(tg,re({id:f,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Qf,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:a,value:""},m))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,i=t.MultiValueRemove,a=t.SingleValue,l=t.Placeholder,s=this.commonProps,c=this.props,u=c.controlShouldRenderValue,d=c.isDisabled,p=c.isMulti,h=c.inputValue,f=c.placeholder,m=this.state,g=m.selectValue,v=m.focusedValue,y=m.isFocused;if(!this.hasValue()||!u)return h?null:oe.createElement(l,re({},s,{key:"placeholder",isDisabled:d,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),f);if(p)return g.map(function(t,a){var l=t===v,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return oe.createElement(n,re({},s,{components:{Container:r,Label:o,Remove:i},isFocused:l,isDisabled:d,key:c,index:a,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(h)return null;var b=g[0];return oe.createElement(a,re({},s,{data:b,isDisabled:d}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var a={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return oe.createElement(e,re({},t,{innerProps:a,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;return e&&o?oe.createElement(e,re({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,o=this.props.isDisabled,i=this.state.isFocused;return oe.createElement(n,re({},r,{isDisabled:o,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return oe.createElement(e,re({},t,{innerProps:o,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,o=t.Menu,i=t.MenuList,a=t.MenuPortal,l=t.LoadingMessage,s=t.NoOptionsMessage,c=t.Option,u=this.commonProps,d=this.state.focusedOption,p=this.props,h=p.captureMenuScroll,f=p.inputValue,m=p.isLoading,g=p.loadingMessage,v=p.minMenuHeight,y=p.maxMenuHeight,b=p.menuIsOpen,w=p.menuPlacement,k=p.menuPosition,E=p.menuPortalTarget,O=p.menuShouldBlockScroll,x=p.menuShouldScrollIntoView,S=p.noOptionsMessage,_=p.onMenuScrollToTop,C=p.onMenuScrollToBottom;if(!b)return null;var P,T=function(t,n){var r=t.type,o=t.data,i=t.isDisabled,a=t.isSelected,l=t.label,s=t.value,p=d===o,h=i?void 0:function(){return e.onOptionHover(o)},f=i?void 0:function(){return e.selectOption(o)},m="".concat(e.getElementId("option"),"-").concat(n),g={id:m,onClick:f,onMouseMove:h,onMouseOver:h,tabIndex:-1,role:"option","aria-selected":e.state.isAppleDevice?void 0:a};return oe.createElement(c,re({},u,{innerProps:g,data:o,isDisabled:i,isSelected:a,key:m,label:l,type:r,value:s,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())P=this.getCategorizedOptions().map(function(t){if("group"===t.type){var o=t.data,i=t.options,a=t.index,l="".concat(e.getElementId("group"),"-").concat(a),s="".concat(l,"-heading");return oe.createElement(n,re({},u,{key:l,data:o,options:i,Heading:r,headingProps:{id:s,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return T(e,"".concat(a,"-").concat(e.index))}))}if("option"===t.type)return T(t,"".concat(t.index))});else if(m){var A=g({inputValue:f});if(null===A)return null;P=oe.createElement(l,u,A)}else{var M=S({inputValue:f});if(null===M)return null;P=oe.createElement(s,u,M)}var N={minMenuHeight:v,maxMenuHeight:y,menuPlacement:w,menuPosition:k,menuShouldScrollIntoView:x},D=oe.createElement(mm,re({},u,N),function(t){var n=t.ref,r=t.placerProps,a=r.placement,l=r.maxHeight;return oe.createElement(o,re({},u,N,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:m,placement:a}),oe.createElement(hg,{captureEnabled:h,onTopArrive:_,onBottomArrive:C,lockEnabled:O},function(t){return oe.createElement(i,re({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":u.isMulti,id:e.getElementId("listbox")},isLoading:m,maxHeight:l,focusedOption:d}),P)}))});return E||"fixed"===k?oe.createElement(a,re({},u,{appendTo:E,controlElement:this.controlRef,menuPlacement:w,menuPosition:k}),D):D}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,i=t.name,a=t.required,l=this.state.selectValue;if(a&&!this.hasValue()&&!r)return oe.createElement(mg,{name:i,onFocus:this.onValueInputFocus});if(i&&!r){if(o){if(n){var s=l.map(function(t){return e.getOptionValue(t)}).join(n);return oe.createElement("input",{name:i,type:"hidden",value:s})}var c=l.length>0?l.map(function(t,n){return oe.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})}):oe.createElement("input",{name:i,type:"hidden",value:""});return oe.createElement("div",null,c)}var u=l[0]?this.getOptionValue(l[0]):"";return oe.createElement("input",{name:i,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.isFocused,a=t.selectValue,l=this.getFocusableOptions();return oe.createElement(Vm,re({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:o,isFocused:i,selectValue:a,focusableOptions:l,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,o=e.ValueContainer,i=this.props,a=i.className,l=i.id,s=i.isDisabled,c=i.menuIsOpen,u=this.state.isFocused,d=this.commonProps=this.getCommonProps();return oe.createElement(r,re({},d,{className:a,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:u}),this.renderLiveRegion(),oe.createElement(t,re({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:u,menuIsOpen:c}),oe.createElement(o,re({},d,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),oe.createElement(n,re({},d,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,a=t.isFocused,l=t.prevWasFocused,s=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,h=e.isMulti,f=Yf(u),m={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var g=d?function(e,t){return Sg(xg(e,t))}(e,f):[],v=d?_g(xg(e,f),"".concat(s,"-option")):[],y=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r<t.length)return t[r]}return null}(t,f):null,b=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);m={selectValue:f,focusedOption:b,focusedOptionId:Pg(v,b),focusableOptionsWithIds:v,focusedValue:y,clearFocusValueOnUpdate:!1}}var w=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},k=i,E=a&&l;return a&&!E&&(k={value:cm(h,f,f[0]||null),options:f,action:"initial-input-focus"},E=!l),"initial-input-focus"===(null==i?void 0:i.action)&&(k=null),Il(Il(Il({},m),w),{},{prevProps:e,ariaSelection:k,prevWasFocused:E})}}]),n}(oe.Component);Rg.defaultProps=Eg;var jg=(0,oe.forwardRef)(function(e,t){var n=Dd(e);return oe.createElement(Rg,re({ref:t},n))}),Fg=jg,zg=["action","dispatch","workspaces","sharedWorkspaces","workspacesLoading","sharedWorkspacesLoading"],Bg=["value"];const Wg=gn(function(e){var t,n;return{workspaces:null!==(t=e.workspaces.lists)&&void 0!==t?t:[],sharedWorkspaces:null!==(n=e.sharedWorkspaces.lists)&&void 0!==n?n:[],workspacesLoading:e.workspaces.isLoading,sharedWorkspacesLoading:e.sharedWorkspaces.isLoading}})(function(e){var t=e.action,n=e.dispatch,r=e.workspaces,o=e.sharedWorkspaces,i=e.workspacesLoading,a=e.sharedWorkspacesLoading,l=Wn(e,zg),s=pe((0,oe.useState)(!1),2),c=s[0],u=s[1],d=pe((0,oe.useState)(!0),2),p=d[0],h=d[1],f=pe((0,oe.useState)(null),2),m=f[0],g=f[1],v=pe((0,oe.useState)([]),2),y=v[0],b=v[1];return(0,oe.useEffect)(function(){0==r.length&&n(sy({list_only:!0})),0==o.length&&n(sy({list_only:!0,shared:!0}))},[]),(0,oe.useEffect)(function(){var e=[];r.length&&e.push({label:(0,At.__)("My WorkSpace","templately"),options:$a(r)}),o.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:$a(o)}),e.length>0&&b(e)},[r,o]),(0,oe.useEffect)(function(){h(null==m)},[m]),(0,oe.useEffect)(function(){if(c){var r=e.my_cloud_id,o=m.value,i=Wn(m,Bg);Tl.showLoading(),"copy"===t?n(Qv({my_cloud_id:r,workspace_id:o,action:t,fileContents:l,details:i})):"move"===t&&n(Gv({my_cloud_id:r,workspace_id:o,action:t,fileContents:l,details:i})),u(!1)}},[c]),ae().createElement(cl,{className:"templately-cloud-copy-n-move-modal",headerClass:"text-center",header:(0,At.sprintf)((0,At.__)("%s to WorkSpace","templately"),"copy"===t?(0,At.__)("Copy","templately"):(0,At.__)("Move","templately"))},ae().createElement(ul,{className:"align-center"},ae().createElement(dl,{className:"text-right",column:4},ae().createElement("p",null,(0,At.__)("Item Name","templately"),":")),ae().createElement(dl,{column:8,wrapper:!0,wrapperClass:"cloud-item-name"},ae().createElement("p",null,ae().createElement("strong",null,l.name)))),ae().createElement(ul,null,ae().createElement(dl,{className:"text-right",column:4},ae().createElement("p",null,"copy"===t?(0,At.__)("Copy to","templately"):(0,At.__)("Move to","templately"),":")),ae().createElement(dl,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},ae().createElement(Fg,{isClearable:!0,isLoading:i||a,placeholder:(0,At.__)("Select WorkSpace","templately"),noOptionsMessage:function(){return(0,At.__)("No WorkSpace Found","templately")},options:y,onChange:function(e){return g(e)}}))),ae().createElement(ul,{className:"flex-end"},ae().createElement(dl,null,ae().createElement(vl,{className:"templately-copy-move-btn",disabled:p,onClick:function(){return u(!0)},label:"copy"===t?(0,At.__)("Copy","templately"):(0,At.__)("Move","templately")}))))}),Ug=function(e){var t=e.id,n=e.source,r=e.slug;return ae().createElement("div",{className:"templately-workspace-modal delete-file"},ae().createElement("h4",null,(0,At.__)("Are You Sure?","templately")),ae().createElement("p",null,(0,At.__)("You want to delete the file from your cloud.","templately")),ae().createElement("div",{className:"twm-df-actions"},ae().createElement("button",{onClick:function(){return Tl.close({isDismissed:!0})},className:"templately-button tb-cancel"},(0,At.__)("Cancel","templately")),ae().createElement("button",{onClick:function(){Tl.showLoading(),e.dispatch(Xv({id:t,source:n,slug:r}))},className:"templately-button tb-delete"},(0,At.__)("Delete","templately"))))};function Vg(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 Hg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vg(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const qg=gn(function(e){var t,n;return{workspaces:null!==(t=e.workspaces.lists)&&void 0!==t?t:[],sharedWorkspaces:null!==(n=e.sharedWorkspaces.lists)&&void 0!==n?n:[],workspacesLoading:e.workspaces.isLoading,sharedWorkspacesLoading:e.sharedWorkspaces.isLoading,templates:{clouds:e.clouds.search,workspaces:e.workspaces.search,shared_workspaces:e.sharedWorkspaces.search}}},function(e){return{searchFiles:function(t){return e(ry(Hg(Hg({},t),{},{context:"modal"})))},addFiles:function(t){return e(xy(t))}}})(function(e){var t,n=pe((0,oe.useState)(!1),2),r=n[0],o=n[1],i=pe((0,oe.useState)(!0),2),a=i[0],l=i[1],s=pe((0,oe.useState)(null),2),c=s[0],u=s[1],d=pe((0,oe.useState)([]),2),p=d[0],h=d[1],f=pe((0,oe.useState)([]),2),m=f[0],g=f[1],v=pe((0,oe.useState)(""),2),y=v[0],b=v[1],w=pe((0,oe.useState)({value:"clouds",label:(0,At.__)("My Clouds","templately")}),2),k=w[0],E=w[1],O=(0,oe.useMemo)(function(){return[{value:"clouds",label:(0,At.__)("My Clouds","templately")},{value:"workspaces",label:(0,At.__)("My Workspaces","templately")},{value:"shared_workspaces",label:(0,At.__)("Shared Workspaces","templately")}]},[]),x=(0,oe.useCallback)(function(){var t,n;return"workspaces"===k.value&&(null===(t=e.workspaces)||void 0===t?void 0:t.length)>0?$a(e.workspaces,!1,"slug",[],[e.slug]):"shared_workspaces"===k.value&&(null===(n=e.sharedWorkspaces)||void 0===n?void 0:n.length)>0?$a(e.sharedWorkspaces,!0,"slug",[],[e.slug]):[]},[k,e.workspaces,e.sharedWorkspaces]);(0,oe.useEffect)(function(){u(null),h(null),l(!0)},[k]),(0,oe.useEffect)(function(){g([])},[c,k]),(0,oe.useEffect)(function(){(null==p?void 0:p.length)>0?l(!1):l(!0)},[p]),(0,oe.useEffect)(function(){if((null==y?void 0:y.length)>=3){var t={search:y};"clouds"!==k.value&&(t.source=k.value,t.slug=c.slug),e.searchFiles(t)}},[y]);var S=(0,oe.useCallback)(function(){var t={};"clouds"!==k.value&&(t.source=k.value,t.slug=c.slug),e.searchFiles(t)},[k,c]);return(0,oe.useEffect)(function(){var t;null!==(t=e.templates[k.value])&&void 0!==t&&t.isLoading?g([]):g($a(e.templates[k.value].data,"shared_workspaces"===k.value,"clouds"===k.value?"id":"my_cloud_id",["slug","owner","last_modified"]))},[e.templates]),(0,oe.useEffect)(function(){r&&(e.addFiles({files:p.map(function(e){return e.value}),workspace_id:null==e?void 0:e.id,slug:null==e?void 0:e.slug}),Tl.showLoading(),o(!1))},[r]),ae().createElement(cl,{className:"add-file-to-workspace",headerClass:"text-center",header:(0,At.__)("Add Template to WorkSpace","templately")},ae().createElement(ul,{className:"align-center"},ae().createElement(dl,{className:"text-right",column:4},ae().createElement("p",null,(0,At.__)("Select Source","templately"),":")),ae().createElement(dl,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},ae().createElement(Fg,{isSearchable:!1,placeholder:(0,At.__)("Select a source","templately"),noOptionsMessage:function(){return(0,At.__)("No Sources Found","templately")},value:k,options:O,onChange:function(e){return E(e)}}))),"clouds"!==(null==k?void 0:k.value)&&ae().createElement(ul,{className:"align-center"},ae().createElement(dl,{className:"text-right",column:4},ae().createElement("p",null,(0,At.__)("Select Workspace","templately"),":")),ae().createElement(dl,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},ae().createElement(Fg,{isSearchable:!1,placeholder:(0,At.__)("Select a workspace","templately"),noOptionsMessage:function(){return(0,At.sprintf)((0,At.__)("No %s Found","templately"),"workspaces"==k.value?(0,At.__)("Workspace","templately"):(0,At.__)("Shared Workspace","templately"))},value:c,options:x(),onChange:function(e){return u(e)}}))),(void 0!==(null==c?void 0:c.slug)&&"clouds"!==k.value||"clouds"===k.value)&&ae().createElement(ul,{className:"align-center"},ae().createElement(dl,{className:"text-right",column:4},ae().createElement("p",null,(0,At.__)("Select Templates","templately"),":")),ae().createElement(dl,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},ae().createElement(Fg,{isMulti:!0,isClearable:!0,isLoading:null===(t=e.templates[k.value])||void 0===t?void 0:t.isLoading,placeholder:(0,At.__)("Search by typing...","templately"),noOptionsMessage:function(){return(0,At.__)("No Templates Found","templately")},loadingMessage:function(){return(0,At.__)("Loading templates...","templately")},onFocus:S,options:m,onChange:function(e){return h(e)},onInputChange:function(e){return b(e)}}),ae().createElement("p",null,ae().createElement("small",null,ae().createElement("strong",null,(0,At.__)("Note","templately"),": "),(0,At.__)("You are seeing fewer items after initial load. You can search more to find your desire templates from the selected source.","templately"))))),ae().createElement(ul,{className:"flex-end"},ae().createElement(dl,null,ae().createElement(vl,{className:"templately-add-templates",disabled:a,onClick:function(){return o(!0)},label:(0,At.__)("Add to WorkSpace","templately")}))))});function Qg(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 $g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qg(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Gg=gn(function(e,t){var n,r,o=null!==(n=null===(r=e.workspaceDetails)||void 0===r?void 0:r[null==t?void 0:t.slug])&&void 0!==n?n:{};return $g($g({},t),o)})(function(e){var t=e.sharedWith,n=e.pending_invitations,r=e.dispatch,o=pe((0,oe.useState)(e.name),2),i=o[0],a=o[1],l=pe((0,oe.useState)(!0),2),s=l[0],c=l[1],u=pe((0,oe.useState)(!1),2),d=u[0],p=u[1],h=pe((0,oe.useState)([]),2),f=h[0],m=h[1],g=pe((0,oe.useState)([]),2),v=g[0],y=g[1],b=pe((0,oe.useState)(!1),2),w=b[0],k=b[1],E=pe((0,oe.useState)(!1),2),O=E[0],x=E[1],S=pe((0,oe.useState)(!1),2),_=S[0],C=S[1],P=pe((0,oe.useState)(""),2),T=P[0],A=P[1],M=pe((0,oe.useState)(!1),2),N=M[0],D=M[1],I=pe((0,oe.useState)([]),2),L=I[0],R=I[1],j=pe((0,oe.useState)([]),2),F=j[0],z=j[1],B=pe((0,oe.useState)([]),2),W=(B[0],B[1]),U=pe((0,oe.useState)([]),2),V=U[0],H=U[1];return(0,oe.useEffect)(function(){var e=[],r=[];if(t&&t.length>0&&(t.map(function(t,n){r.push(t.email),e.push(ae().createElement("li",{key:n},t.profile_photo&&ae().createElement("img",{src:t.profile_photo}),ae().createElement("span",{className:"tae-name "},t.name),ae().createElement("span",{className:"tae-remove",onClick:function(e){x({email:t.email,currentTarget:e.currentTarget.parentElement})}}),ae().createElement("span",{className:"tae-undo",onClick:function(e){C({email:t.email,currentTarget:e.currentTarget.parentElement})}})))}),R(r),m(e)),n&&n.length>0){var o=JSON.parse(n),i=[],a=[];o.map(function(e){Ha(e)&&(a.push(e),i.push(ae().createElement("li",{key:e},ae().createElement("span",{className:"tae-name "},e,ae().createElement("em",null,(0,At.__)("invited","templately"))),ae().createElement("span",{className:"tae-remove",onClick:function(t){x({email:e,currentTarget:t.currentTarget.parentElement})}}),ae().createElement("span",{className:"tae-undo",onClick:function(t){C({email:e,currentTarget:t.currentTarget.parentElement})}}))))}),W(a),R([].concat(r,a)),m([].concat(e,i))}},[]),(0,oe.useEffect)(function(){if(w){var e=Ul(F),t=T.toLowerCase();Ha(t)&&(e.includes(t)||(e.push(t),z(e)),A("")),k(!1)}},[w]),(0,oe.useEffect)(function(){if(!1!==N){var e=Ul(F).filter(function(e){return N!=e});z(e),D(!1)}},[N]),(0,oe.useEffect)(function(){if(!1!==O||!1!==_){var e=Ul(L),t=Ul(V);if(0!=O&&(O.currentTarget.classList.add("removed"),t.push(O.email),e=e.filter(function(e){return O.email!=e}),R(e),H(t),x(!1)),0!=_){_.currentTarget.classList.remove("removed"),e.push(_.email);var n=t.filter(function(e){return _.email!=e});R(e),H(n),C(!1)}}},[O,_]),(0,oe.useEffect)(function(){var e=[];F.length>0&&F.map(function(t,n){return e.push(ae().createElement("li",{key:n},t,ae().createElement("span",{onClick:function(){return D(t)}})))}),y(e)},[F]),(0,oe.useEffect)(function(){F.length>0||V.length>0?c(!1):c(!0)},[L,F,V]),(0,oe.useEffect)(function(){if(d){var t=F,n=Ul(V);Tl.showLoading();var o=e.slug,a=e.id;r(gy({slug:o,id:a,title:i,share_with:t,remove:n})),p(!1)}},[d]),ae().createElement("div",{className:"templately-workspace-modal edit-workspace-modal"},ae().createElement("div",{className:"tm-container"},ae().createElement("div",{className:"tm-row"},ae().createElement("div",{className:"tm-column tm-title"},ae().createElement("span",{className:"tm-title-icon"})),ae().createElement("div",{className:"tm-column bg-light"},ae().createElement("div",{className:"tmw-name"},ae().createElement(bl,{value:i,onChange:function(e){c(0===e.target.value.trim().length),a(e.target.value)}})))),f.length>0&&ae().createElement("div",{className:"tm-row"},ae().createElement("div",{className:"tm-column tm-title"},ae().createElement("p",null,(0,At.__)("Shared with","templately"),": ")),ae().createElement("div",{className:"tm-column templately-shared-with"},ae().createElement("ul",{className:"templately-added-email-list"},f))),ae().createElement("div",{className:"tm-row"},ae().createElement("div",{className:"tm-column tm-title"},ae().createElement("p",null,(0,At.__)("Add People","templately"),": ")),ae().createElement("div",{className:"tm-column bg-light templately-new-shared"},v.length>0&&ae().createElement("ul",{className:"templately-wem-new-email-list"},v),ae().createElement("div",null,ae().createElement(bl,{onKeyUp:function(e){return k(13===e.keyCode)},onChange:function(e){return A(e.target.value)},value:T,placeholder:(0,At.__)("Type email to add","templately")}),ae().createElement(vl,{disabled:0===T.length||!Ha(T),onClick:function(){return k(!0)},label:(0,At.__)("Add","templately")})))),ae().createElement("div",{className:"tm-row"},ae().createElement("div",{className:"tm-column flex-end"},ae().createElement(vl,{disabled:s,onClick:function(){return p(!0)},label:(0,At.__)("Save Changes","templately")})))))});var Yg=function(e,t){var n=e.ModalComponent,r=e.content,o=t.dispatch,i=t.general;o(ty({id:r.my_cloud_id,platform:i.platform}));var a={key:"isDownloaded",error:{title:(0,At.__)("Download Failed!!!","templately"),content:""},success:{title:(0,At.__)("Successfully Downloaded!","templately"),content:""}};Al({showCloseButton:!1,allowOutsideClick:!0,onConfirm:function(e){return Ml(a,e)},html:React.createElement(n,null)},!0)},Xg=function(e,t){var n=e.ModalComponent,r=e.content,o={key:"copy"===t?"isCopied":"isMoved",error:{title:(0,At.__)("Something went wrong.","templately"),content:function(e){var t=e.message;return React.createElement("p",{dangerouslySetInnerHTML:{__html:t}})},args:{showCloseButton:!0,timer:null}},success:{title:(0,At.__)("Successfully Copied","templately"),content:function(e){var n=e.title;return React.createElement(React.Fragment,null,"copy"==t?(0,At.__)("Your file has been copied to a WorkSpace called: ","templately"):(0,At.__)("Your file has been moved to a WorkSpace called: ","templately"),React.createElement("strong",null,n))}}};Al({showCloseButton:!1,allowOutsideClick:!0,onConfirm:function(e){return Ml(o,e)},html:React.createElement(n,re({},r,{action:t}))},!0)},Kg=function(e,t){var n=e.ModalComponent,r=e.content,o=e.source,i=t.dispatch,a={key:"isDeleted",error:{title:(0,At.__)("Something went wrong!","templately"),content:"Something went wrong regarding deleting your file. Try Later or Contact for Support."},success:{title:(0,At.__)("Successfully Deleted!","templately"),content:"You have deleted a file from your cloud."}};Al({showCloseButton:!0,onConfirm:function(e){return Ml(a,e)},html:React.createElement(n,re({},r,{source:o,dispatch:i}))},!0)},Zg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"templately",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"list";return[{include:("templately"===t||"list"!==n)&&void 0,hidden:"templately"===t||"grid"===n,className:"tb-import templately-button",name:(0,At.__)("Insert","templately"),icon:"",action:Cd,ModalComponent:vd},{className:"tw-download",name:(0,At.__)("Download","templately"),icon:"",action:Yg,ModalComponent:_l},{name:(0,At.__)("Copy to WorkSpace","templately"),icon:React.createElement(Tn,null),action:function(e,t){return Xg(e,"copy")},ModalComponent:Wg},{name:(0,At.__)("Move to WorkSpace","templately"),icon:React.createElement(In,null),disabled:e,action:function(e,t){return Xg(e,"move")},ModalComponent:Wg},{name:(0,At.__)("Delete","templately"),icon:React.createElement(An,null),disabled:e,action:Kg,ModalComponent:Ug}]},Jg=function(e,t){var n;(0,t.dispatch)(Ny({id:null==e||null===(n=e.content)||void 0===n?void 0:n.id}))},ev=function(e,t){var n,r,o=e.ModalComponent,i=e.content;(0,t.dispatch)(Kv({id:null==e||null===(n=e.content)||void 0===n?void 0:n.id,page:null==e||null===(r=e.content)||void 0===r?void 0:r.currentPage}));var a={key:"isPushed",error:{args:{timer:null,showCloseButton:!0},title:(0,At.__)("Something went wrong.","templately"),content:function(e){var t=e.message;return React.createElement(React.Fragment,null,React.createElement("p",{dangerouslySetInnerHTML:{__html:t}}))}},success:{title:(0,At.__)("Successfully Pushed","templately"),content:function(){return React.createElement(React.Fragment,null,(0,At.__)("Your file has been pushed successfully to your cloud store.","templately"))}}};Al({showCloseButton:!1,allowOutsideClick:!1,onConfirm:function(e){return Ml(a,e)},html:React.createElement(o,i)},!0)},tv=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"templately",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r={condition:!1===(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]),modalArgs:{title:"",message:React.createElement(React.Fragment,null,React.createElement("p",null,(0,At.__)("The required dependency ‘Elementor’ is missing. Please install it before proceeding.","templately")))},sweetArgs:{icon:"error",title:(0,At.__)("Elementor not installed.","templately")}};return[{include:"templately"===t&&void 0,hidden:"templately"===t,className:"tb-import templately-button",name:(0,At.__)("Insert","templately"),icon:"",action:Cd,ModalComponent:vd,disabled:"Kit"===n},{include:"templately"!==t,className:"tw-preview templately-button",name:(0,At.__)("Preview","templately"),icon:"",href:"Kit"!==n,hrefKey:"preview_url",error:r,disabled:"Kit"===n},{include:"templately"!==t,className:"tw-push2cloud templately-button",name:(0,At.__)("Push To Cloud","templately"),icon:"",redirect:{state:["profile","data"],if:null,then:"sign-in"},disabled:e||"Kit"===n,action:ev,ModalComponent:_l,error:r},{className:"tw-download",name:(0,At.__)("Export","templately"),icon:"",href:"Kit"!==n,hrefKey:"export_url",error:r,disabled:"Kit"===n},{name:(0,At.__)("Delete","templately"),icon:React.createElement(An,null),disabled:e||"Kit"===n,action:Jg,error:r}]},nv=function(e){var t={requirement:e},n=(0,Ci.addQueryArgs)("/templately/v1/dependencies/install",{disable_redirect:!0});return wa(n,t,{},!0)},rv=function(e){return wa("/templately/v1/dependencies/check",e,{},!0)},ov=function(e){return!e||!!e.startsWith("clouds/")||["favourites","downloads","clouds","clouds/shared-workspace","clouds/workspace","clouds/save-template","purchased-items"].includes(e)},iv=function(e,t){var n,r,o=null!==(n=null==t||null===(r=t.data)||void 0===r?void 0:r.is_verified)&&void 0!==n?n:t;return!(!e||o||(Al({icon:!1,showCloseButton:!0,allowOutsideClick:!0,html:React.createElement("div",{className:"templately-import-modal templately-modal"},React.createElement(dd,{code:"invalid_data",title:(0,At.__)("Template Import Failed!","templately"),message:(0,At.sprintf)((0,At.__)('Looks like your account is not verified. Verify your account to start creating your website. Need help? Reach out to our <a href="%s" target="_blank" rel="noopener noreferrer">support team</a> anytime.',"templately"),"https://wpdeveloper.com/support/")}))},!0),0))};function av(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}var lv=function(e,t){var n="elementor"===t,r=e[n?"system_colors":"global_colors"]||[],o=e.custom_colors||[],i={},a=[];return[].concat(Ul(r),Ul(o)).forEach(function(e){var t=n?"_id":"var",r=n?"title":"name";i[e[t]]=e.color,a.push({_id:e[t],title:e[r],color:e.color})}),{colors:i,_systemColors:a}},sv=function(e,t){return(0,oe.useMemo)(function(){return lv(e,t)},[e,t])},cv=function(e,t){var n="elementor"===t,r="gutenberg"===t,o=(0,_a.cloneDeep)(e),i=n?"custom_typography":"global_typography.custom",a=Ua(o,n?"system_typography":"global_typography",[]),l=Ua(o,i,[]);return r&&delete a.custom,{systemTypography:a,customTypography:l}},uv=function(e,t){var n="elementor"===t,r="gutenberg"===t,o=e||{},i=o.systemTypography,a=o.customTypography,l=i,s=a;if(r){var c={body:"Text",link:"Link",button:"Button",heading:"Headings",allHeadings:"All"},u=function(e){return e&&"object"===ne(e)?Object.entries(e).map(function(e){var t=pe(e,2),n=t[0],r=t[1];return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?av(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):av(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({_id:n,name:c[n]||r.name||n},r)}):[]};l=u(l),s=u(s)}var d=["all","h1","h2","h3","h4","h5","h6"],p={_id:"_id",_index:"_index",title:"title",selectedFont:"typography_font_family",selectedFontWeight:"typography_font_weight",transform:"typography_text_transform",decoration:"typography_text_decoration","selectedSize.desktop.value":"typography_font_size.size","selectedSize.desktop.unit":"typography_font_size.unit","selectedLineHeight.desktop.value":"typography_line_height.size","selectedLineHeight.desktop.unit":"typography_line_height.unit","selectedLetterSpacing.desktop.value":"typography_letter_spacing.size","selectedLetterSpacing.desktop.unit":"typography_letter_spacing.unit","selectedSize.tablet.value":"typography_font_size_tablet.size","selectedSize.tablet.unit":"typography_font_size_tablet.unit","selectedLineHeight.tablet.value":"typography_line_height_tablet.size","selectedLineHeight.tablet.unit":"typography_line_height_tablet.unit","selectedLetterSpacing.tablet.value":"typography_letter_spacing_tablet.size","selectedLetterSpacing.tablet.unit":"typography_letter_spacing_tablet.unit","selectedSize.mobile.value":"typography_font_size_mobile.size","selectedSize.mobile.unit":"typography_font_size_mobile.unit","selectedLineHeight.mobile.value":"typography_line_height_mobile.size","selectedLineHeight.mobile.unit":"typography_line_height_mobile.unit","selectedLetterSpacing.mobile.value":"typography_letter_spacing_mobile.size","selectedLetterSpacing.mobile.unit":"typography_letter_spacing_mobile.unit"},h={_id:"_id",_index:"_index",title:"name",selectedFont:"fontFamily",selectedFontWeight:"fontWeight",transform:"textTransform",decoration:"textDecoration","selectedSize.desktop.value":"fontSize","selectedSize.desktop.unit":"fontSizeUnit","selectedLineHeight.desktop.value":"lineHeight","selectedLineHeight.desktop.unit":"lineHeightUnit","selectedLetterSpacing.desktop.value":"letterSpacing","selectedLetterSpacing.desktop.unit":"letterSpacingUnit","selectedSize.tablet.value":"TABfontSize","selectedSize.tablet.unit":"TABfontSizeUnit","selectedLineHeight.tablet.value":"TABlineHeight","selectedLineHeight.tablet.unit":"TABlineHeightUnit","selectedLetterSpacing.tablet.value":"TABletterSpacing","selectedLetterSpacing.tablet.unit":"TABletterSpacingUnit","selectedSize.mobile.value":"MOBfontSize","selectedSize.mobile.unit":"MOBfontSizeUnit","selectedLineHeight.mobile.value":"MOBlineHeight","selectedLineHeight.mobile.unit":"MOBlineHeightUnit","selectedLetterSpacing.mobile.value":"MOBletterSpacing","selectedLetterSpacing.mobile.unit":"MOBletterSpacingUnit"},f=(0,oe.useMemo)(function(){if(!l&&!s)return{normalizedTypography:{},groupedData:[]};for(var e=Array.isArray(l)?l:Object.values(l||{}),t=Array.isArray(s)?s:Object.values(s||{}),r=function(e){var t={};return Object.entries(e).forEach(function(e,r){var o=pe(e,2),i=(o[0],o[1]),a={},s=(0,_a.cloneDeep)(i);s._index=r;for(var c=0,u=Object.entries(n?p:h);c<u.length;c++){var d=pe(u[c],2),f=d[0],m=d[1],g=Ua(s,m,null);a=Va(a,f,g)}a._isSystem=l.some(function(e){return e._id===s._id}),t[a._id]=a}),t}([].concat(Ul(e),Ul(t))),o=[{key:"System Font",items:[]},{key:"Headings",items:[]},{key:"Custom",items:[]}],i=function(){var e=pe(c[a],2),t=(e[0],e[1]),n=d.includes(t.title.trim().toLowerCase())?1:l.some(function(e){return e._id===t._id})?0:2;o[n].items.push({_id:Ua(t,"_id",null),_index:Ua(t,"_index",null),title:Ua(t,"title",null)})},a=0,c=Object.entries(r);a<c.length;a++)i();return o[1].items.sort(function(e,t){return e.title.localeCompare(t.title,"en",{sensitivity:"base"})}),o[1].items.forEach(function(e){r[e._id].title=e.title.toUpperCase()}),o[0].items.sort(function(e,t){return e._index-t._index}),o[2].items.sort(function(e,t){return e._index-t._index}),o=o.filter(function(e){return e.items.length}),{normalizedTypography:r,groupedData:o}},[l,s]);return{normalizedTypography:f.normalizedTypography,groupedData:f.groupedData,getDeNormalizedTypography:function(e){for(var t={},r=0,o=Object.entries(e);r<o.length;r++){for(var i=pe(o[r],2),a=i[0],l=i[1],s={},c=(0,_a.cloneDeep)(l),u=0,d=Object.entries(n?p:h);u<d.length;u++){var f=pe(d[u],2),m=f[0],g=f[1],v=Ua(c,m,null);s=Va(s,g,v)}t[a]=s}return t}}},dv=function(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=null!==(n=null==t||null===(r=t.data)||void 0===r?void 0:r.is_verified)&&void 0!==n?n:t;if(e&&!i){var a=o||(0,At.sprintf)((0,At.__)('Something went wrong. Need help? Reach out to our <a href="%s" target="_blank" rel="noopener noreferrer">support team</a> anytime.',"templately"),"https://wpdeveloper.com/support/");return Al({showCloseButton:!0,allowOutsideClick:!1,icon:"error",title:"Oops...",html:React.createElement("p",{className:"text-danger text-center",dangerouslySetInnerHTML:{__html:a}})},!1),!0}return!1};function pv(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 hv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pv(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var fv=function(e){return{type:br,platform:e}},mv=function(e){return hv({type:Dr},e)},gv=function(e){return hv({type:Ir},e)},vv=function(){return mv({key:"doQuery",data:Date.now()})},yv=function(e){return hv({type:Rr},e)},bv=function(e){return hv({type:Fr},e)},wv=function(e){return hv({type:Br},e)},kv=function(e){return{type:Wr,data:e}},Ev=function(e){return{type:Ur,error:e}},Ov=function(e){return hv({type:Hr},e)},xv=function(e){return hv({type:qr},e)},Sv=function(e){return hv({type:Nr},e)},_v=function(e){return hv({type:Qr},e)},Cv=function(e){return hv({type:Gr},e)},Pv=function(e,t){return{type:Yr,id:e,data:t}};function Tv(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 Av(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tv(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Mv=function(e){return Av({type:Wa(Mo,e.key)},e)},Nv=function(e){return Av({type:Wa(No,e.key)},e)},Dv=function(e){return Av({type:Io},e)},Iv=function(e){return Av({type:Lo},e)},Lv=function(e){return Av({type:jo},e)},Rv=function(e){return Av({type:Fo},e)},jv=function(e){return Av({type:Bo},e)},Fv=function(e){return Av({type:Wo},e)};function zv(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 Bv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zv(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Wv=function(e){return Bv({type:$o.LOAD},e)},Uv=function(e){return Bv({type:$o.LOAD_SUCCESS},e)},Vv=function(e){return Bv({type:$o.LOAD_FAILED},e)},Hv=function(e){return Bv({type:$o.STATUS_SUCCESS},e)},qv=function(e){return Bv({type:$o.STATUS_FAILED},e)},Qv=function(e){return Bv({type:$o.COPY},e)},$v=function(e){return Bv({type:$o.COPY_SUCCESS},e)},Gv=function(e){return Bv({type:$o.MOVE},e)},Yv=function(e){return Bv({type:$o.MOVE_SUCCESS},e)},Xv=function(e){return Bv({type:$o.DELETE},e)},Kv=function(e){return Bv({type:$o.PUSH},e)},Zv=function(e){return Bv({type:$o.CLEAR_PUSH2CLOUD},e)},Jv=function(e){return Bv({type:$o.PUSH_SUCCESS},e)},ey=function(e){return Bv({type:$o.PUSH_FAILED},e)},ty=function(e){return Bv({type:$o.DOWNLOAD},e)},ny=function(){switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"clouds"){case"clouds":return $o;case"workspaces":return Go;case"shared_workspaces":return Yo;case"workspace_details":return Xo}},ry=function(e){return Bv({type:ny(null==e?void 0:e.source).SEARCH},e)},oy=function(e){return Bv({type:ny(null==e?void 0:e.source).SEARCH_SUCCESS},e)};function iy(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 ay(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iy(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ly=function(e){var t;return ay({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Yo.LOAD:Go.LOAD},e)},sy=function(e){var t;return ay({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Yo.LOAD_LISTS:Go.LOAD_LISTS},e)},cy=function(e){var t;return ay({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Yo.SET_LISTS:Go.SET_LISTS},e)},uy=function(e){var t;return ay({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Yo.LOAD_SUCCESS:Go.LOAD_SUCCESS},e)},dy=function(e){var t;return ay({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Yo.LOAD_FAILED:Go.LOAD_FAILED},e)},py=function(e){return ay({type:Go.CREATE},e)},hy=function(e){return ay({type:Go.CREATE_SUCCESS},e)},fy=function(e){return ay({type:Go.DELETE},e)},my=function(e){return ay({type:Go.DELETE_SUCCESS},e)},gy=function(e){return ay({type:Go.SAVE},e)},vy=function(e){return ay({type:Xo.SET},e)},yy=function(e){return ay({type:Xo.LOAD},e)},by=function(e){return ay({type:Xo.LOAD_SUCCESS},e)},wy=function(e){return ay({type:Xo.DELETE},e)},ky=function(e){return ay({type:Xo.GET_FILES},e)},Ey=function(e){return ay({type:Xo.SET_FILES},e)},Oy=function(e){return ay({type:Xo.LOAD_FAILED},e)},xy=function(e){return ay({type:Xo.ADD_FILE},e)},Sy=o(4765);function _y(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 Cy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_y(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Py=function(e){return Cy({type:Uo},e)},Ty=function(e){return Cy({type:Vo},e)},Ay=function(e){return Cy({type:Ho},e)},My=function(e){return Cy({type:"SAVED_TEMPLATES_LOAD_FAILED"},e)},Ny=function(e){return Cy({type:Qo},e)};function Dy(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 Iy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dy(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ly=function(e){return Iy({type:oi},e)},Ry=function(e){return{type:Ko,step:e}},jy=function(e){return{type:Zo,step:e}},Fy=function(e){return{type:Jo,payload:e}},zy=function(e){return{type:ri,payload:e}},By=function(e){return{type:ii,payload:e}},Wy=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:ai,payload:Iy({id:null!==(e=null==t?void 0:t.id)&&void 0!==e?e:null,show:!0},t)}},Uy=function(){return{type:ui,payload:Iy({show:!0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},Vy=function(){return{type:di,payload:{show:!1,aiTemplates:null}}},Hy=function(e){return{type:pi,payload:{packId:e,isAi:arguments.length>1&&void 0!==arguments[1]&&arguments[1]}}},qy=function(e){return{type:hi,payload:e}},Qy=function(e){return{type:fi,payload:e}},$y=function(e){return{type:gi,payload:e}},Gy=function(e){return{type:vi,payload:e}},Yy=function(){return{type:yi}},Xy=function(e){return{type:wi.SET_PLATFORM,platform:e}},Ky=(0,oe.createContext)();Ky.displayName="Anonymous";var Zy,Jy=Ky.Provider;Ky.Consumer,function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(Zy||(Zy={}));var eb="beforeunload";function tb(e){e.preventDefault(),e.returnValue=""}function nb(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter(function(e){return e!==t})}},call:function(t){e.forEach(function(e){return e&&e(t)})}}}var rb,ob=o(5373);function ib(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 ab(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ib(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ib(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lb(){if(!rb){var e=document.location.pathname,t=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,r=n.history;function o(){var e=n.location,t=e.pathname,o=e.search,i=e.hash,a=r.state||{};return[a.idx,{pathname:t,search:o,hash:i,state:a.usr||null,key:a.key||"default"}]}var i=null;n.addEventListener("popstate",function(){if(i)d.call(i),i=null;else{var e=Zy.Pop,t=o(),n=t[0],r=t[1];if(d.length){if(null!=n){var a=s-n;a&&(i={action:e,location:r,retry:function(){v(-1*a)}},v(a))}}else g(e)}});var a=Zy.Pop,l=o(),s=l[0],c=l[1],u=nb(),d=nb();function p(e){return"string"==typeof e?e:(n=(t=e).pathname,r=void 0===n?"/":n,o=t.search,i=void 0===o?"":o,a=t.hash,l=void 0===a?"":a,i&&"?"!==i&&(r+="?"===i.charAt(0)?i:"?"+i),l&&"#"!==l&&(r+="#"===l.charAt(0)?l:"#"+l),r);var t,n,r,o,i,a,l}function h(e,t){return void 0===t&&(t=null),re({pathname:c.pathname,hash:"",search:""},"string"==typeof e?function(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}(e):e,{state:t,key:Math.random().toString(36).substr(2,8)})}function f(e,t){return[{usr:e.state,key:e.key,idx:t},p(e)]}function m(e,t,n){return!d.length||(d.call({action:e,location:t,retry:n}),!1)}function g(e){a=e;var t=o();s=t[0],c=t[1],u.call({action:a,location:c})}function v(e){r.go(e)}return null==s&&(s=0,r.replaceState(re({},r.state,{idx:s}),"")),{get action(){return a},get location(){return c},createHref:p,push:function e(t,o){var i=Zy.Push,a=h(t,o);if(m(i,a,function(){e(t,o)})){var l=f(a,s+1),c=l[0],u=l[1];try{r.pushState(c,"",u)}catch(e){n.location.assign(u)}g(i)}},replace:function e(t,n){var o=Zy.Replace,i=h(t,n);if(m(o,i,function(){e(t,n)})){var a=f(i,s),l=a[0],c=a[1];r.replaceState(l,"",c),g(o)}},go:v,back:function(){v(-1)},forward:function(){v(1)},listen:function(e){return u.push(e)},block:function(e){var t=d.push(e);return 1===d.length&&n.addEventListener(eb,tb),function(){t(),d.length||n.removeEventListener(eb,tb)}}}}({basename:e.substring(0,e.lastIndexOf("/"))});rb={get length(){return t.length},get action(){return t.action},get location(){var n=t.location,r=(0,ob.parse)(n.search.substring(1)).path||"/";return r.startsWith("/")||(r="/"+r),ab(ab({},n),{},{actualPathname:e,pathname:r})},get pathname(){return this.location.pathname.substring(1)},createHref:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.createHref.apply(t,n)},push:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.push.apply(t,n)},replace:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.replace.apply(t,n)},go:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.go.apply(t,n)},goBack:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.goBack.apply(t,n)},goForward:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.goForward.apply(t,n)},block:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.block.apply(t,n)},listen:function(e){var n=this;return t.listen(function(){e(n.location,n.action)})}}}return rb}var sb=lb();function cb(){var e=lb().location.search;return e.length&&(0,ob.parse)(e.substring(1))||{}}var ub=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=(0,Ci.getQueryArgs)(e),a=cb(),l=ab(ab({},a),i);return null!=r&&(l=ab(ab({},l),r)),"/"===e||Array.isArray(e)?Array.isArray(e)&&(l.path=e.join("/")):l.path=e,l.path.startsWith("../")&&(l.path=l.path.substring("3")),"elementor"!==(null==a?void 0:a.action)&&"edit"!==(null==a?void 0:a.action)||null==o||o.push("page"),!0===Boolean(null==r?void 0:r.isGutenbergEditor)&&(null==o||o.push("page"),null==o||o.push("isGutenbergEditor")),null!==(t=l)&&void 0!==t&&t.platform&&null!==(n=l.path)&&void 0!==n&&n.startsWith(l.platform)&&(null==o||o.push("platform")),!0===Boolean(null==r?void 0:r.closing)&&(null==o||o.push("closing")),""===e&&(null==o||o.push("path")),(null==o?void 0:o.length)>0&&(l=Qa(l,o)),(0,Ci.addQueryArgs)(lb().location.actualPathname,l)},db=function(e){return"@@redux-saga/"+e},pb=db("CANCEL_PROMISE"),hb=db("CHANNEL_END"),fb=db("IO"),mb=db("MATCH"),gb=db("MULTICAST"),vb=db("SAGA_ACTION"),yb=db("SELF_CANCELLATION"),bb=db("TASK"),wb=db("TASK_CANCEL"),kb=db("TERMINATE"),Eb=db("LOCATION"),Ob=function(e){return null==e},xb=function(e){return null!=e},Sb=function(e){return"function"==typeof e},_b=function(e){return"string"==typeof e},Cb=Array.isArray,Pb=function(e){return e&&Sb(e.then)},Tb=function(e){return e&&Sb(e.next)&&Sb(e.throw)},Ab=function(e){return e&&(_b(e)||Db(e)||Sb(e)||Cb(e)&&e.every(Ab))},Mb=function(e){return e&&Sb(e.take)&&Sb(e.close)},Nb=function(e){return Sb(e)&&e.hasOwnProperty("toString")},Db=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype},Ib=function(){return function(){return true}}(),Lb=function(){},Rb=function(e){return e},jb=function(e,t){re(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(function(n){e[n]=t[n]})};function Fb(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var zb=function(e){throw e},Bb=function(e){return{value:e,done:!0}};function Wb(e,t,n){void 0===t&&(t=zb),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:Bb,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function Ub(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var Vb=function(e){return Array.apply(null,new Array(e))},Hb=function(e){return function(t){return e(Object.defineProperty(t,vb,{value:!0}))}},qb=function(e){return e===kb},Qb=function(e){return e===wb},$b=function(e){return qb(e)||Qb(e)};function Gb(e,t){var n,r=Object.keys(e),o=r.length,i=0,a=Cb(e)?Vb(o):{},l={};return r.forEach(function(e){var r=function(r,l){n||(l||$b(r)?(t.cancel(),t(r,l)):(a[e]=r,++i===o&&(n=!0,t(a))))};r.cancel=Lb,l[e]=r}),t.cancel=function(){n||(n=!0,r.forEach(function(e){return l[e].cancel()}))},l}function Yb(e){return{name:e.name||"anonymous",location:Xb(e)}}function Xb(e){return e[Eb]}function Kb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var Zb=function(e){return function(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,o=0,i=0,a=function(t){n[o]=t,o=(o+1)%e,r++},l=function(){if(0!=r){var t=n[i];return n[i]=null,r--,i=(i+1)%e,t}},s=function(){for(var e=[];r;)e.push(l());return e};return{isEmpty:function(){return 0==r},put:function(l){var c;if(r<e)a(l);else switch(t){case 1:throw new Error("Channel's Buffer overflow!");case 3:n[o]=l,i=o=(o+1)%e;break;case 4:c=2*e,n=s(),r=n.length,o=n.length,i=0,n.length=c,e=c,a(l)}},take:l,flush:s}}(e,4)},Jb="TAKE",ew="CALL",tw="FORK",nw="CANCEL",rw="SELECT",ow=function(e,t){var n;return(n={})[fb]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function iw(e,t){return void 0===e&&(e="*"),Ab(e)?(xb(t)&&console.warn("take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types"),ow(Jb,{pattern:e})):Mb(n=e)&&n[gb]&&xb(t)&&Ab(t)?ow(Jb,{channel:e,pattern:t}):Mb(e)?(xb(t)&&console.warn("take(channel) takes one argument but two were provided. Second argument is ignored."),ow(Jb,{channel:e})):void 0;var n}function aw(e,t){return Ob(t)&&(t=e,e=void 0),ow("PUT",{channel:e,action:t})}function lw(e){var t=ow("ALL",e);return t.combinator=!0,t}function sw(e,t){var n,r=null;return Sb(e)?n=e:(Cb(e)?(r=e[0],n=e[1]):(r=e.context,n=e.fn),r&&_b(n)&&Sb(r[n])&&(n=r[n])),{context:r,fn:n,args:t}}function cw(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 ow(ew,sw(e,n))}function uw(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 ow(tw,sw(e,n))}function dw(e){void 0===e&&(e=Rb);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ow(rw,{selector:e,args:n})}var pw=[],hw=0;function fw(e){try{vw(),e()}finally{yw()}}function mw(e){pw.push(e),hw||(vw(),bw())}function gw(e){try{return vw(),e()}finally{bw()}}function vw(){hw++}function yw(){hw--}function bw(){var e;for(yw();!hw&&void 0!==(e=pw.shift());)fw(e)}var ww=function(e){return function(t){return e.some(function(e){return Sw(e)(t)})}},kw=function(e){return function(t){return e(t)}},Ew=function(e){return function(t){return t.type===String(e)}},Ow=function(e){return function(t){return t.type===e}},xw=function(){return Ib};function Sw(e){var t="*"===e?xw:_b(e)?Ew:Cb(e)?ww:Nb(e)?Ew:Sb(e)?kw:Db(e)?Ow:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var _w={type:hb},Cw=function(e){return e&&e.type===hb};function Pw(){var e,t,n,r,o,i,a=(t=!1,r=n=[],o=function(){r===n&&(r=n.slice())},i=function(){t=!0;var e=n=r;r=[],e.forEach(function(e){e(_w)})},(e={})[gb]=!0,e.put=function(e){if(!t)if(Cw(e))i();else for(var o=n=r,a=0,l=o.length;a<l;a++){var s=o[a];s[mb](e)&&(s.cancel(),s(e))}},e.take=function(e,n){var i,a;void 0===n&&(n=xw),t?e(_w):(e[mb]=n,o(),r.push(e),e.cancel=(i=function(){o(),Fb(r,e)},a=!1,function(){a||(a=!0,i())}))},e.close=i,e),l=a.put;return a.put=function(e){e[vb]?l(e):mw(function(){l(e)})},a}function Tw(e,t){var n=e[pb];Sb(n)&&(t.cancel=n),e.then(t,function(e){t(e,!0)})}var Aw,Mw=0,Nw=function(){return++Mw};function Dw(e){e.isRunning()&&e.cancel()}var Iw=((Aw={})[Jb]=function(e,t,n){var r=t.channel,o=void 0===r?e.channel:r,i=t.pattern,a=t.maybe,l=function(e){e instanceof Error?n(e,!0):!Cw(e)||a?n(e):n(kb)};try{o.take(l,xb(i)?Sw(i):null)}catch(e){return void n(e,!0)}n.cancel=l.cancel},Aw.PUT=function(e,t,n){var r=t.channel,o=t.action,i=t.resolve;mw(function(){var t;try{t=(r?r.put:e.dispatch)(o)}catch(e){return void n(e,!0)}i&&Pb(t)?Tw(t,n):n(t)})},Aw.ALL=function(e,t,n,r){var o=r.digestEffect,i=Mw,a=Object.keys(t);if(0!==a.length){var l=Gb(t,n);a.forEach(function(e){o(t[e],i,l[e],e)})}else n(Cb(t)?[]:{})},Aw.RACE=function(e,t,n,r){var o=r.digestEffect,i=Mw,a=Object.keys(t),l=Cb(t)?Vb(a.length):{},s={},c=!1;a.forEach(function(e){var t=function(t,r){c||(r||$b(t)?(n.cancel(),n(t,r)):(n.cancel(),c=!0,l[e]=t,n(l)))};t.cancel=Lb,s[e]=t}),n.cancel=function(){c||(c=!0,a.forEach(function(e){return s[e].cancel()}))},a.forEach(function(e){c||o(t[e],i,s[e],e)})},Aw[ew]=function(e,t,n,r){var o=t.context,i=t.fn,a=t.args,l=r.task;try{var s=i.apply(o,a);if(Pb(s))return void Tw(s,n);if(Tb(s))return void qw(e,s,l.context,Mw,Yb(i),!1,n);n(s)}catch(e){n(e,!0)}},Aw.CPS=function(e,t,n){var r=t.context,o=t.fn,i=t.args;try{var a=function(e,t){Ob(e)?n(t):n(e,!0)};o.apply(r,i.concat(a)),a.cancel&&(n.cancel=a.cancel)}catch(e){n(e,!0)}},Aw[tw]=function(e,t,n,r){var o=t.context,i=t.fn,a=t.args,l=t.detached,s=r.task,c=function(e){var t=e.context,n=e.fn,r=e.args;try{var o=n.apply(t,r);if(Tb(o))return o;var i=!1;return Wb(function(e){return i?{value:e,done:!0}:(i=!0,{value:o,done:!Pb(o)})})}catch(e){return Wb(function(){throw e})}}({context:o,fn:i,args:a}),u=function(e,t){return e.isSagaIterator?{name:e.meta.name}:Yb(t)}(c,i);gw(function(){var t=qw(e,c,s.context,Mw,u,l,void 0);l?n(t):t.isRunning()?(s.queue.addTask(t),n(t)):t.isAborted()?s.queue.abort(t.error()):n(t)})},Aw.JOIN=function(e,t,n,r){var o=r.task,i=function(e,t){if(e.isRunning()){var n={task:o,cb:t};t.cancel=function(){e.isRunning()&&Fb(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())};if(Cb(t)){if(0===t.length)return void n([]);var a=Gb(t,n);t.forEach(function(e,t){i(e,a[t])})}else i(t,n)},Aw[nw]=function(e,t,n,r){var o=r.task;t===yb?Dw(o):Cb(t)?t.forEach(Dw):Dw(t),n()},Aw[rw]=function(e,t,n){var r=t.selector,o=t.args;try{n(r.apply(void 0,[e.getState()].concat(o)))}catch(e){n(e,!0)}},Aw.ACTION_CHANNEL=function(e,t,n){var r=t.pattern,o=function(e){void 0===e&&(e=Zb());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(_w):e.isEmpty()?(n.push(r),r.cancel=function(){Fb(n,r)}):r(e.take())},put:function(r){if(!t){if(0===n.length)return e.put(r);n.shift()(r)}},flush:function(n){t&&e.isEmpty()?n(_w):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var r=0,o=e.length;r<o;r++)(0,e[r])(_w)}}}}(t.buffer),i=Sw(r),a=function(t){Cw(t)||e.channel.take(a,i),o.put(t)},l=o.close;o.close=function(){a.cancel(),l()},e.channel.take(a,i),n(o)},Aw.CANCELLED=function(e,t,n,r){n(r.task.isCancelled())},Aw.FLUSH=function(e,t,n){t.flush(n)},Aw.GET_CONTEXT=function(e,t,n,r){n(r.task.context[t])},Aw.SET_CONTEXT=function(e,t,n,r){var o=r.task;jb(o.context,t),n()},Aw);function Lw(e,t){return e+"?"+t}function Rw(e){var t=e.name,n=e.location;return n?t+" "+Lw(n.fileName,n.lineNumber):t}function jw(e){var t,n,r=(t=e,(n=[]).concat.apply(n,t.map(function(e){return e.cancelledTasks})));return r.length?["Tasks cancelled due to error:"].concat(r).join("\n"):""}var Fw=null,zw=[],Bw=function(e){e.crashedEffect=Fw,zw.push(e)},Ww=function(){Fw=null,zw.length=0},Uw=function(e){Fw=e},Vw=function(){var e=zw[0],t=zw.slice(1),n=e.crashedEffect?function(e){var t=Xb(e);return t?t.code+" "+Lw(t.fileName,t.lineNumber):""}(e.crashedEffect):null;return["The above error occurred in task "+Rw(e.meta)+(n?" \n when executing effect "+n:"")].concat(t.map(function(e){return" created by "+Rw(e.meta)}),[jw(zw)]).join("\n")};function Hw(e,t,n,r,o,i,a){var l;void 0===a&&(a=Lb);var s,c,u=0,d=null,p=[],h=Object.create(n),f=function(e,t,n){var r,o=[],i=!1;function a(e){p.push.apply(p,f.getTasks().map(function(e){return e.meta.name})),s(),n(e,!0)}function l(t){o.push(t),t.cont=function(l,s){i||(Fb(o,t),t.cont=Lb,s?a(l):(t===e&&(r=l),o.length||(i=!0,n(r))))}}function s(){i||(i=!0,o.forEach(function(e){e.cont=Lb,e.cancel()}),o=[])}return l(e),{addTask:l,cancelAll:s,abort:a,getTasks:function(){return o}}}(t,0,m);function m(t,n){if(n){if(u=2,Bw({meta:o,cancelledTasks:p}),g.isRoot){var r=Vw();Ww(),e.onError(t,{sagaStack:r})}c=t,d&&d.reject(t)}else t===wb?u=1:1!==u&&(u=3),s=t,d&&d.resolve(t);g.cont(t,n),g.joiners.forEach(function(e){e.cb(t,n)}),g.joiners=null}var g=((l={})[bb]=!0,l.id=r,l.meta=o,l.isRoot=i,l.context=h,l.joiners=[],l.queue=f,l.cancel=function(){0===u&&(u=1,f.cancelAll(),m(wb,!1))},l.cont=a,l.end=m,l.setContext=function(e){jb(h,e)},l.toPromise=function(){return d||((e={}).promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),d=e,2===u?d.reject(c):0!==u&&d.resolve(s)),d.promise;var e},l.isRunning=function(){return 0===u},l.isCancelled=function(){return 1===u||0===u&&1===t.status},l.isAborted=function(){return 2===u},l.result=function(){return s},l.error=function(){return c},l);return g}function qw(e,t,n,r,o,i,a){var l=e.finalizeRunEffect(function(t,n,r){Pb(t)?Tw(t,r):Tb(t)?qw(e,t,c.context,n,o,!1,r):t&&t[fb]?(0,Iw[t.type])(e,t.payload,r,u):r(t)});d.cancel=Lb;var s={meta:o,cancel:function(){0===s.status&&(s.status=1,d(wb))},status:0},c=Hw(e,s,n,r,o,i,a),u={task:c,digestEffect:p};return a&&(a.cancel=c.cancel),d(),c;function d(e,n){try{var o;n?(o=t.throw(e),Ww()):Qb(e)?(s.status=1,d.cancel(),o=Sb(t.return)?t.return(wb):{done:!0,value:wb}):o=qb(e)?Sb(t.return)?t.return():{done:!0}:t.next(e),o.done?(1!==s.status&&(s.status=3),s.cont(o.value)):p(o.value,r,d)}catch(e){if(1===s.status)throw e;s.status=2,s.cont(e,!0)}}function p(t,n,r,o){void 0===o&&(o="");var i,a=Nw();function s(n,o){i||(i=!0,r.cancel=Lb,e.sagaMonitor&&(o?e.sagaMonitor.effectRejected(a,n):e.sagaMonitor.effectResolved(a,n)),o&&Uw(t),r(n,o))}e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:a,parentEffectId:n,label:o,effect:t}),s.cancel=Lb,r.cancel=function(){i||(i=!0,s.cancel(),s.cancel=Lb,e.sagaMonitor&&e.sagaMonitor.effectCancelled(a))},l(t,a,s)}}function Qw(e,t){for(var n=e.channel,r=void 0===n?Pw():n,o=e.dispatch,i=e.getState,a=e.context,l=void 0===a?{}:a,s=e.sagaMonitor,c=e.effectMiddlewares,u=e.onError,d=void 0===u?Ub:u,p=arguments.length,h=new Array(p>2?p-2:0),f=2;f<p;f++)h[f-2]=arguments[f];var m,g=t.apply(void 0,h),v=Nw();if(s&&(s.rootSagaStarted=s.rootSagaStarted||Lb,s.effectTriggered=s.effectTriggered||Lb,s.effectResolved=s.effectResolved||Lb,s.effectRejected=s.effectRejected||Lb,s.effectCancelled=s.effectCancelled||Lb,s.actionDispatched=s.actionDispatched||Lb,s.rootSagaStarted({effectId:v,saga:t,args:h})),c){var y=Kb.apply(void 0,c);m=function(e){return function(t,n,r){return y(function(t){return e(t,n,r)})(t)}}}else m=Rb;var b={channel:r,dispatch:Hb(o),getState:i,sagaMonitor:s,onError:d,finalizeRunEffect:m};return gw(function(){var e=qw(b,g,l,v,Yb(t),!0,void 0);return s&&s.effectResolved(v,e),e})}var $w=["context","channel","sagaMonitor"];var Gw,Yw=({dispatch:e,getState:t})=>n=>r=>"function"==typeof r?r(e,t,Gw):n(r),Xw=function(e){return{done:!0,value:e}},Kw={};function Zw(e){return Mb(e)?"channel":Nb(e)?String(e):Sb(e)?e.name:String(e)}function Jw(e,t,n){var r,o,i,a=t;function l(t,n){if(a===Kw)return Xw(t);if(n&&!o)throw a=Kw,n;r&&r(t);var l=n?e[o](n):e[a]();return a=l.nextState,i=l.effect,r=l.stateUpdater,o=l.errorState,a===Kw?Xw(t):i}return Wb(l,function(e){return l(null,e)},n)}function ek(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i,a={done:!1,value:iw(e)},l=function(e){return i=e};return Jw({q1:function(){return{nextState:"q2",effect:a,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:(e=i,{done:!1,value:uw.apply(void 0,[t].concat(r,[e]))})};var e}},"q1","takeEvery("+Zw(e)+", "+t.name+")")}function tk(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i,a,l={done:!1,value:iw(e)},s=function(e){return{done:!1,value:uw.apply(void 0,[t].concat(r,[e]))}},c=function(e){return{done:!1,value:(t=e,void 0===t&&(t=yb),ow(nw,t))};var t},u=function(e){return i=e},d=function(e){return a=e};return Jw({q1:function(){return{nextState:"q2",effect:l,stateUpdater:d}},q2:function(){return i?{nextState:"q3",effect:c(i)}:{nextState:"q1",effect:s(a),stateUpdater:u}},q3:function(){return{nextState:"q1",effect:s(a),stateUpdater:u}}},"q1","takeLatest("+Zw(e)+", "+t.name+")")}function nk(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return uw.apply(void 0,[ek,e,t].concat(r))}function rk(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return uw.apply(void 0,[tk,e,t].concat(r))}var ok=["type"],ik=xi().mark(lk);function ak(e){return e.type,Wn(e,ok),xi().mark(function e(){var t,n,r;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/dependencies");case 1:if(t=e.sent,n=t.response,t.error,!n){e.next=2;break}return e.next=2,aw(yv({dependencies:n}));case 2:e.next=4;break;case 3:e.prev=3,r=e.catch(0),console.error("DEPENDENCIES ERROR: ",r);case 4:case"end":return e.stop()}},e,null,[[0,3]])})()}function lk(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Lr,ak);case 1:case"end":return e.stop()}},ik)}var sk=["type"],ck=xi().mark(dk);function uk(e){return e.type,Wn(e,sk),xi().mark(function e(){var t,n;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/tags");case 1:if(t=e.sent,n=t.response,t.error,!n){e.next=2;break}return e.next=2,aw(bv({tags:n}));case 2:e.next=4;break;case 3:e.prev=3,e.catch(0);case 4:case"end":return e.stop()}},e,null,[[0,3]])})()}function dk(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(jr,uk);case 1:case"end":return e.stop()}},ck)}var pk=["type"],hk=xi().mark(mk);function fk(e){e.type;var t=Wn(e,pk);return xi().mark(function e(){var n,r,o,i,a,l,s,c,u,d,p,h,f,m,g;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=t.key,r=t.data,!(o={tags:"tags",dependencies:"dependencies",activeFilter:"activeFilter",template_type_id:"templateType",category_id:"category"}).hasOwnProperty(n)){e.next=8;break}if(i=[],a=cb(),l=o[n],"dependencies"!==n){e.next=1;break}a.exclude=r.exclude.join(","),a.include=r.include.join(","),0===r.exclude.length&&i.push("exclude"),0===r.include.length&&i.push("include"),e.next=7;break;case 1:if("tags"!==n){e.next=2;break}a.tags=r.join(","),e.next=7;break;case 2:if("template_type_id"!==n){e.next=4;break}return e.next=3,dw(function(e){var t,n;return{types:null!==(t=null===(n=e.general.templateTypes)||void 0===n?void 0:n.lists)&&void 0!==t?t:[]}});case 3:s=e.sent,c=s.types,u=c.find(function(e){return e.id===r}),a[l]=(null==u?void 0:u.slug)||"all",e.next=7;break;case 4:if("category_id"!==n){e.next=6;break}return e.next=5,dw(function(e){var t,n;return{categories:null!==(t=null===(n=e.general.categories)||void 0===n?void 0:n.lists)&&void 0!==t?t:[]}});case 5:d=e.sent,p=d.categories,h=p.find(function(e){return e.id===r}),a[l]=(null==h?void 0:h.slug)||"all",e.next=7;break;case 6:a[l]=r;case 7:null!=a&&a[l]||i.push(l),f=ub(a.path,a,i),(m=lb().location).actualPathname+m.search!==f&&lb().push(f,{resetFilter:!1});case 8:e.next=10;break;case 9:e.prev=9,g=e.catch(0),console.error("FILTER ERROR: ",g);case 10:case"end":return e.stop()}},e,null,[[0,9]])})()}function mk(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Dr,fk);case 1:case"end":return e.stop()}},hk)}var gk=["type"],vk=["type"],yk=xi().mark(kk);function bk(e){e.type;var t=Wn(e,gk);return xi().mark(function e(){var n,r;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,dw(function(e){var n,r;return{typeLists:null!==(n=null===(r=e.general.templateTyps)||void 0===r||null===(r=r.lists)||void 0===r?void 0:r[null==t?void 0:t.itemType])&&void 0!==n?n:[]}});case 1:if(!(e.sent.typeLists.length>0)){e.next=2;break}return e.abrupt("return");case 2:return e.next=3,ba("/templately/v1/templateTypes",t);case 3:if(n=e.sent,r=n.response,n.error,!r){e.next=4;break}return e.next=4,aw(wv({types:r}));case 4:e.next=6;break;case 5:e.prev=5,e.catch(0);case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function wk(e){return e.type,Wn(e,vk),xi().mark(function e(){var t,n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,ba("/templately/v1/pricing");case 1:if(t=e.sent,n=t.response,r=t.error,!n){e.next=3;break}return e.next=2,aw(kv(n));case 2:return e.abrupt("return");case 3:if(!r){e.next=4;break}return e.next=4,aw(Ev({code:null!==(o=null==r?void 0:r.code)&&void 0!==o?o:"pricing_fetch_failed",message:null==r?void 0:r.message,additional_errors:null==r?void 0:r.additional_errors}));case 4:case"end":return e.stop()}},e)})()}function kk(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(br,wk);case 1:return e.next=2,rk(zr,bk);case 2:case"end":return e.stop()}},yk)}var Ek=["type"],Ok=["type"],xk=["type"],Sk=["type"],_k=["type"],Ck=xi().mark(Lk);function Pk(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 Tk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pk(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ak(e){e.type;var t=Wn(e,Ek);return xi().mark(function e(){var n,r,o,i,a,l,s,c,u,d,p;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.platform,r=t.itemType,o=t.plan,i=t.page,e.next=1,dw(function(e){var t,a,l;return{favLists:null!==(t=null===(a=e.profile.favourites)||void 0===a||null===(a=a[o])||void 0===a||null===(a=a[n])||void 0===a||null===(a=a[r])||void 0===a?void 0:a[i])&&void 0!==t?t:[],totalPage:null===(l=e.profile.favourites)||void 0===l||null===(l=l[o])||void 0===l||null===(l=l[n])||void 0===l||null===(l=l[r])||void 0===l?void 0:l.totalPage}});case 1:if(a=e.sent,l=a.favLists,s=a.totalPage,!((null==l?void 0:l.length)>0)){e.next=3;break}return e.next=2,aw(Yi({data:l,current_page:i,total_page:s,platform:n,itemType:r,plan:o}));case 2:return e.abrupt("return");case 3:return e.next=4,ba("/templately/v1/profile/my-favourites",t);case 4:if(c=e.sent,u=c.response,d=c.error,!u){e.next=7;break}if(!0!==(null==u?void 0:u.redirect)){e.next=6;break}return e.next=5,aw(_v(u));case 5:e.next=7;break;case 6:return e.next=7,aw(Yi(Tk(Tk({},u),{},{platform:n,itemType:r,plan:o})));case 7:if(!d){e.next=8;break}return console.error("Error: P100",d),e.next=8,aw(Xi(d));case 8:e.next=10;break;case 9:e.prev=9,p=e.catch(0),console.error("Error: P100",p);case 10:case"end":return e.stop()}},e,null,[[0,9]])})()}function Mk(e){var t=e.type,n=Wn(e,Ok);return xi().mark(function e(){var r,o,i,a;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,dw(function(e){return null!==e.profile.data});case 1:if(e.sent){e.next=2;break}return e.abrupt("return");case 2:return e.next=3,ba("/templately/v1/profile/download-history",n);case 3:if(r=e.sent,o=r.response,i=r.error,!o){e.next=6;break}if(!0!==(null==o?void 0:o.redirect)||t===br){e.next=5;break}return e.next=4,aw(_v(o));case 4:e.next=6;break;case 5:return e.next=6,aw(ca(o));case 6:if(!i){e.next=7;break}return console.error("Error P101: ",i),e.next=7,aw(ua(i));case 7:e.next=9;break;case 8:return e.prev=8,a=e.catch(0),console.error("Error P101: ",a),e.next=9,aw(ua(a));case 9:case"end":return e.stop()}},e,null,[[0,8]])})()}function Nk(e){return e.type,Wn(e,xk),xi().mark(function e(){var t,n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/profile/sync");case 1:if(t=e.sent,n=t.response,r=t.error,!n){e.next=4;break}if("success"!=(null==n?void 0:n.status)){e.next=3;break}return e.next=2,aw(Wi(null==n?void 0:n.user));case 2:Al({icon:"success",timer:2e3,html:React.createElement(i_,{title:(0,At.__)("Successfully Synced Account","templately")})},!1);case 3:if("error"!=(null==n?void 0:n.status)){e.next=4;break}return e.next=4,aw(Ui({code:"sync_failed",message:n.message}));case 4:if(!r){e.next=5;break}return e.next=5,aw(Ui({code:"sync_failed",message:r}));case 5:e.next=8;break;case 6:return e.prev=6,o=e.catch(0),e.next=7,aw(Ui({code:"sync_failed",message:o}));case 7:console.error("Sync Error: ",o);case 8:case"end":return e.stop()}},e,null,[[0,6]])})()}function Dk(e){return e.type,Wn(e,Sk),xi().mark(function e(){var t,n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,aw({type:Or});case 1:return e.next=2,ba("/templately/v1/profile/verified");case 2:if(t=e.sent,n=t.response,r=t.error,null==n){e.next=3;break}return e.next=3,aw($i({is_verified:n}));case 3:if(!r){e.next=4;break}return console.error("Sync Error: ",r),e.next=4,aw($i({is_verified:!1}));case 4:e.next=6;break;case 5:return e.prev=5,o=e.catch(0),console.error("Sync Error: ",o),e.next=6,aw($i({is_verified:!1}));case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function Ik(e){var t=e.type,n=Wn(e,_k);return xi().mark(function e(){var r,o,i,a,l,s;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,dw(function(e){return null!==e.profile.data});case 1:if(e.sent){e.next=2;break}return e.abrupt("return");case 2:return"APPLICATION_SET_PLATFORM"==t&&(n=Tk(Tk({},n),{},{all:!0})),e.next=3,ba("/templately/v1/profile/purchased-items",n);case 3:if(r=e.sent,o=r.response,i=r.error,t===br){e.next=4;break}if(!0!==(null==o?void 0:o.redirect)){e.next=4;break}return e.next=4,aw(_v(o));case 4:if(!o||"APPLICATION_SET_PLATFORM"!=t){e.next=5;break}return l={},(null==o||null===(a=o.data)||void 0===a?void 0:a.length)>0&&(null==o||o.data.map(function(e){l[e.type]=null==(null==l?void 0:l[e.type])?[e.item_id]:[].concat(Ul(null==l?void 0:l[e.type]),[e.item_id])})),e.next=5,aw(Ki({data:l}));case 5:if(!o||"APPLICATION_SET_PLATFORM"==t){e.next=6;break}return e.next=6,aw(Ji(o));case 6:if(!i||"APPLICATION_SET_PLATFORM"==t){e.next=7;break}return console.error("Error P103: ",i),e.next=7,aw(ea(i));case 7:e.next=9;break;case 8:if(e.prev=8,s=e.catch(0),console.error("Error P103: ",s),"APPLICATION_SET_PLATFORM"==t){e.next=9;break}return e.next=9,aw(ea(s));case 9:case"end":return e.stop()}},e,null,[[0,8]])})()}function Lk(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(no,Ak);case 1:return e.next=2,rk(go,Mk);case 2:return e.next=3,rk(Jr,Nk);case 3:return e.next=4,rk(eo,Dk);case 4:return e.next=5,rk(wo,Ik);case 5:return e.next=6,rk(br,Ik);case 6:return e.next=7,rk(br,Mk);case 7:case"end":return e.stop()}},Ck)}var Rk=["type"],jk=["type","isGloballySigned"],Fk=["type"],zk=["type"],Bk=xi().mark(qk);function Wk(e){return e.type,Wn(e,Rk),xi().mark(function e(){var t,n,r,o,i,a,l,s;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=null,e.next=1,dw(function(e){var t,n,r,o,i;return{user:null!==(t=null!==(n=null===(r=e.profile)||void 0===r?void 0:r.prevData)&&void 0!==n?n:null===(o=e.profile)||void 0===o?void 0:o.data)&&void 0!==t?t:null,error:null!==(i=e.profile.error)&&void 0!==i?i:null}});case 1:if(n=e.sent,r=n.user,o=n.error,t=o,!r){e.next=3;break}return e.next=2,aw(Wi(r));case 2:return e.abrupt("return");case 3:if(null!=r){e.next=7;break}return e.next=4,ba("/templately/v1/is-signed");case 4:if(i=e.sent,a=i.response,l=i.error,t=l,!a||null===(null==a?void 0:a.user)){e.next=6;break}return e.next=5,aw(Wi(null==a?void 0:a.user));case 5:e.next=7;break;case 6:return e.next=7,aw(Ui({code:"is_signed_failed",message:t}));case 7:if(!t){e.next=8;break}return e.next=8,aw(Ui({code:"is_signed_failed",message:t}));case 8:e.next=10;break;case 9:return e.prev=9,s=e.catch(0),e.next=10,aw(Ui({code:"is_signed_failed",message:s}));case 10:case"end":return e.stop()}},e,null,[[0,9]])})()}function Uk(e){e.type;var t=e.isGloballySigned;return Wn(e,jk),xi().mark(function e(){var n,r,o,i,a;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wa("/templately/v1/logout");case 1:if(n=e.sent,r=n.response,o=n.error,!r){e.next=3;break}if("success"!=(null==r?void 0:r.status)){e.next=3;break}return e.next=2,aw(Bi({isGloballySigned:t,global_user:null!==(i=null==r?void 0:r.global_user)&&void 0!==i?i:void 0}));case 2:return e.abrupt("return");case 3:if(!o){e.next=4;break}return e.next=4,aw(Ui({code:"logout_failed",message:o}));case 4:e.next=6;break;case 5:return e.prev=5,a=e.catch(0),e.next=6,aw(Ui({code:"logout_failed",message:a}));case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function Vk(e){e.type;var t=Wn(e,Fk);return xi().mark(function e(){var n,r,o,i;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wa("/templately/v1/login",t);case 1:if(n=e.sent,r=n.response,o=n.error,!r){e.next=3;break}if("success"!==(null==r?void 0:r.status)){e.next=2;break}return e.next=2,aw(Wi(null==r?void 0:r.user));case 2:if("error"!==(null==r?void 0:r.status)){e.next=3;break}return e.next=3,aw(Ui({code:"login_failed",message:r.message}));case 3:if(!o){e.next=4;break}return e.next=4,aw(Ui({code:"login_failed",message:o}));case 4:e.next=6;break;case 5:return e.prev=5,i=e.catch(0),e.next=6,aw(Ui({code:"login_failed",message:i}));case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function Hk(e){e.type;var t=Wn(e,zk);return xi().mark(function e(){var n,r,o,i,a;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wa("/templately/v1/signup",t);case 1:if(n=e.sent,r=n.response,o=n.error,!r){e.next=3;break}if("success"!=(null==r?void 0:r.status)){e.next=2;break}return e.next=2,aw(Vi(null==r?void 0:r.user));case 2:if("error"!=(null==r?void 0:r.status)){e.next=3;break}return e.next=3,aw(Hi({code:"signup_failed",message:r.message,additional_errors:r.additional_errors}));case 3:if(!o){e.next=4;break}return e.next=4,aw(Hi({code:null!==(i=null==o?void 0:o.code)&&void 0!==i?i:"signup_failed",message:null==o?void 0:o.message,additional_errors:null==o?void 0:o.additional_errors}));case 4:e.next=6;break;case 5:return e.prev=5,a=e.catch(0),e.next=6,aw(Hi({code:"signup_failed",message:a}));case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function qk(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,nk($o.LOAD,Wk);case 1:return e.next=2,nk(to,Wk);case 2:return e.next=3,rk(_r,Vk);case 3:return e.next=4,rk(Tr,Hk);case 4:return e.next=5,rk(xr,Uk);case 5:case"end":return e.stop()}},Bk)}var Qk=["type"],$k=xi().mark(Yk);function Gk(e){return e.type,Wn(e,Qk),xi().mark(function e(){var t,n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,dw(function(e){var t,n;return{categoryLists:null!==(t=null===(n=e.general.categories)||void 0===n?void 0:n.lists)&&void 0!==t?t:[]}});case 1:if(!(e.sent.categoryLists.length>0)){e.next=2;break}return e.abrupt("return");case 2:return e.next=3,ba("/templately/v1/categories");case 3:if(t=e.sent,n=t.response,r=t.error,!n){e.next=4;break}return e.next=4,aw(Ov({categories:n}));case 4:if(!r){e.next=5;break}return e.next=5,aw(xv({error:r}));case 5:e.next=7;break;case 6:return e.prev=6,o=e.catch(0),e.next=7,aw(xv({error:o}));case 7:case"end":return e.stop()}},e,null,[[0,6]])})()}function Yk(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Vr,Gk);case 1:case"end":return e.stop()}},$k)}var Xk=["type"],Kk=xi().mark(Jk);function Zk(e){e.type;var t=Wn(e,Xk);return xi().mark(function e(){var n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wa("/templately/v1/dependencies/check",t);case 1:return n=e.sent,r=n.response,n.error,e.abrupt("return",r);case 2:e.prev=2,o=e.catch(0),console.error("Error D101: ",o);case 3:case"end":return e.stop()}},e,null,[[0,2]])})()}function Jk(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk("APPLICATION_CHECK_DEPENDENCIES",Zk);case 1:case"end":return e.stop()}},Kk)}var eE=["type"],tE=["type"],nE=xi().mark(iE);function rE(e){e.type;var t=Wn(e,eE);return xi().mark(function e(){var n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/conditions",t);case 1:if(n=e.sent,r=n.response,n.error,!r){e.next=3;break}return e.next=2,aw(Cv(r.config));case 2:if(null==(null==r?void 0:r.template_conditions)){e.next=3;break}return e.next=3,aw(Pv(t.template_id,r.template_conditions));case 3:e.next=5;break;case 4:e.prev=4,o=e.catch(0),console.error("Condition Failed",o);case 5:case"end":return e.stop()}},e,null,[[0,4]])})()}function oE(e){e.type;var t=Wn(e,tE);return xi().mark(function e(){var n,r,o,i,a;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.id,e.next=1,dw(function(e){return e.conditions.conditionsForSave[n]});case 1:return r=e.sent,e.next=2,wa("/templately/v1/save-conditions",{template_id:n,conditions:null!=r?r:[]});case 2:o=e.sent,i=o.response,o.error,i&&window.TemplatelyAppManager.close("templately-edit-conditions-app"),e.next=4;break;case 3:e.prev=3,a=e.catch(0),console.error("Condition Failed",a);case 4:case"end":return e.stop()}},e,null,[[0,3]])})()}function iE(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk($r,rE);case 1:return e.next=2,rk(Xr,oE);case 2:case"end":return e.stop()}},nE)}var aE=["type"],lE=xi().mark(pE),sE=xi().mark(mE);function cE(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 uE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cE(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dE(e){var t=e.payload;return xi().mark(function e(){var n,r,o,i,a,l,s,c,u,d,p;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.packId,r=t.isAi,o={id:n,isAi:r,action:"templately_pack_import_info",nonce:window.templately.nonce},i=(0,Ci.addQueryArgs)(window.ajaxurl,o),e.next=1,cw(ba,i,{});case 1:if(a=e.sent,l=a.response,!(s=a.error)){e.next=3;break}return e.next=2,aw(Qy(s.data.message));case 2:e.next=5;break;case 3:return c=l.data,e.next=4,aw(qy(c));case 4:return u=c.credit_balance,d=c.estimated_cost,e.next=5,aw(By(uE(uE({},u),{},{estimated_cost:d})));case 5:e.next=7;break;case 6:return e.prev=6,p=e.catch(0),e.next=7,aw(Qy(p.message));case 7:case"end":return e.stop()}},e,null,[[0,6]])})()}function pE(){var e,t,n,r,o,i;return xi().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e={action:"templately_pack_google_font",nonce:window.templately.nonce},t=(0,Ci.addQueryArgs)(window.ajaxurl,e),a.next=1,cw(ba,t,{});case 1:if(n=a.sent,r=n.response,!(o=n.error)){a.next=3;break}return a.next=2,aw(Gy(o));case 2:a.next=4;break;case 3:return a.next=4,aw($y(r));case 4:a.next=6;break;case 5:return a.prev=5,i=a.catch(0),a.next=6,aw(Gy(i.message));case 6:case"end":return a.stop()}},lE,null,[[0,5]])}function hE(e){var t=e.payload;return xi().mark(function e(){var n,r;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=t.id){e.next=1;break}return console.error("Pack ID is missing for AI sidebar"),e.abrupt("return");case 1:return e.next=2,aw(Hy(n,!0));case 2:e.next=4;break;case 3:e.prev=3,r=e.catch(0),console.error("Error in handleShowAiSidebar:",r);case 4:case"end":return e.stop()}},e,null,[[0,3]])})()}function fE(e){return e.type,Wn(e,aE),xi().mark(function e(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)})()}function mE(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,lw([rk("FULL_SITE_IMPORT_START",fE),rk(ai,hE),rk(pi,dE),rk(mi,pE)]);case 1:case"end":return e.stop()}},sE)}var gE=["type"],vE=xi().mark(bE);function yE(e){e.type;var t=Wn(e,gE);return xi().mark(function e(){var n,r,o,i;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wa("/templately/v1/items/favourite",t);case 1:if(n=e.sent,r=n.response,o=n.error,"success"!==(null==r?void 0:r.status)){e.next=4;break}return e.next=2,aw(oa());case 2:return e.next=3,aw(ta({starred:r.data}));case 3:e.next=5;break;case 4:if("error"!==(null==r?void 0:r.status)){e.next=5;break}return e.next=5,aw(ia({error:r.message||"Failed to update favourite"}));case 5:if(!o){e.next=6;break}return console.error("Error P102: ",o),e.next=6,aw(ia({error:o.message||"Failed to update favourite"}));case 6:e.next=8;break;case 7:return e.prev=7,i=e.catch(0),console.error("Error P102: ",i),e.next=8,aw(ia({error:i.message||"Failed to update favourite"}));case 8:case"end":return e.stop()}},e,null,[[0,7]])})()}function bE(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(co,yE);case 1:case"end":return e.stop()}},vE)}var wE=["type"],kE=xi().mark(OE);function EE(e){e.type;var t=Wn(e,wE);return xi().mark(function e(){var n,r,o,i;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wa("/templately/v1/items/rating",t);case 1:if(n=e.sent,r=n.response,o=n.error,"success"!==(null==r?void 0:r.status)){e.next=3;break}return e.next=2,aw(aa());case 2:return e.next=3,aw(na({reviews:r.data.reviews}));case 3:if(!o){e.next=4;break}return console.error("Error P102: ",o),e.next=4,aw(la({error:o.message||"Failed to update rating"}));case 4:e.next=6;break;case 5:return e.prev=5,i=e.catch(0),console.error("Error P102: ",i),e.next=6,aw(la({error:i.message||"Failed to update rating"}));case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function OE(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(ho,EE);case 1:case"end":return e.stop()}},kE)}var xE=["type"],SE=["type"],_E=["type"],CE=xi().mark(DE);function PE(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 TE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PE(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AE(e){e.type;var t=Wn(e,xE);return xi().mark(function e(){var n,r,o,i,a,l;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,dw(function(e){var n,r,o,i=e.general.platform;return{items:null!==(n=(null===(r=e.savedTemplates)||void 0===r?void 0:r[i])&&(null===(o=e.savedTemplates)||void 0===o||null===(o=o[i])||void 0===o?void 0:o[null==t?void 0:t.page]))&&void 0!==n?n:null}});case 1:if(null===e.sent.items){e.next=3;break}return e.next=2,aw(Ty());case 2:return e.abrupt("return");case 3:return e.next=4,ba("/templately/v1/saved-templates",t);case 4:if(r=e.sent,o=r.response,r.error,!(o&&(null==o||null===(n=o.items)||void 0===n?void 0:n.length)>=0)){e.next=7;break}return e.next=5,aw(Ay({platform:"elementor",data:null!==(i=null==o?void 0:o.items)&&void 0!==i?i:[],currentPage:null!==(a=null==o?void 0:o.current_page)&&void 0!==a?a:1,totalPage:null!==(l=null==o?void 0:o.total_page)&&void 0!==l?l:1}));case 5:return e.next=6,aw(Ly({has_elementor:null==o?void 0:o.has_elementor,has_elementor_pro:null==o?void 0:o.has_elementor_pro}));case 6:e.next=8;break;case 7:return e.next=8,aw(My({platform:"elementor",data:"Something went wrong."}));case 8:e.next=10;break;case 9:e.prev=9,e.catch(0);case 10:case"end":return e.stop()}},e,null,[[0,9]])})()}function ME(e){e.type;var t=Wn(e,SE);return xi().mark(function e(){var n,r,o,i,a,l;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wa("/templately/v1/saved-templates/delete",t);case 1:if(n=e.sent,r=n.response,o=n.error,i={key:"isDeleted",error:{title:(0,At.__)("Something went wrong.","templately"),content:""},success:{title:null==r?void 0:r.message,content:""}},!r||"success"!==(null==r?void 0:r.status)){e.next=4;break}return e.next=2,aw(Py());case 2:if(null!=r&&r.is_kit){e.next=3;break}return Al({icon:"success",timer:1500,html:React.createElement(i_,re({},i.success,{contentArgs:r}))},!0),e.abrupt("return");case 3:Tl.close({isDeleted:!0,message:null==r?void 0:r.message}),e.next=5;break;case 4:return null!=o&&o.message&&Al({icon:"error",timer:1500,html:React.createElement(i_,{title:o.message})},!0),e.abrupt("return");case 5:"cant_delete_kit"===(null==o?void 0:o.code)?Al({onConfirm:function(e){return Ml(i,e)},html:React.createElement(Qu,{id:null==o||null===(a=o.data)||void 0===a?void 0:a.id})},!0):"invalid_permission"===(null==o?void 0:o.code)&&Al({icon:"error",timer:1500,html:React.createElement(i_,{title:o.message})},!0),e.next=7;break;case 6:e.prev=6,l=e.catch(0),console.error("ST501","Saved Template Deleting Error.",l);case 7:case"end":return e.stop()}},e,null,[[0,6]])})()}function NE(e){e.type;var t=Wn(e,_E);return xi().mark(function e(){var n,r,o,i;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,dw(function(e){var n,r,o,i=e.general.platform;return{items:null!==(n=(null===(r=e.savedTemplates)||void 0===r?void 0:r[i])&&(null===(o=e.savedTemplates)||void 0===o||null===(o=o[i])||void 0===o?void 0:o[null==t?void 0:t.page]))&&void 0!==n?n:null,platform:i}});case 1:if(n=e.sent,r=n.items,o=n.platform,!(r.length>0)){e.next=2;break}return i=r.map(function(e){return TE(TE({},e),{},{is_pushed:e.is_pushed?e.is_pushed:e.id===t.id})}),e.next=2,aw(Ay({platform:o,data:null!=i?i:[],currentPage:null==t?void 0:t.page}));case 2:e.next=4;break;case 3:e.prev=3,e.catch(0);case 4:case"end":return e.stop()}},e,null,[[0,3]])})()}function DE(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Uo,AE);case 1:return e.next=2,rk(Qo,ME);case 2:return e.next=3,rk($o.PUSHED,NE);case 3:case"end":return e.stop()}},CE)}var IE=["type"],LE=xi().mark(jE);function RE(e){return e.type,Wn(e,IE),xi().mark(function e(){var t,n,r,o,i,a,l,s;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,aw({type:$o.STATUS_REQUEST});case 1:return e.next=2,ba("/templately/v1/clouds/usage");case 2:if(t=e.sent,n=t.response,r=t.error,"error"!==(null==n?void 0:n.status)){e.next=3;break}return e.next=3,aw(qv({error:{message:null==n?void 0:n.message}}));case 3:if("success"!==(null==n?void 0:n.status)){e.next=4;break}if(!(i=null!==(o=n&&JSON.parse(null==n?void 0:n.data))&&void 0!==o?o:{})){e.next=4;break}return e.next=4,aw(Hv({limit:null!==(a=null==i?void 0:i.limit)&&void 0!==a?a:0,usages:null!==(l=null==i?void 0:i.files)&&void 0!==l?l:0}));case 4:if(!r){e.next=5;break}return e.next=5,aw(qv({error:r}));case 5:e.next=7;break;case 6:return e.prev=6,s=e.catch(0),e.next=7,aw(qv({error:s}));case 7:case"end":return e.stop()}},e,null,[[0,6]])})()}function jE(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Cr,RE);case 1:return e.next=2,rk($o.LOAD,RE);case 2:return e.next=3,rk(go,RE);case 3:return e.next=4,rk(no,RE);case 4:return e.next=5,rk(wo,RE);case 5:return e.next=6,rk(Go.LOAD,RE);case 6:return e.next=7,rk(Yo.LOAD,RE);case 7:return e.next=8,rk(Xo.LOAD,RE);case 8:case"end":return e.stop()}},LE)}const FE=function(e){var t=(0,oe.useRef)(null);return(0,oe.useLayoutEffect)(function(){t.current=e}),(0,oe.useCallback)(function(){return t.current.apply(void 0,arguments)},[])};var zE=["action"];function BE(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 WE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BE(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UE(e,t){return{type:e,message:t,progress:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,status:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"waiting"}}var VE=0,HE=0,qE=function(){return Rd(function e(t){var n=this;Id(this,e),this.session_id=new URLSearchParams(t).get("session_id"),this.url=window.ajaxurl+"?action=templately_pack_import_status&session_id="+this.session_id+"&isNetworkAdmin="+window.templately.isNetworkAdmin,this.onmessage=null,this.onerror=null,this.isClosed=!1,this.progressInterval=1e3,this.noLogCount=0,fetch(t+"&ic="+HE+++"&li="+VE).catch(function(e){n.onerror&&n.onerror(e)}),this.fetchProgress()},[{key:"fetchProgress",value:function(){var e=this;!0!==this.isClosed&&fetch(this.url+"&nonce="+window.templately.nonce+"&lastLogIndex="+VE).then(function(e){return e.json()}).then(function(t){var n;if(e.onmessage&&!e.isClosed&&t.log.length){var r,o=t.log.some(function(e){return"error"===e.action});if(VE+=null!==(r=t.log.length)&&void 0!==r?r:0,e.isClosed)return;for(var i=0;i<t.log.length;i++)if(!["continue","error"].includes(t.log[i].action)||i+1===t.log.length){var a={data:JSON.stringify(t.log[i])};e.onmessage(a)}if(o)return void e.close()}var l,s,c=(null===(n=t.log)||void 0===n?void 0:n[t.log.length-1])||{};e.isClosed||["complete","downloadComplete","error"].includes(c.action)||(null!==(l=t.log)&&void 0!==l&&l.length&&0!==(null===(s=t.log)||void 0===s?void 0:s.length)?(e.noLogCount=0,e.progressInterval=1e3):e.noLogCount++,e.noLogCount>=5&&e.progressInterval<5e3&&(e.noLogCount=0,e.progressInterval+=500),setTimeout(function(){e.isClosed||e.fetchProgress()},e.progressInterval))}).catch(function(t){e.onerror&&e.onerror(t)})}},{key:"close",value:function(){this.isClosed=!0}},{key:"addEventListener",value:function(e,t){}}])}();const QE=function(e){var t=pe((0,oe.useState)([]),2),n=t[0],r=t[1],o=pe((0,oe.useState)({}),2),i=o[0],a=(o[1],(0,oe.useRef)(null)),l=(0,oe.useRef)(null),s=pe((0,oe.useState)(!1),2),c=s[0],u=s[1],d=pe((0,oe.useState)(!1),2),p=d[0],h=d[1],f=pe((0,oe.useState)(!1),2),m=f[0],g=f[1],v=(0,oe.useRef)(0),y=(0,oe.useCallback)(function(e){r(function(t){var n=t.map(function(t){var n;return(null==e?void 0:e.type)===(null==t?void 0:t.type)?WE(WE(WE({},t),e),{},{status:null!==(n=e.status)&&void 0!==n?n:100===e.progress?"complete":"processing"}):"error"===(null==e?void 0:e.type)&&"complete"!==t.status?WE(WE({},t),{},{status:e.status}):t});if(!w(e,n))if(null!=e&&e.position){var r=n.findIndex(function(t){return t.type===(null==e?void 0:e.position)});r>=0&&n.splice(r+1,0,WE({status:"processing"},e))}else n.push(WE({status:"processing"},e));return n})},[n]),b=(0,oe.useCallback)(function(){r(function(e){return e.filter(function(e){return"error"!==e.type}).map(function(e){return"error"===e.status?WE(WE({},e),{},{status:"processing"}):e})})},[n]),w=function(e,t){var n;return 1===(null==t||null===(n=t.filter(function(t){return t.type===e.type}))||void 0===n?void 0:n.length)},k=function(e){return r(function(t){return t.filter(function(t){return t.type!==e.type})})},E=function(e){var t,n,r=null===(t=e)||void 0===t?void 0:t.session_id,o=null===(n=e)||void 0===n?void 0:n.is_lightspeed,i=o?qE:EventSource;g(!1),u(!0);var s=new i((0,Ci.addQueryArgs)(window.ajaxurl,{action:"templately_pack_import",nonce:window.templately.nonce,session_id:r,is_lightspeed:o,isNetworkAdmin:window.templately.isNetworkAdmin}));a.current=s,s.addEventListener("log",function(){});var c=function(t){v.current+=1,null==t||t.preventDefault(),b(),t&&v.current>=7&&(e=WE(WE({},e),{},{is_lightspeed:!0})),s.close(),E(e)};s.onmessage=function(t){s.clearTimeout(),k({type:"error"});var n=JSON.parse(t.data),r=n.action,o=Wn(n,zE);switch(r){case"error":s.close(),null!=o&&o.retry&&v.current<5?c():(u(!1),g(!0),requestAnimationFrame(function(){y(WE(WE({},o),{},{handleRetry:c}))}));break;case"updateLog":default:requestAnimationFrame(function(){y(o)});break;case"removeLog":requestAnimationFrame(function(){k(o)});break;case"complete":u(!1),h(o),s.close();break;case"continue":s.close(),E(e);break;case"wait":s.close(),setTimeout(function(){E(e)},5e3);case"eventLog":}"error"!==r&&"complete"!==r&&"downloadComplete"!==r&&s.startTimeout()},s.onerror=function(e){var t;null!==(t=window.templately)&&void 0!==t&&t.log&&console.error("EventSource failed:",e),s.clearTimeout(),s.close(),v.current<5?c():(g(!0),u(!1),requestAnimationFrame(function(){y({type:"error",title:(0,At.__)("Oops!","templately"),message:(0,At.sprintf)((0,At.__)("It seems we're experiencing technical difficulties. Please try again or contact <a href='%s' target='_blank'>support</a>.","templately"),"https://wpdeveloper.com/support"),status:"error",handleRetry:function(e){v.current=0,c(e)}})}))},s.startTimeout=function(e){s.clearTimeout(),l.current=setTimeout(function(){s.close(),v.current<5?c():(g(!0),u(!1),requestAnimationFrame(function(){y({type:"error",title:(0,At.__)("Sorry for the delay!","templately"),message:(0,At.sprintf)((0,At.__)("If it's taking longer than expected, please try again or contact <a href='%s' target='_blank'>support</a>.","templately"),"https://wpdeveloper.com/support"),status:"error",handleRetry:function(e){v.current=0,c(e)}})}))},6e4)},s.clearTimeout=function(e){l.current&&(clearTimeout(l.current),l.current=null)},s.startTimeout()},O=function(){var e=Ei(xi().mark(function e(t){var n,r,o,i,a,l=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>1&&void 0!==l[1]?l[1]:null,r=l.length>2&&void 0!==l[2]?l[2]:null,VE=0,g(!1),u(!0),o=(0,Ci.addQueryArgs)(window.ajaxurl,{action:"templately_pack_import_settings",nonce:window.templately.nonce}),n&&t.set("process_id",n),r&&t.set("ai_page_ids",JSON.stringify(r)),e.prev=1,e.next=2,Sa(o,t);case 2:null!=(i=e.sent)&&i.success&&E(i.data),e.next=4;break;case 3:e.prev=3,a=e.catch(1),console.error("Import start error:",a);case 4:case"end":return e.stop()}},e,null,[[1,3]])}));return function(_x){return e.apply(this,arguments)}}();return{startImporting:O,steps:n,setSteps:r,removeStep:k,currentStep:i,eventSourceRef:a,isImportRunning:c,isImportComplete:p,updateStep:y,hasError:m}},$E=function(e,t){var n=pe((0,oe.useState)(t),2),r=n[0],o=n[1],i=pe((0,oe.useState)([]),2),a=i[0],l=i[1],s=function(e,t){var n=pe((0,oe.useState)(e),2),r=n[0],o=n[1];return(0,oe.useEffect)(function(){var n=setTimeout(function(){o(e)},t);return function(){clearTimeout(n)}},[e,t]),r}(r,500);return(0,oe.useEffect)(function(){l([{value:"",label:"All"}])},[t]),(0,oe.useEffect)(function(){var t=function(){var t=Ei(xi().mark(function t(n){var r,o,i;return xi().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(""!==n){t.next=1;break}return t.abrupt("return");case 1:return t.next=2,ba("/templately/v1/autocomplete-condition",{payload:n,query:null!=e?e:[]});case 2:if(r=t.sent,o=r.response,i=r.error,!o){t.next=3;break}return l(o),t.abrupt("return");case 3:i&&l([]);case 4:case"end":return t.stop()}},t)}));return function(_x){return t.apply(this,arguments)}}();t(s)},[s]),[a,o]},GE={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let YE;const XE=new Uint8Array(16);function KE(){if(!YE&&(YE="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!YE))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return YE(XE)}const ZE=[];for(let e=0;e<256;++e)ZE.push((e+256).toString(16).slice(1));const JE=function(e,t,n){if(GE.randomUUID&&!t&&!e)return GE.randomUUID();const r=(e=e||{}).random||(e.rng||KE)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return ZE[e[t+0]]+ZE[e[t+1]]+ZE[e[t+2]]+ZE[e[t+3]]+"-"+ZE[e[t+4]]+ZE[e[t+5]]+"-"+ZE[e[t+6]]+ZE[e[t+7]]+"-"+ZE[e[t+8]]+ZE[e[t+9]]+"-"+ZE[e[t+10]]+ZE[e[t+11]]+ZE[e[t+12]]+ZE[e[t+13]]+ZE[e[t+14]]+ZE[e[t+15]]}(r)};var eO=function(){return Rd(function e(t){Id(this,e),this.config=t},[{key:"getOptions",value:function(){return this.getSubOptions("general",!0).map(function(e){return{label:e.label,value:e.value}})}},{key:"getSubOptions",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.config[e];return r?[{label:r.plural_label,value:n?e:""}].concat(Ul(r.sub_conditions.map(function(e){var n,r=t.config[e];return null!==(n=r.sub_conditions)&&void 0!==n&&n.length?{label:r.label,value:e,options:t.getSubOptions(e,!0)}:{label:r.label,value:e}}))):[]}},{key:"getSubIdAutocomplete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.config[e];if(!t||"object"!==ne(t.controls))return{};var n=Object.values(t.controls);return null!=n&&n[0]?n[0]:{}}}])}();const tO=eO;function nO(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 rO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nO(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var oO=ae().createContext(),iO=function(e){var t=kn(),n=Sn(function(e){var t;return null!==(t=e.conditions.conditions)&&void 0!==t?t:[]}),r=new tO(n),o=pe((0,oe.useState)(!1),2),i=o[0],a=o[1],l=function(){var t,n;return 0===(null===(t=e.template)||void 0===t||null===(t=t.conditions)||void 0===t?void 0:t.length)?{}:null===(n=e.template)||void 0===n||null===(n=n.conditions)||void 0===n?void 0:n.reduce(function(e,t){var n=t.type,o=t.name,i=t.sub_name,a=void 0===i?"":i,l=t.sub_id,s=void 0===l?"":l,c=JE(),u={};return a&&(u.subIdAutocomplete=r.getSubIdAutocomplete(a)),rO(rO({},e),{},Tt({},c,rO(rO({},u),{},{id:c,type:n,name:o,sub_name:a,sub_id:s,options:r.getOptions(),subOptions:r.getSubOptions(o)})))},{})},s=pe((0,oe.useState)(l),2),c=s[0],u=s[1];(0,oe.useEffect)(function(){u(l())},[e.template.conditions]),(0,oe.useEffect)(function(){var n=Object.values(c).reduce(function(t,n){var r=[n.type,n.name,n.sub_name,n.sub_id].join("/").replace(/^\/+|\/+$/g,""),o=[].concat(Ul((null==t?void 0:t[e.template.id])||[]),[r]);return rO(rO({},t),{},Tt({},e.template.id,o))},{});t(hv({type:Kr},n))},[c]);var d={conditions:c,updateCondition:function(e,t){u(function(n){var o=n[e];return t.name&&(o.subOptions=r.getSubOptions(t.name)),(t.sub_name||t.name)&&(o.subIdAutocomplete=r.getSubIdAutocomplete(t.sub_name)),rO(rO({},n),{},Tt({},e,rO(rO({},o),t)))})},createCondition:function(e){var t=JE();u(function(e){return rO(rO({},e),{},Tt({},t,{id:t,type:"include",name:"general",sub_name:"",sub_id:"",options:r.getOptions(),subOptions:r.getSubOptions("general",!0),subIdAutocomplete:r.getSubIdAutocomplete("")}))})},removeCondition:function(e){u(function(t){return delete t[e],rO({},t)})},saveConditions:function(){var n;e.template.id&&(a(!0),t((n=e.template.id,{type:Xr,id:n})))},isSaving:i};return ae().createElement(oO.Provider,{value:d},e.children)};const aO=function(){return(0,oe.useContext)(oO)};var lO=["key","type"],sO=["type"],cO=["details","fileContents"],uO=["type","saveTemplate"],dO=["type"],pO=["type"],hO=["type","context"],fO=["source","slug"],mO=xi().mark(bO),gO=xi().mark(SO);function vO(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 yO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vO(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bO(e){var t,n,r,o,i,a,l;return xi().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return t=e.key,e.type,n=Wn(e,lO),r=(null==n?void 0:n.search)||null,s.next=1,dw(function(e){return e.general.platform});case 1:if(o=s.sent,null!=(null==n?void 0:n.refresh)){s.next=2;break}return s.next=2,aw({type:$o.REQUESTED,platform:o});case 2:return s.next=3,ba("/templately/v1/clouds",yO({platform:o,type:t},n));case 3:if(i=s.sent,a=i.response,l=i.error,!0!==(null==a?void 0:a.redirect)){s.next=4;break}return s.next=4,aw(_v(a));case 4:if(!a){s.next=6;break}if(null==a||!a.files){s.next=5;break}return s.next=5,aw(Uv({data:a.files.data,platform:o,currentPage:a.files.current_page,totalPage:a.files.total_page,search:r}));case 5:if(void 0!==(null==a?void 0:a.files)){s.next=6;break}return s.next=6,aw(Uv({data:[],platform:o,currentPage:1,totalPage:0,search:r}));case 6:if(!l){s.next=7;break}return s.next=7,aw(Vv(l));case 7:case"end":return s.stop()}},mO)}function wO(e){e.type;var t=Wn(e,sO);return xi().mark(function e(){var n,r,o,i,a,l,s;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.details,r=t.fileContents,o=Wn(t,cO),e.next=1,wa("/templately/v1/clouds/copy-move",o);case 1:if(i=e.sent,a=i.response,i.error,Tl.hideLoading(),l=n.label,s=n.slug,"success"!=a.status){e.next=5;break}if("copy"!==t.action){e.next=3;break}return e.next=2,aw($v(yO(yO({},r),{},{slug:s})));case 2:e.next=4;break;case 3:if("move"!==t.action){e.next=4;break}return e.next=4,aw(Yv(yO(yO({},r),{},{slug:s})));case 4:"copy"===t.action?Tl.close({isCopied:!0,contentArgs:{title:l}}):"move"===t.action&&Tl.close({isMoved:!0,contentArgs:{title:l}}),e.next=6;break;case 5:"error"==a.status&&("copy"===t.action?Tl.close({isCopied:!1,contentArgs:{title:l,message:a.message}}):"move"===t.action&&Tl.close({isMoved:!1,contentArgs:{title:l,message:a.message}}));case 6:e.next=8;break;case 7:e.prev=7,e.catch(0);case 8:case"end":return e.stop()}},e,null,[[0,7]])})()}function kO(e){e.type;var t=e.saveTemplate,n=Wn(e,uO);return xi().mark(function e(){var r,o,i,a,l,s,c,u;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,dw(function(e){return{platform:e.general.platform}});case 1:return r=e.sent,o=r.platform,e.next=2,wa("/templately/v1/clouds/upload",yO(yO({},n),{},{platform:o}));case 2:if(i=e.sent,a=i.response,l=i.error,!t){e.next=6;break}if(!a){e.next=5;break}if("success"!==(null==a?void 0:a.status)){e.next=4;break}return s=n.workspace,c=n.workspace_id,e.next=3,aw(Jv(yO({refresh:!0,redirect:c>0?s.shared?"clouds/shared-workspace/".concat(s.slug):"clouds/workspace/".concat(s.slug):"clouds"},a)));case 3:e.next=5;break;case 4:return e.next=5,aw(ey(a));case 5:if(!l){e.next=6;break}return e.next=6,aw(ey(l));case 6:if(t){e.next=12;break}if(!a){e.next=11;break}if("success"!==(null==a?void 0:a.status)){e.next=9;break}return e.next=7,aw(yO({type:"CLOUDS_PUSHED"},n));case 7:return e.next=8,aw(Wv({refresh:!0,search:null}));case 8:Tl.close({isPushed:!0,contentArgs:{title:"Successfully Pushed!",message:null==a?void 0:a.message}}),e.next=10;break;case 9:Tl.close({isPushed:!1,contentArgs:{title:"Something went wrong!",message:null==a?void 0:a.message}});case 10:e.next=12;break;case 11:l&&Tl.close({isPushed:!1,contentArgs:{title:"Something went wrong!",message:null==l?void 0:l.message}});case 12:e.next=14;break;case 13:e.prev=13,u=e.catch(0),console.error("C503",u);case 14:case"end":return e.stop()}},e,null,[[0,13]])})()}function EO(e){e.type;var t=Wn(e,dO);return xi().mark(function e(){var n,r,o,i;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/clouds/download/".concat(null==t?void 0:t.id),t);case 1:n=e.sent,r=n.response,n.error,r&&"success"===(null==r?void 0:r.status)?((o=document.createElement("a")).setAttribute("download",null==r?void 0:r.file_name),o.href=null==r?void 0:r.fileURL,o.click(),o.remove(),Tl.close({isDownloaded:!0})):Tl.close({isDownloaded:!1}),e.next=3;break;case 2:e.prev=2,i=e.catch(0),console.error("C501","Downloading Error: ",i);case 3:case"end":return e.stop()}},e,null,[[0,2]])})()}function OO(e){e.type;var t=Wn(e,pO);return xi().mark(function e(){var n,r,o,i,a,l,s,c;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.id,r=t.source,o=void 0===r?"cloud":r,i=t.slug,e.next=1,ba("cloud"===o?"/templately/v1/clouds/delete/".concat(n):"/templately/v1/workspaces/item/delete/".concat(n));case 1:if(a=e.sent,l=a.response,s=a.error,!l||"success"!==(null==l?void 0:l.status)){e.next=5;break}if("cloud"!==o){e.next=3;break}return e.next=2,aw(Wv({refresh:!0,search:null}));case 2:e.next=4;break;case 3:if("workspace"!==o&&"sharedWorkspace"!==o){e.next=4;break}return e.next=4,aw(ky({refresh:!0,slug:i}));case 4:Tl.hideLoading(),Tl.close({isDeleted:!0}),e.next=6;break;case 5:Tl.close({isDeleted:!1});case 6:s&&console.error("Error C501: ",s),e.next=8;break;case 7:e.prev=7,c=e.catch(0),console.error("Error C501: ",c);case 8:case"end":return e.stop()}},e,null,[[0,7]])})()}function xO(e){e.type;var t=e.context,n=void 0===t?"modal":t,r=Wn(e,hO);return xi().mark(function e(){var t,o,i,a,l,s,c,u,d,p,h,f,m,g;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=r.source,o=void 0===t?"clouds":t,i=r.slug,a=Wn(r,fO),e.next=1,ba("clouds"===o?"/templately/v1/clouds":"/templately/v1/workspaces/".concat(i),a);case 1:if(l=e.sent,s=l.response,c=l.error,!s){e.next=2;break}return e.next=2,aw(oy({keyword:null==a?void 0:a.search,context:n,source:o,data:null!==(u=null===(d=s.files)||void 0===d?void 0:d.data)&&void 0!==u?u:[],totalPage:null!==(p=null===(h=s.files)||void 0===h?void 0:h.total_page)&&void 0!==p?p:1,currentPage:null!==(f=null===(m=s.files)||void 0===m?void 0:m.current_page)&&void 0!==f?f:1}));case 2:c&&console.error("Error S100: ",c),e.next=4;break;case 3:e.prev=3,g=e.catch(0),console.error("Error S100: ",g);case 4:case"end":return e.stop()}},e,null,[[0,3]])})()}function SO(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk($o.LOAD,bO);case 1:return e.next=2,rk($o.COPY,wO);case 2:return e.next=3,rk($o.MOVE,wO);case 3:return e.next=4,rk($o.PUSH,kO);case 4:return e.next=5,rk($o.DOWNLOAD,EO);case 5:return e.next=6,rk($o.DELETE,OO);case 6:return e.next=7,rk($o.SEARCH,xO);case 7:return e.next=8,rk(Go.SEARCH,xO);case 8:return e.next=9,rk(Yo.SEARCH,xO);case 9:return e.next=10,rk(Xo.SEARCH,xO);case 10:case"end":return e.stop()}},gO)}var _O=["type"],CO=["shared","key","page"],PO=xi().mark(NO);function TO(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 AO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TO(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MO(e){var t=e.type,n=Wn(e,_O);return xi().mark(function e(){var r,o,i,a,l,s,c,u,d,p;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=n.shared,o=void 0!==r&&r,n.key,n.page,Wn(n,CO),e.next=1,dw(function(e){return{plan:e.general.plan,platform:e.general.platform}});case 1:if(i=e.sent,a=i.plan,l=i.platform,t!==Go.LOAD&&t!==Yo.LOAD){e.next=2;break}return e.next=2,aw({type:o?Yo.REQUESTED:Go.REQUESTED,platform:l,plan:a});case 2:return e.next=3,ba("/templately/v1/workspaces",AO({},n));case 3:if(s=e.sent,c=s.response,u=s.error,!c){e.next=8;break}d=t,e.next=d===Go.LOAD_LISTS||d===Yo.LOAD_LISTS?4:d===Go.LOAD||d===Yo.LOAD?6:8;break;case 4:return e.next=5,aw(cy({payload:c.data,shared:n.shared}));case 5:return e.abrupt("continue",8);case 6:return e.next=7,aw(uy({data:c.data,shared:n.shared,currentPage:c.current_page,totalPage:c.total_page}));case 7:return e.abrupt("continue",8);case 8:if(!u){e.next=9;break}return console.error("Error W100: ",u),e.next=9,aw(dy({shared:o,error:u}));case 9:e.next=11;break;case 10:e.prev=10,p=e.catch(0),console.error("Error W100: ",p);case 11:case"end":return e.stop()}},e,null,[[0,10]])})()}function NO(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Go.LOAD,MO);case 1:return e.next=2,rk(Yo.LOAD,MO);case 2:return e.next=3,rk(Go.LOAD_LISTS,MO);case 3:return e.next=4,rk(Yo.LOAD_LISTS,MO);case 4:case"end":return e.stop()}},PO)}var DO=["type"],IO=xi().mark(FO);function LO(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 RO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LO(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jO(e){e.type;var t=Wn(e,DO);return xi().mark(function e(){var n,r,o,i,a,l,s;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wa("/templately/v1/workspaces/create",RO(RO({},t),{},{isCreate:!0}));case 1:if(n=e.sent,r=n.response,o=n.error,Tl.hideLoading(),"success"!==(null==r?void 0:r.status)){e.next=3;break}return e.next=2,aw(hy(RO({},null==r?void 0:r.workspace)));case 2:Tl.close({isCreated:!0,contentArgs:{title:null!==(i=null==t?void 0:t.title)&&void 0!==i?i:""}}),e.next=4;break;case 3:Tl.close({isCreated:!1,message:null!==(a=null!==(l=null==r?void 0:r.message)&&void 0!==l?l:null==o?void 0:o.message)&&void 0!==a?a:null});case 4:o&&console.error("Errro W101: ",o),e.next=6;break;case 5:e.prev=5,s=e.catch(0),console.error("Errro W101: ",s);case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function FO(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Go.CREATE,jO);case 1:case"end":return e.stop()}},IO)}var zO=["type"],BO=["key","shared","refresh"],WO=["type"],UO=xi().mark($O);function VO(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 HO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VO(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qO(e){e.type;var t=Wn(e,zO);return xi().mark(function e(){var n,r,o,i,a,l,s,c,u,d,p;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.key,t.shared,n=t.refresh,r=void 0!==n&&n,o=Wn(t,BO),i=o.slug,o.platform,e.next=1,dw(function(e){var t,n;return{platform:e.general.platform,data:null!==(t=null===(n=e.workspaceDetails)||void 0===n?void 0:n[i])&&void 0!==t?t:null}});case 1:return a=e.sent,l=a.platform,s=a.data,e.next=2,cw(ba,"/templately/v1/workspaces/"+i,HO({file_type:l},o));case 2:if(c=e.sent,u=c.response,d=c.error,!u){e.next=3;break}return e.next=3,aw(by(HO(HO({slug:i,platform:l,refresh:r},u),s)));case 3:if(!d){e.next=4;break}return console.error("Error W104: ",d),e.next=4,aw(Oy(HO({},d)));case 4:e.next=6;break;case 5:return e.prev=5,p=e.catch(0),console.error("Error W104: ",p),e.next=6,aw(Oy(p));case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function QO(e){e.type;var t=Wn(e,WO);return xi().mark(function e(){var n,r,o,i,a,l,s;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.workspace_id,r=t.files,o=t.slug,e.next=1,wa("/templately/v1/workspaces/item/add",{workspace_id:n,files:r});case 1:if(i=e.sent,a=i.response,l=i.error,!a){e.next=4;break}if("success"!==(null==a?void 0:a.status)){e.next=3;break}return Tl.close({isAdded:!0}),e.next=2,aw(ky({slug:o,refresh:!0}));case 2:e.next=4;break;case 3:Tl.close({isAdded:!1});case 4:l&&console.error("Error W105: ",l),e.next=6;break;case 5:e.prev=5,s=e.catch(0),console.error("Error W105: ",s);case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function $O(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Xo.LOAD,qO);case 1:return e.next=2,rk(Xo.ADD_FILE,QO);case 2:case"end":return e.stop()}},UO)}var GO=["type"],YO=["type"],XO=xi().mark(JO);function KO(e){e.type;var t=Wn(e,GO);return xi().mark(function e(){var n,r,o,i,a,l,s;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,o=t.platform,i=t.slug,a=t.files,t.shared,void 0===(l=t.refresh)||!l){e.next=1;break}return e.next=1,aw(Zv({}));case 1:return e.next=2,aw(Ey({slug:i,platform:o,data:null!==(n=null==a?void 0:a.data)&&void 0!==n?n:[],currentPage:null!==(r=null==a?void 0:a.current_page)&&void 0!==r?r:1,totalPage:null==a?void 0:a.total_page}));case 2:e.next=4;break;case 3:e.prev=3,s=e.catch(0),console.error("Error W106: ",s);case 4:case"end":return e.stop()}},e,null,[[0,3]])})()}function ZO(e){e.type;var t=Wn(e,YO);return xi().mark(function e(){var n,r,o,i,a,l,s,c,u,d,p,h,f,m;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.slug,r=t.shared,o=void 0!==r&&r,i=t.page,a=t.refresh,l=void 0!==a&&a,e.next=1,dw(function(e){return e.general.platform});case 1:if(s=e.sent,!l){e.next=2;break}return e.next=2,aw({type:Xo.GET_FILES_REQUESTED});case 2:return e.next=3,ba("/templately/v1/workspaces/"+n,{file_type:s,shared:o,page:i,directLoad:!1});case 3:if(c=e.sent,u=c.response,c.error,!u){e.next=4;break}return f=u.files,e.next=4,aw(Ey({slug:n,platform:s,data:null!==(d=null==f?void 0:f.data)&&void 0!==d?d:[],currentPage:null!==(p=null==f?void 0:f.current_page)&&void 0!==p?p:1,totalPage:null!==(h=null==f?void 0:f.total_page)&&void 0!==h?h:1}));case 4:e.next=6;break;case 5:e.prev=5,m=e.catch(0),console.error("Error W107: ",m);case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function JO(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Xo.LOAD_SUCCESS,KO);case 1:return e.next=2,rk(Xo.SET,ZO);case 2:return e.next=3,rk(Xo.GET_FILES,ZO);case 3:case"end":return e.stop()}},XO)}var ex=xi().mark(ix),tx=xi().mark(ax),nx=xi().mark(lx);function rx(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 ox(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rx(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ix(e){var t,n,r,o,i,a,l;return xi().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return t=e.id,n=e.page,r=e.slug,s.prev=1,s.next=2,wa("/templately/v1/workspaces/delete/"+t,ox({},e));case 2:if(o=s.sent,i=o.response,a=o.error,Tl.hideLoading(),"success"!==i.status){s.next=4;break}return s.next=3,aw(my({id:t,slug:r,page:n}));case 3:Tl.close({isDeleted:!0}),s.next=5;break;case 4:throw Tl.close({isDeleted:!1}),new Error(i.message);case 5:a&&console.error("Error W103: ",a),s.next=7;break;case 6:s.prev=6,l=s.catch(1),console.error("Error W103: ",l);case 7:case"end":return s.stop()}},ex,null,[[1,6]])}function ax(e){var t,n;return xi().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.id){r.next=1;break}return t=e.id,n=e.slug,r.next=1,aw(wy({id:t,slug:n}));case 1:case"end":return r.stop()}},tx)}function lx(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Go.DELETE,ix);case 1:return e.next=2,nk(Go.DELETE_SUCCESS,ax);case 2:case"end":return e.stop()}},nx)}var sx=xi().mark(px),cx=xi().mark(hx);function ux(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 dx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ux(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ux(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function px(e){var t,n,r,o,i,a,l,s,c;return xi().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return t=e.slug,u.prev=1,u.next=2,dw(function(e){return{platform:e.general.platform}});case 2:return n=u.sent,r=n.platform,u.next=3,wa("/templately/v1/workspaces/"+t,dx(dx({},e),{},{platform:r}));case 3:if(o=u.sent,i=o.response,a=o.error,Tl.hideLoading(),"success"!==(null==i?void 0:i.status)){u.next=5;break}return u.next=4,aw(vy(dx({slug:t,platform:r},null==i?void 0:i.workspace)));case 4:Tl.close({isSaved:!0}),u.next=6;break;case 5:throw Tl.close({isSaved:!1,message:null!==(l=null!==(s=null==i?void 0:i.message)&&void 0!==s?s:null==a?void 0:a.message)&&void 0!==l?l:null}),new Error(i.message);case 6:a&&console.error("Error W102: ",a),u.next=8;break;case 7:u.prev=7,c=u.catch(1),console.error("Error W102: ",c);case 8:case"end":return u.stop()}},sx,null,[[1,7]])}function hx(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Go.SAVE,px);case 1:case"end":return e.stop()}},cx)}var fx=["type"],mx=xi().mark(vx);function gx(e){e.type;var t=Wn(e,fx);return xi().mark(function e(){var n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/items-count",t);case 1:if(n=e.sent,r=n.response,n.error,!r){e.next=2;break}return e.next=2,aw(Sv(r));case 2:e.next=4;break;case 3:e.prev=3,o=e.catch(0),console.error("Items Count: ",o);case 4:case"end":return e.stop()}},e,null,[[0,3]])})()}function vx(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Wa(Ao,"PAGES"),gx);case 1:return e.next=2,rk(Wa(Ao,"SECTIONS"),gx);case 2:return e.next=3,rk(Wa(Ao,"PACKS"),gx);case 3:return e.next=4,rk(Wa(So,"PAGES"),gx);case 4:return e.next=5,rk(Wa(So,"SECTIONS"),gx);case 5:return e.next=6,rk(Wa(So,"PACKS"),gx);case 6:case"end":return e.stop()}},mx)}var yx=["type","key","slug"],bx=["type"],wx=xi().mark(xx);function kx(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 Ex(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kx(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ox(e){e.type;var t=e.key,n=e.slug,r=Wn(e,yx);return xi().mark(function e(){var o,i,a,l,s,c,u,d,p;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,dw(function(e){return{plan:e.general.plan,platform:e.general.platform}});case 1:return o=e.sent,i=o.plan,a=o.platform,e.next=2,ba("/templately/v1/items/"+n,Ex({plan:i,platform:a,type:t},r));case 2:if(l=e.sent,s=l.response,c=l.error,!s){e.next=3;break}return u=s.type,d=Wn(s,bx),e.next=3,aw(Mv(Ex(Ex({},d),{},{itemType:u,key:t,platform:a})));case 3:if(!c){e.next=4;break}return console.error("Error ID001: ",c),e.next=4,aw(Nv(Ex(Ex({},c),{},{platform:a,key:t})));case 4:e.next=6;break;case 5:return e.prev=5,p=e.catch(0),console.error("Error ID002: ",p),e.next=6,aw(Nv(p));case 6:case"end":return e.stop()}},e,null,[[0,5]])})()}function xx(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Wa(Ao,"PAGES"),Ox);case 1:return e.next=2,rk(Wa(Ao,"SECTIONS"),Ox);case 2:return e.next=3,rk(Wa(Ao,"PACKS"),Ox);case 3:case"end":return e.stop()}},wx)}var Sx=["key","type","isFilterableQuery","prevFilterableQuery"],Cx=xi().mark(Nx),Px=xi().mark(Dx),Tx=xi().mark(Ix);function Ax(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 Mx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ax(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ax(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nx(e){var t,n,r,o,i,a,l,s,c,u,d,p,h,f,m,g,v,y;return xi().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.prev=0,t=e.key,e.type,n=e.isFilterableQuery,e.prevFilterableQuery,r=Wn(e,Sx),o=!1,b.next=1,dw(function(e){var n,o=e.general.plan,i=e.general.platform,a=null!==(n=null==r?void 0:r.page)&&void 0!==n?n:1,l=e.general.filter.prevQuery,s=e.general.filter.doQuery,c=[t,o,i,a];return s||null!=(null==r?void 0:r.search)||c.push(a),s&&s===l&&(c=c.concat(["filteredResults",a])),null!==(null==r?void 0:r.search)&&(c=c.concat(["search",a])),{items:Ua(e,c,[]),isNewQuery:s!==l,plan:e.general.plan,platform:e.general.platform,prevSearch:e.general.filter.prevSearch}});case 1:if(i=b.sent,a=i.plan,l=i.platform,s=i.items,c=i.isNewQuery,u=i.prevSearch,!((null==s?void 0:s.length)>0)||c){b.next=3;break}return b.next=2,aw({type:Wa(Co,t),data:s,currentPage:null!==(d=null==r?void 0:r.page)&&void 0!==d?d:1,platform:l,plan:a});case 2:return b.abrupt("return");case 3:return b.next=4,aw({type:Wa(So,t),platform:l,plan:a});case 4:if(u===(null==r?void 0:r.search)){b.next=5;break}return o=!0,b.next=5,aw(mv({key:"prevSearch",data:null==r?void 0:r.search}));case 5:return b.next=6,ba("/templately/v1/items",Mx({plan:a,platform:l,include_search:o,type:t},r));case 6:if(p=b.sent,h=p.response,f=p.error,!h){b.next=7;break}return b.next=7,aw({type:Wa(Co,t),data:(null===(m=h.data)||void 0===m?void 0:m.length)>0?h.data:"empty",totalPage:null!==(g=null==h?void 0:h.total_page)&&void 0!==g?g:0,currentPage:null!==(v=null==h?void 0:h.current_page)&&void 0!==v?v:1,platform:l,plan:a,isFilterableQuery:n,search:null==r?void 0:r.search});case 7:if(!f){b.next=8;break}return b.next=8,aw({type:Wa(Po,t),error:f,isFilterableQuery:n,search:null==r?void 0:r.search});case 8:b.next=10;break;case 9:b.prev=9,y=b.catch(0),console.error("ID003: ",y);case 10:case"end":return b.stop()}},Cx,null,[[0,9]])}function Dx(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Wa(_o,"PAGES"),Nx);case 1:return e.next=2,rk(Wa(_o,"SECTIONS"),Nx);case 2:return e.next=3,rk(Wa(_o,"PACKS"),Nx);case 3:case"end":return e.stop()}},Px)}function Ix(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,lw([Dx()]);case 1:case"end":return e.stop()}},Tx)}var Lx=["type"],Rx=xi().mark(Fx);function jx(e){e.type;var t=Wn(e,Lx);return xi().mark(function e(){var n,r,o,i,a,l,s,c;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/featured-items",t);case 1:if(o=e.sent,i=o.response,a=o.error,!(i&&null!=i&&i.data&&(null===(n=i.data)||void 0===n?void 0:n.length)>0)){e.next=2;break}return e.next=2,aw(Dv({items:i.data}));case 2:if(!a&&null!=i&&i.data&&0!=(null==i||null===(r=i.data)||void 0===r?void 0:r.length)){e.next=3;break}throw{code:null!==(l=null==a?void 0:a.code)&&void 0!==l?l:"templately_api_error",message:null!==(s=null==a?void 0:a.message)&&void 0!==s?s:"Something went wrong."};case 3:e.next=5;break;case 4:return e.prev=4,c=e.catch(0),e.next=5,aw(Iv(c));case 5:case"end":return e.stop()}},e,null,[[0,4]])})()}function Fx(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Do,jx);case 1:case"end":return e.stop()}},Rx)}var zx=["type"],Bx=xi().mark(Ux);function Wx(e){e.type;var t=Wn(e,zx);return xi().mark(function e(){var n,r,o,i,a,l,s,c;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/related-items",t);case 1:if(o=e.sent,i=o.response,a=o.error,!(i&&null!=i&&i.data&&(null===(n=i.data)||void 0===n?void 0:n.length)>0)){e.next=2;break}return e.next=2,aw(jv({items:i.data}));case 2:if(!a&&null!=i&&i.data&&0!=(null==i||null===(r=i.data)||void 0===r?void 0:r.length)){e.next=3;break}throw{code:null!==(l=null==a?void 0:a.code)&&void 0!==l?l:"templately_api_error",message:null!==(s=null==a?void 0:a.message)&&void 0!==s?s:"Something went wrong."};case 3:e.next=5;break;case 4:return e.prev=4,c=e.catch(0),e.next=5,aw(Fv(c));case 5:case"end":return e.stop()}},e,null,[[0,4]])})()}function Ux(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(zo,Wx);case 1:case"end":return e.stop()}},Bx)}var Vx=["type"],Hx=xi().mark(Qx);function qx(e){e.type;var t=Wn(e,Vx);return xi().mark(function e(){var n,r,o,i,a,l,s,c;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,ba("/templately/v1/trending-items",t);case 1:if(o=e.sent,i=o.response,a=o.error,!(i&&null!=i&&i.data&&(null===(n=i.data)||void 0===n?void 0:n.length)>0)){e.next=2;break}return e.next=2,aw(Lv({items:i.data}));case 2:if(!a&&null!=i&&i.data&&0!=(null==i||null===(r=i.data)||void 0===r?void 0:r.length)){e.next=3;break}throw{code:null!==(l=null==a?void 0:a.code)&&void 0!==l?l:"templately_api_error",message:null!==(s=null==a?void 0:a.message)&&void 0!==s?s:"Something went wrong."};case 3:e.next=5;break;case 4:return e.prev=4,c=e.catch(0),e.next=5,aw(Rv(c));case 5:case"end":return e.stop()}},e,null,[[0,4]])})()}function Qx(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,rk(Ro,qx);case 1:case"end":return e.stop()}},Hx)}var $x=xi().mark(Gx);function Gx(){return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,lw([uw(qk),uw(Lk),uw(Jk),uw(iE),uw(mE),uw(DE),uw(vx),uw(Ix),uw(Fx),uw(Qx),uw(Ux),uw(bE),uw(OE),uw(xx),uw(Yk),uw(kk),uw(lk),uw(dk),uw(mk),uw(jE),uw(SO),uw(NO),uw(FO),uw($O),uw(JO),uw(lx),uw(hx)]);case 1:case"end":return e.stop()}},$x)}const Yx=Gx;var Xx=function(){var e,t={},n=t.context,r=void 0===n?{}:n,o=t.channel,i=void 0===o?Pw():o,a=t.sagaMonitor,l=Ft(t,$w);function s(t){var n=t.getState,o=t.dispatch;return e=Qw.bind(null,re({},l,{context:r,channel:i,dispatch:o,getState:n,sagaMonitor:a})),function(e){return function(t){a&&a.actionDispatched&&a.actionDispatched(t);var n=e(t);return i.put(t),n}}}return s.run=function(){return e.apply(void 0,arguments)},s.setContext=function(e){jb(r,e)},s}(),Kx=null;Kx=function(e,t){var n=ju(),r=zl(Bl(n),{},t);return r.asyncReducers=null!=n?n:{},r.attachReducer=function(e,t){r.asyncReducers[e]=t,r.replaceReducer(Bl(ju(r.asyncReducers)))},r}(0,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(Ll(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map(function(e){return e(o)});return r=Wl.apply(void 0,i)(n.dispatch),Il(Il({},n),{},{dispatch:r})}}}(Yw,Xx)),Xx.run(Yx),Kx.attachReducer("sections",Du("SECTIONS")),Kx.attachReducer("packs",Du("PACKS")),Kx.attachReducer("pages",Du("PAGES"));var Zx=["to","query","ignoreKeys","icon","isActive","children","label","hasDropdown","aria-current"],Jx=function(e){var t=e.to,n=e.query,r=e.ignoreKeys,o=void 0===r?[]:r,i=e.icon,a=void 0!==i&&i,l=e.isActive,s=e.children,c=void 0===s?"":s,u=e.label,d=void 0===u?"":u,p=e.hasDropdown,h=void 0!==p&&p,f=e["aria-current"],m=void 0===f?"page":f,g=Wn(e,Zx),v=l?m:void 0;return ae().createElement(xt,re({},g,{"aria-current":v,to:ub(t,n,o)}),ae().isValidElement(a)?ae().createElement("i",null,a):null,"function"==typeof c?c({isActive:l}):c,"function"==typeof d?d({isActive:l}):d,h&&ae().createElement("span",{className:"tn-dropdown-icon"},l?ae().createElement(ar,null):ae().createElement(rr,null)))};Jx.displayName="NavLink";const eS=Jx;var tS=["caseSensitive","end","style","className","activeItemClassName","dropdown","list"],nS=ae().forwardRef(function(e,t){e.caseSensitive;var n,r=e.end,o=void 0!==r&&r,i=e.style,a=e.className,l=void 0===a?"":a,s=e.activeItemClassName,c=void 0===s?"active":s,u=e.dropdown,d=e.list,p=void 0===d||d,h=Wn(e,tS),f=null!=u,m=tt(),g=at(e.to),v=m.pathname,y=g.pathname,b=v===y||!o&&v.startsWith(y)&&"/"===v.charAt(y.length);n="function"==typeof l?l({isActive:b,toPathname:y,locationPathname:v}):[l,b?c:null].filter(Boolean).join(" ");var w="function"==typeof i?i({isActive:b}):i,k=Vn()("tn-item",n,{"tn-item-has-dropdown":f,"templately-nav-link":!p});return p?ae().createElement("li",{className:k,ref:t,style:w},ae().createElement(eS,re({},h,{isActive:b,hasDropdown:f})),u&&u.length>0&&ae().createElement(iS,{dropdown:!0,className:b?"dropdown-active":"",activeItemClassName:"dropdown-nav-active",routes:u})):ae().createElement(eS,re({},h,{ref:t,style:w,className:k,isActive:b}))});nS.displayName="NavItem";const rS=nS;var oS=["element"];const iS=function(e){var t=e.routes,n=e.ulClasses,r=void 0===n?"":n,o=e.liClasses,i=void 0===o?"":o,a=e.sidebar,l=void 0!==a&&a,s=e.className,c=void 0===s?"":s,u=e.activeItemClassName,d=void 0===u?"active":u,p=e.dropdown,h=void 0!==p&&p,f=Vn()("templately-nav-wrapper",c,{"templately-nav-sidebar":l,"templately-nav-dropdown":h});return ae().createElement("div",{className:f},ae().createElement("ul",{className:r},t.map(function(e){e.element;var t=Wn(e,oS);return ae().createElement(rS,re({key:t.to,className:i,activeItemClassName:d},t))})))},aS=function(e){var t=Vn()("templately-table",e.className,"tt-view-".concat(e.view));return ae().createElement("div",{className:t},"grid"!=e.view&&(null==e?void 0:e.head)&&("function"==typeof e.head?e.head():e.head),e.children)},lS=function(e){var t;return ae().createElement("div",{className:"templately-table-row ".concat(null!==(t=e.className)&&void 0!==t?t:"")},e.children)};var sS=[{name:"Name",id:"name"},[{name:"Last Modified",id:"last_modified"},{name:"Action",id:"action"}]];const cS=function(e){var t=e.columns,n=void 0===t?sS:t;return ae().createElement(lS,{className:"templately-table-head"},n.map(function(e,t){return Array.isArray(e)?ae().createElement(pS,{key:e.id+"-"+t},ae().createElement(lS,null,e.map(function(e,t){return ae().createElement(pS,{key:e.id+"-"+t},ae().createElement("p",null,e.name))}))):ae().createElement(pS,{key:e.id+"-"+t},ae().createElement("p",null,e.name))}))};var uS=["data","className","view"];const dS=function(e){var t=e.data,n=e.className,r=e.view,o=Wn(e,uS),i=Vn()("templately-table-body",n,"tt-view-".concat(r));return ae().createElement("div",re({},o,{className:i}),t.map(function(e,t){return ae().createElement(lS,{key:Math.random()*t},e.map(function(e,t){return Array.isArray(e)?ae().createElement(pS,{key:"".concat(e.id,"-").concat(t)},ae().createElement(lS,null,e.map(function(e,t){return ae().createElement(pS,{key:"".concat(e.id,"-").concat(t)},ae().isValidElement(e.data)?e.data:ae().createElement("p",null,e.data))}))):ae().createElement(pS,{key:"".concat(e.id,"-").concat(t)},ae().isValidElement(e.data)?e.data:ae().createElement("p",null,e.data))}))}))},pS=function(e){var t;return ae().createElement("div",{className:"templately-table-column ".concat(null!==(t=e.className)&&void 0!==t?t:"")},e.children)},hS=function(e){var t=e.isPro,n=e.className,r=e.inDetails,o=void 0!==r&&r,i=Vn()("templately-badge",{"templately-pro":t,"templately-free":!t},n),a=t?(0,At.__)("Pro","templately"):(0,At.__)("Starter","templately");return ae().createElement("div",{className:i},t&&!o&&ae().createElement(lr,null),ae().createElement("span",null,t&&o&&ae().createElement(lr,null),a))},fS=function(e){var t=e.dependencies,n=pe((0,oe.useState)([]),2),r=n[0],o=n[1];return(0,oe.useEffect)(function(){if(t){var e=[];t.map(function(t,n){e.push(function(e,t){return e&&ae().createElement("span",{key:t,className:"templately-dependency-icon tt-top","data-templately-tooltip":e.name},null!=e&&e.icon?ae().createElement("img",{key:e.id,src:e.icon}):ae().createElement("span",{className:"templately-dependency-icon-text-icon"},e.name[0]))}(t,n))}),o(e)}},[t]),0==r.length?null:ae().createElement("span",{className:"templately-item-dependencies"},r)},mS=function(e){var t=e.type,n=(e.slug,e.dependencies);return e.platform,ae().createElement("div",{className:"templately-item-hover"},"packs"!=t&&ae().createElement(fS,{dependencies:n}))};var gS=["panelKey","title","isActive","onClickItem"],vS=function(e){var t=e.panelKey,n=e.title,r=e.isActive,o=e.onClickItem,i=Wn(e,gS),a=Vn()("tc-panel-header",i.className,{"tc-panel-header-active":r});return ae().createElement("div",{className:a,onClick:function(){return o(t)}},ae().createElement("h4",null,n),ae().createElement("span",{className:"t-collapse-action-btn"},r?ae().createElement(ar,null):ae().createElement(rr,null)))};const yS=ae().memo(vS);var bS=["isActive","children"],wS=function(e){var t=e.isActive,n=e.children,r=Wn(e,bS),o=Vn()("tc-panel-body",r.className,{"tc-content-active":t,"tc-content-hide":!t});return ae().createElement("div",{className:o},n)};const kS=ae().memo(wS);function ES(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 OS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ES(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ES(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const xS=function(e){var t=e.children,n=pe((0,oe.useState)(["0"]),2),r=n[0],o=n[1];(0,oe.useEffect)(function(){if((null==t?void 0:t.length)>0){var e=[];t.map(function(t,n){var r;null!=t&&null!==(r=t.props)&&void 0!==r&&r.isActive&&e.push(String(n))}),e.length>0&&o(function(t){return[].concat(Ul(t),e)})}},[t]);var i=(0,oe.useCallback)(function(e){var t=Ul(r),n=t.indexOf(e);n>-1?t.splice(n,1):t.push(e),o(t)},[r]),a=(0,oe.useCallback)(function(e,t){if(!e)return null;var n=String(t),o=r.indexOf(n)>-1,a=OS(OS({},e.props),{},{key:n,panelKey:n,onClickItem:i,isActive:o});return ae().cloneElement(e,a)},[t,r]);return ae().createElement("div",{className:"templately-collapse"},(null==t?void 0:t.length)>0?t.map(a):t)};var SS=["panelKey","title","children","isActive","onClickItem"],_S=function(e){var t=e.panelKey,n=e.title,r=e.children,o=e.isActive,i=void 0!==o&&o,a=e.onClickItem,l=Wn(e,SS),s={isActive:i,onClickItem:a,panelKey:t},c=Vn()("tc-panel-item",l.className,{"tc-panel-active":i,"tc-panel-inactive":!i});return ae().createElement("div",{className:c},ae().createElement(yS,re({title:n},s)),i&&ae().createElement(kS,s,r))};const CS=ae().memo(_S),PS=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Sn(function(o){var i,a,l,s,c=null===(i=o.profile)||void 0===i||null===(i=i.purchasedItems)||void 0===i||null===(i=i.all)||void 0===i?void 0:i[t],u=null!==(null===(a=o.profile)||void 0===a?void 0:a.data),d=(null===(l=o.profile)||void 0===l||null===(l=l.data)||void 0===l||null===(l=l.plan)||void 0===l?void 0:l.indexOf("free"))>-1,p=null==c?void 0:c.includes(e);return null==n||p||(p=null===(s=o.profile)||void 0===s||null===(s=s.purchasedItems)||void 0===s||null===(s=s.all)||void 0===s||null===(s=s.pack)||void 0===s?void 0:s.includes(n)),r&&!p&&(p=r),d||(p=!0),u?{isPurchased:p,isSubscribed:!d}:{isPurchased:!1,isSubscribed:!1}})},TS=function(e){var t,n=e.id,r=e.type,o=e.downloads,i=void 0===o?0:o,a=e.rating,l=void 0===a?0:a,s=e.likes,c=void 0===s?0:s,u=e.setInsert,d=e.isPack,p=void 0!==d&&d,h=e.price,f=void 0===h?"0.00":h,m=e.isPurchased,g=void 0!==m&&m,v=e.fullSiteImport,y=void 0!==v&&v,b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=rt(),o=pe(Ct(),1)[0],i=pe((0,oe.useState)(n),2),a=i[0],l=i[1],s=pe((0,oe.useState)(!1),2),c=s[0],u=s[1],d=pe((0,oe.useState)(!1),2),p=d[0],h=d[1],f=kn(),m=Sn(function(n){var r,o,i,a=null===(r=n.profile)||void 0===r||null===(r=r.starred)||void 0===r?void 0:r["page"==t||"block"==t?"item":"pack"];return za(a)&&(a=Object.values(a)),{isStarred:null!==(o=null===(i=a)||void 0===i?void 0:i.includes(e))&&void 0!==o&&o,isLoggedIn:null!==n.profile.data}}),g=m.isStarred,v=m.isLoggedIn;return(0,oe.useEffect)(function(){if(c&&!v)return u(!1),r(ub("sign-in",Tt({},"redirect-to",o.get("path"))));c&&(h(function(e){return!e}),l(function(e){return g?e-1:e+1}),f(ra({action:g?"undo":"do",id:e,itemType:t})),u(!0))},[c]),(0,oe.useEffect)(function(){h(g),u(!1)},[g]),{starred:p,isClicked:c,favouriteCount:a,setIsClicked:u,setFavouriteCount:l}}(n,r,c),w=b.starred,k=b.setIsClicked,E=b.favouriteCount,O=PS(n,r,null,g),x=O.isPurchased,S=O.isSubscribed;return ae().createElement("div",{className:"templately-item-meta"},p&&y&&ae().createElement("span",{className:"templately-item-meta-single tb-full-site-import"},"Full Site Import"),null!=l&&S&&ae().createElement(vl,{"data-templately-tooltip":(0,At.__)("Average Rating","templately"),className:"templately-item-meta-single tb-item-rating tt-top ".concat(null==l?"not-rated":"")},ae().createElement(mr,null),ae().createElement("span",null,null!==(t=null==l?void 0:l.toFixed(1))&&void 0!==t?t:ae().createElement("small",null,(0,At.__)("Not Rated","templately")))),!S&&ae().createElement("span",{className:"templately-item-meta-single tb-item-price"},f>0&&!x?"$".concat(f):f>0&&x?ae().createElement(eS,{to:"purchased-items"},"PURCHASED"):"FREE"),!y&&ae().createElement(vl,{"data-templately-tooltip":w?(0,At.__)("Added to Favourite","templately"):(0,At.__)("Add to Favourite","templately"),className:"templately-item-meta-single tb-item-favourite tt-top ".concat(w?"my-favourite":""),onClick:function(){return k(!0)}},ae().createElement(pr,null),ae().createElement("span",null,null!=E?E:0)),ae().createElement(vl,{"data-templately-tooltip":p?(0,At.__)("Total Downloads","templately"):(0,At.__)("Insert","templately"),onClick:function(){return!p&&u(n)},className:"templately-item-meta-single tt-top tb-item-insert"},ae().createElement(sr,null),ae().createElement("span",null,p?null!=i?i:0:(0,At.__)("Insert","templately"))))};var AS=o(1921);const MS=function(e){var t=e.name,n=e.price,r=e.thumbnails,o=void 0===r?[]:r;return null==o?void 0:o.map(function(e,r){return ae().createElement("div",{key:"thumbnail-".concat(r),className:"templately-item-image-wrapper thumbnail-".concat(r)},ae().createElement(hS,{isPro:+n>0}),ae().createElement(AS.LazyLoadImage,{className:"templately-item-image",width:"100%",src:e,alt:t}))})},NS=function(e){var t=e.content,n=t.id,r=t.name,o=t.price,i=t.type,a=t.slug,l=t.rating,s=t.downloads,c=t.thumbnail,u=t.thumbnail2,d=void 0===u?null:u,p=t.thumbnail3,h=void 0===p?null:p,f=t.dependencies,m=t.favourite_count,g=t.fullsite_import,v=void 0!==g&&g,y=rt(),b=pe((0,oe.useState)(null),2),w=b[0],k=b[1],E=Sn(function(e){return e.profile},Jt);(0,oe.useEffect)(function(){if(null!==w){if(!e.isLoggedIn)return void y(ub("sign-in"));if(iv(e.isLoggedIn,E))return;Al({showCloseButton:!0,allowOutsideClick:!1,html:ae().createElement(vd,e.content)},!0).then(function(e){void 0===(null==e?void 0:e.code)?e.isDismissed||Pd(e.platform):Al({icon:"error",showCloseButton:!0,allowOutsideClick:!1,html:ae().createElement(dd,re({},e,{slug:a,type:i}))},!0)}),k(null)}},[w]);var O=Vn()("templately-item","templately-".concat(i,"-item"));return ae().createElement("div",{className:O},ae().createElement("div",{className:"templately-item-inner"},ae().createElement(eS,{ignoreKeys:["category","tag_id","templateType"],className:"templately-item-image-hover-wrapper ".concat("pack"==i?"templately-pack-images-wrapper":""),to:"".concat(e.platform,"/").concat(i,"s/").concat(a)},ae().createElement("div",{className:"templately-item-image-container ".concat("pack"==i?"templately-pack-images":"")},"pack"!==i&&ae().createElement(mS,{slug:a,type:i,dependencies:f,platform:e.platform}),ae().createElement(MS,{name:r,price:+o,thumbnails:"pack"==i?[h,d,c]:[c]}))),ae().createElement("div",{className:"templately-item-details"},ae().createElement(TS,{isPurchased:null==e?void 0:e.isPurchased,isPack:"pack"===i,fullSiteImport:v,type:i,downloads:s,rating:l,likes:m,id:n,price:o,setInsert:k}),ae().createElement(eS,{className:"templately-title",to:"".concat(e.platform,"/").concat(i,"s/").concat(a)},ae().createElement("h4",null,r)))))};var DS=o(5556),IS=o.n(DS),LS=o(312),RS=o.n(LS);function jS(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 FS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jS(Object(n),!0).forEach(function(t){BS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function BS(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WS(){return WS=Object.assign||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},WS.apply(this,arguments)}function US(e){return US=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},US(e)}function VS(e,t){return VS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},VS(e,t)}function HS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qS(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,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||$S(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 QS(e){return function(e){if(Array.isArray(e))return GS(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $S(e,t){if(e){if("string"==typeof e)return GS(e,t);var n=Object.prototype.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)?GS(e,t):void 0}}function GS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function YS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return"";var n=e;return t&&Object.keys(t).forEach(function(e){n=n.replace(e,t[e])}),n}function XS(){return void 0!==globalThis.window?globalThis.window.innerWidth:0}function KS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis.window.self;return e===globalThis.window.top||function(){try{return globalThis.window.location.hostname!==globalThis.window.parent.location.hostname}catch(e){return!0}}()?e:KS(e.parent)}var ZS=300,JS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&VS(e,t)}(l,e);var t,n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=US(o);if(i){var n=US(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?HS(e):t}(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=a.call(this,e)).state={isClosing:!e.animationDisabled,shouldAnimate:!1,zoomLevel:0,offsetX:0,offsetY:0,loadErrorStatus:{}},t.outerEl=ae().createRef(),t.zoomInBtn=ae().createRef(),t.zoomOutBtn=ae().createRef(),t.caption=ae().createRef(),t.closeIfClickInner=t.closeIfClickInner.bind(HS(t)),t.handleImageDoubleClick=t.handleImageDoubleClick.bind(HS(t)),t.handleImageMouseWheel=t.handleImageMouseWheel.bind(HS(t)),t.handleKeyInput=t.handleKeyInput.bind(HS(t)),t.handleMouseUp=t.handleMouseUp.bind(HS(t)),t.handleMouseDown=t.handleMouseDown.bind(HS(t)),t.handleMouseMove=t.handleMouseMove.bind(HS(t)),t.handleOuterMousewheel=t.handleOuterMousewheel.bind(HS(t)),t.handleTouchStart=t.handleTouchStart.bind(HS(t)),t.handleTouchMove=t.handleTouchMove.bind(HS(t)),t.handleTouchEnd=t.handleTouchEnd.bind(HS(t)),t.handlePointerEvent=t.handlePointerEvent.bind(HS(t)),t.handleCaptionMousewheel=t.handleCaptionMousewheel.bind(HS(t)),t.handleWindowResize=t.handleWindowResize.bind(HS(t)),t.handleZoomInButtonClick=t.handleZoomInButtonClick.bind(HS(t)),t.handleZoomOutButtonClick=t.handleZoomOutButtonClick.bind(HS(t)),t.requestClose=t.requestClose.bind(HS(t)),t.requestMoveNext=t.requestMoveNext.bind(HS(t)),t.requestMovePrev=t.requestMovePrev.bind(HS(t)),t.timeouts=[],t.currentAction=0,t.eventsSource=0,t.pointerList=[],t.preventInnerClose=!1,t.preventInnerCloseTimeout=null,t.keyPressed=!1,t.imageCache={},t.lastKeyDownTime=0,t.resizeTimeout=null,t.wheelActionTimeout=null,t.resetScrollTimeout=null,t.scrollX=0,t.scrollY=0,t.moveStartX=0,t.moveStartY=0,t.moveStartOffsetX=0,t.moveStartOffsetY=0,t.swipeStartX=0,t.swipeStartY=0,t.swipeEndX=0,t.swipeEndY=0,t.pinchTouchList=null,t.pinchDistance=0,t.keyCounter=0,t.moveRequested=!1,t}return t=l,n=[{key:"componentDidMount",value:function(){var e=this;this.props.animationDisabled||this.setState({isClosing:!1}),this.windowContext=KS(),this.listeners={resize:this.handleWindowResize,mouseup:this.handleMouseUp,touchend:this.handleTouchEnd,touchcancel:this.handleTouchEnd,pointerdown:this.handlePointerEvent,pointermove:this.handlePointerEvent,pointerup:this.handlePointerEvent,pointercancel:this.handlePointerEvent},Object.keys(this.listeners).forEach(function(t){e.windowContext.addEventListener(t,e.listeners[t])}),this.loadAllImages()}},{key:"shouldComponentUpdate",value:function(e){var t=this;return this.getSrcTypes().forEach(function(n){t.props[n.name]!==e[n.name]&&(t.moveRequested=!1)}),!this.moveRequested}},{key:"componentDidUpdate",value:function(e){var t=this,n=!1,r={},o={};this.getSrcTypes().forEach(function(i){e[i.name]!==t.props[i.name]&&(n=!0,r[e[i.name]]=!0,o[t.props[i.name]]=!0)}),(n||this.moveRequested)&&(Object.keys(r).forEach(function(e){!(e in o)&&e in t.imageCache&&(t.imageCache[e].loaded=!1)}),this.moveRequested=!1,this.loadAllImages(this.props))}},{key:"componentWillUnmount",value:function(){var e=this;this.didUnmount=!0,Object.keys(this.listeners).forEach(function(t){e.windowContext.removeEventListener(t,e.listeners[t])}),this.timeouts.forEach(function(e){return clearTimeout(e)})}},{key:"setTimeout",value:function(e){function t(_x,t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){var n=this,r=setTimeout(function(){n.timeouts=n.timeouts.filter(function(e){return e!==r}),e()},t);return this.timeouts.push(r),r})},{key:"setPreventInnerClose",value:function(){var e=this;this.preventInnerCloseTimeout&&this.clearTimeout(this.preventInnerCloseTimeout),this.preventInnerClose=!0,this.preventInnerCloseTimeout=this.setTimeout(function(){e.preventInnerClose=!1,e.preventInnerCloseTimeout=null},100)}},{key:"getBestImageForType",value:function(e){var t=this.props[e],n={};if(this.isImageLoaded(t))n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height);else{if(!this.isImageLoaded(this.props["".concat(e,"Thumbnail")]))return null;t=this.props["".concat(e,"Thumbnail")],n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height,!0)}return{src:t,height:this.imageCache[t].height,width:this.imageCache[t].width,targetHeight:n.height,targetWidth:n.width}}},{key:"getFitSizes",value:function(e,t,n){var r=this.getLightboxRect(),o=r.height-2*this.props.imagePadding,i=r.width-2*this.props.imagePadding;return n||(o=Math.min(o,t),i=Math.min(i,e)),i/o>e/t?{width:e*o/t,height:o}:{width:i,height:t*i/e}}},{key:"getMaxOffsets",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel,t=this.getBestImageForType("mainSrc");if(null===t)return{maxX:0,minX:0,maxY:0,minY:0};var n,r,o=this.getLightboxRect(),i=this.getZoomMultiplier(e);return{maxX:n=i*t.width-o.width<0?(o.width-i*t.width)/2:(i*t.width-o.width)/2,maxY:r=i*t.height-o.height<0?(o.height-i*t.height)/2:(i*t.height-o.height)/2,minX:-1*n,minY:-1*r}}},{key:"getSrcTypes",value:function(){return[{name:"mainSrc",keyEnding:"i".concat(this.keyCounter)},{name:"mainSrcThumbnail",keyEnding:"t".concat(this.keyCounter)},{name:"nextSrc",keyEnding:"i".concat(this.keyCounter+1)},{name:"nextSrcThumbnail",keyEnding:"t".concat(this.keyCounter+1)},{name:"prevSrc",keyEnding:"i".concat(this.keyCounter-1)},{name:"prevSrcThumbnail",keyEnding:"t".concat(this.keyCounter-1)}]}},{key:"getZoomMultiplier",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel;return Math.pow(1.007,e)}},{key:"getLightboxRect",value:function(){return this.outerEl.current?this.outerEl.current.getBoundingClientRect():{width:XS(),height:void 0!==globalThis.window?globalThis.window.innerHeight:0,top:0,right:0,bottom:0,left:0}}},{key:"clearTimeout",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){this.timeouts=this.timeouts.filter(function(t){return t!==e}),clearTimeout(e)})},{key:"changeZoom",value:function(e,t,n){if(this.props.enableZoom){var r=Math.max(0,Math.min(ZS,e));if(r!==this.state.zoomLevel)if(0!==r){var o=this.getBestImageForType("mainSrc");if(null!==o){var i=this.getZoomMultiplier(),a=this.getZoomMultiplier(r),l=this.getLightboxRect(),s=void 0!==t?t-l.left:l.width/2,c=void 0!==n?n-l.top:l.height/2,u=(l.width-o.width*i)/2,d=(l.height-o.height*i)/2,p=s-(s-(u-this.state.offsetX))/i*a,h=c-(c-(d-this.state.offsetY))/i*a,f=(l.width-o.width*a)/2-p,m=(l.height-o.height*a)/2-h;if(3!==this.currentAction){var g=this.getMaxOffsets();this.state.zoomLevel>r&&(f=Math.max(g.minX,Math.min(g.maxX,f)),m=Math.max(g.minY,Math.min(g.maxY,m)))}this.setState({zoomLevel:r,offsetX:f,offsetY:m})}}else this.setState({zoomLevel:r,offsetX:0,offsetY:0})}}},{key:"closeIfClickInner",value:function(e){!this.preventInnerClose&&e.target.className.search(/\bril-inner\b/)>-1&&this.requestClose(e)}},{key:"handleKeyInput",value:function(e){if(e.stopPropagation(),!this.isAnimating())if("keyup"!==e.type){var t=e.which||e.keyCode,n=new Date;if(!(n.getTime()-this.lastKeyDownTime<this.props.keyRepeatLimit&&27!==t))switch(this.lastKeyDownTime=n.getTime(),t){case 27:e.preventDefault(),this.requestClose(e);break;case 37:if(!this.props.prevSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMovePrev(e);break;case 39:if(!this.props.nextSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMoveNext(e)}}else this.lastKeyDownTime-=this.props.keyRepeatKeyupBonus}},{key:"handleOuterMousewheel",value:function(e){var t=this;e.stopPropagation();var n=0;this.clearTimeout(this.resetScrollTimeout),this.resetScrollTimeout=this.setTimeout(function(){t.scrollX=0,t.scrollY=0},300),null!==this.wheelActionTimeout||this.isAnimating()||(Math.abs(e.deltaY)<Math.abs(e.deltaX)&&(this.scrollY=0,this.scrollX+=e.deltaX,this.scrollX>=200||e.deltaX>=100?(this.requestMoveNext(e),n=500,this.scrollX=0):(this.scrollX<=-200||e.deltaX<=-100)&&(this.requestMovePrev(e),n=500,this.scrollX=0)),0!==n&&(this.wheelActionTimeout=this.setTimeout(function(){t.wheelActionTimeout=null},n)))}},{key:"handleImageMouseWheel",value:function(e){if(Math.abs(e.deltaY)>=Math.abs(e.deltaX)){if(e.stopPropagation(),Math.abs(e.deltaY)<1)return;this.scrollX=0,this.scrollY+=e.deltaY,this.changeZoom(this.state.zoomLevel-e.deltaY,e.clientX,e.clientY)}}},{key:"handleImageDoubleClick",value:function(e){this.state.zoomLevel>0?this.changeZoom(0,e.clientX,e.clientY):this.changeZoom(this.state.zoomLevel+100,e.clientX,e.clientY)}},{key:"shouldHandleEvent",value:function(e){if(this.eventsSource===e)return!0;if(0===this.eventsSource)return this.eventsSource=e,!0;switch(e){case 1:default:return!1;case 2:return this.eventsSource=2,this.filterPointersBySource(),!0;case 3:return 1===this.eventsSource&&(this.eventsSource=3,this.filterPointersBySource(),!0)}}},{key:"addPointer",value:function(e){this.pointerList.push(e)}},{key:"removePointer",value:function(e){this.pointerList=this.pointerList.filter(function(t){return t.id!==e.id})}},{key:"filterPointersBySource",value:function(){var e=this;this.pointerList=this.pointerList.filter(function(t){return t.source===e.eventsSource})}},{key:"handleMouseDown",value:function(e){this.shouldHandleEvent(1)&&l.isTargetMatchImage(e.target)&&(this.addPointer(l.parseMouseEvent(e)),this.multiPointerStart(e))}},{key:"handleMouseMove",value:function(e){this.shouldHandleEvent(1)&&this.multiPointerMove(e,[l.parseMouseEvent(e)])}},{key:"handleMouseUp",value:function(e){this.shouldHandleEvent(1)&&(this.removePointer(l.parseMouseEvent(e)),this.multiPointerEnd(e))}},{key:"handlePointerEvent",value:function(e){if(this.shouldHandleEvent(3))switch(e.type){case"pointerdown":l.isTargetMatchImage(e.target)&&(this.addPointer(l.parsePointerEvent(e)),this.multiPointerStart(e));break;case"pointermove":this.multiPointerMove(e,[l.parsePointerEvent(e)]);break;case"pointerup":case"pointercancel":this.removePointer(l.parsePointerEvent(e)),this.multiPointerEnd(e)}}},{key:"handleTouchStart",value:function(e){var t=this;this.shouldHandleEvent(2)&&l.isTargetMatchImage(e.target)&&([].forEach.call(e.changedTouches,function(e){return t.addPointer(l.parseTouchPointer(e))}),this.multiPointerStart(e))}},{key:"handleTouchMove",value:function(e){this.shouldHandleEvent(2)&&this.multiPointerMove(e,[].map.call(e.changedTouches,function(e){return l.parseTouchPointer(e)}))}},{key:"handleTouchEnd",value:function(e){var t=this;this.shouldHandleEvent(2)&&([].map.call(e.changedTouches,function(e){return t.removePointer(l.parseTouchPointer(e))}),this.multiPointerEnd(e))}},{key:"decideMoveOrSwipe",value:function(e){this.state.zoomLevel<=0?this.handleSwipeStart(e):this.handleMoveStart(e)}},{key:"multiPointerStart",value:function(e){switch(this.handleEnd(null),this.pointerList.length){case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"multiPointerMove",value:function(e,t){switch(this.currentAction){case 1:e.preventDefault(),this.handleMove(t[0]);break;case 2:e.preventDefault(),this.handleSwipe(t[0]);break;case 3:e.preventDefault(),this.handlePinch(t)}}},{key:"multiPointerEnd",value:function(e){switch(0!==this.currentAction&&(this.setPreventInnerClose(),this.handleEnd(e)),this.pointerList.length){case 0:this.eventsSource=0;break;case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"handleEnd",value:function(e){switch(this.currentAction){case 1:this.handleMoveEnd(e);break;case 2:this.handleSwipeEnd(e);break;case 3:this.handlePinchEnd(e)}}},{key:"handleMoveStart",value:function(e){var t=e.x,n=e.y;this.props.enableZoom&&(this.currentAction=1,this.moveStartX=t,this.moveStartY=n,this.moveStartOffsetX=this.state.offsetX,this.moveStartOffsetY=this.state.offsetY)}},{key:"handleMove",value:function(e){var t=e.x,n=e.y,r=this.moveStartX-t+this.moveStartOffsetX,o=this.moveStartY-n+this.moveStartOffsetY;this.state.offsetX===r&&this.state.offsetY===o||this.setState({offsetX:r,offsetY:o})}},{key:"handleMoveEnd",value:function(){var e=this;this.currentAction=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0;var t=this.getMaxOffsets(),n=Math.max(t.minX,Math.min(t.maxX,this.state.offsetX)),r=Math.max(t.minY,Math.min(t.maxY,this.state.offsetY));n===this.state.offsetX&&r===this.state.offsetY||(this.setState({offsetX:n,offsetY:r,shouldAnimate:!0}),this.setTimeout(function(){e.setState({shouldAnimate:!1})},this.props.animationDuration))}},{key:"handleSwipeStart",value:function(e){var t=e.x,n=e.y;this.currentAction=2,this.swipeStartX=t,this.swipeStartY=n,this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipe",value:function(e){var t=e.x,n=e.y;this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipeEnd",value:function(e){var t=this.swipeEndX-this.swipeStartX,n=Math.abs(t),r=Math.abs(this.swipeEndY-this.swipeStartY);if(this.currentAction=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,!(!e||this.isAnimating()||n<1.5*r)){if(n<200&&n<this.getLightboxRect().width/4)return;t>0&&this.props.prevSrc?(e.preventDefault(),this.requestMovePrev()):t<0&&this.props.nextSrc&&(e.preventDefault(),this.requestMoveNext())}}},{key:"calculatePinchDistance",value:function(){var e=qS(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,2),t=e[0],n=e[1];return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}},{key:"calculatePinchCenter",value:function(){var e=qS(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,2),t=e[0],n=e[1];return{x:t.x-(t.x-n.x)/2,y:t.y-(t.y-n.y)/2}}},{key:"handlePinchStart",value:function(e){this.props.enableZoom&&(this.currentAction=3,this.pinchTouchList=e.map(function(e){return{id:e.id,x:e.x,y:e.y}}),this.pinchDistance=this.calculatePinchDistance())}},{key:"handlePinch",value:function(e){this.pinchTouchList=this.pinchTouchList.map(function(t){for(var n=0;n<e.length;n+=1)if(e[n].id===t.id)return e[n];return t});var t=this.calculatePinchDistance(),n=this.state.zoomLevel+t-this.pinchDistance;this.pinchDistance=t;var r=this.calculatePinchCenter(this.pinchTouchList),o=r.x,i=r.y;this.changeZoom(n,o,i)}},{key:"handlePinchEnd",value:function(){this.currentAction=0,this.pinchTouchList=null,this.pinchDistance=0}},{key:"handleWindowResize",value:function(){this.clearTimeout(this.resizeTimeout),this.resizeTimeout=this.setTimeout(this.forceUpdate.bind(this),100)}},{key:"handleZoomInButtonClick",value:function(){var e=this.state.zoomLevel+100;this.changeZoom(e),e===ZS&&this.zoomOutBtn.current.focus()}},{key:"handleZoomOutButtonClick",value:function(){var e=this.state.zoomLevel-100;this.changeZoom(e),0===e&&this.zoomInBtn.current.focus()}},{key:"handleCaptionMousewheel",value:function(e){if(e.stopPropagation(),this.caption.current){var t=this.caption.current.getBoundingClientRect().height,n=this.caption.current,r=n.scrollHeight,o=n.scrollTop;(e.deltaY>0&&t+o>=r||e.deltaY<0&&o<=0)&&e.preventDefault()}}},{key:"isAnimating",value:function(){return this.state.shouldAnimate||this.state.isClosing}},{key:"isImageLoaded",value:function(e){return e&&e in this.imageCache&&this.imageCache[e].loaded}},{key:"loadImage",value:function(e,t,n){var r=this;if(this.isImageLoaded(t))this.setTimeout(function(){n()},1);else{var o=new globalThis.Image;this.props.imageCrossOrigin&&(o.crossOrigin=this.props.imageCrossOrigin),o.onerror=function(o){r.props.onImageLoadError(t,e,o),r.setState(function(t){return{loadErrorStatus:FS(FS({},t.loadErrorStatus),{},BS({},e,!0))}}),n(o)},o.onload=function(){r.props.onImageLoad(t,e,o),r.imageCache[t]={loaded:!0,width:o.width,height:o.height},n()},o.src=t}}},{key:"loadAllImages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;this.getSrcTypes().forEach(function(n){var r=n.name;t[r]&&e.state.loadErrorStatus[r]&&e.setState(function(e){return{loadErrorStatus:FS(FS({},e.loadErrorStatus),{},BS({},r,!1))}}),t[r]&&!e.isImageLoaded(t[r])&&e.loadImage(r,t[r],function(t,n){return function(r){r||e.props[t]!==n||e.didUnmount||e.forceUpdate()}}(r,t[r]))})}},{key:"requestClose",value:function(e){var t=this,n=function(){return t.props.onCloseRequest(e)};this.props.animationDisabled||"keydown"===e.type&&!this.props.animationOnKeyInput?n():(this.setState({isClosing:!0}),this.setTimeout(n,this.props.animationDuration))}},{key:"requestMove",value:function(e,t){var n=this,r={zoomLevel:0,offsetX:0,offsetY:0};this.props.animationDisabled||this.keyPressed&&!this.props.animationOnKeyInput||(r.shouldAnimate=!0,this.setTimeout(function(){return n.setState({shouldAnimate:!1})},this.props.animationDuration)),this.keyPressed=!1,this.moveRequested=!0,"prev"===e?(this.keyCounter-=1,this.setState(r),this.props.onMovePrevRequest(t)):(this.keyCounter+=1,this.setState(r),this.props.onMoveNextRequest(t))}},{key:"requestMoveNext",value:function(e){this.requestMove("next",e)}},{key:"requestMovePrev",value:function(e){this.requestMove("prev",e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.animationDisabled,r=t.animationDuration,o=t.clickOutsideToClose,i=t.discourageDownloads,a=t.enableZoom,s=t.imageTitle,c=t.nextSrc,u=t.prevSrc,d=t.toolbarButtons,p=t.reactModalStyle,h=t.onAfterOpen,f=t.imageCrossOrigin,m=t.reactModalProps,g=t.loader,v=this.state,y=v.zoomLevel,b=v.offsetX,w=v.offsetY,k=v.isClosing,E=v.loadErrorStatus,O=this.getLightboxRect(),x={};!n&&this.isAnimating()&&(x=FS(FS({},x),{},{transition:"transform ".concat(r,"ms")}));var S={};this.getSrcTypes().forEach(function(e){var t=e.name,n=e.keyEnding;S[t]=n});var _=[],C=function(t,n,r){if(e.props[t]){var o=e.getBestImageForType(t),a=FS(FS({},x),l.getTransform(FS(FS({},r),o)));if(y>0&&(a.cursor="move"),null===o&&(d=E,Object.keys(d).some(function(e){return d[e]})))_.push(ae().createElement("div",{className:"".concat(n," ril__image ril-errored"),style:a,key:e.props[t]+S[t]},ae().createElement("div",{className:"ril__errorContainer"},e.props.imageLoadErrorMessage)));else if(null!==o){var c=o.src;i?(a.backgroundImage="url('".concat(c,"')"),_.push(ae().createElement("div",{className:"".concat(n," ril__image ril__imageDiscourager"),onDoubleClick:e.handleImageDoubleClick,onWheel:e.handleImageMouseWheel,style:a,key:c+S[t]},ae().createElement("div",{className:"ril-download-blocker ril__downloadBlocker"})))):_.push(ae().createElement("img",WS({},f?{crossOrigin:f}:{},{className:"".concat(n," ril__image"),onDoubleClick:e.handleImageDoubleClick,onWheel:e.handleImageMouseWheel,onDragStart:function(e){return e.preventDefault()},style:a,src:c,key:c+S[t],alt:"string"==typeof s?s:YS("Image"),draggable:!1})))}else{var u=void 0!==g?g:ae().createElement("div",{className:"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon"},QS(new Array(12)).map(function(e,t){return ae().createElement("div",{key:t,className:"ril-loading-circle-point ril__loadingCirclePoint"})}));_.push(ae().createElement("div",{className:"".concat(n," ril__image ril-not-loaded"),style:a,key:e.props[t]+S[t]},ae().createElement("div",{className:"ril__loadingContainer"},u)))}}var d},P=this.getZoomMultiplier();C("nextSrc","ril-image-next ril__imageNext",{x:O.width}),C("mainSrc","ril-image-current",{x:-1*b,y:-1*w,zoom:P}),C("prevSrc","ril-image-prev ril__imagePrev",{x:-1*O.width});var T={overlay:FS({zIndex:1e3,backgroundColor:"transparent"},p.overlay),content:FS({backgroundColor:"transparent",overflow:"hidden",border:"none",borderRadius:0,padding:0,top:0,left:0,right:0,bottom:0},p.content)};return ae().createElement(RS(),WS({isOpen:!0,onRequestClose:o?this.requestClose:void 0,onAfterOpen:function(){e.outerEl.current&&e.outerEl.current.focus(),h()},style:T,contentLabel:YS("Lightbox"),appElement:void 0!==globalThis.window?globalThis.window.document.body:void 0},m),ae().createElement("div",{className:"ril-outer ril__outer ril__outerAnimating ".concat(this.props.wrapperClassName," ").concat(k?"ril-closing ril__outerClosing":""),style:{transition:"opacity ".concat(r,"ms"),animationDuration:"".concat(r,"ms"),animationDirection:k?"normal":"reverse"},ref:this.outerEl,onWheel:this.handleOuterMousewheel,onMouseMove:this.handleMouseMove,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,tabIndex:"-1",onKeyDown:this.handleKeyInput,onKeyUp:this.handleKeyInput},ae().createElement("div",{className:"ril-inner ril__inner",onClick:o?this.closeIfClickInner:void 0},_),u&&ae().createElement("button",{type:"button",className:"ril-prev-button ril__navButtons ril__navButtonPrev",key:"prev","aria-label":this.props.prevLabel,title:this.props.prevLabel,onClick:this.isAnimating()?void 0:this.requestMovePrev}),c&&ae().createElement("button",{type:"button",className:"ril-next-button ril__navButtons ril__navButtonNext",key:"next","aria-label":this.props.nextLabel,title:this.props.nextLabel,onClick:this.isAnimating()?void 0:this.requestMoveNext}),ae().createElement("div",{className:"ril-toolbar ril__toolbar"},ae().createElement("ul",{className:"ril-toolbar-left ril__toolbarSide ril__toolbarLeftSide"},ae().createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},ae().createElement("span",{className:"ril-toolbar__item__child ril__toolbarItemChild"},s))),ae().createElement("ul",{className:"ril-toolbar-right ril__toolbarSide ril__toolbarRightSide"},d&&d.map(function(e,t){return ae().createElement("li",{key:"button_".concat(t+1),className:"ril-toolbar__item ril__toolbarItem"},e)}),a&&ae().createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},ae().createElement("button",{type:"button",key:"zoom-in","aria-label":this.props.zoomInLabel,title:this.props.zoomInLabel,className:["ril-zoom-in","ril__toolbarItemChild","ril__builtinButton","ril__zoomInButton"].concat(QS(y===ZS?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomInBtn,disabled:this.isAnimating()||y===ZS,onClick:this.isAnimating()||y===ZS?void 0:this.handleZoomInButtonClick})),a&&ae().createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},ae().createElement("button",{type:"button",key:"zoom-out","aria-label":this.props.zoomOutLabel,title:this.props.zoomOutLabel,className:["ril-zoom-out","ril__toolbarItemChild","ril__builtinButton","ril__zoomOutButton"].concat(QS(0===y?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomOutBtn,disabled:this.isAnimating()||0===y,onClick:this.isAnimating()||0===y?void 0:this.handleZoomOutButtonClick})),ae().createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},ae().createElement("button",{type:"button",key:"close","aria-label":this.props.closeLabel,title:this.props.closeLabel,className:"ril-close ril-toolbar__item__child ril__toolbarItemChild ril__builtinButton ril__closeButton",onClick:this.isAnimating()?void 0:this.requestClose})))),this.props.imageCaption&&ae().createElement("div",{onWheel:this.handleCaptionMousewheel,onMouseDown:function(e){return e.stopPropagation()},className:"ril-caption ril__caption",ref:this.caption},ae().createElement("div",{className:"ril-caption-content ril__captionContent"},this.props.imageCaption))))}}],r=[{key:"isTargetMatchImage",value:function(e){return e&&/ril-image-current/.test(e.className)}},{key:"parseMouseEvent",value:function(e){return{id:"mouse",source:1,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parseTouchPointer",value:function(e){return{id:e.identifier,source:2,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parsePointerEvent",value:function(e){return{id:e.pointerId,source:3,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"getTransform",value:function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.zoom,a=void 0===i?1:i,l=e.width,s=e.targetWidth,c=n,u=XS();l>u&&(c+=(u-l)/2);var d=a*(s/l);return{transform:"translate3d(".concat(c,"px,").concat(o,"px,0) scale3d(").concat(d,",").concat(d,",1)")}}}],n&&zS(t.prototype,n),r&&zS(t,r),l}(oe.Component);JS.propTypes={mainSrc:IS().string.isRequired,prevSrc:IS().string,nextSrc:IS().string,mainSrcThumbnail:IS().string,prevSrcThumbnail:IS().string,nextSrcThumbnail:IS().string,onCloseRequest:IS().func.isRequired,onMovePrevRequest:IS().func,onMoveNextRequest:IS().func,onImageLoadError:IS().func,onImageLoad:IS().func,onAfterOpen:IS().func,discourageDownloads:IS().bool,animationDisabled:IS().bool,animationOnKeyInput:IS().bool,animationDuration:IS().number,keyRepeatLimit:IS().number,keyRepeatKeyupBonus:IS().number,imageTitle:IS().node,imageCaption:IS().node,imageCrossOrigin:IS().string,reactModalStyle:IS().shape({}),imagePadding:IS().number,wrapperClassName:IS().string,toolbarButtons:IS().arrayOf(IS().node),clickOutsideToClose:IS().bool,enableZoom:IS().bool,reactModalProps:IS().shape({}),nextLabel:IS().string,prevLabel:IS().string,zoomInLabel:IS().string,zoomOutLabel:IS().string,closeLabel:IS().string,imageLoadErrorMessage:IS().node,loader:IS().node},JS.defaultProps={imageTitle:null,imageCaption:null,toolbarButtons:null,reactModalProps:{},animationDisabled:!1,animationDuration:300,animationOnKeyInput:!1,clickOutsideToClose:!0,closeLabel:"Close lightbox",discourageDownloads:!1,enableZoom:!0,imagePadding:10,imageCrossOrigin:null,keyRepeatKeyupBonus:40,keyRepeatLimit:180,mainSrcThumbnail:null,nextLabel:"Next image",nextSrc:null,nextSrcThumbnail:null,onAfterOpen:function(){},onImageLoadError:function(){},onImageLoad:function(){},onMoveNextRequest:function(){},onMovePrevRequest:function(){},prevLabel:"Previous image",prevSrc:null,prevSrcThumbnail:null,reactModalStyle:{},wrapperClassName:"",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",imageLoadErrorMessage:"This image failed to load",loader:void 0};const e_=JS,t_=function(e){var t,n,r,o=e.isOpen,i=e.images,a=e.setIsOpen,l=pe((0,oe.useState)(0),2),s=l[0],c=l[1];return ae().createElement(ae().Fragment,null,o?ae().createElement(e_,{enableZoom:!1,reactModalProps:{style:{overlay:{position:"initial",inset:"0px"},content:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",border:"none",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"0px",outline:"none",padding:"0px",zIndex:"9999"}},parentSelector:function(){return document.querySelector(".templately-container")}},mainSrc:null===(t=i[s])||void 0===t?void 0:t.url,nextSrc:null===(n=i[(s+1)%i.length])||void 0===n?void 0:n.url,prevSrc:null===(r=i[(s+i.length-1)%i.length])||void 0===r?void 0:r.url,onCloseRequest:function(){return a(!1)},onMovePrevRequest:function(){return c((s+i.length-1)%i.length)},onMoveNextRequest:function(){return c((s+1)%i.length)}}):"")},n_=gn(function(e,t){var n,r,o,i,a,l=null!==(n="blocks"===(null==t?void 0:t.type)?"sections":null==t?void 0:t.type)&&void 0!==n?n:"packs",s=1,c=1,u=e.general.platform,d=e.general.plan,p=e.general.filter.doQuery;if("sharedWorkspaces"===l||"workspaces"===l)s=null!==(r=null==e||null===(o=e[l])||void 0===o?void 0:o.currentPage)&&void 0!==r?r:1,c=null!==(i=null==e||null===(a=e[l])||void 0===a?void 0:a.totalPage)&&void 0!==i?i:1;else if("workspaceDetails"===l){var h,f,m=t.slug;s=null==e||null===(h=e[l])||void 0===h||null===(h=h[u])||void 0===h||null===(h=h[m])||void 0===h?void 0:h.currentPage,c=null==e||null===(f=e[l])||void 0===f||null===(f=f[u])||void 0===f||null===(f=f[m])||void 0===f?void 0:f.totalPage}else if("clouds"===l){var g,v,y,b;s=null!==(g=null==e||null===(v=e[l])||void 0===v||null===(v=v.items)||void 0===v||null===(v=v[u])||void 0===v?void 0:v.currentPage)&&void 0!==g?g:1,c=null!==(y=null==e||null===(b=e[l])||void 0===b||null===(b=b.items)||void 0===b||null===(b=b[u])||void 0===b?void 0:b.totalPage)&&void 0!==y?y:1}else if("savedTemplates"===l){var w,k,E,O;s=null!==(w=null==e||null===(k=e[l])||void 0===k||null===(k=k[u])||void 0===k?void 0:k.currentPage)&&void 0!==w?w:1,c=null!==(E=null==e||null===(O=e[l])||void 0===O||null===(O=O[u])||void 0===O?void 0:O.totalPage)&&void 0!==E?E:1}else{var x,S,_,C;s=null==e||null===(x=e[l])||void 0===x||null===(x=x[d])||void 0===x||null===(x=x[u])||void 0===x?void 0:x.currentPage,c=null==e||null===(S=e[l])||void 0===S||null===(S=S[d])||void 0===S||null===(S=S[u])||void 0===S?void 0:S.totalPage,p&&(s=null==e||null===(_=e[l])||void 0===_||null===(_=_[d])||void 0===_||null===(_=_[u])||void 0===_||null===(_=_.filteredResults)||void 0===_?void 0:_.currentPage,c=null==e||null===(C=e[l])||void 0===C||null===(C=C[d])||void 0===C||null===(C=C[u])||void 0===C||null===(C=C.filteredResults)||void 0===C?void 0:C.totalPage)}return t.hasOwnProperty("states")&&(s=Ua(e,[].concat(Ul(t.states),["currentPage"]),1),c=Ua(e,[].concat(Ul(t.states),["totalPage"]),1)),{plan:d,platform:u,page:s,totalPage:c,need:c>1,doingQuery:p}},function(e){return{setPage:function(t){return e(function(e){var t=Wa(To,e.key);return"workspaces"===e.key?t=Go.SET_PAGE:"sharedWorkspaces"===e.key?t=Yo.SET_PAGE:"workspaceDetails"===e.key?t=Xo.SET_PAGE:"clouds"===e.key?t=$o.SET_PAGE:"savedTemplates"===e.key?t=qo:"favourites"===e.key?t=ao:"downloads"===e.key?t=bo:"purchasedItems"===e.key&&(t=xo),hv({type:t},e)}(t))}}})(function(e){var t,n=pe((0,oe.useState)(null!==(t=e.total)&&void 0!==t?t:1),2),r=n[0],o=n[1],i=pe((0,oe.useState)(!1),2),a=i[0],l=i[1],s=pe((0,oe.useState)([]),2),c=s[0],u=s[1],d=(0,oe.useCallback)(function(){return e.page>1},[e.page]),p=(0,oe.useCallback)(function(){return e.page<r},[e.page,r]);(0,oe.useEffect)(function(){o(e.total)},[e.type]),(0,oe.useEffect)(function(){if(a){var t={page:a,key:e.type,plan:e.plan,platform:e.platform,search:null};t.key="blocks"===t.key?"sections":t.key,e.slug&&(t.slug=e.slug),"favourites"!==e.type&&"downloads"!==e.type&&"purchasedItems"!==e.type||(t={key:e.type,page:a,states:e.states}),null!=e&&e.isSearch&&(t.search=!0),e.doingQuery&&(t.filtering=!0),e.setPage(t)}},[a]),(0,oe.useEffect)(function(){var t=1,n=r;r>10&&(t=Math.max(1,e.page-3),n=Math.min(e.page+3,r),e.page-1<=3&&(n=7),r-e.page<=3&&(t=r-6));var o=[];o.push(ae().createElement("li",{className:1==e.page?"epage-link epage-active":"epage-link",key:1,onClick:function(){return l(1)}},(0,At.__)(1,"templately"))),t>1?o.push(ae().createElement("li",{className:"epage-link",key:"dotdotdot"},(0,At.__)("...","templately"))):o.filter(function(e){return"dotdotdot"!=e.key});for(var i=function(t){o.push(ae().createElement("li",{className:e.page==t?"epage-link epage-active":"epage-link",key:t,onClick:function(){return l(t)}},(0,At.__)(t,"templately")))},a=t+1;a<n;a+=1)i(a);e.page+3<r&&n!==r&&o.push(ae().createElement("li",{className:"epage-link",key:"dotdotdotdot"},(0,At.__)("...","templately"))),o.push(ae().createElement("li",{className:e.page==r?"epage-link epage-active":"epage-link",key:r,onClick:function(){return l(r)}},(0,At.__)(r,"templately"))),r>=2&&u(o)},[r,e.page]);var h,f=(0,oe.useCallback)(function(){var t=e.page-1>0?e.page-1:0;l(t)},[r,e.page]),m=(0,oe.useCallback)(function(){var t=e.page+1<r?e.page+1:r;l(t)},[r,e.page]);return ae().createElement(ae().Fragment,null,!(c.length<2||!e.need)&&ae().createElement("div",{className:"templately-pagination"},ae().createElement("ul",null,(h=!d(),ae().createElement("li",{className:"epage-link pagination-arrow"},ae().createElement("button",{onClick:function(){return f()},disabled:h},ae().createElement(or,null)))),c,function(){var e=!p();return ae().createElement("li",{className:"epage-link pagination-arrow"},ae().createElement("button",{onClick:function(){return m()},disabled:e},ae().createElement(ir,null)))}())))});var r_=["element","isLoading","error","platform"];const o_=gn(function(e,t){var n,r,o,i,a,l,s,c="isLoading",u=null!==(n=null==t?void 0:t.stateSubKey)&&void 0!==n?n:"",d=e.general.platform;return s=null!=t&&t.stateKey?t.stateKey:"blocks"===(null==t?void 0:t.type)?"sections":null==t?void 0:t.type,null!=t&&t.loadingKey&&(c=t.loadingKey),u?(o=Ua(e,[s,d,u,c],!0),Ua(e,[s,d,u,"error"],null)):(o=null===(i=null==e||null===(a=e[s])||void 0===a?void 0:a[c])||void 0===i||i,null==e||null===(l=e[s])||void 0===l?void 0:l.error),null!=t&&t.isLoadingKey&&null!=t&&t.isKey&&(o=Ua(e,t.isLoadingKey[t.isKey],!0),0===t.isLoadingKey[t.isKey].length&&(o=!1)),{isLoading:o,error:null,platform:e.general.platform,isGloballySigned:null===(r=e.profile)||void 0===r?void 0:r.is_globally_signed}},function(e){return{logout:function(t){return e(zi(t))}}})(function(e){var t=e.element,n=e.isLoading,r=e.error,o=e.platform,i=Wn(e,r_);return ae().createElement(ae().Fragment,null,n&&ae().createElement(_l,null),!n&&null!=r&&ae().createElement(fl,re({},r,{platform:o,isGloballySigned:i.isGloballySigned,logout:i.logout})),!n&&null==r&&("function"==typeof t?t({isLoading:n}):t))});var i_=function(e){var t=Vn()("tm-message text-center");return React.createElement("div",{className:t},e.icon&&e.icon,e.title&&(Ga(e.title)?React.createElement("h3",{dangerouslySetInnerHTML:{__html:e.title}}):React.createElement("h3",null," ",e.title," ")),React.createElement("div",{className:"tm-message-body"},React.isValidElement(e.content)?e.content:"function"==typeof e.content?e.content(e.contentArgs):za(e.content)?Object.keys(e.content).map(function(t){return React.createElement("p",null,e.content[t])}):React.createElement("p",{dangerouslySetInnerHTML:{__html:e.content}})))};gn(function(e){return{platform:e.general.platform,sweetalert:e.sweetalert}},function(e){return{closeModal:function(){return e((0,Sy.closeModal)())}}})(function(e){return e.sweetalert.show&&Al(e.sweetalert),null});var a_=["is_verified"],l_=window.templately.no_items;const s_=function(e){var t=e.is_verified;return Wn(e,a_),ae().createElement(ae().Fragment,null,!1===t&&ae().createElement("p",{className:"text-danger templately-not-verified-account"},(0,At.__)("Please verify your email to continue.","templately")),ae().createElement("div",{className:"templately-no-items"},ae().createElement("div",{className:"templately-no-items-inner"},ae().createElement("img",{src:l_,alt:""}))))};function c_(e){return Zn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M.5 1a.5.5 0 0 0 0 1h1.11l.401 1.607 1.498 7.985A.5.5 0 0 0 4 12h1a2 2 0 1 0 0 4 2 2 0 0 0 0-4h7a2 2 0 1 0 0 4 2 2 0 0 0 0-4h1a.5.5 0 0 0 .491-.408l1.5-8A.5.5 0 0 0 14.5 3H2.89l-.405-1.621A.5.5 0 0 0 2 1zM6 14a1 1 0 1 1-2 0 1 1 0 0 1 2 0m7 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-1.646-7.646-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708"},child:[]}]})(e)}function u_(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 d_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u_(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var p_=[{to:"../clouds",label:(0,At.__)("My Cloud","templately"),className:"nav-item-clouds",icon:ae().createElement(Pn,null),end:!0},{to:"../clouds/workspace",label:(0,At.__)("My WorkSpace","templately"),className:"nav-item-workspace",icon:ae().createElement(Bn,null)},{to:"../clouds/shared-workspace",label:(0,At.__)("Shared with Me","templately"),className:"nav-item-shared-workspace",icon:ae().createElement(jn,null)},{to:"../favourites",label:(0,At.__)("My Favourites","templately"),className:"nav-item-profile-favourites",icon:ae().createElement(pr,null)},{to:"../downloads",label:(0,At.__)("My Downloads","templately"),className:"nav-item-profile-downloads",icon:ae().createElement(sr,null)},{to:"../purchased-items",label:(0,At.__)("Purchased Items","templately"),className:"nav-item-purchased-items",icon:ae().createElement(c_,null)}];const h_=gn(function(e){var t,n,r;return{isLoading:null===(t=e.clouds.status)||void 0===t?void 0:t.isLoading,statusError:null===(n=e.clouds.status)||void 0===n?void 0:n.error,percent:100*e.clouds.status.usage/e.clouds.status.limit,usage:null!==(r=e.clouds.status.usage)&&void 0!==r?r:0,limit:-1===e.clouds.status.limit?(0,At.__)("Unlimited","templately"):e.clouds.status.limit}})(function(e){var t,n=pe((0,oe.useState)({}),2),r=n[0],o=n[1],i=pe((0,oe.useState)({}),2),a=i[0],l=i[1];return(0,oe.useEffect)(function(){var t={},n={};e.percent>40&&(n={className:"bg-warning"},t=Tt({href:"https://templately.com/subscription?utm_source=plugin&utm_medium=cloudSidebar",target:"_blank",className:"tt-top tt-warning"},"data-templately-tooltip",(0,At.sprintf)((0,At.__)("You are using %d%% of your storage quota","templately"),e.percent))),e.percent>85&&(n={className:"bg-danger"},t=d_(d_({},t),{},Tt({className:"tt-top tt-danger"},"data-templately-tooltip",(0,At.__)("Your storage quota is runing out. Please upgrade your plan to upload more files.","templately")))),e.percent>99&&(n={className:"bg-danger"},t=d_(d_({},t),{},Tt({className:"tt-top tt-danger"},"data-templately-tooltip",(0,At.__)("You have reached your limit of files. Please upgrade your plan to upload more files.","templately")))),o(t),l(n)},[e.percent]),ae().createElement(ae().Fragment,null,ae().createElement(iS,{className:"templately-clouds-menu",activeItemClassName:"nav-item-active",routes:p_,sidebar:!0}),ae().createElement("div",{className:"templately-clouds-size"},e.isLoading?ae().createElement(_l,{style:"placeholder",template:"clouds_status"}):ae().createElement("a",r,ae().createElement("p",null,(0,At.__)("My Cloud Status","templately")),(null===(t=e.statusError)||void 0===t?void 0:t.message)&&ae().createElement("p",{className:"text-danger"},(0,At.__)("Please verify your email to continue.","templately")),null===e.statusError&&ae().createElement(ae().Fragment,null,ae().createElement("div",null,ae().createElement("span",re({},a,{style:{width:"".concat(e.percent,"%")}}))),ae().createElement("p",null,(0,At.sprintf)((0,At.__)("%d of %s files","templately"),e.usage,e.limit))))))}),f_=gn(function(e){var t,n,r,o,i,a;return{isLoading:null===(t=null===(n=e.general.templateTypes)||void 0===n?void 0:n.isLoading)||void 0===t||t,types:null!==(r=null===(o=e.general.templateTypes)||void 0===o?void 0:o.lists)&&void 0!==r?r:[],template_type_id:null!==(i=null===(a=e.general.filter)||void 0===a?void 0:a.template_type_id)&&void 0!==i?i:"all"}},function(e){return{getTypes:function(t){return e(function(e){return hv({type:zr},e)}(t))},setTypes:function(t){return e(mv({key:"template_type_id",data:t}))},doFilter:function(){return e(vv())}}})(function(e){var t=it();pe(Ct(),1)[0],(0,oe.useEffect)(function(){e.getTypes({itemType:t.type})},[t.type]);var n=FE(function(t){e.setTypes(t)});return e.isLoading?ae().createElement(_l,{style:"placeholder",template:"lists"}):ae().createElement("div",{className:"templately-template-types"},ae().createElement("ul",{className:"templately-list tl-ul"},ae().createElement("li",{key:"templateTypes-all",className:"".concat("all"===e.template_type_id?"templately-list-item-active":"")},ae().createElement("input",{onChange:function(){return n("all")},type:"radio",checked:"all"===e.template_type_id,name:"templateTypes",id:"templateTypes-all",value:"all"}),ae().createElement("label",{htmlFor:"templateTypes-all"},(0,At.__)("All","templately"))),e.types.map(function(t){var r={className:t.id===e.template_type_id?"templately-list-item-active":""};return ae().createElement("li",re({key:"templateTypes-".concat(t.id)},r),ae().createElement("input",{onChange:function(){return n(t.id)},type:"radio",checked:e.template_type_id===t.id,name:"templateTypes",id:"templateTypes-".concat(t.id),value:t.id}),ae().createElement("label",{htmlFor:"templateTypes-".concat(t.id)},t.name))})))}),m_=gn(function(e){var t,n,r,o,i,a;return{isLoading:null!==(t=null===(n=e.general.categories)||void 0===n?void 0:n.isLoading)&&void 0!==t&&t,categories:null!==(r=null===(o=e.general.categories)||void 0===o?void 0:o.lists)&&void 0!==r?r:[],category_id:null!==(i=null===(a=e.general.filter)||void 0===a?void 0:a.category_id)&&void 0!==i?i:"all"}},function(e){return{getCategories:function(t){return e(function(e){return hv({type:Vr},e)}(t))},setCategory:function(t){return e(mv({key:"category_id",data:t}))},doFilter:function(){return e(vv())}}})(function(e){(0,oe.useEffect)(function(){e.getCategories()},[]);var t=FE(function(t){e.setCategory(t)});return e.isLoading?ae().createElement(_l,{style:"placeholder",template:"lists"}):ae().createElement("div",{className:"templately-template-categories"},ae().createElement("ul",{className:"templately-list tl-ul"},ae().createElement("li",{key:"tc-category-all",className:"".concat("all"===e.category_id?"templately-list-item-active":"")},ae().createElement("input",{onChange:function(){return t("all")},type:"radio",checked:"all"===e.category_id,name:"tcategory",id:"tc-category-all",value:"all"}),ae().createElement("label",{htmlFor:"tc-category-all"},(0,At.__)("All","templately"))),e.categories.map(function(n){var r={className:n.id===e.category_id?"templately-list-item-active":""};return ae().createElement("li",re({key:"tc-category-".concat(n.id)},r),ae().createElement("input",{onChange:function(){return t(n.id)},type:"radio",checked:e.category_id===n.id,name:"tcategory",id:"tc-category-".concat(n.id),value:n.id}),ae().createElement("label",{htmlFor:"tc-category-".concat(n.id)},n.name))})))}),g_=gn(function(e){var t,n,r;return{tags:null!==(t=e.general.tags)&&void 0!==t?t:[],isReseted:0===(null===(n=e.general.filter)||void 0===n?void 0:n.tags.length),selectedTags:null===(r=e.general.filter)||void 0===r?void 0:r.tags}},function(e){return{getTags:function(){return e({type:jr})},setTags:function(t){return e(mv({key:"tags",data:t}))}}})(function(e){var t=(0,oe.useMemo)(function(){return e.tags.filter(function(t){var n;return null===(n=e.selectedTags)||void 0===n?void 0:n.includes(t.value)})},[e.tags,e.selectedTags]);(0,oe.useEffect)(function(){var t;0===(null===(t=e.tags)||void 0===t?void 0:t.length)&&e.getTags()},[]);var n=(0,oe.useCallback)(function(t){null!=t?(t=t.map(function(e){return e.value}),e.setTags(t)):e.setTags([])},[]);return ae().createElement("div",{className:"templately-tags ts-single"},ae().createElement("label",{htmlFor:"templately_tags"},(0,At.__)("Filter Items by Tags","templately")),ae().createElement(Fg,{isMulti:!0,placeholder:(0,At.__)("Write a keyword...","templately"),name:"templately_tags",options:e.tags,classNamePrefix:"templately-tags",onChange:n,maxMenuHeight:200,value:t}))}),v_=gn(function(e){return{filter:e.general.filter,doingQuery:e.general.filter.doQuery}},function(e){return{doFilter:function(){return e(vv())},resetFilter:function(t){return e(gv(t))}}})(function(e){var t=rt(),n=pe(Ct(),1)[0],r=pe((0,oe.useState)(!0),2),o=r[0],i=r[1],a=pe((0,oe.useState)(e.filter),1)[0];(0,oe.useEffect)(function(){var t,n;t=e.filter,n=a,(0,_a.isEqual)(t,n)?i(!0):i(!1)},[e.filter]);var l="";return n.get("path")&&(l=ub(n.get("path"),null,["category","tag_id","templateType","activeFilter","include","exclude","tags"])),ae().createElement("div",{className:"ts-single templately-filter-buttons"},ae().createElement("button",{disabled:o,className:"templately-button tf-filter",onClick:function(){return e.doFilter()}},(0,At.__)("Filter","templately")),e.doingQuery&&ae().createElement("button",{className:"templately-button tf-reset",onClick:function(){t(l),e.resetFilter({fromButton:!0})}},(0,At.__)("Reset","templately")))});var y_=(0,oe.createContext)({includes:[],excludes:[],setIncludes:function(e){return e},setExcludes:function(e){return e}}),b_=function(e){var t=e.children,n=e.isReseted,r=e.dependencies,o=e.activeFilter,i=e.setActiveFilter,a=e.activeControls,l=e.setActiveControls,s=pe((0,oe.useState)(r.map(function(e){return e.id})),2),c=s[0],u=(s[1],pe((0,oe.useState)("none"),2)),d=u[0],p=u[1];return(0,oe.useEffect)(function(){n&&l(r)},[r]),(0,oe.useEffect)(function(){a.every(function(e){return"none"===e.action})?p("none"):a.every(function(e){return"include"===e.action})?p("include"):a.every(function(e){return"exclude"===e.action})?p("exclude"):p("mixed")},[a]),ae().createElement(y_.Provider,{value:{activeFilter:o,setActiveFilter:i,controls:c,activeControls:a,setActiveControls:l,activeState:d,setActiveState:p}},t)};const w_=y_;var k_=["children","className"];function E_(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 O_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E_(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const x_=function(e){e.children;var t=e.className,n=Wn(e,k_),r=(0,oe.useContext)(w_),o=r.activeControls,i=r.setActiveControls,a=r.activeState,l=r.setActiveState,s=r.activeFilter,c=r.setActiveFilter,u=(0,oe.useCallback)(function(){switch(a){case"none":case"mixed":i(o.map(function(e){return O_(O_({},e),{},{action:"include"})})),l("include");break;case"include":i(o.map(function(e){return O_(O_({},e),{},{action:"exclude"})})),l("exclude");break;default:i(o.map(function(e){return O_(O_({},e),{},{action:"none"})})),l("none")}},[o,i,l,a]);return ae().createElement("div",{className:"t-dependencies-header"},ae().createElement("div",{className:"td-batch-select","aria-checked":a},ae().createElement("span",re({role:"checkbox","aria-checked":a,tabIndex:0,onClick:u,onKeyDown:function(e){return 32===e.keyCode&&u()},className:t?"".concat(t," tri-state-all-checkbox"):"tri-state-all-checkbox"},n),n.title),ae().createElement("span",{className:"tsdf-actions",onClick:function(){var e="";"pro"===n.filter&&"pro"!==s&&(e="pro"),"free"===n.filter&&"free"!==s&&(e="free"),c(e)}},"free"===s&&"free"===n.filter||"pro"===s&&"pro"===n.filter?ae().createElement(ar,null):ae().createElement(rr,null))))};var S_=["id","content"];function C_(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 P_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C_(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const T_=function(e){var t=e.id,n=e.content,r=(Wn(e,S_),(0,oe.useContext)(w_)),o=r.activeControls,i=r.setActiveControls,a=(0,oe.useCallback)(function(){var e=Ul(o);e=e.map(function(e){return e.id===t?P_(P_({},e),{},{action:"none"===e.action?"include":"include"===e.action?"exclude":"exclude"===e.action?"none":"include"}):e}),i(e)},[o,t]),l=(0,oe.useCallback)(function(e){var t=o.find(function(t){return t.id===e});return t?t.action:"none"},[o]),s=Vn()("tri-state-checkbox",{"tri-state-include":"include"===l(t),"tri-state-exclude":"exclude"===l(t)});return ae().createElement("li",{className:s},ae().createElement("input",{checked:"include"===l(t),type:"checkbox",id:"tsdf-".concat(t),onChange:a}),ae().createElement("label",{htmlFor:"tsdf-".concat(t)},n.name))};function A_(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 M_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A_(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const N_=gn(function(e){var t,n,r,o,i=e.general.platform,a=null!==(t=null===(n=e.general.dependencies)||void 0===n?void 0:n[i])&&void 0!==t?t:[],l=null!==(r=null===(o=e.general.dependencies)||void 0===o?void 0:o.unknown)&&void 0!==r?r:[];return[].concat(Ul(a),Ul(l)),{dependencies:a,activeFilter:e.general.filter.activeFilter||"free",filterableDeps:e.general.filter.dependencies,isReseted:0==e.general.filter.dependencies.include.length&&0==e.general.filter.dependencies.exclude.length}},function(e){return{getDependencies:function(){return e({type:Lr})},setDependencies:function(t){return e(mv({key:"dependencies",data:t}))},setActiveFilter:function(t){return e(mv({key:"activeFilter",data:t}))}}})(function(e){var t=e.activeFilter,n=e.setActiveFilter,r=pe((0,oe.useState)([]),2),o=r[0],i=r[1],a=pe((0,oe.useState)([]),2),l=a[0],s=a[1],c=e.activeFreeControls,u=e.setActiveFreeControls,d=e.activeProControls,p=e.setActiveProControls;(0,oe.useEffect)(function(){var t;0===(null===(t=e.dependencies)||void 0===t?void 0:t.length)&&e.getDependencies()},[]),(0,oe.useEffect)(function(){var t;0!=(null===(t=e.dependencies)||void 0===t?void 0:t.length)&&(i(e.dependencies.filter(function(e){return e.is_pro})),s(e.dependencies.filter(function(e){return!e.is_pro})))},[e.dependencies]),(0,oe.useEffect)(function(){e.isReseted&&(i(e.dependencies.filter(function(e){return e.is_pro})),s(e.dependencies.filter(function(e){return!e.is_pro})))},[e.isReseted]),(0,oe.useEffect)(function(){var t,n,r=[],o=[];d.map(function(e){"include"===e.action&&r.push(e.id),"exclude"===e.action&&o.push(e.id)}),c.map(function(e){"include"===e.action&&r.push(e.id),"exclude"===e.action&&o.push(e.id)});var i=r.length!==(null===(t=e.filterableDeps.include)||void 0===t?void 0:t.length)||r.some(function(t){return!e.filterableDeps.include.includes(t)}),a=o.length!==(null===(n=e.filterableDeps.exclude)||void 0===n?void 0:n.length)||o.some(function(t){return!e.filterableDeps.exclude.includes(t)});(i||a)&&e.setDependencies({include:r,exclude:o})},[c,d]);var h=(0,oe.useMemo)(function(){return o.map(function(e){return M_(M_({},e),{},{action:"none"})})},[o]),f=(0,oe.useMemo)(function(){return l.map(function(e){return M_(M_({},e),{},{action:"none"})})},[l]),m=Vn()("templately-pro-dependencies td-single",{"tsdf-open":"pro"===t}),g=Vn()("templately-free-dependencies td-single",{"tsdf-open":"free"===t});return 0==f.length&&0==h.length?null:ae().createElement("div",{className:"templately-dependencies ts-single"},h.length>0&&ae().createElement("div",{className:m},ae().createElement(b_,{isReseted:e.isReseted,activeFilter:t,setActiveFilter:n,dependencies:h,activeControls:d,setActiveControls:p},ae().createElement(x_,{filter:"pro",title:(0,At.__)("Pro Plugins Dependencies","templately")}),ae().createElement("ul",{className:"t-dependencies-list"},h.map(function(e){return ae().createElement(T_,{key:e.id,id:e.id,content:e})})))),f.length>0&&ae().createElement("div",{className:g},ae().createElement(b_,{isReseted:e.isReseted,activeFilter:t,setActiveFilter:n,dependencies:f,activeControls:c,setActiveControls:u},ae().createElement(x_,{filter:"free",title:(0,At.__)("Free Plugins Dependencies","templately")}),ae().createElement("ul",{className:"t-dependencies-list"},f.map(function(e){return ae().createElement(T_,{key:e.id,id:e.id,content:e})})))))});function D_(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}const I_=gn(function(e){var t,n,r,o,i,a,l,s=e.general.platform,c=null!==(t=null===(n=e.general.dependencies)||void 0===n?void 0:n[s])&&void 0!==t?t:[];return{tags:null!==(r=e.general.tags)&&void 0!==r?r:[],types:null!==(o=null===(i=e.general.templateTypes)||void 0===i?void 0:i.lists)&&void 0!==o?o:[],categories:null!==(a=null===(l=e.general.categories)||void 0===l?void 0:l.lists)&&void 0!==a?a:[],dependencies:c}},function(e){return{setTypes:function(t){return e(mv({key:"template_type_id",data:t}))},setActiveFilter:function(t){return e(mv({key:"activeFilter",data:t}))},setDependencies:function(t){return e(mv({key:"dependencies",data:t}))},setTags:function(t){return e(mv({key:"tags",data:t}))},setCategory:function(t){return e(mv({key:"category_id",data:t}))},doFilter:function(){return e(vv())}}})(function(e){var t=it(),n=pe(Ct(),1)[0],r=pe((0,oe.useState)([]),2),o=r[0],i=r[1],a=pe((0,oe.useState)([]),2),l=a[0],s=a[1];return(0,oe.useEffect)(function(){var t,r,o,a,l,c;if((0!=(null===(t=e.types)||void 0===t?void 0:t.length)||0!=(null===(r=e.categories)||void 0===r?void 0:r.length))&&0!=(null===(o=e.dependencies)||void 0===o?void 0:o.length)){var u=n.get("templateType"),d=n.get("category"),p=n.get("activeFilter"),h=(null===(a=n.get("include"))||void 0===a?void 0:a.split(",").map(Number))||[],f=(null===(l=n.get("exclude"))||void 0===l?void 0:l.split(",").map(Number))||[],m=(null===(c=n.get("tags"))||void 0===c?void 0:c.split(",").map(Number))||[],g=m.length||h.length||f.length||p||u||d;if("all"!=u){var v=e.types.find(function(e){return e.slug===u});null!=v&&v.id&&e.setTypes(null==v?void 0:v.id)}else u&&e.setTypes("all");if("all"!=d){var y=e.categories.find(function(e){return e.slug===d});null!=y&&y.id&&e.setCategory(null==y?void 0:y.id)}else d&&e.setCategory("all");if(m&&e.setTags(m),p&&e.setActiveFilter(p),0!==h.length||0!==f.length){var b=function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D_(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({action:h.includes(e.id)?"include":f.includes(e.id)?"exclude":"none"},e)};s(e.dependencies.filter(function(e){return e.is_pro}).map(b)),i(e.dependencies.filter(function(e){return!e.is_pro}).map(b))}g&&e.doFilter()}},[e.types,e.categories,e.dependencies]),ae().createElement(ae().Fragment,null,ae().createElement(xS,null,"packs"===(null==t?void 0:t.type)&&ae().createElement(CS,{className:"ts-single",isActive:!0,title:(0,At.__)("Categories","templately")},ae().createElement(m_,null)),"packs"!==(null==t?void 0:t.type)&&ae().createElement(CS,{className:"ts-single",isActive:!0,title:(0,At.__)("Types","templately")},ae().createElement(f_,null))),ae().createElement(N_,{activeFreeControls:o,setActiveFreeControls:i,activeProControls:l,setActiveProControls:s}),ae().createElement(g_,null),ae().createElement("div",{className:"templately-sidebar-filter-buttons"},ae().createElement(v_,null)))}),L_=function(){var e=pe(Ct(),1)[0];return ov(e.get("path"))?"clouds/save-template"===e.get("path")?null:ae().createElement("div",{className:"templately-sidebar templately-clouds-sidebar"},ae().createElement(h_,null)):ae().createElement("div",{className:"templately-sidebar templately-templates-sidebar"},ae().createElement(I_,null))};var R_=["title","platform"],j_=function(e){var t=e.title,n=e.platform,r=Wn(e,R_);return ae().createElement("div",{className:"templatey-cloud-header"},Fu(n)?ae().createElement("img",{src:Fu(n),alt:t}):"",r.thumbnail&&ae().createElement("img",{width:"50px",src:r.thumbnail,alt:t}),ae().createElement("p",null,t))},F_=["menus","args","open","setWrapperClass"];function z_(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 B_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z_(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var W_=gn(function(e,t){var n,r,o,i=null===(n=t.redirect)||void 0===n?void 0:n.state,a=void 0;return i&&(a=Ua(e,i,null)===(null===(r=t.redirect)||void 0===r?void 0:r.if)?null===(o=t.redirect)||void 0===o?void 0:o.then:a),{redirect:a}})(function(e){var t=e.premenu,n=void 0!==t&&t,r=e.name,o=e.action,i=e.args,a=e.isOpen,l=e.icon,s=void 0===l?null:l,c=e.disabled,u=void 0!==c&&c,d=e.redux,p=e.ModalComponent,h=e.className,f=e.href,m=void 0!==f&&f,g=e.hrefKey,v=e.redirect,y=e.error,b=m;if(m){var w,k=null==i||null===(w=i.content)||void 0===w?void 0:w[g];b=null!=k?k:b}var E=rt(),O={disabled:u,className:h,onClick:function(e){a(!1)}};if(null!=y&&y.condition&&y.modalArgs)O.onClick=function(e){e.preventDefault(),Al(B_(B_({showCloseButton:!0},y.sweetArgs),{},{html:ae().createElement(dd,y.modalArgs)}),!0)};else if(!u&&!1===b){var x=B_(B_({},i),{},{ModalComponent:p});O.onClick=function(e){void 0===v?(o(x,d),a(!1)):E(ub(v))}}return ae().createElement(ae().Fragment,null,n?!1!==b?ae().createElement("a",re({},O,{href:b}),null!=s?ae().createElement("i",null,s):null,r):ae().createElement(ae().Fragment,null,ae().createElement("button",O,null!=s?ae().createElement("i",null,s):null,r)):ae().createElement("li",O,!1!==b?ae().createElement("a",{href:b},null!=s?ae().createElement("i",null,s):null,r):ae().createElement(ae().Fragment,null,null!=s?ae().createElement("i",null,s):null,r)))}),U_=ae().forwardRef(function(e,t){var n=e.menus,r=e.args,o=e.open,i=e.setWrapperClass,a=Wn(e,F_),l=pe((0,oe.useState)(o),2),s=l[0],c=l[1],u=(0,oe.useMemo)(function(){return n.filter(function(e){return void 0!==(null==e?void 0:e.include)&&!e.include&&1==!(null!=e&&e.hidden)})},[n]),d=(0,oe.useMemo)(function(){return n.filter(function(e){return(null==(null==e?void 0:e.include)||(null==e?void 0:e.include))&&1==!(null!=e&&e.hidden)})},[n]),p=null!=t?t:(0,oe.useRef)({btn:void 0,menu:void 0}),h=function(e){var t=p.current.btn.contains(e.target),n=p.current.menu&&p.current.menu.contains(e.target);t||n||c(!1)};(0,oe.useEffect)(function(){return document.addEventListener("mousedown",h),function(){return document.removeEventListener("mousedown",h)}},[]),(0,oe.useEffect)(function(){"function"==typeof i&&i(s)},[s]);var f=Vn()("templately-context-menu",{"templately-active":s});return ae().createElement(ae().Fragment,null,ae().createElement("div",{className:f},ae().createElement("div",{className:"tcm-pre-menus"},u.map(function(e){return ae().createElement(W_,re({premenu:!0,isOpen:c,key:e.name},e,{args:r,redux:a}))})),ae().createElement("button",{onClick:function(){return c(!s)},ref:function(e){return p.current.btn=e},className:"templately-context-btn"},ae().createElement(cr,null)),s&&ae().createElement("div",{className:"templately-context-menu-list",ref:function(e){return p.current.menu=e}},ae().createElement("ul",null,d.map(function(e){return ae().createElement(W_,re({isOpen:c,key:e.name},e,{args:r,redux:a}))})))))});U_.displayName="ContextMenu";const V_=gn(function(e){return{clouds:e.clouds,general:e.general,workspaces:e.workspaces,sharedWorkspaces:e.sharedWorkspaces,workspaceDetails:e.workspaceDetails}},null,null,{forwardRef:!0})(U_),H_=gn(function(e,t){var n;return{view:null==e?void 0:e[null!==(n=null==t?void 0:t.type)&&void 0!==n?n:"clouds"].view}},function(e){return{setView:function(t,n){return e(function(e){var t=e.stateKey;return{type:"clouds"===t?$o.SET_VIEW:"workspaces"===t?Go.SET_VIEW:"sharedWorkspaces"===t?Yo.SET_VIEW:"workspaceDetails"===t?Xo.SET_VIEW:$o.SET_VIEW,view:e.view}}({view:t,stateKey:n}))}}})(function(e){var t=(0,oe.useCallback)(function(t,n){return e.view===n?"active "+t:t},[e.view]);return ae().createElement("div",{className:"templately-view-buttons"},ae().createElement("button",{onClick:function(){return e.setView("grid",e.type)},className:t("templately-grid-view","grid")},ae().createElement(gr,null)),ae().createElement("button",{onClick:function(){return e.setView("list",e.type)},className:t("templately-list-view","list")},ae().createElement(nr,null)))});function q_(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 Q_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q_(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const $_=gn(function(e){var t,n;return{platform:e.general.platform,workspaces:null!==(t=e.workspaces.lists)&&void 0!==t?t:[],sharedWorkspaces:null!==(n=e.sharedWorkspaces.lists)&&void 0!==n?n:[],workspacesLoading:e.workspaces.isLoading,sharedWorkspacesLoading:e.sharedWorkspaces.isLoading}},function(e){return{dispatch:e,searchFiles:function(t){return e(ry(Q_(Q_({},t),{},{context:"list"})))},resetSearch:function(t){return e(function(e){return Bv({type:ny(null==e?void 0:e.source).RESET_SEARCH},e)}(Q_(Q_({},t),{},{context:"list"})))}}})(function(e){var t=e.dispatch,n=e.workspaces,r=e.sharedWorkspaces,o=(e.workspacesLoading,e.sharedWorkspacesLoading,rt()),i=pe((0,oe.useState)([]),2),a=i[0],l=i[1],s=pe((0,oe.useState)(null),2),c=s[0],u=s[1],d=pe((0,oe.useState)(""),2),p=d[0],h=d[1],f=pe((0,oe.useState)(!1),2),m=f[0],g=f[1];(0,oe.useEffect)(function(){0==n.length&&t(sy({list_only:!0})),0==r.length&&t(sy({list_only:!0,shared:!0}))},[]),(0,oe.useEffect)(function(){var e=[];n.length&&e.push({label:(0,At.__)("My WorkSpace","templately"),options:$a(n)}),n.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:$a(r)}),e.length>0&&l(e)},[n,r]),(0,oe.useEffect)(function(){var t,o;if((null===(t=o=null!=e&&e.shared?r.filter(function(t){return t.slug==(null==e?void 0:e.slug)}):n.filter(function(t){return t.slug==(null==e?void 0:e.slug)}))||void 0===t?void 0:t.length)>0){var i={label:o[0].name,value:o[0].id,slug:o[0].slug};u(i)}},[a]);var v=(0,oe.useCallback)(function(t){u(t);var n=null!=e&&e.shared?"clouds/shared-workspace/".concat(t.slug):"clouds/workspace/".concat(t.slug);n=ub(n),o(n)},[null==e?void 0:e.slug]),y=(0,oe.useMemo)(function(){return{key:"isAdded",error:{title:(0,At.__)("Something went wrong.","templately"),content:""},success:{title:(0,At.__)("Successfully Added!","templately"),content:(0,At.__)("Your file has been added to this workspace.","templately")}}},[]);return(0,oe.useEffect)(function(){if(m){var t={search:p,slug:e.slug,source:"workspace_details",file_type:e.platform,platform:e.platform};if(p.length>0){var n=(0,Ci.addQueryArgs)(ub(lb().pathname),{q:p});o(n),e.searchFiles(t)}else e.resetSearch(t);g(!1)}},[m]),ae().createElement("div",{className:"templately-workspace-filter-n-actions"},ae().createElement("div",{className:"twfa-header"},ae().createElement("button",{onClick:function(){return o(-1)},className:"templately-button tb-back"},ae().createElement(er,null)),ae().createElement("h3",null,(0,At.__)("My Files","templately"))),ae().createElement("div",{className:"twfa-actions"},ae().createElement("div",{className:"twfa-switcher-n-search"},ae().createElement(Fg,{placeholder:(0,At.__)("Current Workspace","templately"),className:"twfa-switcher",classNamePrefix:"templately",options:a,value:c,isLoading:null==c,loadingMessage:function(){return(0,At.__)("Loading workspace and shared workspaces list.","templately")},onChange:function(e){return v(e)}}),ae().createElement("div",{className:"twfa-search"},ae().createElement(bl,{wrapper:!1,placeholder:"Search...",onChange:function(e){return h(e.target.value)},onKeyDown:function(e){var t=e.keyCode;return g(13===t)}}),ae().createElement("button",{onClick:function(){return g(!0)},className:"templately-button tb-wf-search"},ae().createElement(fr,{size:14})))),ae().createElement("button",{onClick:function(){Al({customClass:{popup:"tp-large"},onConfirm:function(e){return Ml(y,e)},html:ae().createElement(qg,{slug:e.slug,id:e.id})},!0)},className:"templately-button tb-add"},ae().createElement(hr,null)),ae().createElement(H_,{type:"workspaceDetails"})))});var G_=o(6614);G_.domToReact,G_.htmlToDOM,G_.attributesToProps,G_.Comment,G_.Element,G_.ProcessingInstruction,G_.Text;const Y_=G_;var X_=["name","dispatch"];const K_=gn(function(e){var t;return{is_verified:null===(t=e.profile.data)||void 0===t?void 0:t.is_verified}})(function(e){var t=e.name,n=void 0===t?(0,At.__)("Add New Workspace","templately"):t,r=e.dispatch,o=Wn(e,X_),i=(0,oe.useMemo)(function(){return{key:"isCreated",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong while creating workspace for you. Try Later or Contact support.","templately")},success:{title:(0,At.__)("Successfully Created","templately"),content:function(e){var t=e.title;return Y_((0,At.sprintf)("%s <strong>%s</strong>",(0,At.__)("You have created a WorkSpace called","templately"),t))}}}},[]);return ae().createElement("div",{className:"templately-workspaces-column"},ae().createElement("div",{className:"templately-workspace templately-create-workspace",onClick:function(){o.is_verified?Al({dispatch:r,showCloseButton:!0,allowOutsideClick:!1,onConfirm:function(e){return Ml(i,e)},html:ae().createElement(Md,{dispatch:r})}):Al({showCloseButton:!0,allowOutsideClick:!1,icon:"error",title:"Oops...",html:ae().createElement("p",{className:"text-danger text-center"},(0,At.__)("Please verify your email to continue.","templately"))},!1)}},ae().createElement("div",{className:"templately-workspace-inner"},ae().createElement("span",{className:"tw-icon"}),ae().createElement("span",{className:"tw-title"},n))))}),Z_=function(e){var t=e.title;return ae().createElement("div",{className:"templately-workspaces-column"},ae().createElement("div",{className:"templately-workspace templately-create-workspace templately-no-workspaces"},ae().createElement("div",{className:"templately-workspace-inner"},ae().createElement("span",{className:"tw-icon"}),ae().createElement("span",{className:"tw-title"},t))))},J_=function(e){var t=e.profile_photo,n=e.name;return ae().createElement(ae().Fragment,null,null!==t?ae().createElement("span",{id:"tw-shared-image-wrapper"},ae().createElement("img",{src:t,alt:n.slice(0,1),onError:function(e){var t;"tw-shared-image-wrapper"==(null===(t=e.target.parentNode)||void 0===t?void 0:t.id)&&(e.target.parentNode.innerHTML="<span>"+e.target.alt+"</span>")}})):ae().createElement("span",null,n.slice(0,1)))};var eC=["name","slug","addNew","sharedWith","view","shared"];function tC(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}const nC=function(e){var t=e.name,n=e.slug,r=e.addNew,o=e.sharedWith,i=e.view,a=void 0!==i&&i,l=e.shared,s=void 0!==l&&l,c=(Wn(e,eC),rt()),u=kn();if(r)return ae().createElement(K_,{dispatch:u});var d=pe((0,oe.useState)([]),2),p=d[0],h=d[1],f=pe((0,oe.useState)(!1),2),m=f[0],g=f[1],v=pe((0,oe.useState)(!1),2),y=v[0],b=v[1];(0,oe.useEffect)(function(){null!=o&&o.length&&h(o.slice(0,s?5:4))},[]);var w=Vn()("templately-workspaces-column",{"templately-widefat":a}),k=Vn()("templately-workspace",{"templately-active":a||m}),E=Sn(function(e){var r,o,i=t,a=null===(r=e.workspaces.lists)||void 0===r?void 0:r.find(function(e){return e.slug===n});return a?i=a.name:null!==(o=e.workspaceDetails[n])&&void 0!==o&&o.name&&(i=e.workspaceDetails[n].name),i}),O=(0,oe.useRef)({btn:void 0,menu:void 0}),x=(0,oe.useRef)(),S=(0,oe.useCallback)(function(e){var t,n,r,o,i=(null===(t=O.current)||void 0===t?void 0:t.btn)&&(null===(n=O.current)||void 0===n?void 0:n.btn.contains(e.target)),a=(null===(r=O.current)||void 0===r?void 0:r.menu)&&O.current.menu.contains(e.target),l=null===(o=x.current)||void 0===o?void 0:o.contains(e.target);(!O.current&&s||!i&&!a&&!l)&&b(!0)},[n,s]);return(0,oe.useEffect)(function(){if(y&&""!==n&&!a){var t="clouds/".concat(s?"shared-workspace":"workspace","/").concat(n),r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tC(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);delete r.key,u(vy(r)),c(ub(t),{state:{slug:n}})}},[y]),ae().createElement("div",{className:w},ae().createElement("div",{className:k,onClick:S},ae().createElement("div",{className:"templately-workspace-inner"},!s&&ae().createElement(V_,{ref:O,args:{content:e},setWrapperClass:g,menus:Uu()}),ae().createElement("header",null,ae().createElement("span",{className:"tw-icon"}),ae().createElement("span",{className:"tw-title"},E)),ae().createElement("div",{className:"tw-share-with"},ae().createElement("p",null,(0,At.__)("Shared with:","templately")),ae().createElement("div",{className:"tw-share-with-list"},(null==p?void 0:p.length)>0&&p.map(function(e){return ae().createElement(J_,re({key:e.name.toLowerCase().replaceAll(" ","-")},e))}),!s&&ae().createElement("button",{ref:x,onClick:function(){return Bu({content:e,ModalComponent:Gg})}},ae().createElement(hr,null)))))))};function rC(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 oC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rC(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const iC=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d,p,h,f,m,g=t.slug,v=e.general.platform,y=null!==(n=null===(r=e.workspaceDetails)||void 0===r||null===(r=r[v])||void 0===r||null===(r=r[g])||void 0===r?void 0:r.currentPage)&&void 0!==n?n:1,b=null!==(o=null===(i=e.workspaceDetails)||void 0===i||null===(i=i[v])||void 0===i||null===(i=i[g])||void 0===i?void 0:i.totalPage)&&void 0!==o?o:1,w=e.workspaceDetails&&(null===(a=e.workspaceDetails)||void 0===a?void 0:a[v])&&(null===(l=e.workspaceDetails[v])||void 0===l?void 0:l[g])&&(null===(s=e.workspaceDetails[v][g])||void 0===s?void 0:s[y])&&e.workspaceDetails[v][g][y];return{current_screen:e.general.current_screen,details:null===(c=e.workspaceDetails)||void 0===c?void 0:c[g],items:null!=w?w:[],currentPage:y,totalPage:b,pages:{search:{currentPage:null!==(u=null===(d=e.workspaceDetails.data)||void 0===d?void 0:d.currentPage)&&void 0!==u?u:1,totalPage:null!==(p=null===(h=e.workspaceDetails.data)||void 0===h?void 0:h.totalPage)&&void 0!==p?p:1},list:{currentPage:y,totalPage:b}},userID:null!==(f=null===(m=e.profile.data)||void 0===m?void 0:m.id)&&void 0!==f?f:0,platform:e.general.platform,view:e.workspaceDetails.view,search:e.workspaceDetails.search}},function(e){return{getWorkSpaceDetails:function(t){return e(yy(t))},getWorkSpaceFiles:function(t){return e(ky(t))}}})(function(e){var t=e.items,n=e.details,r=e.slug,o=e.pages,i=pe((0,oe.useState)("list"),2),a=i[0],l=i[1],s=pe((0,oe.useState)([]),2),c=s[0],u=s[1],d=pe((0,oe.useState)(1),2),p=d[0],h=d[1],f=pe((0,oe.useState)(1),2),m=f[0],g=f[1];return(0,oe.useEffect)(function(){l("list")},[]),(0,oe.useEffect)(function(){m>=1&&e.getWorkSpaceFiles({slug:r,page:m,platform:e.platform})},[m]),(0,oe.useEffect)(function(){var n="list"===e.search.context&&e.search.keyword.length>0?e.search.data[e.search.data.currentPage]:t;if(n.length>0){var o=n.map(function(t){return[{id:"name",data:ae().createElement(j_,{title:t.name,platform:e.platform})},[{id:"last_modified",data:t.last_modified},{id:"action",data:ae().createElement(V_,{args:{content:oC(oC({},t),{},{slug:r,origin:"cloud"}),source:null!=e&&e.shared?"sharedWorkspace":"workspace"},menus:Zg(t.owner.id!==e.userID,e.current_screen)})}]]});u(o)}else u([])},[t,e.search]),(0,oe.useEffect)(function(){e.search.isLoading?l("search"):l("list")},[e.search]),(0,oe.useEffect)(function(){h(o[a].totalPage),g(o[a].currentPage)},[o]),ae().createElement("div",{className:"templately-workspace-details templately-workspaces"},ae().createElement("div",{className:"templately-workspaces-row"},ae().createElement(nC,re({shared:e.shared,view:!0,isSinglePage:!0},n)),ae().createElement($_,{id:null==n?void 0:n.id,slug:null==n?void 0:n.slug,shared:null==e?void 0:e.shared}),ae().createElement(o_,{stateKey:"workspaceDetails",loadingKey:"isFilesLoading",isKey:a,isLoadingKey:{search:["workspaceDetails","search","isLoading"],list:["workspaceDetails","isFilesLoading"]},element:function(t){return t.isLoading,0==c.length?ae().createElement(s_,null):ae().createElement("div",{className:"templately-workspaces-files"},ae().createElement(aS,{view:e.view,head:ae().createElement(cS,null)},ae().createElement(dS,{view:e.view,data:c})),p>1&&ae().createElement(n_,{slug:r,type:"workspaceDetails",total:p}))}})))});var aC=["user","isLoading","platform"];gn(function(e){var t,n,r,o,i,a,l,s,c;return{platform:e.general.platform,isLoading:e.profile.isLoading,user:null!==(t=null===(n=e.profile)||void 0===n?void 0:n.data)&&void 0!==t?t:null,isLoggedIn:null!==(null===(r=e.profile)||void 0===r?void 0:r.data),canLinkAccount:null!==(o=null===(i=e.profile)||void 0===i?void 0:i.link_account)&&void 0!==o&&o,canUnLinkAccount:null!==(a=null===(l=e.profile)||void 0===l?void 0:l.unlink_account)&&void 0!==a&&a,isGloballySigned:null===(s=e.profile)||void 0===s?void 0:s.is_globally_signed,signedAsGlobal:null===(c=e.profile)||void 0===c?void 0:c.signed_as_global}},function(e){return{loadProfile:function(t){return e(function(e){return ji({type:to},e)}(t))},logout:function(t){return e(zi(t))},linkAccount:function(){return e(Bi({linking:!0}))}}})(function(e){var t=e.user,n=(e.isLoading,e.platform),r=Wn(e,aC),o=rt();return(0,oe.useEffect)(function(){r.loadProfile()},[]),(0,oe.useEffect)(function(){r.isLoggedIn||o(ub("sign-in",{platform:n}),{replace:!0})},[r.isLoggedIn]),ae().createElement("div",{className:"templately-profile"},null!==(null==t?void 0:t.profile_photo)?ae().createElement("div",{className:"tp-image-wrap"},ae().createElement("img",{className:"tp-image",src:null==t?void 0:t.profile_photo,alt:null==t?void 0:t.name,onError:function(e){var t;e.target.src=null===(t=window)||void 0===t||null===(t=t.templately)||void 0===t||null===(t=t.icons)||void 0===t?void 0:t.profile}})):ae().createElement("div",{className:"tp-image-wrap"},ae().createElement(Rn,null)),ae().createElement("h1",{className:"tp-title"},(null==t?void 0:t.name)||"".concat(null==t?void 0:t.first_name," ").concat(null==t?void 0:t.last_name)),ae().createElement("ul",{className:"tp-details"},ae().createElement("li",null,ae().createElement("strong",null,(0,At.__)("Email","templately")),": ",null==t?void 0:t.email),ae().createElement("li",null,ae().createElement("strong",null,(0,At.__)("Joining Date","templately")),": ",null==t?void 0:t.joined),!(null!=t&&t.is_verified)&&ae().createElement("li",null,ae().createElement("p",{className:"text-danger"},(0,At.__)("Please verify your email to continue.","templately")))),ae().createElement("div",{className:"tp-managerial-links"},ae().createElement("a",{className:"tb-manage-account templately-button",target:"_blank",href:"https://templately.com/profile?utm_source=plugin&utm_medium=profile"},(0,At.__)("Manage Account","templately")),r.canLinkAccount&&ae().createElement(eS,{to:"sign-in",query:{"add-account":!0},className:"tb-link-account templately-button"},(0,At.__)("Link My Account","templately")),r.isLoggedIn&&!r.canLinkAccount&&ae().createElement(vl,{className:"tb-logout",onClick:function(){return r.logout({isGloballySigned:!r.signedAsGlobal&&r.canUnLinkAccount?!r.isGloballySigned:r.isGloballySigned})},label:!r.signedAsGlobal&&r.canUnLinkAccount?(0,At.__)("Unlink My Account","templately"):(0,At.__)("Logout","templately")})))});var lC=[{name:"Name",id:"name"},[{name:"Type",id:"type"},{name:"Downloaded At",id:"downloaded_at"}]];const sC=gn(function(e){var t,n,r,o,i,a,l,s,c,u=e.general.platform,d=null!==(t=null===(n=e.profile.downloads)||void 0===n?void 0:n.currentPage)&&void 0!==t?t:1;return{currentPage:d,totalPage:null!==(r=null===(o=e.profile.downloads)||void 0===o?void 0:o.totalPage)&&void 0!==r?r:1,platform:u,items:null!==(i=(null===(a=e.profile.downloads)||void 0===a?void 0:a[d])&&e.profile.downloads[d])&&void 0!==i?i:[],isLoading:null===(l=e.profile.downloads)||void 0===l?void 0:l.isLoading,is_verified:null!==(s=null===(c=e.profile.data)||void 0===c?void 0:c.is_verified)&&void 0!==s&&s}},function(e){return{getDownloads:function(t){return e(sa(t))}}})(function(e){var t=pe((0,oe.useState)([]),2),n=t[0],r=t[1];(0,oe.useEffect)(function(){e.currentPage>1&&0==e.items.length&&e.getDownloads({page:e.currentPage})},[e.currentPage]),(0,oe.useEffect)(function(){if(e.items.length>0){var t=e.items.map(function(t){return[{id:"name",data:ae().createElement(eS,{className:"templately-downloaded-item",to:"".concat(e.platform,"/").concat(t.type,"s/").concat(t.slug)},ae().createElement(j_,{title:t.name,thumbnail:t.thumbnail}))},[{id:"type",data:t.type},{id:"downloaded_at",data:t.downloaded_at}]]});r(t)}},[e.items]);var o=Vn()("templately-my-downloads",{"templately-has-no-items":0==n.length});return ae().createElement("div",{className:o},ae().createElement("div",{className:"templately-items templately-download-items"},n.length>0&&!e.isLoading&&ae().createElement(aS,{view:"list",head:ae().createElement(cS,{columns:lC})},ae().createElement(dS,{view:"list",data:n})),0===n.length&&!e.isLoading&&ae().createElement(s_,{is_verified:e.is_verified})),e.totalPage>1&&ae().createElement(n_,{states:["profile","downloads"],type:"downloads",total:e.totalPage}))});function cC(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 uC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cC(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const dC=gn(function(e){var t,n,r,o,i,a,l,s,c,u,d,p,h,f,m=e.general.platform,g=null!==(t=e.profile.favourites.type)&&void 0!==t?t:"all",v=null!==(n=e.profile.favourites.plan)&&void 0!==n?n:"all",y=null!==(r=null===(o=e.profile.favourites)||void 0===o||null===(o=o[v])||void 0===o||null===(o=o[m])||void 0===o||null===(o=o[g])||void 0===o?void 0:o.currentPage)&&void 0!==r?r:1;return{currentPage:y,totalPage:null!==(i=null===(a=e.profile.favourites)||void 0===a||null===(a=a[v])||void 0===a||null===(a=a[m])||void 0===a||null===(a=a[g])||void 0===a?void 0:a.totalPage)&&void 0!==i?i:1,platform:m,type:g,plan:v,items:null!==(l=(null===(s=e.profile.favourites)||void 0===s?void 0:s[v])&&(null===(c=e.profile.favourites[v])||void 0===c?void 0:c[m])&&(null===(u=e.profile.favourites[v][m])||void 0===u?void 0:u[g])&&(null===(d=e.profile.favourites[v][m][g])||void 0===d?void 0:d[y])&&e.profile.favourites[v][m][g][y])&&void 0!==l?l:[],isLoggedIn:null!==(null===(p=e.profile)||void 0===p?void 0:p.data),is_verified:null!==(h=null===(f=e.profile.data)||void 0===f?void 0:f.is_verified)&&void 0!==h&&h}},function(e){return{getFavourites:function(t){return e(Gi(t))}}})(function(e){var t=pe((0,oe.useState)(e.plan),2),n=t[0],r=t[1],o=pe((0,oe.useState)(e.type),2),i=o[0],a=o[1],l=pe((0,oe.useState)(e.currentPage),2),s=l[0],c=l[1];(0,oe.useEffect)(function(){e.type===i&&e.plan===n&&e.currentPage==s||(e.getFavourites({platform:e.platform,itemType:e.type,plan:e.plan,page:e.currentPage}),r(n),a(i),c(e.currentPage))},[e.type,e.plan,e.currentPage]);var u=(0,_a.isArray)(e.items)&&e.items.length>0,d=!(0,_a.isArray)(e.items)||0===e.items.length||"empty"===e.items,p=Vn()("templately-my-favourites",{"templately-has-no-items":d});return ae().createElement("div",{className:p},u?ae().createElement(qC,{items:e.items.map(function(e){return uC(uC({},e),{},{id:parseInt(e.id)})}),isLoggedIn:e.isLoggedIn,platform:e.platform,totalPage:e.totalPage,type:"favourites",pagination:{states:["profile","favourites",e.plan,e.platform,e.type]}}):ae().createElement(s_,{is_verified:e.is_verified}))}),pC=gn(function(e){var t,n;return{activeType:null!==(t=e.profile.favourites.type)&&void 0!==t?t:"all",activePlan:null!==(n=e.profile.favourites.plan)&&void 0!==n?n:"all"}},function(e){return{setFavouriteFilter:function(t,n){return e(ji({type:io},{filter:t,data:n}))}}})(function(e){var t=function(t){e.setFavouriteFilter("type",t)},n=function(t){e.setFavouriteFilter("plan",t)};return ae().createElement("div",{className:"templatley-favourites-filter"},ae().createElement("div",{className:"tf-type-filter templately-plan-switcher"},ae().createElement("button",{onClick:function(){return t("all")},className:"templately-button components-button tb-all tf-filter-btn ".concat("all"==e.activeType?"templately-plan-active":"")},(0,At.__)("All","templately")),ae().createElement("button",{onClick:function(){return t("block")},className:"templately-button components-button tb-blocks tf-filter-btn ".concat("block"==e.activeType?"templately-plan-active":"")},(0,At.__)("Blocks","templately")),ae().createElement("button",{onClick:function(){return t("page")},className:"templately-button components-button tb-pages tf-filter-btn ".concat("page"==e.activeType?"templately-plan-active":"")},(0,At.__)("Pages","templately")),ae().createElement("button",{onClick:function(){return t("pack")},className:"templately-button components-button tb-packs tf-filter-btn ".concat("pack"==e.activeType?"templately-plan-active":"")},(0,At.__)("Packs","templately"))),ae().createElement("div",{className:"tf-plan-filter templately-plan-switcher"},ae().createElement("button",{onClick:function(){return n("all")},className:"templately-button components-button tb-all tf-plan-btn ".concat("all"==e.activePlan?"templately-plan-active":"")},(0,At.__)("All","templately")),ae().createElement("button",{onClick:function(){return n("starter")},className:"templately-button components-button tb-starter tf-plan-btn ".concat("starter"==e.activePlan?"templately-plan-active":"")},(0,At.__)("Starter","templately")),ae().createElement("button",{onClick:function(){return n("pro")},className:"templately-button components-button tb-pro tf-plan-btn ".concat("pro"==e.activePlan?"templately-plan-active":"")},(0,At.__)("Pro","templately"))))});function hC(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 fC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hC(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var mC=[{name:"Name",id:"name"},[{name:"Type",id:"type"},{name:"Actions",id:"actions"},{name:"Purchasd Date",id:"downloaded_at"}]];const gC=gn(function(e){var t,n,r,o,i,a,l,s,c,u,d=e.general.platform,p=null!==(t=null===(n=e.profile.purchasedItems)||void 0===n?void 0:n.currentPage)&&void 0!==t?t:1;return{currentPage:p,totalPage:null!==(r=null===(o=e.profile.purchasedItems)||void 0===o?void 0:o.totalPage)&&void 0!==r?r:1,platform:d,items:null!==(i=(null===(a=e.profile.purchasedItems)||void 0===a?void 0:a[p])&&e.profile.purchasedItems[p])&&void 0!==i?i:[],isLoggedIn:null!==(null===(l=e.profile)||void 0===l?void 0:l.data),isLoading:null===(s=e.profile.purchasedItems)||void 0===s?void 0:s.isLoading,is_verified:null!==(c=null===(u=e.profile.data)||void 0===u?void 0:u.is_verified)&&void 0!==c&&c}},function(e){return{getPurchasedItems:function(t){return e(Zi(t))}}})(function(e){var t=pe((0,oe.useState)([]),2),n=t[0],r=t[1],o=rt();(0,oe.useEffect)(function(){e.currentPage>1&&0==e.items.length&&e.getPurchasedItems({page:e.currentPage})},[e.currentPage]),(0,oe.useEffect)(function(){if(e.items.length>0){var t=e.items.map(function(t){return[{id:"name",data:ae().createElement(eS,{className:"templately-downloaded-item",to:"".concat(e.platform,"/").concat(t.type,"s/").concat(t.slug)},ae().createElement(j_,{title:t.name,thumbnail:t.thumbnail}))},[{id:"type",data:Xa(t.type)},{id:"actions",data:ae().createElement(ae().Fragment,null,"pack"!=t.type&&ae().createElement(vl,{className:"tb-import tb-import-secondary",onClick:function(){e.isLoggedIn?Cd({ModalComponent:vd,content:fC(fC({},t),{},{origin:"remote",id:t.item_id})}):o(ub("sign-in"))},label:ae().createElement(ae().Fragment,null,ae().createElement(sr,null),(0,At.__)("Insert","templately"))}),"pack"==t.type&&ae().createElement(eS,{className:"templately-purchased-item-btn tb-import templately-button tb-import-secondary",to:"".concat(e.platform,"/").concat(t.type,"s/").concat(t.slug)},ae().createElement(ur,null),(0,At.__)("View","templately")))},{id:"purchased_at",data:t.purchased_at}]]});r(t)}},[e.items]);var i=Vn()("templately-my-downloads",{"templately-has-no-items":0==n.length});return ae().createElement("div",{className:i},ae().createElement("div",{className:"templately-items templately-download-items"},n.length>0&&!e.isLoading&&ae().createElement(aS,{view:"list",head:ae().createElement(cS,{columns:mC})},ae().createElement(dS,{view:"list",data:n})),0===n.length&&!e.isLoading&&ae().createElement(s_,{is_verified:e.is_verified})),e.totalPage>1&&ae().createElement(n_,{states:["profile","purchasedItems"],type:"purchasedItems",total:e.totalPage}))}),vC=function(e){var t=[];return"clouds"===e.type&&t.push(ae().createElement(ml,{key:"search"})),"favourites"===e.type&&t.push(ae().createElement(pC,{key:"favourites"})),["favourites","purchasedItems","downloads","profile"].includes(e.type)||t.push(ae().createElement(H_,{key:"view_buttons",type:e.type})),0==t.length?null:ae().createElement("div",{className:"templately-cloud-actions tca-".concat(e.type)},t)};function yC(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 bC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yC(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const wC=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d,p=null==(null==t?void 0:t.q)?"items":"search",h=e.general.platform,f=null!==(n=null===(r=e.clouds[p])||void 0===r||null===(r=r[h])||void 0===r?void 0:r.currentPage)&&void 0!==n?n:1,m=null!==(o=null===(i=e.clouds[p])||void 0===i||null===(i=i[h])||void 0===i?void 0:i.totalPage)&&void 0!==o?o:1;return{items:null!==(a=(null===(l=e.clouds[p])||void 0===l?void 0:l[h])&&(null===(s=e.clouds[p])||void 0===s||null===(s=s[h])||void 0===s?void 0:s[f]))&&void 0!==a?a:[],current_screen:e.general.current_screen,platform:h,currentPage:f,totalPage:m,isLoggedIn:null!==(null===(c=e.profile)||void 0===c?void 0:c.data),view:e.clouds.view,is_verified:null!==(u=null===(d=e.profile.data)||void 0===d?void 0:d.is_verified)&&void 0!==u&&u}},function(e){return{getClouds:function(t){return e(Wv(t))}}})(function(e){var t=pe((0,oe.useState)([]),2),n=t[0],r=t[1],o=rt(),i=pe(Ct(),1)[0],a=(0,oe.useRef)(e.currentPage);(0,oe.useEffect)(function(){e.currentPage>1&&a.current!==e.currentPage&&e.getClouds({page:e.currentPage,search:i.get("q")})},[e.currentPage]),(0,oe.useEffect)(function(){if(e.items.length>0){var t=e.items.map(function(t){return[{id:"name",data:ae().createElement(j_,{title:t.name,platform:e.platform})},[{id:"last_modified",data:ae().createElement(ae().Fragment,null,ae().createElement("p",null,t.last_modified),"templately"!==e.current_screen&&"grid"===e.view&&ae().createElement(vl,{className:"tb-import tb-import-secondary",onClick:function(){e.isLoggedIn?Cd({ModalComponent:vd,content:bC(bC({},t),{},{origin:"cloud",my_cloud_id:t.id})}):o(ub("sign-in"))},label:ae().createElement(ae().Fragment,null,ae().createElement(sr,null),(0,At.__)("Insert","templately"))}))},{id:"action",data:ae().createElement(V_,{args:{content:bC(bC({},t),{},{my_cloud_id:t.id,origin:"cloud"})},menus:Zg(!1,e.current_screen,e.view)})}]]});r(t)}},[e.items,e.view]);var l=Vn()("templately-my-clouds",{"templately-has-no-items":0==n.length});return ae().createElement("div",{className:l},n.length>0?ae().createElement(aS,{view:e.view,head:ae().createElement(cS,null)},ae().createElement(dS,{view:e.view,data:n})):ae().createElement(s_,{is_verified:e.is_verified}),e.totalPage>1&&ae().createElement(n_,{type:"clouds",total:e.totalPage,isSearch:i.has("q"),states:["clouds",i.has("q")?"search":"items",e.platform]}))}),kC=gn(function(e){var t,n,r,o;return{platform:e.general.platform,cloud_activity:null!==(t=null===(n=e.profile)||void 0===n?void 0:n.cloud_activity)&&void 0!==t?t:null,workspaces:null!==(r=e.workspaces.lists)&&void 0!==r?r:[],sharedWorkspaces:null!==(o=e.sharedWorkspaces.lists)&&void 0!==o?o:[],workspacesLoading:e.workspaces.isLoading,sharedWorkspacesLoading:e.sharedWorkspaces.isLoading,isPushing:e.clouds.push2cloud.isLoading,push2cloud:e.clouds.push2cloud}},function(e){return{getWorkSpaceLists:function(t){return e(sy(t))},pushToCloud:function(t){return e(Kv(t))}}})(function(e){var t,n=e.workspaces,r=e.sharedWorkspaces,o=(e.workspacesLoading,e.sharedWorkspacesLoading,pe((0,oe.useState)(""),2)),i=o[0],a=o[1],l=pe((0,oe.useState)(null),2),s=l[0],c=l[1],u=pe((0,oe.useState)(e.cloud_activity),2),d=u[0],p=u[1],h=pe((0,oe.useState)(!0),2),f=h[0],m=h[1],g=pe((0,oe.useState)(!1),2),v=g[0],y=g[1];(0,oe.useEffect)(function(){0==n.length&&e.getWorkSpaceLists({list_only:!0}),0==r.length&&e.getWorkSpaceLists({list_only:!0,shared:!0})},[]),(0,oe.useEffect)(function(){var e=[{label:(0,At.__)("My Clouds","templately"),value:"clouds"}];n.length&&e.push({label:(0,At.__)("My WorkSpace","templately"),options:$a(n)}),n.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:$a(r)}),e.length>0&&c(e)},[n,r]),(0,oe.useEffect)(function(){i.length>0&&null!=(null==d?void 0:d.value)?m(!1):m(!0)},[i,d]);var b=(0,pd.useSelect)(function(e){return e("core/editor")},[]),w=(0,pd.useDispatch)("core/editor",[]);if((0,oe.useEffect)(function(){if(v){var t,n=null,r="clouds"===d.value?0:null!==(t=null==d?void 0:d.value)&&void 0!==t?t:0;if("gutenberg"===e.platform&&((n={__file:"wp_block",id:null==b?void 0:b.getCurrentPostId(),type:null==b?void 0:b.getCurrentPostType(),title:null==b?void 0:b.getEditedPostAttribute("title"),content:null==b?void 0:b.getEditedPostContent()}).content.length,null==w||w.savePost()),"elementor"===e.platform){var o,a=e.page,l=null==a||!0===a?null===(o=window)||void 0===o||null===(o=o.elementor)||void 0===o||null===(o=o.previewView)||void 0===o||null===(o=o.el)||void 0===o||null===(o=o.firstElementChild)||void 0===o?void 0:o.firstElementChild:null==e?void 0:e.currentElement;null!=l&&(s=l,p=window.elementor,null!=s&&s.model&&s.model.get("elType"),null!=p&&null!==(c=p.config)&&void 0!==c&&null!==(c=c.document)&&void 0!==c&&c.library&&null!==(u=p.config.document.library)&&void 0!==u&&u.save_as_same_type&&p.config.document.type,n=null!=s&&s.model?[s.model.toJSON({remove:["default"]})]:p.elements.toJSON({remove:["default"]}))}null==n&&Al({icon:"error",html:ae().createElement(i_,{title:(0,At.__)("Page is empty","templately"),content:(0,At.__)("Please add some content before saving your template.","templately")})},!1),null!=n&&e.pushToCloud({saveTemplate:!0,workspace_id:r,workspace:r>0?d:null,name:i,file_content:n}),y(!1)}var s,c,u,p},[v]),(0,oe.useEffect)(function(){var t;void 0!==(null===(t=e.push2cloud)||void 0===t?void 0:t.status)&&"success"!==e.push2cloud.status&&Al({icon:"error",html:ae().createElement(i_,{title:(0,At.__)("Something must went wrong!","templately"),content:e.push2cloud.message})},!1)},[e.push2cloud]),!0===e.isPushing)return ae().createElement("div",{className:"templately-save-templates"},ae().createElement(_l,{text:(0,At.__)("Uploading...","templately"),description:(0,At.__)("Your template content is being pushed into Templately Cloud. Please do not refresh or close this tab.","templately")}));if(0==e.isPushing&&null!=(null===(t=e.push2cloud)||void 0===t?void 0:t.redirect)){var k;"success"===e.push2cloud.status&&Al({icon:"success",timer:1500,html:ae().createElement(i_,{title:(0,At.__)("Successfully Pushed!","templately"),content:(0,At.__)("Your template is successfully pushed to your desire cloud folder. You will be redirected there.","templately")})},!1),"success"!==e.push2cloud.status&&Al({icon:"error",timer:1500,html:ae().createElement(i_,{title:(0,At.__)("Something must went wrong!","templately"),content:e.push2cloud.message})},!1);var E=null!==(k=e.push2cloud)&&void 0!==k&&k.refresh?{refresh:!0}:null;return ae().createElement(gt,{to:ub(e.push2cloud.redirect,E),replace:!0})}return ae().createElement("div",{className:"templately-save-templates"},ae().createElement("div",{className:"tst-form-wrapper"},ae().createElement("h3",null,(0,At.__)("Save your templates and push to cloud","templately")),ae().createElement("div",{className:"tst-form"},ae().createElement("div",{className:"tst-form-inputs"},ae().createElement(bl,{placeholder:(0,At.__)("Type a name for the template...","templately"),value:i,onChange:function(e){return a(e.target.value)},wrapper:!1}),ae().createElement(Fg,{placeholder:(0,At.__)("Select ","templately"),className:"twfa-switcher",classNamePrefix:"templately",options:s,value:d,isLoading:null==s,loadingMessage:function(){return(0,At.__)("Loading workspace and shared workspaces list.","templately")},onChange:function(e){return p(e)}})),ae().createElement(vl,{disabled:f,onClick:function(){return y(!0)},label:(0,At.__)("Save & Push","templately"),className:"templately-button tb-save-n-push"}))))}),EC=gn(function(e,t){var n,r,o,i,a=t.shared?"sharedWorkspaces":"workspaces",l=null==e?void 0:e[a].isLoading,s=null==e?void 0:e[a].currentPage,c=null==e?void 0:e[a].totalPage,u=null!==(n=null==e||null===(r=e[a])||void 0===r?void 0:r[s])&&void 0!==n?n:[];return{view:null==e?void 0:e[a].view,isLoading:l,currentPage:s,totalPage:c,items:u,is_verified:null!==(o=null===(i=e.profile.data)||void 0===i?void 0:i.is_verified)&&void 0!==o&&o}},function(e){return{getWorkSpaces:function(t){return e(ly(t))}}})(function(e){var t=e.shared,n=e.view,r=void 0!==n&&n,o=Vn()("templately-workspaces",{"templately-shared":t||r,"templately-list-view":"list"===e.view});return(0,oe.useEffect)(function(){!e.isLoading&&e.currentPage>1&&e.getWorkSpaces({page:e.currentPage,shared:t})},[e.currentPage]),ae().createElement("div",{className:o},!1===e.is_verified&&ae().createElement("p",{className:"text-danger templately-not-verified-account"},(0,At.__)("Please verify your email to continue.","templately")),ae().createElement("div",{className:"templately-workspaces-row"},!t&&ae().createElement(nC,{addNew:!0,name:(0,At.__)("Add New WorkSpace","templately")}),e.items.length>0?e.items.map(function(e){return ae().createElement(nC,re({shared:t},e,{key:e.slug}))}):ae().createElement(Z_,{title:t?(0,At.__)("No shared workspaces yet.","templately"):(0,At.__)("You do not have any workspaces.","templately")})),e.totalPage>1&&ae().createElement(n_,{type:e.shared?"sharedWorkspaces":"workspaces",total:e.totalPage}))}),OC=window.wp.element,xC=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 14"},ae().createElement("path",{d:"M14.58 0H3.42C1.54 0 0 1.522 0 3.4v6.39c0 1.878 1.522 3.4 3.42 3.4h11.16c1.88 0 3.401-1.522 3.42-3.42V3.4C18 1.523 16.46 0 14.58 0zm0 1.202c.376 0 .733.094 1.053.282l-4.698 3.514a3.27 3.27 0 01-3.87 0L2.367 1.484c.32-.169.677-.282 1.053-.282h11.16zm2.217 8.587a2.221 2.221 0 01-2.217 2.217H3.42A2.221 2.221 0 011.203 9.79V3.401c0-.376.112-.752.3-1.09l4.848 3.626a4.454 4.454 0 005.298 0l4.848-3.626c.188.338.3.695.3 1.09v6.388z"}))},SC=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 18"},ae().createElement("path",{d:"M12.136 6.435h-.856V4.29A4.295 4.295 0 006.99 0a4.295 4.295 0 00-4.291 4.29v2.145h-.856A1.845 1.845 0 000 8.278v7.879C0 17.173.827 18 1.843 18h10.293a1.845 1.845 0 001.843-1.843v-7.88a1.845 1.845 0 00-1.843-1.842zM4.08 4.29a2.912 2.912 0 012.908-2.909 2.912 2.912 0 012.909 2.909v2.144H4.08V4.291zm8.516 11.866c0 .254-.207.46-.461.46H1.843a.461.461 0 01-.46-.46v-7.88c0-.253.206-.46.46-.46h10.293c.254 0 .46.207.46.46v7.88z"}))},_C=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},ae().createElement("g",{mask:"url(#mask0_39_149)"},ae().createElement("path",{d:"M12.888 16.153c1.25 0 2.312-.437 3.187-1.312s1.313-1.938 1.313-3.188c0-1.25-.438-2.312-1.313-3.187s-1.937-1.313-3.187-1.313c-1.25 0-2.313.438-3.188 1.313s-1.312 1.937-1.312 3.187c0 1.25.437 2.313 1.312 3.188s1.938 1.312 3.188 1.312zm0-1.8c-.75 0-1.388-.262-1.913-.787a2.604 2.604 0 01-.787-1.913c0-.75.262-1.387.787-1.912a2.604 2.604 0 011.913-.788c.75 0 1.387.263 1.912.788.525.525.788 1.162.788 1.912s-.263 1.388-.788 1.913a2.604 2.604 0 01-1.912.787zm0 4.8c-2.434 0-4.65-.679-6.65-2.037-2-1.358-3.45-3.18-4.35-5.463.9-2.283 2.35-4.104 4.35-5.462 2-1.358 4.216-2.038 6.65-2.038 2.433 0 4.65.68 6.65 2.038 2 1.358 3.45 3.18 4.35 5.462-.9 2.284-2.35 4.105-4.35 5.463-2 1.358-4.217 2.037-6.65 2.037zm0-2a9.544 9.544 0 005.187-1.487 9.773 9.773 0 003.613-4.013 9.773 9.773 0 00-3.613-4.012 9.545 9.545 0 00-5.187-1.488A9.545 9.545 0 007.7 7.641a9.773 9.773 0 00-3.612 4.012A9.773 9.773 0 007.7 15.666a9.544 9.544 0 005.188 1.487z"})))},CC=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},ae().createElement("g",{mask:"url(#mask0_39_140)"},ae().createElement("path",{d:"M16.988 13.925l-1.45-1.45c.15-.783-.075-1.516-.675-2.2-.6-.683-1.375-.95-2.325-.8l-1.45-1.45c.283-.133.57-.233.862-.3.292-.066.604-.1.938-.1 1.25 0 2.312.438 3.187 1.313s1.313 1.937 1.313 3.187c0 .334-.034.646-.1.938-.067.291-.167.579-.3.862zm3.2 3.15l-1.45-1.4a10.951 10.951 0 001.687-1.587 8.898 8.898 0 001.263-1.963c-.834-1.683-2.03-3.02-3.588-4.012-1.558-.992-3.296-1.488-5.212-1.488-.484 0-.959.034-1.425.1a9.625 9.625 0 00-1.375.3l-1.55-1.55a11.081 11.081 0 014.35-.85c2.516 0 4.758.696 6.725 2.088 1.966 1.391 3.391 3.196 4.275 5.412a11.696 11.696 0 01-1.513 2.738 11.007 11.007 0 01-2.187 2.212zm.5 6.15l-4.2-4.15c-.584.184-1.171.321-1.763.413-.591.091-1.204.137-1.837.137-2.517 0-4.759-.696-6.725-2.087-1.967-1.392-3.392-3.196-4.275-5.413.35-.883.791-1.704 1.325-2.462a11.514 11.514 0 011.825-2.038l-2.75-2.8 1.4-1.4 18.4 18.4-1.4 1.4zm-14.25-14.2c-.484.434-.925.909-1.325 1.425a9.016 9.016 0 00-1.025 1.675c.833 1.684 2.029 3.021 3.587 4.013 1.559.991 3.296 1.487 5.213 1.487.333 0 .658-.02.975-.062.316-.042.641-.088.975-.138l-.9-.95c-.184.05-.359.088-.525.113a3.539 3.539 0 01-.525.037c-1.25 0-2.313-.437-3.188-1.312s-1.312-1.938-1.312-3.188c0-.183.012-.358.037-.525.025-.166.063-.341.113-.525l-2.1-2.05z"})))};var PC=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];function TC(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 AC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TC(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const MC=function(e){var t=e.id,n=e.onChange,r=void 0===n?null:n,o=e.onBlur,i=void 0===o?null:o,a=e.name,l=e.placeholder,s=void 0===l?null:l,c=e.type,u=void 0===c?"text":c,d=(e.withP,e.label),p=e.icon,h=e.typeChange,f=void 0===h?void 0:h,m=e.error,g=Wn(e,PC),v=pe((0,oe.useState)(u),2),y=v[0],b=v[1],w=null!=t?t:a,k={type:y,name:a,id:w};return(0,oe.useEffect)(function(){f&&b(u)},[]),null!=s&&(k=AC(AC({},k),{},{placeholder:s})),null!=i&&(k=AC(AC({},k),{},{onBlur:i})),null!=r&&(k=AC(AC({},k),{},{onChange:r})),ae().createElement("div",{className:"tf-input tf-input-".concat(null!=u?u:"text")},d&&"checkbox"!==u&&"radio"!==u?ae().createElement("label",{htmlFor:w,className:"tf-input-label"},d):"",ae().createElement("div",{className:"".concat(f?"has-change-button":""," ").concat(p?"has-icon":""," ").concat(null!=m&&m.hasError?"has-error":"")},null!=p?p:"",ae().createElement("input",re({},k,g)),f?ae().createElement("button",{onClick:function(){b(y===u?null==f?void 0:f.type:u)}},y===u?null==f?void 0:f.primaryText:null==f?void 0:f.secondaryText):""),!d||"checkbox"!==u&&"radio"!==u?"":ae().createElement("label",{htmlFor:w,className:"tf-input-label"},d),(null==m?void 0:m.hasError)&&(null==m?void 0:m.errorMessage)&&ae().createElement("div",{className:"tf-error-message"},ae().createElement(zn,null),ae().createElement(OC.RawHTML,null,null==m?void 0:m.errorMessage)))};var NC=["isLoading","setTab","getSignedIn"];function DC(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 IC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DC(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const LC=gn(function(e){var t,n,r,o;return{platform:e.general.platform,isLoading:e.profile.isLoading,isLoggedIn:null!=e.profile.data,profileData:e.profile.data,loggedInError:null!==(t=null===(n=e.profile)||void 0===n?void 0:n.error)&&void 0!==t&&t,isGloballySigned:null!==(r=null===(o=e.profile)||void 0===o?void 0:o.is_globally_signed)&&void 0!==r&&r}},function(e){return{logout:function(t){return e(zi(t))},logoutSuccess:function(t){return e(Bi(t))},getSignedIn:function(t){return e(function(e){return ji({type:_r},e)}(t))},errorCleanUp:function(t){return e(qi(t))}}})(function(e){var t,n,r,o,i,a,l,s,c,u=e.isLoading,d=(e.setTab,e.getSignedIn),p=Wn(e,NC),h=rt(),f=pe(Ct(),1)[0],m=tt(),g=pe((0,oe.useState)(null),2),v=g[0],y=g[1],b=pe((0,oe.useState)(!1),2),w=b[0],k=b[1],E=pe((0,oe.useState)(!1),2),O=E[0],x=E[1],S=pe((0,oe.useState)(!0),2),_=S[0],C=S[1],P=pe((0,oe.useState)(!1),2),T=P[0],A=P[1],M=pe((0,oe.useState)({viaAPI:!1}),2),N=M[0],D=M[1],I=pe((0,oe.useState)(null),2),L=I[0],R=I[1],j=pe((0,oe.useState)({}),2),F=j[0],z=j[1],B=function(e){var t=nl(e,N),n=t.isValid,r=t.title,o=t.content;z(IC(IC({},F),{},Tt({},e,{isValid:n,title:r,content:o}))),n||C(!0)};return(0,oe.useEffect)(function(){p.errorCleanUp(),R({}),null===v&&y(p.profileData)},[]),(0,oe.useEffect)(function(){if(O){var e,t,n=!(null===(e=null==F||null===(t=F.api_key)||void 0===t?void 0:t.isValid)||void 0===e||e)||void 0===(null==N?void 0:N.api_key)||""===(null==N?void 0:N.api_key);C(n)}else{var r=!1;["email","password"].map(function(e){var t,n;r||(r=void 0===(null==N?void 0:N[e])||""==(null==N?void 0:N[e])),r||(r=!(null===(t=null===(n=F[e])||void 0===n?void 0:n.isValid)||void 0===t||t))}),C(r)}L&&R(null)},[N,F]),(0,oe.useEffect)(function(){D(function(e){return IC(IC({},e),{},{viaAPI:O})})},[O]),(0,oe.useEffect)(function(){var e;T&&(k(!0),d(N),C(!0),A(!1),null!=m&&null!==(e=m.state)&&void 0!==e&&e.redirectTo&&h(ub(m.state.redirectTo),{replace:!0}))},[T]),(0,oe.useEffect)(function(){var e,t,n,r,o,i,a,l,s,c="".concat(p.platform,"/packs");if(null!==v&&(null===(e=p.profileData)||void 0===e?void 0:e.id)!==v.id&&p.isLoggedIn&&f.get("add-account")&&!za(null==m||null===(t=m.state)||void 0===t?void 0:t.is_logging_out)&&h(ub(c,{platform:p.platform},["add-account"])),p.isLoggedIn&&!f.get("add-account")&&(null==m||null===(n=m.state)||void 0===n||!n.signed_in_failed)&&!za(null==m||null===(r=m.state)||void 0===r?void 0:r.is_logging_out)){var u=(null==f?void 0:f.get("redirect-to"))||c;h(ub(u,{platform:p.platform},["redirect-to"]))}za(null===(o=m.state)||void 0===o?void 0:o.is_logging_out)&&(p.logoutSuccess({trying_logout:!0,isGloballySigned:null===(a=m.state)||void 0===a?void 0:a.is_logging_out}),p.logout(null===(l=m.state)||void 0===l?void 0:l.is_logging_out),null!=m&&null!==(s=m.state)&&void 0!==s&&s.is_logging_out&&delete m.state.is_logging_out),null!=m&&null!==(i=m.state)&&void 0!==i&&i.signed_in_failed&&delete m.state.signed_in_failed},[p.isLoggedIn,p.profileData]),(0,oe.useEffect)(function(){if(p.loggedInError)if(k(!1),C(!1),za(p.loggedInError.message)){var e,t={},n=(0,At.__)("Oops...!","templately"),r=(null===(e=p.loggedInError.message)||void 0===e?void 0:e.message)||{};"login_error"===p.loggedInError.message.code&&Object.keys(r).map(function(e){var o=r[e];t[e]={isValid:!1,title:n,content:o}}),Object.keys(t).length>0&&z(IC({},t))}else"string"==typeof p.loggedInError.message&&R(p.loggedInError.message);else R({})},[p.loggedInError]),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"tfu-signin tfu-content"},O?ae().createElement(ae().Fragment,null,ae().createElement(MC,{type:"password",name:"api_key",key:"api_key",className:"tf-api-key",label:(0,At.__)("API Key","templately"),placeholder:(0,At.__)("Your API Key","templately"),disabled:w,error:{hasError:!(null===(t=null==F||null===(n=F.api_key)||void 0===n?void 0:n.isValid)||void 0===t||t),errorMessage:null===(r=F.api_key)||void 0===r?void 0:r.content},onBlur:function(){return B("api_key")},onChange:function(e){null==e||e.persist(),D(function(t){var n;return IC(IC({},t),{},{api_key:null==e||null===(n=e.target)||void 0===n?void 0:n.value})})}})):ae().createElement(ae().Fragment,null,ae().createElement(MC,{type:"email",name:"email",key:"email",disabled:w,onBlur:function(){return B("email")},error:{hasError:!(null===(o=null==F||null===(i=F.email)||void 0===i?void 0:i.isValid)||void 0===o||o),errorMessage:null===(a=F.email)||void 0===a?void 0:a.content},label:(0,At.__)("Email Address","templately"),placeholder:(0,At.__)("Enter Your Email Address","templately"),icon:ae().createElement(xC,null),onChange:function(e){null==e||e.persist(),D(function(t){var n;return IC(IC({},t),{},{email:null==e||null===(n=e.target)||void 0===n?void 0:n.value})})}}),ae().createElement("div",{className:"tf-input-wrapper"},ae().createElement(MC,{type:"password",name:"password",key:"password",disabled:w,label:(0,At.__)("Password","templately"),placeholder:(0,At.__)("Password","templately"),icon:ae().createElement(SC,null),onBlur:function(){return z(IC(IC({},F),{},{password:{isValid:!0,title:"",content:""}}))},error:{hasError:!(null===(l=null==F||null===(s=F.password)||void 0===s?void 0:s.isValid)||void 0===l||l),errorMessage:null===(c=F.password)||void 0===c?void 0:c.content},typeChange:{type:"text",primaryText:ae().createElement(CC,null),secondaryText:ae().createElement(_C,null)},onChange:function(e){null==e||e.persist(),D(function(t){var n;return IC(IC({},t),{},{password:null==e||null===(n=e.target)||void 0===n?void 0:n.value})})}}),ae().createElement("a",{className:"tf-forget-link",href:"https://templately.com/forgot-password?utm_source=plugin&utm_medium=SignIn",target:"_blank"},(0,At.__)("Forgot Password?","templately")))),L&&"string"==typeof L&&ae().createElement("div",{className:"tf-global-error-message"},ae().createElement(zn,null),ae().createElement(OC.RawHTML,null,L)),!p.isGloballySigned&&ae().createElement("div",{className:"tf-global_signin"},ae().createElement(MC,{type:"checkbox",name:"global_signin",label:(0,At.__)("Global Sign In","templately"),disabled:w,onChange:function(e){null==e||e.persist(),D(function(t){var n;return IC(IC({},t),{},{global_signin:null==e||null===(n=e.target)||void 0===n?void 0:n.checked})})}}),ae().createElement("p",{className:"global_signin-helptext"},(0,At.__)("All the sitewide users will be logged in with this Templately account","templately"))),ae().createElement("div",{className:"tfus-footer"},ae().createElement("button",{className:"templately-button tb-signin",onClick:function(){return A(!_)},disabled:_},!u&&(0,At.__)("Sign In","templately"),u&&(0,At.__)("Signing In...","templately")),ae().createElement("span",null,"or"),ae().createElement(vl,{className:"tb-viapi",onClick:function(){return x(!O)}},!O&&(0,At.__)("Connect via API","templately"),O&&(0,At.__)("Connect via Login Credentials","templately")))),O?ae().createElement("div",{className:"tfus-link-wrap"},ae().createElement("a",{href:"https://templately.com/manage-sites",target:"_blank"},"Manage Site"),ae().createElement("a",{href:"https://docs.templately.com/home/how-to-manage-sites-in-templately/",target:"_blank"},"Documentation")):"")}),RC=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 19"},ae().createElement("path",{d:"M8.263 10.051a4.777 4.777 0 01-4.77-4.774A4.778 4.778 0 018.262.5a4.783 4.783 0 014.778 4.777 4.782 4.782 0 01-4.778 4.774zm0-7.991a3.217 3.217 0 000 6.432 3.22 3.22 0 003.218-3.215A3.222 3.222 0 008.263 2.06zM15.88 18.5a.78.78 0 01-.78-.78v-1.715a3.41 3.41 0 00-3.407-3.403H4.96a3.404 3.404 0 00-3.4 3.403v1.715a.78.78 0 11-1.56 0v-1.715a4.967 4.967 0 014.96-4.963h6.733a4.972 4.972 0 014.967 4.963v1.715a.78.78 0 01-.78.78z"}))};var jC=["setTab","getSignedUp"];function FC(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 zC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?FC(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const BC=gn(function(e){return{platform:e.general.platform,isLoading:e.profile.isLoading,isLoggedIn:null!=e.profile.data,error:e.profile.error}},function(e){return{getSignedUp:function(t){return e(function(e){return ji({type:Tr},e)}(t))},errorCleanUp:function(t){return e(qi(t))}}})(function(e){e.setTab;var t,n,r,o,i,a,l,s,c,u,d,p,h=e.getSignedUp,f=Wn(e,jC),m=rt(),g=pe((0,oe.useState)(!0),2),v=g[0],y=g[1],b=pe((0,oe.useState)(!1),2),w=b[0],k=b[1],E=pe((0,oe.useState)({}),2),O=E[0],x=E[1],S=pe((0,oe.useState)(null),2),_=S[0],C=S[1],P=pe((0,oe.useState)({}),2),T=P[0],A=P[1],M={first_name_error:"first_name",last_name_error:"last_name",email_error:"email"},N=(0,oe.useMemo)(function(){var e,t,n,r,o,i="",a=!0,l=!(null===(e=null===(t=T.first_name)||void 0===t?void 0:t.isValid)||void 0===e||e),s=!(null===(n=null===(r=T.last_name)||void 0===r?void 0:r.isValid)||void 0===n||n);if(l&&s)a=!1,i=(null===(o=T.first_name)||void 0===o?void 0:o.content)||"",i=new RegExp("First Name","i").test(i)?i.replace(/First Name/i,"First Name and Last Name"):(0,At.__)("First name and Last name cannot be empty.","templately");else if(l){var c;a=!1,i=null===(c=T.first_name)||void 0===c?void 0:c.content}else if(s){var u;a=!1,i=null===(u=T.last_name)||void 0===u?void 0:u.content}return{title:(0,At.__)("Oops...!","templately"),isValid:a,content:i}},[O,T]),D=function(e){var t=nl(e,O),n=t.isValid,r=t.title,o=t.content;A(function(t){return zC(zC({},t),{},Tt({},e,{isValid:n,title:r,content:o}))})};return(0,oe.useEffect)(function(){f.errorCleanUp(),C({})},[]),(0,oe.useEffect)(function(){f.isLoggedIn&&m(ub([f.platform,"packs"]))},[f.isLoggedIn]),(0,oe.useEffect)(function(){if(Object.keys(O).length>=7){var e=!1;Object.keys(O).map(function(t){var n,r;e||(e=null==O[t].length?!O[t]:0==O[t].length),e||(e=!(null===(n=null===(r=T[t])||void 0===r?void 0:r.isValid)||void 0===n||n))}),y(e)}else y(!0);_&&C(null)},[O,T]),(0,oe.useEffect)(function(){w&&(h(O),y(!0),k(!1))},[w]),(0,oe.useEffect)(function(){if(f.error){var e={},t=(0,At.__)("Oops...!","templately");if(M[f.error.code]&&"string"==typeof f.error.message){var n=M[f.error.code],r=f.error.message;e[n]={isValid:!1,title:t,content:r}}else"signup_errors"==f.error.code&&za(f.error.message)?Object.keys(f.error.message).map(function(n){var r=f.error.message[n];e[n]={isValid:!1,title:t,content:r}}):"string"==typeof f.error.message&&C(f.error.message);Ba(f.error.additional_errors)&&Object.values(f.error.additional_errors).map(function(n){if(M[null==n?void 0:n.code]){var r=M[null==n?void 0:n.code],o=n.message;e[r]={isValid:!1,title:t,content:o}}}),za(e)&&Object.keys(e).length>0&&A(zC({},e))}else C({})},[f.error]),ae().createElement("div",{className:"tfu-signup tfu-content"},ae().createElement("div",{className:"tfu-row tfu-cols-2"},ae().createElement(MC,{name:"first_name",label:(0,At.__)("First Name","templately"),placeholder:(0,At.__)("First Name","templately"),onBlur:function(){return D("first_name")},error:{hasError:!(null===(t=null===(n=T.first_name)||void 0===n?void 0:n.isValid)||void 0===t||t)},icon:ae().createElement(RC,null),onChange:function(e){return x(function(t){return zC(zC({},t),{},{first_name:e.target.value})})}}),ae().createElement(MC,{name:"last_name",label:(0,At.__)("Last Name","templately"),placeholder:(0,At.__)("Last Name","templately"),onBlur:function(){return D("last_name")},error:{hasError:!(null===(r=null===(o=T.last_name)||void 0===o?void 0:o.isValid)||void 0===r||r)},icon:ae().createElement(RC,null),onChange:function(e){return x(function(t){return zC(zC({},t),{},{last_name:e.target.value})})}}),ae().createElement("div",{className:"tfu-error-wrapper"},!(null===(i=null==N?void 0:N.isValid)||void 0===i||i)&&N.content&&ae().createElement("div",{className:"tf-error-message"},ae().createElement(zn,null),ae().createElement(OC.RawHTML,null,N.content)))),ae().createElement(MC,{type:"text",name:"email",label:(0,At.__)("Email Address","templately"),placeholder:(0,At.__)("Enter Your Email Address","templately"),onBlur:function(){return D("email")},error:{hasError:!(null===(a=null===(l=T.email)||void 0===l?void 0:l.isValid)||void 0===a||a),errorMessage:null===(s=T.email)||void 0===s?void 0:s.content},icon:ae().createElement(xC,null),onChange:function(e){return x(function(t){return zC(zC({},t),{},{email:e.target.value})})}}),ae().createElement("div",{className:"tfu-row tfu-cols-2"},ae().createElement(MC,{type:"password",name:"password",label:(0,At.__)("Password","templately"),placeholder:(0,At.__)("Password","templately"),onBlur:function(){D("password"),D("confirm_password")},error:{hasError:!(null===(c=null===(u=T.password)||void 0===u?void 0:u.isValid)||void 0===c||c)},icon:ae().createElement(SC,null),onChange:function(e){return x(function(t){return zC(zC({},t),{},{password:e.target.value})})}}),ae().createElement(MC,{type:"password",name:"confirm_password",label:(0,At.__)("Confirm Password","templately"),placeholder:(0,At.__)("Confirm Password","templately"),onBlur:function(){return D("confirm_password")},error:{hasError:!(null===(d=null===(p=T.confirm_password)||void 0===p?void 0:p.isValid)||void 0===d||d)},icon:ae().createElement(SC,null),onChange:function(e){return x(function(t){return zC(zC({},t),{},{confirm_password:e.target.value})})}}),ae().createElement("div",{className:"tfu-error-wrapper"},["password","confirm_password","password_mismatched"].map(function(e){var t,n,r,o;return null!==(t=null===(n=T[e])||void 0===n?void 0:n.isValid)&&void 0!==t&&!t&&null!==(r=T[e])&&void 0!==r&&r.content?ae().createElement("div",{className:"tf-error-message"},ae().createElement(zn,null),ae().createElement(OC.RawHTML,null,null===(o=T[e])||void 0===o?void 0:o.content)):ae().createElement(ae().Fragment,null)}))),ae().createElement("div",{className:"tfu-consent-wrapper"},ae().createElement("div",{className:"tfu-consent"},ae().createElement(MC,{withP:!1,type:"checkbox",name:"privacy_consent",id:"tfu-privacy_consent",label:ae().createElement(ae().Fragment,null,(0,At.__)("I agree to the Templately ","templately")," ",ae().createElement("a",{href:"https://templately.com/privacy-policy?utm_source=plugin&utm_medium=SignUp",target:"_blank"},(0,At.__)("Privacy Policy","templately")),"."),onChange:function(e){return x(function(t){return zC(zC({},t),{},{privacy_consent:e.target.checked})})}})),ae().createElement("div",{className:"tfu-consent"},ae().createElement(MC,{withP:!1,type:"checkbox",name:"terms_consent",id:"tfu-terms_consent",label:ae().createElement(ae().Fragment,null,(0,At.__)("I agree to the Templately ","templately")," ",ae().createElement("a",{href:"https://templately.com/terms-of-services?utm_source=plugin&utm_medium=SignUp",target:"_blank"},(0,At.__)("Terms of Services","templately")),"."),onChange:function(e){return x(function(t){return zC(zC({},t),{},{terms_consent:e.target.checked})})}}))),_&&"string"==typeof _&&ae().createElement("div",{className:"tf-global-error-message"},ae().createElement(zn,null),ae().createElement(OC.RawHTML,null,_)),ae().createElement("div",{className:"tfus-footer"},ae().createElement("button",{disabled:v,onClick:function(){return k(!0)},className:"templately-button tb-signin"},(0,At.__)("Sign Up","templately"))))}),WC=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"356",height:"246",fill:"none",viewBox:"0 0 356 246"},ae().createElement("g",{clipPath:"url(#clip0_21_2)"},ae().createElement("g",{opacity:"0.7"},ae().createElement("path",{fill:"url(#paint0_linear_21_2)",d:"M96.12 45.877l.574.92a168.403 168.403 0 015.545-3.305l-.536-.942a156.796 156.796 0 00-5.583 3.328z"}),ae().createElement("path",{fill:"url(#paint1_linear_21_2)",d:"M85.376 53.208l.644.866c1.72-1.277 3.49-2.543 5.264-3.75l-.612-.892a158.97 158.97 0 00-5.296 3.776z"}),ae().createElement("path",{fill:"url(#paint2_linear_21_2)",d:"M65.84 70.38l.779.752a158.383 158.383 0 014.588-4.556l-.747-.784a167.953 167.953 0 00-4.62 4.588z"}),ae().createElement("path",{fill:"url(#paint3_linear_21_2)",d:"M107.422 39.456l.498.963c1.904-.98 3.852-1.937 5.794-2.84l-.455-.98a161.844 161.844 0 00-5.837 2.857z"}),ae().createElement("path",{fill:"url(#paint4_linear_21_2)",d:"M75.26 61.393l.713.812a157.06 157.06 0 014.94-4.166l-.682-.839a159.63 159.63 0 00-4.977 4.199l.005-.006z"}),ae().createElement("path",{fill:"url(#paint5_linear_21_2)",d:"M119.199 33.98l.417 1.002a157.236 157.236 0 016.021-2.36l-.373-1.016a160.349 160.349 0 00-6.065 2.375z"}),ae().createElement("path",{fill:"url(#paint6_linear_21_2)",d:"M156.761 23.577l.157 1.07c2.12-.313 4.279-.589 6.416-.816l-.114-1.077c-2.147.228-4.322.503-6.459.823z"}),ae().createElement("path",{fill:"url(#paint7_linear_21_2)",d:"M169.708 22.198l.07 1.082c2.137-.141 4.312-.238 6.46-.293l-.027-1.081a161.94 161.94 0 00-6.503.292z"}),ae().createElement("path",{fill:"url(#paint8_linear_21_2)",d:"M57.173 80.1l.838.688a158.449 158.449 0 014.204-4.918l-.806-.72a153.358 153.358 0 00-4.23 4.95h-.006z"}),ae().createElement("path",{fill:"url(#paint9_linear_21_2)",d:"M143.972 26.006l.243 1.055a154.67 154.67 0 016.33-1.336l-.2-1.06c-2.126.405-4.269.854-6.373 1.347v-.006z"}),ae().createElement("path",{fill:"url(#paint10_linear_21_2)",d:"M131.421 29.485l.33 1.028c2.045-.66 4.128-1.282 6.194-1.856l-.286-1.044a165.428 165.428 0 00-6.238 1.867v.005z"}),ae().createElement("path",{fill:"url(#paint11_linear_21_2)",d:"M46.64 96.515l-.915-.579a158.67 158.67 0 00-3.375 5.578l.935.541a153.157 153.157 0 013.355-5.54z"}),ae().createElement("path",{fill:"url(#paint12_linear_21_2)",d:"M40.164 107.73l-.958-.503a163.113 163.113 0 00-2.91 5.837l.98.466c.919-1.942 1.887-3.89 2.888-5.8z"}),ae().createElement("path",{fill:"url(#paint13_linear_21_2)",d:"M34.63 119.443l-.996-.422a158.523 158.523 0 00-2.418 6.059l1.011.379a156.57 156.57 0 012.403-6.022v.006z"}),ae().createElement("path",{fill:"url(#paint14_linear_21_2)",d:"M182.708 22.955c2.153.033 4.328.108 6.465.227l.06-1.082c-2.154-.119-4.339-.195-6.509-.227l-.016 1.082z"}),ae().createElement("path",{fill:"url(#paint15_linear_21_2)",d:"M49.33 90.5l.892.616c1.222-1.764 2.5-3.527 3.792-5.248l-.865-.649a165.582 165.582 0 00-3.82 5.28z"}),ae().createElement("path",{fill:"url(#paint16_linear_21_2)",d:"M24.048 156.713l-1.072-.162c-.33 2.131-.616 4.301-.86 6.454l1.077.119c.238-2.137.53-4.296.855-6.411z"}),ae().createElement("path",{fill:"url(#paint17_linear_21_2)",d:"M26.542 144.021l-1.05-.255a160.784 160.784 0 00-1.385 6.363l1.06.211c.412-2.105.877-4.231 1.38-6.319h-.005z"}),ae().createElement("path",{fill:"url(#paint18_linear_21_2)",d:"M30.069 131.583l-1.028-.341a159.776 159.776 0 00-1.904 6.227l1.038.298c.59-2.072 1.223-4.15 1.894-6.184z"}),ae().createElement("path",{fill:"url(#paint19_linear_21_2)",d:"M328.725 123.652a165.764 165.764 0 00-2.462-6.006l-.99.433c.85 1.964 1.678 3.971 2.446 5.968l1.011-.39-.005-.005z"}),ae().createElement("path",{fill:"url(#paint20_linear_21_2)",d:"M332.912 135.981a164.505 164.505 0 00-1.964-6.21l-1.022.346a157.938 157.938 0 011.953 6.167l1.039-.303h-.006z"}),ae().createElement("path",{fill:"url(#paint21_linear_21_2)",d:"M317.418 100.281a174.14 174.14 0 00-3.413-5.535l-.909.59a167.51 167.51 0 013.392 5.497l.93-.552z"}),ae().createElement("path",{fill:"url(#paint22_linear_21_2)",d:"M323.553 111.739a161.275 161.275 0 00-2.948-5.789l-.953.509a163.515 163.515 0 012.933 5.751l.973-.471h-.005z"}),ae().createElement("path",{fill:"url(#paint23_linear_21_2)",d:"M195.622 23.669c2.137.206 4.301.46 6.422.752l.146-1.071a151.495 151.495 0 00-6.465-.758l-.103 1.077z"}),ae().createElement("path",{fill:"url(#paint24_linear_21_2)",d:"M336.072 148.614a161.62 161.62 0 00-1.45-6.346l-1.05.26c.52 2.083 1.007 4.209 1.439 6.302l1.061-.216z"}),ae().createElement("path",{fill:"url(#paint25_linear_21_2)",d:"M245.432 36.967a160.69 160.69 0 015.843 2.797l.487-.969a163.088 163.088 0 00-5.886-2.818l-.449.984.005.006z"}),ae().createElement("path",{fill:"url(#paint26_linear_21_2)",d:"M257.004 42.799a159.106 159.106 0 015.594 3.267l.563-.925a166.837 166.837 0 00-5.632-3.289l-.525.947z"}),ae().createElement("path",{fill:"url(#paint27_linear_21_2)",d:"M233.422 32.103c2.018.72 4.057 1.499 6.059 2.305l.406-1a151.502 151.502 0 00-6.103-2.322l-.362 1.017z"}),ae().createElement("path",{fill:"url(#paint28_linear_21_2)",d:"M208.433 25.438c2.115.385 4.252.812 6.34 1.277l.238-1.055c-2.104-.47-4.252-.903-6.384-1.287l-.194 1.065z"}),ae().createElement("path",{fill:"url(#paint29_linear_21_2)",d:"M221.054 28.251a159.25 159.25 0 016.216 1.796l.319-1.033a161.378 161.378 0 00-6.254-1.807l-.281 1.044z"}),ae().createElement("path",{fill:"url(#paint30_linear_21_2)",d:"M289.031 64.85l-.741.79a164.273 164.273 0 014.631 4.518l.774-.758a161.252 161.252 0 00-4.658-4.55h-.006z"}),ae().createElement("path",{fill:"url(#paint31_linear_21_2)",d:"M305.646 84.78a149.235 149.235 0 013.83 5.205l.882-.622a159.55 159.55 0 00-3.857-5.237l-.86.66.005-.005z"}),ae().createElement("path",{fill:"url(#paint32_linear_21_2)",d:"M297.363 74.859c1.439 1.59 2.868 3.23 4.247 4.874l.828-.692a154.042 154.042 0 00-4.274-4.907l-.801.725z"}),ae().createElement("path",{fill:"url(#paint33_linear_21_2)",d:"M268.046 49.556a161.142 161.142 0 015.307 3.711l.639-.876a158.039 158.039 0 00-5.34-3.733l-.601.898h-.005z"}),ae().createElement("path",{fill:"url(#paint34_linear_21_2)",d:"M278.498 57.184a158.015 158.015 0 014.983 4.128l.708-.817a159.06 159.06 0 00-5.015-4.155l-.671.85-.005-.006z"})),ae().createElement("path",{stroke:"#9292FF",strokeMiterlimit:"10",strokeWidth:"1.082",d:"M21.613 155.144l156.551 25.578M75.73 59.608l102.433 121.115M179.197 22.1l-1.033 158.623M278.996 58.272L178.164 180.723M333.248 147.38l-155.084 33.342",opacity:"0.7"}),ae().createElement("path",{fill:"url(#paint35_linear_21_2)",d:"M330.846 173.707c13.726 0 24.854-11.127 24.854-24.853 0-13.727-11.128-24.854-24.854-24.854-13.726 0-24.854 11.127-24.854 24.854 0 13.726 11.128 24.853 24.854 24.853z"}),ae().createElement("path",{fill:"#fff",d:"M338.019 141.808a3.043 3.043 0 003.037-3.039c-.151-4.026-5.921-4.025-6.074 0a3.046 3.046 0 003.037 3.039z"}),ae().createElement("path",{fill:"#fff",d:"M342.985 143.9a5.602 5.602 0 00-2.283-2.285c-1.368 1.405-3.998 1.405-5.365 0-1.412.789-3.256 2.629-2.236 4.37a2.089 2.089 0 001.803 1.02h6.231c1.549.051 2.624-1.768 1.85-3.105zM323.955 141.808a3.043 3.043 0 003.036-3.039c-.151-4.026-5.92-4.025-6.073 0a3.046 3.046 0 003.037 3.039z"}),ae().createElement("path",{fill:"#fff",d:"M328.873 145.985c1.018-1.742-.82-3.581-2.236-4.37-1.367 1.405-3.997 1.405-5.364 0-1.413.789-3.256 2.629-2.236 4.37a2.089 2.089 0 001.803 1.02h6.23a2.08 2.08 0 001.803-1.02zM327.951 152.013a3.045 3.045 0 003.037 3.039c4.023-.154 4.021-5.927 0-6.078a3.042 3.042 0 00-3.037 3.039z"}),ae().createElement("path",{fill:"#fff",d:"M333.67 154.859c-1.367 1.406-3.997 1.405-5.364 0a5.624 5.624 0 00-2.284 2.286c-.775 1.336.307 3.155 1.851 3.104h6.23c1.549.051 2.625-1.768 1.851-3.105a5.604 5.604 0 00-2.284-2.285zM328.9 142.337a7.596 7.596 0 014.17 0c.219-.249.451-.481.7-.696a8.47 8.47 0 00-5.57 0c.254.21.486.442.7.696zM323.55 149.47c0-.539.057-1.073.171-1.589h-.893a8.29 8.29 0 002.94 8.047c.171-.236.363-.455.565-.665a7.423 7.423 0 01-2.783-5.793zM338.255 147.881a7.44 7.44 0 01-2.608 7.382c.202.21.39.429.565.665a8.292 8.292 0 002.936-8.047h-.893z"}),ae().createElement("path",{fill:"url(#paint36_linear_21_2)",d:"M24.846 178.707c13.726 0 24.854-11.127 24.854-24.853C49.7 140.127 38.572 129 24.846 129 11.12 129-.008 140.127-.008 153.854c0 13.726 11.128 24.853 24.854 24.853z"}),ae().createElement("path",{fill:"#fff",d:"M31.268 154.252a3.534 3.534 0 00-5.477-3.618c-.997-1.554-2.81-2.592-4.88-2.592-3.146 0-5.695 2.393-5.695 5.346 0 .305.028.603.08.894a4.932 4.932 0 001.53 9.623h13.011a4.932 4.932 0 001.43-9.653z"}),ae().createElement("path",{fill:"#fff",d:"M37.931 153.606a4.032 4.032 0 01-2.13 3.553 6.171 6.171 0 00-3.167-3.754 4.836 4.836 0 00-6.477-4.409 6.984 6.984 0 00-3.596-2.064c.795-1.338 2.317-2.243 4.062-2.243 1.691 0 3.17.848 3.983 2.114a2.884 2.884 0 014.47 2.952c.825.25 1.54.759 2.047 1.434.508.671.808 1.509.808 2.417z"}),ae().createElement("path",{fill:"url(#paint37_linear_21_2)",d:"M77.846 86.707c13.726 0 24.854-11.127 24.854-24.853C102.7 48.127 91.572 37 77.846 37 64.12 37 52.992 48.127 52.992 61.854c0 13.726 11.128 24.853 24.854 24.853z"}),ae().createElement("path",{fill:"url(#paint38_linear_21_2)",d:"M277.846 84.707c13.726 0 24.854-11.127 24.854-24.853C302.7 46.127 291.572 35 277.846 35c-13.726 0-24.854 11.127-24.854 24.854 0 13.726 11.128 24.853 24.854 24.853z"}),ae().createElement("g",{fill:"#fff",clipPath:"url(#clip1_21_2)"},ae().createElement("path",{d:"M281.153 68.765c1.421-.072 2.574.44 3.468 1.551.073-.073.136-.136.211-.214-.366-.266-.51-.61-.299-1.027.178-.352.503-.438.888-.371.014-.046.029-.086.039-.13.124-.524.438-.88.957-1.025.272-.076.559-.099.835-.162.483-.109.875-.342 1.036-.849.121-.38.069-.734-.159-1.059-.017-.023-.036-.046-.052-.069-.074-.099-.08-.197.018-.279.105-.086.208-.054.289.044a1.5 1.5 0 01.343 1.153c-.041.4-.207.747-.508 1.02-.025.02-.044.047-.078.085.113.048.216.086.312.134.653.325.917.906 1.03 1.581.036.216.042.439.044.659 0 .06-.05.15-.103.178-.052.027-.167.019-.203-.021-.203-.22-.483-.258-.743-.352-.263-.097-.537-.191-.774-.338-.31-.19-.481-.495-.506-.87-.009-.136.023-.256.177-.268.155-.013.203.094.214.235.029.402.291.622.63.754.285.111.584.18.877.269.1-.69-.488-1.495-1.185-1.606-.508-.08-1.006.004-1.488.161a.903.903 0 00-.592.845c.006.352.28.734.615.858.22.081.433.056.636-.061.051-.03.097-.065.145-.097.1-.065.207-.052.255.046.032.065.023.197-.023.244-.096.094-.228.153-.349.22-.049.027-.103.04-.155.06a6.383 6.383 0 01-.053.072c.065.038.149.06.191.117.184.246.356.5.534.75.169.24.347.466.694.5.005-.063.013-.118.015-.172v-1.185c0-.182.069-.274.201-.262.159.015.184.132.184.264V71.7c0 .228-.06.291-.289.291-1.588 0-3.177 0-4.765.002-.182 0-.266-.077-.318-.25a1.704 1.704 0 00-1.484-1.21c-.708-.055-1.373.316-1.67.936-.015.03-.024.063-.049.126.141 0 .26.013.375-.006.048-.007.098-.07.128-.12.249-.413.611-.63 1.092-.614.484.017.829.262 1.045.694l.008.015c.098.211.077.354-.059.409-.123.05-.203-.015-.295-.235a.803.803 0 00-1.312-.264c-.023.022-.038.052-.071.1.063.008.102.019.146.021.168.002.337-.002.505.004.115.007.205.063.203.193 0 .126-.086.195-.203.195-.603.004-1.206.006-1.809 0-.18-.002-.251-.163-.18-.386a2.05 2.05 0 01.815-1.096 2.095 2.095 0 013.131.958c.021.05.073.126.113.126.339.01.68.006 1.044.006-.021-.071-.031-.12-.048-.166-.739-2.075-3.261-2.933-5.103-1.719-.255.168-.46.415-.506.755-.048.352-.249.629-.473.895a1.637 1.637 0 00-.226.38c-.048.105-.101.21-.218.176-.073-.021-.13-.122-.182-.195-.057-.082-.084-.19-.153-.262-.318-.338-.544-.705-.607-1.185-.023-.178-.199-.375-.358-.488-1.854-1.33-4.497-.47-5.236 1.692-.009.027-.015.054-.027.102.06.007.108.015.157.017.265 0 .533-.004.799.002.109.002.159-.031.203-.136.297-.713.829-1.149 1.587-1.29.994-.186 2 .41 2.331 1.367.021.061.038.124.044.187.017.178-.054.264-.236.266-.4.005-.8 0-1.2 0-.127 0-.236-.035-.247-.184-.01-.149.088-.201.22-.212.021 0 .042-.01.065-.017-.105-.228-.431-.38-.724-.333a.797.797 0 00-.651.514c-.027.067-.065.149-.122.178-.052.03-.177.025-.198-.01-.046-.072-.082-.185-.057-.26a1.18 1.18 0 011.222-.812c.388.034.708.208.905.543.094.161.192.226.368.2.061-.01.123 0 .184 0 .013-.015.025-.032.036-.047-.109-.157-.205-.331-.333-.472-.848-.945-2.434-.62-2.853.58-.113.326-.127.335-.469.335h-4.504c-.33 0-.395-.068-.393-.397v-1.463c0-.115.029-.208.153-.241.138-.038.238.06.238.234v1.42a.613.613 0 00.503-.189c.111-.109.203-.237.295-.365.215-.297.425-.6.646-.912-.031-.008-.087-.014-.136-.037-.144-.07-.293-.139-.429-.225-.098-.063-.136-.167-.06-.27.077-.105.171-.103.288-.038.139.078.289.162.442.182.343.045.584-.152.768-.417.18-.256.22-.536.086-.824-.119-.255-.308-.455-.59-.528-.444-.115-.894-.201-1.356-.138-.501.067-.863.34-1.059.8-.107.252-.164.525-.243.787.021.014.039.03.06.044.358-.126.725-.23 1.068-.388.27-.124.427-.37.441-.681.007-.133.072-.216.203-.208.134.008.183.105.18.233-.01.427-.219.748-.571.956-.22.13-.475.207-.72.291-.255.088-.525.13-.726.346-.105.115-.308.038-.308-.117 0-.736.101-1.45.666-1.986.194-.186.456-.304.722-.476-.042-.031-.107-.067-.157-.12-.538-.547-.584-1.51-.101-2.07.105-.122.226-.147.314-.06.113.116.051.217-.027.324a1.186 1.186 0 00.103 1.547c.284.285.657.377 1.04.432.161.023.322.044.479.084.572.148.917.515 1.04 1.094.005.023.015.044.025.078.398-.057.737.04.905.434.161.381.029.7-.302.956.067.07.124.134.197.213.896-1.107 2.053-1.612 3.481-1.532-2.435-.88-4.301-2.413-5.457-4.739-1.161-2.337-1.237-4.757-.423-7.214-.188 0-.366.008-.544 0-.736-.036-1.304-.56-1.322-1.243-.005-.18.058-.363.09-.545.027-.147.077-.292.077-.436.006-1.047.004-2.09.004-3.137 0-.046-.014-.107.009-.136.052-.067.123-.164.186-.162.065 0 .138.095.19.16.023.029.007.09.007.136v2.895c.272-.065.529-.138.793-.186.169-.032.347-.015.519-.038.412-.059.693-.461.588-.83a.596.596 0 00-.745-.426c-.067.017-.13.05-.195.073-.117.047-.209.01-.261-.098-.055-.111.004-.189.096-.248.379-.24.965-.155 1.258.187.263.304.333.65.19 1.023-.169.436-.502.67-.965.713-.219.021-.439.025-.657.057-.561.081-.816.58-.808.966.011.468.396.85.913.883.226.015.46-.032.686-.07.059-.01.126-.081.153-.142.287-.62.67-1.178 1.072-1.725.397-.541.416-1.156.236-1.78-.148-.516-.427-.963-.768-1.374a6.15 6.15 0 00-.172-.197c-.09-.098-.123-.205-.01-.304.111-.096.209-.046.306.042.205.189.403.384.621.556.471.369.99.643 1.595.725a1.98 1.98 0 001.178-.212 12.19 12.19 0 012.646-1c.326-.077.661-.117.994-.161.113-.015.182-.046.241-.155a1.53 1.53 0 01.286-.388c.176-.164.392-.151.559.019.096.098.184.214.241.337.056.126.138.164.264.176 1.283.13 2.463.575 3.591 1.183.571.308 1.162.268 1.75.044.6-.23 1.101-.614 1.553-1.063.037-.038.069-.099.111-.105.081-.014.199-.03.245.015.046.044.054.174.023.24-.049.102-.147.18-.218.27-.448.557-.787 1.163-.848 1.893-.039.47.094.886.352 1.283.36.553.693 1.123 1.042 1.683a.378.378 0 00.186.153c.342.097.689.12 1.02-.042.341-.165.538-.431.529-.826-.008-.38-.232-.752-.577-.85-.281-.08-.58-.102-.873-.125-.643-.052-1.114-.597-1.03-1.22.082-.608.762-1.088 1.497-.706.106.054.152.148.096.262-.063.123-.166.12-.283.073-.335-.136-.586-.099-.766.105-.341.386-.119.979.406 1.086.063.012.126.017.191.019.443.012.881.046 1.272.352.007-.071.015-.115.015-.157V51.41c0-.059-.017-.132.012-.17.047-.063.122-.136.189-.14.054-.005.132.077.169.138.03.048.013.124.013.189 0 1.144-.002 2.287.002 3.432 0 .19.044.38.054.57.036.69-.414 1.248-1.107 1.363-.236.038-.481.027-.736.04.943 2.442.843 4.855-.319 7.198-1.155 2.325-3.013 3.868-5.456 4.746v-.012zm3.604-8.974c.149.036.249.03.306-.15a.878.878 0 01.533-.563c.105-.042.151-.088.124-.203-.071-.304-.119-.617-.203-.916a7.494 7.494 0 00-1.664-3.024c-.065-.073-.115-.067-.207-.046-.163.038-.343.061-.507.036-.117-.017-.176 0-.247.084-.498.574-1 1.145-1.5 1.717-.042.048-.088.105-.143.121a.258.258 0 01-.19-.02.196.196 0 01-.071-.162c.008-.063.056-.126.1-.176.503-.577 1.007-1.153 1.516-1.728.071-.082.087-.142.056-.258a1.407 1.407 0 01-.025-.505c.01-.096.002-.145-.078-.199a7.511 7.511 0 00-3.168-1.266c-.105-.017-.155.006-.187.115-.092.33-.307.55-.625.675-.051.021-.084.088-.126.132.055.027.107.078.163.082a6.508 6.508 0 013.01.929c.109.065.222.13.316.216.044.042.077.14.059.195-.017.056-.099.115-.162.125-.056.01-.131-.031-.188-.067a6.1 6.1 0 00-2.29-.924c-.198-.036-.401-.055-.646-.086.05.069.067.098.09.121.299.3.598.598.9.898.238.237.481.47.709.717.05.054.071.167.057.245-.009.044-.118.1-.176.096-.065-.004-.134-.06-.186-.113-.344-.337-.683-.679-1.022-1.02-.268-.271-.533-.548-.803-.825-.053.046-.084.072-.111.099l-1.373 1.358c-.17.168-.337.338-.511.5-.084.077-.197.083-.257-.015-.038-.063-.019-.166-.009-.248.004-.031.052-.06.08-.088l1.544-1.532c.042-.042.078-.09.118-.135l-.03-.041c-1.27.102-2.39.58-3.392 1.404.092.105.167.191.242.28.264.301.532.599.789.905a.291.291 0 01.059.218c-.008.05-.098.124-.147.12a.369.369 0 01-.217-.112c-.312-.344-.616-.696-.923-1.044-.03-.033-.063-.06-.103-.098-1.101 1.088-1.72 2.381-1.844 3.918a.49.49 0 00.149-.107l1.969-1.968c.046-.044.09-.114.143-.122.079-.013.19-.01.243.038.039.035.018.153 0 .23-.011.044-.067.078-.103.116l-2.055 2.054c-.08.08-.157.164-.201.21l5.929 5.975c1.97-1.981 3.943-3.967 5.921-5.96-.013-.015-.038-.047-.065-.076l-2.191-2.19c-.052-.053-.122-.103-.149-.168-.025-.06-.031-.162.004-.2.044-.048.139-.069.21-.069.046 0 .098.057.138.097.636.635 1.272 1.27 1.907 1.907.083.084.169.166.278.273.008-.067.017-.094.012-.12-.121-1.172-.527-2.228-1.251-3.161-.101-.128-.207-.25-.31-.378-.071-.088-.079-.184.004-.266.092-.086.191-.067.281.013.025.023.048.05.071.077.858.977 1.367 2.118 1.555 3.403.031.216.046.436.067.659l.004-.009zm-6.306 8.175l.048.012.13-.11a8.273 8.273 0 011.668-1.158c1.358-.696 2.782-.964 4.295-.64.031.007.079.011.096-.006.182-.195.36-.394.54-.593l-.025-.061c-.327-.042-.651-.107-.977-.12-1.149-.046-2.248.202-3.301.648-1.566.667-3.152.755-4.766.216-.46-.155-.908-.352-1.371-.497-1.073-.337-2.168-.496-3.29-.268-.065.013-.127.036-.228.063.18.203.331.384.496.551a.256.256 0 00.205.063 5.902 5.902 0 012.52.01c1.315.282 2.439.928 3.439 1.808.036.031.073.057.134.105v-.298c0-.136.042-.251.199-.25.15 0 .186.114.186.244v.287l.002-.006zm-.781-1.9c-1.804-1.815-3.65-3.673-5.475-5.514.197 3.128 2.991 5.45 5.475 5.514zm1.133.007c.965.172 3.081-.896 4.112-2.12a5.963 5.963 0 001.424-3.45c-1.863 1.873-3.707 3.729-5.536 5.57zm-9.421-6.743c.329-.107.641-.206.948-.317.042-.014.076-.092.088-.144.086-.374.143-.753.249-1.12a7.797 7.797 0 011.681-3.034.433.433 0 00.08-.222c.023-.18.033-.36.041-.543.003-.059.003-.136-.031-.176-.27-.319-.546-.631-.822-.944-.028-.031-.063-.054-.099-.084-.012.021-.019.028-.017.032.009.063.017.126.028.189.098.673-.021 1.293-.446 1.838a7.948 7.948 0 00-1.469 2.992 7.127 7.127 0 00-.231 1.537v-.004zm15.549-6.594c-.034.008-.055.008-.065.019-.287.325-.576.652-.858.983-.023.027-.021.097-.004.134.079.189.109.373.044.577-.017.052.006.14.044.182a7.9 7.9 0 012.007 4.244c.008.052.077.117.132.14.261.103.529.193.797.288.025.008.052.012.1.025-.006-.095-.006-.174-.016-.252-.203-1.587-.833-2.996-1.779-4.27-.402-.544-.538-1.145-.444-1.808l.038-.26.004-.002zm-2.551 12.297c.056.012.073.02.09.019.47-.05.941-.101 1.412-.16a.263.263 0 00.157-.086c.911-1.084 1.457-2.331 1.679-3.728.014-.096-.004-.146-.101-.184a.864.864 0 01-.538-.535c-.062-.178-.152-.207-.324-.147-.098 1.927-.883 3.531-2.373 4.816l-.002.005zm-8.272.019a.8.8 0 01.046-.055c-.04-.021-.086-.036-.119-.065-1.383-1.216-2.135-2.745-2.256-4.587-.004-.053-.046-.128-.09-.15-.094-.04-.122.038-.151.116-.096.262-.266.478-.529.566-.203.067-.214.172-.183.346a7.675 7.675 0 001.48 3.376c.161.21.323.35.601.304.061-.01.128.004.19.012l1.011.134v.002zm3.366-13.893c-.105.01-.201.015-.295.03-.681.098-1.332.304-1.968.557-.446.179-.879.388-1.316.587-.674.304-1.35.27-2.028.02-.038-.015-.08-.024-.134-.038.012.04.014.06.025.073.335.386.667.77 1.009 1.151.025.03.096.04.134.03a.8.8 0 01.558.024c.042.017.116.005.155-.023a7.934 7.934 0 013.558-1.432c.044-.006.111-.054.12-.092.067-.287.121-.574.184-.885l-.002-.002zm1.548-.031c.067.325.128.589.174.857.019.107.061.143.163.158 1.216.165 2.33.6 3.343 1.287.14.094.259.174.431.067a.278.278 0 01.22-.023c.287.109.435-.059.592-.254.22-.27.456-.526.684-.788.026-.03.044-.06.09-.128-.203.063-.366.117-.529.161-.588.154-1.168.133-1.708-.159-.749-.404-1.524-.738-2.346-.95-.356-.092-.722-.148-1.116-.228h.002zm-9.663 9.477c.048.346.08.673.138.995a8.487 8.487 0 001.455 3.414c.027.038.084.088.117.082.316-.063.63-.137.957-.208-.021-.034-.036-.07-.059-.1a7.67 7.67 0 01-1.507-3.496c-.042-.258-.13-.369-.385-.419-.232-.044-.45-.166-.714-.268h-.002zm15.128 4.29c.287.058.557.094.816.171.162.048.233.004.321-.124a8.686 8.686 0 001.385-3.258c.067-.343.101-.694.149-1.03-.346.108-.664.202-.978.31-.039.014-.073.096-.081.15a7.78 7.78 0 01-1.16 3.122c-.14.218-.293.43-.45.658h-.002zM277.26 52.53c-.031-.003-.054-.009-.075-.005a7.372 7.372 0 00-3.288 1.325c-.038.028-.061.12-.046.168.067.2.054.386-.027.577-.019.044-.026.12 0 .153.077.105.171.197.261.295.042-.031.071-.052.096-.073a6.435 6.435 0 012.031-1.111 6.476 6.476 0 011.72-.325c.046 0 .088-.048.132-.076-.036-.044-.063-.098-.107-.128-.067-.044-.148-.06-.218-.102-.263-.158-.406-.405-.479-.696v-.002zm-4.527 2.373l-.048-.042c-.025.046-.04.1-.073.138-.59.68-1.082 1.424-1.375 2.277-.176.514-.287 1.049-.425 1.575-.025.094-.009.16.104.195.321.1.52.329.639.64.019.047.092.077.14.115.029-.047.082-.09.084-.139.102-1.608.709-2.996 1.821-4.162.188-.197.184-.192.008-.413-.084-.102-.157-.123-.293-.1-.151.027-.316-.017-.473-.036-.038-.004-.073-.033-.109-.05v.002zm11.61 11.514c-.097-.02-.136-.03-.176-.037a5.465 5.465 0 00-2.039.065c-1.329.287-2.436.977-3.44 1.872-.272.243-.243.51-.235.799 0 .035.044.088.078.1.029.011.085-.016.111-.041.075-.08.14-.17.215-.252 1.268-1.415 2.815-2.16 4.747-1.988.044.005.102.007.132-.016.192-.154.381-.313.605-.5l.002-.002zm-12.11-.014c.012.04.012.06.023.069.134.117.276.23.406.354.1.097.207.118.345.105a5.153 5.153 0 012.658.451c.877.403 1.591 1.008 2.2 1.749.031.037.088.054.134.08.023-.049.063-.097.069-.15.042-.329-.029-.59-.31-.834-.881-.76-1.835-1.373-2.963-1.692a5.641 5.641 0 00-2.56-.136l-.002.004zm15.325 5.195c-.214-.32-.411-.618-.612-.912a1.436 1.436 0 00-.157-.186c-.525-.554-1.362-.533-1.833.044-.073.088-.094.161-.034.278.107.206.193.422.268.64.038.109.09.14.199.138.436-.006.869-.002 1.304-.002h.867-.002zm-18.488-.03c.04.02.051.028.061.028.676 0 1.354.004 2.03-.002.051 0 .12-.073.147-.128.09-.195.155-.398.245-.593.115-.25.121-.248-.069-.44a.736.736 0 00-.105-.09 1.163 1.163 0 00-1.555.199c-.276.312-.496.675-.751 1.027h-.003zm9.182-21.089c-.065.086-.115.136-.146.197a4.271 4.271 0 00-.459 1.646.605.605 0 00.601.665.596.596 0 00.601-.642 4.124 4.124 0 00-.448-1.663c-.032-.063-.086-.117-.149-.2v-.003zm.829 19.278l.14-.17c.733-.872 1.643-1.465 2.757-1.704.404-.086.745-.27 1.084-.482.031-.019.054-.05.096-.088-.042-.015-.061-.025-.081-.025a4.833 4.833 0 00-1.654.278c-.961.355-1.733.967-2.386 1.745-.178.212-.176.214.044.446zm-1.595-.056c.214-.262.187-.172-.004-.422a3.744 3.744 0 00-.314-.348c-.843-.864-1.833-1.45-3.047-1.604-.243-.031-.488-.031-.731-.046l-.018.065c.299.162.558.403.906.468.751.14 1.456.398 2.063.868.4.31.762.67 1.147 1.019h-.002zm-6.984-9.123c.435.007.71-.253.705-.605-.004-.344-.276-.602-.638-.588-.398.017-.756.16-1.074.392-.184.135-.182.269 0 .405.318.237.681.363 1.007.394v.002zm15.597 0c.295-.025.628-.146.916-.377.201-.161.203-.285-.006-.444-.291-.225-.619-.363-.99-.37-.36-.008-.63.248-.63.592 0 .352.27.608.712.602l-.002-.003zm-7.824 10.689c.145-.195.291-.356.398-.539.295-.507.063-.9-.339-1.174a.16.16 0 00-.128-.013c-.343.135-.569.615-.456.973.09.29.283.512.527.75l-.002.003zm5.421-17.05a.367.367 0 00-.358-.369.363.363 0 00-.356.37.357.357 0 10.714 0zm1.49 15.568a.371.371 0 00.369-.36.366.366 0 00-.369-.36.347.347 0 00-.354.35.352.352 0 00.354.37zm-13.87 0c.186 0 .36-.164.366-.346a.374.374 0 00-.357-.373.366.366 0 00-.373.354c0 .201.161.363.364.365zm2.183-15.507a.348.348 0 00-.36-.363.36.36 0 00-.354.357c0 .201.166.367.367.365a.35.35 0 00.347-.359z"}),ae().createElement("path",{d:"M278.242 48.801c.245-.27.505-.455.831-.54.58-.152 1.097-.034 1.526.383.18.176.318.396.475.596.138.178.253.381.418.528.27.239.61.306.942.15.36-.17.542-.486.544-.884 0-.306-.171-.52-.437-.66-.115-.061-.157-.162-.088-.277.063-.107.163-.12.272-.063.021.01.042.02.061.034.519.295.72.91.483 1.48-.408.987-1.609 1.132-2.279.268-.132-.17-.232-.36-.356-.537-.173-.25-.372-.476-.661-.6a1.197 1.197 0 00-1.517.516c-.042.07-.132.154-.199.154-.069 0-.166-.078-.205-.147-.406-.698-1.3-.837-1.884-.27a3.32 3.32 0 00-.442.578c-.209.32-.431.618-.801.767-.517.21-1.109.093-1.476-.3a1.253 1.253 0 01-.196-1.396c.115-.228.288-.405.508-.535.111-.065.214-.067.289.047.075.115.027.21-.08.278-.343.223-.523.527-.437.944.134.648.969.91 1.48.455.161-.143.284-.333.404-.518.219-.342.458-.66.818-.862a1.598 1.598 0 011.894.273c.036.036.067.08.115.136l-.002.002zM282.708 51.319c-.067-.026-.138-.147-.136-.22.002-.055.12-.143.193-.15.4-.041.709-.245 1.015-.488.27-.212.569-.394.875-.551a.75.75 0 01.705.019c.115.06.165.15.103.272-.318.627-1.024 1.332-1.901 1.323-.004.015-.579-.105-.854-.205zm.831-.212c.463.09 1.164-.344 1.432-.879-.607.08-.923.594-1.432.879zM273.047 51.52c-.4.009-.754-.128-1.072-.352a2.66 2.66 0 01-.799-.906c-.101-.182-.059-.289.138-.367.333-.13.644-.033.931.13.214.124.413.28.601.44.289.248.596.435.984.477a.315.315 0 01.213.157c.05.117-.048.2-.153.23-.274.084-.837.204-.841.19l-.002.001zm-.023-.404c-.381-.438-1.091-.885-1.367-.866.201.467.931.941 1.367.866zM268.171 57.638v3.263c0 .052.018.12-.007.153-.05.067-.125.125-.188.125-.065 0-.134-.06-.188-.125-.021-.026-.007-.078-.007-.12 0-1.195-.002-2.39.005-3.583 0-.096.041-.222.11-.28.103-.091.191.035.287.079.197.088.404.16.613.212.13.033.268.041.256.215-.013.168-.145.196-.283.175-.192-.03-.383-.07-.596-.11l-.002-.004zM288.332 57.64c-.232.042-.429.084-.63.111-.138.019-.253-.038-.258-.188-.004-.145.109-.191.239-.198.264-.01.496-.09.703-.262.051-.042.161-.063.218-.035.054.027.107.126.107.193.006 1.243.006 2.486.006 3.727 0 .132-.046.235-.199.229-.148-.006-.188-.107-.186-.241v-3.17-.168.002zM288.284 48.86c-.222.249-.441.5-.663.75-.103.117-.205.235-.312.352-.086.095-.188.126-.291.038-.103-.088-.088-.19-.002-.29.444-.505.883-1.012 1.335-1.511.05-.057.176-.099.237-.073.06.023.121.138.121.216.009.706.004 1.415.006 2.121 0 .134-.05.235-.196.233-.147-.002-.189-.109-.189-.241v-1.409c0-.057-.004-.113-.006-.168l-.042-.017.002-.002zM268.219 48.828c-.004.103-.008.157-.008.214 0 .47-.002.941 0 1.411 0 .136-.046.23-.187.245-.119.015-.205-.09-.207-.245 0-.702-.004-1.405.007-2.107 0-.078.06-.2.119-.218.071-.021.197.019.251.078.444.488.877.987 1.314 1.484.086.099.128.205.017.304-.117.105-.224.052-.314-.053l-.839-.953c-.04-.044-.082-.086-.153-.162v.002zM271.352 48.482h-1.233c-.133 0-.238-.05-.238-.19 0-.141.105-.193.238-.193h2.499c.132 0 .239.05.239.193 0 .144-.107.19-.239.19h-1.266zM285.232 48.482h-1.197c-.143 0-.272-.03-.272-.193 0-.167.134-.193.272-.193h2.43c.142 0 .274.032.274.193 0 .158-.128.195-.274.195-.411-.004-.821 0-1.233 0v-.002zM269.065 56.09a.59.59 0 01-.601-.605.597.597 0 01.596-.596.603.603 0 11.005 1.204v-.002zm.219-.586c-.004-.143-.104-.235-.23-.225-.132.01-.197.097-.205.216-.008.116.115.218.232.208.13-.013.193-.092.203-.2zM287.378 56.091a.6.6 0 11.023-1.201.6.6 0 01.588.606.595.595 0 01-.613.595h.002zm.004-.386a.23.23 0 00.226-.216c0-.113-.105-.213-.226-.211-.132.002-.199.081-.214.203-.012.113.099.222.214.224zM268.578 51.732c0-.46.352-.845.798-.868.071-.004.194.07.211.128.136.478-.004 1.004-.619 1.136-.27.057-.365-.019-.386-.291-.004-.04-.004-.082-.006-.105h.002zm.404-.044c.182-.034.264-.153.243-.352-.178.065-.251.172-.243.352zM287.977 51.713c0 .424-.141.518-.54.371-.473-.174-.601-.641-.471-1.09.016-.06.14-.134.209-.13.45.027.797.407.8.85h.002zm-.658-.388c.005.229.072.325.258.378.014-.19-.057-.298-.258-.378zM271.068 49.151c.004.518-.291.843-.764.887-.164.015-.245-.05-.279-.212-.104-.53.222-.993.758-1.067.132-.019.216.034.247.16.023.09.029.182.036.232h.002zm-.394.067c-.215.099-.289.22-.249.392.176-.065.245-.193.249-.392zM285.456 49.2c0-.452.147-.544.555-.35.399.188.584.565.485.987-.033.146-.113.216-.272.2-.477-.043-.768-.355-.768-.838zm.653.406c0-.22-.067-.319-.253-.373-.013.197.058.306.253.373z"}),ae().createElement("path",{d:"M277.655 49.816c-.129-.021-.207-.038-.288-.044-.536-.05-.919.205-1.223.616-.086.116-.159.267-.341.157-.123-.073-.113-.197.032-.39.41-.549.937-.85 1.64-.76.074.008.164.016.214.06.059.053.115.15.107.22-.007.06-.105.11-.141.143v-.002zM279.316 49.749c-.147.02-.245.031-.342.05-.121.023-.228.007-.263-.128-.036-.14.044-.216.173-.25.522-.136.988-.008 1.398.322.174.138.31.325.455.496.083.101.098.216-.028.3-.123.084-.217.025-.293-.084-.169-.245-.366-.467-.648-.582-.157-.065-.329-.093-.455-.126l.003.002zM282.642 49.082a.556.556 0 01-.561.543.552.552 0 01.018-1.103.556.556 0 01.545.562l-.002-.002zm-.547.218c.073-.107.153-.17.151-.23 0-.053-.105-.152-.144-.145a.237.237 0 00-.155.155c-.011.046.073.113.15.218l-.002.002zM274.491 49.625a.555.555 0 01-.549-.558.56.56 0 01.542-.547.558.558 0 01.557.55.56.56 0 01-.55.555zm.014-.789c-.085.111-.165.172-.167.233 0 .052.092.155.136.151.065-.004.159-.078.172-.138.012-.055-.067-.128-.141-.248v.002zM268.633 64.538h.626c.126 0 .226.044.232.18.007.147-.1.2-.23.202-.423.002-.845 0-1.266 0-.132 0-.234-.049-.23-.2.004-.14.104-.18.228-.18h.642l-.002-.002zM287.902 64.53h.626c.128 0 .222.054.222.188 0 .135-.094.19-.222.19h-1.285c-.125 0-.22-.05-.22-.19 0-.142.097-.188.22-.188.22-.002.44 0 .659 0zM269.485 66.104h-.588c-.13 0-.236-.04-.241-.186-.004-.15.103-.193.233-.193h1.195c.132 0 .243.044.243.186 0 .153-.116.197-.254.195-.196-.002-.393 0-.588 0v-.002zM287.026 66.094h-.626c-.132 0-.216-.065-.211-.197.004-.124.09-.178.213-.178h1.235c.128 0 .22.052.222.19 0 .139-.099.187-.222.187h-.609l-.002-.002zM288.032 64.311h-.485c-.126 0-.224-.046-.229-.182-.004-.149.101-.197.233-.2h.99c.127 0 .217.068.211.2-.006.122-.092.178-.213.178h-.505l-.002.004zM270.165 66.706c-.157 0-.311.004-.468 0-.12-.006-.226-.052-.224-.19 0-.148.104-.196.236-.196h.919c.123 0 .222.04.23.18.009.152-.098.202-.224.206-.155.006-.312 0-.469 0zM286.365 66.314h.468c.124 0 .201.063.203.189 0 .117-.073.184-.186.186-.341.005-.682.007-1.023 0-.113-.002-.184-.077-.178-.193.006-.115.081-.176.197-.178.173-.002.347 0 .521 0l-.002-.004zM268.465 64.318h-.502c-.126 0-.201-.063-.203-.187 0-.127.081-.186.203-.186.341 0 .682-.002 1.023 0 .12 0 .203.056.201.186-.002.139-.09.19-.22.19h-.502v-.003zM288.173 63.716h-.347c-.122 0-.201-.059-.207-.184-.007-.12.069-.19.18-.193.259-.009.521-.015.778.006.065.006.157.12.168.193.014.107-.076.174-.193.176-.128.002-.253 0-.381 0l.002.002zM268.32 63.72h-.346c-.121 0-.205-.054-.211-.177-.004-.124.069-.195.192-.197.249-.005.496-.007.746 0 .119.002.203.075.196.197-.006.12-.088.18-.213.178-.122-.002-.243 0-.364 0zM285.47 67.301c-.096-.004-.207.01-.301-.023-.071-.025-.157-.107-.172-.178-.02-.107.059-.187.176-.189.197-.004.396-.017.588.007.067.008.157.098.176.17.03.108-.052.184-.167.197-.099.01-.197.01-.302.016h.002zM271.042 67.297c-.099 0-.197.008-.293-.002-.116-.015-.214-.086-.183-.203.019-.072.122-.16.195-.17.18-.025.366-.01.551-.007.119.003.2.063.205.19.004.127-.084.184-.199.194-.092.009-.184 0-.276 0v-.002zM288.305 63.12c-.088 0-.174.005-.261 0-.116-.008-.201-.079-.18-.188.012-.071.1-.172.165-.182.182-.026.37-.026.552 0 .065.008.172.125.164.178-.013.071-.105.153-.182.186-.074.032-.172.007-.258.007zM268.199 63.123c-.085 0-.182.023-.257-.006-.071-.03-.167-.11-.17-.172-.002-.063.088-.178.149-.187.188-.025.383-.023.569 0 .063.008.157.122.153.185-.002.063-.098.146-.169.172-.082.029-.182.006-.275.006v.002zM286.83 65.49c-.072-.027-.155-.111-.164-.18-.006-.053.088-.166.145-.172.199-.021.395-.02.594.002.055.006.145.12.142.18-.002.06-.087.147-.152.168-.088.029-.486.033-.565 0v.002zM269.41 65.132c.092 0 .194-.026.274.006.071.027.155.113.165.182.009.05-.09.164-.15.17a2.389 2.389 0 01-.586 0c-.061-.006-.145-.117-.149-.186-.004-.055.086-.145.153-.168.088-.03.194-.007.293-.007v.003zM288.391 62.532c-.07-.004-.151.012-.203-.02-.065-.039-.147-.119-.147-.18 0-.06.086-.163.149-.176a1.04 1.04 0 01.41 0c.061.013.144.116.144.179 0 .06-.083.14-.148.178-.053.031-.134.015-.203.019h-.002zM268.114 62.527c-.057 0-.115.005-.172 0-.115-.01-.173-.08-.173-.19 0-.145.098-.16.167-.179.113-.03.239-.014.36-.008.113.006.182.08.18.193 0 .115-.075.176-.188.184-.057.005-.116 0-.172 0h-.002zM270.165 66.886c.023 0 .044.013.059.03.048.06.111.121.121.188.017.122-.081.208-.192.183-.074-.017-.178-.118-.18-.183 0-.063.073-.128.127-.19a.078.078 0 01.065-.028zM278.468 49.77c-.071.05-.134.125-.211.142-.122.025-.201-.063-.203-.178-.002-.12.081-.203.199-.184.077.012.144.09.215.138v.082zM269.083 66.506c-.119.09-.184.177-.261.19-.111.018-.199-.058-.199-.183 0-.124.077-.206.195-.185.077.013.144.095.265.18v-.002zM269.97 50.384c0 .025-.01.05-.031.065-.065.048-.128.11-.199.122-.109.019-.18-.067-.182-.18-.002-.116.069-.2.175-.187.072.008.137.067.201.115a.08.08 0 01.034.065h.002zM268.125 61.8c-.063.092-.186.126-.28.065-.053-.034-.072-.084-.057-.149a.288.288 0 01.182-.176c.115-.021.205.071.184.188a.173.173 0 01-.031.072h.002zM279.303 60.299a.97.97 0 00-.748.396c-.031.042-.062.084-.088.13-.056.103-.129.174-.251.107-.121-.067-.102-.17-.046-.27.214-.374.526-.615.955-.686.175-.03.358-.032.533-.065.312-.059.578-.204.775-.46.071-.092.157-.148.266-.066.11.083.073.18.004.272a1.456 1.456 0 01-.808.539c-.117.031-.155.086-.151.205.006.243-.01.489-.004.732a.993.993 0 01-.523.937 1.753 1.753 0 01-1.589.12c-.613-.246-.91-.745-.952-1.382-.034-.49-.042-.99.006-1.478.119-1.229 1.191-1.709 2.256-1.357.427.14.714.422.798.879.033.182-.034.3-.174.32-.14.022-.224-.066-.249-.26a.688.688 0 00-.454-.588c-.844-.325-1.691.07-1.744 1.06-.025.487-.033.977.007 1.462.088 1.059 1.067 1.32 1.802.97a.637.637 0 00.383-.628c-.004-.29 0-.58 0-.89h-.004zM283.591 55.271c.078.052.143.082.185.13.78.88 1.295 1.889 1.463 3.063.018.134-.021.24-.166.258-.136.017-.194-.071-.211-.2-.155-1.091-.645-2.022-1.352-2.855a.366.366 0 01-.078-.24c.005-.053.095-.097.159-.156zM269.163 48.476a.186.186 0 100-.372.186.186 0 000 .372zM287.427 48.442a.187.187 0 100-.373.187.187 0 000 .373zM286.923 50.407a.186.186 0 11-.373 0 .186.186 0 01.373 0zM288.725 61.733a.186.186 0 11-.371 0 .186.186 0 01.371 0zM286.539 67.102a.187.187 0 01-.187.187.187.187 0 010-.373c.103 0 .187.084.187.186z"})),ae().createElement("path",{fill:"url(#paint39_linear_21_2)",d:"M181.846 49.708c13.726 0 24.854-11.128 24.854-24.854C206.7 11.127 195.572 0 181.846 0c-13.726 0-24.854 11.127-24.854 24.854 0 13.726 11.128 24.854 24.854 24.854z"}),ae().createElement("path",{fill:"url(#paint40_linear_21_2)",d:"M177.877 245.93c36.091 0 65.348-29.258 65.348-65.348 0-36.091-29.257-65.348-65.348-65.348-36.09 0-65.348 29.257-65.348 65.348 0 36.09 29.258 65.348 65.348 65.348z"}),ae().createElement("g",{clipPath:"url(#clip2_21_2)"},ae().createElement("path",{fill:"#FFB45A",d:"M155.387 214.925a7.693 7.693 0 007.693-7.693 7.693 7.693 0 10-15.386 0 7.693 7.693 0 007.693 7.693z"}),ae().createElement("path",{fill:"#FF7B8E",d:"M177.644 214.925a7.693 7.693 0 007.693-7.693 7.693 7.693 0 00-7.693-7.693 7.693 7.693 0 00-7.693 7.693 7.693 7.693 0 007.693 7.693z"}),ae().createElement("path",{fill:"#5AC0FF",d:"M199.896 214.925a7.693 7.693 0 007.693-7.693 7.693 7.693 0 00-7.693-7.693 7.693 7.693 0 00-7.693 7.693 7.693 7.693 0 007.693 7.693z"}),ae().createElement("path",{fill:"#5633D1",d:"M191.159 158.779c-.416 0-.822.028-1.222.055-1.672-7.304-8.208-12.763-16.02-12.763-2.055 0-4.019.379-5.837 1.077 0 2.056.011 4.425.027 5.432 2.099.01 6.157.027 7.947.027v7.774h-7.909v13.135h8.137c-.228.579-.579 1.44-.725 1.775-1.477 3.565-5.151 5.556-8.954 4.869-3.619-.66-6.308-3.738-6.508-7.515-.054-1.103-.027-2.218-.027-3.321v-8.997h-2.786c-5.622 2.607-9.533 8.293-9.533 14.899 0 9.078 7.358 16.43 16.43 16.43h27.164c8.997-.092 16.246-7.411 16.246-16.43s-7.357-16.447-16.43-16.447z"})),ae().createElement("g",{fill:"#fff",clipPath:"url(#clip3_21_2)"},ae().createElement("path",{d:"M181.77 25.565l-3.242 9.42a10.808 10.808 0 006.644-.174.983.983 0 01-.077-.149l-3.321-9.1-.004.003zM170.775 24.62a10.81 10.81 0 006.092 9.727l-5.156-14.126a10.72 10.72 0 00-.936 4.398z"}),ae().createElement("path",{d:"M188.877 24.075c0-1.334-.478-2.258-.892-2.98-.547-.892-1.062-1.642-1.062-2.534 0-.994.754-1.919 1.816-1.919.048 0 .095.004.142.008a10.773 10.773 0 00-7.296-2.835 10.79 10.79 0 00-9.029 4.869c.253.007.493.01.696.01 1.131 0 2.879-.137 2.879-.137.584-.036.653.82.069.888 0 0-.587.07-1.237.105l3.935 11.704 2.364-7.092-1.682-4.612a20.787 20.787 0 01-1.135-.105c-.584-.036-.515-.924.069-.888 0 0 1.784.138 2.846.138 1.128 0 2.879-.138 2.879-.138.584-.033.653.82.069.888 0 0-.587.07-1.236.105l3.905 11.617 1.077-3.6c.468-1.494.823-2.57.823-3.495v.003zM191.064 19.434c.047.345.073.714.073 1.113 0 1.095-.203 2.328-.823 3.872l-3.3 9.543a10.804 10.804 0 005.374-9.34c0-1.878-.479-3.647-1.324-5.184v-.004z"}),ae().createElement("path",{d:"M181.582 10.555c-7.768 0-14.066 6.298-14.066 14.064s6.298 14.064 14.066 14.064c7.767 0 14.066-6.298 14.066-14.064s-6.299-14.064-14.066-14.064zm0 26.395c-6.799 0-12.329-5.53-12.329-12.331 0-6.802 5.53-12.328 12.329-12.328s12.329 5.53 12.329 12.328c0 6.798-5.53 12.331-12.329 12.331z"})),ae().createElement("g",{clipPath:"url(#clip4_21_2)"},ae().createElement("path",{fill:"#fff",d:"M87.793 49.902H67.402c-.644 0-1.166.522-1.166 1.165V71.46c0 .643.522 1.165 1.166 1.165h20.391c.644 0 1.165-.522 1.165-1.165V51.067c0-.643-.521-1.165-1.165-1.165zM74.538 66.39h-1.98V56.136h1.98V66.39zm8.098 0h-5.942v-2.127h5.942v2.127zm0-4.064h-5.942V60.2h5.942v2.126zm0-4.063h-5.942v-2.127h5.942v2.127z"}))),ae().createElement("defs",null,ae().createElement("linearGradient",{id:"paint0_linear_21_2",x1:"98.365",x2:"107.763",y1:"21.3",y2:"290.338",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint1_linear_21_2",x1:"87.284",x2:"96.683",y1:"21.689",y2:"290.727",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint2_linear_21_2",x1:"66.918",x2:"76.316",y1:"22.399",y2:"291.437",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint3_linear_21_2",x1:"109.954",x2:"119.353",y1:"20.898",y2:"289.936",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint4_linear_21_2",x1:"76.777",x2:"86.175",y1:"22.054",y2:"291.092",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint5_linear_21_2",x1:"121.976",x2:"131.374",y1:"20.479",y2:"289.517",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint6_linear_21_2",x1:"159.89",x2:"169.289",y1:"19.152",y2:"288.191",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint7_linear_21_2",x1:"172.849",x2:"182.247",y1:"18.699",y2:"287.737",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint8_linear_21_2",x1:"57.767",x2:"67.166",y1:"22.717",y2:"291.755",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint9_linear_21_2",x1:"147.041",x2:"156.44",y1:"19.6",y2:"288.638",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint10_linear_21_2",x1:"134.371",x2:"143.769",y1:"20.044",y2:"289.082",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint11_linear_21_2",x1:"41.858",x2:"51.256",y1:"23.278",y2:"292.31",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint12_linear_21_2",x1:"35.201",x2:"44.599",y1:"23.507",y2:"292.546",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint13_linear_21_2",x1:"29.484",x2:"38.883",y1:"23.707",y2:"292.745",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint14_linear_21_2",x1:"185.827",x2:"195.226",y1:"18.245",y2:"287.283",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint15_linear_21_2",x1:"49.397",x2:"58.795",y1:"23.015",y2:"292.053",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint16_linear_21_2",x1:"18.35",x2:"27.748",y1:"24.098",y2:"293.136",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint17_linear_21_2",x1:"21.032",x2:"30.431",y1:"24.005",y2:"293.044",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint18_linear_21_2",x1:"24.747",x2:"34.145",y1:"23.872",y2:"292.91",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint19_linear_21_2",x1:"323.253",x2:"332.651",y1:"13.445",y2:"282.483",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint20_linear_21_2",x1:"327.244",x2:"336.642",y1:"13.308",y2:"282.346",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint21_linear_21_2",x1:"312.33",x2:"321.728",y1:"13.827",y2:"282.865",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint22_linear_21_2",x1:"318.272",x2:"327.671",y1:"13.619",y2:"282.657",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint23_linear_21_2",x1:"198.709",x2:"208.108",y1:"17.798",y2:"286.836",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint24_linear_21_2",x1:"330.202",x2:"339.6",y1:"13.201",y2:"282.239",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint25_linear_21_2",x1:"247.84",x2:"257.238",y1:"16.08",y2:"285.119",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint26_linear_21_2",x1:"259.099",x2:"268.497",y1:"15.689",y2:"284.727",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint27_linear_21_2",x1:"236.089",x2:"245.487",y1:"16.49",y2:"285.528",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint28_linear_21_2",x1:"211.439",x2:"220.837",y1:"17.353",y2:"286.391",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint29_linear_21_2",x1:"223.915",x2:"233.313",y1:"16.916",y2:"285.955",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint30_linear_21_2",x1:"289.151",x2:"298.549",y1:"14.636",y2:"283.674",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint31_linear_21_2",x1:"305.461",x2:"314.86",y1:"14.065",y2:"283.103",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint32_linear_21_2",x1:"297.717",x2:"307.116",y1:"14.336",y2:"283.375",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint33_linear_21_2",x1:"269.774",x2:"279.172",y1:"15.316",y2:"284.348",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint34_linear_21_2",x1:"279.817",x2:"289.215",y1:"14.963",y2:"284.001",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#9292FF"}),ae().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),ae().createElement("linearGradient",{id:"paint35_linear_21_2",x1:"325.897",x2:"344.81",y1:"164.814",y2:"103.778",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#019FB4"}),ae().createElement("stop",{offset:"1",stopColor:"#68FF61"})),ae().createElement("linearGradient",{id:"paint36_linear_21_2",x1:"8.897",x2:"39.054",y1:"173.763",y2:"136.125",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#FFA970"}),ae().createElement("stop",{offset:"0.11",stopColor:"#FFAF79"}),ae().createElement("stop",{offset:"0.42",stopColor:"#FFBB8F"}),ae().createElement("stop",{offset:"0.72",stopColor:"#FFC39B"}),ae().createElement("stop",{offset:"1",stopColor:"#FFC6A0"})),ae().createElement("linearGradient",{id:"paint37_linear_21_2",x1:"77.114",x2:"78.852",y1:"37.379",y2:"95.798",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#FF7B8E"}),ae().createElement("stop",{offset:"0.23",stopColor:"#FA768A"}),ae().createElement("stop",{offset:"0.47",stopColor:"#EE6A80"}),ae().createElement("stop",{offset:"0.71",stopColor:"#D95470"}),ae().createElement("stop",{offset:"0.96",stopColor:"#BC3759"}),ae().createElement("stop",{offset:"1",stopColor:"#B73255"})),ae().createElement("linearGradient",{id:"paint38_linear_21_2",x1:"257.38",x2:"322.679",y1:"54.177",y2:"72.279",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#AA6AFF"}),ae().createElement("stop",{offset:"0.26",stopColor:"#8B56EE"}),ae().createElement("stop",{offset:"0.64",stopColor:"#643CD9"}),ae().createElement("stop",{offset:"0.84",stopColor:"#5533D1"})),ae().createElement("linearGradient",{id:"paint39_linear_21_2",x1:"165.405",x2:"198.41",y1:"6.509",y2:"43.342",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#34C6FF"}),ae().createElement("stop",{offset:"0.19",stopColor:"#35C1FE"}),ae().createElement("stop",{offset:"0.39",stopColor:"#3BB5FE"}),ae().createElement("stop",{offset:"0.59",stopColor:"#449FFE"}),ae().createElement("stop",{offset:"0.8",stopColor:"#5082FD"}),ae().createElement("stop",{offset:"1",stopColor:"#605EFD"})),ae().createElement("linearGradient",{id:"paint40_linear_21_2",x1:"177.877",x2:"177.877",y1:"124.501",y2:"263.274",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{offset:"0.01",stopColor:"#fff"}),ae().createElement("stop",{offset:"0.26",stopColor:"#fff",stopOpacity:"0.99"}),ae().createElement("stop",{offset:"0.43",stopColor:"#fff",stopOpacity:"0.95"}),ae().createElement("stop",{offset:"0.58",stopColor:"#fff",stopOpacity:"0.89"}),ae().createElement("stop",{offset:"0.71",stopColor:"#fff",stopOpacity:"0.81"}),ae().createElement("stop",{offset:"0.84",stopColor:"#fff",stopOpacity:"0.7"}),ae().createElement("stop",{offset:"0.95",stopColor:"#fff",stopOpacity:"0.56"}),ae().createElement("stop",{offset:"1",stopColor:"#fff",stopOpacity:"0.5"})),ae().createElement("clipPath",{id:"clip0_21_2"},ae().createElement("path",{fill:"#fff",d:"M0 0H355.975V246H0z"})),ae().createElement("clipPath",{id:"clip1_21_2"},ae().createElement("path",{fill:"#fff",d:"M0 0H22.531V24H0z",transform:"translate(266.992 48)"})),ae().createElement("clipPath",{id:"clip2_21_2"},ae().createElement("path",{fill:"#fff",d:"M0 0H59.895V68.848H0z",transform:"translate(147.694 146.071)"})),ae().createElement("clipPath",{id:"clip3_21_2"},ae().createElement("path",{fill:"#fff",d:"M0 0H28.132V28.132H0z",transform:"translate(167.516 10.555)"})),ae().createElement("clipPath",{id:"clip4_21_2"},ae().createElement("path",{fill:"#fff",d:"M0 0H22.722V22.722H0z",transform:"translate(66.236 49.902)"}))))},UC=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 39 39"},ae().createElement("path",{fillRule:"evenodd",d:"M39 19.5C39 30.27 30.27 39 19.5 39S0 30.27 0 19.5 8.73 0 19.5 0 39 8.73 39 19.5zm-21.695 3.8l6.582-3.8-6.582-3.8v7.6z",clipRule:"evenodd"}))},VC=function(e){var t=pe((0,oe.useState)("signin"),2),n=t[0],r=t[1],o=pe((0,oe.useState)(!1),2),i=o[0],a=o[1];return(0,oe.useEffect)(function(){i&&Al({showConfirmButton:!1,showDenyButton:!1,icon:!1,type:"warning",title:!1,showCloseButton:!0,customClass:{container:"templately-video-container",popup:"templately-video-popup",closeButton:"templately-video-close-button",htmlContainer:"templately-video-html"},html:ae().createElement("iframe",{width:"850",height:"480",src:"https://www.youtube.com/embed/ZhzHWqMD1Zk?autoplay=1&rel=0",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:!0})},!1).then(function(e){(null!=e&&e.isConfirmed||null!=e&&e.isDismissed)&&a(!1)})},[i]),ae().createElement("div",{className:"templately-container-row"},ae().createElement("div",{className:"templately-contents templately-frontpage"},ae().createElement("div",{className:"tf-content-box"},ae().createElement("div",{className:"tf-promo-title"},ae().createElement(WC,null),ae().createElement("h1",null,(0,At.__)("Ultimate Templates ","templately"),ae().createElement("b",null,(0,At.__)("Cloud for WordPress","templately"))),ae().createElement("p",null,(0,At.__)("Take Your Favourite Page Builders To A Whole New Level & Manage All Your Designs In One Place With Templately","templately")),ae().createElement("button",{onClick:function(){return a(!i)}},ae().createElement(UC,null),ae().createElement("span",null,"Play Video"))),ae().createElement("div",{className:"tf-user-form"},ae().createElement("div",{className:"tf-user-form-tab"},ae().createElement("ul",{className:"tf-uft-menu"},ae().createElement("li",{onClick:function(){return r("signin")},className:"signin"===n?"active":""},(0,At.__)("Sign In","templately")),ae().createElement("li",{onClick:function(){return r("signup")},className:"signup"===n?"active":""},(0,At.__)("Free Sign Up","templately"))),ae().createElement("div",{className:"tf-uft-content"},"signin"===n?ae().createElement(LC,{setTab:r}):ae().createElement(BC,{setTab:r})))))))},HC=gn(function(e){return{isLoggedIn:null!=e.profile.data,profileData:e.profile.data}})(function(e){var t,n,r;return null!=e&&e.isLoggedIn?null!=e&&e.isLoggedIn&&"free"!==(null==e||null===(t=e.profileData)||void 0===t?void 0:t.plan)?null:void 0===(null==e||null===(n=e.profileData)||void 0===n?void 0:n.show_notice)||null!=e&&null!==(r=e.profileData)&&void 0!==r&&r.show_notice?ae().createElement("div",{className:"templately-server-notice"},ae().createElement("p",null,"Hi there, you can now use ",ae().createElement("strong",null,"Templately")," in unlimited local sites & 2 live sites for Free! Manage your preferences"," ",ae().createElement("strong",null,ae().createElement("a",{target:"_blank",href:"https://templately.com/manage-sites"},"here"))," ","or"," ",ae().createElement("a",{target:"_blank",href:"https://docs.templately.com/home/how-to-manage-sites-in-templately/"},ae().createElement("strong",null,"learn more")),".")):null:null}),qC=function(e){var t,n,r=0===(null===(t=e.items)||void 0===t?void 0:t.length)||"empty"===e.items,o=Vn()("templately-items",{"templately-has-no-items":r});return ae().createElement(ae().Fragment,null,ae().createElement("div",{className:o},e.items&&Array.isArray(e.items)&&(null===(n=e.items)||void 0===n?void 0:n.length)>0?e.items.map(function(t){return ae().createElement(NS,{key:t.id,isLoggedIn:e.isLoggedIn,platform:e.platform,content:t})}):ae().createElement(s_,null)),e.totalPage>1&&ae().createElement(n_,re({type:e.type,total:e.totalPage},e.pagination)))};var QC=o(7918),$C=o.n(QC),GC=/[A-Z]/g,YC=/^ms-/,XC={};function KC(e){return"-"+e.toLowerCase()}const ZC=function(e){if(XC.hasOwnProperty(e))return XC[e];var t=e.replace(GC,KC);return XC[e]=YC.test(t)?"-"+t:t};const JC=IS().oneOfType([IS().string,IS().number]),eP={all:IS().bool,grid:IS().bool,aural:IS().bool,braille:IS().bool,handheld:IS().bool,print:IS().bool,projection:IS().bool,screen:IS().bool,tty:IS().bool,tv:IS().bool,embossed:IS().bool},tP={orientation:IS().oneOf(["portrait","landscape"]),scan:IS().oneOf(["progressive","interlace"]),aspectRatio:IS().string,deviceAspectRatio:IS().string,height:JC,deviceHeight:JC,width:JC,deviceWidth:JC,color:IS().bool,colorIndex:IS().bool,monochrome:IS().bool,resolution:JC,type:Object.keys(eP)},{type:nP,...rP}=tP,oP={minAspectRatio:IS().string,maxAspectRatio:IS().string,minDeviceAspectRatio:IS().string,maxDeviceAspectRatio:IS().string,minHeight:JC,maxHeight:JC,minDeviceHeight:JC,maxDeviceHeight:JC,minWidth:JC,maxWidth:JC,minDeviceWidth:JC,maxDeviceWidth:JC,minColor:IS().number,maxColor:IS().number,minColorIndex:IS().number,maxColorIndex:IS().number,minMonochrome:IS().number,maxMonochrome:IS().number,minResolution:JC,maxResolution:JC,...rP};var iP={all:{...eP,...oP},types:eP,matchers:tP,features:oP};const aP=(0,oe.createContext)(void 0),lP=e=>{if(e)return Object.keys(e).reduce((t,n)=>(t[ZC(n)]=e[n],t),{})},sP=()=>{const e=(0,oe.useRef)(!1);return(0,oe.useEffect)(()=>{e.current=!0},[]),e.current},cP=e=>{const t=()=>(e=>e.query||(e=>{const t=[];return Object.keys(iP.all).forEach(n=>{const r=e[n];null!=r&&t.push(((e,t)=>{const n=ZC(e);return"number"==typeof t&&(t=`${t}px`),!0===t?n:!1===t?`not ${n}`:`(${n}: ${t})`})(n,r))}),t.join(" and ")})(e))(e),[n,r]=(0,oe.useState)(t);return(0,oe.useEffect)(()=>{const e=t();n!==e&&r(e)},[e]),n},uP=(e,t,n)=>{const r=(e=>{const t=(0,oe.useContext)(aP),n=()=>lP(e)||lP(t),[r,o]=(0,oe.useState)(n);return(0,oe.useEffect)(()=>{const e=n();(function(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t),o=n.length;if(r.length!==o)return!1;for(let r=0;r<o;r++){const o=n[r];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0})(r,e)||o(e)},[e,t]),r})(t),o=cP(e);if(!o)throw new Error("Invalid or missing MediaQuery!");const i=((e,t)=>{const n=()=>$C()(e,t||{},!!t),[r,o]=(0,oe.useState)(n),i=sP();return(0,oe.useEffect)(()=>{if(i){const e=n();return o(e),()=>{e&&e.dispose()}}},[e,t]),r})(o,r),a=(e=>{const[t,n]=(0,oe.useState)(e.matches);return(0,oe.useEffect)(()=>{const t=e=>{n(e.matches)};return e.addListener(t),n(e.matches),()=>{e.removeListener(t)}},[e]),t})(i),l=sP();return(0,oe.useEffect)(()=>{l&&n&&n(a)},[a]),(0,oe.useEffect)(()=>()=>{i&&i.dispose()},[]),a},dP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"173",height:"21",fill:"none",viewBox:"0 0 173 21"},oe.createElement("g",{clipPath:"url(#paint0_angular_15309_5198_clip_path)","data-figma-skip-parse":"true"},oe.createElement("foreignObject",{width:"1274.23",height:"1274.23",x:"-637.117",y:"-637.117",transform:"matrix(.01356 -.02498 .04769 .0259 10.016 10.016)"},oe.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",opacity:"1",style:{background:"conic-gradient(from 90deg,#62c2fc 0deg,#f2d7bc 57.4692deg,#f4e0c4 153.531deg,#5935d0 218.669deg,#5cc1ff 357.335deg,#62c2fc 360deg)",height:"100%",width:"100%"}}))),oe.createElement("path",{d:"M0 10.016c0-.503.409-.906.91-.956A9.11 9.11 0 0 0 9.06.91c.05-.501.453-.91.956-.91s.906.409.955.91a9.11 9.11 0 0 0 8.151 8.15c.5.05.91.453.91.956s-.41.906-.91.955a9.11 9.11 0 0 0-8.15 8.151c-.05.5-.453.91-.956.91s-.906-.41-.956-.91a9.11 9.11 0 0 0-8.15-8.15c-.501-.05-.91-.453-.91-.956","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"stopsVar":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"transform":{"m00":27.126356124877930,"m01":95.376968383789062,"m02":-51.235877990722656,"m10":-49.955394744873047,"m11":51.790794372558594,"m12":9.0981588363647461},"opacity":1.0,"blendMode":"NORMAL","visible":true}'}),oe.createElement("path",{fill:"url(#paint1_linear_15309_5198)",d:"M24.668 5.646V3.88h9.284v1.767h-3.597v9.87h-2.09v-9.87zm13.58 10.04q-1.311 0-2.267-.545a3.7 3.7 0 0 1-1.46-1.557q-.51-1.012-.511-2.38 0-1.348.511-2.365a3.87 3.87 0 0 1 1.444-1.59q.925-.574 2.176-.574.807 0 1.522.261.722.255 1.273.796.557.54.875 1.375.318.83.318 1.977v.63h-7.153v-1.386h5.182a2.2 2.2 0 0 0-.256-1.051q-.25-.466-.699-.733a1.96 1.96 0 0 0-1.034-.267q-.63 0-1.108.307-.477.3-.744.795a2.3 2.3 0 0 0-.267 1.074v1.21q0 .762.278 1.307.279.54.778.83.5.284 1.171.284.45 0 .813-.125.363-.13.63-.38.267-.252.404-.62l1.92.216q-.181.76-.693 1.33a3.4 3.4 0 0 1-1.296.874q-.789.307-1.806.307m5.621-.17V6.788h1.966v1.483h.102q.273-.75.904-1.17.63-.426 1.506-.426.886 0 1.494.432.613.426.864 1.164h.09q.291-.727.978-1.159.694-.437 1.642-.437 1.204 0 1.966.761.76.761.761 2.222v5.858H54.08v-5.54q0-.813-.432-1.188a1.54 1.54 0 0 0-1.057-.38q-.744 0-1.165.466-.415.46-.415 1.198v5.444h-2.017V9.89q0-.676-.409-1.08-.403-.403-1.057-.403-.443 0-.806.227a1.6 1.6 0 0 0-.58.63 2 2 0 0 0-.216.944v5.307zm14.36 3.272v-12h2.022v1.444h.12q.159-.319.449-.677.29-.363.784-.619.495-.261 1.261-.261 1.011 0 1.824.517.818.51 1.295 1.517.483 1 .483 2.454 0 1.438-.471 2.444-.472 1.005-1.284 1.534a3.3 3.3 0 0 1-1.841.528q-.75 0-1.245-.25a2.5 2.5 0 0 1-.795-.602 4 4 0 0 1-.46-.676h-.086v4.647zm2.017-7.636q0 .846.238 1.483.244.636.7.994.459.353 1.113.353.681 0 1.142-.364.46-.37.693-1.006.24-.642.239-1.46a4.2 4.2 0 0 0-.233-1.443q-.234-.63-.693-.989-.46-.357-1.148-.358-.66 0-1.12.347-.46.346-.698.971-.233.626-.233 1.472m10.04-7.273v11.637h-2.057V3.879zm4.626 11.813a3.6 3.6 0 0 1-1.494-.296q-.66-.3-1.046-.886-.38-.585-.38-1.443 0-.74.272-1.222.273-.483.745-.773a3.8 3.8 0 0 1 1.062-.437 9 9 0 0 1 1.233-.222q.767-.08 1.244-.142.478-.067.694-.204.22-.142.221-.438v-.034q0-.643-.38-.994-.381-.352-1.097-.352-.756 0-1.2.33-.436.328-.59.778l-1.92-.273q.226-.795.75-1.33.522-.54 1.278-.807a4.9 4.9 0 0 1 1.67-.272q.631 0 1.256.147.625.148 1.142.49.517.334.83.914.318.58.318 1.449v5.84h-1.977v-1.198h-.069a2.5 2.5 0 0 1-.528.682 2.5 2.5 0 0 1-.847.505q-.506.188-1.187.188m.534-1.512q.619 0 1.074-.244.454-.25.699-.659.25-.41.25-.892v-1.028a1 1 0 0 1-.33.147 5 5 0 0 1-.511.12q-.284.051-.563.09l-.483.069q-.46.062-.823.204a1.37 1.37 0 0 0-.574.398q-.21.25-.21.648 0 .568.414.858.415.29 1.057.29m10.5-7.392V8.38h-5.017V6.79zm-3.778-2.09h2.056v8.193q0 .414.125.636.131.216.341.295.21.08.466.08.193 0 .352-.028.166-.029.25-.052l.347 1.608a5 5 0 0 1-.472.125 4 4 0 0 1-.738.08 3.35 3.35 0 0 1-1.392-.233 2.17 2.17 0 0 1-.983-.807q-.358-.546-.352-1.364zm9.268 10.988q-1.312 0-2.267-.545a3.7 3.7 0 0 1-1.46-1.557q-.512-1.012-.512-2.38 0-1.348.512-2.365a3.87 3.87 0 0 1 1.443-1.59q.926-.574 2.176-.574.807 0 1.523.261.72.255 1.273.796.556.54.875 1.375.318.83.318 1.977v.63h-7.154v-1.386h5.182a2.2 2.2 0 0 0-.255-1.051q-.25-.466-.7-.733a1.96 1.96 0 0 0-1.034-.267q-.63 0-1.107.307-.478.3-.745.795a2.3 2.3 0 0 0-.267 1.074v1.21q0 .762.279 1.307.278.54.778.83.5.284 1.17.284.45 0 .813-.125.364-.13.63-.38.268-.252.404-.62l1.92.216q-.18.76-.693 1.33a3.4 3.4 0 0 1-1.295.874q-.79.307-1.807.307M99.114 3.88v11.637h-2.057V3.879zm3.393 14.91q-.42 0-.778-.069a3 3 0 0 1-.563-.148l.477-1.602q.45.13.802.125a1 1 0 0 0 .619-.221q.273-.21.46-.705l.176-.472-3.164-8.909h2.181l2.012 6.591h.091l2.017-6.59h2.187l-3.494 9.783a3.9 3.9 0 0 1-.648 1.188 2.6 2.6 0 0 1-.989.761q-.579.267-1.386.267m8.432-3.273h-2.25l4.097-11.637h2.602l4.102 11.637h-2.25l-3.108-9.25h-.091zm.074-4.563h6.136v1.693h-6.136zm12.118-7.074v11.637h-2.108V3.879z"}),oe.createElement("rect",{width:"43",height:"20",x:"129.031",y:"0.016",fill:"#EFE8FF",rx:"10"}),oe.createElement("path",{fill:"#70628D",d:"M137.99 14.016V5.288h3.196q.929 0 1.538.307.61.303.912.823.303.515.303 1.163 0 .545-.2.92a1.66 1.66 0 0 1-.537.597 2.4 2.4 0 0 1-.733.324v.085q.434.021.848.281.417.256.69.729t.273 1.15q0 .67-.316 1.202-.31.529-.963.84-.651.306-1.666.307zm1.317-1.13h1.9q.947 0 1.355-.366.41-.366.41-.916 0-.414-.209-.759a1.5 1.5 0 0 0-.597-.55 1.9 1.9 0 0 0-.912-.204h-1.947zm0-3.822h1.764q.443 0 .797-.17.358-.17.567-.478.213-.311.213-.733 0-.54-.38-.907-.378-.367-1.163-.367h-1.798zm9.253 5.084q-.967 0-1.666-.414a2.8 2.8 0 0 1-1.074-1.171q-.375-.76-.375-1.777 0-1.006.375-1.773.38-.767 1.057-1.198.682-.43 1.594-.43.553 0 1.074.183.519.183.933.575.414.393.652 1.019.239.622.239 1.513v.451h-5.204v-.954h3.955q0-.503-.205-.89a1.55 1.55 0 0 0-.575-.619 1.6 1.6 0 0 0-.861-.226q-.537 0-.937.265-.396.26-.614.682a2 2 0 0 0-.213.907v.746q0 .656.23 1.116.235.46.652.704.418.238.976.238.363 0 .661-.102.298-.107.515-.315.218-.21.333-.516l1.206.217q-.145.533-.52.934-.37.396-.933.617a3.5 3.5 0 0 1-1.275.218m7.278-6.678v1.023h-3.576V7.47zm-2.617-1.568h1.274v6.192q0 .37.111.558a.58.58 0 0 0 .286.251q.178.064.387.064.154 0 .269-.021l.179-.034.23 1.052a2.504 2.504 0 0 1-.827.136 2.24 2.24 0 0 1-.937-.178 1.6 1.6 0 0 1-.703-.58q-.269-.392-.269-.984zm5.931 8.259q-.622 0-1.125-.23a1.9 1.9 0 0 1-.797-.678q-.29-.444-.29-1.087 0-.554.213-.912a1.57 1.57 0 0 1 .576-.566q.362-.21.809-.316.449-.106.912-.162l.955-.11q.366-.048.533-.15.166-.102.166-.332v-.03q0-.558-.316-.865-.31-.307-.929-.307-.643 0-1.014.286a1.53 1.53 0 0 0-.507.626l-1.197-.273a2.3 2.3 0 0 1 .622-.963q.413-.37.95-.537.537-.17 1.129-.17.393 0 .831.094.443.09.827.332.388.243.635.695.247.447.247 1.163v4.347h-1.244v-.895h-.051a1.8 1.8 0 0 1-.371.486q-.248.238-.635.396a2.5 2.5 0 0 1-.929.158m.277-1.023q.528 0 .903-.209.38-.21.576-.546.2-.34.2-.728v-.844a.7.7 0 0 1-.264.128q-.192.056-.439.098-.247.038-.482.072-.234.03-.392.052a3 3 0 0 0-.677.157 1.16 1.16 0 0 0-.486.32q-.179.204-.179.545 0 .473.349.716.35.24.891.239"}),oe.createElement("defs",null,oe.createElement("linearGradient",{id:"paint1_linear_15309_5198",x1:"24.031",x2:"125.031",y1:"0.516",y2:"0.516",gradientUnits:"userSpaceOnUse"},oe.createElement("stop",{stopColor:"#7F56D9"}),oe.createElement("stop",{offset:"1",stopColor:"#9E77ED"})),oe.createElement("clipPath",{id:"paint0_angular_15309_5198_clip_path"},oe.createElement("path",{d:"M0 10.016c0-.503.409-.906.91-.956A9.11 9.11 0 0 0 9.06.91c.05-.501.453-.91.956-.91s.906.409.955.91a9.11 9.11 0 0 0 8.151 8.15c.5.05.91.453.91.956s-.41.906-.91.955a9.11 9.11 0 0 0-8.15 8.151c-.05.5-.453.91-.956.91s-.906-.41-.956-.91a9.11 9.11 0 0 0-8.15-8.15c-.501-.05-.91-.453-.91-.956"}))))},pP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"61",height:"66",fill:"none",viewBox:"0 0 61 66"},oe.createElement("path",{fill:"url(#paint0_linear_13916_7701)",d:"M-.004 35.057c0-1.257 1.022-2.264 2.273-2.388 10.757-1.067 19.312-9.621 20.378-20.378.124-1.251 1.131-2.273 2.389-2.273s2.264 1.022 2.388 2.273c1.066 10.757 9.621 19.311 20.378 20.378 1.25.124 2.273 1.131 2.273 2.388s-1.022 2.265-2.273 2.389c-10.757 1.066-19.312 9.62-20.378 20.378-.124 1.25-1.131 2.273-2.388 2.273-1.258 0-2.265-1.022-2.389-2.273-1.066-10.757-9.62-19.312-20.378-20.378-1.25-.124-2.273-1.132-2.273-2.389"}),oe.createElement("path",{fill:"#F6EDFF",d:"M45.066 7.512c0-.377.307-.68.682-.717A6.83 6.83 0 0 0 51.862.682c.037-.375.34-.682.716-.682.377 0 .68.307.717.682a6.83 6.83 0 0 0 6.113 6.113c.375.038.682.34.682.717s-.307.68-.682.716a6.83 6.83 0 0 0-6.113 6.114c-.037.375-.34.682-.717.682s-.68-.307-.716-.682a6.83 6.83 0 0 0-6.114-6.114c-.375-.037-.682-.339-.682-.716M40.066 60.098c0-.503.41-.906.91-.956a9.11 9.11 0 0 0 8.15-8.15c.05-.501.453-.91.956-.91s.906.409.956.91a9.11 9.11 0 0 0 8.15 8.15c.501.05.91.453.91.956s-.409.906-.91.955a9.11 9.11 0 0 0-8.15 8.151c-.05.5-.453.91-.956.91s-.906-.41-.955-.91a9.11 9.11 0 0 0-8.151-8.15c-.5-.05-.91-.453-.91-.956"}),oe.createElement("defs",null,oe.createElement("linearGradient",{id:"paint0_linear_13916_7701",x1:"25.036",x2:"25.036",y1:"10.018",y2:"60.097",gradientUnits:"userSpaceOnUse"},oe.createElement("stop",{stopColor:"#FAF4FF"}),oe.createElement("stop",{offset:"1",stopColor:"#F4E8FF"}))))};var hP=["fill"];const fP=function(e){var t=e.fill,n=void 0===t?"#949DA8":t;return Wn(e,hP),oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"12",fill:"none",viewBox:"0 0 11 12"},oe.createElement("g",{fill:n,clipPath:"url(#clip0_13907_5910)"},oe.createElement("path",{d:"M.806 11.333a.521.521 0 0 1-.368-.89L10.063.82a.52.52 0 1 1 .736.736L1.174 11.18a.52.52 0 0 1-.368.153"}),oe.createElement("path",{d:"M10.431 11.333a.52.52 0 0 1-.368-.153L.438 1.555A.52.52 0 1 1 1.174.82l9.625 9.625a.52.52 0 0 1-.368.889"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_13907_5910"},oe.createElement("path",{fill:"#fff",d:"M.285.666h10.667v10.667H.285z"}))))},mP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",fill:"none",viewBox:"0 0 18 19"},oe.createElement("mask",{id:"mask0_13916_779",width:"19",height:"19",x:"-1",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},oe.createElement("path",{fill:"#D9D9D9",d:"M-.004.016h18v18h-18z"})),oe.createElement("g",{mask:"url(#mask0_13916_779)"},oe.createElement("path",{fill:"#949DA8",d:"M8.996 12.766q.319 0 .534-.216a.73.73 0 0 0 .216-.534.73.73 0 0 0-.216-.535.73.73 0 0 0-.534-.215.73.73 0 0 0-.534.215.73.73 0 0 0-.216.535q0 .318.216.534a.73.73 0 0 0 .534.216m0-3q.319 0 .534-.216a.73.73 0 0 0 .216-.534v-3a.73.73 0 0 0-.216-.535.73.73 0 0 0-.534-.215.73.73 0 0 0-.534.215.73.73 0 0 0-.216.535v3q0 .318.216.534a.73.73 0 0 0 .534.216m0 6.75a7.3 7.3 0 0 1-2.925-.591 7.6 7.6 0 0 1-2.381-1.603 7.6 7.6 0 0 1-1.603-2.381 7.3 7.3 0 0 1-.59-2.925q0-1.557.59-2.925A7.6 7.6 0 0 1 3.69 3.709 7.6 7.6 0 0 1 6.07 2.106a7.3 7.3 0 0 1 2.925-.59q1.557 0 2.925.59a7.6 7.6 0 0 1 2.381 1.603 7.6 7.6 0 0 1 1.604 2.382q.59 1.368.59 2.925a7.3 7.3 0 0 1-.59 2.925 7.6 7.6 0 0 1-1.604 2.38 7.6 7.6 0 0 1-2.38 1.604 7.3 7.3 0 0 1-2.926.59m0-1.5q2.513 0 4.256-1.744t1.744-4.256-1.744-4.257Q11.51 3.016 8.996 3.016q-2.513 0-4.256 1.743-1.744 1.745-1.744 4.257t1.744 4.256q1.743 1.743 4.256 1.744"})))},gP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"92",height:"72",fill:"none",viewBox:"0 0 92 72"},oe.createElement("path",{stroke:"#C3CBD5",strokeLinecap:"round",d:"M1.433 61.41c8.094 8.58 12.48 13.001 21.885 5.545 4.71-3.736 5.573-7.252 3.193-12.157-1.582-3.261-6.133-.148-4.51 3.198 2.12 4.366 5.928 7.779 10.849 8.824C44.342 69.26 54.61 55.17 57.71 46.226c1.232-3.553-1.376-10.59-4.721-5.566-2.362 3.548 2.399 8.26 5.49 9.234 14.007 4.412 20.822-11.01 24.397-21.322 1.2-3.464 3.204-11.054 2.59-14.558-.498-2.84 8.892 2.774 3.768.248-2.965-1.462-8.287-3.1-11.607-1.945-1.602.557 5.901-5.42 6.899-6.602C86.2 3.73 89.888-1.228 89.76 2.39c-.106 2.994.03 7.93 1.275 10.494"}))},vP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",viewBox:"0 0 28 28"},oe.createElement("mask",{id:"mask0_2_32",width:"28",height:"28",x:"0",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},oe.createElement("path",{fill:"#D9D9D9",d:"M27.328.698v26.667H.661V.698z"})),oe.createElement("g",{mask:"url(#mask0_2_32)"},oe.createElement("path",{fill:"#fff",d:"M17.55 12.922 14.33 9.699a1.05 1.05 0 0 1-.306-.777q0-.472.306-.778.305-.306.777-.306t.778.306l5.111 5.111q.334.333.334.778 0 .444-.334.778l-5.11 5.11a1.05 1.05 0 0 1-.779.306q-.472 0-.777-.305a1.05 1.05 0 0 1-.306-.778q0-.472.306-.778l3.222-3.222H8.44q-.473 0-.792-.32a1.08 1.08 0 0 1-.32-.791q0-.473.32-.792t.792-.32z"})))},yP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",viewBox:"0 0 28 28"},oe.createElement("mask",{id:"mask0_4_47",width:"28",height:"28",x:"0",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},oe.createElement("path",{fill:"#D9D9D9",d:"M.664.668h26.667v26.667H.664z"})),oe.createElement("g",{mask:"url(#mask0_4_47)"},oe.createElement("path",{fill:"#fff",d:"m12.888 10.446-3.222 3.222a1.05 1.05 0 0 1-.778.306q-.472 0-.778-.306a1.05 1.05 0 0 1-.305-.778q0-.472.305-.778l5.111-5.11q.334-.334.778-.334t.778.333l5.111 5.111q.306.306.306.778t-.306.778a1.05 1.05 0 0 1-.778.306q-.473 0-.777-.306l-3.223-3.222v9.11q0 .474-.32.793-.319.318-.79.319-.474 0-.793-.32a1.08 1.08 0 0 1-.319-.791z"})))},bP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"17",fill:"none",viewBox:"0 0 17 17"},oe.createElement("mask",{id:"mask0_4_54",width:"17",height:"17",x:"0",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},oe.createElement("path",{fill:"#D9D9D9",d:"M.776.357h16v16h-16z"})),oe.createElement("g",{mask:"url(#mask0_4_54)"},oe.createElement("path",{fill:"#737A85",d:"M3.56 14.358a.61.61 0 0 1-.609-.175.61.61 0 0 1-.175-.609l.667-3.183 3.3 3.3zm3.183-.667-3.3-3.3 7.633-7.633a1.3 1.3 0 0 1 .95-.384q.567 0 .95.384l1.4 1.4q.384.383.383.95 0 .566-.383.95zm5.283-10-6.9 6.9 1.417 1.417 6.9-6.9z"})))},wP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 20 21"},oe.createElement("g",{stroke:"#949DA8",strokeWidth:"1.5",clipPath:"url(#clip0_14513_3614)"},oe.createElement("path",{strokeLinecap:"round",d:"M18.334 9.825v.207c0 3.928 0 5.893-1.22 7.113-1.221 1.22-3.185 1.22-7.114 1.22s-5.892 0-7.113-1.22c-1.22-1.22-1.22-3.184-1.22-7.113 0-3.928 0-5.892 1.22-7.113C4.107 1.7 4.822 1.697 8.75 1.697H10"}),oe.createElement("path",{d:"m13.877 2.91.54-.54a2.294 2.294 0 0 1 3.245 3.243l-.54.54M13.876 2.91s.068 1.149 1.081 2.163c1.014 1.013 2.163 1.08 2.163 1.08M13.877 2.91l-4.97 4.97c-.337.337-.506.506-.65.691q-.258.33-.437.707c-.101.212-.177.438-.327.89l-.482 1.446m10.11-5.46-4.97 4.97c-.337.337-.506.506-.691.65q-.33.258-.707.437c-.212.101-.438.177-.89.327l-1.446.482m0 0-.936.312a.619.619 0 0 1-.782-.782l.312-.936m1.406 1.406-1.406-1.406"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_14513_3614"},oe.createElement("path",{fill:"#fff",d:"M0 .031h20v20H0z"}))))},kP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"33",fill:"none",viewBox:"0 0 32 33"},oe.createElement("g",{clipPath:"url(#paint0_angular_13916_1349_clip_path)","data-figma-skip-parse":"true"},oe.createElement("foreignObject",{width:"974.416",height:"974.416",x:"-487.208",y:"-487.208",transform:"matrix(.02167 -.0399 .09682 .05258 16 16.031)"},oe.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",opacity:"1",style:{background:"conic-gradient(from 90deg,#62c2fc 0deg,#f2d7bc 57.4692deg,#f4e0c4 153.531deg,#5935d0 218.669deg,#5cc1ff 357.335deg,#62c2fc 360deg)",height:"100%",width:"100%"}}))),oe.createElement("rect",{width:"32",height:"32",y:"0.031","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"stopsVar":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"transform":{"m00":43.333770751953125,"m01":193.64140319824219,"m02":-102.48758697509766,"m10":-79.802070617675781,"m11":105.15031433105469,"m12":3.3571283817291260},"opacity":1.0,"blendMode":"NORMAL","visible":true}',rx:"16"}),oe.createElement("path",{fill:"#fff",d:"M9.355 26.272a2.276 2.276 0 1 0 0-4.551 2.276 2.276 0 0 0 0 4.55M16.016 26.272a2.276 2.276 0 1 0 0-4.551 2.276 2.276 0 0 0 0 4.55M22.636 26.27a2.276 2.276 0 1 0 0-4.551 2.276 2.276 0 0 0 0 4.55M20.03 9.597h-.373a4.88 4.88 0 0 0-4.758-3.806c-.62 0-1.2.124-1.738.331v1.614h2.358v2.317h-2.358v3.93h2.441c-.083.165-.165.414-.207.538-.455 1.076-1.53 1.655-2.69 1.448-1.075-.207-1.86-1.117-1.944-2.276v-3.682h-.827c-1.655.786-2.855 2.483-2.855 4.427a4.89 4.89 0 0 0 4.882 4.882h8.11c2.689-.041 4.84-2.193 4.84-4.882 0-2.648-2.193-4.84-4.882-4.84"}),oe.createElement("defs",null,oe.createElement("clipPath",{id:"paint0_angular_13916_1349_clip_path"},oe.createElement("rect",{width:"32",height:"32",y:"0.031",rx:"16"}))))};function EP(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 OP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EP(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xP=["Hospital","Medical Clinic","Dental Clinic","Psychology Practice","Health & Wellness","Spa & Wellness Center","Home Healthcare Services","Mental Health Counseling","Fitness Center","Yoga Studio","Personal Coach","Beauty Salon","Barber Shop","Skincare & Beauty Products","Restaurant","Coffee Shop","Bakery","Catering Service","Food Delivery","Hotel & Resort","Travel Agency","Tourism Platform","Organic Food Shop","Grocery Store","Hotel Booking Platform","Flight Booking Service","Real Estate Agency","Architecture Firm","Construction Company","Interior Design","Plumbing Service","Electrical Service","Landscaping","Cleaning Service","Home Decor Store","Furniture Store","Automobile Repair Shop","Car Dealership","Car Wash","Car Rental Service","Bike Rental","IT Service Provider","Software Development","Web Design Agency","Digital Marketing Agency","SEO Agency","Social Media Management","Advertising Agency","Printing & Branding Agency","Email Marketing Service","Influencer Agency","AI Tools & Automation","AI Startup","NFT Marketplace","Crypto Exchange","Gaming Studio","Streaming Platform","Marketplace Platform","E-commerce Store","Education Center","Online Course Platform","Driving School","Music School","Education Consulting","Photography","Photography Studio","Photography Business","Videography Service","Video Editing Agency","Cinematography Studio","Film Production House","Animation Studio","Post-Production Studio","Recording Studio","Music Production Company","Music Video Production","DJ Service","Dance Academy","Solo Musician","Podcast Recording Studio","Art Gallery","Publishing House","News & Media Agency","Online Magazine","Event Management","Wedding Planner","Music Event Organizer","Live Concert Organizer","Music Festival Organizer","Drone Photography","Law Firm","Accounting Firm","Tax Service","Insurance Agency","Finance & Investment Firm","Consulting Firm","Recruitment Agency","Human Resources Consulting","Recruiting Platform","Job Board","Courier Service","Logistics Company","Coworking Space","Laundry Service","Childcare Center","Senior Care Home","Clothing Brand","Fashion Boutique","Jewelry Store","Shoe Store","Pet Shop","Bookstore","Non-Profit Organization","Charity Foundation","NGO","Freelancer Portfolio","Travel Blogger"],SP=function(e){try{if(!e||"string"!=typeof e)return{isValid:!1,errorMessage:(0,At.__)("Email is required","templately")};var t=e.trim();if(!t)return{isValid:!1,errorMessage:(0,At.__)("Email is required","templately")};if(!/^(?!\.)("[^"\r\\]*(\\.[^"\r\\]*)*"|[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*)@(?!-)[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/.test(t))return{isValid:!1,errorMessage:(0,At.__)("Please enter a valid email address","templately")};if(t.length>254)return{isValid:!1,errorMessage:(0,At.__)("Email address is too long","templately")};var n=t.split("@");if(2!==n.length)return{isValid:!1,errorMessage:(0,At.__)("Please enter a valid email address","templately")};var r=pe(n,2),o=r[0],i=r[1];return o.length>64?{isValid:!1,errorMessage:(0,At.__)("Email address is too long","templately")}:i.length<1||i.length>253||t.includes("..")?{isValid:!1,errorMessage:(0,At.__)("Please enter a valid email address","templately")}:{isValid:!0,errorMessage:""}}catch(e){return console.error("Error in validateEmail:",e),{isValid:!1,errorMessage:(0,At.__)("Please enter a valid email address","templately")}}},_P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;try{if(!e||"string"!=typeof e)return{isValid:!0,errorMessage:""};var n=e.trim();if(!n)return{isValid:!0,errorMessage:""};var r=n.split(/\s+/).filter(function(e){return e.length>0}).length;return r>t?{isValid:!1,errorMessage:(0,At.__)("Maximum ".concat(t," words allowed. You have ").concat(r," words."),"templately")}:{isValid:!0,errorMessage:""}}catch(e){return console.error("Error in validateWordCount:",e),{isValid:!1,errorMessage:(0,At.__)("Maximum ".concat(t," words allowed"),"templately")}}},CP=function(e){try{if(!e||"string"!=typeof e)return{isValid:!1,errorMessage:(0,At.__)("Phone number is required","templately")};var t=e.trim();if(!t)return{isValid:!1,errorMessage:(0,At.__)("Phone number is required","templately")};var n=t.replace(/[^\d+]/g,"");if(!/^[\d\s\-\(\)\.\+]+$/.test(t))return{isValid:!1,errorMessage:(0,At.__)("Contains invalid characters","templately")};var r=n.replace(/\+/g,"");if(r.length<4)return{isValid:!1,errorMessage:(0,At.__)("Phone number is too short","templately")};if(r.length>15)return{isValid:!1,errorMessage:(0,At.__)("Phone number is too long","templately")};var o=(t.match(/\+/g)||[]).length;if(o>1)return{isValid:!1,errorMessage:(0,At.__)("Only one + allowed","templately")};if(1===o&&!t.startsWith("+"))return{isValid:!1,errorMessage:(0,At.__)("+ must be at the beginning","templately")};if(t.startsWith("+")){if(r.length<5)return{isValid:!1,errorMessage:(0,At.__)("Phone number is too short","templately")};var i=r.match(/^(\d{1,3})/);if(i){var a=parseInt(i[1]);if(a<1||a>999)return{isValid:!1,errorMessage:(0,At.__)("Invalid country code","templately")}}}return/[\s\-\(\)\.]{4,}/.test(t)?{isValid:!1,errorMessage:(0,At.__)("Invalid phone number format","templately")}:(t.match(/\(/g)||[]).length!==(t.match(/\)/g)||[]).length?{isValid:!1,errorMessage:(0,At.__)("Unmatched parentheses","templately")}:[/^\+\d{4,15}$/,/^\+\d{1,3}\s\d{1,4}(\s\d{1,4})*$/,/^\+\d{1,3}-\d{1,4}(-\d{1,4})*$/,/^\+\d{1,3}\s?\(\d{1,4}\)\s?\d{1,4}(-\d{1,4})*$/,/^\d{4,15}$/,/^\(\d{1,4}\)\s?\d{1,4}(-\d{1,4})*$/,/^\d{1,4}(\.\d{1,4})+$/,/^\d{1,4}(\s\d{1,4})+$/,/^\d{1,4}(-\d{1,4})+$/].some(function(e){return e.test(n.replace(/\s/g," "))})?/^(\+?0+|(\+?\d)\1{6,})$/.test(n)?{isValid:!1,errorMessage:(0,At.__)("Invalid phone number pattern","templately")}:{isValid:!0,errorMessage:""}:{isValid:!1,errorMessage:(0,At.__)("Invalid phone number format","templately")}}catch(e){return console.error("Error in validatePhoneNumber:",e),{isValid:!1,errorMessage:(0,At.__)("Enter a valid number","templately")}}},PP=null,TP=null,AP=null,MP=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return TP===e&&AP===t&&PP?PP:(TP=e,AP=t,PP=[{key:"start",question:"<p>".concat((0,At.__)("Hi","templately")," ").concat(e||(0,At.__)("there","templately"),"! 👋 ").concat((0,At.__)("Ready to build your website?","templately"),"</p>"),answer:(0,At.__)("Yes, let’s start!","templately"),result:null,skip:!1,done:!1,editable:!1,tooltip:null},{key:"name",question:"<p>".concat((0,At.__)("Great! What’s your business name?","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share the name of your business only.","templately"),"<br/>").concat((0,At.__)("Note","templately"),": ").concat((0,At.__)("If your business name is ‘BizRise’, share the name only.","templately")," ").concat((0,At.__)("For example","templately"),": ‘BizRise’")},{key:"category",question:"<p>".concat((0,At.__)("Love that!","templately")," 💡 ").concat((0,At.__)("What type of business or industry are you in?","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share your business type. You can either select from the available categories in the dropdown or write down any specific type.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("Agency, Restaurant, Technology","templately"))},{key:"description",question:"<p>".concat((0,At.__)("Sounds great! Tell me more about your business — what you do, who you serve, and what makes you special. Please write at least 50 words.","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share your business details with us.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("It’s an agency website that offers education consultancy to students who want to study abroad.","templately"))},{key:"email",question:"<p>".concat((0,At.__)("Thank you! What’s the email address you’d like to show on your website?","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share the email address that you want to show on your website.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("xyz@gmail.com","templately"))},{key:"contactNumber",question:"<p>".concat((0,At.__)("Do you also want to add a contact number? If yes, please share it.","templately"),"</p>"),answer:null,result:null,skip:!0,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share the contact number you want to add.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("+02860630","templately"))},{key:"businessAddress",question:"<p>".concat((0,At.__)("Nice! What’s your business address?","templately"),"</p>"),answer:null,result:null,skip:!0,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share your business address you want to show.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("123 Business Lane, Suite 456 Downtown District, New York, NY 10001 United States","templately"))},{key:"openingHour",question:"<p>".concat((0,At.__)("Awesome","templately")," 👌 ").concat((0,At.__)("Do you have any opening hours you want to display?","templately"),"</p>"),answer:null,result:null,skip:!0,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share your opening hours.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("We stay open from 08:00 AM to 06:00 PM (GMT+6)","templately"))},{key:"imageReplace",question:"<p>".concat((0,At.__)("Thank you! Do you want to replace the default images with new ones?","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!1,tooltip:"".concat((0,At.__)("To replace default images, select an image from the left column, then upload your own or choose one from the image library on the right.","templately"))},{key:"finalize",question:"<p>".concat((0,At.__)("Thank you! That’s all we need for now. Should we go ahead and generate your website content?","templately")," 🚀</p>"),answer:(0,At.__)("Yes, Generate and Proceed.","templately"),result:null,skip:!1,done:!1,editable:!1,tooltip:null}])},NP=function(){try{var e;return null===(e=window.templately)||void 0===e?void 0:e.ai_animate_ignore_mode}catch(e){return!1}};"undefined"!=typeof window&&(window.shouldBypassAnimations=NP);var DP=ae().memo(function(e){var t=e.currentStep,n=e.isCatchFetching,r=e.conversation,o=e.onTypingComplete,i=e.intervalRefs,a=pe((0,oe.useState)(""),2),l=a[0],s=a[1];(0,oe.useEffect)(function(){null!=t&&t.isTyping&&(null==t?void 0:t.key)===(null==r?void 0:r.key)||s("")},[null==t?void 0:t.isTyping,null==t?void 0:t.key,null==r?void 0:r.key]);var c=(0,oe.useCallback)(function(e){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;try{if(!e||"string"!=typeof e)return console.warn("startTypingEffect: Invalid content provided:",e),null==n||n(""),void(null==r||r());if(!n||"function"!=typeof n)return void console.warn("startTypingEffect: Invalid setTypingContent function provided");var i=function(e){try{if(!e)return"";var t=document.createElement("div");t.innerHTML=e,t.textContent||t.innerText;var n=e.replace(/<br\s*\/?>/gi,"\n");return t.innerHTML=n,(t.textContent||t.innerText||"").trim()}catch(t){return console.error("Error in stripHtmlTags:",t),e}}(e);if(!i.trim())return console.warn("startTypingEffect: No content after HTML stripping"),null==n||n(""),void(null==r||r());if(NP())return n(i),void("function"==typeof r&&r());var a=Math.max(10,Math.min(1e3,Number(t)||30)),l=Array.from(i);n("");var s=0,c=setInterval(function(){try{s<l.length?(n(function(e){return e+l[s]}),s+=1):(clearInterval(c),null!=o&&o.current&&Array.isArray(o.current)&&(o.current=o.current.filter(function(e){return e!==c})),"function"==typeof r&&r())}catch(e){console.error("Error in typing interval:",e),clearInterval(c),null!=o&&o.current&&Array.isArray(o.current)&&(o.current=o.current.filter(function(e){return e!==c})),"function"==typeof r&&r()}},a);null!=o&&o.current&&Array.isArray(o.current)&&o.current.push(c)}catch(e){console.error("Error in startTypingEffect:",e),null==n||n(""),"function"==typeof r&&r()}}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,s,o,i)},[i,o]),u=(0,oe.useMemo)(function(){try{return l?l.split("\n"):[]}catch(e){return console.error("Error splitting typing content:",e),[]}},[l]);if((0,oe.useEffect)(function(){null!=t&&t.isTyping&&null!=t&&t.key&&null!=r&&r.question&&(NP()?(s(r.question),o&&o()):c(r.question))},[null==t?void 0:t.isTyping,null==t?void 0:t.key,null==r?void 0:r.question,c,o]),(0,oe.useEffect)(function(){return function(){s("")}},[]),null!=t&&t.isThinking||n)return ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-thinking-wrapper"},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-thinking"}));if(null!=t&&t.isTyping)return ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text"},ae().createElement("div",{style:{minHeight:"1.6em"}},u.map(function(e,t){return ae().createElement(ae().Fragment,{key:t},e,t<u.length-1&&ae().createElement("br",null))}),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-text-cursor"},"|")));try{var d;return ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text",dangerouslySetInnerHTML:{__html:null!==(d=null==r?void 0:r.question)&&void 0!==d?d:""}})}catch(e){var p;return console.error("Error rendering conversation content:",e),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text"},null!==(p=null==r?void 0:r.question)&&void 0!==p?p:"")}},function(e,t){var n,r,o,i,a,l,s,c,u,d;return(null===(n=e.currentStep)||void 0===n?void 0:n.isThinking)===(null===(r=t.currentStep)||void 0===r?void 0:r.isThinking)&&(null===(o=e.currentStep)||void 0===o?void 0:o.isTyping)===(null===(i=t.currentStep)||void 0===i?void 0:i.isTyping)&&(null===(a=e.currentStep)||void 0===a?void 0:a.key)===(null===(l=t.currentStep)||void 0===l?void 0:l.key)&&e.isCatchFetching===t.isCatchFetching&&(null===(s=e.conversation)||void 0===s?void 0:s.key)===(null===(c=t.conversation)||void 0===c?void 0:c.key)&&(null===(u=e.conversation)||void 0===u?void 0:u.question)===(null===(d=t.conversation)||void 0===d?void 0:d.question)});DP.displayName="ConversationTypingEffect";const IP=DP;function LP(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 RP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LP(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var jP=function(e){var t=e.timeoutRefs,n=e.onStepStatusUpdate,r=e.onProgressUpdate,o=e.onUtilityFunctionsReady,i=e.onNoPendingSteps,a=e.isVisible,l=void 0!==a&&a,s=pe((0,oe.useState)({start:!1,complete:!1,errorMessage:null,steps:[{key:"downloading",message:(0,At.__)("Downloading template pack","templately"),status:"waiting"},{key:"analyzing",message:(0,At.__)("Analyzing the details you provided","templately"),status:"waiting"},{key:"generating",message:(0,At.__)("Generating website content","templately"),status:"waiting"},{key:"updating",message:(0,At.__)("Updating content in the template","templately"),status:"waiting"},{key:"preparing",message:(0,At.__)("Preparing live preview","templately"),status:"waiting"}]}),2),c=s[0],u=s[1],d=pe((0,oe.useState)([]),2),p=d[0],h=d[1],f=(0,oe.useRef)(!1);(0,oe.useEffect)(function(){var e=function(){if(!document.hidden&&p.length>0){var e=setTimeout(function(){h(function(e){return 0===e.length?e:Ul(e)})},100);t&&t.current&&t.current.push(e)}};return document.addEventListener("visibilitychange",e),function(){document.removeEventListener("visibilitychange",e)}},[p,t]);var m=(0,oe.useCallback)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(r&&r.delayUntil){var o=Date.now();if(o<r.delayUntil)return{allowed:!1,scheduleAfter:r.delayUntil-o};delete r.delayUntil}var i=e[t],a=Date.now();if("active"===n){if(0===t)return{allowed:!0,scheduleAfter:0};if(!e.slice(0,t).every(function(e){return"done"===e.status}))return{allowed:!1,scheduleAfter:0};var l=e[t-1];if("done"===l.status&&l.completedAt){var s=a-l.completedAt;if(s<3e3)return{allowed:!1,scheduleAfter:3e3-s}}return{allowed:!0,scheduleAfter:0}}if("done"===n){if("active"!==i.status)return{allowed:!1,scheduleAfter:0};if(!e.slice(0,t).every(function(e){return"done"===e.status}))return{allowed:!1,scheduleAfter:0};if(t>0){var c=e[t-1];if("done"===c.status&&c.completedAt){var u=a-c.completedAt;if(u<3e3)return{allowed:!1,scheduleAfter:3e3-u}}}return{allowed:!0,scheduleAfter:0}}if("has-error"===n){if("active"!==i.status)return{allowed:!1,scheduleAfter:0};if(i.activatedAt){var d=a-i.activatedAt;if(d<3e3)return{allowed:!1,scheduleAfter:3e3-d}}return{allowed:!0,scheduleAfter:0}}return"waiting"===n?{allowed:!0,scheduleAfter:0}:{allowed:!1,scheduleAfter:0}},[]),g=(0,oe.useCallback)(function(e,t){try{if(!e||"string"!=typeof e)return void console.warn("setGeneratingContentStepStatus: Invalid key provided:",e);if(!t||"string"!=typeof t)return void console.warn("setGeneratingContentStepStatus: Invalid status provided:",t);if(!["waiting","active","done","has-error"].includes(t))return void console.warn("setGeneratingContentStepStatus: Invalid status value:",t);h(function(n){return-1===n.findIndex(function(n){return n.key===e&&n.status===t})?[].concat(Ul(n),[{key:e,status:t,timestamp:Date.now()}]):n})}catch(e){console.error("Error in setGeneratingContentStepStatus:",e)}},[]);(0,oe.useEffect)(function(){p.length>0&&function(){try{h(function(e){for(var n=Ul(e),r=!1,o=function(e){var o=n[e];if(!o||!o.key||!o.status)return console.warn("Invalid pending step:",o),n.splice(e,1),r=!0,e--,i=e,0;var a=c.steps.findIndex(function(e){return e.key===o.key});if(-1===a)return console.warn("Step not found:",o.key),n.splice(e,1),r=!0,e--,i=e,0;var l=m(c.steps,a,o.status,o);if(l.allowed)n.splice(e,1),r=!0,e--,u(function(e){return RP(RP({},e),{},{steps:e.steps.map(function(e,t){if(e.key===o.key){var n=RP(RP({},e),{},{status:o.status});return"active"===o.status?n.activatedAt=Date.now():"done"===o.status&&(n.completedAt=Date.now()),n}return"done"===o.status&&t===a+1&&"waiting"===e.status?RP(RP({},e),{},{status:"active",activatedAt:Date.now()}):e})})});else if(l.scheduleAfter>0){o.delayUntil=Date.now()+l.scheduleAfter;var s=setTimeout(function(){h(function(e){return Ul(e)})},l.scheduleAfter);t&&t.current&&t.current.push(s)}i=e},i=0;i<n.length;i++)o(i);return r?n:e})}catch(e){console.error("Error processing pending steps:",e)}}()},[c.steps,p,m,t]),(0,oe.useEffect)(function(){if(i&&!f.current){var e=c.steps.every(function(e){return"done"===e.status});if(0===p.length&&e||e&&c.start&&!c.complete){f.current=!0;var n=setTimeout(function(){i()},900);t&&t.current&&t.current.push(n)}}},[p,c.steps,c.start,c.complete,i,t]);var v=(0,oe.useCallback)(function(){u(function(e){return RP(RP({},e),{},{start:!1,complete:!1,errorMessage:null,steps:e.steps.map(function(e){return RP(RP({},e),{},{status:"waiting",completedAt:void 0,activatedAt:void 0})})})}),h([]),f.current=!1},[]),y=(0,oe.useCallback)(function(){h([]),f.current=!1,u(function(e){return RP(RP({},e),{},{start:!0,complete:!1,errorMessage:null,steps:e.steps.map(function(e,t){return RP(RP({},e),{},{status:0===t?"active":"waiting",completedAt:void 0,activatedAt:0===t?Date.now():void 0})})})})},[]),b=(0,oe.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{u(function(t){return RP(RP({},t),{},{start:!1,complete:!0,errorMessage:e})})}catch(e){console.error("Error completing progress:",e)}},[]),w=(0,oe.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{h([]),u(function(n){var r="string"==typeof e?e:"An unknown error occurred",o=n.steps.findIndex(function(e){return"active"===e.status});null!==t&&"number"==typeof t||(t=-1!==o?o:0),t=Math.max(0,Math.min(t,n.steps.length-1));var i=n.steps.map(function(e,n){return n<t&&["waiting","active"].includes(e.status)||n===t?RP(RP({},e),{},{status:"has-error",completedAt:void 0,activatedAt:void 0}):n===t+1?RP(RP({},e),{},{status:"waiting",completedAt:void 0,activatedAt:void 0}):e});return RP(RP({},n),{},{start:!1,complete:!0,errorMessage:r,steps:i})})}catch(e){console.error("Error setting progress error:",e)}},[]);if((0,oe.useEffect)(function(){r&&r({start:c.start,complete:c.complete,errorMessage:c.errorMessage,steps:c.steps})},[c.start,c.complete,c.errorMessage,c.steps,r]),(0,oe.useEffect)(function(){n&&n(g)},[g,n]),(0,oe.useEffect)(function(){o&&o({resetProgress:v,startProgress:y,completeProgress:b,setProgressError:w})},[o,v,y,b,w]),(0,oe.useEffect)(function(){r&&r({start:c.start,complete:c.complete,errorMessage:c.errorMessage,steps:c.steps})},[]),!l)return null;if(!c||!Array.isArray(c.steps))return console.warn("GeneratingContentProgress: Invalid progress state"),null;try{return ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation current-question"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},ae().createElement(kP,null)),ae().createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px"}},ae().createElement("div",{className:"templately-fsi-ai-sidebar-generating-content-wrapper"},c.steps.map(function(e){return e&&e.key&&e.message?ae().createElement("div",{key:e.key,className:"templately-fsi-ai-sidebar-generating-content-step templately-fsi-ai-sidebar-generating-content-step-".concat(e.status||"waiting")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-generating-content-step-icon"}),ae().createElement("span",{className:"templately-fsi-ai-sidebar-generating-content-step-message"},e.message)):(console.warn("GeneratingContentProgress: Invalid step data",e),null)})),null==c||!c.start||null!=c&&c.complete?null!=c&&c.complete&&null!=c&&c.errorMessage?ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-processing-error"},"".concat(c.errorMessage," ").concat((0,At.__)("Please try again or","templately")," "),ae().createElement("a",{href:"https://wpdeveloper.com/support",target:"_blank"},(0,At.__)("contact support.","templately"))):null:ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-processing-placeholder"},(0,At.__)("Generating your website content… This may take a moment. Thanks for waiting!","templately"))))}catch(e){return console.error("GeneratingContentProgress render error:",e),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-processing-error"},"".concat((0,At.__)("An error occurred while displaying progress. Please try again or","templately")," "),ae().createElement("a",{href:"https://wpdeveloper.com/support",target:"_blank"},(0,At.__)("contact support.","templately")))}};jP.resetProgress=function(e){return e&&e()},jP.startProgress=function(e){return e&&e()},jP.completeProgress=function(e,t){return e&&e(t)},jP.setProgressError=function(e,t,n){return e&&e(t,n)};const FP=jP,zP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"15",fill:"none",viewBox:"0 0 14 15"},oe.createElement("mask",{id:"mask0_13963_9821",width:"15",height:"15",x:"-1",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},oe.createElement("path",{fill:"#7F7F7F",d:"M-.005.532h14v14h-14z"})),oe.createElement("g",{mask:"url(#mask0_13963_9821)"},oe.createElement("path",{fill:"#7F7F7F",d:"M6.995 9.253a.7.7 0 0 1-.219-.037.5.5 0 0 1-.19-.124L3.904 6.41a.57.57 0 0 1-.167-.401.54.54 0 0 1 .167-.416.55.55 0 0 1 .409-.16q.247 0 .408.16l2.275 2.26 2.275-2.26a.57.57 0 0 1 .401-.168.54.54 0 0 1 .416.168q.16.16.16.409a.55.55 0 0 1-.16.408L7.403 9.092a.5.5 0 0 1-.19.124.7.7 0 0 1-.218.037"})))},BP=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"15",fill:"none",viewBox:"0 0 14 15"},oe.createElement("mask",{id:"mask0_13963_9816",width:"15",height:"15",x:"-1",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},oe.createElement("path",{fill:"#7F7F7F",d:"M-.005.532h14v14h-14z"})),oe.createElement("g",{mask:"url(#mask0_13963_9816)"},oe.createElement("path",{fill:"#7F7F7F",d:"M6.995 13.365q-.48 0-.824-.343a1.12 1.12 0 0 1-.343-.824h2.334q0 .482-.343.824a1.12 1.12 0 0 1-.824.343m-1.75-1.75a.56.56 0 0 1-.416-.168.56.56 0 0 1-.167-.415q0-.248.167-.416a.56.56 0 0 1 .416-.168h3.5q.248 0 .416.168t.167.416a.56.56 0 0 1-.167.415.56.56 0 0 1-.416.168zm-.437-1.75A4.47 4.47 0 0 1 3.21 8.261q-.59-1.006-.59-2.188 0-1.823 1.275-3.099 1.275-1.275 3.1-1.276 1.821 0 3.098 1.276 1.275 1.276 1.276 3.1 0 1.18-.59 2.187a4.47 4.47 0 0 1-1.597 1.604zm.35-1.167h3.675a3.24 3.24 0 0 0 1.013-1.152 3.14 3.14 0 0 0 .357-1.473q0-1.34-.933-2.275-.933-.933-2.275-.933t-2.275.933-.933 2.275q0 .788.357 1.473.357.686 1.014 1.152"})))},WP=function(e){var t=e.currentStepTooltip,n=e.isVisible,r=void 0!==n&&n,o=e.isThinkingOrTyping,i=void 0!==o&&o,a=e.timeoutRefs,l=pe((0,oe.useState)(!1),2),s=l[0],c=l[1],u=pe((0,oe.useState)(null),2),d=u[0],p=u[1],h=pe((0,oe.useState)(!1),2),f=h[0],m=h[1],g=Boolean(t||d)&&r&&!i,v=(0,oe.useCallback)(function(){f||c(function(e){return!e})},[f]),y=(0,oe.useMemo)(function(){return(0,_a.throttle)(function(e,t){if(t){m(!0),c(!1);var n=setTimeout(function(){p(e),m(!1),null!=a&&a.current&&(a.current=a.current.filter(function(e){return e!==n}))},300);null!=a&&a.current&&a.current.push(n)}else{m(!0);var r=setTimeout(function(){p(e),m(!1),null!=a&&a.current&&(a.current=a.current.filter(function(e){return e!==r}))},100);null!=a&&a.current&&a.current.push(r)}},50)},[a]);(0,oe.useEffect)(function(){try{t&&t!==d&&g?y(t,s):t&&!d?p(t):!t&&d&&(p(null),c(!1))}catch(e){console.warn("HelpPanel: Error during content transition:",e),m(!1),p(t||null)}},[t,d,s,g,y]),(0,oe.useEffect)(function(){return function(){y.cancel()}},[y]),(0,oe.useEffect)(function(){!g&&s&&c(!1)},[g,s]);var b=d||"";return g&&b?ae().createElement("div",{className:"templately-fsi-ai-sidebar-footer-info-panel ".concat(g?"templately-fsi-ai-sidebar-footer-info-panel--visible":"templately-fsi-ai-sidebar-footer-info-panel--hidden"," ").concat(s?"templately-fsi-ai-sidebar-footer-info-panel--open":""," ").concat(f?"templately-fsi-ai-sidebar-footer-info-panel--transitioning":""),role:"complementary","aria-label":(0,At.__)("Help information","templately")},ae().createElement("div",{className:"templately-fsi-ai-sidebar-footer-info-panel-head"},ae().createElement("button",{className:"templately-fsi-ai-sidebar-footer-info-button",onClick:v,disabled:f,"aria-expanded":s,"aria-controls":"help-panel-content",type:"button"},ae().createElement("span",{className:"templately-fsi-ai-sidebar-footer-info-button-icon"},ae().createElement(BP,null)),ae().createElement("span",{className:"templately-fsi-ai-sidebar-footer-info-button-text"},(0,At.__)("How should I pick?","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-footer-info-button-icon ".concat(s?"templately-fsi-ai-sidebar-footer-info-button-icon--rotated":"")},ae().createElement(zP,null)))),ae().createElement("div",{className:"templately-fsi-ai-sidebar-footer-info-panel-body"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-footer-info-panel-body-inner"},ae().createElement("div",{id:"help-panel-content",className:"templately-fsi-ai-sidebar-footer-info-panel-content ".concat(f?"templately-fsi-ai-sidebar-footer-info-panel-content--transitioning":""),dangerouslySetInnerHTML:{__html:b},role:"region","aria-live":"polite"})))):null};function UP(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function VP(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function HP(...e){return t=>{let n=!1;const r=e.map(e=>{const r=VP(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():VP(e[t],null)}}}}function qP(...e){return oe.useCallback(HP(...e),e)}"undefined"==typeof window||!window.document||window.document.createElement;var QP=o(4848);function $P(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>oe.createContext(e));return function(n){const r=n?.[e]||t;return oe.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){const o=oe.createContext(r),i=n.length;n=[...n,r];const a=t=>{const{scope:n,children:r,...a}=t,l=n?.[e]?.[i]||o,s=oe.useMemo(()=>a,Object.values(a));return(0,QP.jsx)(l.Provider,{value:s,children:r})};return a.displayName=t+"Provider",[a,function(n,a){const l=a?.[e]?.[i]||o,s=oe.useContext(l);if(s)return s;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},GP(r,...t)]}function GP(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return oe.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function YP(e){const t=XP(e),n=oe.forwardRef((e,n)=>{const{children:r,...o}=e,i=oe.Children.toArray(r),a=i.find(ZP);if(a){const e=a.props.children,r=i.map(t=>t===a?oe.Children.count(e)>1?oe.Children.only(null):oe.isValidElement(e)?e.props.children:null:t);return(0,QP.jsx)(t,{...o,ref:n,children:oe.isValidElement(e)?oe.cloneElement(e,void 0,r):null})}return(0,QP.jsx)(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function XP(e){const t=oe.forwardRef((e,t)=>{const{children:n,...r}=e;if(oe.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==oe.Fragment&&(o.ref=t?HP(t,e):e),oe.cloneElement(n,o)}return oe.Children.count(n)>1?oe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KP=Symbol("radix.slottable");function ZP(e){return oe.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===KP}var JP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=YP(`Primitive.${t}`),r=oe.forwardRef((e,r)=>{const{asChild:o,...i}=e,a=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,QP.jsx)(a,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function eT(e){const t=oe.useRef(e);return oe.useEffect(()=>{t.current=e}),oe.useMemo(()=>(...e)=>t.current?.(...e),[])}var tT,nT="dismissableLayer.update",rT=oe.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oT=oe.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...s}=e,c=oe.useContext(rT),[u,d]=oe.useState(null),p=u?.ownerDocument??globalThis?.document,[,h]=oe.useState({}),f=qP(t,e=>d(e)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(g),y=u?m.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,w=y>=v,k=function(e,t=globalThis?.document){const n=eT(e),r=oe.useRef(!1),o=oe.useRef(()=>{});return oe.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){lT("dismissableLayer.pointerDownOutside",n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...c.branches].some(e=>e.contains(t));w&&!n&&(o?.(e),a?.(e),e.defaultPrevented||l?.())},p),E=function(e,t=globalThis?.document){const n=eT(e),r=oe.useRef(!1);return oe.useEffect(()=>{const e=e=>{e.target&&!r.current&&lT("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...c.branches].some(e=>e.contains(t))||(i?.(e),a?.(e),e.defaultPrevented||l?.())},p);return function(e,t=globalThis?.document){const n=eT(e);oe.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===c.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),oe.useEffect(()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(tT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),aT(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=tT)}},[u,p,n,c]),oe.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),aT())},[u,c]),oe.useEffect(()=>{const e=()=>h({});return document.addEventListener(nT,e),()=>document.removeEventListener(nT,e)},[]),(0,QP.jsx)(JP.div,{...s,ref:f,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:UP(e.onFocusCapture,E.onFocusCapture),onBlurCapture:UP(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:UP(e.onPointerDownCapture,k.onPointerDownCapture)})});oT.displayName="DismissableLayer";var iT=oe.forwardRef((e,t)=>{const n=oe.useContext(rT),r=oe.useRef(null),o=qP(t,r);return oe.useEffect(()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,QP.jsx)(JP.div,{...e,ref:o})});function aT(){const e=new CustomEvent(nT);document.dispatchEvent(e)}function lT(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&le.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}iT.displayName="DismissableLayerBranch";var sT=0;function cT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var uT="focusScope.autoFocusOnMount",dT="focusScope.autoFocusOnUnmount",pT={bubbles:!1,cancelable:!0},hT=oe.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,s]=oe.useState(null),c=eT(o),u=eT(i),d=oe.useRef(null),p=qP(t,e=>s(e)),h=oe.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;oe.useEffect(()=>{if(r){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?d.current=t:vT(d.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||vT(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&vT(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,l,h.paused]),oe.useEffect(()=>{if(l){yT.add(h);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(uT,pT);l.addEventListener(uT,c),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vT(r,{select:t}),document.activeElement!==n)return}(fT(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&vT(l))}return()=>{l.removeEventListener(uT,c),setTimeout(()=>{const t=new CustomEvent(dT,pT);l.addEventListener(dT,u),l.dispatchEvent(t),t.defaultPrevented||vT(e??document.body,{select:!0}),l.removeEventListener(dT,u),yT.remove(h)},0)}}},[l,c,u,h]);const f=oe.useCallback(e=>{if(!n&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=fT(e);return[mT(t,e),mT(t.reverse(),e)]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&vT(i,{select:!0})):(e.preventDefault(),n&&vT(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,h.paused]);return(0,QP.jsx)(JP.div,{tabIndex:-1,...a,ref:p,onKeyDown:f})});function fT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mT(e,t){for(const n of e)if(!gT(n,{upTo:t}))return n}function gT(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function vT(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hT.displayName="FocusScope";var yT=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=bT(e,t),e.unshift(t)},remove(t){e=bT(e,t),e[0]?.resume()}}}();function bT(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var wT=globalThis?.document?oe.useLayoutEffect:()=>{},kT=ie[" useId ".trim().toString()]||(()=>{}),ET=0;function OT(e){const[t,n]=oe.useState(kT());return wT(()=>{e||n(e=>e??String(ET++))},[e]),e||(t?`radix-${t}`:"")}var xT="undefined"!=typeof document?oe.useLayoutEffect:function(){};function ST(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!ST(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||ST(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function _T(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function CT(e,t){const n=_T(e);return Math.round(t*n)/n}function PT(e){const t=oe.useRef(e);return xT(()=>{t.current=e}),t}const TT=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&function(e){return{}.hasOwnProperty.call(e,"current")}(n)?null!=n.current?Wf({element:n.current,padding:r}).fn(t):{}:n?Wf({element:n,padding:r}).fn(t):{}}}),AT=(e,t)=>({...Rf(e),options:[e,t]}),MT=(e,t)=>({...jf(e),options:[e,t]}),NT=(e,t)=>({...Uf(e),options:[e,t]}),DT=(e,t)=>({...Ff(e),options:[e,t]}),IT=(e,t)=>({...zf(e),options:[e,t]}),LT=(e,t)=>({...Bf(e),options:[e,t]}),RT=(e,t)=>({...TT(e),options:[e,t]});var jT=oe.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return(0,QP.jsx)(JP.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,QP.jsx)("polygon",{points:"0,0 30,0 15,10"})})});jT.displayName="Arrow";var FT=jT,zT="Popper",[BT,WT]=$P(zT),[UT,VT]=BT(zT),HT=e=>{const{__scopePopper:t,children:n}=e,[r,o]=oe.useState(null);return(0,QP.jsx)(UT,{scope:t,anchor:r,onAnchorChange:o,children:n})};HT.displayName=zT;var qT="PopperAnchor",QT=oe.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=VT(qT,n),a=oe.useRef(null),l=qP(t,a),s=oe.useRef(null);return oe.useEffect(()=>{const e=s.current;s.current=r?.current||a.current,e!==s.current&&i.onAnchorChange(s.current)}),r?null:(0,QP.jsx)(JP.div,{...o,ref:l})});QT.displayName=qT;var $T="PopperContent",[GT,YT]=BT($T),XT=oe.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:s=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:f,...m}=e,g=VT($T,n),[v,y]=oe.useState(null),b=qP(t,e=>y(e)),[w,k]=oe.useState(null),E=function(e){const[t,n]=oe.useState(void 0);return wT(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(w),O=E?.width??0,x=E?.height??0,S=r+("center"!==i?"-"+i:""),_="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},C=Array.isArray(c)?c:[c],P=C.length>0,T={padding:_,boundary:C.filter(eA),altBoundary:P},{refs:A,floatingStyles:M,placement:N,isPositioned:D,middlewareData:I}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:s,open:c}=e,[u,d]=oe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=oe.useState(r);ST(p,r)||h(r);const[f,m]=oe.useState(null),[g,v]=oe.useState(null),y=oe.useCallback(e=>{e!==E.current&&(E.current=e,m(e))},[]),b=oe.useCallback(e=>{e!==O.current&&(O.current=e,v(e))},[]),w=i||f,k=a||g,E=oe.useRef(null),O=oe.useRef(null),x=oe.useRef(u),S=null!=s,_=PT(s),C=PT(o),P=PT(c),T=oe.useCallback(()=>{if(!E.current||!O.current)return;const e={placement:t,strategy:n,middleware:p};C.current&&(e.platform=C.current),Vf(E.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};A.current&&!ST(x.current,t)&&(x.current=t,le.flushSync(()=>{d(t)}))})},[p,t,n,C,P]);xT(()=>{!1===c&&x.current.isPositioned&&(x.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const A=oe.useRef(!1);xT(()=>(A.current=!0,()=>{A.current=!1}),[]),xT(()=>{if(w&&(E.current=w),k&&(O.current=k),w&&k){if(_.current)return _.current(w,k,T);T()}},[w,k,T,_,S]);const M=oe.useMemo(()=>({reference:E,floating:O,setReference:y,setFloating:b}),[y,b]),N=oe.useMemo(()=>({reference:w,floating:k}),[w,k]),D=oe.useMemo(()=>{const e={position:n,left:0,top:0};if(!N.floating)return e;const t=CT(N.floating,u.x),r=CT(N.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",..._T(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,N.floating,u.x,u.y]);return oe.useMemo(()=>({...u,update:T,refs:M,elements:N,floatingStyles:D}),[u,T,M,N,D])}({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>Lf(...e,{animationFrame:"always"===h}),elements:{reference:g.anchor},middleware:[AT({mainAxis:o+x,alignmentAxis:a}),s&&MT({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?NT():void 0,...T}),s&&DT({...T}),IT({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),w&&RT({element:w,padding:l}),tA({arrowWidth:O,arrowHeight:x}),p&<({strategy:"referenceHidden",...T})]}),[L,R]=nA(N),j=eT(f);wT(()=>{D&&j?.()},[D,j]);const F=I.arrow?.x,z=I.arrow?.y,B=0!==I.arrow?.centerOffset,[W,U]=oe.useState();return wT(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]),(0,QP.jsx)("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:D?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,QP.jsx)(GT,{scope:n,placedSide:L,onArrowChange:k,arrowX:F,arrowY:z,shouldHideArrow:B,children:(0,QP.jsx)(JP.div,{"data-side":L,"data-align":R,...m,ref:b,style:{...m.style,animation:D?void 0:"none"}})})})});XT.displayName=$T;var KT="PopperArrow",ZT={top:"bottom",right:"left",bottom:"top",left:"right"},JT=oe.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=YT(KT,n),i=ZT[o.placedSide];return(0,QP.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,QP.jsx)(FT,{...r,ref:t,style:{...r.style,display:"block"}})})});function eA(e){return null!==e}JT.displayName=KT;var tA=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[s,c]=nA(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2;let h="",f="";return"bottom"===s?(h=i?u:`${d}px`,f=-l+"px"):"top"===s?(h=i?u:`${d}px`,f=`${r.floating.height+l}px`):"right"===s?(h=-l+"px",f=i?u:`${p}px`):"left"===s&&(h=`${r.floating.width+l}px`,f=i?u:`${p}px`),{data:{x:h,y:f}}}});function nA(e){const[t,n="center"]=e.split("-");return[t,n]}var rA=HT,oA=QT,iA=XT,aA=JT,lA=oe.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=oe.useState(!1);wT(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?le.createPortal((0,QP.jsx)(JP.div,{...r,ref:t}),a):null});lA.displayName="Portal";var sA=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=oe.useState(),r=oe.useRef(null),o=oe.useRef(e),i=oe.useRef("none"),a=e?"mounted":"unmounted",[l,s]=function(e,t){return oe.useReducer((e,n)=>t[e][n]??e,e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return oe.useEffect(()=>{const e=cA(r.current);i.current="mounted"===l?e:"none"},[l]),wT(()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=cA(t);s(e?"MOUNT":"none"===a||"none"===t?.display?"UNMOUNT":n&&r!==a?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,s]),wT(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=cA(r.current).includes(CSS.escape(i.animationName));if(i.target===t&&a&&(s("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},l=e=>{e.target===t&&(i.current=cA(r.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:oe.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),o="function"==typeof n?n({present:r.isPresent}):oe.Children.only(n),i=qP(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof n||r.isPresent?oe.cloneElement(o,{ref:i}):null};function cA(e){return e?.animationName||"none"}sA.displayName="Presence";var uA=ie[" useInsertionEffect ".trim().toString()]||wT;function dA({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=function({defaultProp:e,onChange:t}){const[n,r]=oe.useState(e),o=oe.useRef(n),i=oe.useRef(t);return uA(()=>{i.current=t},[t]),oe.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}({defaultProp:t,onChange:n}),l=void 0!==e,s=l?e:o;{const t=oe.useRef(void 0!==e);oe.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,r])}const c=oe.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&a.current?.(n)}else i(t)},[l,e,i,a]);return[s,c]}Symbol("RADIX:SYNC_STATE");var pA=new WeakMap,hA=new WeakMap,fA={},mA=0,gA=function(e){return e&&(e.host||gA(e.parentNode))},vA=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=gA(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);fA[n]||(fA[n]=new WeakMap);var i=fA[n],a=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(pA.get(e)||0)+1,c=(i.get(e)||0)+1;pA.set(e,s),i.set(e,c),a.push(e),1===s&&o&&hA.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),l.clear(),mA++,function(){a.forEach(function(e){var t=pA.get(e)-1,o=i.get(e)-1;pA.set(e,t),i.set(e,o),t||(hA.has(e)||e.removeAttribute(r),hA.delete(e)),o||e.removeAttribute(n)}),--mA||(pA=new WeakMap,pA=new WeakMap,hA=new WeakMap,fA={})}}(r,o,n,"aria-hidden")):function(){return null}},yA=o(1635),bA="right-scroll-bar-position",wA="width-before-scroll-bar";function kA(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var EA="undefined"!=typeof window?oe.useLayoutEffect:oe.useEffect,OA=new WeakMap;function xA(e){return e}var SA=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=xA);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=(0,yA.__assign)({async:!0,ssr:!1},e),t}(),_A=function(){},CA=oe.forwardRef(function(e,t){var n,r,o,i=oe.useRef(null),a=oe.useState({onScrollCapture:_A,onWheelCapture:_A,onTouchMoveCapture:_A}),l=a[0],s=a[1],c=e.forwardProps,u=e.children,d=e.className,p=e.removeScrollBar,h=e.enabled,f=e.shards,m=e.sideCar,g=e.noRelative,v=e.noIsolation,y=e.inert,b=e.allowPinchZoom,w=e.as,k=void 0===w?"div":w,E=e.gapMode,O=(0,yA.__rest)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=m,S=(n=[i,t],o=function(e,t){var n=(0,oe.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}(r||null,function(e){return n.forEach(function(t){return kA(t,e)})}),EA(function(){var e=OA.get(o);if(e){var t=new Set(e),r=new Set(n),i=o.current;t.forEach(function(e){r.has(e)||kA(e,null)}),r.forEach(function(e){t.has(e)||kA(e,i)})}OA.set(o,n)},[n]),o),_=(0,yA.__assign)((0,yA.__assign)({},O),l);return oe.createElement(oe.Fragment,null,h&&oe.createElement(x,{sideCar:SA,removeScrollBar:p,shards:f,noRelative:g,noIsolation:v,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:i,gapMode:E}),c?oe.cloneElement(oe.Children.only(u),(0,yA.__assign)((0,yA.__assign)({},_),{ref:S})):oe.createElement(k,(0,yA.__assign)({},_,{className:d,ref:S}),u))});CA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},CA.classNames={fullWidth:wA,zeroRight:bA};var PA=function(e){var t=e.sideCar,n=(0,yA.__rest)(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return oe.createElement(r,(0,yA.__assign)({},n))};PA.isSideCarExport=!0;var TA=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=o.nc;return t&&e.setAttribute("nonce",t),e}())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},AA=function(){var e,t=(e=TA(),function(t,n){oe.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},MA={left:0,top:0,right:0,gap:0},NA=function(e){return parseInt(e||"",10)||0},DA=AA(),IA="data-scroll-locked",LA=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(IA,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(bA," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(wA," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(bA," .").concat(bA," {\n right: 0 ").concat(r,";\n }\n \n .").concat(wA," .").concat(wA," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(IA,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},RA=function(){var e=parseInt(document.body.getAttribute(IA)||"0",10);return isFinite(e)?e:0},jA=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;oe.useEffect(function(){return document.body.setAttribute(IA,(RA()+1).toString()),function(){var e=RA()-1;e<=0?document.body.removeAttribute(IA):document.body.setAttribute(IA,e.toString())}},[]);var i=oe.useMemo(function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return MA;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[NA(n),NA(r),NA(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}(o)},[o]);return oe.createElement(DA,{styles:LA(i,!t,o,n?"":"!important")})},FA=!1;if("undefined"!=typeof window)try{var zA=Object.defineProperty({},"passive",{get:function(){return FA=!0,!0}});window.addEventListener("test",zA,zA),window.removeEventListener("test",zA,zA)}catch(e){FA=!1}var BA=!!FA&&{passive:!1},WA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},UA=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),VA(e,r)){var o=HA(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VA=function(e,t){return"v"===e?function(e){return WA(e,"overflowY")}(t):function(e){return WA(e,"overflowX")}(t)},HA=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},qA=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},QA=function(e){return[e.deltaX,e.deltaY]},$A=function(e){return e&&"current"in e?e.current:e},GA=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},YA=0,XA=[];function KA(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ZA=(JA=function(e){var t=oe.useRef([]),n=oe.useRef([0,0]),r=oe.useRef(),o=oe.useState(YA++)[0],i=oe.useState(AA)[0],a=oe.useRef(e);oe.useEffect(function(){a.current=e},[e]),oe.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(0,yA.__spreadArray)([e.lockRef.current],(e.shards||[]).map($A),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=oe.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=qA(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-i[0],c="deltaY"in e?e.deltaY:l[1]-i[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=window.getSelection(),h=p&&p.anchorNode;if(h&&(h===u||h.contains(u)))return!1;var f=UA(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=UA(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(s||c)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,l=t.contains(a),s=!1,c=i>0,u=0,d=0;do{if(!a)break;var p=HA(e,a),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&VA(e,a)&&(u+=f,d+=h);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&(Math.abs(u)<1||!1)||!c&&(Math.abs(d)<1||!1))&&(s=!0),s}(m,t,e,"h"===m?s:c)},[]),s=oe.useCallback(function(e){var n=e;if(XA.length&&XA[XA.length-1]===i){var r="deltaY"in n?QA(n):qA(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var s=(a.current.shards||[]).map($A).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?l(n,s[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),c=oe.useCallback(function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:KA(r)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),u=oe.useCallback(function(e){n.current=qA(e),r.current=void 0},[]),d=oe.useCallback(function(t){c(t.type,QA(t),t.target,l(t,e.lockRef.current))},[]),p=oe.useCallback(function(t){c(t.type,qA(t),t.target,l(t,e.lockRef.current))},[]);oe.useEffect(function(){return XA.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",s,BA),document.addEventListener("touchmove",s,BA),document.addEventListener("touchstart",u,BA),function(){XA=XA.filter(function(e){return e!==i}),document.removeEventListener("wheel",s,BA),document.removeEventListener("touchmove",s,BA),document.removeEventListener("touchstart",u,BA)}},[]);var h=e.removeScrollBar,f=e.inert;return oe.createElement(oe.Fragment,null,f?oe.createElement(i,{styles:GA(o)}):null,h?oe.createElement(jA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},SA.useMedium(JA),PA);var JA,eM=oe.forwardRef(function(e,t){return oe.createElement(CA,(0,yA.__assign)({},e,{ref:t,sideCar:ZA}))});eM.classNames=CA.classNames;const tM=eM;var nM="Popover",[rM,oM]=$P(nM,[WT]),iM=WT(),[aM,lM]=rM(nM),sM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,l=iM(t),s=oe.useRef(null),[c,u]=oe.useState(!1),[d,p]=dA({prop:r,defaultProp:o??!1,onChange:i,caller:nM});return(0,QP.jsx)(rA,{...l,children:(0,QP.jsx)(aM,{scope:t,contentId:OT(),triggerRef:s,open:d,onOpenChange:p,onOpenToggle:oe.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:c,onCustomAnchorAdd:oe.useCallback(()=>u(!0),[]),onCustomAnchorRemove:oe.useCallback(()=>u(!1),[]),modal:a,children:n})})};sM.displayName=nM;var cM="PopoverAnchor";oe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=lM(cM,n),i=iM(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=o;return oe.useEffect(()=>(a(),()=>l()),[a,l]),(0,QP.jsx)(oA,{...i,...r,ref:t})}).displayName=cM;var uM="PopoverTrigger",dM=oe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=lM(uM,n),i=iM(n),a=qP(t,o.triggerRef),l=(0,QP.jsx)(JP.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":OM(o.open),...r,ref:a,onClick:UP(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:(0,QP.jsx)(oA,{asChild:!0,...i,children:l})});dM.displayName=uM;var pM="PopoverPortal",[hM,fM]=rM(pM,{forceMount:void 0}),mM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=lM(pM,t);return(0,QP.jsx)(hM,{scope:t,forceMount:n,children:(0,QP.jsx)(sA,{present:n||i.open,children:(0,QP.jsx)(lA,{asChild:!0,container:o,children:r})})})};mM.displayName=pM;var gM="PopoverContent",vM=oe.forwardRef((e,t)=>{const n=fM(gM,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=lM(gM,e.__scopePopover);return(0,QP.jsx)(sA,{present:r||i.open,children:i.modal?(0,QP.jsx)(bM,{...o,ref:t}):(0,QP.jsx)(wM,{...o,ref:t})})});vM.displayName=gM;var yM=YP("PopoverContent.RemoveScroll"),bM=oe.forwardRef((e,t)=>{const n=lM(gM,e.__scopePopover),r=oe.useRef(null),o=qP(t,r),i=oe.useRef(!1);return oe.useEffect(()=>{const e=r.current;if(e)return vA(e)},[]),(0,QP.jsx)(tM,{as:yM,allowPinchZoom:!0,children:(0,QP.jsx)(kM,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:UP(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:UP(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:UP(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),wM=oe.forwardRef((e,t)=>{const n=lM(gM,e.__scopePopover),r=oe.useRef(!1),o=oe.useRef(!1);return(0,QP.jsx)(kM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,a=n.triggerRef.current?.contains(i);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),kM=oe.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,...d}=e,p=lM(gM,n),h=iM(n);return oe.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cT()),document.body.insertAdjacentElement("beforeend",e[1]??cT()),sT++,()=>{1===sT&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),sT--}},[]),(0,QP.jsx)(hT,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,QP.jsx)(oT,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:(0,QP.jsx)(iA,{"data-state":OM(p.open),role:"dialog",id:p.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),EM="PopoverClose";function OM(e){return e?"open":"closed"}oe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=lM(EM,n);return(0,QP.jsx)(JP.button,{type:"button",...r,ref:t,onClick:UP(e.onClick,()=>o.onOpenChange(!1))})}).displayName=EM,oe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=iM(n);return(0,QP.jsx)(aA,{...o,...r,ref:t})}).displayName="PopoverArrow";var xM=sM,SM=dM,_M=mM,CM=vM;const PM=function(e){var t=e.open,n=e.onOpenChange,r=e.children,o=e.content;return React.createElement(xM,{open:t,onOpenChange:n},React.createElement(SM,{asChild:!0},r),React.createElement(_M,null,React.createElement(CM,{className:"templately-fsi-ai-sidebar-conversation-categories-panel",sideOffset:12,side:"top",align:"end"},o)))};function TM(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 AM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TM(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var MM=function(){return Rd(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Id(this,e),this.callbacks=t,this.state="idle",this.data={},this.errors=[]},[{key:"setState",value:function(e){var t,n,r,o,i,a,l,s,c,u,d,p,h,f,m,g,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,y=this.state;switch(this.state=e,v&&(this.data=AM(AM({},this.data),v)),Ja("AI Workflow: ".concat(y," → ").concat(e),v),e){case"session_created":null===(t=(n=this.callbacks).onSessionCreated)||void 0===t||t.call(n,v);break;case"ai_content_started":null===(r=(o=this.callbacks).onAIContentStarted)||void 0===r||r.call(o,v);break;case"both_completed":null===(i=(a=this.callbacks).onBothCompleted)||void 0===i||i.call(a,this.data);break;case"polling_complete":null===(l=(s=this.callbacks).onPollingComplete)||void 0===l||l.call(s,v);break;case"updating":null===(c=(u=this.callbacks).onUpdating)||void 0===c||c.call(u,v);break;case"preparing":null===(d=(p=this.callbacks).onPreparing)||void 0===d||d.call(p,v);break;case"workflow_complete":null===(h=(f=this.callbacks).onWorkflowComplete)||void 0===h||h.call(f,v);break;case"error":this.errors.push(v),null===(m=(g=this.callbacks).onError)||void 0===m||m.call(g,v)}}},{key:"getState",value:function(){return this.state}},{key:"getData",value:function(){return this.data}},{key:"getErrors",value:function(){return this.errors}}])}(),NM=function(){var e=Ei(xi().mark(function e(t,n,r){var o,i,a,l,s,c,u,d,p,h;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s=Object.values(t.ai_page_ids||{}).flat(),(null===(o=t.preview_pages)||void 0===o?void 0:o.length)>0&&(s=s.filter(function(e){return!t.preview_pages.includes(e)})),(c=new FormData).append("id",n),c.append("session_id",t.session_id),c.append("ai_page_ids",JSON.stringify(t.ai_page_ids)),c.append("content_ids",JSON.stringify(s)),c.append("platform",t.platform),t.requested_platform&&c.append("requested_platform",t.requested_platform),u=(0,Ci.addQueryArgs)(window.ajaxurl,{action:"templately_pack_create_session_and_download",is_lightspeed:!0,nonce:window.templately.nonce}),e.next=1,Sa(u,c,{signal:r});case 1:if("error"!==(null==(d=e.sent)?void 0:d.status)&&null!=d&&d.success){e.next=2;break}throw new Error((null==d?void 0:d.message)||(null==d||null===(p=d.data)||void 0===p?void 0:p.message)||(0,At.__)("Failed to create session and download pack","templately"));case 2:if(null!==(i=d.data)&&void 0!==i&&i.session_id){e.next=3;break}throw new Error((0,At.__)("Session creation failed","templately"));case 3:return e.abrupt("return",AM({session_id:null===(a=d.data)||void 0===a?void 0:a.session_id,pack_downloaded:(null===(l=d.data)||void 0===l?void 0:l.pack_downloaded)||!1},d.data));case 4:throw e.prev=4,h=e.catch(0),console.error("Error in createSessionAndDownloadPack:",h),h;case 5:case"end":return e.stop()}},e,null,[[0,4]])}));return function(_x,t,n){return e.apply(this,arguments)}}(),DM=function(){var e=Ei(xi().mark(function e(t,n){var r,o,i;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Object.values(t.ai_page_ids||{}).flat(),(null===(r=t.preview_pages)||void 0===r?void 0:r.length)>0&&(o=o.filter(function(e){return!t.preview_pages.includes(e)})),!(0,_a.isEmpty)(t.preview_pages)){e.next=1;break}throw{message:(0,At.__)("Please select at least one page to modify.","templately"),type:"error",errorType:"EMPTY_PAGE_SELECTION"};case 1:if(t.description){e.next=2;break}throw{message:(0,At.__)("Please enter a prompt describing your business and content needs.","templately"),type:"error",errorType:"MISSING_PROMPT"};case 2:if(t.pack_id){e.next=3;break}throw{message:(0,At.__)("Template pack ID is missing.","templately"),type:"error",errorType:"MISSING_PACK_ID"};case 3:if(t.platform){e.next=4;break}throw{message:(0,At.__)("Platform selection is required.","templately"),type:"error",errorType:"MISSING_PLATFORM"};case 4:return e.prev=4,e.next=5,wa("/templately/v1/ai-content/modify-content/",AM(AM({},t),{},{content_ids:o,preview_pages:t.preview_pages||[]}),{signal:n},!0);case 5:if(i=e.sent,Ja(i),"success"===i.status){e.next=6;break}throw new Error((null==i?void 0:i.message)||(0,At.__)("Failed to start AI content modification","templately"));case 6:if(null!=i&&i.process_id){e.next=7;break}throw new Error((0,At.__)("Failed to start AI content modification","templately"));case 7:return e.abrupt("return",i);case 8:throw e.prev=8,e.catch(4);case 9:case"end":return e.stop()}},e,null,[[4,8]])}));return function(t,n){return e.apply(this,arguments)}}(),IM=function(){var e=Ei(xi().mark(function e(t){var n,r,o,i,a,l,s=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:"pack",r=s.length>2&&void 0!==s[2]?s[2]:null,e.prev=1,t){e.next=2;break}throw new Error((0,At.__)("Pack ID is required to fetch attachments data","templately"));case 2:return Ja("Fetching attachments data from API...",{packId:t,type:n}),o={type:n,pack_id:t},e.next=3,ba("/templately/v1/ai-content/attachments",o,{signal:r});case 3:if(i=e.sent,Ja("Attachments API response:",i),!i.error){e.next=4;break}throw i.error;case 4:if((a=i.response)&&"success"===a.status){e.next=5;break}throw new Error((null==a?void 0:a.message)||(0,At.__)("Failed to fetch attachments data","templately"));case 5:if(Array.isArray(a.data)){e.next=6;break}throw new Error((0,At.__)("Invalid attachments data format","templately"));case 6:return e.abrupt("return",{attachments:a.data,count:a.data.length,message:a.message,status:a.status});case 7:if(e.prev=7,!("AbortError"===(l=e.catch(1)).name||null!=r&&r.aborted)){e.next=8;break}throw Ja("Attachments fetch was cancelled"),new Error((0,At.__)("Attachments fetch was cancelled","templately"));case 8:throw console.error("Error fetching attachments data:",l),new Error(l.message||(0,At.__)("Failed to fetch attachments data","templately"));case 9:case"end":return e.stop()}},e,null,[[1,7]])}));return function(t){return e.apply(this,arguments)}}(),LM=function(){var e=Ei(xi().mark(function e(t){var n,r,o,i,a,l,s,c,u,d,p,h,f,m,g,v,y,b,w,k,E,O,x,S,_,C,P,T,A,M,N,D,I,L,R=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=R.length>2&&void 0!==R[2]?R[2]:null,r=new MM(R.length>1&&void 0!==R[1]?R[1]:{}),o=new AbortController,i=setTimeout(function(){o.abort("Workflow timeout")},FM.OVERALL_TIMEOUT),e.prev=1,r.setState("validating"),null!=t&&t.pack_id){e.next=2;break}throw new Error((0,At.__)("Template pack ID is missing","templately"));case 2:if(null!=t&&t.description){e.next=3;break}throw new Error((0,At.__)("AI prompt is missing","templately"));case 3:if(a=t.session_id||JE(),l=AM(AM({},t),{},{session_id:a}),s=[new AbortController,new AbortController],c=[],u=function(e){s.forEach(function(t){t.signal.aborted||t.abort(e)}),c.forEach(function(e){try{e()}catch(e){console.warn("Cleanup task failed:",e)}})},!n){e.next=5;break}if(!n.signal.aborted){e.next=4;break}throw new Error((0,At.__)("AI content workflow was cancelled","templately"));case 4:d=function(){return u("External abort signal received")},n.signal.addEventListener("abort",d),c.push(function(){n.signal.removeEventListener("abort",d)});case 5:return r.setState("executing_parallel_operations"),e.next=6,Promise.allSettled([NM(l,t.pack_id,s[0].signal).then(function(e){return r.setState("session_created",e),{success:!0,data:e}}),DM(l,s[1].signal).then(function(e){return r.setState("ai_content_started",e),{success:!0,data:e}})]);case 6:if(p=e.sent,h=pe(p,2),f=h[0],m=h[1],g=[],"rejected"===f.status&&((y=new Error((null===(v=f.reason)||void 0===v?void 0:v.message)||(0,At.__)("Session creation and pack download failed","templately"))).cause="createSessionAndDownloadPack",y.originalError=f.reason,g.push(y)),"rejected"===m.status&&((w=new Error((null===(b=m.reason)||void 0===b?void 0:b.message)||(0,At.__)("AI content modification failed to start","templately"))).cause="startModifyAiContent",w.originalError=m.reason,g.push(w)),!(g.length>0)){e.next=7;break}throw u("Critical operation failed"),g[0];case 7:if(k=f.value.data,E=m.value.data,O=E.is_local_site,!E.process_id){e.next=11;break}return e.prev=8,x=(0,Ci.addQueryArgs)(window.ajaxurl,{action:"templately_pack_import_settings",nonce:window.templately.nonce}),(S=new FormData).append("session_id",l.session_id),S.append("process_id",E.process_id),e.next=9,Sa(x,S);case 9:e.next=11;break;case 10:e.prev=10,D=e.catch(8),Ja("Failed to update session data with process_id:",D);case 11:if(r.setState("both_completed",{sessionResult:k,aiContentResult:E}),r.setState("fetching_preview_content"),(_=null==E?void 0:E.templates)&&0!==Object.keys(_).length){e.next=15;break}return e.prev=12,e.next=13,new Promise(function(e,r){var o=setTimeout(function(){var e=null,t=function(){if(e&&(document.removeEventListener("visibilitychange",e),e=null),window.confirm((0,At.__)("AI content generation is taking longer than expected. Click OK to cancel or Cancel to keep waiting. Credits will still apply.","templately")))return l.cleanup(),void r(new Error((0,At.__)("Polling timeout: AI content generation took too long","templately")))};try{!document.hidden&&l.isActive?t():(e=function(){!document.hidden&&l.isActive&&t()},document.addEventListener("visibilitychange",e))}catch(t){return Ja("Error showing confirmation dialog:",t),void(e&&(document.removeEventListener("visibilitychange",e),e=null))}},FM.POLLING_TIMEOUT),i=t.preview_pages||[],a={};Object.entries(t.ai_page_ids||{}).forEach(function(e){var t=pe(e,2),n=t[0],r=(t[1]||[]).filter(function(e){return i.includes(e)});r.length>0&&(a[n]=r)});var l=zM(k.session_id,E.process_id,a,[],function(){},function(t){clearTimeout(o),Ja("Workflow polling completed successfully"),e(t)},function(e){clearTimeout(o),Ja("Workflow polling failed:",e.message),r(new Error(e.message||(0,At.__)("Polling for AI content failed","templately")))},null==n?void 0:n.signal,O);if(null!=n&&n.signal){var s=function(){clearTimeout(o),null!=l&&l.cleanup&&l.cleanup(),r(new Error((0,At.__)("AI content workflow was cancelled","templately")))};if(n.signal.aborted)return void s();n.signal.addEventListener("abort",s)}});case 13:_=e.sent,e.next=15;break;case 14:throw e.prev=14,I=e.catch(12),new Error(I.message||(0,At.__)("Polling for AI content failed","templately"));case 15:if(_&&0!==Object.keys(_).length){e.next=16;break}throw new Error((0,At.__)("No AI templates were generated","templately"));case 16:return r.setState("polling_complete",{templates:_}),C={isLocalSite:O,session_id:k.session_id,process_id:E.process_id,templates:_||{},pack_downloaded:k.pack_downloaded,ai_page_ids:Object.values(t.AIPageIDs||{}).flat().filter(function(e){return(t.preview_pages||[]).includes(e)})},u("Workflow completed successfully"),clearTimeout(i),r.setState("updating"),r.setState("preparing"),r.setState("workflow_complete",C),e.abrupt("return",C);case 17:if(e.prev=17,L=e.catch(1),clearTimeout(i),!(null!==(P=L.message)&&void 0!==P&&P.includes("timeout")||o.signal.aborted)){e.next=18;break}throw Ja("AI Content Workflow timed out"),(M=new Error((0,At.__)("AI content workflow timed out","templately"))).cause="timeout",r.setState("error",M),M;case 18:if(!("AbortError"===L.name||null!==(T=L.message)&&void 0!==T&&T.includes("cancelled")||null!==(A=L.message)&&void 0!==A&&A.includes("abort"))){e.next=19;break}throw Ja("AI Content Workflow was cancelled"),(N=new Error((0,At.__)("AI content workflow was cancelled","templately"))).cause="cancelled",r.setState("error",N),N;case 19:throw console.error("AI Content Workflow Error:",L),L.cause||(L.cause="workflowGeneral"),r.setState("error",L),L;case 20:case"end":return e.stop()}},e,null,[[1,17],[8,10],[12,14]])}));return function(t){return e.apply(this,arguments)}}(),RM=1e4,jM=2e4,FM={OVERALL_TIMEOUT:3e5,POLLING_TIMEOUT:3e5,PARALLEL_OPERATIONS_TIMEOUT:12e4},zM=function(e,t,n,r,o,i,a){var l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,s=arguments.length>8?arguments[8]:void 0;if(!t||!e||(0,_a.isEmpty)(n))return null==a||a(new Error((0,At.__)("Process ID or page IDs missing","templately"))),null;if(null!=l&&l.aborted)return null==a||a(new Error((0,At.__)("Polling was cancelled","templately"))),null;var c=Date.now(),u=(Date.now(),s?jM:2e3),d=0,p=null,h={},f=!1,m=function(e){var t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return n>0?"".concat(n,"m ").concat(r,"s"):"".concat(t,"s")},g=Object.values(n||{}).flat(),v=g,y={isActive:!0,cleanup:function(){y.isActive=!1,p&&(clearTimeout(p),p=null)}},b=function(){if(s)return Ja("calculateNextInterval: local site, returning ".concat(jM,"ms")),jM;var e=2*(Math.random()-.5)*.05,t=Math.min(u*(1+e),RM);u=Math.min(1.2*u,RM);var n=Math.max(Math.round(t),5e3);return Ja("calculateNextInterval: currentInterval=".concat(u,", jitter=").concat(e.toFixed(3),", interval=").concat(t.toFixed(0),", final=").concat(n,"ms")),n},w=function(){var r=Ei(xi().mark(function r(){var k,E,O,x,S,_,C,P,T,A,M,N,D,I,L,R,j;return xi().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(!y.isActive||null!=l&&l.aborted||f)){r.next=1;break}return r.abrupt("return");case 1:if(f=!0,!(++d>100)){r.next=2;break}return y.cleanup(),k=Date.now()-c,null==a||a(new Error((0,At.__)("Polling timeout: Maximum attempts (".concat(100,") exceeded after ").concat(m(k)),"templately"))),r.abrupt("return");case 2:return Ja("Starting poll attempt ".concat(d)),r.prev=3,O=Date.now(),x=Date.now()-c,Ja("AI polling attempt ".concat(d,", elapsed time: ").concat(m(x))),S=s?"templately_pack_ai_poll_template":"templately_pack_ai_get_json",_=(0,Ci.addQueryArgs)(window.ajaxurl,{action:S,session_id:e,is_lightspeed:!0,nonce:window.templately.nonce}),C={process_id:t,ai_page_ids:n},r.next=4,wa(_,C,{signal:l},!0);case 4:if(P=r.sent,T=Date.now()-O,null==P||!P.success||null===(E=P.data)||void 0===E||!E.templates){r.next=8;break}if(M=AM({},P.data.templates),Object.assign(h,M),v=g.filter(function(e){return!h[e]}),Ja("missing pages: ".concat(v.length," of ").concat(g.length)),Ja("receivedData",h),Object.keys(h).forEach(function(e){(0,_a.isEmpty)(h[e])&&delete h[e]}),null==o||o(h,v),N=null===(A=P.data)||void 0===A?void 0:A.is_last_part,!s||!N){r.next=6;break}if(y.cleanup(),D=Date.now()-c,Ja("AI polling completed (is_last_part=true) after ".concat(d," attempts in ").concat(m(D))),!(v.length>0)){r.next=5;break}return null==a||a(new Error((0,At.__)("AI content generation incomplete: ".concat(v.length," pages still missing when process marked as complete"),"templately"))),r.abrupt("return");case 5:return null==i||i(h,v),r.abrupt("return");case 6:if(0!==v.length){r.next=7;break}return y.cleanup(),I=Date.now()-c,Ja("AI polling completed after ".concat(d," attempts in ").concat(m(I))),null==i||i(h,v),r.abrupt("return");case 7:Object.keys(M).length>0&&(Date.now(),s||(u=2e3)),!s&&T>3e3&&(u=Math.min(1.5*u,RM)),r.next=9;break;case 8:if(null!=P&&P.success){r.next=9;break}return y.cleanup(),null==a||a(new Error((null==P?void 0:P.data)||(0,At.__)("Polling failed","templately"))),r.abrupt("return");case 9:r.next=12;break;case 10:if(r.prev=10,!("AbortError"===(j=r.catch(3)).name||null!=l&&l.aborted)){r.next=11;break}return Ja("AI polling was cancelled"),y.cleanup(),null==a||a(new Error((0,At.__)("Polling was cancelled","templately"))),r.abrupt("return");case 11:L=Date.now()-c,Ja("AI polling attempt ".concat(d," failed after ").concat(m(L),":"),j.message),!s&&j.status>=500&&(u=Math.min(2*u,RM));case 12:f=!1,!y.isActive||null!=l&&l.aborted?Ja("Polling stopped: active=".concat(y.isActive,", aborted=").concat(null==l?void 0:l.aborted)):(R=b(),Ja("Scheduling next poll in ".concat(R,"ms (attempt ").concat(d+1,")")),p=setTimeout(w,R));case 13:case"end":return r.stop()}},r,null,[[3,10]])}));return function(){return r.apply(this,arguments)}}();if(l){var k=function(){y.cleanup(),null==a||a(new Error((0,At.__)("Polling was cancelled","templately")))};l.addEventListener("abort",k);var E=y.cleanup;y.cleanup=function(){E(),l.removeEventListener("abort",k)}}return w(),y},BM=function(e){return function(e){var t={};return e&&(0,_a.isArray)(e)?(e.forEach(function(e){var n,r=e.id,o=e.source,i=e.original,a=e.replace;t[r]={originalUrl:i.url,newUrl:null!==(n=a.src.large2x)&&void 0!==n?n:a.src.large,source:o,newData:{id:a.id,alt:a.alt,provider:a.provider,photographer:a.photographer,width:a.width,height:a.height,original:a.src.original,medium:a.src.medium}}}),t):t}(e)};function WM(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 UM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?WM(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const VM=window.wp.mediaUtils,HM=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",fill:"none",viewBox:"0 0 12 13"},oe.createElement("g",{stroke:"#949DA8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.8",clipPath:"url(#clip0_15476_9513)"},oe.createElement("path",{d:"M1.8 5.363a3.5 3.5 0 1 0 7 0 3.5 3.5 0 0 0-7 0M10.2 10.263l-2.4-2.4"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_15476_9513"},oe.createElement("path",{fill:"#fff",d:"M0 .064h12v12H0z"}))))},qM=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},oe.createElement("g",{fill:"#4488C2",clipPath:"url(#clip0_16188_9300)"},oe.createElement("path",{d:"M12.153 8.906a2.448 2.448 0 1 0 0 4.897 2.448 2.448 0 0 0 0-4.897m0 3.73a1.282 1.282 0 1 1 0-2.564 1.282 1.282 0 0 1 0 2.565"}),oe.createElement("path",{d:"M21.917 3.31 6.005 1.501a2.19 2.19 0 0 0-1.72.496c-.476.369-.781.916-.845 1.515l-.292 2.39h-.903C.963 5.903 0 7.04 0 8.322v11.92a2.215 2.215 0 0 0 2.244 2.273h16c1.282 0 2.448-.99 2.448-2.273v-.466a2.9 2.9 0 0 0 1.108-.467 2.42 2.42 0 0 0 .845-1.573l1.34-11.833a2.36 2.36 0 0 0-2.069-2.594m-2.39 16.932c0 .641-.64 1.107-1.282 1.107h-16a1.05 1.05 0 0 1-1.078-1.107v-2.157l4.517-3.322a1.4 1.4 0 0 1 1.807.087l3.177 2.798a2.74 2.74 0 0 0 1.72.641c.492.006.976-.125 1.398-.379l5.742-3.322zm0-7.024-6.353 3.702a1.49 1.49 0 0 1-1.72-.146L8.25 13.947a2.594 2.594 0 0 0-3.235-.117l-3.847 2.798V8.322c0-.641.437-1.253 1.078-1.253h16a1.34 1.34 0 0 1 1.282 1.253zm3.295-7.472-.001.011-1.37 11.833a.99.99 0 0 1-.379.787c-.116.116-.379.175-.379.233V8.322a2.506 2.506 0 0 0-2.448-2.419H4.315l.261-2.273a1.34 1.34 0 0 1 .438-.758 1.34 1.34 0 0 1 .874-.233l15.884 1.836c.64.06 1.11.63 1.05 1.27"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_16188_9300"},oe.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"}))))},QM=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},oe.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2",clipPath:"url(#clip0_15476_9537)"},oe.createElement("path",{d:"M2 4.665a1.333 1.333 0 0 1 1.333-1.333h9.334A1.333 1.333 0 0 1 14 4.665v6.667a1.333 1.333 0 0 1-1.333 1.333H3.333A1.333 1.333 0 0 1 2 11.332z"}),oe.createElement("path",{d:"M4.666 8V6h2M11.334 8v2h-2"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_15476_9537"},oe.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"}))))},$M=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},oe.createElement("g",{clipPath:"url(#clip0_15476_9545)"},oe.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2",d:"M8.002 11.331h-2v-2m2-4.666h2v2m-5.335 7.333a1.333 1.333 0 0 1-1.333-1.333V3.33a1.333 1.333 0 0 1 1.333-1.333h6.667a1.333 1.333 0 0 1 1.333 1.333v9.334a1.333 1.333 0 0 1-1.333 1.333z"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_15476_9545"},oe.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"}))))},GM=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},oe.createElement("g",{clipPath:"url(#clip0_15476_9551)"},oe.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2",d:"M8.001 10.778H5.86V9.11M8 5.222h2.143V6.89M4.43 13c-.38 0-.743-.117-1.01-.325-.268-.209-.419-.491-.419-.786V4.11c0-.295.15-.577.418-.786A1.66 1.66 0 0 1 4.428 3h7.143c.38 0 .743.117 1.01.325.269.209.419.491.419.786v7.778c0 .295-.15.577-.418.786a1.66 1.66 0 0 1-1.01.325z"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_15476_9551"},oe.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"}))))},YM=o.p+"images/image-placeholder.png",XM=o.p+"images/arrow-no-selected-image.png",KM=o.p+"images/ai-generated-image-placeholder.png";var ZM=ae().memo(function(e){var t=e.children,n=e.content,r=e.disabled;return void 0!==r&&r?t:ae().createElement(xM,null,ae().createElement(SM,{asChild:!0},t),ae().createElement(_M,null,ae().createElement(CM,{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ratio-popover",sideOffset:3,align:"end"},n)))});const JM=ZM;var eN={low:0,max:0,high:0,C:2,P:void 0,R:void 0,L:void 0,list:void 0};function tN(e){var t=e.high;e.L===eN&&e.R===eN?e.max=t:e.L===eN?e.max=Math.max(e.R.max,t):e.R===eN?e.max=Math.max(e.L.max,t):e.max=Math.max(Math.max(e.L.max,e.R.max),t)}function nN(e){for(var t=e;t.P!==eN;)tN(t.P),t=t.P}function rN(e,t){if(t.R!==eN){var n=t.R;t.R=n.L,n.L!==eN&&(n.L.P=t),n.P=t.P,t.P===eN?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.L=t,t.P=n,tN(t),tN(n)}}function oN(e,t){if(t.L!==eN){var n=t.L;t.L=n.R,n.R!==eN&&(n.R.P=t),n.P=t.P,t.P===eN?e.root=n:t===t.P.R?t.P.R=n:t.P.L=n,n.R=t,t.P=n,tN(t),tN(n)}}function iN(e,t,n){t.P===eN?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.P=t.P}eN.P=eN,eN.L=eN,eN.R=eN;const aN=e=>{const t=oe.useRef(e);return oe.useEffect(()=>{t.current=e}),t},lN=(e,t=100,n=!1)=>{const r=aN(e),o=oe.useRef(),i=[t,n,r];function a(){o.current&&clearTimeout(o.current),o.current=void 0}function l(){o.current=void 0}return oe.useEffect(()=>a,i),oe.useCallback(function(){const e=arguments,{current:i}=o;if(void 0===i&&n)return o.current=setTimeout(l,t),r.current.apply(null,e);i&&clearTimeout(i),o.current=setTimeout(()=>{o.current=void 0,r.current.apply(null,e)},t)},i)},sN=function(e,t,n,r){const o=oe.useRef(n),i=oe.useRef(r);oe.useEffect(()=>{o.current=n,i.current=r}),oe.useEffect(()=>{const n=e&&"current"in e?e.current:e;if(!n)return;let r=0;function a(...e){r||o.current.apply(this,e)}n.addEventListener(t,a);const l=i.current;return()=>{r=1,n.removeEventListener(t,a),l&&l()}},[e,t])},cN={},uN="undefined"==typeof window?null:window,dN=uN&&void 0!==uN.visualViewport?uN.visualViewport:null,pN=()=>[document.documentElement.clientWidth,document.documentElement.clientHeight],hN=(e,t)=>{const n=t||fN;let r,o;return function(){return r&&n(arguments,r)?o:o=e.apply(null,r=arguments)}},fN=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3],mN=class{constructor(){let e,t;this.set=void 0,this.get=void 0,this.get=n=>n===e?t:void 0,this.set=(n,r)=>{e=n,t=r}}},gN=e=>{try{return new e}catch(e){const t={};return{set(e,n){t[e]=n},get:e=>t[e]}}},vN=(e,t)=>{let n;const{g:r,s:o}=(e=>{const t=e.length,n=gN(e[0]);let r,o,i,a;const l=1===t;return t<3?{g:e=>void 0===(r=n.get(e[0]))||l?r:r.get(e[1]),s:(t,i)=>(l?n.set(t[0],i):void 0===(r=n.get(t[0]))?(o=gN(e[1]),o.set(t[1],i),n.set(t[0],o)):r.set(t[1],i),i)}:{g:e=>{for(a=n,i=0;i<t;i++)if(void 0===(a=a.get(e[i])))return;return a},s:(r,l)=>{for(a=n,i=0;i<t-1;i++)void 0===(o=a.get(r[i]))?(o=gN(e[i+1]),a.set(r[i],o),a=o):a=o;return a.set(r[t-1],l),l}}})(e);return function(){return void 0===(n=r(arguments))?o(arguments,t.apply(null,arguments)):n}};var yN=new WeakMap;function bN(){var e=oe.useState(wN)[1];return oe.useRef(function(){return e({})}).current}var wN={},kN="0",EN=vN([mN,{},WeakMap,mN],function(e,t,n,r){return oe.createElement(e,{index:t,data:n,width:r})}),ON=hN(function(e){return{position:"relative",width:"100%",maxWidth:"100%",height:Math.ceil(e),maxHeight:Math.ceil(e)}}),xN=function(e,t){return e[0]===t[0]&&e[1]===t[1]},SN=hN(function(e,t){return Object.assign({},e,t)},xN);function _N(e,t){return t}var CN=hN(function(e){return{width:e,zIndex:-1e3,visibility:"hidden",position:"absolute",writingMode:"horizontal-tb"}},function(e,t){return e[0]===t[0]}),PN=hN(function(e,t){return function(n){return function(r){null!==r&&(t&&(t.observe(r),yN.set(r,n)),void 0===e.get(n)&&e.set(n,r.offsetHeight))}}},xN);let TN="undefined",AN=typeof window!==TN?window:{},MN=typeof performance!==TN?performance:Date,NN=()=>MN.now(),DN="AnimationFrame",IN="cancel"+DN,LN="request"+DN,RN=AN[LN]&&AN[LN].bind(AN),jN=AN[IN]&&AN[IN].bind(AN);if(!RN||!jN){let e=0;RN=t=>{let n=NN(),r=Math.max(e+1e3/60,n);return setTimeout(()=>{t(e=r)},r-n)},jN=function(e){return clearTimeout(e)}}const FN="undefined"!=typeof performance?performance:Date;function zN(e,t=30,n=!1){const r=aN(e),o=1e3/t,i=oe.useRef(0),a=oe.useRef(),l=()=>a.current&&clearTimeout(a.current),s=[t,n,r];function c(){i.current=0,l()}return oe.useEffect(()=>c,s),oe.useCallback(function(){const e=arguments,t=FN.now(),s=()=>{i.current=t,l(),r.current.apply(null,e)},c=i.current;if(n&&0===c)return s();if(t-c>o){if(c>0)return s();i.current=t}l(),a.current=setTimeout(()=>{s(),i.current=0},o)},s)}const BN="undefined"==typeof window?null:window,WN=()=>void 0!==BN.scrollY?BN.scrollY:void 0===BN.pageYOffset?0:BN.pageYOffset;function UN(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2?arguments[2]:void 0,r=((e=30)=>{const t=function(e,t){const n=oe.useState(e);return[n[0],zN(n[1],t,!0)]}("undefined"==typeof window?0:WN,e);return sN(BN,"scroll",()=>t[1](WN())),t[0]})(t),o=pe(oe.useState(0),2),i=o[0],a=o[1],l=pe(oe.useState(!1),2),s=l[0],c=l[1],u=oe.useRef(0),d=n&&"current"in n,p=d?i:r;return oe.useEffect(function(){if(d){var e=n.current;if(e){var t,r=function(){t||(t=requestAnimationFrame(function(){a(e.scrollTop),t=0}))};return a(e.scrollTop),e.addEventListener("scroll",r,{passive:!0}),function(){e.removeEventListener("scroll",r),t&&cancelAnimationFrame(t)}}}},[n,t,d]),oe.useEffect(function(){1===u.current&&c(!0);var e=!1,n=((e,t)=>{const n=NN(),r={},o=()=>{NN()-n>=t?e.call(null):r.v=RN(o)};return r.v=RN(o),r})(function(){e||c(!1)},40+1e3/t);return u.current=1,function(){e=!0,jN(n.v||-1)}},[t,p]),{scrollTop:Math.max(0,p-e),isScrolling:s}}function VN(e){var t=UN(0,12,e.containerRef);return function(e){var t,n=e.positioner,r=e.resizeObserver,o=e.items,i=e.as,a=void 0===i?"div":i,l=e.id,s=e.className,c=e.style,u=e.role,d=void 0===u?"grid":u,p=e.tabIndex,h=void 0===p?0:p,f=e.containerRef,m=e.itemAs,g=void 0===m?"div":m,v=e.itemStyle,y=e.itemHeightEstimate,b=void 0===y?300:y,w=e.itemKey,k=void 0===w?_N:w,E=e.scrollTop,O=e.height,x=void 0===O?600:O,S=e.overscanBy,_=void 0===S?2:S,C=e.render,P=e.onRender,T=bN(),A=PN(n,r),M=o.length,N=n.columnWidth,D=n.estimateHeight,I=[],L="list"===d?"listitem":"grid"===d?"gridcell":void 0,R=aN(P),j=0,F=x*_,z=Math.max(0,E-F/2),B=E+x+F;n.range(z,B,function(e){void 0===t?(j=e,t=e):(j=Math.min(j,e),t=Math.max(t,e))});for(var W=0;W<M;W++){var U=o[W],V=k(U,W),H=n.get(W);if(H){var q={top:H.top,left:H.left,width:N,writingMode:"horizontal-tb",position:"absolute"};I.push(oe.createElement(g,{key:V,ref:A(W),role:L,style:"object"===ne(v)&&null!==v?Object.assign({},q,v):q},EN(C,W,U,N)))}else{var Q=CN(N);I.push(oe.createElement(g,{key:V,ref:A(W),role:L,style:"object"===ne(v)?Object.assign({},Q,v):Q},EN(C,W,U,N)))}}oe.useEffect(function(){"function"==typeof R.current&&void 0!==t&&R.current(j,t,o),kN="1"},[j,t,o,R]),oe.useEffect(function(){T()},[n]);var $=ON(D(M,b));return oe.createElement(a,{ref:f,key:kN,id:l,role:d,className:s,tabIndex:h,style:"object"===ne(c)?SN($,c):$,children:I})}({scrollTop:t.scrollTop,isScrolling:t.isScrolling,positioner:e.positioner,resizeObserver:e.resizeObserver,items:e.items,onRender:e.onRender,as:e.as,id:e.id,className:e.className,style:e.style,role:e.role,tabIndex:e.tabIndex,containerRef:e.containerRef,itemAs:e.itemAs,itemStyle:e.itemStyle,itemHeightEstimate:e.itemHeightEstimate,itemKey:e.itemKey,render:e.render})}const HN=ae()["undefined"!=typeof document&&void 0!==document.createElement?"useLayoutEffect":"useEffect"];var qN=[],QN=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,o=function(){var e={root:eN,size:0},t={};return{insert:function(n,r,o){for(var i=e.root,a=eN;i!==eN&&n!==(a=i).low;)i=n<i.low?i.L:i.R;if(n===a.low&&a!==eN){if(!function(e,t,n){for(var r,o=e.list;o;){if(o.index===n)return!1;if(t>o.high)break;r=o,o=o.next}return r||(e.list={index:n,high:t,next:o}),r&&(r.next={index:n,high:t,next:r.next}),!0}(a,r,o))return;return a.high=Math.max(a.high,r),tN(a),nN(a),t[o]=a,void e.size++}var l={low:n,high:r,max:r,C:0,P:a,L:eN,R:eN,list:{index:o,high:r,next:null}};a===eN?e.root=l:(l.low<a.low?a.L=l:a.R=l,nN(l)),function(e,t){for(var n;0===t.P.C;)t.P===t.P.P.L?0===(n=t.P.P.R).C?(t.P.C=1,n.C=1,t.P.P.C=0,t=t.P.P):(t===t.P.R&&rN(e,t=t.P),t.P.C=1,t.P.P.C=0,oN(e,t.P.P)):0===(n=t.P.P.L).C?(t.P.C=1,n.C=1,t.P.P.C=0,t=t.P.P):(t===t.P.L&&oN(e,t=t.P),t.P.C=1,t.P.P.C=0,rN(e,t.P.P));e.root.C=1}(e,l),t[o]=l,e.size++},remove:function(n){var r=t[n];if(void 0!==r){delete t[n];var o=function(e,t){var n=e.list;if(n.index===t)return null===n.next?0:(e.list=n.next,1);var r=n;for(n=n.next;null!==n;){if(n.index===t)return r.next=n.next,1;r=n,n=n.next}}(r,n);if(void 0!==o){if(1===o)return r.high=r.list.high,tN(r),nN(r),void e.size--;var i,a=r,l=a.C;r.L===eN?(i=r.R,iN(e,r,r.R)):r.R===eN?(i=r.L,iN(e,r,r.L)):(a=function(e){for(;e.L!==eN;)e=e.L;return e}(r.R),l=a.C,i=a.R,a.P===r?i.P=a:(iN(e,a,a.R),a.R=r.R,a.R.P=a),iN(e,r,a),a.L=r.L,a.L.P=a,a.C=r.C),tN(i),nN(i),1===l&&function(e,t){for(var n;t!==eN&&1===t.C;)t===t.P.L?(0===(n=t.P.R).C&&(n.C=1,t.P.C=0,rN(e,t.P),n=t.P.R),1===n.L.C&&1===n.R.C?(n.C=0,t=t.P):(1===n.R.C&&(n.L.C=1,n.C=0,oN(e,n),n=t.P.R),n.C=t.P.C,t.P.C=1,n.R.C=1,rN(e,t.P),t=e.root)):(0===(n=t.P.L).C&&(n.C=1,t.P.C=0,oN(e,t.P),n=t.P.L),1===n.R.C&&1===n.L.C?(n.C=0,t=t.P):(1===n.L.C&&(n.R.C=1,n.C=0,rN(e,n),n=t.P.L),n.C=t.P.C,t.P.C=1,n.L.C=1,oN(e,t.P),t=e.root));t.C=1}(e,i),e.size--}}},search:function(t,n,r){for(var o=[e.root];0!==o.length;){var i=o.pop();if(!(i===eN||t>i.max)&&(i.L!==eN&&o.push(i.L),i.R!==eN&&o.push(i.R),i.low<=n&&i.high>=t))for(var a=i.list;null!==a;)a.high>=t&&r(a.index,i.low),a=a.next}},get size(){return e.size}}}(),i=new Array(e),a=[],l=new Array(e),s=0;s<e;s++)i[s]=0,l[s]=[];return{columnCount:e,columnWidth:t,set:function(e){for(var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=0,u=1;u<i.length;u++)i[u]<i[c]&&(c=u);var d=i[c]||0;i[c]=d+s+r,l[c].push(e),a[e]={left:c*(t+n),top:d,height:s,column:c},o.insert(d,d+s,e)},get:function(e){return a[e]},update:function(t){for(var n=new Array(e),s=0,c=0;s<t.length-1;s++){var u=t[s],d=a[u];d.height=t[++s],o.remove(u),o.insert(d.top,d.top+d.height,u),n[d.column]=void 0===n[d.column]?u:Math.min(u,n[d.column])}for(s=0;s<n.length;s++)if(void 0!==n[s]){var p=l[s],h=$N(p,n[s]),f=l[s][h],m=a[f];for(i[s]=m.top+m.height+r,c=h+1;c<p.length;c++){var g=p[c],v=a[g];v.top=i[s],i[s]=v.top+v.height+r,o.remove(g),o.insert(v.top,v.top+v.height,g)}}},range:function(e,t,n){return o.search(e,t,function(e,t){return n(e,a[e].left,t)})},estimateHeight:function(t,n){var r=Math.max(0,Math.max.apply(null,i));return t===o.size?r:r+Math.ceil((t-o.size)/e)*n},shortestColumn:function(){return i.length>1?Math.min.apply(null,i):i[0]||0},size:function(){return o.size},all:function(){return a}}},$N=function(e,t){for(var n=0,r=e.length-1;n<=r;){var o=n+r>>>1,i=e[o];if(i===t)return o;i<=t?n=o+1:r=o-1}return-1},GN=[];const YN=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t=o,n||(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};YN(function(e){});var XN=vN([WeakMap],function(e,t){var n=[],r=YN(function(){n.length>0&&(e.update(n),t(n)),n.length=0}),o=function(t){var o=t.offsetHeight;if(o>0){var i=yN.get(t);if(void 0!==i){var a=e.get(i);void 0!==a&&o!==a.height&&n.push(i,o)}}r()},i=new Map,a=new ResizeObserver(function(e){for(var t=0;t<e.length;t++){var n=e[t],r=yN.get(n.target);if(void 0!==r){var a=i.get(r);a||(a=YN(o),i.set(r,a)),a(n.target)}}}),l=a.disconnect.bind(a);return a.disconnect=function(){l(),i.forEach(function(e){e.cancel()})},a}),KN={index:void 0,position:void 0,prevTop:void 0};function ZN(e){var t,n,r,o=oe.useRef(null),i=e.containerRef||o,a=function(e){void 0===e&&(e=cN);const{wait:t,leading:n,initialWidth:r=0,initialHeight:o=0}=e,[i,a]=((e,t,n)=>{const r=oe.useState(e);return[r[0],lN(r[1],t,n)]})("undefined"==typeof document?[r,o]:pN,t,n),l=()=>a(pN);return sN(uN,"resize",l),sN(dN,"resize",l),sN(uN,"orientationchange",l),i}({initialWidth:e.ssrWidth,initialHeight:e.ssrHeight}),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qN,n=pe(oe.useState({offset:0,width:0}),2),r=n[0],o=n[1];return HN(function(){var t=e.current;if(null!==t){var n=0,i=t;do{n+=i.offsetTop||0,i=i.offsetParent}while(i);n===r.offset&&t.offsetWidth===r.width||o({offset:n,width:t.offsetWidth})}},t),r}(i,a),s=Object.assign({width:l.width||a[0],height:a[1],containerRef:i},e);s.positioner=function(e){var t=e.width,n=e.columnWidth,r=void 0===n?200:n,o=e.columnGutter,i=void 0===o?0:o,a=e.rowGutter,l=e.columnCount,s=e.maxColumnCount,c=e.maxColumnWidth,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:GN,d=function(){var e=pe(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0;r=r||Math.min(Math.floor((e+n)/(t+n)),o||1/0)||1;var a=Math.floor((e-n*(r-1))/r);return void 0!==i&&a>i&&(a=i),[a,r]}(t,r,i,l,s,c),2),n=e[0],o=e[1];return QN(o,n,i,null!=a?a:i)},p=oe.useRef();void 0===p.current&&(p.current=d());var h=oe.useRef(u),f=[t,r,i,a,l,s,c],m=oe.useRef(f),g=!f.every(function(e,t){return m.current[t]===e});if(g||!u.every(function(e,t){return h.current[t]===e})){var v=p.current,y=d();if(h.current=u,m.current=f,g)for(var b=v.size(),w=0;w<b;w++){var k=v.get(w);y.set(w,void 0!==k?k.height:0)}p.current=y}return p.current}(s),s.resizeObserver=(t=s.positioner,n=bN(),r=XN(t,n),oe.useEffect(function(){return function(){return r.disconnect()}},[r]),r);var c=function(e,t){var n,r=t.align,o=void 0===r?"top":r,i=t.element,a=void 0===i?"undefined"!=typeof window&&window:i,l=t.offset,s=void 0===l?0:l,c=t.height,u=void 0===c?"undefined"!=typeof window?window.innerHeight:0:c,d=oe.useCallback(function(){if(u&&u>0)return u;var e=a&&"current"in a?a.current:a;return e&&e!==window&&"clientHeight"in e?e.clientHeight:"undefined"!=typeof window?window.innerHeight:0},[u,a]),p=aN({positioner:e,element:a,align:o,offset:s,height:u}),h=oe.useRef(function(){var e=p.current.element;return e&&"current"in e?e.current:e}).current,f=pe(oe.useReducer(function(e,t){var n,r={position:e.position,index:e.index,prevTop:e.prevTop};if("scrollToIndex"===t.type)return{position:p.current.positioner.get(null!==(n=t.value)&&void 0!==n?n:-1),index:t.value,prevTop:void 0};if("setPosition"===t.type)r.position=t.value;else if("setPrevTop"===t.type)r.prevTop=t.value;else if("reset"===t.type)return KN;return r},KN),2),m=f[0],g=f[1],v=zN(g,15),y=h();sN(y,"scroll",function(){if(!m.position&&m.index){var e=p.current.positioner.get(m.index);e&&g({type:"setPosition",value:e})}});var b=void 0!==m.index&&(null===(n=p.current.positioner.get(m.index))||void 0===n?void 0:n.top);return oe.useEffect(function(){var e=h();if(e){var t=p.current,n=t.align,r=t.offset,o=t.positioner,i=d();if(m.position){var a=m.position.top;"bottom"===n?a=a-i+m.position.height:"center"===n&&(a-=(i-m.position.height)/2),e.scrollTo(0,Math.max(0,a+=r));var l=!1,s=setTimeout(function(){return!l&&g({type:"reset"})},400);return function(){l=!0,clearTimeout(s)}}if(void 0!==m.index){var c=o.shortestColumn()/o.size()*m.index;m.prevTop&&(c=Math.max(c,m.prevTop+i)),e.scrollTo(0,c),v({type:"setPrevTop",value:c})}}},[b,m,p,h,v,d]),oe.useRef(function(e){g({type:"scrollToIndex",value:e})}).current}(s.positioner,{offset:l.offset,align:"object"===ne(e.scrollToIndex)?e.scrollToIndex.align:void 0,element:i}),u=e.scrollToIndex&&("number"==typeof e.scrollToIndex?e.scrollToIndex:e.scrollToIndex.index);return oe.useEffect(function(){void 0!==u&&c(u)},[u,c]),oe.createElement(VN,s)}var JN=function(e,t){return void 0!==t[e]},eD={};const tD=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 14 14"},oe.createElement("path",{stroke:"#737A85",d:"M1.91 8.923c-.495-.644-.743-.966-.743-1.922 0-.957.248-1.279.744-1.923C2.9 3.792 4.56 2.334 7 2.334S11.1 3.792 12.09 5.078c.496.644.744.966.744 1.923 0 .956-.248 1.278-.744 1.922-.99 1.286-2.65 2.744-5.09 2.744S2.9 10.21 1.91 8.923Z"}),oe.createElement("path",{stroke:"#737A85",d:"M8.75 7a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0Z"}))},nD=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 14 14"},oe.createElement("g",{stroke:"#737A85",strokeLinecap:"round",strokeLinejoin:"round",clipPath:"url(#clip0_15476_12003)"},oe.createElement("path",{d:"M11.666 6.416A4.724 4.724 0 0 0 2.625 5.25m-.292-2.334V5.25h2.333M2.333 7.584a4.725 4.725 0 0 0 9.042 1.167m.291 2.333V8.751H9.333"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_15476_12003"},oe.createElement("path",{fill:"#fff",d:"M0 0h14v14H0z"}))))},rD=function(e){var t=e.isOpen,n=e.image,r=e.setIsOpen;return ae().createElement(ae().Fragment,null,t?ae().createElement(e_,{enableZoom:!1,wrapperClassName:"templately-ai-lightbox-wrapper",reactModalProps:{style:{overlay:{position:"initial",inset:"0px"},content:{position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",border:"none",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"0px",outline:"none",padding:"0px",zIndex:"100002"}},parentSelector:function(){return document.querySelector(".templately-container")}},mainSrc:null==n?void 0:n.url,onCloseRequest:function(){return r(!1)}}):"")},oD=function(e){var t=e.searchResults,n=e.isSearchLoading,r=e.searchError,o=e.onImageSelect,i=e.selectedImageId,a=e.perPage,l=e.totalPages,s=e.onLoadMore,c=ae().useRef(null),u=pe((0,oe.useState)(!1),2),d=u[0],p=u[1],h=pe((0,oe.useState)([]),2),f=h[0],m=h[1],g=ae().memo(function(e){var t,n,r,i,a=e.data,l=e.width,s=ae().useMemo(function(){var e=a.width,t=a.height;if(e&&t&&l){var n=l/(e/t);if(n)return{width:l,height:n}}return{}},[a.width,a.height,l]),c=ae().useMemo(function(){var e,t,n,r;return null!==(e=null!==(t=null==a||null===(n=a.src)||void 0===n?void 0:n.medium)&&void 0!==t?t:null==a||null===(r=a.src)||void 0===r?void 0:r.original)&&void 0!==e?e:null==a?void 0:a.url},[null==a||null===(t=a.src)||void 0===t?void 0:t.medium,null==a||null===(n=a.src)||void 0===n?void 0:n.original,null==a?void 0:a.url]);return ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-images-outer-wrapper"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-images-wrapper"},ae().createElement("img",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-image",src:c,alt:null!==(r=null!==(i=null==a?void 0:a.title)&&void 0!==i?i:null==a?void 0:a.alt)&&void 0!==r?r:"",style:s}),ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-image-overlay"},ae().createElement("button",{type:"button",onClick:function(e){var t,n,r,o,i,l,s,c,u;return s=e,c=null!==(t=null!==(n=null==a||null===(r=a.src)||void 0===r?void 0:r.original)&&void 0!==n?n:null==a?void 0:a.url)&&void 0!==t?t:null==a||null===(o=a.src)||void 0===o?void 0:o.medium,u=null!==(i=null!==(l=null==a?void 0:a.title)&&void 0!==l?l:null==a?void 0:a.alt)&&void 0!==i?i:"",s.preventDefault(),s.stopPropagation(),void(c&&(m({url:c,alt:u||"Original Image"}),p(!0)))},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-image-overlay-button templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-image-overlay-button-eye"},ae().createElement(tD,null)),ae().createElement("button",{type:"button",onClick:function(e){var t=0;e.metaKey&&e.shiftKey?t=1:e.altKey&&e.shiftKey?t=2:e.metaKey&&(t=3),o(a,"stock",void 0,t)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-image-overlay-button"},ae().createElement(nD,null),(0,At.__)("Use This Image","templately")))),(null==a?void 0:a.provider)&&ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-image-provider"},"by ",ae().createElement("a",{href:a.url,target:"_blank"},null==a?void 0:a.provider)))},function(e,t){var n,r,o,i;return e.data.id===t.data.id&&(null===(n=e.data.src)||void 0===n?void 0:n.medium)===(null===(r=t.data.src)||void 0===r?void 0:r.medium)&&(null===(o=e.data.src)||void 0===o?void 0:o.original)===(null===(i=t.data.src)||void 0===i?void 0:i.original)&&e.data.url===t.data.url&&e.width===t.width}),v=(0,oe.useCallback)((0,_a.debounce)(function(){var e=Ei(xi().mark(function e(t,r,o){var c;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i&&!n){e.next=1;break}return e.abrupt("return");case 1:if(void 0===o[r]){e.next=2;break}return e.abrupt("return");case 2:if(c=Math.floor(r/a)+1,!(l>0&&c>l)){e.next=3;break}return e.abrupt("return");case 3:if(!s){e.next=4;break}return e.next=4,s(c);case 4:case"end":return e.stop()}},e)}));return function(_x,t,n){return e.apply(this,arguments)}}(),300),[i,n,a,l,s]);(0,oe.useEffect)(function(){return function(){v.cancel()}},[v]);var y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eD,n=t.isItemLoaded,r=t.minimumBatchSize,o=void 0===r?16:r,i=t.threshold,a=void 0===i?16:i,l=t.totalItems,s=void 0===l?9e9:l,c=aN(e),u=aN(n);return oe.useCallback(function(e,t,n){for(var r=function(){for(var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:JN,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,o=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:9e9,a=arguments.length>5?arguments[5]:void 0,l=[],s=arguments.length>4?arguments[4]:void 0;s<=a;s++)n(s,o)?void 0!==e&&void 0!==t&&(l.push(e,t),e=t=void 0):(t=s,void 0===e&&(e=s));if(void 0!==e&&void 0!==t){var c=Math.min(Math.max(t,e+r-1),i-1);for(s=t+1;s<=c&&!n(s,o);s++)t=s;l.push(e,t)}if(l.length)for(var u=l[0],d=l[1];d-u+1<r&&u>0;){var p=u-1;if(n(p,o))break;l[0]=u=p}return l}(u.current,o,n,s,Math.max(0,e-a),Math.min(s-1,(t||0)+a)),i=0;i<r.length-1;++i)c.current(r[i],r[++i],n)},[s,o,a,c,u])}(v,{isItemLoaded:function(e,t){return!!t[e]},minimumBatchSize:a,threshold:a});return n&&0===t.length?ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-loading"},ae().createElement("p",null,(0,At.__)("Searching for images...","templately"))):r?ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-error"},ae().createElement("p",null,r)):0===t.length?ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-error"},ae().createElement("p",null,(0,At.__)("No image found","templately"))):ae().createElement(ae().Fragment,null,ae().createElement(ZN,{containerRef:c,className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-images-grid",items:t,columnGutter:12,columnCount:2,columnWidth:150,render:g,onRender:y,shouldUpdateItem:function(e,t){var n,r,o,i;return e.id!==t.id||(null===(n=e.src)||void 0===n?void 0:n.medium)!==(null===(r=t.src)||void 0===r?void 0:r.medium)||(null===(o=e.src)||void 0===o?void 0:o.original)!==(null===(i=t.src)||void 0===i?void 0:i.original)||e.url!==t.url}}),d&&ae().createElement(rD,{isOpen:d,image:f,setIsOpen:p}))},iD=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 14 14"},oe.createElement("g",{clipPath:"url(#clip0_15476_12009)"},oe.createElement("path",{stroke:"#737A85",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.167",d:"M5.25 6.417 2.917 8.751m0 0 2.333 2.333M2.917 8.751h6.417a2.333 2.333 0 0 0 0-4.667H8.75"})),oe.createElement("defs",null,oe.createElement("clipPath",{id:"clip0_15476_12009"},oe.createElement("path",{fill:"#fff",d:"M0 0h14v14H0z"}))))};var aD=ae().memo(function(e){var t=e.defaultImages,n=e.modifiedImages,r=e.selectedImageId,o=e.onImageReplace,i=e.onImageUndo,a=e.aiSidebarContext,l=(0,oe.useRef)(null),s=pe((0,oe.useState)(0),2),c=s[0],u=s[1],d=pe((0,oe.useState)(!1),2),p=d[0],h=d[1],f=pe((0,oe.useState)({}),2),m=f[0],g=f[1],v=(0,oe.useMemo)(function(){var e=new Map;return n.forEach(function(t){e.set(t.id,t)}),e},[n]);(0,oe.useEffect)(function(){var e=document.querySelector(".templately-fsi-ai-sidebar");if(e){var t=function(t){t.target===e&&"max-width"===t.propertyName&&u(function(e){return e+1})};return e.addEventListener("transitionend",t),function(){e.removeEventListener("transitionend",t)}}},[]),(0,oe.useEffect)(function(){var e=setTimeout(function(){u(function(e){return e+1})},120);return function(){return clearTimeout(e)}},[null==a?void 0:a.expanded]);var y=ae().memo(function(e){var t,n=e.data,r=e.width,o=e.index,i=e.selectedImageId,a=e.modifiedImagesMap,l=e.onImageReplace,s=e.onImageUndo,c=(0,oe.useMemo)(function(){var e,t,r,o,i,l,s,c,u,d,p,h=null!==(e=null==n?void 0:n.medium_url)&&void 0!==e?e:null==n?void 0:n.url,f=a.get(n.id),m=null==f?void 0:f.replace,g=!!f,v=null!==(t=null!==(r=null==m||null===(o=m.src)||void 0===o?void 0:o.medium)&&void 0!==r?r:null==m||null===(i=m.src)||void 0===i?void 0:i.original)&&void 0!==t?t:null==m?void 0:m.url,y=null!==(l=null!==(s=null==m||null===(c=m.src)||void 0===c?void 0:c.original)&&void 0!==s?s:null==m?void 0:m.url)&&void 0!==l?l:null==m||null===(u=m.src)||void 0===u?void 0:u.medium,b=g?v:h,w=g?y:null!==(d=n.url)&&void 0!==d?d:n.medium_url;return{finalImageSrc:b,finalImageAlt:g?null==m?void 0:m.alt:null!==(p=null==n?void 0:n.title)&&void 0!==p?p:null==n?void 0:n.alt,isImageReplaced:g,finalImageOriginalSrc:w}},[n,a]),u=(0,oe.useMemo)(function(){if(!r)return{};var e=a.get(n.id),t=null==e?void 0:e.replace;if(e&&t){var o,i,l=t.width||(null===(o=t.dimensions)||void 0===o?void 0:o.width),s=t.height||(null===(i=t.dimensions)||void 0===i?void 0:i.height);if(l&&s){var c=l/s;return{width:r,height:r/c>=80?r/c:80}}}if(n.width&&n.height){var u=n.width/n.height;return{width:r,height:r/u>=80?r/u:80}}return{width:r,height:80}},[r,n.width,n.height,a,n.id]),d=(0,oe.useCallback)(function(e,t){e.preventDefault(),e.stopPropagation(),s&&s(t)},[s]),p=(0,oe.useCallback)(function(e,t,n){e.preventDefault(),e.stopPropagation(),t&&(g({url:t,alt:n||"Original Image"}),h(!0))},[g,h]),f=c.finalImageSrc,m=c.finalImageAlt,v=c.isImageReplaced,y=c.finalImageOriginalSrc;return ae().createElement("div",{key:"image-".concat(null!==(t=null==n?void 0:n.id)&&void 0!==t?t:o),className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-wrapper ".concat((null==n?void 0:n.id)===i?"selected":""," ").concat(null!=n&&n.type&&"photo"!==(null==n?void 0:n.type)?"show-border":""),"data-type":null==n?void 0:n.type},ae().createElement("img",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image",src:f,style:u,alt:m}),ae().createElement("div",{onClick:function(){return l(null==n?void 0:n.id)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay"},ae().createElement("button",{type:"button",onClick:function(e){return p(e,y,m)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay-button templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay-button-eye"},ae().createElement(tD,null)),v&&ae().createElement("button",{type:"button",onClick:function(e){return d(e,null==n?void 0:n.id)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay-button"},ae().createElement(iD,null),(0,At.__)("Undo","templately")),ae().createElement("button",{type:"button",onClick:function(){l(null==n?void 0:n.id)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay-button"},ae().createElement(nD,null),(0,At.__)("Replace","templately"))))},function(e,t){var n=e.data.id!==t.data.id||e.data.url!==t.data.url||e.width!==t.width,r=e.data.id===e.selectedImageId!=(t.data.id===t.selectedImageId),o=e.modifiedImagesMap.get(e.data.id)!==t.modifiedImagesMap.get(t.data.id);return!n&&!r&&!o}),b=(0,oe.useRef)(o),w=(0,oe.useRef)(i);b.current=o,w.current=i;var k=(0,oe.useCallback)(function(e){b.current(e)},[]),E=(0,oe.useCallback)(function(e){w.current(e)},[]),O=(0,oe.useCallback)(function(e){return ae().createElement(y,re({},e,{selectedImageId:r,modifiedImagesMap:v,onImageReplace:k,onImageUndo:E}))},[r,v,k,E]);return ae().createElement(ae().Fragment,null,ae().createElement(ZN,{key:c,containerRef:l,items:t,columnGutter:12,columnCount:2,columnWidth:150,render:O,shouldUpdateItem:function(e,t){var n=v.get(e.id),o=v.get(t.id);return e.id!==t.id||e.url!==t.url||n!==o||e.id===r!=(t.id===r)}}),p&&ae().createElement(rD,{isOpen:p,image:m,setIsOpen:h}))});const lD=aD;var sD=function(e){e.imagesAlreadyReplaced;var t,n=e.defaultImages,r=e.handleSkip,o=e.handleSaveChange,i=e.setShowImageReplacePanel,a=(e.selectedCategory,e.imagePanelData),l=e.aiSidebarContext,s=e.onExpandAiSidebar,c=e.onCollapseAiSidebar;if(!a)return console.error("ImageReplacePanelIsolated: imagePanelData prop is missing"),ae().createElement("div",null,"Error: Image panel data not available");var u=a.searchString,d=a.modifiedImages,p=a.selectedImageId,h=a.isResetClicked,f=a.setIsResetClicked,m=a.selectedTab,g=a.setSelectedTab,v=a.selectedImageRatio,y=a.setSelectedImageRatio,b=a.searchResults,w=a.isSearchLoading,k=a.searchError,E=a.totalPages,O=a.perPage,x=a.handleImageSearchById,S=a.handleSearchInputChange,_=a.handleSearchSubmit,C=a.replaceSelectedImage,P=a.handleImageReplace,T=a.handleImageUndo,A=a.handleLoadMore,M=a.onReset,N=[{label:(0,At.__)("All","templately"),value:"all"},{label:(0,At.__)("Landscape","templately"),value:"landscape",icon:ae().createElement(QM,null)},{label:(0,At.__)("Portrait","templately"),value:"portrait",icon:ae().createElement($M,null)},{label:(0,At.__)("Square","templately"),value:"square",icon:ae().createElement(GM,null)}];(0,oe.useEffect)(function(){return s&&s(),function(){c&&c()}},[s,c]);var D=function(){d.length?o(d):(o([]),f(!1)),i(!1)},I=(0,oe.useCallback)(function(){try{return ae().createElement(ae().Fragment,null,N.map(function(e,t){var n;return ae().createElement("button",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ratio-popover-item ".concat(v===e.value?"active":""),onClick:function(t){t.stopPropagation(),y(e.value),x(u,p,e.value,1)},key:t},null!==(n=e.icon)&&void 0!==n?n:null,e.label)}))}catch(e){return console.error("Error in ImageRatioPopoverPanel:",e),ae().createElement(ae().Fragment,null)}},[u,p,v,y,x]);return ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-header"},ae().createElement("h3",{className:"templately-fsi-ai-sidebar-image-replace-panel-title"},(0,At.__)("Great! Choose visuals that fit your web content or upload your own.","templately"))),ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-header"},ae().createElement("h4",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-title"},(0,At.__)("Images used in your template","templately")),ae().createElement("button",{onClick:M,disabled:0===d.length,className:"templately-fsi-ai-sidebar-image-replace-panel-reset-button",type:"button",title:(0,At.__)("Reset","templately")},(0,At.__)("Reset","templately"))),ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-grid"},ae().createElement(lD,{defaultImages:n,modifiedImages:d,selectedImageId:p,onImageReplace:P,onImageUndo:T,aiSidebarContext:l}))),ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion"},ae().createElement("h4",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-title"},(0,At.__)("Select image","templately")),ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-tab-wrapper"},ae().createElement("button",{type:"button",onClick:function(){return g("stock")},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-tab ".concat("stock"===m?"active":"")},(0,At.__)("Stock Images","templately")),ae().createElement("button",{type:"button",onClick:function(){return g("upload")},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-tab ".concat("upload"===m?"active":"")},(0,At.__)("Upload","templately")),ae().createElement("button",{type:"button",onClick:function(){return g("aiGenerated")},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-tab ".concat("aiGenerated"===m?"active":"")},(0,At.__)("AI Generated","templately"))),"stock"===m?ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-filter"},ae().createElement("form",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-search-wrapper ".concat(p?"":"disabled"),onSubmit:p?_:function(e){return e.preventDefault()}},ae().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-search-icon"},ae().createElement(HM,null)),ae().createElement("input",{type:"text",name:"search",id:"search",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-search",placeholder:(0,At.__)("Search","templately"),value:u,onChange:p?S:function(){},disabled:!p}),ae().createElement("button",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-search-button",type:"submit",onClick:p?_:function(e){return e.preventDefault()},disabled:!p},(0,At.__)("Search","templately"))),ae().createElement(JM,{content:ae().createElement(I,null),disabled:!p},ae().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ratio-popover-button ".concat(p?"":"disabled")},function(){var e,t,n=N.find(function(e){return e.value===v});return null!==(e=null!==(t=null==n?void 0:n.icon)&&void 0!==t?t:null==n?void 0:n.label)&&void 0!==e?e:""}()))):null,"aiGenerated"===m||p?null:ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-wrapper"},ae().createElement("img",{src:XM,alt:"image-arrow",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-image-arrow"}),ae().createElement("img",{src:YM,alt:"image-placeholder",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-image"}),ae().createElement("p",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-title"},(0,At.__)("No image selected","templately")),ae().createElement("p",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-text"},(0,At.__)("Please choose an image to replace the current one.","templately"))),p&&"stock"===m?ae().createElement(oD,{searchResults:b,isSearchLoading:w,searchError:k,onImageSelect:C,selectedImageId:p,perPage:O,totalPages:E,onLoadMore:A}):null,"aiGenerated"===m?ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ai-generated-tab-content-wrapper"},ae().createElement("p",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ai-generated-tab-content-title"},(0,At.__)("Coming Soon","templately")),ae().createElement("img",{src:KM,alt:"ai-generated-image-placeholder",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ai-generated-tab-content-image"})):null,p&&"upload"===m?ae().createElement(ae().Fragment,null,ae().createElement(VM.MediaUpload,{onSelect:function(e){var t,n,r,o;C({alt:null!==(t=e.alt)&&void 0!==t?t:e.title,height:e.height,id:e.id,photographer:e.authorName,photographer_url:e.authorLink,provider:e.authorName,src:{large2x:null===(n=e.sizes.full)||void 0===n?void 0:n.url,medium:null===(r=e.sizes.medium)||void 0===r?void 0:r.url,original:null===(o=e.sizes.full)||void 0===o?void 0:o.url},url:e.url,width:e.width},"upload")},allowedTypes:["image"],value:null===(t=d.find(function(e){return e.id===p}))||void 0===t||null===(t=t.replace)||void 0===t?void 0:t.id,render:function(e){var t=e.open;return ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-image-upload-uploader",onClick:t},ae().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-image-upload-uploader-icon"},ae().createElement(qM,null)),ae().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-image-upload-uploader-text"},(0,At.__)("Select or upload from Media Library.","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-image-upload-uploader-button"},(0,At.__)("Browse media library","templately")))}})):null)),ae().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-footer"},ae().createElement("button",{onClick:function(){i(!1),r()},disabled:!1,className:"templately-fsi-ai-sidebar-image-replace-panel-skip-button",type:"button",title:(0,At.__)("Skip","templately")},(0,At.__)("Skip","templately")),ae().createElement("button",{className:"templately-fsi-ai-sidebar-image-replace-panel-submit-button",onClick:function(){return D()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),document.activeElement===e.target&&D())},disabled:!(null!=d&&d.length||h),title:(0,At.__)("Save Changes","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-submit-button-text"},(0,At.__)("Save Changes","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-submit-button-icon"},ae().createElement(vP,null)))))};const cD=ae().memo(sD);function uD(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 dD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uD(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var pD=function(){var e=Ei(xi().mark(function e(t,n,r,o){var i,a,l,s,c,u=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=u.length>4&&void 0!==u[4]?u[4]:null,a={query:t.trim(),orientation:"all"===n?void 0:n,page:r,per_page:o},Object.keys(a).forEach(function(e){void 0===a[e]&&delete a[e]}),e.next=1,ba("/templately/v1/ai-content/images",a,{signal:i});case 1:if(l=e.sent,s=l.response,!(c=l.error)){e.next=2;break}throw c;case 2:return e.abrupt("return",s);case 3:case"end":return e.stop()}},e)}));return function(_x,t,n,r){return e.apply(this,arguments)}}(),hD=function(e,t,n){return"".concat(t||"all","-").concat(n||1,"-").concat(e||"")},fD=function(e,t,n){if(null==e||!e.searchParams)return!1;var r=e.searchParams,o=r.query,i=r.orientation;return o===t&&i===n},mD=function(e,t,n,r){var o=e[hD(t,n,r)];return o&&fD(o,t,n)?o.data:null},gD=function(e,t,n,r,o){var i=hD(t,n,r);return dD(dD({},e),{},Tt({},i,{data:o,searchParams:{query:t,orientation:n},timestamp:Date.now()}))},vD=function(e,t,n){if(!e||0===Object.keys(e).length)return{};var r={};for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];fD(i,t,n)&&(r[o]=i)}return r};const yD=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=pe((0,oe.useState)(""),2),o=r[0],i=r[1],a=pe((0,oe.useState)(e||[]),2),l=a[0],s=a[1],c=pe((0,oe.useState)(null),2),u=c[0],d=c[1],p=pe((0,oe.useState)(!1),2),h=p[0],f=p[1],m=pe((0,oe.useState)("stock"),2),g=m[0],v=m[1],y=pe((0,oe.useState)("all"),2),b=y[0],w=y[1],k=pe((0,oe.useState)({}),2),E=k[0],O=k[1],x=pe((0,oe.useState)([]),2),S=x[0],_=x[1],C=pe((0,oe.useState)(!1),2),P=C[0],T=C[1],A=pe((0,oe.useState)(null),2),M=A[0],N=A[1],D=pe((0,oe.useState)(0),2),I=D[0],L=D[1],R=pe((0,oe.useState)({}),2),j=R[0],F=R[1],z=pe((0,oe.useState)(null),2),B=z[0],W=z[1],U=pe((0,oe.useState)(null),2),V=U[0],H=U[1],q=pe((0,oe.useState)(50),1)[0],Q=pe((0,oe.useState)({query:"",orientation:"all"}),2),$=Q[0],G=Q[1],Y=pe((0,oe.useState)(new Set),2),X=Y[0],K=Y[1];(0,oe.useEffect)(function(){s(e||[])},[e]),(0,oe.useEffect)(function(){return function(){B&&B.abort("Component unmounted")}},[B]),(0,oe.useEffect)(function(){return function(){V&&V.abort("Component unmounting")}},[V]);var Z=[{label:(0,At.__)("All","templately"),value:"all"},{label:(0,At.__)("Landscape","templately"),value:"landscape"},{label:(0,At.__)("Portrait","templately"),value:"portrait"},{label:(0,At.__)("Square","templately"),value:"square"}],J=(0,oe.useCallback)(function(){var e=Ei(xi().mark(function e(t,r,o){var i,a,l,s,c,u,d,p,h,f,m=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=m.length>3&&void 0!==m[3]?m[3]:1,r){e.next=1;break}return _([]),N(null),e.abrupt("return");case 1:if(t||(t=n),a="".concat(t||"default","-").concat(o||"all","-").concat(i||1),!X.has(a)){e.next=2;break}return e.abrupt("return");case 2:if(V&&V.abort("New search initiated"),l={query:t,orientation:o},(s=$.query!==t||$.orientation!==o)&&(T(!0),_([]),K(new Set),O(function(e){return vD(e,t,o)}),G(l),i=1),!(c=mD(E,t,o,i))){e.next=3;break}return _(1===i||s?c.images:function(e){return[].concat(Ul(e),Ul(c.images))}),L(c.total_pages||0),N(null),e.abrupt("return");case 3:return u=new AbortController,H(u),K(function(e){var t=new Set(e);return t.add(a),t}),T(!0),N(null),e.prev=4,e.next=5,pD(t,o,i,q,u.signal);case 5:(d=e.sent)&&d.images?(_(1===i||s?d.images:function(e){return[].concat(Ul(e),Ul(d.images))}),L(d.total_pages||0),O(function(e){return gD(e,t,o,i,d)})):(_([]),N((0,At.__)("No image found","templately"))),e.next=8;break;case 6:if(e.prev=6,!("AbortError"===(null==(f=e.catch(4))?void 0:f.name)||null!=f&&null!==(p=f.message)&&void 0!==p&&p.includes("abort")||null!=f&&null!==(h=f.message)&&void 0!==h&&h.includes("cancelled")||u.signal.aborted)){e.next=7;break}return e.abrupt("return");case 7:console.error("Image search error:",f),N(f.message||(0,At.__)("Failed to search images. Please try again.","templately")),_([]);case 8:return e.prev=8,H(function(e){return e===u?null:e}),K(function(e){var t=new Set(e);return t.delete(a),t}),T(!1),e.finish(8);case 9:case"end":return e.stop()}},e,null,[[4,6,8,9]])}));return function(_x,t,n){return e.apply(this,arguments)}}(),[q,n,E,$,X,V]),ee=(0,oe.useCallback)(function(e){var t=e.target.value;i(t)},[]),te=(0,oe.useCallback)(function(e){e&&e.preventDefault(),u&&J(o,u,b,1)},[o,u,b,J]),ne=(0,oe.useCallback)(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=null!=r?r:u;if(i){var a={id:i,source:n,original:t.find(function(e){return e.id===i}),replace:e};3!==o?1!==o&&2!==o?l.some(function(e){return e.id===i})?s(function(e){return e.map(function(e){return e.id===i?a:e})}):s(function(e){return[].concat(Ul(e),[a])}):s(function(){return t.map(function(t,r){var i=1===o?e:S[r%S.length];return{id:t.id,source:n,original:t,replace:i}})}):s(function(){for(var e=t.map(function(e){return e.width/e.height}),r=S.map(function(e){return e.width/e.height}),o=new Set,i=[],a=0;a<t.length;a++){for(var l=e[a],s=null,c=-1,u=1/0,d=0;d<S.length;d++)if(!o.has(d)){var p=Math.abs(l-r[d]);p<u&&(u=p,s=S[d],c=d)}if(null===s&&S.length>0){for(var h=S[0],f=Math.abs(l-r[0]),m=1;m<S.length;m++){var g=Math.abs(l-r[m]);g<f&&(f=g,h=S[m])}s=h}else c>=0&&o.add(c);s&&i.push(s)}return t.map(function(e,t){return{id:e.id,source:n,original:e,replace:i[t]}})})}},[u,t,S,l]),re=(0,oe.useCallback)(function(e){d(e),((0,_a.isEmpty)(S)||0===S.length)&&J(o,e,b,1);var t=l.find(function(t){return t.id===e});t&&v((null==t?void 0:t.source)||"stock")},[l,o,b,J,S]),ie=(0,oe.useCallback)(function(e){s(function(t){return t.filter(function(t){return t.id!==e})})},[]),ae=(0,oe.useCallback)(function(){var e=Ei(xi().mark(function e(t){var r;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=o||n,e.next=1,J(r,u,b,t);case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),[o,n,u,b,J]),le=(0,oe.useCallback)(function(){var e,t,n=Z.find(function(e){return e.value===b});return null!==(e=null!==(t=null==n?void 0:n.icon)&&void 0!==t?t:null==n?void 0:n.label)&&void 0!==e?e:""},[b,Z]),se=(0,oe.useCallback)(function(){s([]),f(!0)},[]);return{searchString:o,setSearchString:i,modifiedImages:l,setModifiedImages:s,selectedImageId:u,setSelectedImageId:d,isResetClicked:h,setIsResetClicked:f,selectedTab:g,setSelectedTab:v,selectedImageRatio:b,setSelectedImageRatio:w,apiCache:E,setApiCache:O,searchResults:S,setSearchResults:_,isSearchLoading:P,setIsSearchLoading:T,searchError:M,setSearchError:N,totalPages:I,setTotalPages:L,imageUploadingProgress:j,setImageUploadingProgress:F,uploadAbortController:B,setUploadAbortController:W,searchAbortController:V,setSearchAbortController:H,perPage:q,lastSearchParams:$,setLastSearchParams:G,loadingPages:X,setLoadingPages:K,imageRatioOptions:Z,handleImageSearchById:J,handleSearchInputChange:ee,handleSearchSubmit:te,replaceSelectedImage:ne,handleImageReplace:re,handleImageUndo:ie,handleLoadMore:ae,getSelectedRatio:le,onReset:se}},bD=function(e){var t=e.imagesAlreadyReplaced,n=void 0===t?[]:t,r=e.defaultImages,o=e.handleSkip,i=e.handleSaveChange,a=e.setShowImageReplacePanel,l=e.selectedCategory,s=kn(),c=Sn(function(e){var t,n;return null!==(t=null==e||null===(n=e.general)||void 0===n||null===(n=n.fullSiteImport)||void 0===n?void 0:n.aiSidebarContext)&&void 0!==t?t:{id:null,show:!1,content:{},expanded:!1}}),u=yD(n,r,l),d=(0,oe.useCallback)(function(){s(function(){return{type:si,payload:Iy({expanded:!0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}())},[s]),p=(0,oe.useCallback)(function(){s(function(){return{type:ci,payload:Iy({expanded:!1},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}())},[s]);return ae().createElement(cD,{imagesAlreadyReplaced:n,defaultImages:r,handleSkip:o,handleSaveChange:i,setShowImageReplacePanel:a,selectedCategory:l,imagePanelData:u,aiSidebarContext:c,onExpandAiSidebar:d,onCollapseAiSidebar:p})};function wD(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 kD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wD(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const ED=gn(function(e){var t,n;return{profile:null!==(t=null==e||null===(n=e.profile)||void 0===n?void 0:n.data)&&void 0!==t?t:{}}})(function(e){var t,n,r,o,i=e.setSidebarShowState,a=e.hideAiSidebar,l=e.packId,s=e.creditDataLoading,c=e.creditData,u=e.creditLimitPopoverOpen,d=e.setCreditLimitPopoverOpen,p=e.setCreditLimitWarningPopover,h=e.profile,f=void 0===h?{}:h,m=e.onGeneratingProgressVisibilityChange,g=e.handleSidebarClose,v=e.showErrorAlert,y=kn(),b=Sn(function(e){return e.general.platform}),w=Sn(function(e){var t;return(null==e||null===(t=e.general)||void 0===t||null===(t=t.fullSiteImport)||void 0===t?void 0:t.packInfo)||{data:null}},Jt),k=pe((0,oe.useState)(null),2),E=k[0],O=k[1],x=pe((0,oe.useState)([]),2),S=x[0],_=x[1],C=pe((0,oe.useState)(!1),2),P=C[0],T=C[1],A=pe((0,oe.useState)([]),2),M=A[0],N=A[1],D=(0,oe.useCallback)(function(e){try{nt.current&&(clearTimeout(nt.current),nt.current=null),Ee(!0),nt.current=setTimeout(function(){U(function(t){return kD(kD({},t),{},{key:e})}),nt.current=null;var t=setTimeout(function(){Ee(!1)},150);et.current.push(t)},100)}catch(t){console.error("Error in changeStepWithDelay:",t),U(function(t){return kD(kD({},t),{},{key:e})}),Ee(!1)}},[]),I=(0,oe.useCallback)(function(){try{var e;return(null===(e=window)||void 0===e||null===(e=e.templately)||void 0===e?void 0:e.wp_user_avatar)||(null!=f&&f.profile_photo?f.profile_photo:null)}catch(e){return console.error("Error getting profile image source:",e),(null==f?void 0:f.profile_photo)||null}},[null==f?void 0:f.profile_photo]),L=(0,oe.useMemo)(function(){try{var e=Array.isArray(M)?M.filter(function(e){return!xP.includes(e)}):[];return[].concat(Ul(xP),Ul(e))}catch(e){return console.error("Error creating categories:",e),[]}},[M]),R=pe((0,oe.useState)(function(){return MP(null==f?void 0:f.first_name,S.length>0)}),2),j=R[0],F=R[1],z=(0,oe.useMemo)(function(){return MP(null==f?void 0:f.first_name,S.length>0)},[null==f?void 0:f.first_name,S.length]);(0,oe.useEffect)(function(){F(function(e){var t,n,r=MP(null==f?void 0:f.first_name,S.length>0);return(null===(t=e[0])||void 0===t?void 0:t.question)!==(null===(n=r[0])||void 0===n?void 0:n.question)?r.map(function(t,n){var r,o,i;return kD(kD({},t),{},{done:(null===(r=e[n])||void 0===r?void 0:r.done)||!1,result:(null===(o=e[n])||void 0===o?void 0:o.result)||null,editMode:(null===(i=e[n])||void 0===i?void 0:i.editMode)||!1})}):e})},[null==f?void 0:f.first_name,S.length]);var B=pe((0,oe.useState)({key:"start",isThinking:!1,isTyping:!1}),2),W=B[0],U=B[1],V=pe((0,oe.useState)(""),2),H=V[0],q=V[1],Q=pe((0,oe.useState)(""),2),$=Q[0],G=Q[1],Y=pe((0,oe.useState)(""),2),X=Y[0],K=Y[1],Z=pe((0,oe.useState)([]),2),J=Z[0],ee=Z[1],te=pe((0,oe.useState)({}),2),re=te[0],ie=te[1],le=pe((0,oe.useState)({}),2),se=le[0],ce=le[1],ue=pe((0,oe.useState)(!1),2),de=ue[0],he=ue[1],fe=pe((0,oe.useState)(!1),2),me=fe[0],ge=fe[1],ve=pe((0,oe.useState)(!1),2),ye=ve[0],be=ve[1],we=pe((0,oe.useState)(!1),2),ke=we[0],Ee=we[1],Oe=pe((0,oe.useState)(!0),2),xe=Oe[0],Se=Oe[1],_e=pe((0,oe.useState)(new Set),2),Ce=_e[0],Pe=_e[1],Te=pe((0,oe.useState)(!1),2),Ae=Te[0],Me=Te[1],Ne=pe((0,oe.useState)(!1),2),De=Ne[0],Ie=Ne[1],Le=(0,oe.useRef)(null),Re=pe((0,oe.useState)({isValid:!0,errorMessage:""}),2),je=Re[0],Fe=Re[1],ze=pe((0,oe.useState)({isValid:!0,errorMessage:""}),2),Be=ze[0],We=ze[1],Ue=pe((0,oe.useState)({isValid:!0,errorMessage:""}),2),Ve=Ue[0],He=Ue[1],qe=pe((0,oe.useState)({start:!1,complete:!1,errorMessage:null}),2),Qe=qe[0],$e=qe[1],Ge=(0,oe.useRef)(null),Ye=(0,oe.useRef)({stepStatusSetter:null,resetProgress:null,startProgress:null,completeProgress:null,setProgressError:null}),Xe=(0,oe.useCallback)(function(e){$e(e)},[]),Ke=(0,oe.useCallback)(function(e){Ye.current.stepStatusSetter=e},[]),Ze=(0,oe.useCallback)(function(e){Ye.current.resetProgress=e.resetProgress,Ye.current.startProgress=e.startProgress,Ye.current.completeProgress=e.completeProgress,Ye.current.setProgressError=e.setProgressError},[]),Je=(0,oe.useCallback)(function(){Ge.current&&(Ja("No pending steps detected, submitting immediately with AI templates:",Ge.current),St(Ge.current),Ge.current=null,Ye.current.completeProgress&&Ye.current.completeProgress(),nt.current=null)},[St]);(0,oe.useEffect)(function(){var e=(null==Qe?void 0:Qe.start)&&!Qe.complete;m&&m(e)},[Qe,m]);var et=(0,oe.useRef)([]),tt=(0,oe.useRef)([]),nt=(0,oe.useRef)(null),rt=(0,oe.useRef)(null);(0,oe.useEffect)(function(){return function(){if(et.current.forEach(function(e){e&&clearTimeout(e)}),et.current=[],tt.current.forEach(function(e){e&&clearInterval(e)}),tt.current=[],nt.current&&(clearTimeout(nt.current),nt.current=null),lt.cancel(),rt.current)try{rt.current.abort("Component unmounted"),rt.current=null}catch(e){console.warn("Error aborting AI workflow:",e)}}},[lt]),(0,oe.useEffect)(function(){var e=function(e){if("Enter"===e.key&&"start"===(null==W?void 0:W.key)){var t=document.activeElement;t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||"true"===t.contentEditable)||(e.preventDefault(),e.stopPropagation())}};return document.addEventListener("keydown",e,!0),function(){document.removeEventListener("keydown",e,!0)}},[null==W?void 0:W.key]),(0,oe.useEffect)(function(){(null==L?void 0:L.length)>0&&ee(L)},[L]),(0,oe.useEffect)(function(){if(null!=w&&w.error)return g(),void v(w.error);if(w.data){var e=function(e){var t,n,r,o,i,a,l,s={businessNiches:null,aiProcess:null,creditInfo:null,aiPageIDs:null,previewPages:null,ai_preview_content:null};if(null!=e&&null!==(t=e.data)&&void 0!==t&&t.business_niches&&(s.businessNiches=e.data.business_niches),null!=e&&null!==(n=e.data)&&void 0!==n&&n.ai_preview_content&&(s.ai_preview_content=e.data.ai_preview_content),null!=e&&null!==(r=e.data)&&void 0!==r&&r.ai_process){var c=e.data.ai_process;s.aiProcess={pack_id:null==c?void 0:c.pack_id,processId:null==c?void 0:c.process_id,name:null==c?void 0:c.name,category:null==c?void 0:c.category,description:null==c?void 0:c.description,email:null==c?void 0:c.email,contactNumber:null==c?void 0:c.contactNumber,businessAddress:null==c?void 0:c.businessAddress,openingHour:null==c?void 0:c.openingHour,imageReplace:null==c?void 0:c.imageReplace}}if(null!=e&&null!==(o=e.data)&&void 0!==o&&o.credit_balance||null!=e&&null!==(i=e.data)&&void 0!==i&&i.estimated_cost){var u,d,p=null!==(u=e.data.credit_balance)&&void 0!==u?u:{},h=null!==(d=e.data.estimated_cost)&&void 0!==d?d:0;s.creditInfo=UM(UM({},p),{},{estimated_cost:h})}if(null!=e&&null!==(a=e.data)&&void 0!==a&&null!==(a=a.manifest)&&void 0!==a&&null!==(a=a.content)&&void 0!==a&&a.page||null!=e&&null!==(l=e.data)&&void 0!==l&&null!==(l=l.manifest)&&void 0!==l&&l.templates){var f,m,g,v,y=null!==(f=null==e||null===(m=e.data)||void 0===m||null===(m=m.manifest)||void 0===m||null===(m=m.content)||void 0===m?void 0:m.page)&&void 0!==f?f:{},b=null!==(g=null==e||null===(v=e.data)||void 0===v||null===(v=v.manifest)||void 0===v?void 0:v.templates)&&void 0!==g?g:{},w=Object.values(b),k=Object.values(y).filter(function(e){var t;return!0!==(null===(t=e.page_settings)||void 0===t?void 0:t.page_for_posts)}),E=Object.values(y).filter(function(e){var t;return!0===(null===(t=e.page_settings)||void 0===t?void 0:t.page_on_front)}).map(function(e){return e.post_id}),O=k.map(function(e){return e.post_id}),x=w.filter(function(e){return!O.includes(e.post_id)}).map(function(e){return e.post_id}),S=w.filter(function(e){return"header"===e.type||"footer"===e.type}).map(function(e){return e.post_id}),_=Ul(S);S.length>0&&(s.headerFooterIDs=S),(E.length>0||_.length>0)&&(s.previewPages=[].concat(Ul(E),Ul(_))),(O.length>0||x.length>0)&&(s.aiPageIDs={"content/page":O,templates:x})}return s}(w);if(w.data.business_niches&&N(w.data.business_niches),e.aiProcess){var t=e.aiProcess,n=Number(t.pack_id)===Number(l);F(function(){return z.map(function(e){var n=e.editable;return"start"===e.key?kD(kD({},e),{},{editable:!1,done:!0}):"finalize"===e.key?kD(kD({},e),{},{editable:!1,question:"<p>".concat("Welcome back,"," ",(null==f?void 0:f.first_name)||(0,At.__)("there","templately"),"! 👋 ").concat((0,At.__)("Would you like us to generate your website content based on your previous conversation?","templately"),"</p>")}):"imageReplace"===e.key&&Object.hasOwn(t,e.key)&&t[e.key]?kD(kD({},e),{},{done:!0,answer:(0,At.__)("Yes, I would like to change images","templately"),result:t[e.key],editable:n}):Object.hasOwn(t,e.key)&&t[e.key]?kD(kD({},mt(t[e.key],{key:e.key},e)),{},{editable:n}):Object.hasOwn(t,e.key)&&!t[e.key]?kD(kD({},e),{},{done:!0,editable:n,answer:(0,At.__)("I want to skip the question","templately")}):kD(kD({},e),{},{editable:!1})})}),n?U({key:"finalize",isThinking:!1,isTyping:!1}):function(e,t){try{if(!e||"function"!=typeof e)return void console.warn("handlePackChange: Invalid setCurrentStep function provided");if(!t||"function"!=typeof t)return void console.warn("handlePackChange: Invalid setConversationSteps function provided");e({key:"imageReplace",isThinking:!1,isTyping:!1}),t(function(e){return e&&Array.isArray(e)?e.map(function(t){if(!t||"object"!==ne(t))return t;if("imageReplace"===t.key)return OP(OP({},t),{},{answer:null,result:null,done:!1});var n=e.findIndex(function(e){return"imageReplace"===(null==e?void 0:e.key)}),r=e.findIndex(function(e){return(null==e?void 0:e.key)===t.key});return-1!==n&&r>n?OP(OP({},t),{},{done:!1}):t}):(console.warn("handlePackChange: Invalid conversations array"),e)})}catch(e){console.error("Error in handlePackChange:",e)}}(U,F)}O(e)}},[w]),(0,oe.useEffect)(function(){E&&Se(!1)},[E]);var ot=(0,oe.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;try{if(!e||!Array.isArray(e))return console.warn("getNextStep: Invalid conversationSteps provided"),null;var r=null!=n?n:t,o=e.findIndex(function(e){return(null==e?void 0:e.key)===r});return-1!==o&&o<e.length-1?e[o+1]:null}catch(e){return console.error("Error in getNextStep:",e),null}}(j,null==W?void 0:W.key,e)},[j,null==W?void 0:W.key]);(0,oe.useEffect)(function(){me||be(!1)},[me]);var it=ae().useMemo(function(){return function(e){try{return e&&Array.isArray(e)?e.some(function(e){return!0===(null==e?void 0:e.editMode)}):(console.warn("checkAnyConversationInEditMode: Invalid conversationSteps provided"),!1)}catch(e){return console.error("Error in checkAnyConversationInEditMode:",e),!1}}(j)},[j]),at=(0,oe.useCallback)(function(e){if(e.preventDefault(),!nt.current&&!it)if("category"===(null==W?void 0:W.key))try{if(null==H||!H.trim())return void console.warn("Category submission blocked: Invalid category data");var t=_P(H,4);if(He(t),!t.isValid)return void console.warn("Category submission blocked: Too many words");he(!1),gt(H)}catch(e){return void console.error("Error submitting category:",e)}else if("email"===(null==W?void 0:W.key)){var n=SP(X);if(Fe(n),!n.isValid)return void console.warn("Email submission blocked: Invalid email");he(!1),gt(X.trim())}else if("contactNumber"===(null==W?void 0:W.key)){var r=CP(X);if(We(r),!r.isValid)return void console.warn("Phone submission blocked: Invalid phone number");he(!1),gt(X.trim())}else{if(null==X||!X.trim())return;he(!1),gt(X)}},[null==W?void 0:W.key,H,X,it,gt]),lt=(0,oe.useMemo)(function(){return(0,_a.throttle)(function(e,t,n){!function(e,t,n){try{var r=(null!=t?t:[]).map(function(t){try{if(!t||"string"!=typeof t)return null;var n=e.toLowerCase(),r=t.toLowerCase(),o=n.split(/\s+/).filter(function(e){return e.length>0}),i=r.split(/\s+/).filter(function(e){return e.length>0}),a=0,l=!1;r===n&&(a+=1e3,l=!0),r.startsWith(n)&&(a+=500,l=!0),n.startsWith(r)&&(a+=400,l=!0),r.includes(n)?(a+=300,l=!0):n.includes(r)&&(a+=250,l=!0);var s=o.length,c=0;return o.forEach(function(e,t){i.forEach(function(n){var r=0,o=!1;if(n===e?(r=100,o=!0):n.startsWith(e)?(r=80,o=!0):e.startsWith(n)?(r=70,o=!0):n.includes(e)?(r=50,o=!0):e.includes(n)&&(r=40,o=!0),o)if(l=!0,t<s)s=t,c=r+(1e4-1e3*t);else if(t===s){var i=r+(1e4-1e3*t);c=Math.max(c,i)}})}),a+=c,i.forEach(function(e){n.includes(e)?(a+=30,l=!0):e.includes(n)&&(a+=25,l=!0)}),l?{category:t,relevanceScore:a}:null}catch(e){return console.warn("Error scoring category:",t,e),null}}).filter(Boolean).sort(function(e,t){return t.relevanceScore-e.relevanceScore}).map(function(e){return e.category});n(r.length>0?r:[])}catch(e){console.error("Error in performCategorySearch:",e),n(t)}}(e,t,n)},150)},[]),st=(0,oe.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{var n="string"==typeof e?e:"";G(n);var r=n.trim(),o=_P(n,4);if(He(o),!r)return q(""),ee(L),lt.cancel(),void He({isValid:!0,errorMessage:""});if(q(r),t&&Me(!1),t){var i=setTimeout(function(){try{if(!(null==j?void 0:j.some(function(e){return null==e?void 0:e.editMode}))&&null!=Le&&Le.current)try{Le.current.focus();var e=r.length;Le.current.setSelectionRange(e,e)}catch(e){console.warn("Could not focus category input:",e)}et.current=et.current.filter(function(e){return e!==i})}catch(e){console.warn("Error in focus timeout:",e)}},50);et.current.push(i)}lt(r,L,ee)}catch(e){console.error("Error in handleCategoryInputChange:",e),G(""),q(""),ee(L),He({isValid:!0,errorMessage:""})}},[L,j,lt]),ct=(0,oe.useCallback)(function(e){try{if(K(null!=e?e:""),"email"===(null==W?void 0:W.key)){var t=SP(e);Fe(t),We({isValid:!0,errorMessage:""})}else if("contactNumber"===(null==W?void 0:W.key)){var n=CP(e);We(n),Fe({isValid:!0,errorMessage:""})}else Fe({isValid:!0,errorMessage:""}),We({isValid:!0,errorMessage:""});"category"!==(null==W?void 0:W.key)&&He({isValid:!0,errorMessage:""})}catch(e){console.error("Error in handleTextInputChange:",e),K(""),Fe({isValid:!0,errorMessage:""}),We({isValid:!0,errorMessage:""}),He({isValid:!0,errorMessage:""})}},[null==W?void 0:W.key]),ut=(0,oe.useCallback)(function(){he(!1),Ee(!0),F(function(e){return e.map(function(e){return"start"===(null==e?void 0:e.key)?kD(kD({},e),{},{done:!0}):e})});var e=setTimeout(function(){var t,n;D(null!==(t=null===(n=ot())||void 0===n?void 0:n.key)&&void 0!==t?t:"name"),et.current=et.current.filter(function(t){return t!==e})},30);et.current.push(e)},[D]),dt=(0,oe.useCallback)(function(e){if(e)F(function(e){var t;return null!==(t=null==e?void 0:e.map(function(e){return(null==e?void 0:e.key)===(null==W?void 0:W.key)?kD(kD({},e),{},{done:!0,answer:(0,At.__)("Yes, I would like to change images","templately")}):e}))&&void 0!==t?t:[]}),be(!1),ge(!0);else{F(function(e){var t;return null!==(t=null==e?void 0:e.map(function(e){return(null==e?void 0:e.key)===(null==W?void 0:W.key)?kD(kD({},e),{},{done:!0,answer:(0,At.__)("No, I will keep the default images.","templately")}):e}))&&void 0!==t?t:[]});var t=ot();null!=t&&t.key&&D(t.key)}},[null==W?void 0:W.key,ot,D]),pt=(0,oe.useCallback)(function(){var e,t,n=MP(null==f?void 0:f.first_name,S.length>0).filter(function(e){return"start"!==e.key});F(n),U({key:null!==(e=null===(t=ot())||void 0===t?void 0:t.key)&&void 0!==e?e:"name",isThinking:!1,isTyping:!1}),he(!1),O(function(e){return kD(kD({},e),{},{aiProcess:null})})},[null==f?void 0:f.first_name,S.length]),ht=(0,oe.useMemo)(function(){var e;return(null==j||null===(e=j.find(function(e){return(null==e?void 0:e.key)===(null==W?void 0:W.key)}))||void 0===e?void 0:e.tooltip)||null},[j,null==W?void 0:W.key]);(0,oe.useEffect)(function(){var e;return(null==W?void 0:W.isThinking)||(null==W?void 0:W.isTyping)||xe?Ie(!1):ht?(e=setTimeout(function(){Ie(!0),null!=et&&et.current&&(et.current=et.current.filter(function(t){return t!==e}))},120),null!=et&&et.current&&et.current.push(e)):Ie(!1),function(){e&&(clearTimeout(e),null!=et&&et.current&&(et.current=et.current.filter(function(t){return t!==e})))}},[ht,null==W?void 0:W.isThinking,null==W?void 0:W.isTyping,xe,et]),(0,oe.useEffect)(function(){var e=(null==j?void 0:j.filter(function(e){return null==e?void 0:e.done}))||[],t=[];return e.forEach(function(e){if(null!=e&&e.key){var n=setTimeout(function(){Pe(function(t){return new Set([].concat(Ul(t),[e.key]))})},200);t.push(n)}}),function(){t.forEach(function(e){return clearTimeout(e)})}},[j]),(0,oe.useEffect)(function(){if(!(null!=W&&W.isThinking||null!=W&&W.isTyping)){Ee(!0),U(function(e){return kD(kD({},e),{},{isThinking:!0})});var e=setTimeout(function(){Ee(!1),et.current=et.current.filter(function(t){return t!==e})},100);et.current.push(e)}},[null==W?void 0:W.key]),(0,oe.useEffect)(function(){if(null!=W&&W.isThinking){if(NP())return void U(function(e){return kD(kD({},e),{},{isThinking:!1,isTyping:!0})});var e=setTimeout(function(){Ee(!0),U(function(e){return kD(kD({},e),{},{isThinking:!1,isTyping:!0})}),Ee(!1)},1800);return et.current.push(e),function(){clearTimeout(e),et.current=et.current.filter(function(t){return t!==e})}}},[null==W?void 0:W.isThinking]),(0,oe.useEffect)(function(){var e;return(null==W?void 0:W.isThinking)||(null==W?void 0:W.isTyping)?he(!1):(e=setTimeout(function(){he(function(e){return e||!0})},120),et.current.push(e)),function(){e&&(clearTimeout(e),et.current=et.current.filter(function(t){return t!==e}))}},[null==W?void 0:W.isThinking,null==W?void 0:W.isTyping,null==W?void 0:W.key]);var ft=(0,oe.useCallback)(function(){try{F(function(e){var t;return null!==(t=null==e?void 0:e.map(function(e){return(null==e?void 0:e.key)===(null==W?void 0:W.key)?kD(kD({},e),{},{done:!0,answer:(0,At.__)("I want to skip the question","templately")}):e}))&&void 0!==t?t:[]});var e=ot();null!=e&&e.key&&D(e.key)}catch(e){console.error("Error in handleAnswerSkip:",e)}},[null==W?void 0:W.key,ot,D]),mt=function(e,t,n){if((null==n?void 0:n.key)===(null==t?void 0:t.key)){var r=null!=e?e:"",o=null!=e?e:"";return kD(kD({},n),{},{done:!0,answer:r,result:o})}return n},gt=(0,oe.useCallback)(function(e){try{if("category"===(null==W?void 0:W.key))try{var t=null!=e?e:"",n=(null!=L?L:[]).some(function(e){try{return e===t}catch(t){return console.warn("Error checking category:",e,t),!1}});T(!n)}catch(e){console.error("Error detecting category type:",e),T(!0)}F(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return mt(e,W,t)}))&&void 0!==n?n:[]}),"category"!==(null==W?void 0:W.key)&&K("");var r=ot();null!=r&&r.key&&D(r.key)}catch(e){console.error("Error in handleAnswerSubmit:",e)}},[null==W?void 0:W.key,ot,L,D]),vt=(0,oe.useCallback)(function(e){try{if(!e)return void console.warn("handleEdit: No key provided");var t=null==j?void 0:j.find(function(t){return(null==t?void 0:t.key)===e});if(!t)return void console.warn("handleEdit: No conversation found for key: ".concat(e));if("category"===e)try{if(null!=t&&t.result){var n=(null!=L?L:[]).find(function(e){try{return e===t.result}catch(t){return console.warn("Error checking category in edit:",e,t),!1}});n?(G(n||""),q(n||""),ee(L),T(!1),ce(function(n){return kD(kD({},n),{},Tt({},e,t.result))})):(G(t.result),q(t.result),ee([]),T(!0),ce(function(n){return kD(kD({},n),{},Tt({},e,t.result))}))}else G(""),q(""),ee(L),T(!1)}catch(e){console.error("Error in category edit setup:",e),G(""),q(""),ee(L),T(!1)}else null!=t&&t.result&&(ie(function(n){return kD(kD({},n),{},Tt({},e,t.result))}),ce(function(n){return kD(kD({},n),{},Tt({},e,t.result))}));F(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return(null==t?void 0:t.key)===e?kD(kD({},t),{},{editMode:!0}):t}))&&void 0!==n?n:[]})}catch(e){console.error("Error in handleEdit:",e)}},[j,L]),yt=(0,oe.useCallback)(function(e){if("category"===e){var t=H||$||"",n=(null==se?void 0:se[e])||"";return t.trim()!==n.trim()}var r=(null==re?void 0:re[e])||"",o=(null==se?void 0:se[e])||"";return r.trim()!==o.trim()},[H,$,re,se]),bt=(0,oe.useCallback)(function(e,t){try{if(!e)return void console.warn("handleEditInputChange: No key provided");if(ie(function(n){return kD(kD({},n),{},Tt({},e,null!=t?t:""))}),"email"===e){var n=SP(t);Fe(n)}else if("contactNumber"===e){var r=CP(t);We(r)}}catch(e){console.error("Error in handleEditInputChange:",e)}},[]),wt=(0,oe.useCallback)(function(e){try{var t,n;if(!e)return void console.warn("handleEditSubmit: No key provided");if(!yt(e))return void Ja("handleEditSubmit: No changes detected, skipping submission");var r=null!==(t=null==re||null===(n=re[e])||void 0===n?void 0:n.trim())&&void 0!==t?t:"";if("category"!==e&&!r)return void console.warn("handleEditSubmit: No value provided");if("email"===e){var o=SP(r);if(Fe(o),!o.isValid)return void console.warn("Email edit submission blocked: Invalid email")}else if("contactNumber"===e){var i=CP(r);if(We(i),!i.isValid)return void console.warn("Phone edit submission blocked: Invalid phone number")}if("category"===e){var a=_P(H,4);if(He(a),!a.isValid)return void console.warn("".concat(e," edit submission blocked: Too many words"))}F(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){if((null==t?void 0:t.key)===e){var n="category"===e?H:r,o="category"===e?H:r;return kD(kD({},t),{},{editMode:!1,answer:n,result:o})}return t}))&&void 0!==n?n:[]}),"category"===e?(G(""),q(""),ee(L),T(!1)):ie(function(t){var n=kD({},t);return delete n[e],n}),ce(function(t){var n=kD({},t);return delete n[e],n}),O(function(e){return kD(kD({},e),{},{ai_preview_content:null})})}catch(e){console.error("Error in handleEditSubmit:",e)}},[re,j,ot,H,L,yt]),kt=(0,oe.useCallback)(function(e){try{if(!e)return void console.warn("handleEditCancel: No key provided");F(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return(null==t?void 0:t.key)===e?kD(kD({},t),{},{editMode:!1}):t}))&&void 0!==n?n:[]}),"category"===e?(G(""),q(""),ee(L),T(!1)):ie(function(t){var n=kD({},t);return delete n[e],n}),ce(function(t){var n=kD({},t);return delete n[e],n})}catch(e){console.error("Error in handleEditCancel:",e)}},[L]),Et=(0,oe.useCallback)(function(){try{U(function(e){return kD(kD({},e),{},{isTyping:!1})})}catch(e){console.error("Error in handleTypingComplete:",e)}},[]),Ot=(0,oe.useCallback)(Ei(xi().mark(function e(){var t,n,r,o,i,a,u,h,f,m,g,v;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("AI_GENERATION_IN_PROGRESS"!==nt.current){e.next=1;break}return console.warn("AI generation already in progress"),e.abrupt("return");case 1:if(!s&&c){e.next=2;break}return console.warn("Credit data is still loading"),e.abrupt("return");case 2:if(c.is_first_generation){e.next=3;break}if(c.available_credit&&!(c.available_credit<c.estimated_cost)){e.next=3;break}return d(!0),p(!0),e.abrupt("return");case 3:if(e.prev=3,t=new AbortController,rt.current=t,nt.current="AI_GENERATION_IN_PROGRESS",F(function(e){return e.map(function(e){return"finalize"===(null==e?void 0:e.key)?kD(kD({},e),{},{done:!0}):e})}),n={},j.forEach(function(e){e.done&&e.result&&(n[e.key]=e.result)}),l){e.next=4;break}return console.error("Pack ID not found in AI sidebar context"),nt.current=null,he(!0),e.abrupt("return");case 4:if((r={pack_id:l,platform:b,isBusinessNichesNew:P,ai_page_ids:(null==E?void 0:E.aiPageIDs)||{},preview_pages:(null==E?void 0:E.previewPages)||[],name:n.name||"",category:n.category||"",description:n.description||"",email:n.email||"",contactNumber:n.contactNumber||"",businessAddress:n.businessAddress||"",openingHour:n.openingHour||"",imageReplace:(null==n?void 0:n.imageReplace)||[]}).description){e.next=5;break}return console.error("AI prompt is missing from conversation results"),nt.current=null,he(!0),e.abrupt("return");case 5:return Ye.current.startProgress?Ye.current.startProgress():console.warn("Progress start function not available"),o=Date.now(),e.next=6,LM(r,{onSessionCreated:function(e){Ye.current.stepStatusSetter&&Ye.current.stepStatusSetter("downloading","done"),Ja("Session created:",e.session_id)},onAIContentStarted:function(e){Ye.current.stepStatusSetter&&Ye.current.stepStatusSetter("analyzing","done"),Ja("AI content generation started:",e.process_id)},onBothCompleted:function(e){var t=e.sessionResult,n=e.aiContentResult;Ja("Both AJAX calls completed:",{sessionId:t.session_id,processId:n.process_id})},onPollingComplete:function(e){Ye.current.stepStatusSetter&&Ye.current.stepStatusSetter("generating","done"),Ja("AI content polling completed:",e)},onUpdating:function(){Ye.current.stepStatusSetter&&Ye.current.stepStatusSetter("updating","done")},onPreparing:function(){Ye.current.stepStatusSetter&&Ye.current.stepStatusSetter("preparing","done")},onWorkflowComplete:function(e){Ja("AI workflow completed successfully:",e),rt.current=null}},t);case 6:i=e.sent,a=Date.now(),u=((a-o)/1e3).toFixed(2),Ja("AI workflow took ".concat(u," seconds")),h={isLocalSite:i.isLocalSite,templates:i.templates,session_id:i.session_id,process_id:i.process_id,ai_page_ids:r.ai_page_ids,preview_pages:r.preview_pages,headerFooterIDs:E.headerFooterIDs,imageMappings:BM(r.imageReplace||[]),originalAttachments:S,description:r.description},Ge.current=h,Ja("AI content generation workflow completed, templates stored for submission:",i),e.next=14;break;case 7:e.prev=7,g=e.catch(3),console.error("Error in startAIGeneration:",g),f=g.message||(0,At.__)("Oops! An unexpected error occurred.","templately"),m=null,v=g.cause,e.next="cancelled"===v?8:"timeout"===v?9:"createSessionAndDownloadPack"===v?10:"startModifyAiContent"===v?11:12;break;case 8:return Ja("AI generation was cancelled"),nt.current=null,rt.current=null,he(!0),Ye.current.resetProgress&&Ye.current.resetProgress(),e.abrupt("return");case 9:return f=(0,At.__)("Oops! It's taking a bit longer than usual.","templately"),m=null,e.abrupt("continue",13);case 10:return f=(0,At.__)("Sorry, something went wrong.","templately"),m=0,console.error("Session/Download Error:",g.originalError),e.abrupt("continue",13);case 11:return f=(0,At.__)("Oops! Something went wrong while updating your content.","templately"),m=2,console.error("AI Content Error:",g.originalError),e.abrupt("continue",13);case 12:return f=(0,At.__)("Sorry, something went wrong.","templately"),m=3,e.abrupt("continue",13);case 13:nt.current=null,rt.current=null,he(!0),Ye.current.setProgressError&&Ye.current.setProgressError(f,m);case 14:case"end":return e.stop()}},e,null,[[3,7]])})),[l,j,b,E,P,c,d,p,St,Qe]),xt=(0,oe.useCallback)(function(){var e;if(null!=w&&null!==(e=w.data)&&void 0!==e&&null!==(e=e.ai_process)&&void 0!==e&&e.process_id){var t,n=w.data.ai_process,r=null==j?void 0:j.find(function(e){return"imageReplace"===e.key}),o={isCacheData:!0,templates:w.data.ai_preview_content,session_id:n.session_id,process_id:n.process_id,ai_page_ids:n.ai_page_ids,preview_pages:n.ai_preview_ids,headerFooterIDs:E.headerFooterIDs,isLocalSite:!0,imageMappings:BM(null!==(t=r.result)&&void 0!==t?t:[]),originalAttachments:S,description:n.description};St(o)}},[w,E,St,S,j]),St=(0,oe.useCallback)(function(e){null==i||i(function(e){return kD(kD({},e),{},{finishAnimation:!0})});var t=setTimeout(function(){var n=document.querySelector("body");n&&n.classList.remove("templately-fsi-ai-sidebar-open"),null==a||a(),null==i||i(function(e){return kD(kD({},e),{},{show:!1,finishAnimation:!1})}),Ja("AI templates submitted:",e),y(Uy({aiTemplates:e})),et.current=et.current.filter(function(e){return e!==t})},500);return et.current.push(t),t},[i,a,y]),_t=(0,oe.useCallback)(function(){try{var e,t=null!==(e=null==J?void 0:J.slice(2))&&void 0!==e?e:[];return ae().createElement(ae().Fragment,null,t.map(function(e,t){try{if(!e)return null;var n="category-more-".concat(t),r="category-radio-more-".concat(n);return ae().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-category"},ae().createElement("input",{id:r,type:"radio",name:"category",value:n,checked:H===e,onChange:function(){return st(e,!0)}}),ae().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))}catch(t){return console.warn("Error rendering category in MoreCategoryPanel:",e,t),null}}))}catch(e){return console.error("Error in MoreCategoryPanel:",e),ae().createElement(ae().Fragment,null)}},[J,H,st]);return(0,oe.useEffect)(function(){var e=function(){var e=Ei(xi().mark(function e(){var t,n,r,o;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,l){e.next=1;break}return console.error("Pack ID is required to fetch attachments data"),e.abrupt("return");case 1:return e.next=2,IM(l,"pack");case 2:n=e.sent,r=n.attachments.filter(function(e){return"photo"===e.type||!e.type}),null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_ai_all_images&&(r=n.attachments),_(r),Ja("attachments:",r),e.next=4;break;case 3:e.prev=3,o=e.catch(0),console.error("Error fetching attachments data:",o);case 4:case"end":return e.stop()}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}();e()},[l]),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-fsi-ai-sidebar-body ".concat(u?"credit-limit-popover-open":"")},"start"===(null==W?void 0:W.key)&&ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-info-wrapper"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-info"},(0,At.__)("You can check your AI Credits here!","templately"),ae().createElement("br",null),(0,At.__)("Buy credits if you needed!","templately")),ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-info-icon"},ae().createElement(gP,null))),ae().createElement("div",{className:"templately-fsi-ai-sidebar-body-inner"},null==j?void 0:j.map(function(e,t){var n,r,o,i,a,l,s,c,u,d,p,h,m,g,v;return null!=e&&e.done?ae().createElement(ae().Fragment,{key:"conversation-".concat(null==e?void 0:e.key,"-").concat(t)},ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation ai-conversation ".concat(Ce.has(null==e?void 0:e.key)?"animate-in":"")},ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},ae().createElement(kP,null)),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text",dangerouslySetInnerHTML:{__html:null!==(n=null==e?void 0:e.question)&&void 0!==n?n:""}}))),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation client-conversation ".concat(Ce.has(null==e?void 0:e.key)?"animate-in":"")},I()?ae().createElement("img",{src:I(),className:"templately-fsi-ai-sidebar-conversation-image",alt:null!==(r=null==f?void 0:f.name)&&void 0!==r?r:(0,At.__)("Profile","templately"),onError:function(e){var t,n;null!=e&&e.target&&(null!=f&&f.profile_photo&&e.target.src!==f.profile_photo?e.target.src=f.profile_photo:e.target.src=null!==(t=null===(n=window)||void 0===n||null===(n=n.templately)||void 0===n||null===(n=n.icons)||void 0===n?void 0:n.profile)&&void 0!==t?t:"")}}):ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},ae().createElement("span",null,null!=f&&f.first_name&&null!=f&&f.last_name?"".concat(null==f||null===(o=f.first_name)||void 0===o||null===(o=o.slice(0,1))||void 0===o?void 0:o.toUpperCase()).concat(null==f||null===(i=f.last_name)||void 0===i||null===(i=i.slice(0,1))||void 0===i?void 0:i.toUpperCase()):null!=f&&f.first_name?"".concat(null==f||null===(a=f.first_name)||void 0===a||null===(a=a.slice(0,2))||void 0===a?void 0:a.toUpperCase()):"".concat(null==f||null===(l=f.name)||void 0===l||null===(l=l.slice(0,2))||void 0===l?void 0:l.toUpperCase()))),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},null!=e&&e.editable&&null!=e&&e.editMode?ae().createElement("form",{onSubmit:function(t){t.preventDefault(),wt(null==e?void 0:e.key)},className:"templately-fsi-ai-sidebar-conversation-text ".concat(null!=e&&e.editable&&null!=e&&e.editMode?"templately-fsi-ai-sidebar-conversation-text-editing":"")},"description"===(null==e?void 0:e.key)?ae().createElement("textarea",{className:"templately-fsi-ai-sidebar-conversation-edit-textarea",placeholder:(0,At.__)("Type your answer...","templately"),value:null!==(s=null==re?void 0:re[null==e?void 0:e.key])&&void 0!==s?s:"",onChange:function(t){var n,r;return bt(null==e?void 0:e.key,null!==(n=null==t||null===(r=t.target)||void 0===r?void 0:r.value)&&void 0!==n?n:"")},onKeyDown:function(t){"Enter"===t.key&&(t.preventDefault(),wt(null==e?void 0:e.key))},autoFocus:!0}):ae().createElement("input",{type:"contactNumber"===(null==e?void 0:e.key)?"tel":"email"===(null==e?void 0:e.key)?"email":"text",className:"templately-fsi-ai-sidebar-conversation-edit-input ".concat("email"===(null==e?void 0:e.key)&&!je.isValid||"contactNumber"===(null==e?void 0:e.key)&&!Be.isValid?"templately-fsi-ai-sidebar-conversation-edit-input-has-error":""),placeholder:"email"===(null==e?void 0:e.key)?(0,At.__)("Enter your email address...","templately"):"contactNumber"===(null==e?void 0:e.key)?(0,At.__)("Enter your phone number...","templately"):(0,At.__)("Type your answer...","templately"),value:"category"===(null==e?void 0:e.key)?null!=$?$:"":null!==(c=null==re?void 0:re[null==e?void 0:e.key])&&void 0!==c?c:"",onChange:function(t){var n,r,o,i;"category"===(null==e?void 0:e.key)?st(null!==(n=null==t||null===(r=t.target)||void 0===r?void 0:r.value)&&void 0!==n?n:""):bt(null==e?void 0:e.key,null!==(o=null==t||null===(i=t.target)||void 0===i?void 0:i.value)&&void 0!==o?o:"")},autoFocus:!0}),"category"===(null==e?void 0:e.key)&&(null==J?void 0:J.length)>0&&Ve.isValid?ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-categories-wrapper"},J.map(function(e,t){var n="category-edit-".concat(t),r="category-radio-edit-".concat(n);return ae().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-category"},ae().createElement("input",{id:r,type:"radio",name:"edit-category",value:n,checked:H===e,onChange:function(){return st(e,!0)}}),ae().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))})):null,ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-edit-footer"},"email"===(null==e?void 0:e.key)&&!je.isValid&&ae().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},je.errorMessage),"contactNumber"===(null==e?void 0:e.key)&&!Be.isValid&&ae().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Be.errorMessage),"category"===(null==e?void 0:e.key)&&!Ve.isValid&&ae().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Ve.errorMessage),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-edit-buttons"},ae().createElement("button",{type:"button",onClick:function(){return kt(null==e?void 0:e.key)},className:"templately-fsi-ai-sidebar-conversation-edit-cancel","aria-label":(0,At.__)("Cancel editing","templately")},(0,At.__)("Cancel","templately")),ae().createElement("button",{type:"submit",className:"templately-fsi-ai-sidebar-conversation-edit-submit",disabled:"category"===(null==e?void 0:e.key)?!(null!=$&&$.trim()&&yt(null==e?void 0:e.key)&&Ve.isValid):"email"===(null==e?void 0:e.key)?!(null!=re&&null!==(u=re[null==e?void 0:e.key])&&void 0!==u&&u.trim()&&je.isValid&&yt(null==e?void 0:e.key)):"contactNumber"===(null==e?void 0:e.key)?!(null!=re&&null!==(d=re[null==e?void 0:e.key])&&void 0!==d&&d.trim()&&Be.isValid&&yt(null==e?void 0:e.key)):!(null!=re&&null!==(p=re[null==e?void 0:e.key])&&void 0!==p&&p.trim()&&yt(null==e?void 0:e.key)),"aria-label":(0,At.__)("Save changes","templately")},(0,At.__)("Save","templately"))))):ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text"},ae().createElement("p",null,null!==(h=null==e?void 0:e.answer)&&void 0!==h?h:"")),(null==e?void 0:e.editable)&&"AI_GENERATION_IN_PROGRESS"!==nt.current&&ae().createElement("button",{onClick:function(){return vt(null==e?void 0:e.key)},disabled:it,className:"templately-fsi-ai-sidebar-conversation-text-edit","aria-label":(0,At.__)("Edit answer","templately"),title:"AI_GENERATION_IN_PROGRESS"===nt.current?(0,At.__)("Cannot edit while AI generation is in progress","templately"):it?(0,At.__)("Please finish editing the current conversation first","templately"):(0,At.__)("Edit","templately")},ae().createElement(bP,null)))),"imageReplace"===(null==e?void 0:e.key)?ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation image-replace-conversation ".concat(Ce.has(null==e?void 0:e.key)?"animate-in":"")},ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},ae().createElement(kP,null)),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text"},null!=e&&null!==(m=e.result)&&void 0!==m&&m.length?ae().createElement("p",null,(0,At.sprintf)((0,At._n)("%d image replaced successfully.","%d images replaced successfully.",null==e||null===(g=e.result)||void 0===g?void 0:g.length,"templately"),null==e||null===(v=e.result)||void 0===v?void 0:v.length)):ae().createElement("p",null,(0,At.__)("No image has been replaced yet.","templately")),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-image-replace-button-wrapper"},ae().createElement("button",{className:"templately-fsi-ai-sidebar-conversation-image-replace-edit-button",onClick:function(){be(!0),ge(!0)},disabled:"AI_GENERATION_IN_PROGRESS"===nt.current||it,title:"AI_GENERATION_IN_PROGRESS"===nt.current||it?(0,At.__)("Please finish editing conversations before starting","templately"):(0,At.__)("View and Edit","templately")},(0,At.__)("View & Edit","templately")))))):ae().createElement(ae().Fragment,null)):(null==e?void 0:e.key)!==(null==W?void 0:W.key)||me?null:ae().createElement("div",{key:"current-".concat(null==e?void 0:e.key),className:"templately-fsi-ai-sidebar-conversation current-question ".concat(ke?"transitioning":""," ").concat("finalize"===(null==W?void 0:W.key)&&null!=Qe&&Qe.start?"finalize-completed":"")},ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},ae().createElement(kP,null)),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},ae().createElement(IP,{currentStep:W,isCatchFetching:xe,conversation:e,onTypingComplete:Et,intervalRefs:tt})))}),"finalize"===(null==W?void 0:W.key)?ae().createElement(FP,{timeoutRefs:et,onStepStatusUpdate:Ke,onProgressUpdate:Xe,onUtilityFunctionsReady:Ze,onNoPendingSteps:Je,isVisible:(null==Qe?void 0:Qe.start)&&!Qe.complete||Qe.complete&&Qe.errorMessage}):null,me&&ae().createElement(bD,{imagesAlreadyReplaced:null===(t=j.find(function(e){return"imageReplace"===e.key}))||void 0===t?void 0:t.result,defaultImages:S,setShowImageReplacePanel:ge,selectedCategory:H||(null===(n=j.find(function(e){return"category"===e.key}))||void 0===n?void 0:n.result),handleSkip:function(){if(!ye){var e=ot();null!=e&&e.key&&D(e.key)}},handleSaveChange:function(e){var t,n=(null===(t=j.find(function(e){return"imageReplace"===e.key}))||void 0===t||null===(t=t.result)||void 0===t?void 0:t.length)>0;if(F(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return"imageReplace"===(null==t?void 0:t.key)?kD(kD({},t),{},{result:e,done:!0,answer:(0,At.__)("Yes, I would like to change images","templately")}):t}))&&void 0!==n?n:[]}),!ye&&!n){var r=ot();null!=r&&r.key&&D(r.key)}}}))),null==Qe||!Qe.start||null!=Qe&&Qe.complete?me?ae().createElement(ae().Fragment,null):ae().createElement("div",{className:"templately-fsi-ai-sidebar-footer"},ae().createElement(WP,{currentStepTooltip:ht,isVisible:De,isThinkingOrTyping:(null==W?void 0:W.isThinking)||(null==W?void 0:W.isTyping)||xe,timeoutRefs:et}),ae().createElement("div",{className:"templately-fsi-ai-sidebar-footer-panel-wrapper"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-footer-panel"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-footer-panel-content ".concat(!de||s||xe?"templately-fsi-ai-sidebar-footer-panel-content--no-animation":"templately-fsi-ai-sidebar-footer-panel-content--animate-in")},de&&!s&&!xe&&ae().createElement(ae().Fragment,null,"start"===(null==W?void 0:W.key)?ae().createElement("button",{className:"templately-fsi-ai-sidebar-conversation-start-button",onClick:function(){return ut()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),document.activeElement===e.target&&ut())},disabled:it,title:it?(0,At.__)("Please finish editing conversations before starting","templately"):(0,At.__)("Yes, let’s start","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-start-button-text"},(0,At.__)("Yes, let’s start","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-start-button-icon"},ae().createElement(vP,null))):"imageReplace"===(null==W?void 0:W.key)?ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-image-replace-button-wrapper"},ae().createElement("button",{className:"templately-fsi-ai-sidebar-conversation-image-replace-button",onClick:function(){return dt(!0)},disabled:it,title:it?(0,At.__)("Please finish editing conversations before starting","templately"):(0,At.__)("Yes","templately")},(0,At.__)("Yes","templately")),ae().createElement("button",{className:"templately-fsi-ai-sidebar-conversation-image-replace-button",onClick:function(){return dt(!1)},disabled:it,title:it?(0,At.__)("Please finish editing conversations before starting","templately"):(0,At.__)("No","templately")},(0,At.__)("No","templately"))):"finalize"===(null==W?void 0:W.key)?null==E||!E.aiProcess||null!=Qe&&Qe.start||null!=Qe&&Qe.complete||null!=Qe&&Qe.errorMessage?null!=Qe&&Qe.complete&&null!=Qe&&Qe.errorMessage?ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},ae().createElement("button",{onClick:function(){return pt()},className:"templately-fsi-ai-sidebar-conversation-new-chat-button-with-tooltip",disabled:it,title:it?(0,At.__)("Please finish editing conversations before starting new chat","templately"):(0,At.__)("New Chat","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-text"},(0,At.__)("New Chat","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-icon"},ae().createElement(wP,null))),ae().createElement("button",{onClick:function(){return Ot()},disabled:it||"AI_GENERATION_IN_PROGRESS"===nt.current,className:"templately-fsi-ai-sidebar-conversation-finish-button",title:(0,At.__)("Generate Again","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-text"},(0,At.__)("Generate Again","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-icon"},ae().createElement(vP,null)))):ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},ae().createElement("button",{onClick:function(){return pt()},className:"templately-fsi-ai-sidebar-conversation-new-chat-button",disabled:it,title:it?(0,At.__)("Please finish editing conversations before starting new chat","templately"):(0,At.__)("New Chat","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-icon"},ae().createElement(wP,null)),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-text"},(0,At.__)("No, Let’s Start Fresh","templately"))),ae().createElement("button",{onClick:function(){return Ot()},disabled:it||"AI_GENERATION_IN_PROGRESS"===nt.current,className:"templately-fsi-ai-sidebar-conversation-finish-button",title:"AI_GENERATION_IN_PROGRESS"===nt.current?(0,At.__)("AI generation in progress...","templately"):it?(0,At.__)("Please finish editing conversations before proceeding","templately"):(0,At.__)("Generate and Proceed","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-text"},(0,At.__)("Yes, Let’s Do It!","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-icon"},ae().createElement(vP,null)))):null!=E&&E.ai_preview_content?ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},ae().createElement("button",{onClick:function(){return pt()},className:"templately-fsi-ai-sidebar-conversation-new-chat-button",disabled:it,title:it?(0,At.__)("Please finish editing conversations before starting new chat","templately"):(0,At.__)("New Chat","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-icon"},ae().createElement(wP,null)),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-text"},(0,At.__)("No, Let’s Start Fresh","templately"))),ae().createElement("button",{onClick:function(e){(e.metaKey||e.ctrlKey)&&e.shiftKey?xt():Ot()},className:"templately-fsi-ai-sidebar-conversation-finish-button",disabled:it,title:it?(0,At.__)("Please finish editing conversations before proceeding","templately"):(0,At.__)("Generate and Proceed...","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-text"},(0,At.__)("Yes, Let’s Do It!","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-icon"},ae().createElement(vP,null)))):ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},ae().createElement("button",{onClick:function(){return pt()},className:"templately-fsi-ai-sidebar-conversation-new-chat-button",disabled:it,title:it?(0,At.__)("Please finish editing conversations before starting new chat","templately"):(0,At.__)("New Chat","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-icon"},ae().createElement(wP,null)),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-text"},(0,At.__)("No, Let’s Start Fresh","templately"))),ae().createElement("button",{onClick:Ot,className:"templately-fsi-ai-sidebar-conversation-finish-button",disabled:it,title:it?(0,At.__)("Please finish editing conversations before proceeding","templately"):(0,At.__)("Generate and Proceed...","templately")},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-text"},(0,At.__)("Yes, Let’s Do It!","templately")),ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-icon"},ae().createElement(vP,null)))):ae().createElement(ae().Fragment,null,"category"===(null==W?void 0:W.key)?ae().createElement("form",{onSubmit:at},ae().createElement("input",{ref:Le,type:"text",className:"templately-fsi-ai-sidebar-conversation-category-input",placeholder:(0,At.__)("Type your business category...","templately"),value:$,onChange:function(e){var t,n;return st(null!==(t=null==e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"")},autoFocus:!0}),!Ve.isValid&&ae().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Ve.errorMessage),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-categories-wrapper"},(null==J?void 0:J.length)>0&&Ve.isValid?ae().createElement(ae().Fragment,null,J.length<=2?J.map(function(e,t){var n="category-".concat(t),r="category-radio-".concat(n);return ae().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-category"},ae().createElement("input",{id:r,type:"radio",name:"category",value:n,checked:H===e,onChange:function(){return st(e,!0)}}),ae().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))}):ae().createElement(ae().Fragment,null,null==J||null===(r=J.slice(0,2))||void 0===r?void 0:r.map(function(e,t){var n="category-main-".concat(t),r="category-radio-main-".concat(n);return ae().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-category"},ae().createElement("input",{id:r,type:"radio",name:"category",value:n,checked:H===e,onChange:function(){return st(e,!0)}}),ae().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))}),ae().createElement(PM,{open:Ae,onOpenChange:Me,content:ae().createElement(_t,null)},ae().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-category-more-button"},J.length-2,"+")))):null)):ae().createElement("form",{className:"templately-fsi-ai-sidebar-conversation-form",onSubmit:at},"description"===(null==W?void 0:W.key)?ae().createElement("textarea",{className:"templately-fsi-ai-sidebar-conversation-input",placeholder:(0,At.__)("Type your answer...","templately"),value:X,onChange:function(e){var t,n;return ct(null!==(t=null==e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"")},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),at(e))},autoFocus:!0}):ae().createElement("input",{type:"contactNumber"===(null==W?void 0:W.key)?"tel":"email"===(null==W?void 0:W.key)?"email":"text",className:"templately-fsi-ai-sidebar-conversation-input",placeholder:"email"===(null==W?void 0:W.key)?(0,At.__)("Enter your email address...","templately"):"contactNumber"===(null==W?void 0:W.key)?(0,At.__)("Enter your phone number...","templately"):(0,At.__)("Type your answer...","templately"),value:X,onChange:function(e){var t,n;return ct(null!==(t=null==e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"")},autoFocus:!0}),"email"===(null==W?void 0:W.key)&&!je.isValid&&ae().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},je.errorMessage),"contactNumber"===(null==W?void 0:W.key)&&!Be.isValid&&ae().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Be.errorMessage)),ae().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},(null==j||null===(o=j.find(function(e){return(null==e?void 0:e.key)===(null==W?void 0:W.key)}))||void 0===o?void 0:o.skip)&&ae().createElement("button",{onClick:ft,disabled:it,className:"templately-fsi-ai-sidebar-conversation-skip-button",type:"button",title:it?(0,At.__)("Please finish editing conversations before skipping","templately"):(0,At.__)("Skip this question","templately")},(0,At.__)("Skip","templately")),ae().createElement("button",{onClick:function(){return gt("category"===(null==W?void 0:W.key)?H:X)},disabled:it||("category"===(null==W?void 0:W.key)?!(null!=H&&H.trim()&&Ve.isValid):"email"===(null==W?void 0:W.key)?!(null!=X&&X.trim()&&je.isValid):"contactNumber"===(null==W?void 0:W.key)?!(null!=X&&X.trim()&&Be.isValid):!(null!=X&&X.trim())),className:"templately-fsi-ai-sidebar-conversation-submit-button",type:"button","aria-label":(0,At.__)("Submit answer","templately"),title:it?(0,At.__)("Please finish editing conversations before submitting","templately"):(0,At.__)("Submit answer","templately")},ae().createElement(yP,null))))))))):ae().createElement(ae().Fragment,null))});var OD=ae().memo(function(e){var t=e.isOpenWarningPopover,n=e.open,r=e.onOpenChange,o=e.children,i=e.content;return ae().createElement(xM,{open:n,onOpenChange:r},ae().createElement(SM,{asChild:!0},o),ae().createElement(_M,null,ae().createElement(CM,{style:t?xD:{},className:"templately-fsi-ai-sidebar-credit-limit-panel",sideOffset:12,align:"end"},i)))});OD.displayName="CreditLimitPopover";var xD={backgroundColor:"#fbf3f3",border:"1px solid #ff7a8e"};const SD=OD;function _D(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 CD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_D(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const PD=gn(function(e){var t,n;return{aiSidebarContext:null!==(t=null==e||null===(n=e.general)||void 0===n||null===(n=n.fullSiteImport)||void 0===n?void 0:n.aiSidebarContext)&&void 0!==t?t:{id:null,show:!1,content:{},expanded:!1}}},function(e){return{hideAiSidebar:function(){try{return e(function(){return{type:li,payload:Iy({id:null,show:!1},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}())}catch(e){return console.error("Error dispatching hideAiSidebar:",e),null}}}})(function(e){var t=e.className,n=void 0===t?"":t,r=e.aiSidebarContext,o=void 0===r?{id:null,show:!1,content:{},expanded:!1}:r,i=e.hideAiSidebar,a=e.packId,l=pe((0,oe.useState)(function(){return{show:!1,showAnimation:!1,hideAnimation:!1,finishAnimation:!1}}),2),s=l[0],c=l[1],u=pe((0,oe.useState)(!1),2),d=u[0],p=u[1],h=pe((0,oe.useState)(!1),2),f=h[0],m=h[1],g=pe((0,oe.useState)(!1),2),v=g[0],y=g[1],b=Sn(function(e){return e.general.fullSiteImport.availableCredit},Jt),w=(0,oe.useMemo)(function(){var e=null!=b?b:{is_first_generation:null,available_credit:0,purchased_credit:0,subscription_credit:0,subscription_plan:{billing_interval:"",type:""},total_credit:0,total_used_credit:0,estimated_cost:0};return{is_first_generation:e.is_first_generation,available_credit:Number(e.available_credit)||0,purchased_credit:Number(e.purchased_credit)||0,subscription_credit:Number(e.subscription_credit)||0,subscription_plan:e.subscription_plan||{billing_interval:"",type:""},total_credit:Number(e.total_credit)||0,total_used_credit:Number(e.total_used_credit)||0,estimated_cost:Number(e.estimated_cost)||0}},[b]);(0,oe.useEffect)(function(){!k&&null!==w.is_first_generation&&s.show&&(w.is_first_generation||(!w.available_credit||w.available_credit<w.estimated_cost)&&(m(function(e){return e||!0}),y(function(e){return e||!0})))},[w,k,s.show]);var k=Sn(function(e){var t,n;return null===(t=null===(n=e.general.fullSiteImport.packInfo)||void 0===n?void 0:n.loading)||void 0===t||t},Jt),E=(0,oe.useRef)(null);(0,oe.useEffect)(function(){if(E.current&&(clearTimeout(E.current),E.current=null),null!=o&&o.show){c(function(e){return CD(CD({},e),{},{show:!0,showAnimation:!0})});var e=document.querySelector("body");e&&e.classList.add("templately-fsi-ai-sidebar-open"),E.current=setTimeout(function(){c(function(e){return CD(CD({},e),{},{showAnimation:!1})})},300)}return function(){E.current&&(clearTimeout(E.current),E.current=null)}},[null==o?void 0:o.show]);var O=(0,oe.useCallback)(function(e){p(e)},[]),x=(0,oe.useCallback)(function(){if(d)try{if(!window.confirm((0,At.__)("Are you sure you want to cancel the template building process? Note: Credits will be deducted based on usage.","templately")))return}catch(e){return void console.error("Error showing confirmation dialog:",e)}E.current&&(clearTimeout(E.current),E.current=null),m(!1),y(!1),p(!1);var e=document.querySelector("body");e&&e.classList.remove("templately-fsi-ai-sidebar-open"),c(function(e){return CD(CD({},e),{},{hideAnimation:!0})}),E.current=setTimeout(function(){null==i||i(),c(function(e){return CD(CD({},e),{},{show:!1,hideAnimation:!1})})},300)},[i,d]),S=(0,oe.useMemo)(function(){return["templately-fsi-ai-sidebar",n,null!=o&&o.expanded?"expanded":"",null!=s&&s.showAnimation?"show-animation":"",null!=s&&s.hideAnimation?"hide-animation":"",null!=s&&s.finishAnimation?"finish-animation":""].filter(Boolean).join(" ")},[n,s,null==o?void 0:o.expanded]),_=(0,oe.useMemo)(function(){return["templately-fsi-ai-sidebar-overlay",null!=s&&s.showAnimation?"show-animation":"",null!=s&&s.hideAnimation?"hide-animation":"",null!=s&&s.finishAnimation?"finish-animation":""].filter(Boolean).join(" ")},[s]),C=(0,oe.useCallback)(function(){var e,t,n="recurring",r=w.total_used_credit,o=w.total_credit,i=w.available_credit,a=w.subscription_credit,l=w.purchased_credit,s=w.estimated_cost,c=(null===(e=w.subscription_plan)||void 0===e?void 0:e.type)||"one_time",u=o>0?Math.min(Math.round(r/o*100),100):0;return ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-header"},ae().createElement("h3",{className:"templately-fsi-ai-sidebar-credit-limit-panel-title"},(0,At.__)("Your AI Credits","templately")),ae().createElement("a",{href:null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_api?"https://www.templately.dev/#credit":"https://www.templately.com/#credit",target:"_blank",className:"templately-fsi-ai-sidebar-credit-limit-panel-increase-limit-btn"},!i||i<s?(0,At.__)("Buy Credits","templately"):(0,At.__)("Increase Limit","templately"))),c===n&&a?ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-credits-info"},"(".concat(a," ").concat((0,At.__)("AI Credits","templately"),"/").concat((0,At.__)("Month","templately")," + ").concat(l," ").concat((0,At.__)("AI Credits","templately"),")")):ae().createElement(ae().Fragment,null),ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-usage-wrapper"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-usage-text"},"".concat(null==r?void 0:r.toLocaleString(),"/").concat(null==o?void 0:o.toLocaleString()," ").concat((0,At.__)("Credits","templately"))),ae().createElement("span",{className:"templately-fsi-ai-sidebar-credit-limit-panel-credits-reset-info"},i?c===n&&a?"".concat((0,At.__)("Monthly reset in","templately")," ").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getFullYear(),n=e.getMonth(),r=new Date(t,n+1,0);if(e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()){var o=24-e.getHours();return"".concat(o," hour").concat(1!==o?"s":"")}var i=r.getDate()-e.getDate();return"".concat(i," day").concat(1!==i?"s":"")}()):(0,At.__)("AI credits validity: Lifetime – use anytime.","templately"):(0,At.__)("To generate AI content - buy credits now!","templately"))),ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-progress-wrapper"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-progress-bar",style:{width:"".concat(u,"%")}})),!w.is_first_generation&&s>0&&ae().createElement("p",{className:"templately-fsi-ai-sidebar-credit-limit-panel-estimated-credit"},(0,At.__)("Estimated AI Credits for this generation:","templately")," ",ae().createElement("strong",null,s)))},[w]);return ae().createElement(ae().Fragment,null,(null==s?void 0:s.show)&&ae().createElement(ae().Fragment,null,ae().createElement("div",{className:_}),ae().createElement("div",{className:S},ae().createElement("button",{className:"templately-fixed-sidebar-close",onClick:x,"aria-label":(0,At.__)("Close AI Sidebar","templately")},ae().createElement(fP,null)),ae().createElement("div",{className:"templately-fsi-ai-sidebar-content"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-header"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-header-left"},ae().createElement(dP,null)),ae().createElement("div",{className:"templately-fsi-ai-sidebar-header-right"},ae().createElement("div",{className:"templately-fsi-ai-sidebar-header-right-bg"},ae().createElement(pP,null)),!k&&ae().createElement(SD,{isOpenWarningPopover:v,open:f,onOpenChange:m,content:ae().createElement(C,null)},ae().createElement("button",{className:"templately-fsi-ai-sidebar-header-right-button"},ae().createElement("span",{className:"templately-fsi-ai-sidebar-header-right-icon"},ae().createElement(mP,null)),ae().createElement("span",{className:"templately-fsi-ai-sidebar-header-right-content"},"".concat(w.available_credit>0?"".concat(w.available_credit.toLocaleString()," ").concat((0,At.__)("Credits Left","templately")):(0,At.__)("No Credit Remaining","templately"))))))),ae().createElement(ED,{setSidebarShowState:c,creditDataLoading:k,creditData:w,packId:a,hideAiSidebar:i,creditLimitPopoverOpen:f,setCreditLimitPopoverOpen:m,setCreditLimitWarningPopover:y,onGeneratingProgressVisibilityChange:O,handleSidebarClose:x,showErrorAlert:function(e){Al({icon:"info",showCloseButton:!0,html:ae().createElement(i_,{title:(0,At.__)("Oops!","templately"),content:e})},!1)}})))))}),TD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e,{style:{fill:"currentColor",height:"22px",width:"22px"}}),oe.createElement("path",{d:"M20.95 22.375 18 19.425v2.225h-2V16h5.65v2H19.4l2.95 2.95zM12 22a9.7 9.7 0 0 1-3.9-.788 10.1 10.1 0 0 1-3.175-2.137q-1.35-1.35-2.137-3.175A9.7 9.7 0 0 1 2 12q0-2.075.788-3.9a10.1 10.1 0 0 1 2.137-3.175q1.35-1.35 3.175-2.137A9.7 9.7 0 0 1 12 2q2.075 0 3.9.788a10.1 10.1 0 0 1 3.175 2.137q1.35 1.35 2.137 3.175A9.7 9.7 0 0 1 22 12a10 10 0 0 1-.2 2h-2.05q.125-.5.188-1a8 8 0 0 0-.188-3h-3.4a13.6 13.6 0 0 1 .15 2 13.4 13.4 0 0 1-.15 2h-2a13.6 13.6 0 0 0 .15-2 13.4 13.4 0 0 0-.15-2h-4.7a13.6 13.6 0 0 0-.15 2 13.4 13.4 0 0 0 .15 2H13v2h-2.9q.3 1.075.775 2.063.476.987 1.125 1.887.5 0 1-.062.5-.063 1-.113v2.05q-.5.049-1 .113A8 8 0 0 1 12 22m-7.75-8h3.4a13.6 13.6 0 0 1-.15-2 13.4 13.4 0 0 1 .15-2h-3.4a8 8 0 0 0-.187 1 8 8 0 0 0 .187 3m.85-6h2.95A15.2 15.2 0 0 1 9.4 4.45q-1.376.45-2.475 1.362A7.9 7.9 0 0 0 5.1 8m4.3 11.55q-.45-.85-.787-1.738A15 15 0 0 1 8.05 16H5.1a7.9 7.9 0 0 0 1.825 2.188A7.5 7.5 0 0 0 9.4 19.55M10.1 8h3.8q-.3-1.075-.775-2.062A12.4 12.4 0 0 0 12 4.05 12.4 12.4 0 0 0 10.1 8m5.85 0h2.95a7.9 7.9 0 0 0-1.825-2.187A7.5 7.5 0 0 0 14.6 4.45q.45.85.787 1.737.338.888.563 1.813"}))},AD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},e,{style:{fill:"currentColor",height:"22px",width:"22px"}}),oe.createElement("path",{d:"M12 16.008q1.875 0 3.188-1.313 1.312-1.312 1.312-3.187T15.188 8.32 12 7.008 8.813 8.32Q7.499 9.633 7.5 11.508q0 1.875 1.313 3.187 1.312 1.313 3.187 1.313m0-1.8q-1.125 0-1.912-.788a2.6 2.6 0 0 1-.788-1.912q0-1.125.787-1.913A2.6 2.6 0 0 1 12 8.808q1.125 0 1.912.787.788.788.788 1.913t-.787 1.912a2.6 2.6 0 0 1-1.913.788m0 4.8q-3.65 0-6.65-2.038T1 11.508q1.35-3.425 4.35-5.463 3-2.037 6.65-2.037t6.65 2.037q3 2.039 4.35 5.463-1.35 3.425-4.35 5.462T12 19.008m0-2a9.54 9.54 0 0 0 5.188-1.488 9.77 9.77 0 0 0 3.612-4.012 9.77 9.77 0 0 0-3.613-4.013A9.55 9.55 0 0 0 12 6.008a9.55 9.55 0 0 0-5.187 1.487A9.77 9.77 0 0 0 3.2 11.508a9.77 9.77 0 0 0 3.613 4.012A9.54 9.54 0 0 0 12 17.008"}))},MD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14"},e,{style:{fill:"currentColor",height:"14px",width:"14px"}}),oe.createElement("path",{d:"M3.5 11.666a.56.56 0 0 1-.416-.168.56.56 0 0 1-.168-.415q0-.248.168-.416a.56.56 0 0 1 .415-.168h7q.248 0 .416.168t.168.416a.56.56 0 0 1-.168.415.56.56 0 0 1-.416.168zm.408-2.042q-.423 0-.751-.277a1.14 1.14 0 0 1-.401-.7l-.584-3.704a.3.3 0 0 0-.065.007.3.3 0 0 1-.066.008.84.84 0 0 1-.62-.256.84.84 0 0 1-.255-.62q0-.363.255-.62a.84.84 0 0 1 .62-.254q.365 0 .62.255t.255.62a.8.8 0 0 1-.022.19 1 1 0 0 1-.05.16l1.822.816 1.823-2.493a.9.9 0 0 1-.365-.715q0-.365.256-.62A.84.84 0 0 1 7 1.166q.363 0 .62.255.255.255.254.62a.898.898 0 0 1-.365.715l1.824 2.493 1.823-.816a1 1 0 0 1-.051-.16.8.8 0 0 1-.022-.19q0-.365.255-.62a.84.84 0 0 1 .62-.255q.365 0 .62.255t.255.62-.255.62a.84.84 0 0 1-.62.255.3.3 0 0 1-.066-.008.3.3 0 0 0-.066-.007l-.583 3.704a1.14 1.14 0 0 1-.4.7q-.33.277-.752.277z"}))},ND=function(e){var t=e.isPro,n=e.className,r=Vn()({"templately-pro":t,"templately-free":!t},n),o=t?(0,At.__)("Pro","templately"):(0,At.__)("Starter","templately");return React.createElement("div",{className:r},t&&React.createElement(MD,null),React.createElement("span",{className:"templately-badge-title"},o))};function DD(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 ID(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DD(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const LD=function(e){var t=e.url,n=e.name,r=e.thumbnail,o=e.alt,i=e.screenshotsEnabled,a=e.price,l=e.isPack,s=void 0!==l&&l,c=(i.hasShots,i.setIsOpen),u=pe((0,oe.useState)(!1),2),d=u[0],p=u[1],h=pe((0,oe.useState)("95%"),2),f=h[0],m=h[1],g=uP({query:"(max-width: 480px)"}),v=uP({query:"(max-width: 768px)"}),y=pe((0,oe.useState)(g?"phone":v?"tablet":"desktop"),2),b=y[0],w=y[1],k={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(3, 6, 60, 0.8)",zIndex:3},content:{position:"absolute",top:"50%",left:"50%",right:0,bottom:"auto",border:"none",background:"white",borderRadius:"2.5rem",outline:"none",padding:0,transform:"translate(-50%, -50%)",width:f,maxWidth:"96%",height:"90vh"}},E=Vn()("templately-item-details-banner-wrapper",{"is-pack":s}),O=pe((0,oe.useState)("liveDemo"),2),x=O[0],S=O[1];return React.createElement(React.Fragment,null,React.createElement("div",{className:E},React.createElement("div",{className:"templately-item-details-header"},React.createElement("h3",{className:"templately-item-details-title"},n),React.createElement(ND,{className:"templately-item-details-badge",isPro:+a>0}),"0"===a?React.createElement(React.Fragment,null):React.createElement("span",{className:"templately-item-details-price"},"$",a)),r&&React.createElement("div",{className:"templately-item-details-banner"},React.createElement("img",{src:r,alt:o,className:"templately-item-details-banner-image"}),React.createElement("div",{className:"templately-item-details-banner-overlay",onClick:function(){c(!0)}},React.createElement("button",{className:"templately-item-details-banner-overlay-button ".concat("preview"===x?"active":""),onClick:function(e){e.preventDefault(),e.stopPropagation(),p(!0)},onMouseEnter:function(){return S("preview")},onMouseLeave:function(){return S("liveDemo")}},React.createElement("span",{className:"templately-item-details-banner-overlay-button-text-wrapper"},React.createElement("span",{className:"templately-item-details-banner-overlay-button-text"},(0,At.__)("Preview","templately"))),React.createElement("span",{className:"templately-item-details-banner-overlay-button-icon"},React.createElement(AD,null))),React.createElement("a",{href:t,onClick:function(e){e.stopPropagation()},target:"_blank",className:"templately-item-details-banner-overlay-button ".concat("liveDemo"===x?"active":"")},React.createElement("span",{className:"templately-item-details-banner-overlay-button-text-wrapper"},React.createElement("span",{className:"templately-item-details-banner-overlay-button-text"},(0,At.__)("Live Demo","templately"))),React.createElement("span",{className:"templately-item-details-banner-overlay-button-icon"},React.createElement(TD,null)))))),React.createElement(RS(),{isOpen:d,onRequestClose:function(){return p(!1)},onAfterClose:function(){return m("95%")},contentLabel:"LiveDemoModal ".concat("tablet"===b?"tablet":"phone"===b?"phone":"desktop"),style:{overlay:k.overlay,content:ID({},k.content)},appElement:document.getElementById("wpbody")||document.body},React.createElement("div",{className:"tly__preview__head ".concat("tablet"===b?"tly__tablet__active":"phone"===b?"tly__mobile__active":"")},React.createElement("h5",{className:"tly__preview__product__name"},"Live Demo"),React.createElement("div",{className:"tly__preview__controller__group tly__preview__controller__group"},React.createElement("button",{className:"tly__preview__control ".concat("desktop"===b?"tly__active":""," "),onClick:function(){return w("desktop")}},React.createElement("i",{className:"dashicons dashicons-desktop"})),React.createElement("button",{className:"tly__preview__control ".concat("tablet"===b?"tly__active":""),onClick:function(){return w("tablet")}},React.createElement("i",{className:"dashicons dashicons-tablet"})),React.createElement("button",{className:"tly__preview__control ".concat("phone"===b?"tly__active":"","\n"),onClick:function(){return w("phone")}},React.createElement("i",{className:"dashicons dashicons-smartphone"}))),React.createElement("div",{className:"tly__live__link"},t&&React.createElement("a",{className:"tly__danger__button",href:t,target:"_blank",rel:"noreferrer"},"Go Live"))),React.createElement("div",{className:"tly__preview__body"},React.createElement("iframe",{src:t,width:"100%",height:"100%"})),React.createElement("div",{className:"tly__modal__closer",onClick:function(){return p(!1)}})))},RD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},e,{style:{fill:"currentColor",height:"24px",width:"24px"}}),oe.createElement("path",{d:"m18 20.971-1.45-1.45a.48.48 0 0 0-.7 0 .48.48 0 0 0 0 .7l1.95 1.95q.15.15.325.213.175.062.375.062t.375-.062a.9.9 0 0 0 .325-.213l1.95-1.95a.48.48 0 0 0 0-.7.48.48 0 0 0-.7 0L19 20.971v-3.6a.48.48 0 0 0-.15-.35.48.48 0 0 0-.7 0 .48.48 0 0 0-.15.35zm-5.5-7.25q.274 0 .525-.075.25-.075.475-.2l5.075-2.925a.92.92 0 0 0 .45-.612q.1-.413-.1-.763a.92.92 0 0 0-.6-.45.98.98 0 0 0-.75.1L12.5 11.721 7.425 8.796a.98.98 0 0 0-.75-.1.92.92 0 0 0-.6.45.97.97 0 0 0-.088.763q.113.412.463.612l5.05 2.925q.225.125.475.2t.525.075m-9 3.125v-7.95a1.95 1.95 0 0 1 1-1.725l7-4.025q.25-.125.488-.2.237-.075.512-.075.274 0 .525.075.25.075.475.2l7 4.025q.475.275.738.725.262.45.262 1v3.4q0 .45-.375.7a.91.91 0 0 1-.8.125 6 6 0 0 0-.887-.187 7 7 0 0 0-.938-.063q-2.9 0-4.95 2.05t-2.05 4.95v.513q0 .237.05.437.1.626-.363.975-.462.35-.962.075l-5.725-3.3a1.948 1.948 0 0 1-1-1.725m15 8.025q-2.075 0-3.537-1.462Q13.5 21.946 13.5 19.87t1.463-3.537T18.5 14.87t3.538 1.463T23.5 19.87t-1.462 3.538Q20.574 24.87 18.5 24.87"}))};var jD=["fillColor"];const FD=function(e){var t=e.fillColor,n=void 0===t?"#5AC0FF":t,r=Wn(e,jD);return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},r,{style:{fill:n,height:"16px",width:"16px"}}),oe.createElement("path",{d:"m7.56 1 1.353 6.208 6.208 1.353-6.208 1.352-1.352 6.208-1.353-6.208L0 8.561l6.208-1.353zM14.38 10.363l.594 2.728 2.727.594-2.727.594-.594 2.728-.594-2.728-2.728-.594 2.728-.594z"}))},zD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 512 512"},e),oe.createElement("path",{d:"M42.666 256c0-117.821 95.513-213.333 213.334-213.333v64c-82.475 0-149.333 66.859-149.333 149.333h-64z"}))},BD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},e,{style:{fill:"#5AC0FF",height:"24px",width:"24px"}}),oe.createElement("path",{fillRule:"evenodd",d:"M8.277 2.676a11.036 11.036 0 1 1 8.447 20.391A11.036 11.036 0 0 1 8.277 2.676",clipRule:"evenodd"}),oe.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M16.46 10.054a.75.75 0 0 1 0 1.06l-4.572 4.572a.75.75 0 0 1-1.06 0L8.542 13.4a.75.75 0 1 1 1.06-1.06l1.756 1.755 4.041-4.041a.75.75 0 0 1 1.06 0",clipRule:"evenodd"}))},WD=function(e){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512"},oe.createElement("path",{fill:"#ffffff",d:"M168.7 355.692V149.611q0-8.463 5.974-14.186c5.974-5.723 8.628-5.725 13.938-5.725q2.489 0 5.227.746c2.738.746 3.567 1.244 5.226 2.24l162.274 103.04q4.482 2.986 6.72 7.467 2.241 4.48 2.24 9.458c-.001 4.978-.745 6.472-2.24 9.457q-2.24 4.481-6.72 7.467l-162.274 103.04q-2.489 1.494-5.226 2.24c-2.737.746-3.567.748-5.227.748q-7.964-.002-13.938-5.724-5.974-5.725-5.974-14.188z"}))},UD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 512 512"},e),oe.createElement("path",{d:"M250.389 73.441a18.9 18.9 0 0 1 19.979-.011z"}),oe.createElement("path",{d:"M260.387 70.579a18.9 18.9 0 0 0-9.998 2.861 18.9 18.9 0 0 0-5.928 5.857l-.724 1.132-52.532 119.306-122.318 8.147-3.098.63-1.63.698a18.9 18.9 0 0 0-5.949 4.033 18.96 18.96 0 0 0-4.901 8.564 18.9 18.9 0 0 0 2.676 15.44l1.389 2.035 99.172 81.757-31.343 124.293-.364 3.053.153 1.771a18.91 18.91 0 0 0 8.59 14.268 18.94 18.94 0 0 0 9.309 2.995l.185.007c1.478.058 2.867-.06 4.133-.291l3.697-.673 109.613-76.106 109.382 76.146 3.765.663c1.978.347 4.084.394 6.228.051a18.9 18.9 0 0 0 8.921-3.961 19 19 0 0 0 5.802-8.001 18.8 18.8 0 0 0 1.226-6.465l.031-2.246-31.377-125.505 97.878-80.916 2.169-2.373.926-1.579a18.9 18.9 0 0 0 2.346-6.494l.033-.214a18.91 18.91 0 0 0-6.875-17.61l-.077-.062a19 19 0 0 0-5.555-3.045l-2.192-.758-123.313-8.253-52.755-119.196-.633-1.02a18.9 18.9 0 0 0-16.062-8.938z"}))},VD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 512 512"},e),oe.createElement("path",{d:"m245.913 449.478-29.461-26.412q-51.301-46.223-84.826-79.745-33.524-33.524-53.334-60.192-19.81-26.666-27.683-49.015c-7.873-22.349-7.873-30.137-7.873-45.714q0-47.746 32-79.746c32-32 47.916-32 79.746-32q26.412 0 50.286 11.175c23.874 11.175 29.63 17.947 41.144 31.492q17.268-20.318 41.143-31.492 23.87-11.175 50.286-11.175 47.745 0 79.745 32c32 32 32 47.915 32 79.746q.001 23.365-7.873 45.714c-7.874 22.349-14.478 31.239-27.682 49.015q-19.811 26.667-53.334 60.192-33.525 33.522-84.826 79.745l-29.459 26.412z"}))},HD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 512 512"},e),oe.createElement("path",{d:"m245.913 449.478-29.461-26.412q-51.301-46.223-84.826-79.745-33.524-33.524-53.334-60.192-19.81-26.666-27.683-49.015c-7.873-22.349-7.873-30.137-7.873-45.714q0-47.746 32-79.746c32-32 47.916-32 79.746-32q26.412 0 50.286 11.175c23.874 11.175 29.63 17.947 41.144 31.492q17.268-20.318 41.143-31.492 23.87-11.175 50.286-11.175 47.745 0 79.745 32c32 32 32 47.915 32 79.746q.001 23.365-7.873 45.714c-7.874 22.349-14.478 31.239-27.682 49.015q-19.811 26.667-53.334 60.192-33.525 33.522-84.826 79.745l-29.459 26.412zm0-54.858q48.76-43.68 80.252-74.92 31.493-31.238 49.779-54.348 18.285-23.113 25.397-41.144 7.11-18.032 7.11-35.81.001-30.476-20.317-50.793c-20.318-20.317-30.476-20.317-50.793-20.317q-23.875 0-44.19 13.46-20.318 13.46-27.938 34.285h-38.602q-7.62-20.825-27.936-34.286c-20.316-13.461-28.275-13.46-44.19-13.46q-30.476 0-50.793 20.317c-20.317 20.317-20.317 30.476-20.317 50.793q0 17.778 7.111 35.81c7.111 18.032 13.207 25.735 25.397 41.143q18.286 23.11 49.778 54.348 31.491 31.24 80.255 74.92z"}))},qD=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 512 512"},e),oe.createElement("path",{d:"M250.392 73.441a18.9 18.9 0 0 1 9.998-2.861c3.51 0 6.989.989 10 2.861z"}),oe.createElement("path",{d:"M126.972 457.092a19 19 0 0 1-1.977-6.938l-.153-1.771.364-3.053 31.343-124.293-99.172-81.757-1.389-2.035a18.9 18.9 0 0 1-2.592-5.566 18.91 18.91 0 0 1 10.764-22.47l1.632-.699 3.099-.63 122.316-8.147L243.74 80.427l.724-1.132a18.902 18.902 0 0 1 15.926-8.718c3.51 0 6.989.989 10 2.861a18.953 18.953 0 0 1 5.879 5.784l.184.292.633 1.02 52.755 119.198 123.31 8.251 2.192.758a18.9 18.9 0 0 1 5.555 3.045l.079.062a18.92 18.92 0 0 1 6.875 17.61l-.035.217a18.9 18.9 0 0 1-2.346 6.49l-.928 1.587-2.171 2.37-97.873 80.911 31.377 125.505-.028 2.246a18.9 18.9 0 0 1-1.229 6.465 19 19 0 0 1-5.8 8.001 18.9 18.9 0 0 1-8.921 3.961c-2.144.342-4.25.296-6.23-.051l-3.765-.663-109.377-76.146-109.617 76.106-3.696.673a19 19 0 0 1-4.134.291l-.183-.007a18.92 18.92 0 0 1-15.922-10.327zm179.653-224.175-46.199-104.384-45.963 104.387-102.07 6.798 83.124 68.529-25.999 103.101 91.031-63.204 90.803 63.216-25.779-103.112 82.881-68.517-101.83-6.814z"}))};var QD=["classNamePrefix"];const $D=function(e){var t=e.classNamePrefix;return Wn(e,QD),oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"25",fill:"none",viewBox:"0 0 22 25"},oe.createElement("path",{fill:"url(#temp_paint0_".concat(t,")"),d:"M.603 12.87c0-.43.35-.775.778-.817a7.795 7.795 0 0 0 6.976-6.975c.042-.429.387-.778.817-.778s.775.35.818.778a7.795 7.795 0 0 0 6.976 6.975c.428.042.778.387.778.817s-.35.776-.778.818a7.795 7.795 0 0 0-6.976 6.975c-.043.429-.387.778-.818.778s-.775-.35-.817-.778a7.795 7.795 0 0 0-6.976-6.975c-.429-.042-.778-.387-.778-.818"}),oe.createElement("path",{fill:"url(#temp_paint1_".concat(t,")"),d:"M16.035 3.442c0-.13.105-.233.234-.245a2.34 2.34 0 0 0 2.092-2.093.253.253 0 0 1 .246-.233c.129 0 .232.105.245.233a2.34 2.34 0 0 0 2.093 2.093.253.253 0 0 1 .233.245c0 .129-.105.232-.233.245a2.34 2.34 0 0 0-2.093 2.093.253.253 0 0 1-.245.233.253.253 0 0 1-.246-.233 2.34 2.34 0 0 0-2.092-2.093.253.253 0 0 1-.234-.245"}),oe.createElement("path",{fill:"url(#temp_paint2_".concat(t,")"),d:"M14.32 21.442c0-.172.14-.31.31-.327a3.12 3.12 0 0 0 2.79-2.79.337.337 0 0 1 .328-.311c.172 0 .31.14.327.311a3.12 3.12 0 0 0 2.79 2.79.337.337 0 0 1 .312.327c0 .172-.14.31-.312.327a3.12 3.12 0 0 0-2.79 2.79.337.337 0 0 1-.327.312.337.337 0 0 1-.327-.312 3.12 3.12 0 0 0-2.79-2.79.337.337 0 0 1-.312-.327"}),oe.createElement("defs",null,oe.createElement("linearGradient",{id:"temp_paint0_".concat(t),x1:"9.174",x2:"9.174",y1:"4.3",y2:"21.441",gradientUnits:"userSpaceOnUse"},oe.createElement("stop",{stopColor:"#E5C8FF"}),oe.createElement("stop",{offset:"1",stopColor:"#BA6DFC"})),oe.createElement("linearGradient",{id:"temp_paint1_".concat(t),x1:"18.607",x2:"18.607",y1:"0.871",y2:"6.013",gradientUnits:"userSpaceOnUse"},oe.createElement("stop",{stopColor:"#E7CBFF"}),oe.createElement("stop",{offset:"1",stopColor:"#F5E9FF"})),oe.createElement("linearGradient",{id:"temp_paint2_".concat(t),x1:"17.748",x2:"17.748",y1:"18.014",y2:"24.871",gradientUnits:"userSpaceOnUse"},oe.createElement("stop",{stopColor:"#E7CBFF"}),oe.createElement("stop",{offset:"1",stopColor:"#F5E9FF"}))))},GD=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 25 24"},ae().createElement("mask",{id:"mask0_1187_1618",style:{maskType:"alpha"},width:"25",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},ae().createElement("path",{fill:"#D9D9D9",d:"M24.81 24H48.81V48H24.81z",transform:"rotate(-180 24.81 24)"})),ae().createElement("g",{mask:"url(#mask0_1187_1618)"},ae().createElement("path",{fill:"#667085",d:"M9.81 5l1.425 1.4-4.6 4.6H22.81v2H6.635l4.575 4.6-1.4 1.4-7-7 7-7z"})))},YD=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 25 24"},ae().createElement("mask",{id:"mask0_1187_1613",style:{maskType:"alpha"},width:"25",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},ae().createElement("path",{fill:"#D9D9D9",d:"M0.191 0H24.191V24H0.191z"})),ae().createElement("g",{mask:"url(#mask0_1187_1613)"},ae().createElement("path",{fill:"#fff",d:"M15.191 19l-1.425-1.4 4.6-4.6H2.191v-2h16.175l-4.575-4.6 1.4-1.4 7 7-7 7z"})))},XD=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"17",fill:"none",viewBox:"0 0 17 17"},ae().createElement("path",{fill:"#B7B9BD",d:"M8.258 15.465c-1.79 0-3.348-.593-4.677-1.78-1.328-1.185-2.09-2.667-2.284-4.442H2.89c.182 1.348.781 2.463 1.799 3.344 1.017.882 2.207 1.322 3.568 1.322 1.516 0 2.803-.528 3.86-1.584 1.056-1.057 1.584-2.343 1.584-3.86s-.528-2.803-1.585-3.86C11.061 3.55 9.774 3.02 8.258 3.02a5.25 5.25 0 00-2.508.623 5.78 5.78 0 00-1.963 1.71h2.138V6.91H1.258V2.243h1.555V4.07a6.791 6.791 0 012.421-1.925 6.946 6.946 0 013.024-.68c.972 0 1.883.185 2.732.554.849.37 1.588.869 2.216 1.497a7.115 7.115 0 011.498 2.217c.37.849.554 1.76.554 2.732 0 .972-.185 1.883-.554 2.732a7.114 7.114 0 01-1.498 2.217 7.117 7.117 0 01-2.216 1.497c-.85.37-1.76.554-2.732.554zm2.178-3.733L7.48 8.776v-4.2h1.556v3.578l2.489 2.489-1.09 1.088z"}))};var KD=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];function ZD(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 JD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ZD(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var eI=function(e,t){var n=e.id,r=e.onChange,o=void 0===r?null:r,i=e.onBlur,a=void 0===i?null:i,l=e.name,s=e.placeholder,c=void 0===s?null:s,u=e.type,d=void 0===u?"text":u,p=(e.withP,e.label),h=e.icon,f=e.typeChange,m=void 0===f?void 0:f,g=e.error,v=Wn(e,KD),y=pe((0,oe.useState)(d),2),b=y[0],w=y[1],k=null!=n?n:l,E={type:b,name:l,id:k},O=null==v?void 0:v.additionalButtons;return(0,oe.useEffect)(function(){m&&w(d)},[]),null!=c&&(E=JD(JD({},E),{},{placeholder:c})),null!=a&&(E=JD(JD({},E),{},{onBlur:a})),null!=o&&(E=JD(JD({},E),{},{onChange:o})),ae().createElement("div",{className:"templately-dmc-input templately-dmc-input-".concat(null!=d?d:"text")},ae().createElement("div",{className:"templately-dmc-input-label-wrapper"},p&&"checkbox"!==d&&"radio"!==d?ae().createElement("label",{htmlFor:k,className:"templately-dmc-input-label"},p):"",O&&O.length>0&&ae().createElement("div",{className:"templately-dmc-input-additional-buttons"},O.map(function(e,t){return ae().createElement(ae().Fragment,{key:t},e)}))),ae().createElement("div",{className:"".concat(m?"has-change-button":""," ").concat(h?"has-icon":""," ").concat(null!=g&&g.hasError?"has-error":"")},null!=h?h:"",ae().createElement("input",re({ref:t},E,v)),m?ae().createElement("button",{onClick:function(){w(b===d?null==m?void 0:m.type:d)}},b===d?null==m?void 0:m.primaryText:null==m?void 0:m.secondaryText):""),!p||"checkbox"!==d&&"radio"!==d?"":ae().createElement("label",{htmlFor:k,className:"templately-dmc-input-label"},p),(null==g?void 0:g.hasError)&&ae().createElement("div",{className:"templately-dmc-error-message"},ae().createElement(zn,null),null==g?void 0:g.errorMessage))};const tI=ae().forwardRef(eI),nI=window.wp.components,rI=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22"},ae().createElement("path",{d:"M12.778 11L5 3.222 7.222 1l10 10-10 10L5 18.778 12.778 11z"}))},oI=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",fill:"none",viewBox:"0 0 11 11"},ae().createElement("path",{fill:"#475467",d:"M1.658 10.465l-1.4-1.4 3.6-3.6-3.6-3.575 1.4-1.4 3.6 3.6L8.833.49l1.4 1.4-3.6 3.575 3.6 3.6-1.4 1.4-3.575-3.6-3.6 3.6z"}))},iI=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"51",height:"52",fill:"none",viewBox:"0 0 51 52"},ae().createElement("rect",{width:"44",height:"44",x:"3.5",y:"4.142",fill:"#F2F4F7",rx:"22"}),ae().createElement("g",{clipPath:"url(#clip0_397_310)"},ae().createElement("path",{fill:"#475467",d:"M14.5 28.642a6.495 6.495 0 013.064-5.52 8.001 8.001 0 0115.872 0 6.5 6.5 0 01-2.936 12l-10 .02c-3.356-.274-6-3.078-6-6.5zm15.848 4.487a4.5 4.5 0 002.03-8.31l-.807-.502-.12-.942a6.001 6.001 0 00-11.903 0l-.12.942-.805.503a4.5 4.5 0 002.029 8.309l.173.013h9.35l.173-.013zM26.5 27.142v4h-2v-4h-3l4-5 4 5h-3z"})),ae().createElement("rect",{width:"44",height:"44",x:"3.5",y:"4.142",stroke:"#F9FAFB",strokeWidth:"7",rx:"22"}),ae().createElement("defs",null,ae().createElement("clipPath",{id:"clip0_397_310"},ae().createElement("path",{fill:"#fff",d:"M0 0H24V24H0z",transform:"translate(13.5 14.142)"}))))};var aI=function(e){var t=e.name,n=e.color,r=e.setColor,o=e.defaultColor,i=e.setColorPickerOpen,a=pe((0,oe.useState)(!1),2),l=a[0],s=a[1],c=(0,oe.useRef)(null);return(0,oe.useEffect)(function(){i(l)},[l]),function(e){(0,oe.useEffect)(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&s(!1)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[e])}(c),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-colorpicker-wrap",ref:c},ae().createElement("span",{"data-templately-tooltip":(0,At.__)("".concat(t),"templately"),className:"templately-colorpicker-screen tt-top tt-black",onClick:function(){return s(!l)}},ae().createElement("span",{className:"templately-picker-display",style:{backgroundColor:n}})),l&&ae().createElement("div",{className:"templately-colorpicker"},ae().createElement("span",{className:"templately-title"},t),ae().createElement(nI.ColorPicker,{color:n,onChangeComplete:function(e){return r(e.hex)},enableAlpha:!0,defaultValue:null!=n?n:o}))))};const lI=function(e){var t,n=e.title,r=e.children,o=e.current,i=e.setCurrent,a=e.id,l=pe((0,oe.useState)(null!==(t=e.initialCollapsed)&&void 0!==t&&t),2),s=l[0],c=l[1];return(0,oe.useEffect)(function(){null!=o&&null!=a&&c(o!=a)},[o]),ae().createElement("div",{className:"templately-new-collapser"},ae().createElement("div",{className:"templately-new-collapser-header ".concat(s?"collapsed":"show"),onClick:function(){null!=o&&null!=a?i(s?a:-1):c(!s)}},ae().createElement("h4",{className:"templately-title"},n),ae().createElement("div",{className:"templately-icon"},ae().createElement(Cn,null))),ae().createElement("div",{className:"templately-new-collapser-body ".concat(s?"collapsed":"show")},ae().createElement("div",{className:"templately-new-collapser-body-inner"},r)))};var sI=o(124);function cI(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 uI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dI=function(e,t){var n=kn(),r=Sn(function(e){var t;return null!==(t=e.general.fullSiteImport.cache_data)&&void 0!==t?t:{}}),o=pe((0,oe.useState)(function(){var n;return null!==(n=r[e])&&void 0!==n?n:t}),2),i=o[0],a=o[1];return(0,oe.useEffect)(function(){void 0!==r[e]&&a(r[e])},[r]),[i,function(t){t=(0,_a.isFunction)(t)?t(i):t,a(t),n({type:ni,payload:{type:e,value:t}})},function(e){return i}]},pI=["Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"],hI=function(e,t){if(e&&"Default"!==e&&!pI.includes(e)){var n={ru_RU:"cyrillic",uk:"cyrillic",bg_BG:"cyrillic",vi:"vietnamese",el:"greek",he_IL:"hebrew"},r="https://fonts.googleapis.com/css?family="+e+":100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic";n[t]&&(r+="&subset="+n[t]);var o='link[href="'+r+'"]',i=document.createElement("link");if(i.href=r,i.rel="stylesheet",i.type="text/css",i.crossOrigin="anonymous",!document.querySelector(o)){var a=document.querySelectorAll("link"),l=a[a.length-1];l?l.after(i):document.body.appendChild(i)}}};function fI(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 mI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fI(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const gI=function(e){var t,n,r=e.label,o=e.title,i=void 0===o?"":o,a=e.screen,l=e.setScreen,s=e.field,c=e.typography,u=e.setTypography,d=null!==(t=c[s][a].value)&&void 0!==t?t:"",p=null!==(n=c[s][a].unit)&&void 0!==n?n:"px",h=function(e,t){var n=t[e]||{};return uI(uI({},{px:{min:0,max:100,step:1},em:{min:.1,max:10,step:.1},rem:{min:.1,max:10,step:.1},vh:{min:0,max:100,step:1},vw:{min:0,max:100,step:1}}[e]),n)}(p,{selectedSize:{px:{min:1,max:200},em:{max:20},rem:{max:20},vw:{min:.1,max:10,step:.1}},selectedLetterSpacing:{px:{min:-5,max:10,step:.1},em:{min:0,max:1,step:.01},rem:{min:0,max:1,step:.01}},selectedLineHeight:{px:{min:1}}}[s]),f=h.min,m=h.max,g=h.step,v=Math.max(f,Math.min(m,d)),y=function(e){u("".concat(s,".").concat(a,".value"),e),c[s][a].unit||u("".concat(s,".").concat(a,".unit"),p)},b=function(e){l(e)};return(0,oe.useEffect)(function(){c[s][a].unit||u("".concat(s,".").concat(a,".unit"),"px")},[]),ae().createElement("div",{className:"templately-typography-picker-field"},ae().createElement("label",{className:"templately-typography-picker-field-label"},ae().createElement("span",{title:i},r),ae().createElement("div",{className:"templately-device-dropdown"},ae().createElement("button",{className:"templately-device-dropdown-selected"},"desktop"===a?ae().createElement("span",{className:"dashicons dashicons-desktop"}):"tablet"===a?ae().createElement("span",{className:"dashicons dashicons-tablet"}):ae().createElement("span",{className:"dashicons dashicons-smartphone"})),ae().createElement("ul",{className:"templately-device-dropdown-menu"},ae().createElement("li",{className:"templately-device-dropdown-menu-item ".concat("desktop"===a?"active":""),onClick:function(){return b("desktop")}},ae().createElement("span",{className:"dashicons dashicons-desktop"})),ae().createElement("li",{className:"templately-device-dropdown-menu-item ".concat("tablet"===a?"active":""),onClick:function(){return b("tablet")}},ae().createElement("span",{className:"dashicons dashicons-tablet"})),ae().createElement("li",{className:"templately-device-dropdown-menu-item ".concat("mobile"===a?"active":""),onClick:function(){return b("mobile")}},ae().createElement("span",{className:"dashicons dashicons-smartphone"}))))),ae().createElement("div",{className:"templately-typography-picker-field-inner"},ae().createElement(nI.TextControl,{min:f,max:m,step:g,value:d,onChange:y,type:"number",label:"Text Control",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),ae().createElement(nI.SelectControl,{value:p||defaultUnit,onChange:function(e){u("".concat(s,".").concat(a),{unit:e,value:null})},options:[{label:"PX",value:"px"},{label:"EM",value:"em"},{label:"REM",value:"rem"},{label:"VW",value:"vw"},{label:"VH",value:"vh"}],label:"Select Option",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),ae().createElement(sI.Range,{values:[v],step:g,min:f,max:m,onChange:function(e){return y(e[0])},renderTrack:function(e){var t=e.props,n=e.children;return ae().createElement("div",{onMouseDown:t.onMouseDown,onTouchStart:t.onTouchStart,style:mI(mI({},t.style),{},{height:"12px",display:"flex",width:"100%"})},ae().createElement("div",{ref:t.ref,style:{height:"2px",width:"100%",borderRadius:"2px",background:(0,sI.getTrackBackground)({values:[v],colors:["#798294","#798294"],min:f,max:m}),alignSelf:"center"}},n))},renderThumb:function(e){var t=e.props,n=e.isDragged;return ae().createElement("div",re({},t,{key:t.key,style:mI(mI({},t.style),{},{height:"12px",width:"12px",borderRadius:"12px",backgroundColor:"#D0D5DD",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0px 2px 6px rgba(16, 24, 40, 0.059)"})}),ae().createElement("div",{style:{height:"12px",width:"12px",borderRadius:"12px",backgroundColor:n?"#548BF4":"#D0D5DD"}}))}})))};var vI=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function yI(e,t){return e===t||!(!vI(e)||!vI(t))}function bI(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!yI(e[n],t[n]))return!1;return!0}const wI=function(e,t){var n;void 0===t&&(t=bI);var r,o=[],i=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&n===this&&t(a,o)||(r=e.apply(this,a),i=!0,n=this,o=a),r}};var kI="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function EI(e){cancelAnimationFrame(e.id)}var OI=-1;function xI(e){if(void 0===e&&(e=!1),-1===OI||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),OI=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return OI}var SI=null;function _I(e){if(void 0===e&&(e=!1),null===SI||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?SI="positive-descending":(t.scrollLeft=1,SI=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),SI}return SI}var CI=function(e,t){return e};function PI(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,s=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=s(r.props,Bd(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:Bd(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=wI(function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})}),r._callOnScroll=void 0,r._callOnScroll=wI(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,i=r.props,a=i.direction,l=i.itemSize,s=i.layout,u=r._getItemStyleCache(c&&l,c&&s,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),p=o(r.props,e,r._instanceProps),h="horizontal"===a||"horizontal"===s,f="rtl"===a,m=h?d:0;u[e]=t={position:"absolute",left:f?void 0:m,right:f?m:void 0,top:h?0:d,height:h?"100%":p,width:h?p:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=wI(function(e,__,t){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===o)return null;var t=r.props.direction,a=o;if("rtl"===t)switch(_I()){case"negative":a=-o;break;case"positive-descending":a=i-n-o}return a=Math.max(0,Math.min(a,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;r.setState(function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,o;null!==r._resetIsScrollingTimeoutId&&EI(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=kI(),o={id:requestAnimationFrame(function r(){kI()-n>=t?e.call(null):o.id=requestAnimationFrame(r)})})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}(function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,jd(e,t)})(t,e),t.getDerivedStateFromProps=function(e,t){return TI(e,t),u(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,o=n.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var l=0;if(this._outerRef){var s=this._outerRef;l="vertical"===o?s.scrollWidth>s.clientWidth?xI():0:s.scrollHeight>s.clientHeight?xI():0}this.scrollTo(i(this.props,e,t,a,this._instanceProps,l))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===r?o.scrollLeft=n:o.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,o=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(_I()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},d.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&EI(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,i=e.height,a=e.innerRef,l=e.innerElementType,s=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,p=void 0===d?CI:d,h=e.layout,f=e.outerElementType,m=e.outerTagName,g=e.style,v=e.useIsScrolling,y=e.width,b=this.state.isScrolling,w="horizontal"===o||"horizontal"===h,k=w?this._onScrollHorizontal:this._onScrollVertical,E=this._getRangeToRender(),O=E[0],x=E[1],S=[];if(c>0)for(var _=O;_<=x;_++)S.push((0,oe.createElement)(t,{data:u,key:p(_,u),index:_,isScrolling:v?b:void 0,style:this._getItemStyle(_)}));var C=r(this.props,this._instanceProps);return(0,oe.createElement)(f||m||"div",{className:n,onScroll:k,ref:this._outerRefSetter,style:re({position:"relative",height:i,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},g)},(0,oe.createElement)(l||s||"div",{children:S,ref:a,style:{height:w?"100%":C,pointerEvents:b?"none":void 0,width:w?C:"100%"}}))},d._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],o=e[3];this._callOnItemsRendered(t,n,r,o)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,l=i.scrollOffset,s=i.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,o=r.isScrolling,i=r.scrollDirection,s=r.scrollOffset;if(0===t)return[0,0,0,0];var c=a(this.props,s,this._instanceProps),u=l(this.props,c,s,this._instanceProps),d=o&&"backward"!==i?1:Math.max(1,n),p=o&&"forward"!==i?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+p)),c,u]},t}(oe.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var TI=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},AI=function(e,t,n){var r=e.itemSize,o=n.itemMetadataMap,i=n.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var l=o[i];a=l.offset+l.size}for(var s=i+1;s<=t;s++){var c=r(s);o[s]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return o[t]},MI=function(e,t,n,r,o){for(;r<=n;){var i=r+Math.floor((n-r)/2),a=AI(e,i,t).offset;if(a===o)return i;a<o?r=i+1:a>o&&(n=i-1)}return r>0?r-1:0},NI=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=n&&(i=n-1),i>=0){var l=r[i];a=l.offset+l.size}return a+(n-i-1)*o},DI=PI({getItemOffset:function(e,t,n){return AI(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:NI,getOffsetForIndexAndAlignment:function(e,t,n,r,o,i){var a=e.direction,l=e.height,s=e.layout,c=e.width,u="horizontal"===a||"horizontal"===s?c:l,d=AI(e,t,o),p=NI(e,o),h=Math.max(0,Math.min(p-u,d.offset)),f=Math.max(0,d.offset-u+d.size+i);switch("smart"===n&&(n=r>=f-u&&r<=h+u?"auto":"center"),n){case"start":return h;case"end":return f;case"center":return Math.round(f+(h-f)/2);default:return r>=f&&r<=h?r:r<f?f:h}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?r[o].offset:0)>=n?MI(e,t,o,0,n):function(e,t,n,r){for(var o=e.itemCount,i=1;n<o&&AI(e,n,t).offset<r;)n+=i,i*=2;return MI(e,t,Math.min(n,o-1),Math.floor(n/2),r)}(e,t,Math.max(0,o),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var o=e.direction,i=e.height,a=e.itemCount,l=e.layout,s=e.width,c="horizontal"===o||"horizontal"===l?s:i,u=AI(e,t,r),d=n+c,p=u.offset+u.size,h=t;h<a-1&&p<d;)h++,p+=AI(e,h,r).size;return h},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}}),II=["options","children","maxHeight","getValue","loadedFonts"];function LI(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 RI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var jI=ae().createContext({}),FI=function(e){var t=e.children,n=e.index,r=(e.style,e.isScrolling),o=ae().useContext(jI),i=o.setSize,a=o.windowWidth,l=o.loadedFonts,s=o.options,c=ae().useRef(),u=s[n];return(0,oe.useEffect)(function(){r||!u.value||l.current.includes(u.value)||(hI(u.value,window.templately.locale),l.current=[].concat(Ul(l.current),[u.value]))},[]),(0,oe.useEffect)(function(){i(n,c.current.getBoundingClientRect().height)},[a]),ae().createElement("div",{ref:c},t)};function zI(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 BI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zI(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const WI=function(e){e.normalizedTypography;var t=e.setShowPicker,n=e.typography,r=e.setTypography,o=e.fontList,i=e.reset,a=e.screen,l=e.setScreen,s=[{label:"Default",value:""},{label:"Uppercase",value:"uppercase"},{label:"Lowercase",value:"lowercase"},{label:"Capitalize",value:"capitalize"},{label:"Normal",value:"none"}],c=[{label:"Default",value:""},{label:"Overline",value:"overline"},{label:"Line Through",value:"line-through"},{label:"Underline",value:"underline"},{label:"Underline Overline",value:"underline overline"},{label:"Initial",value:"initial"},{label:"None",value:"none"}],u=[{value:"100",label:"100 (Thin)"},{value:"200",label:"200 (Extra Light)"},{value:"300",label:"300 (Light)"},{value:"400",label:"400 (Normal)"},{value:"500",label:"500 (Medium)"},{value:"600",label:"600 (Semi Bold)"},{value:"700",label:"700 (Bold)"},{value:"800",label:"800 (Extra Bold)"},{value:"900",label:"900 (Black)"},{value:"",label:"Default"},{value:"normal",label:"Normal"},{value:"bold",label:"Bold"}];return(0,oe.useEffect)(function(){hI(n.selectedFont,window.templately.locale)},[n.selectedFont]),ae().createElement("td",{className:"templately-typography-picker"},ae().createElement("div",{className:"templately-typography-picker-title-wrapper"},ae().createElement("div",{className:"templately-typography-picker-title-inner"},ae().createElement("h4",{className:"templately-typography-picker-title"},null==n?void 0:n.title),ae().createElement("button",{className:"templately-color-picker-reset-button",onClick:i},ae().createElement(XD,null))),ae().createElement("button",{className:"templately-color-picker-close-button",onClick:function(){return t(!1)}},ae().createElement(oI,null))),ae().createElement("div",{className:"templately-typography-picker-preview",style:{fontFamily:n.selectedFont,fontSize:"40px",lineHeight:"1.5"}},"Ag"),ae().createElement("div",{className:"templately-typography-picker-field"},ae().createElement("label",{htmlFor:"",className:"templately-typography-picker-field-label"},"Family"),ae().createElement("div",{className:"templately-typography-picker-field-inner"},ae().createElement(Fg,{isSearchable:!0,menuPlacement:"top",value:o.find(function(e){return e.value===n.selectedFont}),options:o,onChange:function(e){return r("selectedFont",e.value)},components:{MenuList:function(t){return function(e){var t,n=e.options,r=e.children,o=e.maxHeight,i=e.getValue,a=e.loadedFonts,l=(Wn(e,II),pe(i(),1)[0]),s=null!==(t=n.indexOf(l))&&void 0!==t?t:0,c=ae().useRef(),u=ae().useRef({}),d=ae().useCallback(function(e,t){var n;u.current=RI(RI({},u.current),{},Tt({},e,t)),null===(n=c.current)||void 0===n||n.resetAfterIndex(e)},[]),p=function(){var e=pe((0,oe.useState)([0,0]),2),t=e[0],n=e[1];return(0,oe.useLayoutEffect)(function(){function e(){n([window.innerWidth,window.innerHeight])}return window.addEventListener("resize",e),e(),function(){return window.removeEventListener("resize",e)}},[]),t}(),h=pe(p,1)[0];return(0,oe.useEffect)(function(){var e;null===(e=c.current)||void 0===e||e.scrollToItem(s,"center")},[]),ae().createElement(jI.Provider,{value:{setSize:d,windowWidth:h,loadedFonts:a,options:n,listRef:c}},ae().createElement("div",null,ae().createElement(DI,{useIsScrolling:!0,height:o,itemSize:function(e){return u.current[e]||35},itemCount:r.length,ref:c},function(e){var t=e.index,o=e.style,i=(e.data,e.isScrolling);return ae().createElement("div",{style:RI(RI({},o),{},{fontFamily:n[t].value})},ae().createElement(FI,{index:t,style:o,isScrolling:i},r[t]))})))}(BI(BI({},t),{},{loadedFonts:e.loadedFonts}))}},className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))),ae().createElement(gI,{label:"Size",screen:a,setScreen:l,typography:n,setTypography:r,field:"selectedSize"}),ae().createElement(gI,{label:"Line",title:"Line Height",screen:a,setScreen:l,field:"selectedLineHeight",typography:n,setTypography:r}),ae().createElement(gI,{label:"Letter",title:"Letter Spacing",screen:a,setScreen:l,field:"selectedLetterSpacing",typography:n,setTypography:r}),ae().createElement("div",{className:"templately-typography-picker-field"},ae().createElement("label",{htmlFor:"",className:"templately-typography-picker-field-label"},"Weight"),ae().createElement("div",{className:"templately-typography-picker-field-inner"},ae().createElement(Fg,{isSearchable:!0,menuPlacement:"top",value:u.find(function(e){return e.value===n.selectedFontWeight}),options:u,onChange:function(e){return r("selectedFontWeight",e.value)},className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))),ae().createElement("div",{className:"templately-typography-picker-field"},ae().createElement("label",{htmlFor:"",className:"templately-typography-picker-field-label"},"Transform"),ae().createElement("div",{className:"templately-typography-picker-field-inner"},ae().createElement(Fg,{isSearchable:!0,menuPlacement:"top",defaultValue:s.find(function(e){return e.value==n.transform}),onChange:function(e){return r("transform",e.value)},options:s,className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))),ae().createElement("div",{className:"templately-typography-picker-field"},ae().createElement("label",{htmlFor:"",className:"templately-typography-picker-field-label"},"Decoration"),ae().createElement("div",{className:"templately-typography-picker-field-inner"},ae().createElement(Fg,{isSearchable:!0,menuPlacement:"top",defaultValue:c.find(function(e){return e.value==n.decoration}),onChange:function(e){return r("decoration",e.value)},options:c,className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))))};var UI=function(e){var t=e.setTypographyPickerOpen,n=e.normalizedTypography,r=e.typography,o=e.setTypography,i=e.fontList,a=e.reset,l=e.screen,s=e.setScreen,c=pe((0,oe.useState)(!1),2),u=c[0],d=c[1],p=(0,oe.useRef)(null);return(0,oe.useEffect)(function(){t(u)},[u]),function(e){(0,oe.useEffect)(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&d(!1)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[e])}(p),(0,oe.useEffect)(function(){null!=r&&r.selectedFont&&hI(r.selectedFont,window.templately.locale)},[r,null==r?void 0:r.selectedFont]),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-typography-panel-item",ref:p,key:null==r?void 0:r._id},ae().createElement("div",{className:"templately-typography-mini-preview",style:{fontFamily:null==r?void 0:r.selectedFont}},"Ag"),ae().createElement("div",{className:"templately-typography-title"},null==r?void 0:r.title),ae().createElement("div",{className:"templately-typography-popup-button",onClick:function(){return d(!u)}},ae().createElement(Ln,null)),u&&ae().createElement(WI,{normalizedTypography:n,setShowPicker:d,typography:r,setTypography:o,fontList:i,reset:a,screen:l,setScreen:s,loadedFonts:e.loadedFonts})))};function VI(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 HI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var qI=function(e){var t=e.normalizedTypography,n=e.selectedTypography,r=e.setSelectedTypography,o=e.groupedData,i=e.setTypographyPickerOpen,a=e.fontList,l=e.screen,s=e.setScreen,c=(0,oe.useRef)([]);if((0,_a.isEmpty)(t))return React.createElement(React.Fragment,null);var u=(0,oe.useMemo)(function(){var e=pI.map(function(e){return{value:e,label:e}});return[{value:"",label:(0,At.__)("Default","templately")},{label:(0,At.__)("System","templately"),isDisabled:!0}].concat(Ul(e),[{label:(0,At.__)("Google","templately"),isDisabled:!0}],Ul(a))},[a]),d=pe((0,oe.useState)(-1),2),p=d[0],h=d[1];return React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-color-picker-section"},React.createElement("div",{className:"templately-color-picker-section-label-wrapper"},React.createElement("div",{style:{display:"flex",alignItems:"center",gap:10}},React.createElement("label",{className:"templately-color-picker-section-label"},"Typography"),React.createElement("div",{className:"templately-device-tab"},React.createElement("button",{className:"templately-device-tab-button ".concat("desktop"===l?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return s("desktop")}},React.createElement("span",{className:"dashicons dashicons-desktop"})),React.createElement("button",{className:"templately-device-tab-button ".concat("tablet"===l?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return s("tablet")}},React.createElement("span",{className:"dashicons dashicons-tablet"})),React.createElement("button",{className:"templately-device-tab-button ".concat("mobile"===l?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return s("mobile")}},React.createElement("span",{className:"dashicons dashicons-smartphone"})))),React.createElement("button",{className:"templately-color-picker-reset-button",onClick:function(){r(t)}},React.createElement(XD,null))),React.createElement("div",{className:"templately-typography-panel-wrapper"},o.map(function(e,o){var a=e.key,d=e.items;return React.createElement(lI,{title:a,key:a,initialCollapsed:!0,current:p,setCurrent:h,id:o},React.createElement("div",{className:"templately-typography-panel"},d&&d.map(function(e){var o=e._id;return React.createElement(UI,{key:o,setTypographyPickerOpen:i,reset:function(){return function(e){r(HI(HI({},n),{},Tt({},e,t[e])))}(o)},normalizedTypography:t,typography:n[o],setTypography:function(e,t){return function(e,t,n){r(function(r){var o=Va(r[e],t,n);return HI(HI({},r),{},Tt({},e,o))})}(o,e,t)},fontList:u,screen:l,setScreen:s,loadedFonts:c})})))}))))},QI=["data","image_mappings"];function $I(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 GI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var YI=function(e){var t,n,r,o=e.name,i=e.id,a=e.next,l=e.back,s=e.formData,c=e.live_url,u=e.has_settings,d=e.showErrorAlert,p=e.isAi,h=e.disableBackButton,f=e.setShowFSIModal,m=e.ogIsAi,g=(e.startModifyAiContent,e.platform),v=e.aiTemplates,y=e.customizerData,b=(e.onHideFSIModal,e.onShowAiSidebar),w=e.isWhiteLabel;if(e.onGenerateLogo,e.onGenerateMeta,e.aiMetaGenContent,!y)return console.error("CustomizerIsolated: customizerData prop is missing"),ae().createElement("div",null,"Error: Customizer data not available");y.packInfo,y.googleFonts,y.packInfoLoading,y.googleFontsLoading;var k=y.fetchPackImportInfo,E=y.fetchGoogleFonts,O=y.aiData,x=(y.setAiData,y.title),S=y.setTitle,_=y.slogan,C=y.setSlogan,P=y.siteLogo,T=y.setSiteLogo,A=y.logoSrc,M=y.setLogoSrc,N=y.logoSize,D=y.setLogoSize,I=y.color,L=y.setColor,R=y.currentStep,j=y.setCurrentStep,F=y.settingsLoaded,z=y.setSettingsLoaded,B=y.systemColors,W=y.setSystemColors,U=y.originalTypography,V=y.setOriginalTypography,H=y.fontList,q=y.setFontList,Q=uv(U,g),$=Q.normalizedTypography,G=Q.groupedData,Y=Q.getDeNormalizedTypography,X=pe((0,oe.useState)(function(){return $}),2),K=X[0],Z=X[1],J=(0,oe.useRef)(U),ee=pe((0,oe.useState)(!0),2),te=ee[0],ne=ee[1],re=pe((0,oe.useState)(!0),2),ie=re[0],le=re[1],se=pe((0,oe.useState)(!1),2),ce=se[0],ue=se[1],de=pe((0,oe.useState)(!1),2),he=de[0],fe=de[1],me=pe((0,oe.useState)(Math.random()),2),ge=me[0],ve=(me[1],pe((0,oe.useState)(!1),2)),ye=ve[0],be=(ve[1],(0,oe.useRef)(),(0,oe.useRef)(),null==o?void 0:o.split("-")),we=(0,oe.useMemo)(function(){return v||{templates:null,process_id:null,ai_page_ids:null}},[v]);(0,oe.useEffect)(function(){},[R]);var ke=(0,oe.useCallback)(function(e){var t=Y(e);if("gutenberg"===g){t.custom={};for(var n=0,r=Object.entries(e);n<r.length;n++){var o=pe(r[n],2),i=o[0];o[1]._isSystem||(t.custom[i]=t[i],delete t[i])}}s.set("typography",JSON.stringify(t))},[Y,g,s]),Ee=(0,oe.useCallback)(function(e){Z(e)},[]);(0,oe.useEffect)(function(){J.current===U||(0,_a.isEmpty)($)||(J.current=U,Z($))},[U,$]);var Oe=(0,_a.throttle)(function(e,t,n,r){var o,i,a={type:"templately_css_variable",log:(null===(o=window.templately)||void 0===o?void 0:o.log)||!1,platform:g,logo:A,color:e,logoSize:t,typography:{selectedTypography:n,screen:r,locale:"en"}};null===(i=Te.current.contentWindow)||void 0===i||i.postMessage(a,"*")},500),xe=(0,oe.useMemo)(function(){return(0,_a.throttle)(function(e){var t,n=GI({type:"templately_ai_data",aiData:e.data,imageMappings:e.image_mappings||null},Wn(e,QI)),r=Te.current;null!=r&&r.contentWindow&&(r.contentWindow.postMessage(n,"*"),null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.log&&Ja("Throttled consolidated AI data and image mappings sent to iframe:",n))},500)},[g]),Se=(0,oe.useCallback)(function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"postMessage";if(null!=we&&we.templates||O){var o=(null===(e=we.ai_page_ids)||void 0===e?void 0:e["content/page"])||[],i={plugin_preview:ge,has_ai_json:"true",platform:g,dev_mode:(null===(t=window.templatelyDeveloper)||void 0===t?void 0:t.dev_api)||!1,log:(null===(n=window.templatelyDeveloper)||void 0===n?void 0:n.log)||!1,processBackgroundImages:!0,ai_page_ids:o,isWhiteLabel:null!=w&&w},a={use_partial_ai_content:!0,data:O||we.templates};we.imageMappings&&Object.keys(we.imageMappings).length>0&&(a.image_mappings=we.imageMappings);var l=GI(GI({},i),a);"postMessage"===r?xe(l):"form"===r&&("string"==typeof c&&c.trim()?function(e,t,n){if(e&&n){var r=document.createElement("form");r.method="POST",r.action=(0,Ci.addQueryArgs)(e,t),r.target="customizer-iframe",Object.keys(n).forEach(function(e){var t=document.createElement("input");t.type="hidden",t.name=e,t.value=JSON.stringify(n[e]),r.appendChild(t)}),document.body.appendChild(r),r.submit(),setTimeout(function(){document.body.removeChild(r)},200)}}(c,i,a):console.error("CustomizerIsolated: live_url is not a valid string for form submission:",c))}},[O,we,xe,g,ge,c]),_e=pe((0,oe.useState)("desktop"),2),Ce=_e[0],Pe=_e[1],Te=(0,oe.useRef)(),Ae=pe((0,oe.useState)(0),2),Me=Ae[0],Ne=Ae[1];return(0,oe.useEffect)(function(){Me&&Se("postMessage")},[O,Me,Se,we]),(0,oe.useEffect)(function(){if(u&&!1===(null==y?void 0:y.initialFetchAttempted)&&k&&E){var e=function(){var e=Ei(xi().mark(function e(){var t;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Promise.all([k(i,p),E()]);case 1:e.next=3;break;case 2:e.prev=2,t=e.catch(0),console.error("Failed to load settings:",t),d&&d((0,At.__)("Failed to load customizer settings. Please try again.","templately"));case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();e()}},[u,i,p,k,E,d,null==y?void 0:y.initialFetchAttempted]),(0,oe.useEffect)(function(){var e,t=null==y?void 0:y.packInfo;if(null!=t&&t.data&&null!==(e=t.data)&&void 0!==e&&null!==(e=e.manifest)&&void 0!==e&&e.has_settings&&t.data.settings){var n=t.data.settings,r="elementor"===g,o=lv(n,g),i=o.colors,a=o._systemColors;if(W(a),(0,_a.isEmpty)(I)&&L(i),(0,_a.isEmpty)(U)){var l=cv(n,g),s=l.systemTypography,c=l.customTypography;V({systemTypography:s,customTypography:c})}if(z(!0),r){var u=n.site_logo;null!=u&&u.url&&T(u.url)}else{var d=n.logo;null!=d&&d.url&&T(null==d?void 0:d.url)}}else null!=t&&t.data&&null!==t.data&&z(0)},[null==y||null===(t=y.packInfo)||void 0===t?void 0:t.data,g]),(0,oe.useEffect)(function(){var e,t=null==y?void 0:y.packInfo;null!=t&&t.error&&(z(0),d(t.error),null!==(e=window.templately)&&void 0!==e&&e.log&&console.error("Pack info error:",t.error))},[null==y||null===(n=y.packInfo)||void 0===n?void 0:n.error]),(0,oe.useEffect)(function(){var e,t=null==y?void 0:y.googleFonts;(null==t||null===(e=t.data)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.length)>0&&q(t.data.data.map(function(e){return{value:e.family,label:e.family,variants:e.variants.map(function(e){return{value:e,label:e}})}}))},[null==y||null===(r=y.googleFonts)||void 0===r?void 0:r.data]),(0,oe.useEffect)(function(){Me>0&&Oe(I,N,K,Ce)},[I,N,K,Ce,Me,Oe]),(0,oe.useEffect)(function(){var e=function(t){var n,r;if("templately_preview_window_loaded"===(null===(n=t.data)||void 0===n?void 0:n.type))return le(!1),void Ne(function(e){return e+1});"templately_css_variable"===(null===(r=t.data)||void 0===r?void 0:r.type)&&t.data.logoWidth&&(D(parseFloat(t.data.logoWidth)),window.removeEventListener("message",e))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}},[g]),(0,oe.useEffect)(function(){we.session_id&&(s.set("session_id",we.session_id),s.set("process_id",we.process_id)),we.templates&&(Ja("AI templates detected:",we.templates),Se("form"))},[we,Se]),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-dependency-modal-customizer"},ae().createElement("div",{className:"templately-dependency-modal-customizer-left ".concat(te?"show":"hide")},ae().createElement("div",{className:"templately-dmc-header"},ae().createElement("p",{className:"templately-dmc-header-label",onDoubleClick:function(){var e,t;(null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.dev_api||null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_mode)&&Se("form")}},"Template Name:"),ae().createElement("h2",{className:"templately-dmc-header-title",onDoubleClick:function(){var e,t;(null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.dev_api||null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_mode)&&Se("postMessage")}},o),h?null:ae().createElement("button",{className:"templately-dmc-header-close-button",onClick:function(){return f()}},ae().createElement(oI,null)),ae().createElement("button",{className:"templately-dmc-header-toggle-button ".concat(te?"show":"hide"),onClick:function(){return ne(!te)}},ae().createElement(rI,null))),ae().createElement("div",{className:"templately-dmc-body"},ae().createElement("div",{className:"templately-dmc-body-inner"},0===R&&ae().createElement(ae().Fragment,null,ae().createElement(tI,{type:"text",name:"page_title",placeholder:be[0]?"i.e: ".concat(be[0]):"",label:(0,At.__)("Site Title","templately"),additionalButtons:[],value:x,onChange:function(e){return S(e.target.value)}}),ae().createElement(tI,{type:"text",name:"page_name",placeholder:be[1]?"i.e: ".concat(be[1]):"",label:(0,At.__)("Site Tagline","templately"),additionalButtons:[],value:_,onChange:function(e){return C(e.target.value)}}),u&&!0===F&&ae().createElement("div",{className:"templately-dmc-file-uploader-wrapper"},ae().createElement("div",{className:"templately-title-wrapper"},ae().createElement("h4",{className:"templately-title"},"Upload a logo")),ae().createElement("p",{className:"templately-info"},"Upload a logo for your site. You can upload/update it anytime later."),ae().createElement(VM.MediaUpload,{onSelect:function(e){if(null!=e&&e.url){s.set("logo",JSON.stringify({id:e.id,url:e.url}));var t=function(e){var t;return e&&(null===(t=window.templately)||void 0===t?void 0:t.is_ssl)&&/^http:\/\//i.test(e)?e.replace(/^http:\/\//i,"https://"):e}(e.url);fetch(t).then(function(e){return e.blob()}).then(function(e){var t=new FileReader;t.onloadend=function(){M(t.result)},t.readAsDataURL(e)}).catch(function(t){Ja("Failed to convert logo to base64:",t),M(e.url)})}},allowedTypes:["image"],value:A,render:function(e){var t=e.open;return ae().createElement("button",{onClick:t,className:"templately-dmc-file-uploader"},ae().createElement("span",{className:"icon"},A&&ae().createElement(ae().Fragment,null,ae().createElement("span",{className:"templately-dmc-file-remove-button",onClick:function(e){e.preventDefault(),e.stopPropagation(),M(""),s.delete("logo")}},ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 -0.5 21 21"},ae().createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},ae().createElement("g",{fill:"#fff",transform:"translate(-179 -360)"},ae().createElement("g",{transform:"translate(56 160)"},ae().createElement("path",{d:"M130.35 216h2.1v-8h-2.1v8zm4.2 0h2.1v-8h-2.1v8zm-6.3 2h10.5v-12h-10.5v12zm2.1-14h6.3v-2h-6.3v2zm8.4 0v-4h-10.5v4H123v2h3.15v14h14.7v-14H144v-2h-5.25z"})))))),ae().createElement("img",{src:A,alt:""})),!A&&ae().createElement(iI,null)),ae().createElement("span",{className:"content"},ae().createElement("span",{className:"title"},ae().createElement("span",{className:"highlighted"},"Click to upload")," logo"),ae().createElement("span",{className:"info"},"SVG, PNG, JPG or GIF (max. 800x400 px)")))}}),A&&ae().createElement(ae().Fragment,null,ae().createElement("br",null),ae().createElement(nI.RangeControl,{label:"Logo Width (px)",value:N,onChange:function(e){D(e)},min:20,max:800})))),1===R&&u&&!0===F&&ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-color-picker-section"},ae().createElement("div",{className:"templately-color-picker-section-label-wrapper"},ae().createElement("label",{className:"templately-color-picker-section-label"},"Select Color"),ae().createElement("button",{className:"templately-color-picker-reset-button",onClick:function(){var e={};B.forEach(function(t){e[t._id]=t.color}),L(e)}},ae().createElement(XD,null))),ae().createElement("div",{className:"templately-color-picker-panel"},B&&(null==B?void 0:B.map(function(e,t){var n;return ae().createElement(aI,{key:e._id,name:e.title,setColorPickerOpen:ue,color:null!==(n=null==I?void 0:I[e._id])&&void 0!==n?n:e.color,setColor:function(t){return L(function(n){return GI(GI({},n),{},Tt({},e._id,t))})},defaultValue:e.color})})))),ae().createElement(qI,{normalizedTypography:$,selectedTypography:K,setSelectedTypography:Ee,groupedData:G,setTypographyPickerOpen:fe,fontList:H,screen:Ce,setScreen:Pe})),u&&!1===F&&ae().createElement(_l,{isWhiteLabel:w})),ae().createElement("div",{className:"templately-dmc-button-wrapper"},ae().createElement("button",{disabled:u&&!1===F,onClick:function(){return!u&&0===R||R>=1?(s.set("title",x||be[0]||""),s.set("slogan",_||be[1]||""),s.set("color",JSON.stringify(I)),ke(K),s.get("logo")||s.set("logo",P),s.get("logo")&&s.set("logo_size",N),null!=we&&we.imageMappings&&s.set("image_mappings",JSON.stringify(we.imageMappings)),void 0!==(null==we?void 0:we.isLocalSite)&&s.set("isLocalSite",we.isLocalSite),void a()):void j(R+1<=0?0:R+1)},className:"templately-dmc-submit-button"},ae().createElement("span",null,u&&0===R?"Style Website":"Confirm Setup"),ae().createElement(YD,null)),(u||m)&&ae().createElement("button",{onClick:function(){0===R&&m?(b&&b(),f&&f(!1)):R>0?j(R-1):l()},disabled:0===R&&(!m||h),className:"templately-dmc-back-button"},ae().createElement(GD,null),ae().createElement("span",null,"Back"))))),ae().createElement("div",{className:"templately-dependency-modal-customizer-right"},(ce||he||ye)&&ae().createElement("div",{className:"templately-dependency-modal-customizer-right-overlay"}),ae().createElement("div",{style:{margin:"auto",maxWidth:"100%",maxHeight:"100%",width:"tablet"===Ce?"720px":"mobile"===Ce?"320px":"100%",height:"tablet"===Ce?"1080px":"mobile"===Ce?"480px":"100%"}},ae().createElement("iframe",{ref:Te,name:"customizer-iframe",src:c+"?plugin_preview="+ge,frameBorder:0,width:"100%",height:"100%",onLoad:function(e){Ja("iframe loaded",e),le(!1),Ne(function(e){return e+1})},onError:function(e){le(!1)}})),ie&&ae().createElement("div",{className:"templately-dependency-modal-customizer-right-loader","data-iswhitelabel":w},ae().createElement(_l,{isWhiteLabel:w})))))};const XI=ae().memo(YI),KI=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=t.isAi,o=void 0!==r&&r,i=t.shouldFetchData,a=void 0!==i&&i,l=t.showErrorAlert,s=t.aiTemplates,c=(0,oe.useCallback)(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return n;try{var r=e.get(t);return r&&"string"==typeof r&&r.startsWith("{")?JSON.parse(r):r||n}catch(e){return n}},[e]),u=pe((0,oe.useState)(null),2),d=u[0],p=u[1],h=pe((0,oe.useState)({}),2),f=h[0],m=h[1],g=pe((0,oe.useState)(!1),2),v=g[0],y=g[1],b=pe((0,oe.useState)(!1),2),w=b[0],k=b[1],E=pe((0,oe.useState)(null),2),O=E[0],x=E[1],S=pe((0,oe.useState)(null),2),_=S[0],C=S[1],P=pe((0,oe.useState)(function(){return c("title","")}),2),T=P[0],A=P[1],M=pe((0,oe.useState)(function(){return c("slogan","")}),2),N=M[0],D=M[1],I=pe((0,oe.useState)(""),2),L=I[0],R=I[1],j=pe((0,oe.useState)(function(){var e=c("logo",{});return((0,Ci.isURL)(e)?"":null==e?void 0:e.url)||""}),2),F=j[0],z=j[1],B=pe((0,oe.useState)(function(){return c("logo_size",211)}),2),W=B[0],U=B[1],V=pe((0,oe.useState)(function(){return c("color",{})}),2),H=V[0],q=V[1],Q=pe((0,oe.useState)(0),2),$=Q[0],G=Q[1],Y=pe((0,oe.useState)(!1),2),X=Y[0],K=Y[1],Z=pe((0,oe.useState)([]),2),J=Z[0],ee=Z[1],te=pe((0,oe.useState)({}),2),re=te[0],ie=te[1],ae=pe((0,oe.useState)([]),2),le=ae[0],se=ae[1],ce=pe((0,oe.useState)(null),2),ue=ce[0],de=ce[1],he=pe((0,oe.useState)(null),2),fe=he[0],me=he[1],ge=(0,oe.useRef)(null),ve=pe((0,oe.useState)(!1),2),ye=ve[0],be=ve[1],we=function(e){var t,n;return"string"==typeof(null==e?void 0:e.message)?e.message:"string"==typeof(null==e?void 0:e.error)?e.error:"object"===ne(null==e?void 0:e.error)&&null!=e&&null!==(t=e.error)&&void 0!==t&&t.message?e.error.message:"object"===ne(null==e?void 0:e.data)&&null!=e&&null!==(n=e.data)&&void 0!==n&&n.message?e.data.message:"string"==typeof(null==e?void 0:e.data)?e.data:"string"==typeof e?e:"Request failed"},ke=(0,oe.useCallback)(function(){var e=Ei(xi().mark(function e(t){var r,o,i,a,l,s,c,u,d,h,f=arguments;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=f.length>1&&void 0!==f[1]&&f[1],o=t||n){e.next=1;break}return console.error("Pack ID is required for fetchPackImportInfo"),e.abrupt("return");case 1:return y(!0),x(null),e.prev=2,a={id:o,isAi:r,action:"templately_pack_import_info",nonce:(null===(i=window.templately)||void 0===i?void 0:i.nonce)||""},l=(0,Ci.addQueryArgs)(window.ajaxurl,a),e.next=3,ba(l);case 3:s=e.sent,c=s.response,(u=s.error)?(console.error("Pack import info error:",we(u)),x(we(u)),p({})):(d=(null==c?void 0:c.data)||{},p(d),x(null)),e.next=5;break;case 4:e.prev=4,h=e.catch(2),x(h.message),p({});case 5:return e.prev=5,y(!1),e.finish(5);case 6:case"end":return e.stop()}},e,null,[[2,4,5,6]])}));return function(_x){return e.apply(this,arguments)}}(),[n]),Ee=(0,oe.useCallback)(Ei(xi().mark(function e(){var t,n,r,o,i,a,l;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return k(!0),C(null),e.prev=1,n={action:"templately_pack_google_font",nonce:(null===(t=window.templately)||void 0===t?void 0:t.nonce)||""},r=(0,Ci.addQueryArgs)(window.ajaxurl,n),e.next=2,ba(r);case 2:o=e.sent,i=o.response,(a=o.error)?(console.error("Google fonts error:",we(a)),C(we(a)),m({})):(m(i||{}),C(null)),e.next=4;break;case 3:e.prev=3,l=e.catch(1),C(l.message),m({});case 4:return e.prev=4,k(!1),e.finish(4);case 5:case"end":return e.stop()}},e,null,[[1,3,4,5]])})),[]),Oe=(0,oe.useCallback)(function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t&&e&&o){var a=new AbortController;ge.current=a;var s=zM(e,t,n,r,function(e,t){var n;null!==(n=window.templatelyDeveloper)&&void 0!==n&&n.log&&Ja("AI content polling update:",Object.keys(e),t),de(e)},function(e,t){var n;null!==(n=window.templatelyDeveloper)&&void 0!==n&&n.log&&Ja("AI content polling completed:",e,t),de(e),me(null),ge.current=null},function(e){console.error("AI content polling error:",e),l&&l(e.message||(0,At.__)("AI content polling failed","templately")),me(null),ge.current=null},a.signal,i);return me(s),function(){null!=s&&s.cleanup&&s.cleanup(),ge.current=null}}},[o,l]),xe=(0,oe.useCallback)(function(){p({}),m({}),y(!1),k(!1),x(null),C(null),de(null),me(null),ge.current&&(ge.current.abort(),ge.current=null)},[]);return(0,oe.useEffect)(function(){if(a&&!ye&&n){be(!0);var e=function(){var e=Ei(xi().mark(function e(){var t;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Promise.all([ke(n,o),Ee()]);case 1:e.next=3;break;case 2:e.prev=2,t=e.catch(0),console.error("Failed to load customizer data:",t),l&&l((0,At.__)("Failed to load customizer settings. Please try again.","templately"));case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();e()}},[a,ye,n,o,ke,Ee,l]),(0,oe.useEffect)(function(){a&&ye&&!v&&!w&&!X&&d&&Object.keys(d).length>0&&K(!0)},[a,ye,d,f,v,w,X]),(0,oe.useEffect)(function(){return function(){ge.current&&(ge.current.abort(),ge.current=null)}},[]),(0,oe.useEffect)(function(){if(s&&o){var e=s.process_id,t=s.session_id,n=s.ai_page_ids,r=s.preview_pages,i=s.isLocalSite;e&&t&&n&&Object.keys(n).length>0&&Oe(t,e,n,r||[],i||!1)}},[s,o,Oe]),{packInfo:(0,oe.useMemo)(function(){return{data:d,loading:v,error:O}},[d,v,O]),googleFonts:(0,oe.useMemo)(function(){return{data:f,loading:w,error:_}},[f,w,_]),packInfoLoading:v,googleFontsLoading:w,packInfoError:O,googleFontsError:_,title:T,setTitle:A,slogan:N,setSlogan:D,siteLogo:L,setSiteLogo:R,logoSrc:F,setLogoSrc:z,logoSize:W,setLogoSize:U,color:H,setColor:q,currentStep:$,setCurrentStep:G,settingsLoaded:X,setSettingsLoaded:K,systemColors:J,setSystemColors:ee,originalTypography:re,setOriginalTypography:ie,fontList:le,setFontList:se,aiData:ue,setAiData:de,pollingController:fe,setPollingController:me,fetchPackImportInfo:ke,fetchGoogleFonts:Ee,pollForAIContent:Oe,resetData:xe,getFormData:c,isLoading:v||w,hasErrors:!!O||!!_,initialFetchAttempted:ye}},ZI=function(e){var t=e.name,n=e.id,r=e.next,o=e.back,i=e.formData,a=e.live_url,l=e.has_settings,s=e.showErrorAlert,c=e.isAi,u=e.setShowFSIModal,d=e.ogIsAi,p=e.startModifyAiContent,h=Sn(function(e){return e.general.platform},Jt),f=Sn(function(e){var t;return(null==e||null===(t=e.general)||void 0===t||null===(t=t.fullSiteImport)||void 0===t||null===(t=t.fsiModalContext)||void 0===t?void 0:t.aiTemplates)||{templates:null,process_id:null,ai_page_ids:null,description:null}},Jt),m=Sn(function(e){return e.aiContent},Jt),g=KI(i,{id:n,isAi:d,shouldFetchData:!0,showErrorAlert:s,aiTemplates:f}),v=kn(),y=(0,oe.useCallback)(function(){v(Vy())},[v]),b=(0,oe.useCallback)(function(){v(Wy())},[v]),w=(0,oe.useCallback)(function(){var e=Ei(xi().mark(function e(t){var n;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,v(Eu(t));case 1:if(n=e.sent,!Eu.fulfilled.match(n)){e.next=2;break}return e.abrupt("return",{logoUrl:n.payload.logoUrl,message:n.payload.message});case 2:throw new Error(n.payload||(0,At.__)("Failed to generate logo","templately"));case 3:case"end":return e.stop()}},e)}));return function(_x){return e.apply(this,arguments)}}(),[v]),k=(0,oe.useCallback)(function(){var e=Ei(xi().mark(function e(t){var n;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,v(Ou(t));case 1:if(n=e.sent,!Ou.fulfilled.match(n)){e.next=2;break}return e.abrupt("return",{text:n.payload.text,message:n.payload.message});case 2:throw new Error(n.payload||(0,At.__)("Failed to generate content","templately"));case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),[v]);return React.createElement(XI,{name:t,id:n,next:r,back:o,formData:i,live_url:a,has_settings:l,showErrorAlert:s,isAi:c,setShowFSIModal:u,ogIsAi:d,startModifyAiContent:p,platform:h,aiTemplates:f,customizerData:g,onHideFSIModal:y,onShowAiSidebar:b,onGenerateLogo:w,onGenerateMeta:k,aiMetaGenContent:m})},JI=function(e){var t="string"==typeof(null==e?void 0:e.value)?"true"===(null==e?void 0:e.value.toLowerCase()):null==e?void 0:e.value;return ae().createElement("label",{className:"templately-checkbox"},ae().createElement("input",{type:"checkbox",className:"templately-checkbox-input",checked:t,disabled:null==e?void 0:e.disabled,onChange:null==e?void 0:e.onChange}),ae().createElement("span",{className:"templately-checkbox-content"},ae().createElement("span",{className:"templately-checkbox-content-inner"},null==e?void 0:e.label,null!=e&&e.disabled?ae().createElement(ae().Fragment,null," | ",ae().createElement("span",{className:"installed"},"Installed")):"",null!=e&&e.recommended?ae().createElement(ae().Fragment,null," ",ae().createElement("span",{className:"recommended"},"( Recommended )")):"")))},eL=function(e){var t,n=e.isAi,r=e.back,o=e.next,i=e.setSteps,a=e.formData,l=e.dependencies,s=e.categories,c=e.hasAttachment,u=pe((0,oe.useState)([]),2),d=u[0],p=u[1],h=pe((0,oe.useState)(null===(t=a.get("import_demo_content"))||void 0===t||t),2),f=h[0],m=h[1],g=pe((0,oe.useState)(!0),2),v=g[0],y=g[1],b=pe((0,oe.useState)([]),2),w=b[0],k=b[1],E=Sn(function(e){return e.general.platform}),O=pe((0,oe.useState)({}),2),x=O[0],S=O[1];(0,oe.useEffect)(function(){Ja("Dependencies mounted",l)},[]),(0,oe.useEffect)(function(){var e;a.set("import_demo_content",null===(e=a.get("import_demo_content"))||void 0===e||e)},[]),(0,oe.useEffect)(function(){var e,t,n={dependencies:Object.fromEntries(l)||{},platform:E,categories:s||[],isNetworkAdmin:(null===(e=window)||void 0===e||null===(e=e.templately)||void 0===e?void 0:e.isNetworkAdmin)||!1};wa("/templately/v1/dependencies/plugins",n).then(function(e){var t=e.response,n=e.error;n?console.error("Error fetching plugins:",n):(k(t.dependencyList||[]),p(t.requiredPlugins||[]))});var r={platform:E,isNetworkAdmin:(null===(t=window)||void 0===t||null===(t=t.templately)||void 0===t?void 0:t.isNetworkAdmin)||!1};wa("/templately/v1/dependencies/themes",r).then(function(e){var t=e.response,n=e.error;n?console.error("Error fetching themes:",n):(S(t),a.set("theme",JSON.stringify(t)))})},[l,E]);var _=(0,oe.useCallback)(function(e){return void 0!==(null==d?void 0:d.find(function(t){return t.plugin_file===e}))},[d]),C=[];return null==w||w.map(function(e){var t,n=function(){return null};e.mustHave||(n=function(){return function(e){var t=Ul(d);t=_(e.plugin_file)?t.filter(function(t){return(null==t?void 0:t.plugin_file)!==e.plugin_file}):[].concat(Ul(t),[e]),p(t)}(e)}),C.push(React.createElement(JI,{key:e.plugin_file,value:_(e.plugin_file),onChange:n,label:null==e?void 0:e.name,disabled:null!==(t=null==e?void 0:e.installed)&&void 0!==t&&t}))}),React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-dependency-modal-header"},React.createElement("h3",{className:"templately-title"},"Required Dependencies"),React.createElement("p",{className:"templately-details"},"To import this pack, please install all the listed plugins, theme, and demo contents to avoid missing dependent sections.")),React.createElement("div",{className:"templately-dependency-modal-body"},React.createElement(lI,{title:"Plugin Dependencies",current:void 0,setCurrent:function(){},id:null},C),(null==x?void 0:x.name)&&React.createElement(lI,{title:"Theme Dependency",current:void 0,setCurrent:function(){},id:null},React.createElement(JI,{value:v,onChange:function(e){return function(e,t){y(e.target.checked),"active"!==t.status&&e.target.checked?a.set("theme",JSON.stringify(t)):a.delete("theme")}(e,x)},label:x.name,recommended:"active"!==x.status,disabled:"active"===x.status}),!v&&React.createElement("p",{className:"templately-details"},"We recommend you to use this theme for a smooth importing experience.")),React.createElement("div",{className:"templately-new-collapser"},React.createElement("div",{className:"templately-new-collapser-header not-clickable"},React.createElement("div",null,React.createElement(JI,{value:"true"===f||f,onChange:function(e){m(!f),f?a.delete("import_demo_content"):a.set("import_demo_content",!0)},label:"Import Demo Content"}),!f&&React.createElement("p",{className:"templately-details"},"Demo content such as posts, products, forms, etc will be excluded from the import."))))),React.createElement("div",{className:"templately-dependency-modal-footer"},React.createElement("button",{className:"templately-button close-button",onClick:function(){r()}},(0,At.__)("Back","templately")),React.createElement("button",{onClick:function(){var e=[UE("writing_permission_check","Permission Passed",1,"processing"),UE("download","Downloading Template Pack","--","processing"),UE("theme","Installing Required Theme","--","processing"),UE("plugin","Installing Required Theme","--","processing"),UE("attachments","Importing Media Attachments","--","processing"),UE("templates","Importing Templates (i.e: Header, Footer, etc)","--","processing"),UE("content","Importing Page and Post Templates","--","processing"),UE("wp-content","Importing Content (Pages, Posts, Products, Navigation)","--","processing"),UE("finalize","Finalizing Your Imports","--","processing")];0===d.length&&(e=e.filter(function(e){return"plugin"!==e.type})),c||(e=e.filter(function(e){return"attachments"!==e.type})),n&&(e=e.filter(function(e){return"download"!==e.type})),i(e),a.set("plugins",JSON.stringify(d)),o()},className:"templately-dmc-submit-button"},React.createElement("span",null,"Install & Proceed"),React.createElement(YD,null))))};var tL,nL,rL=o(4552);function oL(e,t){return e+Math.random()*(t-e)}!function(e){e[e.Circle=0]="Circle",e[e.Square=1]="Square",e[e.Strip=2]="Strip"}(tL||(tL={})),function(e){e[e.Positive=1]="Positive",e[e.Negative=-1]="Negative"}(nL||(nL={}));const iL=1e3/60;class aL{constructor(e,t,n,r){this.getOptions=t;const{colors:o,initialVelocityX:i,initialVelocityY:a}=this.getOptions();this.context=e,this.x=n,this.y=r,this.w=oL(5,20),this.h=oL(5,20),this.radius=oL(5,10),this.vx="number"==typeof i?oL(-i,i):oL(i.min,i.max),this.vy="number"==typeof a?oL(-a,0):oL(a.min,a.max),this.shape=Math.floor(0+3*Math.random()),this.angle=oL(0,360)*Math.PI/180,this.angularSpin=oL(-.2,.2),this.color=o[Math.floor(Math.random()*o.length)],this.rotateY=oL(0,1),this.rotationDirection=oL(0,1)?nL.Positive:nL.Negative}update(e){const{gravity:t,wind:n,friction:r,opacity:o,drawShape:i}=this.getOptions(),a=e/iL;this.x+=this.vx*a,this.y+=this.vy*a,this.vy+=t*a,this.vx+=n*a,this.vx*=r**a,this.vy*=r**a,this.rotateY>=1&&this.rotationDirection===nL.Positive?this.rotationDirection=nL.Negative:this.rotateY<=-1&&this.rotationDirection===nL.Negative&&(this.rotationDirection=nL.Positive);const l=.1*this.rotationDirection*a;if(this.rotateY+=l,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=o,this.context.lineCap="round",this.context.lineWidth=2,i&&"function"==typeof i)i.call(this,this.context);else switch(this.shape){case tL.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case tL.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case tL.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}class lL{constructor(e,t){this.x=0,this.y=0,this.w=0,this.h=0,this.lastNumberOfPieces=0,this.tweenProgress=0,this.tweenFrom=0,this.particles=[],this.particlesGenerated=0,this.removeParticleAt=e=>{this.particles.splice(e,1)},this.getParticle=()=>{const e=oL(this.x,this.w+this.x),t=oL(this.y,this.h+this.y);return new aL(this.context,this.getOptions,e,t)},this.animate=e=>{const{canvas:t,context:n,particlesGenerated:r,lastNumberOfPieces:o}=this,{run:i,recycle:a,numberOfPieces:l,debug:s,tweenFunction:c,tweenDuration:u}=this.getOptions();if(!i)return!1;const d=this.particles.length,p=a?d:r;if(p<l){o!==l&&(this.tweenProgress=0,this.tweenFrom=p,this.lastNumberOfPieces=l),this.tweenProgress=Math.min(u,Math.max(0,this.tweenProgress+e));const t=c(this.tweenProgress,this.tweenFrom,l,u),n=Math.round(t-p);for(let e=0;e<n;e++)this.particles.push(this.getParticle());this.particlesGenerated+=n}s&&(n.font="12px sans-serif",n.fillStyle="#333",n.textAlign="right",n.fillText(`Particles: ${d}`,t.width-10,t.height-20));for(let n=this.particles.length-1;n>=0;n--){const r=this.particles[n];r.update(e),(r.y>t.height||r.y<-100||r.x>t.width+100||r.x<-100)&&(a&&p<=l?this.particles[n]=this.getParticle():this.removeParticleAt(n))}return d>0||p<l},this.canvas=e;const n=this.canvas.getContext("2d");if(!n)throw new Error("Could not get canvas context");this.context=n,this.getOptions=t}}const sL={width:"undefined"!=typeof window?window.innerWidth:300,height:"undefined"!=typeof window?window.innerHeight:200,numberOfPieces:200,friction:.99,wind:0,gravity:.1,initialVelocityX:4,initialVelocityY:10,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,debug:!1,tweenFunction:rL.easeInOutQuad,tweenDuration:5e3,recycle:!0,run:!0};class cL{constructor(e,t){this.lastFrameTime=0,this.setOptionsWithDefaults=e=>{const t={confettiSource:{x:0,y:0,w:this.canvas.width,h:0}};this._options={...t,...sL,...e},Object.assign(this,e.confettiSource)},this.update=(e=0)=>{const{options:{run:t,onConfettiComplete:n,frameRate:r},canvas:o,context:i}=this,a=Math.min(e-this.lastFrameTime,50);r&&a<1e3/r?this.rafId=requestAnimationFrame(this.update):(this.lastFrameTime=e-(r?a%r:0),t&&(i.fillStyle="white",i.clearRect(0,0,o.width,o.height)),this.generator.animate(a)?this.rafId=requestAnimationFrame(this.update):(n&&"function"==typeof n&&this.generator.particlesGenerated>0&&n.call(this,this),this._options.run=!1))},this.reset=()=>{this.generator&&this.generator.particlesGenerated>0&&(this.generator.particlesGenerated=0,this.generator.particles=[],this.generator.lastNumberOfPieces=0)},this.stop=()=>{this.options={run:!1},this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)},this.canvas=e;const n=this.canvas.getContext("2d");if(!n)throw new Error("Could not get canvas context");this.context=n,this.generator=new lL(this.canvas,()=>this.options),this.options=t,this.update()}get options(){return this._options}set options(e){const t=this._options?.run,n=this._options?.recycle;this.setOptionsWithDefaults(e),this.generator&&(Object.assign(this.generator,this.options.confettiSource),"boolean"==typeof e.recycle&&e.recycle&&!1===n&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),"boolean"==typeof e.run&&e.run&&!1===t&&this.update()}}const uL=oe.createRef();class dL extends oe.Component{constructor(e){super(e),this.canvas=oe.createRef(),this.canvas=e.canvasRef||uL}componentDidMount(){if(this.canvas.current){const e=pL(this.props)[0];this.confetti=new cL(this.canvas.current,e)}}componentDidUpdate(){const e=pL(this.props)[0];this.confetti&&(this.confetti.options=e)}componentWillUnmount(){this.confetti&&this.confetti.stop(),this.confetti=void 0}render(){const[e,t]=pL(this.props),n={zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0,...t.style};return(0,QP.jsx)("canvas",{width:e.width,height:e.height,ref:this.canvas,...t,style:n})}}function pL(e){const t={},n={},r=[...Object.keys(sL),"confettiSource","drawShape","onConfettiComplete","frameRate"],o=["canvasRef"];for(const i in e){const a=e[i];r.includes(i)?t[i]=a:o.includes(i)?o[i]=a:n[i]=a}return[t,n,{}]}dL.defaultProps={...sL},dL.displayName="ReactConfetti";const hL=oe.forwardRef((e,t)=>(0,QP.jsx)(dL,{canvasRef:t,...e}));var fL=o(4364);function mL(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 gL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mL(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const vL=function(e){var t,n,r,o,i,a,l=e.results,s=(e.steps,e.isAi),c=(e.importCounter,e.formData),u=pe((0,oe.useState)({0:!0}),2),d=u[0],p=u[1],h=pe((0,oe.useState)(!0),2),f=h[0],m=h[1];(0,oe.useEffect)(function(){var e=setTimeout(function(){m(!1)},3500);return function(){return clearTimeout(e)}},[]);var g=(0,fL.A)(),v=g.width,y=g.height;function b(e){var t=e.filter(function(e){return e}).map(function(e){return e.replace(/_/g," ").split(" ").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ")});return t.slice(0,-1).join(", ")+(t.length>1?" & ":"")+t.slice(-1)}var w,k=[],E=templately.url;if(null!=l&&null!==(t=l.results)&&void 0!==t&&t.home_url&&(E=l.results.home_url),s){var O,x,S,_={label:" ",details:[]};if(null==l||null===(O=l.results)||void 0===O||!O.ai_content)return _.label=(0,At.__)("AI Content Processing Information Unavailable","templately"),void k.push(_);if(void 0!==(null==l||null===(x=l.results)||void 0===x||null===(x=x.ai_content)||void 0===x||null===(x=x.processed)||void 0===x?void 0:x.credit_cost)){var C=l.results.ai_content.processed.credit_cost;_.label=(0,At.__)("Credit Cost:","templately")+" ".concat(C)}else _.label=(0,At.__)("Credit Cost: Not Available","templately");if((0,_a.isEmpty)(null==l||null===(S=l.results)||void 0===S||null===(S=S.ai_content)||void 0===S||null===(S=S.processed)||void 0===S?void 0:S.pages))_.details.push(React.createElement(React.Fragment,null,(0,At.__)("No AI pages were processed","templately")));else{var P=l.results.ai_content.processed.pages,T=Object.values(P).filter(function(e){return"1"!==e}).length;_.details.push(React.createElement(React.Fragment,null,(0,At.__)("AI Generated Pages & Templates:","templately")," ",T));var A=l.results.ai_content.requested,M=l.results.ai_content.processed.pages,N=Object.values(A).flat().filter(function(e){return!M.hasOwnProperty(e)});N.length>0&&_.details.push(React.createElement(React.Fragment,null,(0,At.__)("Failed:","templately")," ",N.length," ",(0,At.__)("pages or templates","templately")))}k.push(_)}if(null!=l&&null!==(n=l.results)&&void 0!==n&&null!==(n=n.dependency_data)&&void 0!==n&&null!==(n=n.plugins)&&void 0!==n&&n.total){var D,I=l.results.dependency_data.plugins,L={label:" ".concat((0,At.__)("Installed Required Plugins","templately")," (").concat(I.succeed,"/").concat(I.total,")"),details:[]},R={"elementor-pro":"https://wpdeveloper.com/go/elementor","essential-addons-elementor":"https://essential-addons.com/#pricing","essential-blocks-pro":"https://essential-blocks.com/#pricing"};if((null===(D=I.failed)||void 0===D?void 0:D.length)>0)for(var j=0;j<I.failed.length;j++){var F=I.failed[j];L.details.push(React.createElement(React.Fragment,null,F.name," ",(0,At.__)("not found.","templately"),R[F.slug]&&React.createElement(React.Fragment,null," ".concat((0,At.__)("Please get it","templately")," "),React.createElement("a",{href:R[F.slug],target:"_blank",rel:"noopener noreferrer"},(0,At.__)("here","templately")),".")))}k.push(L)}if(null!=l&&null!==(r=l.results)&&void 0!==r&&null!==(r=r.dependency_data)&&void 0!==r&&r.theme&&c.get("theme")&&(w=l.results.dependency_data.theme.success?{label:(0,At.__)("Installed Recommended Theme","templately")}:{label:(0,At.__)("Theme Installation Failed","templately")},k.push(w)),(null==l||null===(o=l.results)||void 0===o?void 0:o.attachments)>0){var z=l.results.attachments;k.push({label:"".concat((0,At.__)("Imported Attachments:","templately")," ").concat(z)})}if((null==l||null===(i=l.results)||void 0===i||null===(i=i.post_types)||void 0===i?void 0:i.length)>0){var B=b(l.results.post_types);k.push({label:"".concat((0,At.__)("Imported Contents:","templately")," ").concat(B)})}if((null==l||null===(a=l.results)||void 0===a||null===(a=a.template_types)||void 0===a?void 0:a.length)>0){var W=l.results.template_types;W=W.map(function(e){return e.includes("single")?(0,At.__)("Single Post type","templately"):e});var U=b(W=Ul(new Set(W)));k.push({label:"".concat((0,At.__)("Imported Templates:","templately")," ").concat(U)})}return k.push({label:(0,At.__)("Imported Site Settings: Layout, Fonts, Colors, Typography, Images, Custom CSS, etc.","templately")}),React.createElement(React.Fragment,null,React.createElement(hL,{className:"templately-confetti-canvas",width:v,height:y,recycle:f}),React.createElement("div",{className:"templately-dependency-modal-header"},React.createElement("h3",{className:"templately-title"},(0,At.__)("Congratulations! Your Website is ready 🚀","templately")),React.createElement("p",{className:"templately-details"},(0,At.__)("You have imported and applied the following to your site:","templately"))),React.createElement("div",{className:"templately-dependency-modal-body"},React.createElement("ul",{className:"templately-dependency-processing-wrapper"},null==k?void 0:k.map(function(e,t){var n,r,o;return React.createElement("li",{key:t,className:"templately-dependency-processing-item complete ".concat((null==e||null===(n=e.details)||void 0===n?void 0:n.length)>0?"has-sub-menu":""," ").concat(null!=d&&d[t]?"collapsed":"show")},React.createElement("span",{className:"templately-label"},null==e?void 0:e.label,React.createElement("div",{className:"templately-collapse-icon",onClick:function(){return p(function(e){return gL(gL({},e),{},Tt({},t,!(null!=e&&e[t])))})}},React.createElement(Cn,null))),(null==e||null===(r=e.details)||void 0===r?void 0:r.length)>0&&React.createElement("div",{className:"templately-dependency-processing-details-wrapper"},React.createElement("ul",{className:"templately-dependency-processing-details"},null==e||null===(o=e.details)||void 0===o?void 0:o.map(function(e,t){return React.createElement("li",{key:t},e)}))))}))),React.createElement("div",{className:"templately-dependency-modal-footer"},React.createElement("a",{href:E,target:"_blank",className:"templately-dependency-modal-footer-final-button",style:{marginLeft:0,width:"100%",color:"#FFF"}},(0,At.__)("Visit your website","templately"))))},yL=function(e){var t,n,r,o,i=e.steps,a=e.formData,l=e.start,s=(e.startModifyAiContent,e.isAi),c=pe((0,oe.useState)(!1),2),u=c[0],d=c[1],p=pe(dI("process_id",""),2),h=(p[0],p[1],pe(dI("aiRequestData",[]),1)[0]),f=pe(dI("isRequestStarted",!1),2),m=f[0],g=f[1],v=pe(dI("isAIRequestDone",!1),2),y=(v[0],v[1],(0,_a.isEmpty)(h)||null==h||!h.prompt||null==h||h.AIPageIDs,Sn(function(e){return{processId:e.general.fullSiteImport.processId,AIPageIDs:e.general.fullSiteImport.AIPageIDs}},Jt));return y.processId,y.AIPageIDs,(0,oe.useEffect)(function(){m||(g(!0),l(a))},[]),React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-dependency-modal-header"},React.createElement("h3",{className:"templately-title"},"Your website is being ready..."),React.createElement("p",{className:"templately-details"},s?(0,At.__)("This usually takes a few minutes. Please do not close the window until the process is complete.","templately"):(0,At.__)("This usually takes a few moments. Please do not close the window until the process is complete.","templately"))),React.createElement("div",{className:"templately-dependency-modal-body"},React.createElement("ul",{className:"templately-dependency-processing-wrapper"},null==i||null===(t=i.filter(function(e){return"error"!==(null==e?void 0:e.type)}))||void 0===t?void 0:t.map(function(e){return React.createElement("li",{key:e.type,className:"templately-dependency-processing-item ".concat(null==e?void 0:e.status)},React.createElement("span",{className:"templately-label"},null==e?void 0:e.message),"error"!==(null==e?void 0:e.status)&&React.createElement("span",{className:"templately-count"},"string"==typeof(null==e?void 0:e.progress)?null==e?void 0:e.progress:"".concat(null==e?void 0:e.progress,"%")))})),(null==i||null===(n=i.filter(function(e){return"error"===(null==e?void 0:e.type)}))||void 0===n?void 0:n.length)>0&&React.createElement("div",{className:"templately-dependency-processing-wrapper"},null==i||null===(r=i.filter(function(e){return"error"===(null==e?void 0:e.type)&&(null==e?void 0:e.handleRetry)}))||void 0===r?void 0:r.map(function(e){return React.createElement("button",{id:"templately-fsi-retry-button",_isDisabled:u,onClick:function(t){d(!0),e.handleRetry(t)}},React.createElement(Fn,null))}),React.createElement("ul",null,null==i||null===(o=i.filter(function(e){return"error"===(null==e?void 0:e.type)}))||void 0===o?void 0:o.map(function(e){return React.createElement("li",{key:e.type,className:"templately-dependency-processing-item ".concat(null==e?void 0:e.status," warning no-icon")},React.createElement("h4",{className:"templately-title"},(null==e?void 0:e.title)||"Something went wrong"),React.createElement("span",{className:"templately-label"},React.createElement(OC.RawHTML,null,null==e?void 0:e.message)))}))),React.createElement("div",{style:{width:"300px",marginLeft:"auto",marginRight:"auto"}},React.createElement("img",{src:templately.icons.construction,alt:"construction",style:{width:"100%"}}))))};var bL=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],wL=function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,n=String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase(),r=String(t.getOptionValue(e)).toLowerCase(),o=String(t.getOptionLabel(e)).toLowerCase();return r===n||o===n},kL={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(t){return wL(e,t,r)})||n.some(function(t){return wL(e,t,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}},EL=(0,oe.forwardRef)(function(e,t){var n=function(e){var t=e.allowCreateWhileLoading,n=void 0!==t&&t,r=e.createOptionPosition,o=void 0===r?"last":r,i=e.formatCreateLabel,a=void 0===i?kL.formatCreateLabel:i,l=e.isValidNewOption,s=void 0===l?kL.isValidNewOption:l,c=e.getNewOptionData,u=void 0===c?kL.getNewOptionData:c,d=e.onCreateOption,p=e.options,h=void 0===p?[]:p,f=e.onChange,m=Wn(e,bL),g=m.getOptionValue,v=void 0===g?bg:g,y=m.getOptionLabel,b=void 0===y?yg:y,w=m.inputValue,k=m.isLoading,E=m.isMulti,O=m.value,x=m.name,S=(0,oe.useMemo)(function(){return s(w,Yf(O),h,{getOptionValue:v,getOptionLabel:b})?u(w,a(w)):void 0},[a,u,b,v,w,s,h,O]),_=(0,oe.useMemo)(function(){return!n&&k||!S?h:"first"===o?[S].concat(Ul(h)):[].concat(Ul(h),[S])},[n,o,k,S,h]),C=(0,oe.useCallback)(function(e,t){if("select-option"!==t.action)return f(e,t);var n=Array.isArray(e)?e:[e];if(n[n.length-1]!==S)f(e,t);else if(d)d(w);else{var r=u(w,w),o={action:"create-option",name:x,option:r};f(cm(E,[].concat(Ul(Yf(O)),[r]),r),o)}},[u,w,E,x,S,d,f,O]);return Il(Il({},m),{},{options:_,onChange:C})}(Dd(e));return oe.createElement(Rg,re({ref:t},n))}),OL=EL;const xL=function(){return ae().createElement("svg",{className:"templately-ai-content-header-bg",xmlns:"http://www.w3.org/2000/svg",width:"61",height:"71",fill:"none",viewBox:"0 0 61 71"},ae().createElement("path",{fill:"url(#paint0_linear_2112_1895)",d:"M.275 35.21c0-1.258 1.022-2.265 2.274-2.389C13.305 31.755 21.86 23.2 22.927 12.443c.123-1.251 1.13-2.273 2.388-2.273 1.257 0 2.264 1.022 2.388 2.273C28.77 23.2 37.324 31.755 48.081 32.821c1.251.124 2.273 1.131 2.273 2.389s-1.022 2.264-2.273 2.388c-10.757 1.066-19.311 9.621-20.378 20.378-.124 1.251-1.131 2.273-2.388 2.273s-2.265-1.022-2.389-2.273C21.86 47.22 13.307 38.664 2.55 37.598 1.297 37.474.275 36.467.275 35.21"}),ae().createElement("path",{fill:"#F5EAFF",d:"M45.344 7.665c0-.377.306-.68.682-.716A6.83 6.83 0 0 0 52.139.835c.037-.375.34-.682.717-.682s.679.307.716.682a6.83 6.83 0 0 0 6.113 6.114c.376.037.682.34.682.716 0 .377-.306.68-.681.717a6.83 6.83 0 0 0-6.114 6.113c-.037.376-.34.682-.716.682-.378 0-.68-.306-.717-.682a6.83 6.83 0 0 0-6.113-6.113c-.376-.037-.682-.34-.682-.717M40.344 60.251c0-.503.409-.905.909-.955a9.11 9.11 0 0 0 8.151-8.151c.05-.5.453-.91.955-.91.503 0 .906.41.956.91a9.11 9.11 0 0 0 8.151 8.15c.5.05.91.453.91.956s-.41.906-.91.956a9.11 9.11 0 0 0-8.151 8.15c-.05.501-.453.91-.956.91s-.905-.409-.955-.91a9.11 9.11 0 0 0-8.151-8.15c-.5-.05-.91-.453-.91-.956"}),ae().createElement("defs",null,ae().createElement("linearGradient",{id:"paint0_linear_2112_1895",x1:"25.315",x2:"25.315",y1:"10.17",y2:"60.249",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#F7EEFF"}),ae().createElement("stop",{offset:"1",stopColor:"#F4E7FF"}))))},SL=function(){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"18",fill:"none",style:{marginLeft:0,marginRight:"8px"},viewBox:"0 0 16 18"},ae().createElement("path",{fill:"url(#paint0_linear_2112_1918)",d:"M.5 9c0-.323.262-.582.584-.614a5.846 5.846 0 0 0 5.231-5.231c.032-.321.29-.584.613-.584s.582.263.613.584a5.846 5.846 0 0 0 5.232 5.231c.321.032.583.29.583.614 0 .322-.262.58-.583.613a5.846 5.846 0 0 0-5.232 5.231c-.031.321-.29.584-.613.584s-.581-.263-.613-.584a5.846 5.846 0 0 0-5.231-5.231C.762 9.58.5 9.323.5 9"}),ae().createElement("path",{fill:"url(#paint1_linear_2112_1918)",d:"M12.07 1.928a.19.19 0 0 1 .175-.183 1.754 1.754 0 0 0 1.57-1.57.19.19 0 0 1 .184-.175.19.19 0 0 1 .184.175 1.754 1.754 0 0 0 1.57 1.57.19.19 0 0 1 .174.183.19.19 0 0 1-.175.184 1.754 1.754 0 0 0-1.57 1.57.19.19 0 0 1-.183.175.19.19 0 0 1-.184-.175 1.754 1.754 0 0 0-1.57-1.57.19.19 0 0 1-.175-.184"}),ae().createElement("path",{fill:"url(#paint2_linear_2112_1918)",d:"M10.786 15.429c0-.13.105-.233.234-.245a2.34 2.34 0 0 0 2.092-2.093.253.253 0 0 1 .245-.234c.13 0 .233.105.246.234a2.34 2.34 0 0 0 2.092 2.093.253.253 0 0 1 .234.245c0 .129-.105.232-.234.245a2.34 2.34 0 0 0-2.092 2.093.253.253 0 0 1-.246.233.253.253 0 0 1-.245-.233 2.34 2.34 0 0 0-2.092-2.093.253.253 0 0 1-.234-.245"}),ae().createElement("defs",null,ae().createElement("linearGradient",{id:"paint0_linear_2112_1918",x1:"6.928",x2:"6.928",y1:"2.571",y2:"15.428",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#E5C8FF"}),ae().createElement("stop",{offset:"1",stopColor:"#BA6DFC"})),ae().createElement("linearGradient",{id:"paint1_linear_2112_1918",x1:"13.999",x2:"13.999",y1:"0",y2:"3.857",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#E7CBFF"}),ae().createElement("stop",{offset:"1",stopColor:"#F5E9FF"})),ae().createElement("linearGradient",{id:"paint2_linear_2112_1918",x1:"13.357",x2:"13.357",y1:"12.857",y2:"18",gradientUnits:"userSpaceOnUse"},ae().createElement("stop",{stopColor:"#E7CBFF"}),ae().createElement("stop",{offset:"1",stopColor:"#F5E9FF"}))))};var _L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getFullYear(),n=e.getMonth(),r=new Date(t,n+1,0);if(e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()){var o=24-e.getHours();return"".concat(o," hour").concat(1!==o?"s":"")}var i=r.getDate()-e.getDate();return"".concat(i," day").concat(1!==i?"s":"")};const CL=function(e){var t,n=e.creditData,r=Number(n.total_used_credit)||0,o=Number(n.total_credit)||0,i=Number(n.available_credit)||0,a=Number(n.estimated_cost)||0,l=n.subscription_credit.interval||"one_time",s=o>0?Math.min(Math.round(r/o*100),100):0;return React.createElement("div",{className:"optimizer-container"},React.createElement("div",{className:"optimizer-header"},React.createElement("div",{className:"title-area"},React.createElement("h3",{className:"optimizer-title"},(0,At.__)("Your AI Credit","templately"))),React.createElement("a",{href:null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_api?"https://www.templately.dev/#credit":"https://www.templately.com/#credit",target:"_blank",className:"increase-limit-btn"},(0,At.__)("Increase Limit","templately"))),React.createElement("div",{className:"usage-container"},React.createElement("div",{className:"usage-text"},React.createElement(React.Fragment,null,r.toLocaleString(),"/",o.toLocaleString()," ",(0,At.__)("Credit","templately"))),React.createElement("span",{className:"credits-info tt-top","data-templately-tooltip":i?"recurring"===l?(0,At.__)("Monthly reset in ".concat(_L()),"templately"):(0,At.__)("AI credit validity: Lifetime – use anytime.","templately"):(0,At.__)("To generate AI content - buy credits now!","templately")},React.createElement("i",{className:"dashicons dashicons-info"}))),React.createElement("div",{className:"progress-container"},React.createElement("div",{className:"progress-bar",style:{width:"".concat(s,"%")}})),a>0&&React.createElement("p",{className:"estimated-credit"},(0,At.__)("Estimated AI Credits for this generation:","templately")," ",React.createElement("strong",null,a)))};function PL(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 TL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PL(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const AL=function(e){var t,n=e.pack_id,r=(e.startModifyAiContent,e.back,e.next),o=e.setIsAi,i=e.removeStep,a=pe((0,oe.useState)("website-information"),2),l=a[0],s=a[1],c=pe((0,oe.useState)(!1),2),u=c[0],d=c[1],p=pe((0,oe.useState)(""),2),h=p[0],f=p[1],m=pe(dI("prompt",""),2),g=m[0],v=m[1],y=pe(dI("businessNiches",[]),2),b=y[0],w=y[1],k=pe(dI("address",""),2),E=k[0],O=k[1],x=pe(dI("email",""),2),S=x[0],_=x[1],C=pe(dI("phone",""),2),P=C[0],T=C[1],A=kn(),M=pe((0,oe.useState)([]),2),N=M[0],D=M[1],I=pe(dI("AIPageIDs",{"content/page":[],templates:[]}),2),L=I[0],R=I[1],j=pe(dI("aiRequestData",[]),2),F=(j[0],j[1]),z=pe(dI("previewPages",[]),2),B=z[0],W=z[1],U=pe(dI("process_id",""),2),V=(U[0],U[1]),H=pe(dI("cachedPreviewInput",{}),2),q=H[0],Q=H[1],$=(0,oe.useMemo)(function(){return Object.values(L).flat().length},[L]),G=["Agency","Restaurant","Entrepreneur","Event","Non-profit","Local business","Gym","Spa","SaaS","Dentist","Blog","Construction","Creative","Cyber","eCommerce","Education","Entertainment","Fashion","Restaurants","Health","Holiday","Multipurpose","NFT","Photography","Portfolio","Technology","Travel","Dentists","Law Firms","Wedding Photographers"].concat(Ul((0,_a.isArray)(N)?N:[])),Y=Sn(function(e){return e.general.platform},Jt),X=Sn(function(e){var t;return null!==(t=e.general.fullSiteImport.availableCredit)&&void 0!==t?t:{available_credit:0,interval:"",purchased_credit:0,subscription_credit:0,total_credit:0,total_used_credit:0,estimated_cost:0}},Jt),K=X.available_credit-X.estimated_cost,Z=function(e,t){var o,i;if(e.preventDefault(),!g||!g.length||!g.trim())return f((0,At.__)("Oops! We need some details about your website.","templately")),s("website-information"),!1;f(""),F({address:E,email:S,phone:P,platform:Y,pack_id:n,prompt:g,AIPageIDs:L,preview_pages:B,businessNiches:null!==(o=null==b?void 0:b.value)&&void 0!==o?o:"",isBusinessNichesNew:!G.includes(null!==(i=null==b?void 0:b.value)&&void 0!==i?i:"")}),r()};return(0,oe.useEffect)(function(){g&&f("")},[g]),(0,oe.useEffect)(function(){d(!0);var e=(0,Ci.addQueryArgs)(window.ajaxurl,{action:"templately_pack_import_info",id:n,isAi:!0,nonce:window.templately.nonce});wa(e,{},{method:"GET"}).then(function(e){var t,n,r,o,i,a=e.response,l=e.error;if(l)return console.error("Error fetching pack import info:",l),void d(!1);if(null!=a&&a.business_niches&&D(null==a?void 0:a.business_niches),null!=a&&null!==(t=a.data)&&void 0!==t&&t.ai_process){var s,c=null==a||null===(s=a.data)||void 0===s?void 0:s.ai_process;V(null==c?void 0:c.process_id),v(null==c?void 0:c.prompt),w({value:null==c?void 0:c.business_niches,label:null==c?void 0:c.business_niches}),O(null==c?void 0:c.address),_(null==c?void 0:c.email),T(null==c?void 0:c.phone),Q(c)}if(null!=a&&null!==(n=a.data)&&void 0!==n&&n.credit_balance||null!=a&&null!==(r=a.data)&&void 0!==r&&r.estimated_cost){var u,p,h=null!==(u=a.data.credit_balance)&&void 0!==u?u:{},f=null!==(p=a.data.estimated_cost)&&void 0!==p?p:0;A(By(TL(TL({},h),{},{estimated_cost:f})))}if(null!=a&&null!==(o=a.data)&&void 0!==o&&null!==(o=o.manifest)&&void 0!==o&&null!==(o=o.content)&&void 0!==o&&o.page||null!=a&&null!==(i=a.data)&&void 0!==i&&null!==(i=i.manifest)&&void 0!==i&&i.templates){var m,g,y,b,k=null!==(m=null==a||null===(g=a.data)||void 0===g||null===(g=g.manifest)||void 0===g||null===(g=g.content)||void 0===g?void 0:g.page)&&void 0!==m?m:{},E=null!==(y=null==a||null===(b=a.data)||void 0===b||null===(b=b.manifest)||void 0===b?void 0:b.templates)&&void 0!==y?y:{},x=Object.values(k).filter(function(e){var t;return!0!==(null===(t=e.page_settings)||void 0===t?void 0:t.page_for_posts)}),S=Object.values(k).filter(function(e){var t;return!0===(null===(t=e.page_settings)||void 0===t?void 0:t.page_on_front)}).map(function(e){return e.post_id}),C=Object.values(E),P=x.map(function(e){return e.post_id}),M=C.filter(function(e){return!P.includes(e.post_id)}).map(function(e){return e.post_id});S.length>0&&W(S),(P.length>0||M.length>0)&&R({"content/page":P,templates:M})}d(!1)}).catch(function(e){d(!1),window.templately.log&&console.error(e)})},[]),(0,oe.useEffect)(function(){(0,_a.isEmpty)(q)||(q.prompt!==g||q.business_niches!==(null==b?void 0:b.value)||q.address!==E||q.email!==S||q.phone!==P)&&V("")},[q,g,b,E,S,P]),u?React.createElement("div",{className:"templately-dependency-modal-customizer-right-loader ai-content-loader"},React.createElement(_l,null)):React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-dependency-modal-header templately-ai-content-header"},React.createElement("h3",{className:"templately-title"},(0,At.__)("Launch your website in seconds!","templately")),React.createElement("p",{className:"templately-details"},(0,At.__)("Just a few details about your site – we’ll take care of the rest.","templately")),React.createElement(xL,null)),React.createElement("div",{className:"templately-dependency-modal-body"},React.createElement("div",{className:"templately-ai-content-wrapper"},React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-ai-content-inner-wrapper"},React.createElement(lI,{title:(0,At.__)("Website Information","templately"),current:l,setCurrent:s,id:"website-information"},React.createElement("div",{className:"templately-ai-content business-type"},React.createElement("h4",{className:"templately-ai-content-title"},(0,At.__)("Select website type","templately")),React.createElement(OL,{placeholder:(0,At.__)(" e.g., Portfolio, Blog, Business, etc.","templately"),noOptionsMessage:function(){return(0,At.__)("No category found, create new one!","templately")},value:b,options:G.map(function(e){return{value:e,label:e}}),className:"templately-ai-prompt-category",classNamePrefix:"templately-ai-prompt-category",onChange:function(e){w(e)}})),React.createElement("div",{className:"templately-ai-content"},React.createElement("h4",{className:"templately-ai-content-title"},(0,At.__)("Tell us what your site is about","templately")),React.createElement(nI.TextareaControl,{value:g,onChange:function(e){return v(e)},className:"templately-ai-prompt ".concat(h?"templately-ai-prompt-error":""),placeholder:"Briefly describe your website’s purpose",help:(0,At.__)("Your input will reflect throughout the entire templates.","templately"),rows:4}),h&&React.createElement(nI.Notice,{status:"error",isDismissible:!1},h))),React.createElement(lI,{title:(0,At.__)("Contact Information","templately"),current:l,setCurrent:s,initialCollapsed:!0,id:"contact-information"},React.createElement("div",{className:"templately-ai-content"},React.createElement(nI.TextControl,{label:(0,At.__)("Full address","templately"),value:E,onChange:function(e){return O(e)},placeholder:(0,At.__)("123 Main St, Anytown, USA","templately"),className:"templately-ai-prompt"}),React.createElement(nI.TextControl,{label:(0,At.__)("Email address","templately"),value:S,onChange:function(e){return _(e)},placeholder:(0,At.__)("you@example.com","templately"),className:"templately-ai-prompt"}),React.createElement(nI.TextControl,{label:(0,At.__)("Contact number","templately"),value:P,onChange:function(e){return T(e)},placeholder:(0,At.__)("(123) 456-7890","templately"),className:"templately-ai-prompt"}))))),React.createElement(CL,{creditData:X}),0===$&&React.createElement(nI.Notice,{status:"error",isDismissible:!1},(0,At.__)("Oops! Something went wrong while generating AI content for this template. Need help? Please contact","templately")," ",React.createElement("a",{href:"https://wpdeveloper.com/support",target:"_blank"},(0,At.__)("support","templately"))))),React.createElement("div",{className:"templately-dependency-modal-footer"},React.createElement("button",{className:"templately-button skip-button",onClick:function(){f(""),F(null),o(!1),i({type:"ai-content"}),r()}},(0,At.__)("Switch to Regular","templately")),K<=0&&React.createElement("a",{target:"_blank",href:null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_api?"https://www.templately.dev/#credit":"https://www.templately.com/#credit",className:"templately-dmc-submit-button"},React.createElement(SL,null),React.createElement("span",null,(0,At.__)("Buy Credit","templately")),React.createElement(YD,null)),K>0&&React.createElement("button",{disabled:0===$,onClick:function(e){return Z(e)},className:"templately-dmc-submit-button"},React.createElement(SL,null),React.createElement("span",null,(0,At.__)("Preview","templately"))),K>0&&React.createElement("button",{disabled:0===$,onClick:function(e){return Z(e)},className:"templately-dmc-submit-button"},React.createElement(SL,null),React.createElement("span",null,(0,At.__)("Set Branding","templately")),React.createElement(YD,null))))},ML=function(e){var t,n,r,o=kn(),i=pe(dI("isAi",e.isAi),2),a=i[0],l=i[1],s=QE(),c=s.setSteps,u=s.steps,d=s.removeStep,p=s.startImporting,h=s.eventSourceRef,f=s.isImportRunning,m=s.isImportComplete,g=s.startModifyAiContent,v=Sn(function(e){var t;return{currentStep:null!==(t=e.general.fullSiteImport.currentStep)&&void 0!==t?t:1,results:e.general.fullSiteImport.results}},Jt),y=v.currentStep,b=v.results,w=Sn(function(e){var t=e.general.fullSiteImport.formData;return e.general.fullSiteImport.formData||(t=new FormData,o({type:ti,payload:t})),t},Jt),k=new Map;null===(t=e.items)||void 0===t||t.map(function(e){var t;null===(t=e.dependencies)||void 0===t||t.map(function(e){k.set(e.plugin_file,e)})}),w.set("id",null==e?void 0:e.id);var E=pe(ae().useState(!1),2),O=E[0],x=E[1],S=function(){var e=pe((0,oe.useState)(window.location),2),t=e[0],n=e[1];return(0,oe.useEffect)(function(){var e=function(e){n(WE({},window.location))};return window.addEventListener("popstate",e),function(){window.removeEventListener("popstate",e)}},[]),t}(),_=null!==(n=null===(r=window.history.state)||void 0===r?void 0:r.usr)&&void 0!==n?n:{};return(0,oe.useEffect)(function(){m&&(o({type:ei,payload:m}),o(Ry(4)))},[m]),(0,oe.useEffect)(function(){var t=null==_?void 0:_.isRunning;f?t||e.pushState("isRunning"):e.removeState("isRunning")},[f]),(0,oe.useEffect)(function(){!(null==_?void 0:_.isRunning)&&O&&f&&e.pushState("isRunning")},[S,O]),(0,oe.useEffect)(function(){!0!==(null==_?void 0:_.modal)&&O&&!f&&(x(!1),Tl.close())},[S]),(e=>{const t=(0,oe.useRef)(e);(0,oe.useEffect)(()=>{t.current=e});const n="function"==typeof e;(0,oe.useEffect)(()=>{if(n){const e=e=>{const n=t.current(e);n||"string"==typeof n?(e.preventDefault(),e.returnValue=n):e.defaultPrevented&&(e.returnValue=!0)};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)}},[n])})(function(e){if((null==_?void 0:_.isRunning)&&O&&f)return e.preventDefault(),alert((0,At.__)("Please wait until the import process is complete before navigating back.","templately")),!1}),(0,oe.useEffect)(function(){return x(!0),function(){var e;null===(e=h.current)||void 0===e||e.close(),x(!1)}},[]),ae().createElement(ae().Fragment,null,0===y&&ae().createElement("div",{className:"templately-dependency-modal-container"},ae().createElement("div",{className:"templately-dependency-modal"},ae().createElement(AL,{back:function(){return o(Ry(0))},next:function(){return o(Ry(1))},pack_id:null==e?void 0:e.id,formData:w,removeStep:d,setIsAi:l}),ae().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:function(){return e.setShowFSIModal()}},ae().createElement(oI,null)))),1===y&&ae().createElement("div",{className:"templately-dependency-modal-container full-screen"},ae().createElement("div",{className:"templately-dependency-modal"},ae().createElement(ZI,{id:null==e?void 0:e.id,live_url:null==e?void 0:e.live_url,has_settings:null==e?void 0:e.has_settings,name:e.name,back:function(){return o(Ry(0))},next:function(){return o(Ry(2))},formData:w,showErrorAlert:e.showErrorAlert,isAi:a,ogIsAi:e.isAi,setShowFSIModal:e.setShowFSIModal,startModifyAiContent:g}))),2===y&&(null==u?void 0:u.length)<=0&&ae().createElement("div",{className:"templately-dependency-modal-container"},ae().createElement("div",{className:"templately-dependency-modal"},ae().createElement(eL,{back:function(){return o(Ry(1))},next:function(){return o(Ry(3))},dependencies:k,categories:e.categories,formData:w,setSteps:c,steps:u,hasAttachment:e.hasAttachment,isAi:a}),ae().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:function(){return e.setShowFSIModal()}},ae().createElement(oI,null)))),3===y&&(null==u?void 0:u.length)>0&&ae().createElement("div",{className:"templately-dependency-modal-container"},ae().createElement("div",{className:"templately-dependency-modal"},ae().createElement(yL,{steps:u,formData:w,start:p,startModifyAiContent:g,isAi:a}),ae().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:function(){return e.setShowFSIModal()}},ae().createElement(oI,null)))),4===y&&ae().createElement("div",{className:"templately-dependency-modal-container"},ae().createElement("div",{className:"templately-dependency-modal"},ae().createElement(vL,{results:b,steps:u,isAi:a,formData:w}),ae().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:function(){return e.setShowFSIModal()}},ae().createElement(oI,null)))))},NL=function(e){var t=Sn(function(e){var t,n;return null!==(t=null==e||null===(n=e.general)||void 0===n||null===(n=n.fullSiteImport)||void 0===n||null===(n=n.fsiModalContext)||void 0===n?void 0:n.show)&&void 0!==t&&t},Jt),n=pe(dI("isAi",!1),2),r=n[0],o=n[1],i=Sn(function(e){var t,n;return null!==(t=null==e||null===(n=e.general)||void 0===n||null===(n=n.fullSiteImport)||void 0===n?void 0:n.triggerHandleClick)&&void 0!==t?t:null},Jt),a=Sn(function(e){return null!=e.profile.data},Jt),l=Sn(function(e){return e.profile},Jt),s=kn(),c=rt(),u=tt(),d=function(){var e,t,n=kn(),r=pe((0,oe.useState)(!1),2),o=r[0],i=r[1],a=pe((0,oe.useState)(!1),2),l=a[0],s=a[1],c=pe((0,oe.useState)(null),2),u=c[0],d=c[1],p=Sn(function(e){var t;return null!==(t=e.profile.isVerifying)&&void 0!==t&&t}),h=Sn(function(e){return e.profile}),f=Sn(function(e){return null!==e.profile.data});return(0,oe.useEffect)(function(){var e,t;l&&!p&&(i(!1),s(!1),Tl.close(),u&&(u.resolve({is_verified:null!==(e=null==h||null===(t=h.data)||void 0===t?void 0:t.is_verified)&&void 0!==e&&e}),d(null)))},[p,l,null==h||null===(e=h.data)||void 0===e?void 0:e.is_verified,u]),(0,oe.useCallback)(Ei(xi().mark(function e(){var t;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!f||null!=h&&null!==(t=h.data)&&void 0!==t&&t.is_verified||o||p){e.next=1;break}return i(!0),s(!0),Al({icon:"info",showCloseButton:!0,allowOutsideClick:!0,showConfirmButton:!1,html:React.createElement("div",{className:"templately-import-modal templately-modal"},React.createElement(dd,{code:"verification_check",title:(0,At.__)("Checking Account Verification...","templately"),message:(0,At.sprintf)((0,At.__)('We are checking your account verification status. Please wait while we verify your account. If you haven\'t verified your account yet, please check your email for the verification link. Need help? Contact our <a href="%s" target="_blank" rel="noopener noreferrer">support team</a>.',"templately"),"https://wpdeveloper.com/support/")}))},!0),n(Qi()),e.abrupt("return",new Promise(function(e,t){var n=setTimeout(function(){i(!1),s(!1),window.Swal&&window.Swal.isVisible()&&window.Swal.close(),t(new Error("Verification check timeout"))},1e4);d({resolve:function(t){clearTimeout(n),e(t)},reject:function(e){clearTimeout(n),t(e)}})}));case 1:return e.abrupt("return",!1);case 2:case"end":return e.stop()}},e)})),[n,f,null==h||null===(t=h.data)||void 0===t?void 0:t.is_verified,o,p])}(),p=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"modal";null!==(e=u.state)&&void 0!==e&&e[t]||c(ub(u.pathname.replace(/^\/+/,"")),{state:Tt({},t,!0)})},h=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"modal";null!==(e=window.history.state)&&void 0!==e&&null!==(e=e.usr)&&void 0!==e&&e[t]&&c(-1)},f=function(){var t=Ei(xi().mark(function t(n){var r,i,f;return xi().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a){t.next=1;break}return c(ub("sign-in"),{state:{redirectTo:u.pathname.replace(/^\/(.*)/,"$1")}}),t.abrupt("return");case 1:return i=null==l||null===(r=l.data)||void 0===r?void 0:r.is_verified,t.prev=2,t.next=3,d();case 3:!0===(null==(f=t.sent)?void 0:f.is_verified)&&(i=!0),t.next=5;break;case 4:t.prev=4,t.catch(2);case 5:if(!iv(a,i)){t.next=6;break}return t.abrupt("return");case 6:if(h(),h("isRunning"),p(),s(zy()),s(Yy()),s(Ry(1)),s(jy(0)),s(Fy(!1)),window.templately.can_fsi){t.next=7;break}return Al({icon:"warning",showCloseButton:!0,html:React.createElement(i_,{title:(0,At.__)("Oops!","templately"),content:(0,At.__)("Unfortunately, you don't have permission to import templates. Please check your permissions or contact the website admin for help.","templately")})},!1),t.abrupt("return");case 7:s(n?Wy({id:e.id}):Uy()),o(n);case 8:case"end":return t.stop()}},t,null,[[2,4]])}));return function(_x){return t.apply(this,arguments)}}(),m=function(){s(zy()),h(),h("isRunning"),s(Fy(!0)),s(Vy())};return(0,oe.useEffect)(function(){t||m()},[t]),(0,oe.useEffect)(function(){i&&i.id===e.id&&f(i.isWithAI)},[i]),React.createElement(React.Fragment,null,React.createElement(RS(),{isOpen:t,onRequestClose:function(){return m()},className:"templately-dependency-modal-content",portalClassName:"templately-dependency-modal-portal",overlayClassName:"templately-dependency-modal-overlay",style:{overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",zIndex:"159999"},content:{position:"fixed",top:0,left:0,right:0,bottom:0,border:"none",background:"transparent",borderRadius:"0",outline:"none",padding:"0",width:"100vw",height:"100vh"}}},React.createElement(ML,re({},e,{pushState:p,removeState:h,setShowFSIModal:function(){return s(Vy())},showErrorAlert:function(e){s(zy()),s(Fy(!0)),Al({icon:"info",showCloseButton:!0,html:React.createElement(i_,{title:(0,At.__)("Oops!","templately"),content:e})},!1)},isAi:r}))),React.createElement("button",{type:"button",onClick:function(){return f(!1)},className:"templately-item-details-fsi-button"},React.createElement(RD,null),React.createElement("span",null,(0,At.__)("Build Full Website","templately"))),(null==e?void 0:e.ai_compatible)&&React.createElement("button",{type:"button",onClick:function(){return f(!0)},className:"templately-item-details-fsi-ai-button with-ai"},React.createElement($D,{classNamePrefix:el()}),React.createElement("span",null,(0,At.__)("Build with Templately AI","templately")),React.createElement("span",{className:"templately-button-badge"},"Beta")))};var DL=["children","details"],IL=(0,oe.createContext)({items:[],templateType:"",type:"",setType:function(e){return e}}),LL=function(e){var t,n,r,o,i,a=e.children,l=e.details,s=(Wn(e,DL),pe((0,oe.useState)({blocks:!1,pages:!1}),2)),c=s[0],u=s[1],d=pe((0,oe.useState)("all"),2),p=d[0],h=d[1],f=pe((0,oe.useState)(null),2),m=f[0],g=f[1],v=pe((0,oe.useState)([]),2),y=v[0],b=v[1],w=pe((0,oe.useState)([]),2),k=w[0],E=w[1];return(0,oe.useEffect)(function(){var e;if((null==l||null===(e=l.items)||void 0===e?void 0:e.length)>0){var t=null==l?void 0:l.items.filter(function(e){return"block"===e.type}),n=null==l?void 0:l.items.filter(function(e){return"page"===e.type});b(t),E(n)}},[l]),(0,oe.useEffect)(function(){g(null)},[p]),ae().createElement(IL.Provider,{value:{id:null==l?void 0:l.id,name:null==l?void 0:l.name,fullsite_import:null!==(t=null==l?void 0:l.fullsite_import)&&void 0!==t&&t,ai_compatible:null!==(n=null==l?void 0:l.ai_compatible)&&void 0!==n&&n,has_settings:null!==(r=null==l?void 0:l.has_settings)&&void 0!==r&&r,hasAttachment:null!==(o=null==l?void 0:l.has_attachments)&&void 0!==o&&o,items:null==l?void 0:l.items,live_url:null==l?void 0:l.live_url,categories:null!==(i=null==l?void 0:l.categories)&&void 0!==i?i:[],blocksData:y,pagesData:k,type:p,setType:h,templateType:m,setTemplateType:g,isOpen:c,setIsOpen:u}},a)},RL=IL.Consumer,jL={trigger:{color:"#475467",fontSize:"1rem","line-height":"1.25 !important","font-weight":600},content:{backgroundColor:"#fff",border:"1px solid #ddd",borderRadius:"4px",padding:"10px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",zIndex:100,maxWidth:"20rem"},arrow:{fill:"#fff"}};const FL=function(e){var t;return React.createElement(xM,null,React.createElement(SM,{asChild:!0},React.createElement("button",{className:"templately-item-details-item-meta-category-popover-button"},(null==e||null===(t=e.details)||void 0===t||null===(t=t.categories)||void 0===t?void 0:t.length)-1," more")),React.createElement(_M,null,React.createElement(CM,{className:"hello",sideOffset:5,align:"end",style:jL.content},null==e?void 0:e.children)))};var zL=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),BL=oe.forwardRef((e,t)=>(0,QP.jsx)(JP.span,{...e,ref:t,style:{...zL,...e.style}}));BL.displayName="VisuallyHidden";var WL=BL,[UL,VL]=$P("Tooltip",[WT]),HL=WT(),qL="TooltipProvider",QL=700,$L="tooltip.open",[GL,YL]=UL(qL),XL=e=>{const{__scopeTooltip:t,delayDuration:n=QL,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=oe.useRef(!0),l=oe.useRef(!1),s=oe.useRef(0);return oe.useEffect(()=>{const e=s.current;return()=>window.clearTimeout(e)},[]),(0,QP.jsx)(GL,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:oe.useCallback(()=>{window.clearTimeout(s.current),a.current=!1},[]),onClose:oe.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:oe.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:i})};XL.displayName=qL;var KL="Tooltip",[ZL,JL]=UL(KL),eR=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=e,s=YL(KL,e.__scopeTooltip),c=HL(t),[u,d]=oe.useState(null),p=OT(),h=oe.useRef(0),f=a??s.disableHoverableContent,m=l??s.delayDuration,g=oe.useRef(!1),[v,y]=dA({prop:r,defaultProp:o??!1,onChange:e=>{e?(s.onOpen(),document.dispatchEvent(new CustomEvent($L))):s.onClose(),i?.(e)},caller:KL}),b=oe.useMemo(()=>v?g.current?"delayed-open":"instant-open":"closed",[v]),w=oe.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,y(!0)},[y]),k=oe.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y(!1)},[y]),E=oe.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,y(!0),h.current=0},m)},[m,y]);return oe.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),(0,QP.jsx)(rA,{...c,children:(0,QP.jsx)(ZL,{scope:t,contentId:p,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:oe.useCallback(()=>{s.isOpenDelayedRef.current?E():w()},[s.isOpenDelayedRef,E,w]),onTriggerLeave:oe.useCallback(()=>{f?k():(window.clearTimeout(h.current),h.current=0)},[k,f]),onOpen:w,onClose:k,disableHoverableContent:f,children:n})})};eR.displayName=KL;var tR="TooltipTrigger",nR=oe.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=JL(tR,n),i=YL(tR,n),a=HL(n),l=qP(t,oe.useRef(null),o.onTriggerChange),s=oe.useRef(!1),c=oe.useRef(!1),u=oe.useCallback(()=>s.current=!1,[]);return oe.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),(0,QP.jsx)(oA,{asChild:!0,...a,children:(0,QP.jsx)(JP.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:UP(e.onPointerMove,e=>{"touch"!==e.pointerType&&(c.current||i.isPointerInTransitRef.current||(o.onTriggerEnter(),c.current=!0))}),onPointerLeave:UP(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:UP(e.onPointerDown,()=>{o.open&&o.onClose(),s.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:UP(e.onFocus,()=>{s.current||o.onOpen()}),onBlur:UP(e.onBlur,o.onClose),onClick:UP(e.onClick,o.onClose)})})});nR.displayName=tR;var rR="TooltipPortal",[oR,iR]=UL(rR,{forceMount:void 0}),aR=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=JL(rR,t);return(0,QP.jsx)(oR,{scope:t,forceMount:n,children:(0,QP.jsx)(sA,{present:n||i.open,children:(0,QP.jsx)(lA,{asChild:!0,container:o,children:r})})})};aR.displayName=rR;var lR="TooltipContent",sR=oe.forwardRef((e,t)=>{const n=iR(lR,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=JL(lR,e.__scopeTooltip);return(0,QP.jsx)(sA,{present:r||a.open,children:a.disableHoverableContent?(0,QP.jsx)(hR,{side:o,...i,ref:t}):(0,QP.jsx)(cR,{side:o,...i,ref:t})})}),cR=oe.forwardRef((e,t)=>{const n=JL(lR,e.__scopeTooltip),r=YL(lR,e.__scopeTooltip),o=oe.useRef(null),i=qP(t,o),[a,l]=oe.useState(null),{trigger:s,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,p=oe.useCallback(()=>{l(null),d(!1)},[d]),h=oe.useCallback((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);l(i),d(!0)},[d]);return oe.useEffect(()=>()=>p(),[p]),oe.useEffect(()=>{if(s&&u){const e=e=>h(e,u),t=e=>h(e,s);return s.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{s.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}},[s,u,h,p]),oe.useEffect(()=>{if(a){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=s?.contains(t)||u?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],l=t[i],s=a.x,c=a.y,u=l.x,d=l.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(o=!o)}return o}(n,a);r?p():o&&(p(),c())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[s,u,a,c,p]),(0,QP.jsx)(hR,{...e,ref:i})}),[uR,dR]=UL(KL,{isInside:!1}),pR=function(e){const t=({children:e})=>(0,QP.jsx)(QP.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=KP,t}("TooltipContent"),hR=oe.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=e,s=JL(lR,n),c=HL(n),{onClose:u}=s;return oe.useEffect(()=>(document.addEventListener($L,u),()=>document.removeEventListener($L,u)),[u]),oe.useEffect(()=>{if(s.trigger){const e=e=>{const t=e.target;t?.contains(s.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[s.trigger,u]),(0,QP.jsx)(oT,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,QP.jsxs)(iA,{"data-state":s.stateAttribute,...c,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,QP.jsx)(pR,{children:r}),(0,QP.jsx)(uR,{scope:n,isInside:!0,children:(0,QP.jsx)(WL,{id:s.contentId,role:"tooltip",children:o||r})})]})})});sR.displayName=lR;var fR="TooltipArrow",mR=oe.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=HL(n);return dR(fR,n).isInside?null:(0,QP.jsx)(aA,{...o,...r,ref:t})});mR.displayName=fR;var gR=XL,vR=eR,yR=nR,bR=aR,wR=sR,kR=mR,ER=["children","content","side","align","sideOffset","alignOffset","open","onOpenChange","className","disabled","enableClick"],OR={content:{backgroundColor:"#5453fd",color:"#fff",padding:"5px 10px",fontSize:"12px",borderRadius:"6px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",zIndex:1e4,maxWidth:"300px",wordWrap:"break-word"},arrow:{fill:"#5453fd"}};const xR=function(e){var t=e.children,n=e.content,r=e.side,o=void 0===r?"top":r,i=e.align,a=void 0===i?"center":i,l=e.sideOffset,s=void 0===l?5:l,c=e.alignOffset,u=void 0===c?0:c,d=e.open,p=e.onOpenChange,h=e.className,f=void 0===h?"":h,m=e.disabled,g=void 0!==m&&m,v=e.enableClick,y=void 0!==v&&v,b=Wn(e,ER),w=pe((0,oe.useState)(!1),2),k=w[0],E=w[1],O=pe((0,oe.useState)(!1),2),x=O[0],S=O[1],_=y?k||x:d;return(0,oe.useEffect)(function(){if(y){var e=function(e){if(k){var t=e.target,n=document.querySelectorAll('[data-slot="tooltip"], [data-slot="tooltip-trigger"], [data-slot="tooltip-content"]');Array.from(n).some(function(e){return e.contains(t)})||E(!1)}};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}},[k,y]),g||!n?t:ae().createElement(gR,{delayDuration:0},ae().createElement(vR,re({open:_,onOpenChange:function(e){y?k||S(e):p&&p(e)}},b),ae().createElement(yR,{asChild:!0,onClick:function(){y&&(E(!k),S(!1))}},t),ae().createElement(bR,null,ae().createElement(wR,{side:o,align:a,sideOffset:s,alignOffset:u,className:"templately-custom-tooltip ".concat(f),style:OR.content,"data-slot":"tooltip-content"},n,ae().createElement(kR,{className:"templately-custom-tooltip-arrow",style:OR.arrow})))))},SR=o.p+"images/blurry-bg.png",_R=o.p+"images/templately-bg-gradient.png";function CR(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 PR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CR(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TR(e){if(e){var t=(e=e.toString()).match(/^-?\d+(?:\.\d{0,2})?/);return t?t[0]:e}return e}const AR=gn(function(e){var t,n;return{proPlans:(null!==(t=null===(n=e.general)||void 0===n||null===(n=n.pricing)||void 0===n?void 0:n.data)&&void 0!==t?t:[]).filter(function(e){return("year"===e.type||"one_time"===e.type)&&e.price>0}),counts:e.general.counts,isCountsLoading:null===e.general.counts}})(function(e){var t,n=e.proPlans,r=e.counts,o=e.isCountsLoading,i=function(e){return function(e,t,n,r,o,i){var a,l="https://templately.com/checkout/";null!==(a=window.templatelyDeveloper)&&void 0!==a&&a.dev_api&&(l="https://templately.dev/checkout/");var s={planId:t,plan_name:e,type:o,slug:n,utm_source:"plugin",utm_medium:"upgradeButton"};return r&&(s.coupon=r),i&&(s.sites=i),(0,Ci.addQueryArgs)(l,s)}(e.name,e.id,e.slug,e.coupon,e.type,e.sites)},a=pe((0,oe.useState)(!1),2),l=a[0],s=a[1],c=pe((0,oe.useState)({starter:0,pro:0}),2),u=c[0],d=c[1];return(0,oe.useEffect)(function(){if(za(r)){var e=Object.values(r).map(function(e){return e.items}),t=e.reduce(function(e,t){return e+t.starter},0),n=e.reduce(function(e,t){return e+t.pro},0);d({starter:t,pro:n})}},[r]),n&&0!==n.length?ae().createElement(ae().Fragment,null,ae().createElement("button",{className:"templately-item-details-upgrade-plan-button",onClick:function(){return s(!0)}},ae().createElement("span",{className:"templately-item-details-upgrade-plan-button-text"},ae().createElement("span",null,"Unlimited template from"),ae().createElement("span",{className:"templately-item-details-upgrade-plan-button-price"},"$",(t=function(e){if(!e||0===e.length)return null;var t=e.map(function(e){var t=parseFloat(e.discounted_price?e.discounted_price/12:e.price/12);return PR(PR({},e),{},{calculatedPrice:t})}).reduce(function(e,t){return t.calculatedPrice<e.calculatedPrice?t:e});return{price:TR(t.calculatedPrice),plan:t}}(n),t?t.price:"4.99")))),ae().createElement(RS(),{isOpen:l,onRequestClose:function(){return s(!1)},style:{overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",zIndex:3},content:{position:"absolute",top:"50%",left:"50%",right:0,bottom:"auto",border:"none",background:"#28222D",borderRadius:"0.25rem",outline:"none",padding:"0",transform:"translate(-50%, -50%)",width:"40rem",overflow:"visible"}}},ae().createElement("div",{className:"templately-item-details-upgrade-plan-modal"},ae().createElement("button",{type:"button",className:"templately-item-details-upgrade-plan-modal-close",onClick:function(){return s(!1)}},ae().createElement("i",{className:"dashicons dashicons-no-alt"})),ae().createElement("div",{className:"templately-item-details-upgrade-plan-modal-content"},ae().createElement("img",{src:_R,alt:"background",className:"templately-item-details-upgrade-plan-modal-bg"}),ae().createElement("div",{className:"templately-item-details-upgrade-plan-modal-inner"},ae().createElement("h2",{className:"templately-item-details-upgrade-plan-modal-heading"},"Download Unlimited and ",ae().createElement("br",null)," Save upto ",ae().createElement("span",{className:""},"52%")),ae().createElement("ul",{className:"templately-item-details-upgrade-plan-modal-list"},ae().createElement("li",{className:"templately-item-details-upgrade-plan-modal-list-item"},ae().createElement("i",{className:"dashicons dashicons-yes-alt"}),ae().createElement("span",{className:"templately-item-details-upgrade-plan-modal-list-item-text"},o?"...":u.starter," Starter Items")),ae().createElement("li",{className:"templately-item-details-upgrade-plan-modal-list-item"},ae().createElement("i",{className:"dashicons dashicons-yes-alt"}),ae().createElement("span",{className:"templately-item-details-upgrade-plan-modal-list-item-text"},"Unlimited WorkSpace")),ae().createElement("li",{className:"templately-item-details-upgrade-plan-modal-list-item"},ae().createElement("i",{className:"dashicons dashicons-yes-alt"}),ae().createElement("span",{className:"templately-item-details-upgrade-plan-modal-list-item-text"},o?"...":u.pro," PRO Items")),ae().createElement("li",{className:"templately-item-details-upgrade-plan-modal-list-item"},ae().createElement("i",{className:"dashicons dashicons-yes-alt"}),ae().createElement("span",{className:"templately-item-details-upgrade-plan-modal-list-item-text"},"Unlimited Items On My Cloud"))),ae().createElement("div",{className:"templately-item-details-upgrade-plan-modal-plans"},n.map(function(e){return ae().createElement("a",{href:i(e),target:"_blank",className:"templately-item-details-upgrade-plan-modal-plans-item",key:Math.random()},ae().createElement("div",{className:"templately-item-details-upgrade-plan-modal-plans-item-inner"},ae().createElement("p",{className:"templately-item-details-upgrade-plan-modal-plans-item-name"},"one_time"===e.type?ae().createElement(ae().Fragment,null,ae().createElement("span",{className:"templately-item-details-upgrade-plan-modal-plans-item-name-bold"},e.name)," - Unlimited Sites"):"".concat(e.name," - ").concat(e.sites," Sites")),ae().createElement("p",{className:"templately-item-details-upgrade-plan-modal-plans-item-price"},"one_time"===e.type?ae().createElement(ae().Fragment,null,"$".concat(TR(parseFloat(e.discounted_price?e.discounted_price:e.price))),e.discounted_price?ae().createElement("sub",{className:"templately-item-details-upgrade-plan-modal-plans-item-price-sub"},ae().createElement("del",{style:{marginLeft:10,marginRight:0}},"$",e.price)):ae().createElement(ae().Fragment,null)):ae().createElement(ae().Fragment,null,"$".concat(TR(parseFloat(e.discounted_price?e.discounted_price/12:e.price/12)),"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t"),ae().createElement("sub",{className:"templately-item-details-upgrade-plan-modal-plans-item-price-sub"}," ","/ month"))),ae().createElement("span",{className:"templately-item-details-upgrade-plan-modal-plans-item-button"},ae().createElement("span",{className:"templately-item-details-upgrade-plan-modal-plans-item-button-icon"},ae().createElement("i",{className:"dashicons dashicons-arrow-right-alt2"})))))}))))),ae().createElement("div",{className:"tly__modal__closer",onClick:function(){return s(!1)}}))):null});var MR=["template_type","categories","pack","id","platform","dependencies","isPurchased","isSubscribed","details"];function NR(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 DR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NR(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const IR=function(e){var t,n,r,o,i,a,l=e.template_type,s=e.categories,c=(e.pack,e.id),u=e.platform,d=e.dependencies,p=e.isPurchased,h=e.isSubscribed,f=e.details,m=Wn(e,MR),g=kn(),v=rt(),y=pe(Ct(),1)[0],b=Sn(function(e){return null!=e.profile.data}),w=Sn(function(e){return e.profile},Jt),k=(m.downloads,m.favourite_count,m.params,m.price),E=(m.rating,function(e,t,n){var r=rt(),o=pe(Ct(),1)[0],i=pe((0,oe.useState)(!1),2),a=i[0],l=i[1],s=pe((0,oe.useState)(null),2),c=s[0],u=s[1],d=kn(),p=Sn(function(e){return e.profile},Jt),h=Sn(function(e){return null!==e.profile.data}),f=Sn(function(e){var t,n;return null!==(t=null===(n=e.profile.favourite)||void 0===n?void 0:n.loading)&&void 0!==t&&t}),m=Sn(function(e){var t,n;return null!==(t=null===(n=e.profile.favourite)||void 0===n?void 0:n.error)&&void 0!==t&&t}),g=(0,oe.useMemo)(function(){return null===c||m?n:c},[c,n,m]);return(0,oe.useEffect)(function(){if(a&&!h)return l(!1),r(ub("sign-in",Tt({},"redirect-to",o.get("path"))));if(a){if(f)return;u(function(e){return!e}),d(ra({action:g?"undo":"do",id:e,itemType:t})),l(!1)}},[a]),(0,oe.useEffect)(function(){m&&"string"==typeof m&&(u(null),dv(h,p,m))},[m]),{starred:g,isClicked:a,favouriteLoading:f,setIsClicked:l}}(c,m.type,m.is_favourite)),O=E.starred,x=E.setIsClicked,S=E.favouriteLoading,_=pe((0,oe.useState)(null),2),C=_[0],P=_[1],T=Sn(function(e){var t,n;return null!==(t=null===(n=e.profile.rating)||void 0===n?void 0:n.error)&&void 0!==t&&t}),A=Sn(function(e){var t,n;return null!==(t=null===(n=e.profile.rating)||void 0===n?void 0:n.loading)&&void 0!==t&&t}),M=(0,oe.useMemo)(function(){return null===C||T?m.is_reviewed:C},[m.is_reviewed,C,T]),N=(0,oe.useMemo)(function(){if("pack"==m.type){var e,t={};return null===(e=m.items)||void 0===e||e.filter(function(e){var n;(null==e||null===(n=e.dependencies)||void 0===n?void 0:n.length)>0&&e.dependencies.map(function(e){t[e.id]=e})}),Object.values(t)}return d},[]);(0,oe.useEffect)(function(){T&&"string"==typeof T&&dv(b,w,T)},[T]);var D=pe((0,oe.useState)(!1),2),I=D[0],L=D[1],R=function(e){var t;e!==u&&v(ub("".concat(e,"/").concat("pack"===m.type?"packs":"page"===m.type?"pages":"blocks","/").concat(null==m||null===(t=m.variations)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.slug)))};return(0,oe.useEffect)(function(){I&&Al({showConfirmButton:!1,showDenyButton:!1,icon:!1,type:"warning",title:!1,showCloseButton:!0,customClass:{container:"templately-video-container",popup:"templately-video-popup",closeButton:"templately-video-close-button",htmlContainer:"templately-video-html"},html:ae().createElement("iframe",{width:"850",height:"480",src:"https://www.youtube.com/embed/ZhzHWqMD1Zk?autoplay=1&rel=0",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:!0})},!1).then(function(e){(null!=e&&e.isConfirmed||null!=e&&e.isDismissed)&&L(!1)})},[I]),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-item-details-item-meta"},ae().createElement("img",{src:SR,alt:"background",height:1456,width:1696,className:"templately-item-details-item-meta-background"}),ae().createElement("div",{className:"templately-item-details-item-meta-header"},ae().createElement("div",{className:"templately-item-details-item-meta-variations-button-wrapper ".concat("")},"elementor"!==(null==m||null===(t=m.variations)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.platform)&&"elementor"!==u?ae().createElement(xR,{enableClick:!0,content:(0,At.__)("Coming Soon","templately")},ae().createElement("span",{className:"templately-item-details-item-meta-variations-button not-available"},(0,At.__)("Elementor","templately"))):ae().createElement("button",{type:"button",onClick:function(){R("elementor")},className:"templately-item-details-item-meta-variations-button ".concat("elementor"===u?"active":"")},(0,At.__)("Elementor","templately")),"gutenberg"!==(null==m||null===(n=m.variations)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.platform)&&"gutenberg"!==u?ae().createElement(xR,{enableClick:!0,content:(0,At.__)("Coming Soon","templately")},ae().createElement("span",{className:"templately-item-details-item-meta-variations-button not-available"},(0,At.__)("Gutenberg","templately"))):ae().createElement("button",{type:"button",onClick:function(){R("gutenberg")},className:"templately-item-details-item-meta-variations-button ".concat("gutenberg"===u?"active":"")},(0,At.__)("Gutenberg","templately")))),ae().createElement("div",{className:"templately-item-details-item-meta-body"},ae().createElement("div",{className:"templately-item-details-item-meta-content-wrapper"},ae().createElement("div",{className:"templately-item-details-item-meta-content"},ae().createElement("div",{className:"templately-item-details-item-meta-content-inner"},ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-item-details-item-meta-title"},"Published Date"),ae().createElement("div",{className:"templately-item-details-item-meta-info"},null!==(r=null==f?void 0:f.published_at)&&void 0!==r?r:"--")),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-item-details-item-meta-title"},"Last Update"),ae().createElement("div",{className:"templately-item-details-item-meta-info"},null!==(o=null==f?void 0:f.updated_at)&&void 0!==o?o:"--")),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-item-details-item-meta-title"},"Type"),ae().createElement("div",{className:"templately-item-details-item-meta-info"},null!==(i=null==l?void 0:l.name)&&void 0!==i?i:"--")),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-item-details-item-meta-title"},"Category"),ae().createElement("div",{className:"templately-item-details-item-meta-categories"},0!==(null==s?void 0:s.length)?(null==s?void 0:s.length)<2?null==s?void 0:s.map(function(e,t){return ae().createElement(ae().Fragment,{key:Math.random()},ae().createElement(eS,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(u,"/").concat(m.type,"s"),className:"templately-item-details-item-meta-category"},e.name))}):ae().createElement(ae().Fragment,null,null==s?void 0:s.slice(0,1).map(function(e,t){return ae().createElement(ae().Fragment,{key:Math.random()},ae().createElement(eS,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(u,"/").concat(m.type,"s"),className:"templately-item-details-item-meta-category"},e.name),ae().createElement("span",{className:"templately-item-details-item-meta-category-separator"}," and "))}),ae().createElement(FL,{details:f},ae().createElement(ae().Fragment,null,null==s?void 0:s.map(function(e,t){return ae().createElement(ae().Fragment,{key:Math.random()},ae().createElement(eS,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(u,"/").concat(m.type,"s"),className:"templately-item-details-item-meta-category"},e.name)," ",t+1<(null==s?void 0:s.length)?", ":"")})))):"--"))),ae().createElement("div",{className:"templately-item-details-item-meta-content-badges"},null==f||null===(a=f.badges)||void 0===a?void 0:a.map(function(e){var t=tl.find(function(t){return t.key===e});return ae().createElement("div",{key:t.key,className:"templately-item-details-item-meta-content-badges-badge ".concat(t.class)},ae().createElement("img",{src:t.image,alt:"trending",height:63,width:56,className:"templately-item-details-item-meta-content-badges-badge-image"}),ae().createElement("h4",{className:"templately-item-details-item-meta-content-badges-badge-title"},t.title))})),ae().createElement("div",{className:"templately-item-details-item-meta-content-ratting-and-favorite flex gap-2 items-center"},ae().createElement("div",{className:"templately-item-details-item-meta-content-ratting-wrapper"},ae().createElement("span",{className:"templately-item-details-item-meta-title"},"Rate this"),ae().createElement("div",{className:"templately-item-details-item-meta-content-ratting-group"},[1,2,3,4,5].map(function(e){return ae().createElement("button",{key:e,type:"button",onClick:function(){return t=e,void(b?A||(P(t),g((n={type_id:c,itemType:m.type,rating:t},ji({type:ho},n)))):v(ub("sign-in",{"redirect-to":y.get("path")})));var t,n},className:"templately-item-details-item-meta-content-ratting-button"},e<=M?ae().createElement(UD,{fill:"#FEB273"}):ae().createElement(qD,{fill:"#FEB273"}))}))),ae().createElement("button",{type:"button",onClick:function(){return x(!0)},className:"templately-item-details-item-meta-content-favorite-button"},ae().createElement("span",{className:"templately-item-details-item-meta-content-favorite-button-tooltip"},O?"Added to Favorite":"Add to Favorite"),S?ae().createElement(zD,{fill:"#F96796",className:"animate-spin"}):O?ae().createElement(VD,{fill:"#F96796"}):ae().createElement(HD,{fill:"#F96796"})))),ae().createElement("div",{className:"templately-item-details-item-meta-content-fsi-button-wrapper"},ae().createElement("button",{type:"button",onClick:function(){return L(!I)},className:"templately-item-details-item-meta-content-fsi-button"},ae().createElement(BD,null),ae().createElement("span",{className:"templately-item-details-item-meta-content-fsi-button-title-wrapper"},ae().createElement("span",{className:"templately-item-details-item-meta-content-fsi-button-title"},"Starter Guide"),ae().createElement(FD,null)),ae().createElement("span",{className:"templately-item-details-item-meta-content-fsi-button-play-button-wrapper"},ae().createElement("span",{className:"templately-item-details-item-meta-content-fsi-button-play-button"},ae().createElement("span",{className:"templately-item-details-item-meta-content-fsi-button-play-button-inner"},ae().createElement(WD,null))))),ae().createElement("span",{className:"templately-item-details-item-meta-content-fsi-button-learn-more-wrapper"},ae().createElement("a",{target:"_blank",href:"https://docs.templately.com/home/how-templately-full-site-import-works/",className:"templately-item-details-item-meta-content-fsi-button-learn-more"},"Learn more")))),ae().createElement("div",{className:"templately-item-details-button-wrapper"},"pack"===(null==m?void 0:m.type)?ae().createElement(ae().Fragment,null,parseInt(k)>0&&!p&&!h&&ae().createElement("a",{target:"_blank",href:function(e,t,n,r,o,i){var a,l="https://templately.com/checkout/";null!==(a=window.templatelyDeveloper)&&void 0!==a&&a.dev_api&&(l="https://templately.dev/checkout/");var s={action:"payment",type:o,item_id:t,utm_source:"plugin",utm_medium:"purchaseButton"};return r&&(s.coupon=r),i&&(s.sites=i),(0,Ci.addQueryArgs)(l,s)}(null==m||m.name,(null==m?void 0:m.id)||c,null==m||m.slug,null==m?void 0:m.coupon,(null==m?void 0:m.type)||"pack",null==m?void 0:m.sites),className:"templately-item-details-fsi-button"},ae().createElement(RD,null),ae().createElement("span",null,(0,At.sprintf)((0,At.__)("Purchase This %s","templately"),"Pack"))),(null==m?void 0:m.fullsite_import)&&(0===parseInt(k)||p||h)&&ae().createElement(LL,{details:f},ae().createElement(RL,null,function(e){return ae().createElement(NL,re({sidebar:!0,platform:u},e))})),!h&&ae().createElement(AR,null)):ae().createElement(ae().Fragment,null,parseInt(k)>0&&!p&&!h&&ae().createElement("a",{target:"_blank",href:Za(null==m?void 0:m.slug,null==m?void 0:m.type),className:"templately-item-details-fsi-button"},ae().createElement(RD,null),ae().createElement("span",null,(0,At.sprintf)((0,At.__)("Purchase This %s","templately"),"page"===m.type?"Page":"Block"))),(0===parseInt(k)||p||h)&&ae().createElement("button",{onClick:function(){m.isLoggedIn?iv(m.isLoggedIn,w)||Cd({ModalComponent:vd,content:DR({id:c},m)}):v(ub("sign-in",{"redirect-to":y.get("path")}))},className:"templately-item-details-fsi-button"},ae().createElement(RD,null),ae().createElement("span",null,(0,At.sprintf)((0,At.__)("Insert This %s","templately"),"page"===m.type?"Page":"Block"))),!h&&ae().createElement(AR,null))))),null!=N&&N.length?ae().createElement("div",{className:"templately-item-details-item-meta-dependencies-wrapper"},ae().createElement("div",{className:"templately-item-details-item-meta-dependencies-header"},ae().createElement("div",{className:"templately-item-details-item-meta-dependencies-title-wrapper"},ae().createElement("span",{className:"templately-item-details-item-meta-dependencies-title"},"Dependency"))),ae().createElement("div",{className:"templately-item-details-item-meta-dependencies-body"},ae().createElement("div",{className:"templately-item-details-item-meta-dependencies-body-inner"},N.map(function(e,t){return ae().createElement(ae().Fragment,{key:t},ae().createElement("a",{href:e.link&&"#"!==e.link?e.link:void 0,target:e.link&&"#"!==e.link?"_blank":void 0,rel:"noreferrer",className:"templately-item-details-item-meta-dependencies-item"},ae().createElement("span",{className:"templately-item-details-item-meta-dependencies-item-tooltip"},e.name),e.icon?ae().createElement("img",{src:e.icon,alt:e.name,height:"30",width:"30",className:"templately-item-details-item-meta-dependencies-item-icon"}):ae().createElement("span",{className:"templately-item-details-item-meta-dependencies-item-text"},e.name[0])))})))):ae().createElement(ae().Fragment,null))};var LR=function(e){var t=e.data,n=e.platform,r=e.type;return 0===t.length?React.createElement("div",null):React.createElement("div",{className:"templately-item-details-items-grid-panel"},t.map(function(e,t){return React.createElement("div",{key:t,className:"templately-item-details-items-grid-panel-items"},React.createElement("h4",{className:"templately-item-details-items-grid-panel-items-title"},e.name),React.createElement(xt,{to:ub("".concat(n,"/").concat(r,"/").concat(null==e?void 0:e.slug)),className:"templately-item-details-items-grid-panel-items-image-wrapper"},React.createElement("img",{src:e.thumbnail?"".concat(e.thumbnail):"https://assets.templately.com/frontend/banner.jpg",alt:"".concat(e&&e.name," thumbnail"),className:"templately-item-details-items-grid-panel-items-image"})))}))};const RR=function(e){var t=e.items,n=e.platform,r=pe((0,oe.useState)([]),2),o=r[0],i=r[1],a=pe((0,oe.useState)([]),2),l=a[0],s=a[1],c=pe((0,oe.useState)(!1),2),u=c[0],d=c[1];return(0,oe.useEffect)(function(){var e=null==t?void 0:t.filter(function(e){return"block"===e.type}),n=null==t?void 0:t.filter(function(e){return"page"===e.type});s(n),i(e)},[t]),(0,oe.useEffect)(function(){l.length<=0&&o.length>0&&d(!0)},[o,l]),React.createElement("div",{className:"templately-item-details-panel"},React.createElement("div",{className:"templately-item-details-panel-header"},React.createElement("div",{className:"templately-item-details-panel-header-inner"},l.length>0&&React.createElement("button",{type:"button",onClick:function(){return d(!1)},className:"templately-item-details-panel-header-button ".concat(u?"not-selected":"selected")},(0,At.__)("Pages","templately")),o.length>0&&React.createElement("button",{type:"button",onClick:function(){return d(!0)},className:"templately-item-details-panel-header-button ".concat(u?"selected":"not-selected")},(0,At.__)("Blocks","templately")))),u?React.createElement(LR,{data:o,platform:n,type:"blocks"}):React.createElement(LR,{data:l,platform:n,type:"pages"}))};var jR=function(e){var t=e.data,n=e.platform,r=e.type;return 0===t.length?React.createElement("div",null):React.createElement("div",{className:"templately-item-details-items-grid-panel"},t.map(function(e,t){return React.createElement("div",{key:t,className:"templately-item-details-items-grid-panel-items"},React.createElement("h4",{className:"templately-item-details-items-grid-panel-items-title"},e.name),React.createElement(xt,{to:ub("".concat(n,"/").concat(r,"/").concat(null==e?void 0:e.slug)),className:"templately-item-details-items-grid-panel-items-image-wrapper"},React.createElement("img",{src:e.thumbnail?"".concat(e.thumbnail):"https://assets.templately.com/frontend/banner.jpg",alt:"".concat(e&&e.name," thumbnail"),className:"templately-item-details-items-grid-panel-items-image"})))}))};const FR=function(e){var t=e.items,n=e.pack,r=e.platform,o=pe((0,oe.useState)([]),2),i=o[0],a=o[1],l=pe((0,oe.useState)([]),2),s=l[0],c=l[1],u=pe((0,oe.useState)(!1),2),d=u[0],p=u[1];return(0,oe.useEffect)(function(){var e=null==t?void 0:t.filter(function(e){return"block"===e.type}),n=null==t?void 0:t.filter(function(e){return"page"===e.type});c(n),a(e)},[t]),(0,oe.useEffect)(function(){s.length<=0&&i.length>0&&p(!0)},[i,s]),React.createElement("div",{className:"templately-item-details-panel"},React.createElement("div",{className:"templately-item-details-panel-header"},React.createElement("div",{className:"templately-item-details-panel-header-title-wrapper"},React.createElement("h4",{className:"templately-item-details-panel-header-title"},(0,At.__)("More ".concat(d?"blocks":"pages"," of "),"templately"),null==n?void 0:n.name," ",(0,At.__)("Pack","templately")),React.createElement(xt,{to:ub("".concat(r,"/packs/").concat(null==n?void 0:n.slug)),className:"templately-item-details-panel-header-title-link"},(0,At.__)("View full Pack","templately"))),React.createElement("div",{className:"templately-item-details-panel-header-inner"},s.length>0&&React.createElement("button",{type:"button",onClick:function(){return p(!1)},className:"templately-item-details-panel-header-button ".concat(d?"not-selected":"selected")},(0,At.__)("Pages","templately")),i.length>0&&React.createElement("button",{type:"button",onClick:function(){return p(!0)},className:"templately-item-details-panel-header-button ".concat(d?"selected":"not-selected")},(0,At.__)("Blocks","templately")))),d?React.createElement(jR,{data:i,platform:r,type:"blocks"}):React.createElement(jR,{data:s,platform:r,type:"pages"}))};var zR=o(4145);const BR=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 21"},e,{style:{fill:"currentColor",height:"18px",width:"18px"}}),oe.createElement("path",{d:"m13.333 7.6-7.417 7.416a.8.8 0 0 1-.583.23.8.8 0 0 1-.583-.23.8.8 0 0 1-.23-.583.8.8 0 0 1 .23-.583l7.416-7.417H5.833a.8.8 0 0 1-.594-.24A.8.8 0 0 1 5 5.6q0-.354.24-.594t.594-.24h8.333q.355 0 .594.24.24.24.24.594v8.333q0 .354-.24.594a.8.8 0 0 1-.594.24.8.8 0 0 1-.593-.24.8.8 0 0 1-.24-.594z"}))};var WR=function(e){var t=e.hasCarousel,n=e.data,r=e.platform;return t?React.createElement("div",{className:"templately-item-details-more-product-panel-carousel-body"},React.createElement(zR.default,{autoPlay:!0,ssr:!0,arrows:!1,showDots:!1,infinite:!0,responsive:{desktop:{breakpoint:{max:3e3,min:1600},items:3},laptop:{breakpoint:{max:1599.98,min:1200},items:3},tablet:{breakpoint:{max:1199.98,min:480},items:2},mobile:{breakpoint:{max:479.98,min:0},items:2}},itemClass:"templately-item-details-more-product-panel-item"},n.map(function(e,t){return React.createElement(xt,{key:t,to:ub("".concat(r,"/packs/").concat(null==e?void 0:e.slug)),className:"templately-item-details-more-product-panel-item-image-wrapper"},React.createElement("img",{src:e.thumbnail?"".concat(e.thumbnail):"https://assets.templately.com/frontend/banner.jpg",alt:"".concat(e&&e.name," thumbnail"),className:"templately-item-details-more-product-panel-item-image"}))}))):React.createElement("div",{className:"templately-item-details-more-product-panel-grid-body"},n.map(function(e,t){return React.createElement("div",{key:t,className:"templately-item-details-more-product-panel-item"},React.createElement(xt,{to:ub("".concat(r,"/packs/").concat(null==e?void 0:e.slug)),className:"templately-item-details-more-product-panel-item-image-wrapper"},React.createElement("img",{src:e.thumbnail?"".concat(e.thumbnail):"https://assets.templately.com/frontend/banner.jpg",alt:"".concat(e&&e.name," thumbnail"),className:"templately-item-details-more-product-panel-item-image"})))}))};const UR=function(e){var t=e.title,n=void 0===t?"More Items":t,r=e.browseLink,o=e.redBg,i=void 0!==o&&o,a=e.data,l=void 0===a?[]:a,s=e.hasCarousel,c=void 0!==s&&s,u=e.platform;if(l.length)return React.createElement("div",{className:"templately-item-details-more-product-panel ".concat(i?"red-bg":"white-bg")},React.createElement("div",{className:"templately-item-details-more-product-panel-head"},React.createElement("h4",{className:"templately-item-details-more-product-panel-title"},(0,At.__)(n,"templately")),r&&React.createElement(xt,{to:r,className:"templately-item-details-more-product-panel-link"},React.createElement("span",null,(0,At.__)("Browse More","templately")),React.createElement(BR,null))),React.createElement(WR,{hasCarousel:c,data:l,platform:u}))},VR=gn(function(e){return{platform:e.general.platform,items:e.general.featured.items,isLoading:e.general.featured.isLoading}},function(e){return{getFeaturedTemplates:function(t){return e(function(e){return Av({type:Do},e)}(t))}}})(function(e){return(0,oe.useEffect)(function(){e.getFeaturedTemplates({platform:e.platform})},[]),e.isLoading?ae().createElement("div",{className:"templately-item-details-more-product-panel",style:{padding:0}},ae().createElement(_l,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:ae().createElement(ae().Fragment,null,ae().createElement(UR,{title:"Featured Products",browseLink:ub("".concat(null==e?void 0:e.platform)),redBg:!0,data:e.items,platform:e.platform,hasCarousel:!0}))});function HR(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 qR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}gn(function(e,t){var n,r,o,i;return{counts:e.general.counts,profile:e.profile.data,isLoggedIn:null!=e.profile.data,pricing:null!==(n=null===(r=e.general)||void 0===r||null===(r=r.pricing)||void 0===r?void 0:r.data)&&void 0!==n?n:[],isPricingLoading:null===(o=null===(i=e.general)||void 0===i||null===(i=i.pricing)||void 0===i?void 0:i.isLoading)||void 0===o||o}},function(e){return{}})(function(e){var t,n,r,o,i,a,l,s,c,u=pe((0,oe.useState)("lifetime"),2),d=u[0],p=u[1],h=pe((0,oe.useState)(Ka("lifetime")),2),f=h[0],m=h[1],g=pe((0,oe.useState)({starter:0,pro:0}),2),v=g[0],y=g[1];(0,oe.useEffect)(function(){if(za(e.counts)){var t=0,n=0;Object.keys(e.counts).map(function(r){Object.keys(e.counts[r]).map(function(o){t+=e.counts[r][o].starter,n+=e.counts[r][o].pro})}),y(function(e){return qR(qR({},e),{},{starter:t,pro:n})})}},[e.counts]),(0,oe.useEffect)(function(){m(Ka(d))},[d]),(0,oe.useEffect)(function(){null!=e.profile&&e.profile.plan.indexOf("yearly")>-1&&p("lifetime")},[e.profile]);var b=(null===(t=e.profile)||void 0===t||null===(t=t.plan)||void 0===t?void 0:t.indexOf("free"))>-1,w=(null===(n=e.profile)||void 0===n||null===(n=n.plan)||void 0===n?void 0:n.indexOf("lifetime"))>-1;if(!b&&e.isLoggedIn)return null;var k={},E={},O="";if(e.details.price>0&&!w){var x=e.pricing.filter(function(e){return"year"==e.type&&e.price>0});if(E=x[0],"premium"===d){if((null==x?void 0:x.length)>0){k=x[0];var S=x[0].discounted_price/12;O="".concat(S.toString().substr(0,S.toString().indexOf(".")+3),"/month")}}else if("lifetime"===d){var _=e.pricing.filter(function(e){return"one_time"==e.type});(null==_?void 0:_.length)>0&&(k=_[0],O="<del>$".concat(_[0].price,"</del> $").concat(_[0].discounted_price))}}return ae().createElement(ae().Fragment,null,e.details.price>0&&!w&&ae().createElement("div",{className:"tly__sidebar__widget tly__site__promote__widget templately-subscription-upgrade-widget templately-item-widget"},ae().createElement("div",{className:"tly__promo_heading"},ae().createElement("img",{src:window.templately.promo_image,alt:"Ultimate Access To All Premium Templates"}),ae().createElement("div",{className:"tly__plan__card tly__center"},ae().createElement("h5",{className:"tly__plan__heading tly__lg"},"Ultimate Access To All Premium Templates"),ae().createElement("div",{className:"tly__plan__description_wrapper tly__mt_0"},ae().createElement("p",{className:"tly__plan__description"},"Build your websites with any of our powerful, premium WordPress templates & the ultimate cloud-based WorkSpace. Go PRO now!")))),ae().createElement("div",{className:"tly__promo_body"},ae().createElement("div",{className:"tly__plan__card"},ae().createElement("h5",{className:"tly__plan__heading"},"Select Your Plan"),ae().createElement("div",{className:"tly__plan__wrapper"},ae().createElement("label",{className:"tly__plan",htmlFor:"templately-subscription-plan-free"},ae().createElement("input",{id:"templately-subscription-plan-free",type:"radio",name:"plan",value:"premium",onChange:function(){return p("premium")},checked:"premium"===d}),ae().createElement("span",{className:"tly__plan_content"},"Premium",ae().createElement("span",{className:"tly__plan__badge"},"Save ",Math.floor(((null===(r=E)||void 0===r?void 0:r.price)-(null===(o=E)||void 0===o?void 0:o.discounted_price))/(null===(i=E)||void 0===i?void 0:i.price)*100),"%"))),ae().createElement("label",{className:"tly__plan",htmlFor:"templately-subscription-plan-lifetime"},ae().createElement("input",{type:"radio",name:"plan",id:"templately-subscription-plan-lifetime",value:"lifetime",onChange:function(){return p("lifetime")},checked:"lifetime"===d}),ae().createElement("span",{className:"tly__plan_content"},"Lifetime"))),ae().createElement("div",{className:"tly__plan__description_wrapper"},ae().createElement("h5",{className:"tly__plan__heading"},"Get Unlimited Access & Save Up To ",Math.floor(((null===(a=k)||void 0===a?void 0:a.price)-(null===(l=k)||void 0===l?void 0:l.discounted_price))/(null===(s=k)||void 0===s?void 0:s.price)*100),"%"),ae().createElement("ul",{className:"tly__plan__description_list"},ae().createElement("li",null,v.starter," STARTER Items"),ae().createElement("li",null,v.pro," PRO Items"),ae().createElement("li",null,"Unlimited WorkSpace"),ae().createElement("li",null,"Unlimited Items On My Cloud")),ae().createElement("h5",{className:"tly__plan__heading tly__mt_1",dangerouslySetInnerHTML:{__html:"".concat("premium"===d?"Starting from: $"+O:"Price: "+O)}}),ae().createElement("a",{href:f,className:"tly__button tly__success__button templately-button",target:"_blank"},ae().createElement("span",null,e.isLoggedIn?"Upgrade Now":"Go With Subscription")))))),0==e.details.price&&!e.isLoggedIn&&ae().createElement("div",{className:"tly__sidebar__widget tly__site__promote__widget templately-item-widget"},ae().createElement("div",{className:"tly__promo_heading"},ae().createElement("img",{src:window.templately.promo_image,alt:"Get Free Access To"})),ae().createElement("div",{className:"tly__promo_body"},ae().createElement("div",{className:"tly__plan__card tly__center"},ae().createElement("h5",{className:"tly__plan__heading tly__lg"},"Get Free Access To ",null==e||null===(c=e.details)||void 0===c?void 0:c.name),ae().createElement("div",{className:"tly__plan__description_wrapper tly__mt_0"},ae().createElement("p",{className:"tly__plan__description"},"Build your website with this powerful, customizable, and FREE WordPress template. To get started, register now!"),ae().createElement(eS,{to:"sign-in",style:{marginTop:10},className:"tly__button templately-button tly__success__button tly__mt_1_5"},ae().createElement("span",null,"Access This Template")))))))});const QR=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 21"},e,{style:{fill:"currentColor",height:"18px",width:"18px"}}),oe.createElement("path",{d:"M10.499 18.95a.8.8 0 0 1-.313-.063.9.9 0 0 1-.27-.188l-4.667-4.646a.8.8 0 0 1-.23-.583q0-.354.23-.604a.8.8 0 0 1 .593-.25q.345 0 .594.25l3.23 3.25V10.97q0-.354.239-.594.24-.24.594-.24t.593.24.24.594v5.146l3.25-3.25a.78.78 0 0 1 .573-.23q.344 0 .594.25a.8.8 0 0 1 .229.584.8.8 0 0 1-.23.583L11.083 18.7a.9.9 0 0 1-.27.188.8.8 0 0 1-.313.062m0-10.48a.8.8 0 0 1-.594-.24.8.8 0 0 1-.24-.593v-.834q0-.354.24-.593.24-.24.594-.24t.593.24.24.593v.834q0 .354-.24.593a.8.8 0 0 1-.593.24m0-4.167a.8.8 0 0 1-.594-.24.8.8 0 0 1-.24-.593q0-.354.24-.594t.594-.24.593.24.24.594-.24.594a.8.8 0 0 1-.593.24"}))},$R=function(e){return oe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 21"},e,{style:{fill:"currentColor",height:"18px",width:"18px"}}),oe.createElement("path",{d:"M10.499 2.05a.8.8 0 0 0-.313.063.9.9 0 0 0-.27.188L5.248 6.947a.8.8 0 0 0-.23.583q0 .354.23.604.25.25.593.25.345 0 .594-.25l3.23-3.25v5.146q0 .354.239.594.24.24.594.24t.593-.24.24-.594V4.884l3.25 3.25q.23.23.573.23.344 0 .594-.25a.8.8 0 0 0 .229-.584.8.8 0 0 0-.23-.583L11.083 2.3a.9.9 0 0 0-.27-.188.8.8 0 0 0-.313-.062m0 10.48a.8.8 0 0 0-.594.24.8.8 0 0 0-.24.593v.834q0 .354.24.593.24.24.594.24t.593-.24.24-.593v-.834a.8.8 0 0 0-.24-.593.8.8 0 0 0-.593-.24m0 4.167a.8.8 0 0 0-.594.24.8.8 0 0 0-.24.593q0 .354.24.594t.594.24.593-.24.24-.594a.8.8 0 0 0-.24-.594.8.8 0 0 0-.593-.24"}))},GR=function(e){var t,n,r,o,i,a,l=pe((0,oe.useState)("description"),2),s=l[0],c=l[1],u=(null==e?void 0:e.features)&&null!==JSON.parse(null==e?void 0:e.features),d=(0,oe.useRef)("descriptionRef"),p=pe((0,oe.useState)(0),2),h=p[0],f=p[1],m=pe((0,oe.useState)(!1),2),g=m[0],v=m[1],y=480;return(0,oe.useEffect)(function(){var e;f(null==d||null===(e=d.current)||void 0===e?void 0:e.scrollHeight)},[null==d?void 0:d.current.scrollHeight,s]),(0,oe.useEffect)(function(){var t,n;null!=e&&null!==(t=e.description)&&void 0!==t&&t.length?c("description"):null!=e&&null!==(n=e.features)&&void 0!==n&&n.length?c("features"):c("tags")},[e]),React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-item-details-panel"},React.createElement("div",{className:"templately-item-details-panel-header"},React.createElement("div",{className:"templately-item-details-panel-header-inner"},(null==e||null===(t=e.description)||void 0===t?void 0:t.length)>0&&React.createElement("button",{type:"button",onClick:function(){return c("description")},className:"templately-item-details-panel-header-button ".concat("description"===s?"selected":"not-selected")},(0,At.__)("Description","templately")),(null==e||null===(n=e.features)||void 0===n?void 0:n.length)>0&&React.createElement("button",{type:"button",onClick:function(){return c("features")},className:"templately-item-details-panel-header-button ".concat("features"===s?"selected":"not-selected")},(0,At.__)("Features","templately")),(null==e||null===(r=e.tags)||void 0===r?void 0:r.length)>0&&React.createElement("button",{type:"button",onClick:function(){return c("tags")},className:"templately-item-details-panel-header-button ".concat("tags"===s?"selected":"not-selected")},(0,At.__)("Tags","templately")))),(null==e||null===(o=e.description)||void 0===o?void 0:o.length)>0&&React.createElement("div",{className:"templately-item-details-items-text-panel ".concat("description"===s?"show":"hide")},React.createElement("div",{className:"".concat(h>y?"templately-item-details-items-description-with-show-more-button ".concat(g?"show":"hide"):"templately-item-details-items-description-without-show-more-button"),style:{maxHeight:h>y&&g?h:y}},React.createElement("div",{ref:d,className:"templately-item-details-items-text-panel-inner",dangerouslySetInnerHTML:{__html:e.description}}),(null==e?void 0:e.video_url)&&React.createElement("iframe",{width:"100%",height:"400",className:"w-full rounded-2xl",src:e.video_url,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",allowFullScreen:"allowFullScreen",frameBorder:"0"}))),(null==e||null===(i=e.features)||void 0===i?void 0:i.length)>0&&React.createElement("div",{className:"templately-item-details-items-text-panel ".concat("features"===s?"show":"hide")},u?React.createElement("div",{className:"templately-item-details-items-text-panel-inner",dangerouslySetInnerHTML:{__html:JSON.parse(null==e?void 0:e.features).join("")}}):React.createElement(React.Fragment,null)),(null==e||null===(a=e.tags)||void 0===a?void 0:a.length)>0&&React.createElement("div",{className:"templately-item-details-items-tags-panel ".concat("tags"===s?"show":"hide")},e.tags.map(function(t,n){return React.createElement(xt,{key:n,to:"/".concat("pack"===(null==e?void 0:e.type)?"":"".concat(null==e?void 0:e.type,"s"),"?tag_id=").concat(null==t?void 0:t.id),className:"templately-item-details-items-tag"},t.name)}))),null!=e&&e.description&&"description"===s&&h>y?React.createElement("div",{className:"templately-item-details-items-description-show-more-button-wrapper ".concat(g?"show":"hide")},React.createElement("button",{className:"templately-item-details-items-description-show-more-button",onClick:function(){return v(function(e){return!e})}},React.createElement("span",{className:"templately-item-details-items-description-show-more-button-text"},g?"View Less":"View More"),React.createElement("span",{className:"templately-item-details-items-description-show-more-button-icon"},g?React.createElement($R,null):React.createElement(QR,null)))):React.createElement(React.Fragment,null))},YR=gn(function(e){return{items:e.general.related.items,isLoading:e.general.related.isLoading}},function(e){return{getRelatedTemplates:function(t){return e(function(e){return Av({type:zo},e)}(t))}}})(function(e){return(0,oe.useEffect)(function(){e.itemId&&e.itemType&&e.getRelatedTemplates({item_id:e.itemId,_type:e.itemType})},[e.itemId,e.itemType]),e.isLoading?ae().createElement("div",{className:"templately-item-details-more-product-panel",style:{padding:0}},ae().createElement(_l,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:ae().createElement(ae().Fragment,null,ae().createElement(UR,{title:"Related Products",browseLink:ub("".concat(null==e?void 0:e.platform)),redBg:!1,data:e.items,platform:e.platform,hasCarousel:!1}))}),XR=function(e){var t,n;return React.createElement("ul",{className:"templately-item-details-breadcrumb"},React.createElement("li",{className:"templately-item-details-breadcrumb-item"},React.createElement(xt,{className:"templately-item-details-breadcrumb-item-link",to:ub("".concat(null==e?void 0:e.platform))},(0,At.__)("Home","templately"))),React.createElement("li",{className:"templately-item-details-breadcrumb-separator"},"/"),React.createElement("li",{className:"templately-item-details-breadcrumb-item"},"pack"===(null==e?void 0:e.type)?React.createElement(xt,{className:"templately-item-details-breadcrumb-item-link",to:ub("".concat(null==e?void 0:e.platform,"/packs"))},"elementor"===(null==e?void 0:e.platform)?(0,At.__)("Elementor","templately"):(0,At.__)("Gutenberg","templately")):React.createElement(xt,{className:"templately-item-details-breadcrumb-item-link",to:ub("".concat(null==e?void 0:e.platform,"/packs/").concat(null==e||null===(t=e.pack)||void 0===t?void 0:t.slug))},null==e||null===(n=e.pack)||void 0===n?void 0:n.name)),React.createElement("li",{className:"templately-item-details-breadcrumb-separator"},"/"),React.createElement("li",{className:"templately-item-details-breadcrumb-item"},"pack"===(null==e?void 0:e.type)?"Pack":null==e?void 0:e.name))},KR=gn(function(e){return{platform:e.general.platform,items:e.general.trending.items,isLoading:e.general.trending.isLoading}},function(e){return{getTrendingTemplates:function(t){return e(function(e){return Av({type:Ro},e)}(t))}}})(function(e){return(0,oe.useEffect)(function(){e.getTrendingTemplates({platform:e.platform})},[]),e.isLoading?ae().createElement("div",{className:"templately-item-details-more-product-panel",style:{padding:0}},ae().createElement(_l,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:ae().createElement(ae().Fragment,null,ae().createElement(UR,{title:"Trending Products",browseLink:ub("".concat(null==e?void 0:e.platform)),redBg:!1,data:e.items,platform:e.platform,hasCarousel:!0}))}),ZR=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d=null!==(n="blocks"===(null==t||null===(r=t.params)||void 0===r?void 0:r.type)?"sections":null==t||null===(o=t.params)||void 0===o?void 0:o.type)&&void 0!==n?n:"packs",p=null==t||null===(i=t.params)||void 0===i?void 0:i.slug,h=null!==(a=null==t||null===(l=t.params)||void 0===l?void 0:l.platform)&&void 0!==a?a:e.general.platform;return{details:null!=e&&e[d]&&null!==(s=e[d])&&void 0!==s&&s[h]&&null!==(c=e[d][h])&&void 0!==c&&c.itemsDetails&&null!==(u=e[d][h].itemsDetails)&&void 0!==u&&u[p]?e[d][h].itemsDetails[p]:{},platform:h,profile:e.profile.data,isLoggedIn:null!=e.profile.data}},function(e){return{getTemplate:function(t){return e(function(e){return Av({type:Wa(Ao,e.key)},e)}(t))},setPlatform:function(t){return e(fv(t))}}})(function(e){var t,n,r=pe((0,oe.useState)(!1),2),o=r[0],i=r[1],a=e.params,l=e.details,s=e.platform,c=pe(Ct(),1)[0],u=rt(),d=kn(),p=(0,oe.useRef)(!1),h=uP({maxWidth:1170});(0,oe.useEffect)(function(){e.setPlatform(e.platform),e.getTemplate({key:ja(a.type),slug:a.slug,platform:s})},[a.slug,a.type,s]),(0,oe.useEffect)(function(){var t=c.get("process");if("pack"===l.type&&"ai"===t&&l.id&&!p.current){if(p.current=!0,!e.isLoggedIn){var n=c.get("path")||"";return void u(ub("sign-in",{"redirect-to":n}),{})}d(function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:bi,payload:Iy({id:null!==(e=null==n?void 0:n.id)&&void 0!==e?e:null,isWithAI:null===(t=null==n?void 0:n.isWithAI)||void 0===t||t},n)}}({id:l.id,isWithAI:!0}));var r=c.get("path")||"",o=ub(r,null,["process"]);u(o,{replace:!0})}},[l.type,l.id,c,u,d,e.isLoggedIn]),null===(t=e.profile)||void 0===t||null===(t=t.plan)||void 0===t||t.indexOf("lifetime");var f=PS(l.id,l.type,null==l||null===(n=l.pack)||void 0===n?void 0:n.id),m=f.isPurchased,g=f.isSubscribed;return React.createElement("div",{className:"templately-container-row"},React.createElement(o_,{type:a.type,stateSubKey:"itemsDetails",element:React.createElement(JR,{className:"templately-item-details-wrapper",render:function(){var t,n,r,c,u,d,p,f,v,y;return React.createElement("div",{className:"templately-item-details-wrapper-inner"},React.createElement(t_,{images:(null==l||null===(t=l.screenshots)||void 0===t?void 0:t.length)>0?null==l?void 0:l.screenshots:[{url:null!==(n=null==l?void 0:l.banner)&&void 0!==n?n:null==l?void 0:l.thumbnail,alt:null==l?void 0:l.name}],isOpen:o,setIsOpen:i}),React.createElement(XR,re({},l,{platform:s})),React.createElement("div",{className:"templately-item-details-container"},React.createElement("div",{className:"templately-item-details"},React.createElement(LD,{isPack:"packs"===a.type,price:null==l?void 0:l.price,name:null==l?void 0:l.name,thumbnail:null!==(r=null==l?void 0:l.banner)&&void 0!==r?r:null==l?void 0:l.thumbnail,alt:null==l?void 0:l.name,url:null==l?void 0:l.live_url,screenshotsEnabled:{setIsOpen:i,hasShots:"packs"!==a.type&&(null==l||null===(c=l.screenshots)||void 0===c?void 0:c.length)>0}}),h&&React.createElement("div",{className:"templately-item-details-mini-sidebar"},React.createElement(IR,re({details:l,isPurchased:m,isSubscribed:g,params:a},l,{platform:e.params.platform,isLoggedIn:e.isLoggedIn}))),React.createElement("div",{className:"templately-item-details-inner"},"packs"===(null==a?void 0:a.type)&&(null==l||null===(u=l.items)||void 0===u?void 0:u.length)>0&&React.createElement(RR,{items:null==l?void 0:l.items,platform:s}),(null==l||null===(d=l.description)||void 0===d?void 0:d.length)>0||(null==l||null===(p=l.features)||void 0===p?void 0:p.length)>0||(null==l||null===(f=l.tags)||void 0===f?void 0:f.length)>0?React.createElement(GR,l):React.createElement(React.Fragment,null)),"packs"!==a.type&&(null==l||null===(v=l.pack)||void 0===v||null===(v=v.items)||void 0===v?void 0:v.length)>0&&React.createElement("div",{className:"templately-item-details-inner",style:{marginTop:"3rem"}},React.createElement(FR,{pack:null==l?void 0:l.pack,platform:s,items:null==l||null===(y=l.pack)||void 0===y?void 0:y.items}))),!h&&React.createElement("div",{className:"templately-item-details-sidebar"},React.createElement(IR,re({details:l,isPurchased:m,isSubscribed:g,params:a},l,{platform:e.params.platform,isLoggedIn:e.isLoggedIn})))),React.createElement(YR,{slug:a.slug,itemId:l.id,itemType:l.type||a.type,platform:s}),React.createElement(VR,{slug:a.slug,platform:s}),React.createElement(KR,{slug:a.slug,platform:s}))}})}),React.createElement(PD,{packId:null==l?void 0:l.id}))}),JR=function(e){var t=e.render,n=e.hasSticky,r=void 0===n||n,o=e.header,i=void 0===o?"":o,a=(0,oe.useRef)(null),l=pe((0,oe.useState)(""),2),s=l[0],c=l[1],u=(0,oe.useCallback)(function(e){null!=a&&a.current&&r&&(e.target.scrollTop>250&&""===s?c("templately-sticky"):c(""))},[]);(0,oe.useEffect)(function(){return a.current=!0,function(){return a.current=!1}},[]);var d=Vn()("templately-contents",e.className,{"templately-has-sticky":r&&""!==s});return ae().createElement("div",{className:d,onScroll:r?u:null},"function"==typeof i?i({stickyClass:s}):i,"function"==typeof t?t({stickyClass:s}):t)},ej=(o.p,o.p+"images/footer-bar-icon.png");function tj(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}var nj=function(e){var t,n=e.headerHeight,r=e.current_screen,o=it(),i="templately"===r&&"1"==(null===(t=window.templately)||void 0===t?void 0:t.is_free_user),a=Vn()("templately-container",Tt(Tt({},"templately-".concat(null==o?void 0:o.type,"-container"),void 0!==(null==o?void 0:o.type)),"templately-templates-container",void 0===(null==o?void 0:o.type)&&"elementor"===o.platform)),l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tj(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({height:"calc(100% - ".concat(n,"px)")},"templately"===r&&{top:n});return ae().createElement("div",{className:a,style:l},ae().createElement(vt,null),i&&ae().createElement("footer",{className:"templately-template-library-footer"},ae().createElement("div",{className:"footer-bar-content"},ae().createElement("img",{src:ej,alt:"footer-bar-icon",className:"footer-bar-icon"}),ae().createElement("p",{className:"footer-bar-text"},"Unlock premium templates with the biggest ",ae().createElement("span",null,"Holiday")," deals")),ae().createElement("a",{href:"https://templately.com/#pricing",target:"_blank",className:"footer-bar-link"},ae().createElement("span",null,"Grab up to 60% OFF"))))};const rj=gn(function(e){return{headerHeight:e.general.headerHeight,current_screen:e.general.current_screen}})(ae().memo(nj));function oj(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 ij(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oj(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const aj=gn(function(e){var t,n,r,o,i,a,l=e.general.platform,s=e.general.current_screen,c=null!==(t=null===(n=e.savedTemplates)||void 0===n||null===(n=n[l])||void 0===n?void 0:n.currentPage)&&void 0!==t?t:1,u=null!==(r=null===(o=e.savedTemplates)||void 0===o||null===(o=o[l])||void 0===o?void 0:o.totalPage)&&void 0!==r?r:1;return{platform:l,current_screen:s,has_elementor:e.general.has_elementor,currentPage:c,totalPage:u,items:null!==(i=null===(a=e.savedTemplates)||void 0===a||null===(a=a[l])||void 0===a?void 0:a[c])&&void 0!==i?i:[]}})(function(e){var t=pe((0,oe.useState)([]),2),n=t[0],r=t[1];(0,oe.useEffect)(function(){if(e.items.length>0){var t=e.items.map(function(t){return[{id:"name",data:ae().createElement(j_,{title:t.title,platform:e.platform})},[{id:"last_modified",data:t.date},{id:"action",data:ae().createElement("div",{className:"tt-actions"},ae().createElement(V_,{current_screen:e.current_screen,args:{content:ij(ij({},t),{},{my_cloud_id:t.id,origin:"local",currentPage:e.currentPage})},menus:tv(t.is_pushed,e.current_screen,e.has_elementor,t.type)}))}]]});r(t)}},[e.items,e.has_elementor]);var o=Vn()("templately-saved-templates",{"templately-nas-no-items":0==n.length});return ae().createElement(ae().Fragment,null,ae().createElement("div",{className:o},n.length>0?ae().createElement(aS,{view:"list",head:ae().createElement(cS,null)},ae().createElement(dS,{view:"list",data:n})):ae().createElement(s_,null),e.totalPage>1&&ae().createElement(n_,{type:"savedTemplates",total:e.totalPage})))});var lj=["plan","active","label","total"],sj=function(e){var t=e.plan,n=void 0===t?"all":t,r=e.active,o=void 0===r||r,i=e.label,a=e.total,l=Wn(e,lj),s=Vn()("components-button","templately-plan-".concat(n),{"templately-plan-active":o});return ae().createElement("button",re({className:s},l),i," (",a,")")};const cj=gn(function(e){var t,n=e.general.platform;return{plan:e.general.plan,counts:null===(t=e.general.counts)||void 0===t?void 0:t[n]}},function(e){return{setPlan:function(t){return e(function(e){return{type:wr,plan:e}}(t))}}})(function(e){var t,n,r,o,i,a,l=pe((0,oe.useState)(e.plan),2),s=l[0],c=l[1],u=it();return(0,oe.useEffect)(function(){s!==e.plan&&e.setPlan(s)},[e.plan,s]),ae().createElement("div",{className:"templately-plan-switcher"},ae().createElement(sj,{onClick:function(){return c("all")},label:(0,At.__)("All","templately"),active:"all"===s,total:null!==(t=null===(n=e.counts)||void 0===n||null===(n=n[null==u?void 0:u.type])||void 0===n?void 0:n.total)&&void 0!==t?t:0,plan:"all"}),ae().createElement(sj,{onClick:function(){return c("starter")},label:(0,At.__)("Starter","templately"),active:"starter"===s,total:null!==(r=null===(o=e.counts)||void 0===o||null===(o=o[null==u?void 0:u.type])||void 0===o?void 0:o.starter)&&void 0!==r?r:0,plan:"starter"}),ae().createElement(sj,{onClick:function(){return c("pro")},label:(0,At.__)("Pro","templately"),active:"pro"===s,total:null!==(i=null===(a=e.counts)||void 0===a||null===(a=a[null==u?void 0:u.type])||void 0===a?void 0:a.pro)&&void 0!==i?i:0,plan:"pro"}))}),uj=function(e){var t=e.className,n=e.label,r=void 0===n?null:n,o=e.element,i=e.hideTitle,a=void 0!==i&&i,l=it();return ae().createElement("div",{className:"templately-contents-header ".concat(null!=t?t:"")},(0,ce.applyFilters)("templately_before_content_header","",l),ae().createElement("div",{className:"templately-contents-header-inner"},!a&&ae().createElement("div",{className:"templately-header-title"},ae().createElement("h3",null,null===r?(0,At.__)("All","templately")+" "+(null==l?void 0:l.type):r)),"function"==typeof o?o():o))},dj=function(){var e=rt(),t=it();return ae().createElement("div",{className:"templately-logo"},ae().createElement(Nn,{width:"37.66px"}),null==(null==t?void 0:t.slug)&&ae().createElement(Dn,null),null!=(null==t?void 0:t.slug)&&ae().createElement("span",{className:"templately-back-2-library",onClick:function(){return e(-1)}},ae().createElement(tr,{color:"#000"}),(0,At.__)("Back to Library","templately")))};function pj(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 hj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pj(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var fj=function(e){return e.join("/")};const mj=gn(function(e){var t;return{platform:null!==(t=e.general.platform)&&void 0!==t?t:"elementor",isLoggedIn:null!=e.profile.data}})(function(e){var t=it(),n=tt(),r=rt(),o=pe((0,oe.useState)([]),2),i=o[0],a=o[1];return(0,oe.useEffect)(function(){var o,i=function(e){var t=e.platform,n=void 0===t?"elementor":t,r=[],o=["q","add-account","redirect-to","tag_id","category","templateType","activeFilter","include","exclude","tags"];return r.push({to:fj([n,"packs"]),label:(0,At.__)("Packs","templately"),element:!1,query:{}}),"gutenberg"===n&&r.push({to:fj([n,"blocks"]),label:(0,At.__)("Blocks","templately"),element:!1,query:{}}),r.push({to:fj([n,"pages"]),label:(0,At.__)("Pages","templately"),element:!1,capability:"templately_read",query:{}}),"elementor"===n&&r.push({to:fj([n,"blocks"]),label:(0,At.__)("Blocks","templately"),element:!1,query:{}}),"elementor"===n&&r.push({to:fj([n,"templates"]),label:(0,At.__)("Templates","templately"),element:!1,query:{}}),r.push({to:"clouds",query:{platform:n},label:(0,At.__)("My Cloud","templately"),element:!1,icon:React.createElement(Pn,null)}),r.map(function(e){return hj(hj({},e),{},{ignoreKeys:o})})}({platform:null!==(o=t.platform)&&void 0!==o?o:e.platform});a(i),i.filter(function(e){return e.to===n.pathname.substring(1)}).length||null!=(null==t?void 0:t.slug)||"clouds/save-template"==n.pathname.substring(1)||r(ub(i[0].to))},[e.platform]),ae().createElement(iS,{className:"templately-menu",ulClasses:"templately-nav",liClasses:function(e){var t=e.isActive,n=e.toPathname,r=e.locationPathname,o=["templately-nav-item",t?"templately-nav-active":null];return"/clouds"!==n||"/favourites"!==r&&"/downloads"!==r&&"/purchased-items"!==r||o.push("templately-nav-active"),o.filter(Boolean).join(" ")},activeItemClassName:"templately-nav-active",routes:i})});function gj(e){return Zn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12zM7 9h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"},child:[]}]})(e)}const vj=gn(function(e){return{platform:e.general.platform}},function(e){return{setPlatform:function(t){return e(fv(t))}}})(function(e){var t=it(),n=tt(),r=rt(),o=pe(Ct(),1)[0],i=Sn(function(e){var n,r,o;if(null==t||!t.slug)return{hasVariation:!1,variation:null};var i=null==t?void 0:t.platform,a=null==t?void 0:t.slug,l=null===(r=e[null!==(n="blocks"===(null==t?void 0:t.type)?"sections":null==t?void 0:t.type)&&void 0!==n?n:"packs"])||void 0===r||null===(r=r[i])||void 0===r||null===(r=r.itemsDetails)||void 0===r?void 0:r[a],s=Boolean(null==l||null===(o=l.variations)||void 0===o?void 0:o.length);return{hasVariation:s,variation:s?l.variations:null}}),a=i.hasVariation,l=i.variation,s=pe((0,oe.useState)([{value:"elementor",label:ae().createElement(ae().Fragment,null,ae().createElement("span",{className:"tswitcher-icon tswitch-elementor"}),ae().createElement("span",{className:"templately-editor-name"},(0,At.__)("Elementor","templately")))},{value:"gutenberg",label:ae().createElement(ae().Fragment,null,ae().createElement("span",{className:"tswitcher-icon tswitch-gutenberg"}),ae().createElement("span",{className:"templately-editor-name"},(0,At.__)("Gutenberg","templately")))}]),1)[0],c=pe((0,oe.useState)(null==s?void 0:s[0]),2),u=c[0],d=c[1];return(0,oe.useEffect)(function(){var r,i,a,l,c,u,p=null!==(r=null!==(i=null!==(a=null!==(l=null==t?void 0:t.platform)&&void 0!==l?l:o.get("platform"))&&void 0!==a?a:null===(c=n.state)||void 0===c?void 0:c.platform)&&void 0!==i?i:e.platform)&&void 0!==r?r:"elementor",h=s.filter(function(e){return e.value==p});h.length>0&&d(null!==(u=h[0])&&void 0!==u?u:s[0])},[t]),ae().createElement(Fg,{options:s,classNamePrefix:"templately-switcher",onChange:function(o){if(d(o),e.setPlatform(o.value),t.type){var i=[],s=[o.value,t.type];if(t.slug&&i.push("q"),a){var c=l.find(function(e){return e.platform===o.value});c&&(s=[o.value,t.type,c.slug])}r(ub(s,{platform:o.value},i))}else r(ub(n.pathname.substring(1),{platform:o.value}))},value:u,isSearchable:!1})}),yj=gn(function(e){var t,n,r,o,i,a,l;return{isLoggedIn:null!==(null===(t=e.profile)||void 0===t?void 0:t.data),canLinkAccount:null!==(n=null===(r=e.profile)||void 0===r?void 0:r.link_account)&&void 0!==n&&n,canUnLinkAccount:null!==(o=null===(i=e.profile)||void 0===i?void 0:i.unlink_account)&&void 0!==o&&o,isGloballySigned:null===(a=e.profile)||void 0===a?void 0:a.is_globally_signed,signedAsGlobal:null===(l=e.profile)||void 0===l?void 0:l.signed_as_global}},function(e){return{logout:function(t){return e(zi(t))},linkAccount:function(){return e(Bi({linking:!0}))}}})(function(e){var t=rt();return e.canLinkAccount?ae().createElement(eS,{to:"sign-in",query:{"add-account":!0},className:"tb-link-account templately-button"},(0,At.__)("Link My Account","templately")):e.isLoggedIn&&!e.canLinkAccount?ae().createElement(vl,{className:"tb-logout",onClick:function(){t(ub("sign-in"),{state:{is_logging_out:{isGloballySigned:!e.signedAsGlobal&&e.canUnLinkAccount?!e.isGloballySigned:e.isGloballySigned}}})},label:!e.signedAsGlobal&&e.canUnLinkAccount?(0,At.__)("Unlink My Account","templately"):(0,At.__)("Logout","templately")}):void 0}),bj=function(e){var t,n=e.name,r=e.first_name,o=e.last_name,i=e.email,a=e.profile_photo,l=pe((0,oe.useState)(!1),2),s=l[0],c=l[1],u=(0,oe.useRef)(null),d=function(e){if(u.current.contains(e.target)&&"A"!==e.target.nodeName)c(!0);else var t=setTimeout(function(){c(!1),clearTimeout(t)},100)};return(0,oe.useEffect)(function(){return document.addEventListener("mousedown",d),function(){return document.removeEventListener("mousedown",d)}},[s]),ae().createElement("div",{className:"templately-profile-drops-wrapper",ref:u},ae().createElement("span",{className:"templately-profile-btn templately-button ".concat(null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_api?"dev-api-mode":"")},null!=a?ae().createElement("img",{src:a,alt:n,onError:function(e){var t;e.target.src=null===(t=window)||void 0===t||null===(t=t.templately)||void 0===t||null===(t=t.icons)||void 0===t?void 0:t.profile}}):ae().createElement(Rn,null)),s&&ae().createElement("div",{className:"templately-profile-drops-inner"},ae().createElement("ul",null,ae().createElement("li",{className:"templately-profile-drops"},ae().createElement("div",{className:"d-flex align-center"},null!=a?ae().createElement("img",{width:"40px",height:"40px",src:a,alt:n,onError:function(e){var t;e.target.src=null===(t=window)||void 0===t||null===(t=t.templately)||void 0===t||null===(t=t.icons)||void 0===t?void 0:t.profile}}):ae().createElement(Rn,{width:"40px",height:"40px"}),ae().createElement("div",{className:"templately-profile-drops-details"},ae().createElement("h4",null,null!=n?n:r+" "+o),ae().createElement("p",null,i)))),ae().createElement("li",null,ae().createElement("a",{target:"_blank",className:"d-flex align-center",href:"https://templately.com/profile?utm_source=plugin&utm_medium=profileDrops"},(0,At.__)("Manage Account","templately"))),ae().createElement("li",null,ae().createElement(eS,{isActive:!0,className:"d-flex align-center",to:"favourites",children:function(e){return e.isActive,ae().createElement(ae().Fragment,null,ae().createElement(pr,null),(0,At.__)("My Favourites","templately"))}})),ae().createElement("li",null,ae().createElement(eS,{className:"d-flex align-center",to:"downloads"},ae().createElement(sr,null),(0,At.__)("My Downloads","templately"))),ae().createElement("li",null,ae().createElement(eS,{className:"d-flex align-center",to:"purchased-items"},ae().createElement(c_,null),(0,At.__)("Purchased Items","templately"))),ae().createElement("li",null,ae().createElement(yj,null)))))},wj=gn(function(e){return{platform:e.general.platform,isLoggedIn:null!=e.profile.data,profile:e.profile.data,syncing:e.profile.syncing,shouldClose:e.clouds.push2cloud.isLoading}},function(e){return{syncProfile:function(t){return e(function(e){return ji({type:Jr},e)}(t))}}})(function(e){var t,n=e.platform,r=e.isLoggedIn,o=pe(Ct(),1)[0];return ae().createElement("div",{className:"templately-actions"},("templately"===o.get("page")||"templately_settings"===o.get("page"))&&ae().createElement(vj,null),ae().createElement("a",{className:"templately-button templately-chat-button",href:"https://wpdeveloper.com/support/",target:"_blank",rel:"noopener"},ae().createElement(gj,null),ae().createElement("span",null,"Talk to Support")),r&&o.get("path")&&ov(o.get("path"))&&ae().createElement(vl,{className:"templately-cloud-sync ".concat(e.syncing?"tc-syncing":""),onClick:function(){return e.syncProfile()}},ae().createElement(Fn,null)),!r&&ae().createElement(eS,{to:"sign-in",query:{"redirect-to":o.get("path")},className:"components-button templately-button tb-login"},ae().createElement(yr,{style:{marginRight:"10px"}}),(0,At.__)("Login","templately")),r&&ae().createElement(bj,e.profile),"templately"!==o.get("page")&&"templately_settings"!==o.get("page")&&ae().createElement(vl,{disabled:null!==(t=e.shouldClose)&&void 0!==t&&t,className:"templately-close",onClick:function(){"gutenberg"===n&&window.TemplatelyAppManager.close("templately-gutenberg"),"elementor"===n&&window.TemplatelyModal.hide()}},ae().createElement(vr,{color:"#a4b0c1"})))});function kj(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}const Ej=gn(null,function(e){return{setHeaderHeight:function(t){return e(function(e){return{type:Zr,height:e}}(t))}}})(function(e){var t=(0,oe.useRef)(null);return(0,oe.useLayoutEffect)(function(){if(t.current){var n=function(){var n=t.current.offsetHeight;e.setHeaderHeight(n)},r=new ResizeObserver(function(t){var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return kj(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)?kj(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var o=n.value.target.offsetHeight;e.setHeaderHeight(o)}}catch(e){r.e(e)}finally{r.f()}});return r.observe(t.current),requestAnimationFrame(function(){requestAnimationFrame(n)}),function(){r.disconnect()}}},[]),ae().createElement("div",{className:"templately-header",ref:t},ae().createElement(dj,null),ae().createElement(mj,null),ae().createElement(wj,null))}),Oj=function(e){var t,n,r,o,i=null===(t=window)||void 0===t?void 0:t.templately,a=i.current_screen,l=void 0===a?"templately":a,s=i.theme,c=void 0===s?"light":s;(0,oe.useEffect)(function(){var e;return"templately"===l&&"1"==(null===(e=window.templately)||void 0===e?void 0:e.is_free_user)&&document.body.classList.add("templately_template_library"),function(){document.body.classList.remove("templately_template_library")}},[l]);var u=Vn()("templately-wrapper","templately-theme-".concat(c),"templately-screen-".concat(l));return ae().createElement("div",{className:u,id:"templately-wrapper"},ae().createElement(Ej,null),ae().createElement(rj,null),e.isLoggedIn&&!(null!==(n=e.user)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&n.is_verified)&&ae().createElement("div",{className:"templately-verification"},ae().createElement("p",null,(0,At.__)("Please complete your account by the verification email we sent you, If you don't get an email","templately")," ",ae().createElement("a",{target:"_blank",href:"https://templately.com/resend-verification-email?email=".concat(window.btoa(null===(r=e.user)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.email),"&from=plugin&utm_source=plugin&utm_medium=globalLayout")},(0,At.__)("click here","templately"))," ",(0,At.__)("to resend verification mail.","templately")),ae().createElement("button",{onClick:function(){return e.isVerifiedProfile()},className:"templately-button components-button tb-verified"},null!==(o=e.user)&&void 0!==o&&o.isVerifying?(0,At.__)("Verifying . . .","templately"):(0,At.__)("I've verified & Close","templately"))))},xj=gn(function(e,t){var n,r="clouds";location.pathname.startsWith("/clouds/workspace")?r="workspaces":location.pathname.startsWith("/clouds/shared-workspace")&&(r="sharedWorkspaces");var o=null==e?void 0:e[r].view,i=(null==e||e[r].isLoading,null==e?void 0:e[r].currentPage);return null==e||e[r].totalPage,null==e||null===(n=e[r])||void 0===n?void 0:n[i],{view:o,platform:e.general.platform,isLoggedIn:null!=e.profile.data,favouritesType:e.profile.favourites.type,favouritesPlan:e.profile.favourites.plan}},function(e){return{getClouds:function(t){return e(Wv(t))},getWorkSpaces:function(t){return e(ly(t))},getWorkSpaceDetails:function(t){return e(yy(t))},getFavourites:function(t){return e(Gi(t))},getDownloads:function(t){return e(sa(t))},getPurchasedItems:function(t){return e(Zi(t))}}})(function(e){var t=it(),n=tt(),r=rt(),o=pe(Ct(),1)[0],i=pe((0,oe.useState)(""),2),a=i[0],l=i[1],s=pe((0,oe.useState)((0,At.__)("My Clouds","templately")),2),c=s[0],u=s[1],d=pe((0,oe.useState)(!1),2),p=d[0],h=d[1],f=pe((0,oe.useState)(e.isLoggedIn),2),m=f[0],g=f[1];return(0,oe.useEffect)(function(){var t=ub("sign-in",{platform:e.platform});!1===e.isLoggedIn&&!0===m&&"/profile"!==n.pathname&&"profile"!==n.pathname&&(g(!m),r(t,{replace:!0})),!1!==e.isLoggedIn||!0!==m||"/profile"!==n.pathname&&"profile"!==n.pathname||r(t,{replace:!0}),!1===e.isLoggedIn&&!1===m&&r(t,{replace:!0})},[e.isLoggedIn]),(0,oe.useEffect)(function(){if(null!=o.get("path")){var e=o.get("path").split("/").pop();switch(h(!1),e){case"profile":u((0,At.__)("Profile","templately")),l("profile");break;case"favourites":u((0,At.__)("My Favourites","templately")),l("favourites");break;case"downloads":u((0,At.__)("My Downloads","templately")),l("downloads");break;case"clouds":u((0,At.__)("My Clouds","templately")),l("clouds");break;case"workspace":u((0,At.__)("My WorkSpace","templately")),l("workspaces");break;case"shared-workspace":u((0,At.__)("Shared with Me","templately")),l("sharedWorkspaces");break;case"save-template":u((0,At.__)("Save your template","templately")),l("saveTemplate");break;case"purchased-items":u((0,At.__)("Purchased Items","templately")),l("purchasedItems");break;default:null!=t&&t.slug&&(u((0,At.__)("My Clouds","templately")),l("workspaceDetails"),h(!0))}}},[o.get("path")]),(0,oe.useEffect)(function(){if(""!==a){var r=o.get("q");if("clouds"===a){var i={page:1,search:r};(o.has("q")||o.has("refresh"))&&(i.refresh=!0),e.getClouds(i)}if("favourites"===a&&e.getFavourites({platform:e.platform,itemType:e.favouritesType,plan:e.favouritesPlan}),"purchasedItems"===a&&e.getPurchasedItems({platform:e.platform,itemType:e.favouritesType,plan:e.favouritesPlan}),"downloads"===a&&e.getDownloads(),"workspaceDetails"===a&&null!=t&&t.slug){var l,s,c,u=!((null==n||null===(l=n.state)||void 0===l?void 0:l.slug)===t.slug),d={slug:null==t?void 0:t.slug,directLoad:!((null==n||null===(s=n.state)||void 0===s?void 0:s.slug)===t.slug),shared:"sharedWorkspaces"===a,platform:null!==(c=e.platform)&&void 0!==c?c:"elementor",refresh:o.has("refresh")};u&&e.getWorkSpaceDetails(d)}"sharedWorkspaces"!==a&&"workspaces"!==a||e.getWorkSpaces({page:1,shared:"sharedWorkspaces"===a,refresh:o.has("refresh")})}},[a,e.platform,o.get("q")]),ae().createElement("div",{className:"templately-clouds-layout templately-container-row"},ae().createElement(L_,null),ae().createElement(o_,{type:a,isKey:a,isLoadingKey:{clouds:["clouds","isLoading"],workspaces:["workspaces","isLoading"],sharedWorkspaces:["sharedWorkspaces","isLoading"],workspaceDetails:["workspaceDetails","isLoading"],profile:["profile","isLoading"],favourites:["profile","favourites","isLoading"],purchasedItems:["profile","purchasedItems","isLoading"],downloads:["profile","downloads","isLoading"],saveTemplate:[]},element:function(e){return e.isLoading,ae().createElement(JR,{header:function(e){var t=e.stickyClass;if("profile"!==a&&"purchasedItems"!==a&&"downloads"!==a&&"saveTemplate"!==a&&!p)return ae().createElement(uj,{hideTitle:"favourites"===a||"purchasedItems"===a,element:ae().createElement(vC,{type:a}),label:c,className:t})},render:function(){return ae().createElement(vt,null)}})}}))}),Sj=gn(function(e){var t,n,r,o,i=e.general.platform;return{platform:i,currentPage:null!==(t=null===(n=e.savedTemplates)||void 0===n||null===(n=n[i])||void 0===n?void 0:n.currentPage)&&void 0!==t?t:1,totalPage:null!==(r=null===(o=e.savedTemplates)||void 0===o||null===(o=o[i])||void 0===o?void 0:o.totalPage)&&void 0!==r?r:1}},function(e){return{getSavedTemplates:function(t){return e(Py(t))}}})(function(e){return(0,oe.useEffect)(function(){e.getSavedTemplates({platform:e.platform,page:e.currentPage})},[e.currentPage]),ae().createElement("div",{className:"templately-container-row"},ae().createElement(o_,{type:"savedTemplates",element:ae().createElement(JR,{header:function(e){var t=e.stickyClass;return ae().createElement(uj,{label:"Saved Templates",className:t})},render:ae().createElement(aj,null)})}))});var _j=["prevQuery","doQuery","results"];function Cj(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 Pj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cj(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Tj=gn(function(e,t){var n,r=t.type,o=t.query,i=void 0===o?null:o,a=null!==(n="blocks"===r?"sections":r)&&void 0!==n?n:"packs",l=e.general.plan,s=e.general.platform,c=e.general.filter,u=c.prevQuery,d=c.doQuery,p=(c.results,Wn(c,_j)),h=1,f=0,m=[a,l,s];return d||null!=i||(h=Ua(e,[].concat(Ul(m),["currentPage"]),1),f=Ua(e,[].concat(Ul(m),["totalPage"]),0),m.push(h)),d&&d===u&&(m.push("filteredResults"),h=Ua(e,[].concat(Ul(m),["currentPage"]),1),f=Ua(e,[].concat(Ul(m),["totalPage"]),0),m=m.concat([h])),null!==i&&(m.push("search"),h=Ua(e,[].concat(Ul(m),["currentPage"]),1),f=Ua(e,[].concat(Ul(m),["totalPage"]),0),m=m.concat([h])),{plan:l,currentPage:h,totalPage:f,items:Ua(e,m,[]),platform:e.general.platform,isLoggedIn:null!=e.profile.data,prevFilterableQuery:u,isFilterableQuery:d,filteredQuery:p}},function(e){return{getTemplates:function(t){return e(function(e){return Av({type:Wa(_o,e.key)},e)}(t))},setPlatform:function(t){return e(fv(t))},setPrevQuery:function(t){return e(mv({key:"prevQuery",data:null!=t?t:Date.now()}))}}})(function(e){var t=it(),n=pe(Ct(),1)[0],r=pe((0,oe.useState)(n.get("q")),2),o=r[0],i=r[1];return(0,oe.useEffect)(function(){e.setPlatform(t.platform)},[]),(0,oe.useEffect)(function(){e.isFilterableQuery===e.prevFilterableQuery||e.items.length||e.setPrevQuery(e.isFilterableQuery)},[e.isFilterableQuery]),(0,oe.useEffect)(function(){var r=n.get("q");i(null!=r?(0,At.sprintf)((0,At.__)("You are looking for: %s","templately"),n.get("q")):null);var o=n.get("category");e.getTemplates(Pj(Pj({key:ja(t.type),page:e.currentPage,search:r,prevFilterableQuery:e.prevFilterableQuery,isFilterableQuery:e.isFilterableQuery,category_id:o},e.filteredQuery),{},{platform:e.platform}))},[t.type,e.currentPage,e.platform,e.plan,e.isFilterableQuery,n.get("q")]),ae().createElement("div",{className:"templately-container-row"},ae().createElement(L_,null),ae().createElement(o_,{type:t.type,element:ae().createElement(JR,{className:"templately-search-results",header:function(e){var t=e.stickyClass;return ae().createElement(uj,{label:o,element:ae().createElement(ae().Fragment,null,ae().createElement(ml,null),ae().createElement(cj,null)),className:t})},render:ae().createElement(qC,{platform:e.platform,items:e.items,currentPage:e.currentPage,totalPage:e.totalPage,type:null==t?void 0:t.type,isLoggedIn:e.isLoggedIn})})}))});var Aj=["selected","setSelected","settings"];function Mj(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 Nj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mj(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Dj=gn(function(e){return{platform:e.general.platform}},function(e){return{setPlatform:function(t){return e(Xy(t))}}})(function(e){var t=e.selected,n=(e.setSelected,e.settings),r=Wn(e,Aj),o=it(),i=tt(),a=rt(),l=pe(Ct(),1)[0],s=(0,oe.useMemo)(function(){var e=[{value:"elementor",label:ae().createElement(ae().Fragment,null,ae().createElement("span",{className:"tswitcher-icon tswitch-elementor"}),ae().createElement("span",{className:"templately-editor-name"},(0,At.__)("Elementor","templately")))},{value:"gutenberg",label:ae().createElement(ae().Fragment,null,ae().createElement("span",{className:"tswitcher-icon tswitch-gutenberg"}),ae().createElement("span",{className:"templately-editor-name"},(0,At.__)("Gutenberg","templately")))}];return n.has_elementor?e:[e[1],e[0]]},[n.has_elementor,n.has_eb]),c=(0,oe.useState)((null==s?void 0:s.find(function(e){return e.value===t}))||(null==s?void 0:s[0])),u=pe(c,2),d=u[0],p=u[1];(0,oe.useEffect)(function(){var e,t,n,a,c,u=null!==(e=null!==(t=null!==(n=null!==(a=null==o?void 0:o.platform)&&void 0!==a?a:l.get("platform"))&&void 0!==n?n:null===(c=i.state)||void 0===c?void 0:c.platform)&&void 0!==t?t:r.platform)&&void 0!==e?e:"elementor",d=s.filter(function(e){return e.value==u&&!e.isdisabled});if(d.length>0){var f;p(null!==(f=d[0])&&void 0!==f?f:s[0])}else{var m=s.find(function(e){return!e.isdisabled});m&&h(m)}},[]);var h=function(e){var t=e.value;if("elementor"===t&&!n.has_elementor){var o=(0,At.__)("Please Install Elementor.","templately");return 0===n.has_elementor&&(o=(0,At.__)("Please Activate Elementor.","templately")),Al({icon:"error",timer:2e3,html:ae().createElement(i_,{title:o})},!1),!1}p(e),r.setPlatform(t);var i=Ya("/settings/:platform/:tab",l.get("path")).tab;a(ub(["settings",t,i]))};return ae().createElement(Fg,{components:{Option:function(e){return ae().createElement(Rm.Option,re({},e,{className:"tt-top",innerProps:Nj(Nj({},e.innerProps),{},{"data-templately-tooltip":e.data.tooltip})}))}},options:s,className:"templately-switcher",classNamePrefix:"templately-switcher",onChange:h,value:d,isSearchable:!1,isOptionDisabled:function(e){return e.isdisabled}})});function Ij(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 Lj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ij(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ij(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Rj=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d,p,h,f,m,g,v,y,b,w,k,E,O,x,S,_=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor",C=null!==(r=null===(o=e.settingsPage)||void 0===o?void 0:o[_])&&void 0!==r?r:{};return Lj(Lj({},t),{},{platform:_,settings:null!==(i=null===(a=e.settingsPage.settings)||void 0===a?void 0:a[_])&&void 0!==i?i:{},templatelySettings:null!==(l=null===(s=e.settingsPage)||void 0===s?void 0:s.settings)&&void 0!==l?l:{},importedPlatform:null!==(c=e.settingsPage.settings.imported_platform)&&void 0!==c&&c,formData:{siteTitle:null!==(u=null!==(d=null===(p=e.settingsPage)||void 0===p?void 0:p.siteTitle)&&void 0!==d?d:null===(h=e.settingsPage)||void 0===h||null===(h=h.settings)||void 0===h?void 0:h.siteTitle)&&void 0!==u?u:"",siteTagline:null!==(f=null!==(m=null===(g=e.settingsPage)||void 0===g?void 0:g.siteTagline)&&void 0!==m?m:null===(v=e.settingsPage)||void 0===v||null===(v=v.settings)||void 0===v?void 0:v.siteTagline)&&void 0!==f?f:"",logoImage:null!==(y=null===(b=e.settingsPage)||void 0===b?void 0:b.logoImage)&&void 0!==y?y:"",customCSS:null!==(w=null!==(k=null===(E=e.settingsPage)||void 0===E?void 0:E.customCSS)&&void 0!==k?k:null===(O=e.settingsPage)||void 0===O||null===(O=O.settings)||void 0===O?void 0:O.customCSS)&&void 0!==w?w:"",colors:null!==(x=null==C?void 0:C.colors)&&void 0!==x?x:{},typography:null!==(S=null==C?void 0:C.selectedTypography)&&void 0!==S?S:{}}})},function(e){return{setSettings:function(t){return e((0,Sy.setSettings)(t))},setPlatform:function(t){return e(Xy(t))}}})(function(e){var t,n=e.templatelySettings,r=e.settings,o=e.platform,i=e.setPlatform,a=e.formData,l=(e.importedPlatform,it()),s=tt(),c=rt(),u=pe(Ct(),1)[0].get("path"),d=Ne("/settings/:platform/:tab","/"+u).params.tab,p=sv(r,o)._systemColors,h=cv(r,o),f=uv(h,o),m=f.normalizedTypography,g=f.groupedData,v=f.getDeNormalizedTypography,y=(0,oe.useMemo)(function(){return(0,ce.applyFilters)("templately.settings.tabs",[{key:"general",label:"General"},{key:"colors",label:"Colors"},{key:"typography",label:"Typography"},{key:"custom_css",label:"Custom CSS"},{key:"miscellaneous",label:"Revert"}],o).filter(function(e){if("general"===e.key||"custom_css"===e.key||"miscellaneous"===e.key)return!0;if("developer"===e.key)return!0;if("elementor"===l.platform)return n.has_elementor;if("gutenberg"===l.platform){if(n.has_eb){if("colors"===e.key&&(0,_a.isEmpty)(p))return!1;if("typography"===e.key&&(0,_a.isEmpty)(g))return!1}return n.has_eb}return!1})},[o,l.platform,n]);(0,oe.useEffect)(function(){i(l.platform),Ne("/settings/:platform/:tab","/"+u);var e=y.some(function(e){return e.key===d});if(!e&&y.length>0){var t=y[0];c(ub(["settings",l.platform,t.key]))}},[d,y,c,l.platform,i]);var b=(0,oe.useMemo)(function(){return y.map(function(e){var t=Re(o+"/"+e.key,"/settings"),n=t.pathname.startsWith("/")?t.pathname.slice(1):t.pathname,r=s.pathname===t.pathname||"general"===e.key&&"/settings"===s.pathname;return{key:e.key,label:e.label,to:n,isActive:r}})},[y,o,s.pathname]);return React.createElement("div",{className:"templately-setting-container templately-wrapper"},React.createElement("div",{className:"wrap"},React.createElement("h1",{className:"wp-heading-inline"},"Templately Settings ",(null===(t=window.templatelyDeveloper)||void 0===t?void 0:t.dev_api)&&"(".concat(o,")")),React.createElement("hr",{className:"wp-header-end"}),React.createElement("div",{className:"templately-builder-nav"},React.createElement("ul",{className:"nav-tab-wrapper"},b.map(function(e){var t=e.key,n=e.label,r=e.to,o=e.isActive;return React.createElement("li",{key:t,className:"nav-tab ".concat(t," ").concat(o?"active":"")},React.createElement(eS,{to:r,isActive:o},n))})),React.createElement(Dj,{selected:o,setSelected:i,settings:n}))),React.createElement("div",{className:"wrap"},React.createElement("div",{className:"templately-setting-tab-panel-wrapper"},React.createElement(vt,{context:{normalizedTypography:m,groupedData:g}}),"miscellaneous"!==d&&"developer"!==d&&React.createElement("div",{className:"templately-setting-save-button-wrapper"},React.createElement("button",{onClick:function(e){e.preventDefault();var t=Lj(Lj({},a),{},{platform:o}),n=v(a.typography);if("gutenberg"===o&&!(0,_a.isEmpty)(n)){n.custom={};for(var r=0,i=Object.entries(a.typography);r<i.length;r++){var l=pe(i[r],2),s=l[0];l[1]._isSystem||(n.custom[s]=n[s],delete n[s])}}t.typography=n,_i()({path:"/templately/v1/settings/update",method:"POST",data:{settings:t}}).then(function(e){Al({icon:"success",timer:2e3,html:React.createElement(i_,{title:(0,At.__)("Successfully Updated Settings","templately")})},!1)}).catch(function(e){var t;Al({icon:"error",timer:2e3,html:React.createElement(i_,{title:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:(0,At.__)("Failed to Update Settings","templately")})},!1)})},className:"components-button templately-setting-save-button"},"Save")))))});var jj=function(e){var t=e.name,n=e.color,r=e.setColor,o=e.defaultColor,i=e.setColorPickerOpen,a=pe((0,oe.useState)(!1),2),l=a[0],s=a[1],c=(0,oe.useRef)(null);return(0,oe.useEffect)(function(){i(l)},[l]),function(e){(0,oe.useEffect)(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&s(!1)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[e])}(c),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-setting-colorpicker-wrap"},ae().createElement("div",{className:"templately-colorpicker-screen"},ae().createElement("span",{className:"templately-picker-title"},t),ae().createElement("span",{className:"templately-picker-sub-title"},n),ae().createElement("span",{className:"templately-picker-display-wrapper",onClick:function(){return s(!l)}},ae().createElement("span",{className:"templately-picker-display",style:{backgroundColor:n}}))),l&&ae().createElement("div",{className:"templately-colorpicker-wrapper"},ae().createElement("div",{className:"templately-colorpicker",ref:c},ae().createElement("span",{className:"templately-title"},t),ae().createElement(nI.ColorPicker,{color:n,onChangeComplete:function(e){return r(e.hex)},enableAlpha:!0,defaultValue:null!=n?n:o})))))};function Fj(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 zj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fj(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Bj=gn(function(e,t){var n,r,o,i,a,l=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return zj(zj({},t),{},{platform:l,settings:null!==(r=null===(o=e.settingsPage.settings)||void 0===o?void 0:o[l])&&void 0!==r?r:{},colors:null!==(i=null===(a=e.settingsPage)||void 0===a||null===(a=a[l])||void 0===a?void 0:a.colors)&&void 0!==i?i:{}})},function(e){return{setColors:function(t){return e(function(e){return{type:wi.SET_COLORS,colors:e}}(t))}}})(function(e){var t=e.platform,n=e.settings,r=e.colors,o=e.setColors,i=sv(n,t),a=i.colors,l=i._systemColors,s=pe((0,oe.useState)(!1),2),c=s[0],u=s[1];return(0,oe.useEffect)(function(){(0,_a.isEmpty)(r)&&o(a)},[t]),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-colors"},ae().createElement("div",{className:"templately-setting-color-picker-section"},ae().createElement("div",{className:"templately-setting-color-picker-section-label-wrapper"},ae().createElement("label",{className:"templately-setting-color-picker-section-label"},"Select Color"),ae().createElement("button",{className:"templately-setting-color-picker-reset-button",onClick:function(){o(a)}},ae().createElement(XD,null))),"elementor"===t?ae().createElement("div",{className:"templately-setting-color-picker-panel"},l&&(null==l?void 0:l.map(function(e,t){var n;return ae().createElement(jj,{key:e._id,name:e.title,setColorPickerOpen:u,color:null!==(n=null==r?void 0:r[e._id])&&void 0!==n?n:e.color,setColor:function(t){return o(zj(zj({},r),{},Tt({},e._id,t)))},defaultValue:e.color})}))):ae().createElement("div",{className:"templately-setting-color-picker-panel-2"},l&&(null==l?void 0:l.map(function(e,t){var n;return ae().createElement(jj,{key:e._id,name:e.title,setColorPickerOpen:u,color:null!==(n=null==r?void 0:r[e._id])&&void 0!==n?n:e.color,setColor:function(t){return o(zj(zj({},r),{},Tt({},e._id,t)))},defaultValue:e.color})}))))),c&&ae().createElement("div",{className:"templately-setting-overlay"}))}),Wj=1024;let Uj=0;class Vj{constructor(e,t){this.from=e,this.to=t}}class Hj{constructor(e={}){this.id=Uj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=$j.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Hj.closedBy=new Hj({deserialize:e=>e.split(" ")}),Hj.openedBy=new Hj({deserialize:e=>e.split(" ")}),Hj.group=new Hj({deserialize:e=>e.split(" ")}),Hj.isolate=new Hj({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Hj.contextHash=new Hj({perNode:!0}),Hj.lookAhead=new Hj({perNode:!0}),Hj.mounted=new Hj({perNode:!0});class qj{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Hj.mounted.id]}}const Qj=Object.create(null);class $j{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Qj,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),r=new $j(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Hj.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(Hj.group),r=-1;r<(n?n.length:0);r++){let o=t[r<0?e.name:n[r]];if(o)return o}}}}$j.none=new $j("",Object.create(null),0,8);class Gj{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let r=null;for(let t of e){let e=t(n);if(e){r||(r=Object.assign({},n.props));let t=e[1],o=e[0];o.combine&&o.id in r&&(t=o.combine(r[o.id],t)),r[o.id]=t}}t.push(r?new $j(n.name,r,n.id,n.flags):n)}return new Gj(t)}}const Yj=new WeakMap,Xj=new WeakMap;var Kj;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays"}(Kj||(Kj={}));class Zj{constructor(e,t,n,r,o){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,o&&o.length){this.props=Object.create(null);for(let[e,t]of o)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=qj.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new dF(this.topNode,e)}cursorAt(e,t=0,n=0){let r=Yj.get(this)||this.topNode,o=new dF(r);return o.moveTo(e,t),Yj.set(this,o._tree),o}get topNode(){return new oF(this,0,0,null)}resolve(e,t=0){let n=nF(Yj.get(this)||this.topNode,e,t,!1);return Yj.set(this,n),n}resolveInner(e,t=0){let n=nF(Xj.get(this)||this.topNode,e,t,!0);return Xj.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),o=null;for(let e=r instanceof oF?r:r.context.parent;e;e=e.parent)if(e.index<0){let i=e.parent;(o||(o=[r])).push(i.resolve(t,n)),e=i}else{let i=qj.get(e.tree);if(i&&i.overlay&&i.overlay[0].from<=t&&i.overlay[i.overlay.length-1].to>=t){let a=new oF(i.tree,i.overlay[0].from+e.from,-1,e);(o||(o=[r])).push(nF(a,t,n,!1))}}return o?cF(o):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:o=this.length}=e,i=e.mode||0,a=(i&Kj.IncludeAnonymous)>0;for(let e=this.cursor(i|Kj.IncludeAnonymous);;){let i=!1;if(e.from<=o&&e.to>=r&&(!a&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;i=!0}for(;i&&n&&(a||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;i=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:mF($j.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new Zj(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new Zj($j.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:o=Wj,reused:i=[],minRepeatType:a=r.types.length}=e,l=Array.isArray(n)?new Jj(n,n.length):n,s=r.types,c=0,u=0;function d(e,t,n,g,v,y){let{id:b,start:w,end:k,size:E}=l,O=u,x=c;if(E<0){if(l.next(),-1==E){let t=i[b];return n.push(t),void g.push(w-e)}if(-3==E)return void(c=b);if(-4==E)return void(u=b);throw new RangeError(`Unrecognized record size: ${E}`)}let S,_,C=s[b],P=w-e;if(k-w<=o&&(_=function(e,t){let n=l.fork(),r=0,i=0,s=0,c=n.end-o,u={size:0,start:0,skip:0};e:for(let o=n.pos-e;n.pos>o;){let e=n.size;if(n.id==t&&e>=0){u.size=r,u.start=i,u.skip=s,s+=4,r+=4,n.next();continue}let l=n.pos-e;if(e<0||l<o||n.start<c)break;let d=n.id>=a?4:0,p=n.start;for(n.next();n.pos>l;){if(n.size<0){if(-3!=n.size&&-4!=n.size)break e;d+=4}else n.id>=a&&(d+=4);n.next()}i=p,r+=e,s+=d}return(t<0||r==e)&&(u.size=r,u.start=i,u.skip=s),u.size>4?u:void 0}(l.pos-t,v))){let t=new Uint16Array(_.size-_.skip),n=l.pos-_.size,o=t.length;for(;l.pos>n;)o=m(_.start,t,o);S=new eF(t,k-_.start,r),P=_.start-e}else{let e=l.pos-E;l.next();let t=[],n=[],r=b>=a?b:-1,i=0,s=k;for(;l.pos>e;)r>=0&&l.id==r&&l.size>=0?(l.end<=s-o&&(h(t,n,w,i,l.end,s,r,O,x),i=t.length,s=l.end),l.next()):y>2500?p(w,e,t,n):d(w,e,t,n,r,y+1);if(r>=0&&i>0&&i<t.length&&h(t,n,w,i,w,s,r,O,x),t.reverse(),n.reverse(),r>-1&&i>0){let e=function(e,t){return(n,r,o)=>{let i,a,l=0,s=n.length-1;if(s>=0&&(i=n[s])instanceof Zj){if(!s&&i.type==e&&i.length==o)return i;(a=i.prop(Hj.lookAhead))&&(l=r[s]+i.length+a)}return f(e,n,r,o,l,t)}}(C,x);S=mF(C,t,n,0,t.length,0,k-w,e,e)}else S=f(C,t,n,k-w,O-k,x)}n.push(S),g.push(P)}function p(e,t,n,i){let a=[],s=0,c=-1;for(;l.pos>t;){let{id:e,start:t,end:n,size:r}=l;if(r>4)l.next();else{if(c>-1&&t<c)break;c<0&&(c=n-o),a.push(e,t,n),s++,l.next()}}if(s){let t=new Uint16Array(4*s),o=a[a.length-2];for(let e=a.length-3,n=0;e>=0;e-=3)t[n++]=a[e],t[n++]=a[e+1]-o,t[n++]=a[e+2]-o,t[n++]=n;n.push(new eF(t,a[2]-o,r)),i.push(o-e)}}function h(e,t,n,o,i,a,l,s,c){let u=[],d=[];for(;e.length>o;)u.push(e.pop()),d.push(t.pop()+n-i);e.push(f(r.types[l],u,d,a-i,s-a,c)),t.push(i-n)}function f(e,t,n,r,o,i,a){if(i){let e=[Hj.contextHash,i];a=a?[e].concat(a):[e]}if(o>25){let e=[Hj.lookAhead,o];a=a?[e].concat(a):[e]}return new Zj(e,t,n,r,a)}function m(e,t,n){let{id:r,start:o,end:i,size:s}=l;if(l.next(),s>=0&&r<a){let a=n;if(s>4){let r=l.pos-(s-4);for(;l.pos>r;)n=m(e,t,n)}t[--n]=a,t[--n]=i-e,t[--n]=o-e,t[--n]=r}else-3==s?c=r:-4==s&&(u=r);return n}let g=[],v=[];for(;l.pos>0;)d(e.start||0,e.bufferStart||0,g,v,-1,0);let y=null!==(t=e.length)&&void 0!==t?t:g.length?v[0]+g[0].length:0;return new Zj(s[e.topID],g.reverse(),v.reverse(),y)}(e)}}Zj.empty=new Zj($j.none,[],[],0);class Jj{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Jj(this.buffer,this.index)}}class eF{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return $j.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],o=r.name;if(/\W/.test(o)&&!r.isError&&(o=JSON.stringify(o)),n==(e+=4))return o;let i=[];for(;e<n;)i.push(this.childString(e)),e=this.buffer[e+3];return o+"("+i.join(",")+")"}findChild(e,t,n,r,o){let{buffer:i}=this,a=-1;for(let l=e;l!=t&&!(tF(o,r,i[l+1],i[l+2])&&(a=l,n>0));l=i[l+3]);return a}slice(e,t,n){let r=this.buffer,o=new Uint16Array(t-e),i=0;for(let a=e,l=0;a<t;){o[l++]=r[a++],o[l++]=r[a++]-n;let t=o[l++]=r[a++]-n;o[l++]=r[a++]-e,i=Math.max(i,t)}return new eF(o,i,this.set)}}function tF(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function nF(e,t,n,r){for(var o;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof oF&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:Kj.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof oF&&r.index<0&&(null===(o=a.enter(t,n,i))||void 0===o?void 0:o.from)!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}class rF{cursor(e=0){return new dF(this,e)}getChild(e,t=null,n=null){let r=iF(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return iF(this,e,t,n)}resolve(e,t=0){return nF(this,e,t,!1)}resolveInner(e,t=0){return nF(this,e,t,!0)}matchContext(e){return aF(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class oF extends rF{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,o=0){for(let i=this;;){for(let{children:a,positions:l}=i._tree,s=t>0?a.length:-1;e!=s;e+=t){let s=a[e],c=l[e]+i.from;if(tF(r,n,c,c+s.length))if(s instanceof eF){if(o&Kj.ExcludeBuffers)continue;let a=s.findChild(0,s.buffer.length,t,n-c,r);if(a>-1)return new sF(new lF(i,s,e,c),null,a)}else if(o&Kj.IncludeAnonymous||!s.type.isAnonymous||pF(s)){let a;if(!(o&Kj.IgnoreMounts)&&(a=qj.get(s))&&!a.overlay)return new oF(a.tree,c,e,i);let l=new oF(s,c,e,i);return o&Kj.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(t<0?s.children.length-1:0,t,n,r)}}if(o&Kj.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&Kj.IgnoreOverlays)&&(r=qj.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:e,to:o}of r.overlay)if((t>0?e<=n:e<n)&&(t<0?o>=n:o>n))return new oF(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function iF(e,t,n,r){let o=e.cursor(),i=[];if(!o.firstChild())return i;if(null!=n)for(let e=!1;!e;)if(e=o.type.is(n),!o.nextSibling())return i;for(;;){if(null!=r&&o.type.is(r))return i;if(o.type.is(t)&&i.push(o.node),!o.nextSibling())return null==r?i:[]}}function aF(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class lF{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class sF extends rF{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return o<0?null:new sF(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&Kj.ExcludeBuffers)return null;let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new sF(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new sF(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new sF(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,o=n.buffer[this.index+3];if(o>r){let i=n.buffer[this.index+1];e.push(n.slice(r,o,i)),t.push(0)}return new Zj(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function cF(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let o=e[r];(o.from>n.from||o.to<n.to)&&(n=o,t=r)}let r=n instanceof oF&&n.index<0?null:n.parent,o=e.slice();return r?o[t]=r:o.splice(t,1),new uF(o,n)}class uF{constructor(e,t){this.heads=e,this.node=t}get next(){return cF(this.heads)}}class dF{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof oF)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof oF?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(o<0)&&(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&Kj.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Kj.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Kj.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;({index:t,_parent:n}=n))if(t>-1)for(let r=t+e,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let e=n._tree.children[r];if(this.mode&Kj.IncludeAnonymous||e instanceof eF||!e.type.isAnonymous||pF(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,o=this.stack.length;o>=0;){for(let i=e;i;i=i._parent)if(i.index==r){if(r==this.index)return i;t=i,n=o+1;break e}r=this.stack[--o]}for(let e=n;e<this.stack.length;e++)t=new sF(this.buffer,t,this.stack[e]);return this.bufferNode=new sF(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return aF(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,o=this.stack.length-1;r>=0;o--){if(o<0)return aF(this._tree,e,r);let i=n[t.buffer[this.stack[o]]];if(!i.isAnonymous){if(e[r]&&e[r]!=i.name)return!1;r--}}return!0}}function pF(e){return e.children.some(e=>e instanceof eF||!e.type.isAnonymous||pF(e))}const hF=new WeakMap;function fF(e,t){if(!e.isAnonymous||t instanceof eF||t.type!=e)return 1;let n=hF.get(t);if(null==n){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Zj)){n=1;break}n+=fF(e,r)}hF.set(t,n)}return n}function mF(e,t,n,r,o,i,a,l,s){let c=0;for(let n=r;n<o;n++)c+=fF(e,t[n]);let u=Math.ceil(1.5*c/8),d=[],p=[];return function t(n,r,o,a,l){for(let c=o;c<a;){let o=c,h=r[c],f=fF(e,n[c]);for(c++;c<a;c++){let t=fF(e,n[c]);if(f+t>=u)break;f+=t}if(c==o+1){if(f>u){let e=n[o];t(e.children,e.positions,0,e.children.length,r[o]+l);continue}d.push(n[o])}else{let t=r[c-1]+n[c-1].length-h;d.push(mF(e,n,r,o,c,h,t,null,s))}p.push(h+l-i)}}(t,n,r,o,0),(l||s)(d,p,a)}class gF{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof sF?this.setBuffer(e.context.buffer,e.index,t):e instanceof oF&&this.map.set(e.tree,t)}get(e){return e instanceof sF?this.getBuffer(e.context.buffer,e.index):e instanceof oF?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class vF{constructor(e,t,n,r,o=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(o?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new vF(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],o=1,i=e.length?e[0]:null;for(let a=0,l=0,s=0;;a++){let c=a<t.length?t[a]:null,u=c?c.fromA:1e9;if(u-l>=n)for(;i&&i.from<u;){let t=i;if(l>=t.from||u<=t.to||s){let e=Math.max(t.from,l)-s,n=Math.min(t.to,u)-s;t=e>=n?null:new vF(e,n,t.tree,t.offset+s,a>0,!!c)}if(t&&r.push(t),i.to>u)break;i=o<e.length?e[o++]:null}if(!c)break;l=c.toA,s=c.toA-c.toB}return r}}class yF{startParse(e,t,n){return"string"==typeof e&&(e=new bF(e)),n=n?n.length?n.map(e=>new Vj(e.from,e.to)):[new Vj(0,0)]:[new Vj(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class bF{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Hj({perNode:!0});class wF{constructor(e,t,n,r,o,i,a,l,s,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=o,this.score=i,this.buffer=a,this.bufferBase=l,this.curContext=s,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new wF(e,[],t,n,n,0,[],0,r?new kF(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=65535&e,{parser:o}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=o.dynamicPrecedence(r);if(a&&(this.score+=a),0==n)return this.pushState(o.getGoto(this.state,r,!0),this.reducePos),r<o.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,i?8:4,!0),void this.reduceContext(r,this.reducePos);let l=this.stack.length-3*(n-1)-(262144&e?6:0),s=l?this.stack[l-2]:this.p.ranges[0].from,c=this.reducePos-s;c>=2e3&&!(null===(t=this.p.parser.nodeSet.types[r])||void 0===t?void 0:t.isAnonymous)&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let u=l?this.stack[l-1]:0,d=this.bufferBase+this.buffer.length-u;if(r<o.minRepeatTerm||131072&e){let e=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,s,e,d+4,!0)}if(262144&e)this.state=this.stack[l];else{let e=this.stack[l-3];this.state=o.getGoto(e,r,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(r,s)}storeNode(e,t,n,r=4,o=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(0==r&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&0==e.buffer[r-4]&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t)return void(e.buffer[r-2]=n)}}if(o&&this.pos!=n){let o=this.buffer.length;if(o>0&&(0!=this.buffer[o-4]||this.buffer[o-1]<0)){let e=!1;for(let t=o;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n,r){if(131072&e)this.pushState(65535&e,this.pos);else if(262144&e)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let o=e,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(o,1)||(this.reducePos=r)),this.pushState(o,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){65536&e?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new wF(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new EF(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(!(65536&n))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r,o=0;o<t.length;o+=2)(r=t[o+1])!=this.state&&this.p.parser.hasAction(r,e)&&n.push(t[o],r);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>1&t&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let o=this.split();o.pushState(r,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[e],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(65536&t))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=65535&t,o=this.stack.length-3*n;if(o<0||e.getGoto(this.stack[o],r,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,o)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-o;if(n>1){let r=65535&t,o=this.stack.length-3*n;if(o>=0&&e.getGoto(this.stack[o],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,o+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new kF(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead||(this.emitLookAhead(),this.lookAhead=e,0))}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class kF{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class EF{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class OF{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new OF(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new OF(this.stack,this.pos,this.index)}}function xF(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,o=0;r<e.length;){let i=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(126==t){i=65535;break}t>=92&&t--,t>=34&&t--;let o=t-32;if(o>=46&&(o-=46,n=!0),i+=o,n)break;i*=46}n?n[o++]=i:n=new t(i)}return n}class SF{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const _F=new SF;class CF{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=_F,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,o=this.pos+e;for(;o<n.from;){if(!r)return null;let e=this.ranges[--r];o-=n.from-e.to,n=e}for(;t<0?o>n.to:o>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];o+=e.from-n.to,n=e}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t,n,r=this.chunkOff+e;if(r>=0&&r<this.chunk.length)t=this.pos+e,n=this.chunk.charCodeAt(r);else{let r=this.resolveOffset(e,1);if(null==r)return-1;if(t=r,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let e=this.rangeIndex,r=this.range;for(;r.to<=t;)r=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>r.to&&(this.chunk2=this.chunk2.slice(0,r.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=_F,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class PF{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;MF(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}PF.prototype.contextual=PF.prototype.fallback=PF.prototype.extend=!1;class TF{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?xF(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,o=e.resolveOffset(1,1);if(MF(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||r++,null==o)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}TF.prototype.contextual=PF.prototype.fallback=PF.prototype.extend=!1;class AF{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function MF(e,t,n,r,o,i){let a=0,l=1<<r,{dialect:s}=n.p.parser;e:for(;0!=(l&e[a]);){let n=e[a+1];for(let r=a+3;r<n;r+=2)if((e[r+1]&l)>0){let n=e[r];if(s.allows(n)&&(-1==t.token.value||t.token.value==n||DF(n,t.token.value,o,i))){t.acceptToken(n);break}}let r=t.next,c=0,u=e[a+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c<u;){let o=c+u>>1,i=n+o+(o<<1),l=e[i],s=e[i+1]||65536;if(r<l)u=o;else{if(!(r>=s)){a=e[i+2],t.advance();continue e}c=o+1}}break}a=e[n+3*u-1]}}function NF(e,t,n){for(let r,o=t;65535!=(r=e[o]);o++)if(r==n)return o-t;return-1}function DF(e,t,n,r){let o=NF(n,r,t);return o<0||NF(n,r,e)<o}const IF="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let LF=null;function RF(e,t,n){let r=e.cursor(Kj.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class jF{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?RF(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?RF(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=n.children[r],i=this.start[t]+n.positions[r];if(i>e)return this.nextStart=i,null;if(o instanceof Zj){if(i==e){if(i<this.safeFrom)return null;let e=i+o.length;if(e<=this.safeTo){let t=o.prop(Hj.lookAhead);if(!t||e+t<this.fragment.to)return o}}this.index[t]++,i+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+o.length}}}class FF{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new SF)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:o}=r,i=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let r=0;r<o.length;r++){if(!(1<<r&i))continue;let s=o[r],c=this.tokens[r];if((!n||s.fallback)&&((s.contextual||c.start!=e.pos||c.mask!=i||c.context!=a)&&(this.updateCachedToken(c,s,e),c.mask=i,c.context=a),c.lookAhead>c.end+25&&(l=Math.max(c.lookAhead,l)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!s.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),n||e.pos!=this.stream.end||(n=new SF,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new SF,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let o=t.specializers[r](this.stream.read(e.start,e.end),n);if(o>=0&&n.p.parser.dialect.allows(o>>1)){1&o?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:o}=e,{parser:i}=e.p,{data:a}=i;for(let e=0;e<2;e++)for(let l=i.stateSlot(o,e?2:1);;l+=3){if(65535==a[l]){if(1!=a[l+1]){0==r&&2==a[l+1]&&(r=this.putAction(VF(a,l+2),t,n,r));break}l=VF(a,l+2)}a[l]==t&&(r=this.putAction(VF(a,l+1),t,n,r))}return r}}class zF{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new CF(t,r),this.tokens=new FF(e,this.stream),this.topTerm=e.top[1];let{from:o}=r[0];this.stacks=[wF.start(this,e.top[0],o)],this.fragments=n.length&&this.stream.end-o>4*e.bufferLength?new jF(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,o=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;i<n.length;i++){let a=n[i];for(;;){if(this.tokens.mainToken=null,a.pos>r)o.push(a);else{if(this.advanceStack(a,o,n))continue;{e||(e=[],t=[]),e.push(a);let n=this.tokens.getMainToken(a);t.push(n.value,n.end)}}break}}if(!o.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return IF&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw IF&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,o);if(n)return IF&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(o.length>e)for(o.sort((e,t)=>t.score-e.score);o.length>e;)o.pop();o.some(e=>e.reducePos>r)&&this.recovering--}else if(o.length>1){e:for(let e=0;e<o.length-1;e++){let t=o[e];for(let n=e+1;n<o.length;n++){let r=o[n];if(t.sameState(r)||t.buffer.length>500&&r.buffer.length>500){if(!((t.score-r.score||t.buffer.length-r.buffer.length)>0)){o.splice(e--,1);continue e}o.splice(n--,1)}}}o.length>12&&(o.sort((e,t)=>t.score-e.score),o.splice(12,o.length-12))}this.minStackPos=o[0].pos;for(let e=1;e<o.length;e++)o[e].pos<this.minStackPos&&(this.minStackPos=o[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:o}=this,i=IF?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(r);a;){let r=this.parser.nodeSet.types[a.type.id]==a.type?o.getGoto(e.state,a.type.id):-1;if(r>-1&&a.length&&(!t||(a.prop(Hj.contextHash)||0)==n))return e.useNode(a,r),IF&&console.log(i+this.stackID(e)+` (via reuse of ${o.getName(a.type.id)})`),!0;if(!(a instanceof Zj)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof Zj&&0==a.positions[0]))break;a=l}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),IF&&console.log(i+this.stackID(e)+` (via always-reduce ${o.getName(65535&a)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;a<l.length;){let s=l[a++],c=l[a++],u=l[a++],d=a==l.length||!n,p=d?e:e.split(),h=this.tokens.mainToken;if(p.apply(s,c,h?h.start:p.pos,u),IF&&console.log(i+this.stackID(p)+` (via ${65536&s?`reduce of ${o.getName(65535&s)}`:"shift"} for ${o.getName(c)} @ ${r}${p==e?"":", split"})`),d)return!0;p.pos>r?t.push(p):n.push(p)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return BF(e,t),!0}}runRecovery(e,t,n){let r=null,o=!1;for(let i=0;i<e.length;i++){let a=e[i],l=t[i<<1],s=t[1+(i<<1)],c=IF?this.stackID(a)+" -> ":"";if(a.deadEnd){if(o)continue;if(o=!0,a.restart(),IF&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))continue}let u=a.split(),d=c;for(let e=0;e<10&&u.forceReduce()&&(IF&&console.log(d+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,n));e++)IF&&(d=this.stackID(u)+" -> ");for(let e of a.recoverByInsert(l))IF&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>a.pos?(s==a.pos&&(s++,l=0),a.recoverByDelete(l,s),IF&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),BF(a,n)):(!r||r.score<a.score)&&(r=a)}return r}stackToTree(e){return e.close(),Zj.build({buffer:OF.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(LF||(LF=new WeakMap)).get(e);return t||LF.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function BF(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e))return void(t[n].score<e.score&&(t[n]=e))}t.push(e)}class WF{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class UF extends yF{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function o(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=Hj[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)o(r,e,t[n++]);else{let i=t[n+-r];for(let a=-r;a>0;a--)o(t[n++],e,i);n++}}}this.nodeSet=new Gj(t.map((t,o)=>$j.define({name:o>=this.minRepeatTerm?void 0:t,id:o,props:r[o],top:n.indexOf(o)>-1,error:0==o,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Wj;let i=xF(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(HF),this.states=xF(e.states,Uint32Array),this.data=xF(e.stateData),this.goto=xF(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new PF(i,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new zF(this,e,t,n);for(let o of this.wrappers)r=o(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let o=r[t+1];;){let t=r[o++],i=1&t,a=r[o++];if(i&&n)return a;for(let n=o+(t>>1);o<n;o++)if(r[o]==e)return a;if(i)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let o,i=this.stateSlot(e,r?2:1);;i+=3){if(65535==(o=n[i])){if(1!=n[i+1]){if(2==n[i+1])return VF(n,i+2);break}o=n[i=VF(n,i+2)]}if(o==t||0==o)return VF(n,i+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==r;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=VF(this.data,n+2)}r=t(VF(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=VF(this.data,n+2)}if(!(1&this.data[n+2])){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(UF.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let o=e.specializers.find(e=>e.from==n.external);if(!o)return n;let i=Object.assign(Object.assign({},n),{external:o.to});return t.specializers[r]=HF(i),i})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n,o=this.dialects[t[e]];65535!=(n=this.data[o++]);)(r||(r=new Uint8Array(this.maxTerm+1)))[n]=1;return new WF(e,n,r)}static deserialize(e){return new UF(e)}}function VF(e,t){return e[t]|e[t+1]<<16}function HF(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}let qF=0;class QF{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=qF++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n="string"==typeof e?e:"?";if(e instanceof QF&&(t=e),null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let r=new QF(n,[],null,[]);if(r.set.push(r),t)for(let e of t.set)r.set.push(e);return r}static defineModifier(e){let t=new GF(e);return e=>e.modified.indexOf(t)>-1?e:GF.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let $F=0;class GF{constructor(e){this.name=e,this.instances=[],this.id=$F++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{return n.base==e&&(r=t,o=n.modified,r.length==o.length&&r.every((e,t)=>e==o[t]));var r,o});if(n)return n;let r=[],o=new QF(e.name,r,e,t);for(let e of t)e.instances.push(o);let i=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,o=t.length;r<o;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of i)r.push(GF.get(t,e));return o}}function YF(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(" "))if(e){let n=[],o=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){o=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!r)throw new RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let a=e[t++];if(t==e.length&&"!"==a){o=0;break}if("/"!=a)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let a=n.length-1,l=n[a];if(!l)throw new RangeError("Invalid path: "+e);let s=new KF(r,o,a>0?n.slice(0,a):null);t[l]=s.sort(t[l])}}return XF.add(t)}const XF=new Hj({combine(e,t){let n,r,o;for(;e||t;){if(!e||t&&e.depth>=t.depth?(o=t,t=t.next):(o=e,e=e.next),n&&n.mode==o.mode&&!o.context&&!n.context)continue;let i=new KF(o.tags,o.mode,o.context);n?n.next=i:r=i,n=i}return r}});class KF{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function ZF(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:r,all:o=null}=t||{};return{style:e=>{let t=o;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}function JF(e,t,n,r=0,o=e.length){let i=new ez(r,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),r,o,"",i.highlighters),i.flush(o)}KF.empty=new KF([],2,null);class ez{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,o){let{type:i,from:a,to:l}=e;if(a>=n||l<=t)return;i.isTop&&(o=this.highlighters.filter(e=>!e.scope||e.scope(i)));let s=r,c=function(e){let t=e.type.prop(XF);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||KF.empty,u=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(o,c.tags);if(u&&(s&&(s+=" "),s+=u,1==c.mode&&(r+=(r?" ":"")+u)),this.startSpan(Math.max(t,a),s),c.opaque)return;let d=e.tree&&e.tree.prop(Hj.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+a,1),c=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let p=0,h=a;;p++){let f=p<d.overlay.length?d.overlay[p]:null,m=f?f.from+a:l,g=Math.max(t,h),v=Math.min(n,m);if(g<v&&u)for(;e.from<v&&(this.highlightRange(e,g,v,r,o),this.startSpan(Math.min(v,e.to),s),!(e.to>=m)&&e.nextSibling()););if(!f||m>n)break;h=f.to+a,h>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+a),Math.min(n,h),"",c),this.startSpan(Math.min(n,h),s))}u&&e.parent()}else if(e.firstChild()){d&&(r="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,o),this.startSpan(Math.min(n,e.to),s)}}while(e.nextSibling());e.parent()}}}const tz=QF.define,nz=tz(),rz=tz(),oz=tz(rz),iz=tz(rz),az=tz(),lz=tz(az),sz=tz(az),cz=tz(),uz=tz(cz),dz=tz(),pz=tz(),hz=tz(),fz=tz(hz),mz=tz(),gz={comment:nz,lineComment:tz(nz),blockComment:tz(nz),docComment:tz(nz),name:rz,variableName:tz(rz),typeName:oz,tagName:tz(oz),propertyName:iz,attributeName:tz(iz),className:tz(rz),labelName:tz(rz),namespace:tz(rz),macroName:tz(rz),literal:az,string:lz,docString:tz(lz),character:tz(lz),attributeValue:tz(lz),number:sz,integer:tz(sz),float:tz(sz),bool:tz(az),regexp:tz(az),escape:tz(az),color:tz(az),url:tz(az),keyword:dz,self:tz(dz),null:tz(dz),atom:tz(dz),unit:tz(dz),modifier:tz(dz),operatorKeyword:tz(dz),controlKeyword:tz(dz),definitionKeyword:tz(dz),moduleKeyword:tz(dz),operator:pz,derefOperator:tz(pz),arithmeticOperator:tz(pz),logicOperator:tz(pz),bitwiseOperator:tz(pz),compareOperator:tz(pz),updateOperator:tz(pz),definitionOperator:tz(pz),typeOperator:tz(pz),controlOperator:tz(pz),punctuation:hz,separator:tz(hz),bracket:fz,angleBracket:tz(fz),squareBracket:tz(fz),paren:tz(fz),brace:tz(fz),content:cz,heading:uz,heading1:tz(uz),heading2:tz(uz),heading3:tz(uz),heading4:tz(uz),heading5:tz(uz),heading6:tz(uz),contentSeparator:tz(cz),list:tz(cz),quote:tz(cz),emphasis:tz(cz),strong:tz(cz),link:tz(cz),monospace:tz(cz),strikethrough:tz(cz),inserted:tz(),deleted:tz(),changed:tz(),invalid:tz(),meta:mz,documentMeta:tz(mz),annotation:tz(mz),processingInstruction:tz(mz),definition:QF.defineModifier("definition"),constant:QF.defineModifier("constant"),function:QF.defineModifier("function"),standard:QF.defineModifier("standard"),local:QF.defineModifier("local"),special:QF.defineModifier("special")};for(let e in gz){let t=gz[e];t instanceof QF&&(t.name=e)}ZF([{tag:gz.link,class:"tok-link"},{tag:gz.heading,class:"tok-heading"},{tag:gz.emphasis,class:"tok-emphasis"},{tag:gz.strong,class:"tok-strong"},{tag:gz.keyword,class:"tok-keyword"},{tag:gz.atom,class:"tok-atom"},{tag:gz.bool,class:"tok-bool"},{tag:gz.url,class:"tok-url"},{tag:gz.labelName,class:"tok-labelName"},{tag:gz.inserted,class:"tok-inserted"},{tag:gz.deleted,class:"tok-deleted"},{tag:gz.literal,class:"tok-literal"},{tag:gz.string,class:"tok-string"},{tag:gz.number,class:"tok-number"},{tag:[gz.regexp,gz.escape,gz.special(gz.string)],class:"tok-string2"},{tag:gz.variableName,class:"tok-variableName"},{tag:gz.local(gz.variableName),class:"tok-variableName tok-local"},{tag:gz.definition(gz.variableName),class:"tok-variableName tok-definition"},{tag:gz.special(gz.variableName),class:"tok-variableName2"},{tag:gz.definition(gz.propertyName),class:"tok-propertyName tok-definition"},{tag:gz.typeName,class:"tok-typeName"},{tag:gz.namespace,class:"tok-namespace"},{tag:gz.className,class:"tok-className"},{tag:gz.macroName,class:"tok-macroName"},{tag:gz.propertyName,class:"tok-propertyName"},{tag:gz.operator,class:"tok-operator"},{tag:gz.comment,class:"tok-comment"},{tag:gz.meta,class:"tok-meta"},{tag:gz.invalid,class:"tok-invalid"},{tag:gz.punctuation,class:"tok-punctuation"}]);const vz=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function yz(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function bz(e){return e>=48&&e<=57}function wz(e){return bz(e)||e>=97&&e<=102||e>=65&&e<=70}const kz=(e,t,n)=>(r,o)=>{for(let i=!1,a=0,l=0;;l++){let{next:s}=r;if(yz(s)||45==s||95==s||i&&bz(s))!i&&(45!=s||l>0)&&(i=!0),a===l&&45==s&&a++,r.advance();else{if(92!=s||10==r.peek(1)){i&&r.acceptToken(2==a&&o.canShift(2)?t:40==s?n:e);break}if(r.advance(),wz(r.next)){do{r.advance()}while(wz(r.next));32==r.next&&r.advance()}else r.next>-1&&r.advance();i=!0}}},Ez=new AF(kz(123,2,124)),Oz=new AF(kz(125,3,4)),xz=new AF(e=>{if(vz.includes(e.peek(-1))){let{next:t}=e;(yz(t)||95==t||35==t||46==t||42==t||91==t||58==t&&yz(e.peek(1))||45==t||38==t)&&e.acceptToken(122)}}),Sz=new AF(e=>{if(!vz.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),yz(t)){do{e.advance()}while(yz(e.next)||bz(e.next));e.acceptToken(1)}}}),_z=YF({"AtKeyword import charset namespace keyframes media supports":gz.definitionKeyword,"from to selector":gz.keyword,NamespaceName:gz.namespace,KeyframeName:gz.labelName,KeyframeRangeName:gz.operatorKeyword,TagName:gz.tagName,ClassName:gz.className,PseudoClassName:gz.constant(gz.className),IdName:gz.labelName,"FeatureName PropertyName":gz.propertyName,AttributeName:gz.attributeName,NumberLiteral:gz.number,KeywordQuery:gz.keyword,UnaryQueryOp:gz.operatorKeyword,"CallTag ValueName":gz.atom,VariableName:gz.variableName,Callee:gz.operatorKeyword,Unit:gz.unit,"UniversalSelector NestingSelector":gz.definitionOperator,"MatchOp CompareOp":gz.compareOperator,"ChildOp SiblingOp, LogicOp":gz.logicOperator,BinOp:gz.arithmeticOperator,Important:gz.modifier,Comment:gz.blockComment,ColorLiteral:gz.color,"ParenthesizedContent StringLiteral":gz.string,":":gz.punctuation,"PseudoOp #":gz.derefOperator,"; ,":gz.separator,"( )":gz.paren,"[ ]":gz.squareBracket,"{ }":gz.brace}),Cz={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},Pz={__proto__:null,or:98,and:98,not:106,only:106,layer:170},Tz={__proto__:null,selector:112,layer:166},Az={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},Mz={__proto__:null,to:207},Nz=UF.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[_z],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[xz,Sz,Ez,Oz,1,2,3,4,new TF("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},specialized:[{term:124,get:e=>Cz[e]||-1},{term:125,get:e=>Pz[e]||-1},{term:4,get:e=>Tz[e]||-1},{term:25,get:e=>Az[e]||-1},{term:123,get:e=>Mz[e]||-1}],tokenPrec:1963});let Dz=[],Iz=[];function Lz(e){if(e<768)return!1;for(let t=0,n=Dz.length;;){let r=t+n>>1;if(e<Dz[r])n=r;else{if(!(e>=Iz[r]))return!0;t=r+1}if(t==n)return!1}}function Rz(e){return e>=127462&&e<=127487}function jz(e,t,n=!0,r=!0){return(n?Fz:zz)(e,t,r)}function Fz(e,t,n){if(t==e.length)return t;t&&Wz(e.charCodeAt(t))&&Uz(e.charCodeAt(t-1))&&t--;let r=Bz(e,t);for(t+=Vz(r);t<e.length;){let o=Bz(e,t);if(8205==r||8205==o||n&&Lz(o))t+=Vz(o),r=o;else{if(!Rz(o))break;{let n=0,r=t-2;for(;r>=0&&Rz(Bz(e,r));)n++,r-=2;if(n%2==0)break;t+=2}}}return t}function zz(e,t,n){for(;t>0;){let r=Fz(e,t-2,n);if(r<t)return r;t--}return 0}function Bz(e,t){let n=e.charCodeAt(t);if(!Uz(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Wz(r)?r-56320+(n-55296<<10)+65536:n}function Wz(e){return e>=56320&&e<57344}function Uz(e){return e>=55296&&e<56320}function Vz(e){return e<65536?1:2}(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?Iz:Dz).push(n+=e[t])})();class Hz{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Jz(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Qz.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Jz(this,e,t);let n=[];return this.decompose(e,t,n,0),Qz.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Yz(this),o=new Yz(e);for(let e=t,i=t;;){if(r.next(e),o.next(e),e=0,r.lineBreak!=o.lineBreak||r.done!=o.done||r.value!=o.value)return!1;if(i+=r.value.length,r.done||i>=n)return!0}}iter(e=1){return new Yz(this,e)}iterRange(e,t=this.length){return new Xz(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Kz(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new qz(e):Qz.from(qz.split(e,[])):Hz.empty}}class qz extends Hz{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let o=0;;o++){let i=this.text[o],a=r+i.length;if((t?n:a)>=e)return new Zz(r,a,n,i);r=a+1,n++}}decompose(e,t,n,r){let o=e<=0&&t>=this.length?this:new qz(Gz(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=$z(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new qz(t,e.length+o.length));else{let e=t.length>>1;n.push(new qz(t.slice(0,e)),new qz(t.slice(e)))}}else n.push(o)}replace(e,t,n){if(!(n instanceof qz))return super.replace(e,t,n);[e,t]=Jz(this,e,t);let r=$z(this.text,$z(n.text,Gz(this.text,0,e)),t),o=this.length+n.length-(t-e);return r.length<=32?new qz(r,o):Qz.from(qz.split(r,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=Jz(this,e,t);let r="";for(let o=0,i=0;o<=t&&i<this.text.length;i++){let a=this.text[i],l=o+a.length;o>e&&i&&(r+=n),e<l&&t>o&&(r+=a.slice(Math.max(0,e-o),t-o)),o=l+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let o of e)n.push(o),r+=o.length+1,32==n.length&&(t.push(new qz(n,r)),n=[],r=-1);return r>-1&&t.push(new qz(n,r)),t}}class Qz extends Hz{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let o=0;;o++){let i=this.children[o],a=r+i.length,l=n+i.lines-1;if((t?l:a)>=e)return i.lineInner(e,t,n,r);r=a+1,n=l+1}}decompose(e,t,n,r){for(let o=0,i=0;i<=t&&o<this.children.length;o++){let a=this.children[o],l=i+a.length;if(e<=l&&t>=i){let o=r&((i<=e?1:0)|(l>=t?2:0));i>=e&&l<=t&&!o?n.push(a):a.decompose(e-i,t-i,n,o)}i=l+1}}replace(e,t,n){if([e,t]=Jz(this,e,t),n.lines<this.lines)for(let r=0,o=0;r<this.children.length;r++){let i=this.children[r],a=o+i.length;if(e>=o&&t<=a){let l=i.replace(e-o,t-o,n),s=this.lines-i.lines+l.lines;if(l.lines<s>>4&&l.lines>s>>6){let o=this.children.slice();return o[r]=l,new Qz(o,this.length-(t-e)+n.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=Jz(this,e,t);let r="";for(let o=0,i=0;o<this.children.length&&i<=t;o++){let a=this.children[o],l=i+a.length;i>e&&o&&(r+=n),e<l&&t>i&&(r+=a.sliceString(e-i,t-i,n)),i=l+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Qz))return 0;let n=0,[r,o,i,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,o+=t){if(r==i||o==a)return n;let l=this.children[r],s=e.children[o];if(l!=s)return n+l.scanIdentical(s,t);n+=l.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new qz(n,t)}let r=Math.max(32,n>>5),o=r<<1,i=r>>1,a=[],l=0,s=-1,c=[];function u(e){let t;if(e.lines>o&&e instanceof Qz)for(let t of e.children)u(t);else e.lines>i&&(l>i||!l)?(d(),a.push(e)):e instanceof qz&&l&&(t=c[c.length-1])instanceof qz&&e.lines+t.lines<=32?(l+=e.lines,s+=e.length+1,c[c.length-1]=new qz(t.text.concat(e.text),t.length+1+e.length)):(l+e.lines>r&&d(),l+=e.lines,s+=e.length+1,c.push(e))}function d(){0!=l&&(a.push(1==c.length?c[0]:Qz.from(c,s)),s=-1,l=c.length=0)}for(let t of e)u(t);return d(),1==a.length?a[0]:new Qz(a,t)}}function $z(e,t,n=0,r=1e9){for(let o=0,i=0,a=!0;i<e.length&&o<=r;i++){let l=e[i],s=o+l.length;s>=n&&(s>r&&(l=l.slice(0,r-o)),o<n&&(l=l.slice(n-o)),a?(t[t.length-1]+=l,a=!1):t.push(l)),o=s+1}return t}function Gz(e,t,n){return $z(e,[""],t,n)}Hz.empty=new qz([""],0);class Yz{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof qz?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],o=this.offsets[n],i=o>>1,a=r instanceof qz?r.text.length:r.children.length;if(i==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof qz){let o=r.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,o.length>Math.max(0,e))return this.value=0==e?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=r.children[i+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof qz?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Xz{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Yz(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Kz{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(Hz.prototype[Symbol.iterator]=function(){return this.iter()},Yz.prototype[Symbol.iterator]=Xz.prototype[Symbol.iterator]=Kz.prototype[Symbol.iterator]=function(){return this});class Zz{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function Jz(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function eB(e,t,n=!0,r=!0){return jz(e,t,n,r)}function tB(e,t){let n=e.charCodeAt(t);if(!((r=n)>=55296&&r<56320&&t+1!=e.length))return n;var r;let o=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(o)?o-56320+(n-55296<<10)+65536:n}function nB(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function rB(e){return e<65536?1:2}const oB=/\r\n?|\n/;var iB=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(iB||(iB={}));class aB{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let o=this.sections[t++],i=this.sections[t++];i<0?(e(n,r,o),r+=o):r+=i,n+=o}}iterChangedRanges(e,t=!1){uB(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new aB(e)}composeDesc(e){return this.empty?e:e.empty?this:pB(this,e)}mapDesc(e,t=!1){return e.empty?this:dB(this,e,t)}mapPos(e,t=-1,n=iB.Simple){let r=0,o=0;for(let i=0;i<this.sections.length;){let a=this.sections[i++],l=this.sections[i++],s=r+a;if(l<0){if(s>e)return o+(e-r);o+=a}else{if(n!=iB.Simple&&s>=e&&(n==iB.TrackDel&&r<e&&s>e||n==iB.TrackBefore&&r<e||n==iB.TrackAfter&&s>e))return null;if(s>e||s==e&&t<0&&!a)return e==r||t<0?o:o+l;o+=l}r=s}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return o}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let o=r+this.sections[n++];if(this.sections[n++]>=0&&r<=t&&o>=e)return!(r<e&&o>t)||"cover";r=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeDesc");return new aB(e)}static create(e){return new aB(e)}}class lB extends aB{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return uB(this,(t,n,r,o,i)=>e=e.replace(r,r+(n-t),i),!1),e}mapDesc(e,t=!1){return dB(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,o=0;r<t.length;r+=2){let i=t[r],a=t[r+1];if(a>=0){t[r]=a,t[r+1]=i;let l=r>>1;for(;n.length<l;)n.push(Hz.empty);n.push(i?e.slice(o,o+i):Hz.empty)}o+=i}return new lB(t,n)}compose(e){return this.empty?e:e.empty?this:pB(this,e,!0)}map(e,t=!1){return e.empty?this:dB(this,e,t,!0)}iterChanges(e,t=!1){uB(this,e,t)}get desc(){return aB.create(this.sections)}filter(e){let t=[],n=[],r=[],o=new hB(this);e:for(let i=0,a=0;;){let l=i==e.length?1e9:e[i++];for(;a<l||a==l&&0==o.len;){if(o.done)break e;let e=Math.min(o.len,l-a);sB(r,e,-1);let i=-1==o.ins?-1:0==o.off?o.ins:0;sB(t,e,i),i>0&&cB(n,t,o.text),o.forward(e),a+=e}let s=e[i++];for(;a<s;){if(o.done)break e;let e=Math.min(o.len,s-a);sB(t,e,-1),sB(r,e,-1==o.ins?-1:0==o.off?o.ins:0),o.forward(e),a+=e}}return{changes:new lB(t,n),filtered:aB.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],o=[],i=0,a=null;function l(e=!1){if(!e&&!r.length)return;i<t&&sB(r,t-i,-1);let n=new lB(r,o);a=a?a.compose(n.map(a)):n,r=[],o=[],i=0}return function e(s){if(Array.isArray(s))for(let t of s)e(t);else if(s instanceof lB){if(s.length!=t)throw new RangeError(`Mismatched change set length (got ${s.length}, expected ${t})`);l(),a=a?a.compose(s.map(a)):s}else{let{from:e,to:a=e,insert:c}=s;if(e>a||e<0||a>t)throw new RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let u=c?"string"==typeof c?Hz.of(c.split(n||oB)):c:Hz.empty,d=u.length;if(e==a&&0==d)return;e<i&&l(),e>i&&sB(r,e-i,-1),sB(r,a-e,d),cB(o,r,u),i=a}}(e),l(!a),a}static empty(e){return new lB(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let o=e[r];if("number"==typeof o)t.push(o,-1);else{if(!Array.isArray(o)||"number"!=typeof o[0]||o.some((e,t)=>t&&"string"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)t.push(o[0],0);else{for(;n.length<r;)n.push(Hz.empty);n[r]=Hz.of(o.slice(1)),t.push(o[0],n[r].length)}}}return new lB(t,n)}static createSet(e,t){return new lB(e,t)}}function sB(e,t,n,r=!1){if(0==t&&n<=0)return;let o=e.length-2;o>=0&&n<=0&&n==e[o+1]?e[o]+=t:o>=0&&0==t&&0==e[o]?e[o+1]+=n:r?(e[o]+=t,e[o+1]+=n):e.push(t,n)}function cB(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Hz.empty);e.push(n)}}function uB(e,t,n){let r=e.inserted;for(let o=0,i=0,a=0;a<e.sections.length;){let l=e.sections[a++],s=e.sections[a++];if(s<0)o+=l,i+=l;else{let c=o,u=i,d=Hz.empty;for(;c+=l,u+=s,s&&r&&(d=d.append(r[a-2>>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],s=e.sections[a++];t(o,c,i,u,d),o=c,i=u}}}function dB(e,t,n,r=!1){let o=[],i=r?[]:null,a=new hB(e),l=new hB(t);for(let e=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(-1==a.ins&&-1==l.ins){let e=Math.min(a.len,l.len);sB(o,e,-1),a.forward(e),l.forward(e)}else if(l.ins>=0&&(a.ins<0||e==a.i||0==a.off&&(l.len<a.len||l.len==a.len&&!n))){let t=l.len;for(sB(o,l.ins,-1);t;){let n=Math.min(a.len,t);a.ins>=0&&e<a.i&&a.len<=n&&(sB(o,0,a.ins),i&&cB(i,o,a.text),e=a.i),a.forward(n),t-=n}l.next()}else{if(!(a.ins>=0)){if(a.done&&l.done)return i?lB.createSet(o,i):aB.create(o);throw new Error("Mismatched change set lengths")}{let t=0,n=a.len;for(;n;)if(-1==l.ins){let e=Math.min(n,l.len);t+=e,n-=e,l.forward(e)}else{if(!(0==l.ins&&l.len<n))break;n-=l.len,l.next()}sB(o,t,e<a.i?a.ins:0),i&&e<a.i&&cB(i,o,a.text),e=a.i,a.forward(a.len-n)}}}}function pB(e,t,n=!1){let r=[],o=n?[]:null,i=new hB(e),a=new hB(t);for(let e=!1;;){if(i.done&&a.done)return o?lB.createSet(r,o):aB.create(r);if(0==i.ins)sB(r,i.len,0,e),i.next();else if(0!=a.len||a.done){if(i.done||a.done)throw new Error("Mismatched change set lengths");{let t=Math.min(i.len2,a.len),n=r.length;if(-1==i.ins){let n=-1==a.ins?-1:a.off?0:a.ins;sB(r,t,n,e),o&&n&&cB(o,r,a.text)}else-1==a.ins?(sB(r,i.off?0:i.len,t,e),o&&cB(o,r,i.textBit(t))):(sB(r,i.off?0:i.len,a.off?0:a.ins,e),o&&!a.off&&cB(o,r,a.text));e=(i.ins>t||a.ins>=0&&a.len>t)&&(e||r.length>n),i.forward2(t),a.forward(t)}}else sB(r,0,a.ins,e),o&&cB(o,r,a.text),a.next()}}class hB{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Hz.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Hz.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class fB{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new fB(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return mB.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return mB.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return mB.range(e.anchor,e.head)}static create(e,t,n){return new fB(e,t,n)}}class mB{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:mB.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new mB([this.main],0)}addRange(e,t=!0){return mB.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,mB.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new mB(e.ranges.map(e=>fB.fromJSON(e)),e.main)}static single(e,t=e){return new mB([mB.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let o=e[r];if(o.empty?o.from<=n:o.from<n)return mB.normalized(e.slice(),t);n=o.to}return new mB(e,t)}static cursor(e,t=0,n,r){return fB.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=r?r:16777215)<<6)}static range(e,t,n,r){let o=(null!=n?n:16777215)<<6|(null==r?7:Math.min(6,r));return t<e?fB.create(t,e,48|o):fB.create(e,t,(t>e?8:0)|o)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let r=e[n],o=e[n-1];if(r.empty?r.from<=o.to:r.from<o.to){let i=o.from,a=Math.max(r.to,o.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?mB.range(a,i):mB.range(i,a))}}return new mB(e,t)}}function gB(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let vB=0;class yB{constructor(e,t,n,r,o){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=vB++,this.default=e([]),this.extensions="function"==typeof o?o(this):o}get reader(){return this}static define(e={}){return new yB(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:bB),!!e.static,e.enables)}of(e){return new wB([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new wB(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new wB(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function bB(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class wB{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=vB++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,o=this.id,i=e[o]>>1,a=2==this.type,l=!1,s=!1,c=[];for(let n of this.dependencies)"doc"==n?l=!0:"selection"==n?s=!0:1&(null!==(t=e[n.id])&&void 0!==t?t:1)||c.push(e[n.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(l&&t.docChanged||s&&(t.docChanged||t.selection)||EB(e,c)){let t=n(e);if(a?!kB(t,e.values[i],r):!r(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let l,s=t.config.address[o];if(null!=s){let o=DB(t,s);if(this.dependencies.every(n=>n instanceof yB?t.facet(n)===e.facet(n):!(n instanceof SB)||t.field(n,!1)==e.field(n,!1))||(a?kB(l=n(e),o,r):r(l=n(e),o)))return e.values[i]=o,0}else l=n(e);return e.values[i]=l,1}}}}function kB(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function EB(e,t){let n=!1;for(let r of t)1&NB(e,r)&&(n=!0);return n}function OB(e,t,n){let r=n.map(t=>e[t.id]),o=n.map(e=>e.type),i=r.filter(e=>!(1&e)),a=e[t.id]>>1;function l(e){let n=[];for(let t=0;t<r.length;t++){let i=DB(e,r[t]);if(2==o[t])for(let e of i)n.push(e);else n.push(i)}return t.combine(n)}return{create(e){for(let t of r)NB(e,t);return e.values[a]=l(e),1},update(e,n){if(!EB(e,i))return 0;let r=l(e);return t.compare(r,e.values[a])?0:(e.values[a]=r,1)},reconfigure(e,o){let i=EB(e,r),s=o.config.facets[t.id],c=o.facet(t);if(s&&!i&&bB(n,s))return e.values[a]=c,0;let u=l(e);return t.compare(u,c)?(e.values[a]=c,0):(e.values[a]=u,1)}}}const xB=yB.define({static:!0});class SB{constructor(e,t,n,r,o){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=o,this.provides=void 0}static define(e){let t=new SB(vB++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(xB).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],o=this.updateF(r,n);return this.compareF(r,o)?0:(e.values[t]=o,1)},reconfigure:(e,n)=>{let r,o=e.facet(xB),i=n.facet(xB);return(r=o.find(e=>e.field==this))&&r!=i.find(e=>e.field==this)?(e.values[t]=r.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,xB.of({field:this,create:e})]}get extension(){return this}}function _B(e){return t=>new PB(t,e)}const CB={highest:_B(0),high:_B(1),default:_B(2),low:_B(3),lowest:_B(4)};class PB{constructor(e,t){this.inner=e,this.prec=t}}class TB{of(e){return new AB(this,e)}reconfigure(e){return TB.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class AB{constructor(e,t){this.compartment=e,this.inner=t}}class MB{constructor(e,t,n,r,o,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=o,this.facets=i,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let r=[],o=Object.create(null),i=new Map;for(let n of function(e,t,n){let r=[[],[],[],[],[]],o=new Map;return function e(i,a){let l=o.get(i);if(null!=l){if(l<=a)return;let e=r[l].indexOf(i);e>-1&&r[l].splice(e,1),i instanceof AB&&n.delete(i.compartment)}if(o.set(i,a),Array.isArray(i))for(let t of i)e(t,a);else if(i instanceof AB){if(n.has(i.compartment))throw new RangeError("Duplicate use of compartment in extensions");let r=t.get(i.compartment)||i.inner;n.set(i.compartment,r),e(r,a)}else if(i instanceof PB)e(i.inner,i.prec);else if(i instanceof SB)r[a].push(i),i.provides&&e(i.provides,a);else if(i instanceof wB)r[a].push(i),i.facet.extensions&&e(i.facet.extensions,2);else{let t=i.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${i}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,a)}}(e,2),r.reduce((e,t)=>e.concat(t))}(e,t,i))n instanceof SB?r.push(n):(o[n.facet.id]||(o[n.facet.id]=[])).push(n);let a=Object.create(null),l=[],s=[];for(let e of r)a[e.id]=s.length<<1,s.push(t=>e.slot(t));let c=null==n?void 0:n.config.facets;for(let e in o){let t=o[e],r=t[0].facet,i=c&&c[e]||[];if(t.every(e=>0==e.type))if(a[r.id]=l.length<<1|1,bB(i,t))l.push(n.facet(r));else{let e=r.combine(t.map(e=>e.value));l.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(a[e.id]=l.length<<1|1,l.push(e.value)):(a[e.id]=s.length<<1,s.push(t=>e.dynamicSlot(t)));a[r.id]=s.length<<1,s.push(e=>OB(e,r,t))}}let u=s.map(e=>e(a));return new MB(e,i,u,a,l,o)}}function NB(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let o=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|o}function DB(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const IB=yB.define(),LB=yB.define({combine:e=>e.some(e=>e),static:!0}),RB=yB.define({combine:e=>e.length?e[0]:void 0,static:!0}),jB=yB.define(),FB=yB.define(),zB=yB.define(),BB=yB.define({combine:e=>!!e.length&&e[0]});class WB{constructor(e,t){this.type=e,this.value=t}static define(){return new UB}}class UB{of(e){return new WB(this,e)}}class VB{constructor(e){this.map=e}of(e){return new HB(this,e)}}class HB{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new HB(this.type,t)}is(e){return this.type==e}static define(e={}){return new VB(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}HB.reconfigure=HB.define(),HB.appendConfig=HB.define();class qB{constructor(e,t,n,r,o,i){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=o,this.scrollIntoView=i,this._doc=null,this._state=null,n&&gB(n,t.newLength),o.some(e=>e.type==qB.time)||(this.annotations=o.concat(qB.time.of(Date.now())))}static create(e,t,n,r,o,i){return new qB(e,t,n,r,o,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(qB.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function QB(e,t){let n=[];for(let r=0,o=0;;){let i,a;if(r<e.length&&(o==t.length||t[o]>=e[r]))i=e[r++],a=e[r++];else{if(!(o<t.length))return n;i=t[o++],a=t[o++]}!n.length||n[n.length-1]<i?n.push(i,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function $B(e,t,n){var r;let o,i,a;return n?(o=t.changes,i=lB.empty(t.changes.length),a=e.changes.compose(t.changes)):(o=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(o)),{changes:a,selection:t.selection?t.selection.map(i):null===(r=e.selection)||void 0===r?void 0:r.map(o),effects:HB.mapEffects(e.effects,o).concat(HB.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function GB(e,t,n){let r=t.selection,o=KB(t.annotations);return t.userEvent&&(o=o.concat(qB.userEvent.of(t.userEvent))),{changes:t.changes instanceof lB?t.changes:lB.of(t.changes||[],n,e.facet(RB)),selection:r&&(r instanceof mB?r:mB.single(r.anchor,r.head)),effects:KB(t.effects),annotations:o,scrollIntoView:!!t.scrollIntoView}}function YB(e,t,n){let r=GB(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(let o=1;o<t.length;o++){!1===t[o].filter&&(n=!1);let i=!!t[o].sequential;r=$B(r,GB(e,t[o],i?r.changes.newLength:e.doc.length),i)}let o=qB.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(zB),r=e;for(let o=n.length-1;o>=0;o--){let i=n[o](e);i&&Object.keys(i).length&&(r=$B(r,GB(t,i,e.changes.newLength),!0))}return r==e?e:qB.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(jB)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:QB(n,t))}if(!0!==n){let r,o;if(!1===n)o=e.changes.invertedDesc,r=lB.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,o=t.filtered.mapDesc(t.changes).invertedDesc}e=qB.create(t,r,e.selection&&e.selection.map(o),HB.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let r=t.facet(FB);for(let n=r.length-1;n>=0;n--){let o=r[n](e);e=o instanceof qB?o:Array.isArray(o)&&1==o.length&&o[0]instanceof qB?o[0]:YB(t,KB(o),!1)}return e}(o):o)}qB.time=WB.define(),qB.userEvent=WB.define(),qB.addToHistory=WB.define(),qB.remote=WB.define();const XB=[];function KB(e){return null==e?XB:Array.isArray(e)?e:[e]}var ZB=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ZB||(ZB={}));const JB=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let eW;try{eW=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class tW{constructor(e,t,n,r,o,i){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=o,i&&(i._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)NB(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null!=n)return NB(this,n),DB(this,n);if(t)throw new RangeError("Field is not present in this state")}update(...e){return YB(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:o}=n;for(let t of e.effects)t.is(TB.reconfigure)?(n&&(o=new Map,n.compartments.forEach((e,t)=>o.set(t,e)),n=null),o.set(t.value.compartment,t.value.extension)):t.is(HB.reconfigure)?(n=null,r=t.value):t.is(HB.appendConfig)&&(n=null,r=KB(r).concat(t.value));n?t=e.startState.values.slice():(n=MB.resolve(r,o,this),t=new tW(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let i=e.startState.facet(LB)?e.newSelection:e.newSelection.asSingle();new tW(n,e.newDoc,i,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:mB.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),o=[n.range],i=KB(n.effects);for(let n=1;n<t.ranges.length;n++){let a=e(t.ranges[n]),l=this.changes(a.changes),s=l.map(r);for(let e=0;e<n;e++)o[e]=o[e].map(s);let c=r.mapDesc(l,!0);o.push(a.range.map(c)),r=r.compose(s),i=HB.mapEffects(i,s).concat(HB.mapEffects(KB(a.effects),c))}return{changes:r,selection:mB.create(o,t.mainIndex),effects:i}}changes(e=[]){return e instanceof lB?e:lB.of(e,this.doc.length,this.facet(tW.lineSeparator))}toText(e){return Hz.of(e.split(this.facet(tW.lineSeparator)||oB))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(NB(this,t),DB(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof SB&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n)for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let o=n[t],i=e[t];r.push(o.init(e=>o.spec.fromJSON(i,e)))}return tW.create({doc:e.doc,selection:mB.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=MB.resolve(e.extensions||[],new Map),n=e.doc instanceof Hz?e.doc:Hz.of((e.doc||"").split(t.staticFacet(tW.lineSeparator)||oB)),r=e.selection?e.selection instanceof mB?e.selection:mB.single(e.selection.anchor,e.selection.head):mB.single(0);return gB(r,n.length),t.staticFacet(LB)||(r=r.asSingle()),new tW(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(tW.tabSize)}get lineBreak(){return this.facet(tW.lineSeparator)||"\n"}get readOnly(){return this.facet(BB)}phrase(e,...t){for(let t of this.facet(tW.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let o of this.facet(IB))for(let i of o(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&r.push(i[e]);return r}charCategorizer(e){return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return ZB.Space;if(function(e){if(eW)return eW.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||JB.test(n)))return!0}return!1}(e))return ZB.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return ZB.Word;return ZB.Other};var t}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),o=this.charCategorizer(e),i=e-n,a=e-n;for(;i>0;){let e=eB(t,i,!1);if(o(t.slice(e,i))!=ZB.Word)break;i=e}for(;a<r;){let e=eB(t,a);if(o(t.slice(a,e))!=ZB.Word)break;a=e}return i==a?null:mB.range(i+n,a+n)}}function nW(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let o=t[e],i=r[e];if(void 0===i)r[e]=o;else if(i===o||void 0===o);else{if(!Object.hasOwnProperty.call(n,e))throw new Error("Config merge conflict for field "+e);r[e]=n[e](i,o)}}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}tW.allowMultipleSelections=LB,tW.tabSize=yB.define({combine:e=>e.length?e[0]:4}),tW.lineSeparator=RB,tW.readOnly=BB,tW.phrases=yB.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),tW.languageData=IB,tW.changeFilter=jB,tW.transactionFilter=FB,tW.transactionExtender=zB,TB.reconfigure=HB.define();class rW{eq(e){return this==e}range(e,t=e){return oW.create(e,t,this)}}rW.prototype.startSide=rW.prototype.endSide=0,rW.prototype.point=!1,rW.prototype.mapMode=iB.TrackDel;class oW{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new oW(e,t,n)}}function iW(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class aW{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let o=n?this.to:this.from;for(let i=r,a=o.length;;){if(i==a)return i;let r=i+a>>1,l=o[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==i)return l>=0?i:a;l>=0?a=r:i=r+1}}between(e,t,n,r){for(let o=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,o);o<i;o++)if(!1===r(this.from[o]+e,this.to[o]+e,this.value[o]))return!1}map(e,t){let n=[],r=[],o=[],i=-1,a=-1;for(let l=0;l<this.value.length;l++){let s,c,u=this.value[l],d=this.from[l]+e,p=this.to[l]+e;if(d==p){let e=t.mapPos(d,u.startSide,u.mapMode);if(null==e)continue;if(s=c=e,u.startSide!=u.endSide&&(c=t.mapPos(d,u.endSide),c<s))continue}else if(s=t.mapPos(d,u.startSide),c=t.mapPos(p,u.endSide),s>c||s==c&&u.startSide>0&&u.endSide<=0)continue;(c-s||u.endSide-u.startSide)<0||(i<0&&(i=s),u.point&&(a=Math.max(a,c-s)),n.push(u),r.push(s-i),o.push(c-i))}return{mapped:n.length?new aW(r,o,n,a):null,pos:i}}}class lW{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new lW(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:o=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(iW)),this.isEmpty)return t.length?lW.of(t):this;let a=new uW(this,null,-1).goto(0),l=0,s=[],c=new sW;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let e=t[l++];c.addInner(e.from,e.to,e.value)||s.push(e)}else 1==a.rangeIndex&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!i||r>this.chunkEnd(a.chunkIndex)||o<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!i||r>a.to||o<a.from||i(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||s.push(oW.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!s.length?lW.empty:this.nextLayer.update({add:s,filter:i,filterFrom:r,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let i=this.chunkPos[o],a=this.chunk[o],l=e.touchesRange(i,i+a.length);if(!1===l)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(i));else if(!0===l){let{mapped:o,pos:l}=a.map(i,e);o&&(r=Math.max(r,o.maxPoint),t.push(o),n.push(l))}}let o=this.nextLayer.map(e);return 0==t.length?o:new lW(n,t,o||lW.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],i=this.chunk[r];if(t>=o&&e<=o+i.length&&!1===i.between(o,e-o,t-o,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return dW.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return dW.from(e).goto(t)}static compare(e,t,n,r,o=-1){let i=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=o),a=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=o),l=cW(i,a,n),s=new hW(i,l,o),c=new hW(a,l,o);n.iterGaps((e,t,n)=>fW(s,e,c,t,n,r)),n.empty&&0==n.length&&fW(s,0,c,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=999999999);let o=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),i=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(o.length!=i.length)return!1;if(!o.length)return!0;let a=cW(o,i),l=new hW(o,a,0).goto(n),s=new hW(i,a,0).goto(n);for(;;){if(l.to!=s.to||!mW(l.active,s.active)||l.point&&(!s.point||!l.point.eq(s.point)))return!1;if(l.to>r)return!0;l.next(),s.next()}}static spans(e,t,n,r,o=-1){let i=new hW(e,null,o).goto(t),a=t,l=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),o=i.pointFrom<t?n.length+1:i.point.startSide<0?n.length:Math.min(n.length,l);r.point(a,e,i.point,n,o,i.pointRank),l=Math.min(i.openEnd(e),n.length)}else e>a&&(r.span(a,e,i.active,l),l=i.openEnd(e));if(i.to>n)return l+(i.point&&i.to>n?1:0);a=i.to,i.next()}}static of(e,t=!1){let n=new sW;for(let r of e instanceof oW?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(iW(t,r)>0)return e.slice().sort(iW);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return lW.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=lW.empty;r=r.nextLayer)t=new lW(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}lW.empty=new lW([],[],null,-1),lW.empty.nextLayer=lW.empty;class sW{finishChunk(e){this.chunks.push(new aW(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new sW)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(lW.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=lW.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function cW(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let o=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let i=r.get(e.chunk[t]);null==i||(n?n.mapPos(i):i)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(i,i+e.chunk[t].length))||o.add(e.chunk[t])}return o}class uW{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class dW{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let o=0;o<e.length;o++)for(let i=e[o];!i.isEmpty;i=i.nextLayer)i.maxPoint>=n&&r.push(new uW(i,t,n,o));return 1==r.length?r[0]:new dW(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)pW(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)pW(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),pW(this.heap,0)}}}function pW(e,t){for(let n=e[t];;){let r=1+(t<<1);if(r>=e.length)break;let o=e[r];if(r+1<e.length&&o.compare(e[r+1])>=0&&(o=e[r+1],r++),n.compare(o)<0)break;e[r]=n,e[t]=o,t=r}}class hW{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=dW.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){gW(this.active,e),gW(this.activeTo,e),gW(this.activeRank,e),this.minActive=yW(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:o}=this.cursor;for(;t<this.activeRank.length&&(o-this.activeRank[t]||r-this.activeTo[t])>0;)t++;vW(this.active,t,n),vW(this.activeTo,t,r),vW(this.activeRank,t,o),e&&vW(e,t,this.cursor.from),this.minActive=yW(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&gW(n,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function fW(e,t,n,r,o,i){e.goto(t),n.goto(r);let a=r+o,l=r,s=r-t;for(;;){let t=e.to+s-n.to,r=t||e.endSide-n.endSide,o=r<0?e.to+s:n.to,c=Math.min(o,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&mW(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(l,c,e.point,n.point):c>l&&!mW(e.active,n.active)&&i.compareRange(l,c,e.active,n.active),o>a)break;(t||e.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(o),l=o,r<=0&&e.next(),r>=0&&n.next()}}function mW(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function gW(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function vW(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function yW(e,t){let n=-1,r=1e9;for(let o=0;o<t.length;o++)(t[o]-r||e[o].endSide-e[n].endSide)<0&&(n=o,r=t[o]);return n}function bW(e,t,n=e.length){let r=0;for(let o=0;o<n&&o<e.length;)9==e.charCodeAt(o)?(r+=t-r%t,o++):(r++,o=eB(e,o));return r}function wW(e,t,n,r){for(let r=0,o=0;;){if(o>=t)return r;if(r==e.length)break;o+=9==e.charCodeAt(r)?n-o%n:1,r=eB(e,r)}return!0===r?-1:e.length}const kW="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),EW="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),OW="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class xW{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function o(e,t,i,a){let l=[],s=/^@(\w+)\b/.exec(e[0]),c=s&&"keyframes"==s[1];if(s&&null==t)return i.push(e[0]+";");for(let n in t){let a=t[n];if(/&/.test(n))o(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),a,i);else if(a&&"object"==typeof a){if(!s)throw new RangeError("The value of a property ("+n+") should be a primitive value.");o(r(n),a,l,c)}else null!=a&&l.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+a+";")}(l.length||c)&&i.push((!n||s||a?e:e.map(n)).join(", ")+" {"+l.join(" ")+"}")}for(let t in e)o(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=OW[kW]||1;return OW[kW]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[EW],o=n&&n.nonce;r?o&&r.setNonce(o):r=new _W(e,o),r.mount(Array.isArray(t)?t:[t],e)}}let SW=new Map;class _W{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=SW.get(n);if(t)return e[EW]=t;this.sheet=new r.CSSStyleSheet,SW.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[EW]=this}mount(e,t){let n=this.sheet,r=0,o=0;for(let t=0;t<e.length;t++){let i=e[t],a=this.modules.indexOf(i);if(a<o&&a>-1&&(this.modules.splice(a,1),o--,a=-1),-1==a){if(this.modules.splice(o++,0,i),n)for(let e=0;e<i.rules.length;e++)n.insertRule(i.rules[e],r++)}else{for(;o<a;)r+=this.modules[o++].rules.length;r+=i.rules.length,o++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var CW={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},PW={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},TW="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),AW="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),MW=0;MW<10;MW++)CW[48+MW]=CW[96+MW]=String(MW);for(MW=1;MW<=24;MW++)CW[MW+111]="F"+MW;for(MW=65;MW<=90;MW++)CW[MW]=String.fromCharCode(MW+32),PW[MW]=String.fromCharCode(MW);for(var NW in CW)PW.hasOwnProperty(NW)||(PW[NW]=CW[NW]);let DW="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},IW="undefined"!=typeof document?document:{documentElement:{style:{}}};const LW=/Edge\/(\d+)/.exec(DW.userAgent),RW=/MSIE \d/.test(DW.userAgent),jW=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(DW.userAgent),FW=!!(RW||jW||LW),zW=!FW&&/gecko\/(\d+)/i.test(DW.userAgent),BW=!FW&&/Chrome\/(\d+)/.exec(DW.userAgent),WW="webkitFontSmoothing"in IW.documentElement.style,UW=!FW&&/Apple Computer/.test(DW.vendor),VW=UW&&(/Mobile\/\w+/.test(DW.userAgent)||DW.maxTouchPoints>2);var HW={mac:VW||/Mac/.test(DW.platform),windows:/Win/.test(DW.platform),linux:/Linux|X11/.test(DW.platform),ie:FW,ie_version:RW?IW.documentMode||6:jW?+jW[1]:LW?+LW[1]:0,gecko:zW,gecko_version:zW?+(/Firefox\/(\d+)/.exec(DW.userAgent)||[0,0])[1]:0,chrome:!!BW,chrome_version:BW?+BW[1]:0,ios:VW,android:/Android\b/.test(DW.userAgent),webkit:WW,webkit_version:WW?+(/\bAppleWebKit\/(\d+)/.exec(DW.userAgent)||[0,0])[1]:0,safari:UW,safari_version:UW?+(/\bVersion\/(\d+(\.\d+)?)/.exec(DW.userAgent)||[0,0])[1]:0,tabSize:null!=IW.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function qW(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const QW=Object.create(null);function $W(e,t,n){if(e==t)return!0;e||(e=QW),t||(t=QW);let r=Object.keys(e),o=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=o.length-(n&&o.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(-1==o.indexOf(i)||e[i]!==t[i]))return!1;return!0}function GW(e,t,n){let r=!1;if(t)for(let o in t)n&&o in n||(r=!0,"style"==o?e.style.cssText="":e.removeAttribute(o));if(n)for(let o in n)t&&t[o]==n[o]||(r=!0,"style"==o?e.style.cssText=n[o]:e.setAttribute(o,n[o]));return r}function YW(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class XW{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var KW=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(KW||(KW={}));class ZW extends rW{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new JW(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new tU(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,r=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:o,end:i}=nU(e,r);t=(o?r?-3e8:-1:5e8)-1,n=1+(i?r?2e8:1:-6e8)}return new tU(e,t,n,r,e.widget||null,!0)}static line(e){return new eU(e)}static set(e,t=!1){return lW.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}ZW.none=lW.empty;class JW extends ZW{constructor(e){let{start:t,end:n}=nU(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?qW(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||QW}eq(e){return this==e||e instanceof JW&&this.tagName==e.tagName&&$W(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}JW.prototype.point=!1;class eU extends ZW{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof eU&&this.spec.class==e.spec.class&&$W(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}eU.prototype.mapMode=iB.TrackBefore,eU.prototype.point=!0;class tU extends ZW{constructor(e,t,n,r,o,i){super(t,n,o,e),this.block=r,this.isReplace=i,this.mapMode=r?t<=0?iB.TrackBefore:iB.TrackAfter:iB.TrackDel}get type(){return this.startSide!=this.endSide?KW.WidgetRange:this.startSide<=0?KW.WidgetBefore:KW.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof tU&&(t=this.widget,n=e.widget,t==n||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function nU(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function rU(e,t,n,r=0){let o=n.length-1;o>=0&&n[o]+r>=e?n[o]=Math.max(n[o],t):n.push(e,t)}tU.prototype.point=!0;class oU extends rW{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof oU&&this.tagName==e.tagName&&$W(this.attributes,e.attributes)}static create(e){return new oU(e.tagName,e.attributes||QW)}static set(e,t=!1){return lW.of(e,t)}}function iU(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function aU(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function lU(e,t){if(!t.anchorNode)return!1;try{return aU(e,t.anchorNode)}catch(e){return!1}}function sU(e){return 3==e.nodeType?kU(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function cU(e,t,n,r){return!!n&&(pU(e,t,n,r,-1)||pU(e,t,n,r,1))}function uU(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function dU(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function pU(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:hU(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=uU(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(o<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=o<0?hU(e):0}}}function hU(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function fU(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function mU(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function gU(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}oU.prototype.startSide=oU.prototype.endSide=-1;class vU{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?hU(t):0),n,Math.min(e.focusOffset,n?hU(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let yU,bU=null;function wU(e){if(e.setActive)return e.setActive();if(bU)return e.focus(bU);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==bU?{get preventScroll(){return bU={preventScroll:!0},!0}}:void 0),!bU){bU=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],o=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=o&&(n.scrollLeft=o)}}}function kU(e,t,n=t){let r=yU||(yU=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function EU(e,t,n,r){let o={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=r);let i=new KeyboardEvent("keydown",o);i.synthetic=!0,e.dispatchEvent(i);let a=new KeyboardEvent("keyup",o);return a.synthetic=!0,e.dispatchEvent(a),i.defaultPrevented||a.defaultPrevented}function OU(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function xU(e,t){for(let n=e,r=t;;){if(3==n.nodeType&&r>0)return{node:n,offset:r};if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;n=n.childNodes[r-1],r=hU(n)}else{if(!n.parentNode||dU(n))return null;r=uU(n),n=n.parentNode}}}function SU(e,t){for(let n=e,r=t;;){if(3==n.nodeType&&r<n.nodeValue.length)return{node:n,offset:r};if(1==n.nodeType&&r<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[r],r=0}else{if(!n.parentNode||dU(n))return null;r=uU(n)+1,n=n.parentNode}}}HW.safari&&HW.safari_version>=26&&(bU=!1);class _U{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new _U(e.parentNode,uU(e),t)}static after(e,t){return new _U(e.parentNode,uU(e)+1,t)}}var CU=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(CU||(CU={}));const PU=CU.LTR,TU=CU.RTL;function AU(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const MU=AU("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),NU=AU("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),DU=Object.create(null),IU=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);DU[t]=n,DU[n]=-t}function LU(e){return e<=247?MU[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?NU[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const RU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class jU{get dir(){return this.level%2?TU:PU}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let o=-1;for(let i=0;i<e.length;i++){let a=e[i];if(a.from<=t&&a.to>=t){if(a.level==n)return i;(o<0||(0!=r?r<0?a.from<t:a.to>t:e[o].level>a.level))&&(o=i)}}if(o<0)throw new RangeError("Index out of range");return o}}function FU(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!FU(r.inner,o.inner))return!1}return!0}const zU=[];function BU(e,t,n,r,o,i,a){let l=r%2?2:1;if(r%2==o%2)for(let s=t,c=0;s<n;){let t=!0,u=!1;if(c==i.length||s<i[c].from){let e=zU[s];e!=l&&(t=!1,u=16==e)}let d=t||1!=l?null:[],p=t?r:r+1,h=s;e:for(;;)if(c<i.length&&h==i[c].from){if(u)break e;let f=i[c];if(!t)for(let e=f.to,t=c+1;;){if(e==n)break e;if(!(t<i.length&&i[t].from==e)){if(zU[e]==l)break e;break}e=i[t++].to}c++,d?d.push(f):(f.from>s&&a.push(new jU(s,f.from,p)),WU(e,f.direction==PU!=!(p%2)?r+1:r,o,f.inner,f.from,f.to,a),s=f.to),h=f.to}else{if(h==n||(t?zU[h]!=l:zU[h]==l))break;h++}d?BU(e,s,h,r+1,o,d,a):s<h&&a.push(new jU(s,h,p)),s=h}else for(let s=n,c=i.length;s>t;){let n=!0,u=!1;if(!c||s>i[c-1].to){let e=zU[s-1];e!=l&&(n=!1,u=16==e)}let d=n||1!=l?null:[],p=n?r:r+1,h=s;e:for(;;)if(c&&h==i[c-1].to){if(u)break e;let f=i[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(zU[e-1]==l)break e;break}e=i[--n].from}d?d.push(f):(f.to<s&&a.push(new jU(f.to,s,p)),WU(e,f.direction==PU!=!(p%2)?r+1:r,o,f.inner,f.from,f.to,a),s=f.from),h=f.from}else{if(h==t||(n?zU[h-1]!=l:zU[h-1]==l))break;h--}d?BU(e,h,s,r+1,o,d,a):h<s&&a.push(new jU(h,s,p)),s=h}}function WU(e,t,n,r,o,i,a){let l=t%2?2:1;!function(e,t,n,r,o){for(let i=0;i<=r.length;i++){let a=i?r[i-1].to:t,l=i<r.length?r[i].from:n,s=i?256:o;for(let t=a,n=s,r=s;t<l;t++){let o=LU(e.charCodeAt(t));512==o?o=n:8==o&&4==r&&(o=16),zU[t]=4==o?2:o,7&o&&(r=o),n=o}for(let e=a,t=s,r=s;e<l;e++){let o=zU[e];if(128==o)e<l-1&&t==zU[e+1]&&24&t?o=zU[e]=t:zU[e]=256;else if(64==o){let o=e+1;for(;o<l&&64==zU[o];)o++;let i=e&&8==t||o<n&&8==zU[o]?1==r?1:8:256;for(let t=e;t<o;t++)zU[t]=i;e=o-1}else 8==o&&1==r&&(zU[e]=1);t=o,7&o&&(r=o)}}}(e,o,i,r,l),function(e,t,n,r,o){let i=1==o?2:1;for(let a=0,l=0,s=0;a<=r.length;a++){let c=a?r[a-1].to:t,u=a<r.length?r[a].from:n;for(let t,n,r,a=c;a<u;a++)if(n=DU[t=e.charCodeAt(a)])if(n<0){for(let e=l-3;e>=0;e-=3)if(IU[e+1]==-n){let t=IU[e+2],n=2&t?o:4&t?1&t?i:o:0;n&&(zU[a]=zU[IU[e]]=n),l=e;break}}else{if(189==IU.length)break;IU[l++]=a,IU[l++]=t,IU[l++]=s}else if(2==(r=zU[a])||1==r){let e=r==o;s=e?0:1;for(let t=l-3;t>=0;t-=3){let n=IU[t+2];if(2&n)break;if(e)IU[t+2]|=2;else{if(4&n)break;IU[t+2]|=4}}}}}(e,o,i,r,l),function(e,t,n,r){for(let o=0,i=r;o<=n.length;o++){let a=o?n[o-1].to:e,l=o<n.length?n[o].from:t;for(let s=a;s<l;){let a=zU[s];if(256==a){let a=s+1;for(;;)if(a==l){if(o==n.length)break;a=n[o++].to,l=o<n.length?n[o].from:t}else{if(256!=zU[a])break;a++}let c=1==i,u=c==(1==(a<t?zU[a]:r))?c?1:2:r;for(let t=a,r=o,i=r?n[r-1].to:e;t>s;)t==i&&(t=n[--r].from,i=r?n[r-1].to:e),zU[--t]=u;s=a}else i=a,s++}}}(o,i,r,l),BU(e,o,i,t,n,r,a)}function UU(e){return[new jU(0,e,0)]}let VU="";function HU(e,t,n,r,o){var i;let a=r.head-e.from,l=jU.find(t,a,null!==(i=r.bidiLevel)&&void 0!==i?i:-1,r.assoc),s=t[l],c=s.side(o,n);if(a==c){let e=l+=o?1:-1;if(e<0||e>=t.length)return null;s=t[l=e],a=s.side(!o,n),c=s.side(o,n)}let u=eB(e.text,a,s.forward(o,n));(u<s.from||u>s.to)&&(u=c),VU=e.text.slice(Math.min(a,u),Math.max(a,u));let d=l==(o?t.length-1:0)?null:t[l+(o?1:-1)];return d&&u==c&&d.level+(o?0:1)<s.level?mB.cursor(d.side(!o,n)+e.from,d.forward(o,n)?1:-1,d.level):mB.cursor(u+e.from,s.forward(o,n)?-1:1,s.level)}function qU(e,t,n){for(let r=t;r<n;r++){let t=LU(e.charCodeAt(r));if(1==t)return PU;if(2==t||4==t)return TU}return PU}const QU=yB.define(),$U=yB.define(),GU=yB.define(),YU=yB.define(),XU=yB.define(),KU=yB.define(),ZU=yB.define(),JU=yB.define(),eV=yB.define(),tV=yB.define({combine:e=>e.some(e=>e)}),nV=yB.define({combine:e=>e.some(e=>e)}),rV=yB.define();class oV{constructor(e,t="nearest",n="nearest",r=5,o=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=o,this.isSnapshot=i}map(e){return e.empty?this:new oV(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new oV(mB.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const iV=HB.define({map:(e,t)=>e.map(t)}),aV=HB.define();function lV(e,t,n){let r=e.facet(YU);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const sV=yB.define({combine:e=>!e.length||e[0]});let cV=0;const uV=yB.define({combine:e=>e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})});class dV{constructor(e,t,n,r,o){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(uV.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(uV.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:o,decorations:i}=t||{};return new dV(cV++,e,n,r,e=>{let t=[];return i&&t.push(mV.of(t=>{let n=t.plugin(e);return n?i(n):ZW.none})),o&&t.push(o(e)),t})}static fromClass(e,t){return dV.define((t,n)=>new e(t,n),t)}}class pV{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(lV(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){lV(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){lV(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const hV=yB.define(),fV=yB.define(),mV=yB.define(),gV=yB.define(),vV=yB.define(),yV=yB.define(),bV=yB.define();function wV(e,t){let n=e.state.facet(bV);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),o=[];return lW.spans(r,t.from,t.to,{point(){},span(e,n,r,i){let a=e-t.from,l=n-t.from,s=o;for(let e=r.length-1;e>=0;e--,i--){let n,o=r[e].spec.bidiIsolate;if(null==o&&(o=qU(t.text,a,l)),i>0&&s.length&&(n=s[s.length-1]).to==a&&n.direction==o)n.to=l,s=n.inner;else{let e={from:a,to:l,direction:o,inner:[]};s.push(e),s=e.inner}}}}),o}const kV=yB.define();function EV(e){let t=0,n=0,r=0,o=0;for(let i of e.state.facet(kV)){let a=i(e);a&&(null!=a.left&&(t=Math.max(t,a.left)),null!=a.right&&(n=Math.max(n,a.right)),null!=a.top&&(r=Math.max(r,a.top)),null!=a.bottom&&(o=Math.max(o,a.bottom)))}return{left:t,right:n,top:r,bottom:o}}const OV=yB.define();class xV{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new xV(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let r=0,o=0,i=0;;){let a=r<e.length?e[r].fromB:1e9,l=o<t.length?t[o]:1e9,s=Math.min(a,l);if(1e9==s)break;let c=s+i,u=s,d=c;for(;;)if(o<t.length&&t[o]<=u){let n=t[o+1];o+=2,u=Math.max(u,n);for(let t=r;t<e.length&&e[t].fromB<=u;t++)i=e[t].toA-e[t].toB;d=Math.max(d,n+i)}else{if(!(r<e.length&&e[r].fromB<=u))break;{let t=e[r++];u=Math.max(u,t.toB),d=Math.max(d,t.toA),i=t.toA-t.toB}}n.push(new xV(c,d,s,u))}return n}}class SV{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=lB.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,o)=>r.push(new xV(e,t,n,o))),this.changedRanges=r}static create(e,t,n){return new SV(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}const _V=[];class CV{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return _V}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;null==t[r]&&e.removeAttribute(r)}for(let n in t){let r=t[n];"style"==n?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=uU(this.dom),r=this.length?e>0:t>0;return new _U(this.parent.dom,n+(r?1:0),0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof AV)return e;return null}static get(e){return e.cmTile}}class PV extends CV{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t,n=this.dom,r=null,o=(null==e?void 0:e.node)==n?e:null,i=0;for(let a of this.children){if(a.sync(e),i+=a.length+a.breakAfter,t=r?r.nextSibling:n.firstChild,o&&t!=a.dom&&(o.written=!0),a.dom.parentNode==n)for(;t&&t!=a.dom;)t=TV(t);else n.insertBefore(a.dom,t);r=a.dom}for(t=r?r.nextSibling:n.firstChild,o&&t&&(o.written=!0);t;)t=TV(t);this.length=i}}function TV(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class AV extends PV{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=CV.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,o=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&o++,r=t.pop()}else{let i=n.children[r++];if(i instanceof MV)t.push(r),n=i,r=0;else{let t=o+i.length,n=e(i,o);if(void 0!==n)return n;o=t+i.breakAfter}}}resolveBlock(e,t){let n,r,o=-1,i=-1;if(this.blockTiles((a,l)=>{let s=l+a.length;if(e>=l&&e<=s){if(a.isWidget()&&t>=-1&&t<=1){if(32&a.flags)return!0;16&a.flags&&(n=void 0)}(l<e||e==s&&(t<-1?a.length:a.covers(1)))&&(!n||!a.isWidget()&&n.isWidget())&&(n=a,o=e-l),(s>e||e==l&&(t>1?a.length:a.covers(-1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,i=e-l)}}),!n&&!r)throw new Error("No tile at position "+e);return n&&t<0||!r?{tile:n,offset:o}:{tile:r,offset:i}}}class MV extends PV{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new MV(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class NV extends PV{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new NV(t||document.createElement("div"),e);return t&&n||(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,o=-1,i=null,a=-1;!function e(l,s){for(let c=0,u=0;c<l.children.length&&u<=s;c++){let d=l.children[c],p=u+d.length;p>=s&&(d.isComposite()?e(d,s-u):(!i||i.isHidden&&(t>0||n&&DV(i,d)))&&(p>s||32&d.flags)?(i=d,a=s-u):(u<s||16&d.flags&&!d.isHidden)&&(r=d,o=s-u)),u=p}}(this,e);let l=(t<0?r:i)||r||i;return l?{tile:l,offset:l==r?o:a}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=sU(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new _U(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,t);let o=n.tile.parent,i=!1;for(let e of o.children){if(i)return new _U(e.dom,0);e==n.tile&&(i=!0)}}return new _U(this.dom,0)}}function DV(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class IV extends PV{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new IV(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class LV extends CV{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,o=e,i=0;0==e&&t<0||e==n&&t>=0?HW.chrome||HW.gecko||(e?(r--,i=1):o<n&&(o++,i=-1)):t<0?r--:o<n&&o++;let a=kU(this.dom,r,o).getClientRects();if(!a.length)return null;let l=a[(i?i<0:t>=0)?0:a.length-1];return HW.safari&&!i&&0==l.width&&(l=Array.prototype.find.call(a,e=>e.width)||l),i?fU(l,i<0):l||null}static of(e,t){let n=new LV(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class RV extends CV{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return fU(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let o=r?t.length-1:0;n=t[o],!(e>0?0==o:o==t.length-1||n.top<n.bottom);o+=r?-1:1);return fU(n,!r)}}get overrideDOMText(){if(!this.length)return Hz.empty;let{root:e}=this;if(!e)return Hz.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,r,o){return o||(o=e.toDOM(t),e.editable||(o.contentEditable="false")),new RV(o,n,e,r)}}class jV extends CV{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!1}get overrideDOMText(){return Hz.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class FV{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:o,beforeBreak:i,parents:a}=this;for(;e||t>0;)if(r.isComposite())if(i){if(!e)break;n&&n.break(),e--,i=!1}else if(o==r.children.length){if(!e&&!a.length)break;n&&n.leave(r),i=!!r.breakAfter,({tile:r,index:o}=a.pop()),o++}else{let l=r.children[o],s=l.breakAfter;!(t>0?l.length<=e:l.length<e)||n&&!1===n.skip(l,0,l.length)&&l.isComposite?(a.push({tile:r,index:o}),r=l,o=0,n&&l.isComposite()&&n.enter(l)):(i=!!s,o++,e-=l.length)}else if(o==r.length)i=!!r.breakAfter,({tile:r,index:o}=a.pop()),o++;else{if(!e)break;{let t=Math.min(e,r.length-o);n&&n.skip(r,o,o+t),e-=t,o+=t}}return this.tile=r,this.index=o,this.beforeBreak=i,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class zV{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class BV{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){var o;this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;!a||!a.isText()||8&a.flags?i.append(r||LV.of(e,null===(o=this.cache.find(LV))||void 0===o?void 0:o.dom)):(this.cache.reused.set(a,2),(i.children[i.children.length-1]=new LV(a.dom,a.text+e)).parent=i),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?$V(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],o=r.lastChild;if(o instanceof IV&&o.mark.eq(n.mark))o.dom!=n.dom&&o.setDOM($V(n.dom)),r=o;else{if(this.cache.reused.get(n)){let e=CV.get(n.dom);e&&e.setDOM($V(n.dom))}let e=IV.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let o=new LV(e.text,e.text.nodeValue);o.flags|=8,r.append(o)}addInlineWidget(e,t,n){let r=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);r||this.flushBuffer();let o=this.ensureMarks(t,n);r||16&e.flags||o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){(this.afterWidget||this.lastBlock).length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=QV);let r=NV.start(e,t||(null===(n=this.cache.find(NV))||void 0===n?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let r=this.curLine;for(let o=e.length-1;o>=0;o--){let i,a=e[o];if(t>0&&(i=r.lastChild)&&i instanceof IV&&i.mark.eq(a))r=i,t--;else{let e=IV.of(a,null===(n=this.cache.find(IV,e=>e.mark.eq(a)))||void 0===n?void 0:n.dom);r.append(e),r=e,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;e&&qV(this.curLine,!1)&&("BR"==e.dom.nodeName||!e.isWidget()||HW.ios&&qV(this.curLine,!0))||this.curLine.append(this.cache.findWidget(YV,0,32)||new RV(YV.toDOM(),0,YV,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new zV(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof MV&&r.wrapper.eq(n.wrapper))t=r;else{let r=MV.of(n.wrapper,null===(e=this.cache.find(MV,e=>e.wrapper.eq(n.wrapper)))||void 0===e?void 0:e.dom);t.append(r),t=r}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(jV,void 0,1);return n&&(n.flags=t),n||new jV(t)}flushBuffer(){!this.afterWidget||32&this.afterWidget.flags||(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class WV{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw new Error("Ran out of text content when drawing inline views");this.text=t;let o=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,o)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}const UV=[RV,NV,LV,IV,jV,MV,AV];for(let e=0;e<UV.length;e++)UV[e].bucket=e;class VV{constructor(e){this.view=e,this.buckets=UV.map(()=>[]),this.index=UV.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,o=this.buckets[r],i=this.index[r];for(let e=o.length-1;e>=0;e--){let a=(e+i)%o.length,l=o[a];if((!t||t(l))&&!this.reused.has(l))return o.splice(a,1),a<i&&this.index[r]--,this.reused.set(l,n),l}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let o=0,i=0;;o++){if(o==r.length){if(i)return null;i=1,o=0}let a=r[o];if(!this.reused.has(a)&&(0==i?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view)))return r.splice(o,1),o<this.index[0]&&this.index[0]--,this.reused.set(a,1),a.length=t,a.flags=-498&a.flags|n,a}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}}class HV{constructor(e,t,n,r,o){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new VV(e),this.text=new WV(e.state.doc),this.builder=new BV(this.cache,new AV(e,e.contentDOM),lW.iter(n)),this.cache.reused.set(t,2),this.old=new FV(t)}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,o=0,i=0;;){let a=i<e.length?e[i++]:null,l=a?a.fromA:this.old.root.length;if(l>r){let e=l-r;this.preserve(e,!i,!a),r=l,o+=e}if(!a)break;this.forward(a.fromA,a.toA),t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.emit(o,t.range.fromB),this.builder.addComposition(t,n),this.emit(t.range.toB,a.toB)):this.emit(o,a.toB),o=a.toB,r=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof IV&&t.push(r.mark)}return t}(this.old),o=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let i=n>0||t<e.length?RV.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&i.flags?(i.flags&=-2,this.builder.addBlockWidget(i)):(this.builder.addInlineWidget(i,r,o),o=r.length)}else if(e.isText())t||n!=e.length?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,o)):this.builder.addText(e.text,r,o,this.cache.reuse(e)),o=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof jV)this.cache.add(e);else{if(!(e instanceof IV))return!1;this.builder.addMark(e,r,o),this.cache.reused.set(e,1),o=r.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof IV&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&(r.length=o=0):e instanceof IV&&(r.shift(),o=Math.min(o,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,o=0,i=lW.spans(this.decorations,e,t,{point:(e,t,i,a,l,s)=>{if(i instanceof tU){if(this.disallowBlockEffectsFor[s]){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=a.length,l>a.length)r.continueWidget(t-e);else{let o=i.widget||(i.block?GV.block:GV.inline),s=function(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}(i),c=this.cache.findWidget(o,t-e,s)||RV.of(o,this.view,t-e,s);i.block?(i.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(c)):(r.ensureLine(n),r.addInlineWidget(c,a,l))}n=null}else n=function(e,t){let n=t.spec.attributes,r=t.spec.class;return n||r?(e||(e={class:"cm-line"}),n&&qW(n,e),r&&(e.class+=" "+r),e):e}(n,i);t>e&&this.text.skip(t-e)},span:(e,t,o,i)=>{for(let a=e;a<t;){let e=this.text.next(Math.min(512,t-a));null==e?(r.addLineStartIfNotCovered(n),r.addBreak(),a++):(r.ensureLine(n),r.addText(e,o,i),a+=e.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=i>o,this.openMarks=i}forward(e,t){this.old.advance(t-e,1,{skip:(e,t,n)=>{(e.isText()||n==e.length)&&this.cache.add(e)},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}})}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=CV.get(r);if(r==this.view.contentDOM)break;e instanceof IV?t.push(e):(null==e?void 0:e.isLine())?n=e:"DIV"!=r.nodeName||n||r==this.view.contentDOM?t.push(IV.of(new JW({tagName:r.nodeName.toLowerCase(),attributes:YW(r)}),r)):n=new NV(r,QV)}return{line:n,marks:t}}}function qV(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}const QV={class:"cm-line"};function $V(e){let t=CV.get(e);return t&&t.setDOM(e.cloneNode()),e}class GV extends XW{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}GV.inline=new GV("span"),GV.block=new GV("div");const YV=new class extends XW{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class XV{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ZW.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new AV(e,e.contentDOM),this.updateInner([new xV(0,0,0,e.state.doc.length)],null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?r=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}(e.changes,this.hasComposition)||e.selectionSet||(r=e.state.selection.main.head));let o=r>-1?function(e,t,n){let r=ZV(e,n);if(!r)return null;let{node:o,from:i,to:a}=r,l=o.nodeValue;if(/[\n\r]/.test(l))return null;if(e.state.doc.sliceString(r.from,r.to)!=l)return null;let s=t.invertedDesc;return{range:new xV(s.mapPos(i),s.mapPos(a),i,a),text:o}}(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:r}=this.hasComposition;n=new xV(t,r,e.changes.mapPos(t,-1),e.changes.mapPos(r,1)).addToSet(n.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(HW.ie||HW.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let l=function(e,t,n){let r=new JV;return lW.compare(e,t,n,r),r.changes}(i,this.decorations,e.changes);l.length&&(n=xV.extendWithRanges(n,l));let s=function(e,t,n){let r=new eH;return lW.compare(e,t,n,r),r.changes}(a,this.blockWrappers,e.changes);return s.length&&(n=xV.extendWithRanges(n,s)),o&&!n.some(e=>e.fromA<=o.range.fromA&&e.toA>=o.range.toA)&&(n=o.range.addToSet(n.slice())),!(2&this.tile.flags&&0==n.length||(this.updateInner(n,o),e.transactions.length&&(this.lastUpdate=Date.now()),0))}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new HV(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=r.run(e,t),KV(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=HW.chrome||HW.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),!r||!r.written&&n.selectionRange.focusNode==r.node&&this.tile.dom.contains(r.node)||(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof tH&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(aV)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,o=r==n,i=!o&&!(this.view.state.facet(sV)||n.tabIndex>-1)&&lU(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(o||t||i))return;let a=this.forceSelection;this.forceSelection=!1;let l,s,c=this.view.state.selection.main;if(c.empty?s=l=this.inlineDOMNearPos(c.anchor,c.assoc||1):(s=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),l=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),HW.gecko&&c.empty&&!this.hasComposition&&1==(u=l).node.nodeType&&u.node.firstChild&&(0==u.offset||"false"==u.node.childNodes[u.offset-1].contentEditable)&&(u.offset==u.node.childNodes.length||"false"==u.node.childNodes[u.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(e,l.node.childNodes[l.offset]||null)),l=s=new _U(e,0),a=!0}var u;let d=this.view.observer.selectionRange;!a&&d.focusNode&&(cU(l.node,l.offset,d.anchorNode,d.anchorOffset)&&cU(s.node,s.offset,d.focusNode,d.focusOffset)||this.suppressWidgetCursorChange(d,c))||(this.view.observer.ignore(()=>{HW.android&&HW.chrome&&n.contains(d.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(d.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=iU(this.view.root);if(e)if(c.empty){if(HW.gecko){let e=function(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(t<e.childNodes.length&&"false"==e.childNodes[t].contentEditable?2:0)}(l.node,l.offset);if(e&&3!=e){let t=(1==e?xU:SU)(l.node,l.offset);t&&(l=new _U(t.node,t.offset))}}e.collapse(l.node,l.offset),null!=c.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=c.bidiLevel)}else if(e.extend){e.collapse(l.node,l.offset);try{e.extend(s.node,s.offset)}catch(e){}}else{let t=document.createRange();c.anchor>c.head&&([l,s]=[s,l]),t.setEnd(s.node,s.offset),t.setStart(l.node,l.offset),e.removeAllRanges(),e.addRange(t)}i&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,s)),this.impreciseAnchor=l.precise?null:new _U(d.anchorNode,d.anchorOffset),this.impreciseHead=s.precise?null:new _U(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&cU(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=iU(e.root),{anchorNode:r,anchorOffset:o}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=this.lineAt(t.head);if(!i)return;let a=i.posAtStart;if(t.head==a||t.head==a+i.length)return;let l=this.coordsAt(t.head,-1),s=this.coordsAt(t.head,1);if(!l||!s||l.bottom>s.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,o)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let r=n.posAtStart;if(!n.isComposite())return n.isText()?e==n.dom?r+t:r+(t?n.length:0):r;{let o;if(e==n.dom)o=n.dom.childNodes[t];else{let r=0==hU(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==r&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}o=r<0?e:e.nextSibling}if(o==n.dom.firstChild)return r;for(;o&&!CV.get(o);)o=o.nextSibling;if(!o)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==o)return t;t+=r.length+r.breakAfter}}}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r,o=-1,i=!1,a=-1,l=!1;return this.tile.blockTiles((t,s)=>{if(t.isWidget()){if(32&t.flags&&n)return!0;16&t.flags&&(i=!0)}else{let c=s+t.length;if(s<=e&&(n=t,o=e-s,i=c<e),c>=e&&!r&&(r=t,a=e-s,l=s>e),s>e&&r)return!0}}),n||r?(i&&r?n=null:l&&n&&(r=null),n&&t<0||!r?n.domIn(o,t):r.domIn(a,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof tH?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return t.isLine()?t:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let r of t.children){if(r.length>=n){let t=e(r,n);if(t)return t}if((n-=r.length)<0)break}else if(t.isText()&&n<t.length){let e=eB(t.text,n);if(e==n)return null;let r=kU(t.dom,n,e).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,o=this.view.contentDOM.clientWidth,i=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==CU.LTR,s=0,c=(e,u,d)=>{for(let p=0;p<e.children.length&&!(u>r);p++){let r=e.children[p],h=u+r.length,f=r.dom.getBoundingClientRect(),{height:m}=f;if(d&&!p&&(s+=f.top-d.top),r instanceof MV)h>n&&c(r,u,f);else if(u>=n&&(s>0&&t.push(-s),t.push(m+s),s=0,i)){let e=r.dom.lastChild,t=e?sU(e):[];if(t.length){let e=t[t.length-1],n=l?e.right-f.left:f.right-e.left;n>a&&(a=n,this.minWidth=o,this.minWidthFrom=u,this.minWidthTo=h)}}d&&p==e.children.length-1&&(s+=d.bottom-f.bottom),u=h+r.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?CU.RTL:CU.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t,n=0;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=sU(r.dom);if(1!=e.length)return;n+=e[0].width,t=e[0].height}if(n)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:n/e.length,textHeight:t}}});if(e)return e;let t,n,r,o=document.createElement("div");return o.className="cm-line",o.style.width="99999px",o.style.position="absolute",o.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(o);let e=sU(o.firstChild)[0];t=o.getBoundingClientRect().height,n=e&&e.width?e.width/27:7,r=e&&e.height?e.height:t,o.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let o=r==t.viewports.length?null:t.viewports[r],i=o?o.from-1:this.view.state.doc.length;if(i>n){let r=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(ZW.replace({widget:new tH(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!o)break;n=o.to+1}return ZW.set(e)}updateDeco(){let e=1,t=this.view.state.facet(mV).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(vV).map((e,t)=>{let r="function"==typeof e;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(lW.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(gV).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(rV))try{if(t(this.view,e.range,e))return!0}catch(e){lV(this.view.state,e,"scroll handler")}let t,{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1);if(!r)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,t.left),top:Math.min(r.top,t.top),right:Math.max(r.right,t.right),bottom:Math.max(r.bottom,t.bottom)});let o=EV(this.view),i={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;!function(e,t,n,r,o,i,a,l){let s=e.ownerDocument,c=s.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,p=u==s.body,h=1,f=1;if(p)e=mU(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:h,scaleY:f}=gU(u,t)),e={left:t.left,right:t.left+u.clientWidth*h,top:t.top,bottom:t.top+u.clientHeight*f}}let m=0,g=0;if("nearest"==o)t.top<e.top?(g=t.top-(e.top+a),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+a)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+a,n<0&&t.top-g<e.top&&(g=t.top-(e.top+a)));else{let r=t.bottom-t.top,i=e.bottom-e.top;g=("center"==o&&r<=i?t.top+r/2-i/2:"start"==o||"center"==o&&n<0?t.top-a:t.bottom-i+a)-e.top}if("nearest"==r?t.left<e.left?(m=t.left-(e.left+i),n>0&&t.right>e.right+m&&(m=t.right-e.right+i)):t.right>e.right&&(m=t.right-e.right+i,n<0&&t.left<e.left+m&&(m=t.left-(e.left+i))):m=("center"==r?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==r==l?t.left-i:t.right-(e.right-e.left)+i)-e.left,m||g)if(p)c.scrollBy(m,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/f,n=(u.scrollTop-e)*f}if(m){let t=u.scrollLeft;u.scrollLeft+=m/h,e=(u.scrollLeft-t)*h}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-m)<1&&(r="nearest"),n&&Math.abs(n-g)<1&&(o="nearest")}if(p)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else{if(11!=u.nodeType)break;u=u.host}}(this.view.scrollDOM,i,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==CU.LTR)}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){KV(this.tile)}}function KV(e,t){let n=null==t?void 0:t.get(e);if(1!=n){null==n&&e.destroy();for(let n of e.children)KV(n,t)}}function ZV(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=xU(n.focusNode,n.focusOffset),o=SU(n.focusNode,n.focusOffset),i=r||o;if(o&&r&&o.node!=r.node){let t=CV.get(o.node);if(!t||t.isText()&&t.text!=o.node.nodeValue)i=o;else if(e.docView.lastCompositionAfterCursor){let e=CV.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(i=o)}}if(e.docView.lastCompositionAfterCursor=i!=r,!i)return null;let a=t-i.offset;return{from:a,to:a+i.node.nodeValue.length,node:i.node}}let JV=class{constructor(){this.changes=[]}compareRange(e,t){rU(e,t,this.changes)}comparePoint(e,t){rU(e,t,this.changes)}boundChange(e){rU(e,e,this.changes)}};class eH{constructor(){this.changes=[]}compareRange(e,t){rU(e,t,this.changes)}comparePoint(){}boundChange(e){rU(e,e,this.changes)}}class tH extends XW{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function nH(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let o of r.type){if(o.from>t)break;if(!(o.to<t)){if(o.from<t&&o.to>t)return o;e&&(o.type!=KW.Text||e.type==o.type&&!(n<0?o.from<t:o.to>t))||(e=o)}}return e||r}return r}function rH(e,t,n,r){let o=e.state.doc.lineAt(t.head),i=e.bidiSpans(o),a=e.textDirectionAt(o.from);for(let l=t,s=null;;){let t=HU(o,i,a,l,n),c=VU;if(!t){if(o.number==(n?e.state.doc.lines:1))return l;c="\n",o=e.state.doc.line(o.number+(n?1:-1)),i=e.bidiSpans(o),t=e.visualLineSide(o,!n)}if(s){if(!s(c))return l}else{if(!r)return t;s=r(c)}l=t}}function oH(e,t,n){for(;;){let r=0;for(let o of e)o.between(t-1,t+1,(e,o,i)=>{if(t>e&&t<o){let i=r||n||(t-e<o-t?-1:1);t=i<0?e:o,r=i}});if(!r)return t}}function iH(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let o=t.ranges[r],i=null;if(o.empty){let t=oH(e,o.from,0);t!=o.from&&(i=mB.cursor(t,-1))}else{let t=oH(e,o.from,-1),n=oH(e,o.to,1);t==o.from&&n==o.to||(i=mB.range(o.from==o.anchor?t:n,o.from==o.head?t:n))}i&&(n||(n=t.ranges.slice()),n[r]=i)}return n?mB.create(n,t.mainIndex):t}function aH(e,t,n){let r=oH(e.state.facet(yV).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:mB.cursor(r,r<n.from?1:-1)}class lH{constructor(e,t){this.pos=e,this.assoc=t}}function sH(e,t,n,r){let o,i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:l,y:s}=t,c=s-a;for(;;){if(c<0)return new lH(0,1);if(c>e.viewState.docHeight)return new lH(e.state.doc.length,-1);if(o=e.elementAtHeight(c),null==r)break;if(o.type==KW.Text){let t=e.docView.coordsAt(r<0?o.from:o.to,r);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?o.bottom+t:o.top-t}if(e.viewport.from>=o.to||e.viewport.to<=o.from){if(n)return null;if(o.type==KW.Text){let t=function(e,t,n,r,o){let i=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((o-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+wW(a,i,e.state.tabSize)}(e,i,o,l,s);return new lH(t,t==o.from?1:-1)}}return o.type!=KW.Text?c<(o.top+o.bottom)/2?new lH(o.from,1):new lH(o.to,-1):cH(e,e.docView.lineAt(o.from),o.from,l,s)}function cH(e,t,n,r,o){let i=-1,a=null,l=1e9,s=1e9,c=o,u=o,d=(e,t)=>{for(let n=0;n<e.length;n++){let d=e[n];if(d.top==d.bottom)continue;let p=d.left>r?d.left-r:d.right<r?r-d.right:0,h=d.top>o?d.top-o:d.bottom<o?o-d.bottom:0;d.top<=u&&d.bottom>=c&&(c=Math.min(d.top,c),u=Math.max(d.bottom,u),h=0),(i<0||(h-s||p-l)<0)&&(i>=0&&s&&l<p&&a.top<=u-2&&a.bottom>=c+2?s=0:(i=t,l=p,s=h,a=d))}};if(t.isText()){for(let e=0;e<t.length;){let n=eB(t.text,e);if(d(kU(t.dom,e,n).getClientRects(),e),!l&&!s)break;e=n}return r>(a.left+a.right)/2==(uH(e,i+n)==CU.LTR)?new lH(n+eB(t.text,i),-1):new lH(n+i,1)}{if(!t.length)return new lH(n,1);for(let e=0;e<t.children.length;e++){let n=t.children[e];if(!(48&n.flags||(d((1==n.dom.nodeType?n.dom:kU(n.dom,0,n.length)).getClientRects(),e),l||s)))break}let c=t.children[i],u=t.posBefore(c,n);return c.isComposite()||c.isText()?cH(e,c,u,Math.max(a.left,Math.min(a.right,r)),o):r>(a.left+a.right)/2==(uH(e,i+n)==CU.LTR)?new lH(u+c.length,-1):new lH(u,1)}}function uH(e,t){let n=e.state.doc.lineAt(t);return e.bidiSpans(n)[jU.find(e.bidiSpans(n),t-n.from,-1,1)].dir}const dH="";class pH{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(tW.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=dH}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let o=CV.get(r),i=r.nextSibling;if(i==t){(null==o?void 0:o.breakAfter)&&!i&&this.lineBreak();break}let a=CV.get(i);(o&&a?o.breakAfter:(o?o.breakAfter:dU(r))||dU(i)&&("BR"!=r.nodeName||(null==o?void 0:o.isWidget()))&&this.text.length>e)&&!fH(i,t)&&this.lineBreak(),r=i}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let o,i=-1,a=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=CV.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(hH(e,n.node,n.offset)?t:0))}}function hH(e,t,n){for(;;){if(!t||n<hU(t))return!1;if(t==e)return!0;n=uU(t)+1,t=t.parentNode}}function fH(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=CV.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}class mH{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class gH{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:i}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=vH(e.docView.tile,t,n,0))){let t=o||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new mH(n,r)),o==n&&i==r||t.push(new mH(o,i))),t}(e),n=new pH(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?mB.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=o&&o.node==t.focusNode&&o.offset==t.focusOffset||!aU(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!aU(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),a=e.viewport;if((HW.ios||HW.chrome)&&e.state.selection.main.empty&&n!=r&&(a.from>0||a.to<e.state.doc.length)){let t=Math.min(n,r),o=Math.max(n,r),i=a.from-t,l=a.to-o;0!=i&&1!=i&&0!=t||0!=l&&-1!=l&&o!=e.state.doc.length||(n=0,r=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(mB.range(r,n)):this.newSel=mB.single(r,n)}}}function vH(e,t,n,r){if(e.isComposite()){let o=-1,i=-1,a=-1,l=-1;for(let s=0,c=r,u=r;s<e.children.length;s++){let r=e.children[s],d=c+r.length;if(c<t&&d>n)return vH(r,t,n,c);if(d>=t&&-1==o&&(o=s,i=c),c>n&&r.dom.parentNode==e.dom){a=s,l=u;break}u=d,c=d+r.breakAfter}return{from:i,to:l<0?r+e.length:l,startDOM:(o?e.children[o-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:a<e.children.length&&a>=0?e.children[a].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function yH(e,t){let n,{newSel:r}=t,o=e.state.selection.main,i=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:a}=t.bounds,l=o.from,s=null;(8===i||HW.android&&t.text.length<a-r)&&(l=o.to,s="end");let c=wH(e.state.doc.sliceString(r,a,dH),t.text,l-r,s);c&&(HW.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==dH+dH&&c.toB--,n={from:r+c.from,to:r+c.toA,insert:Hz.of(t.text.slice(c.from,c.toB).split(dH))})}else r&&(!e.hasFocus&&e.state.facet(sV)||r.main.eq(o))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!o.empty&&r&&r.main.empty?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:(HW.mac||HW.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=mB.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Hz.of([n.insert.toString().replace("."," ")])}):n&&n.from>=o.from&&n.to<=o.to&&(n.from!=o.from||n.to!=o.to)&&o.to-o.from-(n.to-n.from)<=4?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,o.to))}:e.state.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:e.state.toText(e.inputState.insertingText)}:HW.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=mB.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:Hz.of([" "])}),n)return bH(e,n,r,i);if(r&&!r.main.eq(o)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin,"select.pointer"==n&&(r=iH(e.state.facet(yV).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function bH(e,t,n,r=-1){if(HW.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(HW.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&EU(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&EU(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&EU(e.contentDOM,"Delete",46)))return!0;let i,a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l=()=>i||(i=function(e,t,n){let r,o=e.state,i=o.selection.main,a=-1;if(t.from==t.to&&t.from<i.from||t.from>i.to){let n=t.from<i.from?-1:1,r=n<0?i.from:i.to,l=oH(o.facet(yV).map(t=>t(e)),r,n);t.from==l&&(a=l)}if(a>-1)r={changes:t,selection:mB.cursor(t.from+t.insert.length,-1)};else if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.from<t.from?o.sliceDoc(i.from,t.from):"",a=i.to>t.to?o.sliceDoc(t.to,i.to):"";r=o.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+a))}else{let a=o.changes(t),l=n&&n.main.to<=a.newLength?n.main:void 0;if(o.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=i.to+10&&t.to>=i.to-10){let s,c=e.state.sliceDoc(t.from,t.to),u=n&&ZV(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);s={from:u.from,to:u.to-e}}else s=e.state.doc.lineAt(i.head);let d=i.to-t.to;r=o.changeByRange(n=>{if(n.from==i.from&&n.to==i.to)return{changes:a,range:l||n.map(a)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=s.from&&u<=s.to)return{range:n};let p=o.changes({from:u,to:r,insert:t.insert}),h=n.to-i.to;return{changes:p,range:l?mB.range(Math.max(0,l.anchor+h),Math.max(0,l.head+h)):n.map(p)}})}else r={changes:a,selection:l&&o.selection.replaceRange(l)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),o.update(r,{userEvent:l,scrollIntoView:!0})}(e,t,n));return e.state.facet(KU).some(n=>n(e,t.from,t.to,a,l))||e.dispatch(l()),!0}function wH(e,t,n,r){let o=Math.min(e.length,t.length),i=0;for(;i<o&&e.charCodeAt(i)==t.charCodeAt(i);)i++;if(i==o&&e.length==t.length)return null;let a=e.length,l=t.length;for(;a>0&&l>0&&e.charCodeAt(a-1)==t.charCodeAt(l-1);)a--,l--;return"end"==r&&(n-=a+Math.max(0,i-Math.min(a,l))-i),a<i&&e.length<t.length?(i-=n<=i&&n>=a?i-n:0,l=i+(l-a),a=i):l<i&&(i-=n<=i&&n>=l?i-n:0,a=i+(a-l),l=i),{from:i,toA:a,toB:l}}class kH{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,HW.safari&&e.contentDOM.addEventListener("input",()=>null),HW.gecko&&function(e){GH.has(e)||(GH.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=CV.get(r))&&n.isWidget()&&n.widget.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=OH(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if("scroll"!=e){let o=!t[e].handlers.length,i=n[e];i&&o!=!i.handlers.length&&(r.removeEventListener(e,this.handleEvent),i=null),i||r.addEventListener(e,this.handleEvent,{passive:o})}for(let e in n)"scroll"==e||t[e]||r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&_H.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),HW.android&&HW.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!HW.ios||e.synthetic||e.altKey||e.metaKey||!((t=xH.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||SH.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,EU(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!(!/^key/.test(e.type)||e.synthetic)&&(this.composing>0||!!(HW.safari&&!HW.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function EH(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){lV(n.state,e)}}}function OH(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,o=e&&e.plugin.domEventObservers;if(r)for(let e in r){let o=r[e];o&&n(e).handlers.push(EH(t.value,o))}if(o)for(let e in o){let r=o[e];r&&n(e).observers.push(EH(t.value,r))}}for(let e in TH)n(e).handlers.push(TH[e]);for(let e in AH)n(e).observers.push(AH[e]);return t}const xH=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],SH="dthko",_H=[16,17,18,20,91,92,224,225];function CH(e){return.7*Math.max(0,e)+8}class PH{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t,n,r=e.ownerDocument;for(let o=e.parentNode;o&&!(o==r.body||t&&n);)if(1==o.nodeType)!n&&o.scrollHeight>o.clientHeight&&(n=o),!t&&o.scrollWidth>o.clientWidth&&(t=o),o=o.assignedSlot||o.parentNode;else{if(11!=o.nodeType)break;o=o.host}return{x:t,y:n}}(e.contentDOM),this.atoms=e.state.facet(yV).map(t=>t(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(tW.allowMultipleSelections)&&function(e,t){let n=e.state.facet(QU);return n.length?n[0](t):HW.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=iU(e.root);if(!r||0==r.rangeCount)return!0;let o=r.getRangeAt(0).getClientRects();for(let e=0;e<o.length;e++){let n=o[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=UH(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(t=this.startEvent,n=e,Math.max(Math.abs(t.clientX-n.clientX),Math.abs(t.clientY-n.clientY))<10))return;var t,n;this.select(this.lastEvent=e);let r=0,o=0,i=0,a=0,l=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:s}=this.scrollParents.y.getBoundingClientRect());let c=EV(this.view);e.clientX-c.left<=i+6?r=-CH(i-e.clientX):e.clientX+c.right>=l-6&&(r=CH(e.clientX-l)),e.clientY-c.top<=a+6?o=-CH(a-e.clientY):e.clientY+c.bottom>=s-6&&(o=CH(e.clientY-s)),this.setScrollSpeed(r,o)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=iH(this.atoms,this.style.get(e,this.extend,this.multiple));!this.mustSelect&&n.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}const TH=Object.create(null),AH=Object.create(null),MH=HW.ie&&HW.ie_version<15||HW.ios&&HW.webkit_version<604;function NH(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function DH(e,t){t=NH(e.state,JU,t);let n,{state:r}=e,o=1,i=r.toText(t),a=i.lines==r.selection.ranges.length;if(null!=HH&&r.selection.ranges.every(e=>e.empty)&&HH==i.toString()){let e=-1;n=r.changeByRange(n=>{let l=r.doc.lineAt(n.from);if(l.from==e)return{range:n};e=l.from;let s=r.toText((a?i.line(o++).text:t)+r.lineBreak);return{changes:{from:l.from,insert:s},range:mB.cursor(n.from+s.length)}})}else n=a?r.changeByRange(e=>{let t=i.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:mB.cursor(e.from+t.length)}}):r.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function IH(e,t,n,r){if(1==r)return mB.cursor(t,n);if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),o=e.doc.lineAt(t),i=t-o.from;if(0==o.length)return mB.cursor(t);0==i?n=1:i==o.length&&(n=-1);let a=i,l=i;n<0?a=eB(o.text,i,!1):l=eB(o.text,i);let s=r(o.text.slice(a,l));for(;a>0;){let e=eB(o.text,a,!1);if(r(o.text.slice(e,a))!=s)break;a=e}for(;l<o.length;){let e=eB(o.text,l);if(r(o.text.slice(l,e))!=s)break;l=e}return mB.range(a+o.from,l+o.from)}(e.state,t,n);{let n=e.docView.lineAt(t),r=e.state.doc.lineAt(n?n.posAtEnd:t),o=n?n.posAtStart:r.from,i=n?n.posAtEnd:r.to;return i<e.state.doc.length&&i==r.to&&i++,mB.range(o,i)}}AH.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},TH.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),AH.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},AH.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},TH.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(GU))if(n=r(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=jH(e,t),r=UH(t),o=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),o=o.map(e.changes))},get(t,i,a){let l,s=jH(e,t),c=IH(e,s.pos,s.bias,r);if(n.pos!=s.pos&&!i){let t=IH(e,n.pos,n.bias,r),o=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=o<c.from?mB.range(o,i):mB.range(i,o)}return i?o.replaceRange(o.main.extend(c.from,c.to)):a&&1==r&&o.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:o}=e.ranges[n];if(r<=t&&o>=t)return mB.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(o,s.pos))?l:a?o.addRange(c):mB.create([c])}}}(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new PH(e,t,n,r)),r&&e.observer.ignore(()=>{wU(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let o=e.inputState.mouseSelection;if(o)return o.start(t),!1===o.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};let LH=(e,t,n)=>t>=n.top&&t<=n.bottom&&e>=n.left&&e<=n.right;function RH(e,t,n,r){let o=e.docView.lineAt(t);if(!o)return 1;let i=t-o.posAtStart;if(0==i)return 1;if(i==o.length)return-1;let a=o.coordsIn(i,-1);if(a&&LH(n,r,a))return-1;let l=o.coordsIn(i,1);return l&&LH(n,r,l)?1:a&&a.bottom>=r?-1:1}function jH(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:RH(e,n,t.clientX,t.clientY)}}const FH=HW.ie&&HW.ie_version<=11;let zH=null,BH=0,WH=0;function UH(e){if(!FH)return e.detail;let t=zH,n=WH;return zH=e,WH=Date.now(),BH=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(BH+1)%3:1}function VH(e,t,n,r){if(!(n=NH(e.state,JU,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,a=r&&i&&function(e,t){let n=e.state.facet($U);return n.length?n[0](t):HW.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,l={from:o,insert:n},s=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(o,-1),head:s.mapPos(o,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}TH.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=mB.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",NH(e.state,eV,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},TH.dragend=e=>(e.inputState.draggedContent=null,!1),TH.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),o=0,i=()=>{++o==n.length&&VH(e,t,r.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=i,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return VH(e,t,n,!0),!0}return!1},TH.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=MH?null:t.clipboardData;return n?(DH(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),DH(e,n.value)},50)}(e),!1)};let HH=null;TH.copy=TH.cut=(e,t)=>{let{text:n,ranges:r,linewise:o}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let o=-1;for(let{from:r}of e.selection.ranges){let i=e.doc.lineAt(r);i.number>o&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),o=i.number}r=!0}return{text:NH(e,eV,t.join(e.lineBreak)),ranges:n,linewise:r}}(e.state);if(!n&&!o)return!1;HH=o?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=MH?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}(e,n),!1)};const qH=WB.define();function QH(e,t){let n=[];for(let r of e.facet(ZU)){let o=r(e,t);o&&n.push(o)}return n.length?e.update({effects:n,annotations:qH.of(!0)}):null}function $H(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=QH(e.state,t);n?e.dispatch(n):e.update([])}},10)}AH.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),$H(e)},AH.blur=e=>{e.observer.clearSelectionRange(),$H(e)},AH.compositionstart=AH.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},AH.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,HW.chrome&&HW.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},AH.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},TH.beforeinput=(e,t)=>{var n,r;if("insertText"!=t.inputType&&"insertCompositionText"!=t.inputType||(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let r=null===(n=t.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(r&&o.length){let t=o[0],n=e.posAtDOM(t.startContainer,t.startOffset),i=e.posAtDOM(t.endContainer,t.endOffset);return bH(e,{from:n,to:i,insert:e.state.toText(r)},null),!0}}let o;if(HW.chrome&&HW.android&&(o=xH.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(r=window.visualViewport)||void 0===r?void 0:r.height)||0;setTimeout(()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return HW.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),HW.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>AH.compositionend(e,t),20),!1};const GH=new Set,YH=["pre-wrap","normal","pre-line","break-spaces"];let XH=!1;function KH(){XH=!1}class ZH{constructor(e){this.lineWrapping=e,this.doc=Hz.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return YH.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,o,i){let a=YH.indexOf(e)>-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=o,l){this.heightSamples={};for(let e=0;e<i.length;e++){let t=i[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return l}}class JH{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class eq{constructor(e,t,n,r,o){this.from=e,this.length=t,this.top=n,this.height=r,this._content=o}get type(){return"number"==typeof this._content?KW.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof tU?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new eq(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var tq=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(tq||(tq={}));const nq=.001;class rq{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>nq&&(XH=!0),this.height=e)}replace(e,t,n){return rq.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let o=this,i=n.doc;for(let a=r.length-1;a>=0;a--){let{fromA:l,toA:s,fromB:c,toB:u}=r[a],d=o.lineAt(l,tq.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:o.lineAt(s,tq.ByPosNoHeight,n,0,0);for(u+=p.to-s,s=p.to;a>0&&d.from<=r[a-1].toA;)l=r[a-1].fromA,c=r[a-1].fromB,a--,l<d.from&&(d=o.lineAt(l,tq.ByPosNoHeight,n,0,0));c+=d.from-l,l=d.from;let h=dq.build(n.setDoc(i),e,c,u);o=oq(o,o.replace(l,s,h))}return o.updateHeight(n,0)}static empty(){return new lq(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,o=0;for(;;)if(t==n)if(r>2*o){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),n+=1+o.break,r-=o.size}else{if(!(o>2*r))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,o-=t.size}}else if(r<o){let n=e[t++];n&&(r+=n.size)}else{let t=e[--n];t&&(o+=t.size)}let i=0;return null==e[t-1]?(i=1,t--):null==e[t]&&(i=1,n++),new cq(rq.of(e.slice(0,t)),i,rq.of(e.slice(n)))}}function oq(e,t){return e==t?e:(e.constructor!=t.constructor&&(XH=!0),t)}rq.prototype.size=1;const iq=ZW.replace({});class aq extends rq{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new eq(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new eq(r,0,n,this.spaceAbove,iq):this.mainBlock(n,r)}lineAt(e,t,n,r,o){let i=this.mainBlock(r,o);return this.spaceAbove?this.blockAt(0,n,r,o).join(i):i}forEachLine(e,t,n,r,o,i){e<=o+this.length&&t>=o&&i(this.lineAt(0,tq.ByPos,n,r,o))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class lq extends aq{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new eq(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof lq||r instanceof sq&&4&r.flags)&&Math.abs(this.length-r.length)<10?(r instanceof sq?r=new lq(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):rq.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class sq extends rq{constructor(e){super(e,0)}heightMetrics(e,t){let n,r=e.doc.lineAt(t).number,o=e.doc.lineAt(t+this.length).number,i=o-r+1,a=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(a=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:r,lastLine:o,perLine:n,perChar:a}}blockAt(e,t,n,r){let{firstLine:o,lastLine:i,perLine:a,perChar:l}=this.heightMetrics(t,r);if(t.lineWrapping){let o=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),i=t.doc.lineAt(o),s=a+i.length*l,c=Math.max(n,e-s/2);return new eq(i.from,i.length,c,s,0)}{let r=Math.max(0,Math.min(i-o,Math.floor((e-n)/a))),{from:l,length:s}=t.doc.line(o+r);return new eq(l,s,n+a*r,a,0)}}lineAt(e,t,n,r,o){if(t==tq.ByHeight)return this.blockAt(e,n,r,o);if(t==tq.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new eq(t,r-t,0,0,0)}let{firstLine:i,perLine:a,perChar:l}=this.heightMetrics(n,o),s=n.doc.lineAt(e),c=a+s.length*l,u=s.number-i,d=r+a*u+l*(s.from-o-u);return new eq(s.from,s.length,Math.max(r,Math.min(d,r+this.height-c)),c,0)}forEachLine(e,t,n,r,o,i){e=Math.max(e,o),t=Math.min(t,o+this.length);let{firstLine:a,perLine:l,perChar:s}=this.heightMetrics(n,o);for(let c=e,u=r;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-a;u+=l*n+s*(e-o-n)}let r=l+s*t.length;i(new eq(t.from,t.length,u,r,0)),u+=r,c=t.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof sq?n[n.length-1]=new sq(e.length+r):n.push(null,new sq(r-1))}if(e>0){let t=n[0];t instanceof sq?n[0]=new sq(e+t.length):n.unshift(new sq(e-1),null)}return rq.of(n)}decomposeLeft(e,t){t.push(new sq(e-1),null)}decomposeRight(e,t){t.push(null,new sq(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let o=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],i=Math.max(t,r.from),a=-1;for(r.from>t&&n.push(new sq(r.from-t-1).updateHeight(e,t));i<=o&&r.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let o=r.heights[r.index++],l=0;o<0&&(l=-o,o=r.heights[r.index++]),-1==a?a=o:Math.abs(o-a)>=nq&&(a=-2);let s=new lq(t,o,l);s.outdated=!1,n.push(s),i+=t+1}i<=o&&n.push(null,new sq(o-i).updateHeight(e,i));let l=rq.of(n);return(a<0||Math.abs(l.height-this.height)>=nq||Math.abs(a-this.heightMetrics(e,t).perLine)>=nq)&&(XH=!0),oq(this,l)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class cq extends rq{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let o=n+this.left.height;return e<o?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,o,r+this.left.length+this.break)}lineAt(e,t,n,r,o){let i=r+this.left.height,a=o+this.left.length+this.break,l=t==tq.ByHeight?e<i:e<a,s=l?this.left.lineAt(e,t,n,r,o):this.right.lineAt(e,t,n,i,a);if(this.break||(l?s.to<a:s.from>a))return s;let c=t==tq.ByPosNoHeight?tq.ByPosNoHeight:tq.ByPos;return l?s.join(this.right.lineAt(a,c,n,i,a)):this.left.lineAt(a,c,n,r,o).join(s)}forEachLine(e,t,n,r,o,i){let a=r+this.left.height,l=o+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,n,r,o,i),t>=l&&this.right.forEachLine(e,t,n,a,l,i);else{let s=this.lineAt(l,tq.ByPos,n,r,o);e<s.from&&this.left.forEachLine(e,s.from-1,n,r,o,i),s.to>=e&&s.from<=t&&i(s),t>s.to&&this.right.forEachLine(s.to+1,t,n,a,l,i)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let o=[];e>0&&this.decomposeLeft(e,o);let i=o.length;for(let e of n)o.push(e);if(e>0&&uq(o,i-1),t<this.length){let e=o.length;this.decomposeRight(t,o),uq(o,e)}return rq.of(o)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?rq.of(this.break?[e,null,t]:[e,t]):(this.left=oq(this.left,e),this.right=oq(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:o,right:i}=this,a=t+o.length+this.break,l=null;return r&&r.from<=t+o.length&&r.more?l=o=o.updateHeight(e,t,n,r):o.updateHeight(e,t,n),r&&r.from<=a+i.length&&r.more?l=i=i.updateHeight(e,a,n,r):i.updateHeight(e,a,n),l?this.balanced(o,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function uq(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof sq&&(r=e[t+1])instanceof sq&&e.splice(t-1,3,new sq(n.length+1+r.length))}class dq{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof lq?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new lq(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,o=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let i=t-e;n.block?this.addBlock(new aq(i,r,n)):(i||o||r>=5)&&this.addLineDeco(r,o,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new lq(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new sq(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof lq)return e;let t=new lq(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof lq||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new lq(0,-1,0));let n=e;for(let e of this.nodes)e instanceof lq&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let o=new dq(n,e);return lW.spans(t,n,r,o,0),o.finish(n)}}class pq{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&rU(e,t,this.changes,5)}}function hq(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,o=r.defaultView||window,i=Math.max(0,n.left),a=Math.min(o.innerWidth,n.right),l=Math.max(0,n.top),s=Math.min(o.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(1==t.nodeType){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=r.overflow){let r=n.getBoundingClientRect();i=Math.max(i,r.left),a=Math.min(a,r.right),l=Math.max(l,r.top),s=Math.min(t==e.parentNode?o.innerHeight:s,r.bottom)}t="absolute"==r.position||"fixed"==r.position?n.offsetParent:n.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:i-n.left,right:Math.max(i,a)-n.left,top:l-(n.top+t),bottom:Math.max(l,s)-(n.top+t)}}function fq(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class mq{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(r.from!=o.from||r.to!=o.to||r.size!=o.size)return!1}return!0}draw(e,t){return ZW.replace({widget:new gq(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class gq extends XW{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class vq{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=kq,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=CU.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(fV).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new ZH(t),this.stateDeco=e.facet(mV).filter(e=>"function"!=typeof e),this.heightMap=rq.empty().applyChanges(this.stateDeco,Hz.empty,this.heightOracle.setDoc(e.doc),[new xV(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ZW.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new yq(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?kq:new Eq(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Oq(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(mV).filter(e=>"function"!=typeof e);let r=e.changedRanges,o=xV.extendWithRanges(r,function(e,t,n){let r=new pq;return lW.compare(e,t,n,r,0),r.changes}(n,this.stateDeco,e?e.changes:lB.empty(this.state.doc.length))),i=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);KH(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=i||XH)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=i);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let s=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(s||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(nV)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,o=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?CU.RTL:CU.LTR;let i=this.heightOracle.mustRefreshForWrapping(o),a=t.getBoundingClientRect(),l=i||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let s=0,c=0;if(a.width&&a.height){let{scaleX:e,scaleY:n}=gU(t,a);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,s|=16,i=l=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,s|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=16);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=OU(e.scrollDOM);let h=(this.printing?fq:hq)(t,this.paddingTop),f=h.top-this.pixelViewport.top,m=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}(e.dom))return 0;let v=a.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,s|=16),l){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(i=!0),i||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:a,textHeight:l}=e.docView.measureTextSize();i=n>0&&r.refresh(o,n,a,l,Math.max(5,v/a),t),i&&(e.docView.minWidth=0,s|=16)}f>0&&m>0?c=Math.max(f,m):f<0&&m<0&&(c=Math.min(f,m)),KH();for(let n of this.viewports){let o=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?rq.empty().applyChanges(this.stateDeco,Hz.empty,this.heightOracle,[new xV(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,i,new JH(n.from,o))}XH&&(s|=2)}let y=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(2&s&&(s|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),s|=this.updateForViewport()),(2&s||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,o=this.heightOracle,{visibleTop:i,visibleBottom:a}=this,l=new yq(r.lineAt(i-1e3*n,tq.ByHeight,o,0,0).from,r.lineAt(a+1e3*(1-n),tq.ByHeight,o,0,0).to);if(t){let{head:e}=t.range;if(e<l.from||e>l.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,tq.ByPos,o,0,0);n="center"==t.y?(a.top+a.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e<l.from?a.top:a.bottom-i,l=new yq(r.lineAt(n-500,tq.ByHeight,o,0,0).from,r.lineAt(n+i+500,tq.ByHeight,o,0,0).to)}}return l}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new yq(this.heightMap.lineAt(n,tq.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,tq.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,tq.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,tq.ByPos,this.heightOracle,0,0),{visibleTop:i,visibleBottom:a}=this;return(0==e||r<=i-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||o>=a+Math.max(10,Math.min(n,250)))&&r>i-2e3&&o<a+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new mq(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,o=r>>1,i=r<<1;if(this.defaultTextDirection!=CU.LTR&&!n)return[];let a=[],l=(r,i,s,c)=>{if(i-r<o)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<i)return l(r,e-10,s,c),void l(e+10,i,s,c);let p=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=s.from&&e.to<=s.to&&Math.abs(e.from-r)<o&&Math.abs(e.to-i)<o&&!d.some(t=>e.from<t&&e.to>t));if(!p){if(i<s.to&&t&&n&&t.visibleRanges.some(e=>e.from<=i&&e.to>=i)){let e=t.moveToLineBoundary(mB.cursor(i),!1,!0).head;e>r&&(i=e)}let e=this.gapSize(s,r,i,c);p=new mq(r,i,e,n||e<2e6?e:2e6)}a.push(p)},s=t=>{if(t.length<i||t.type!=KW.Text)return;let o=function(e,t,n){let r=[],o=e,i=0;return lW.spans(n,e,t,{span(){},point(e,t){e>o&&(r.push({from:o,to:e}),i+=e-o),o=t}},20),o<t&&(r.push({from:o,to:t}),i+=t-o),{total:i,ranges:r}}(t.from,t.to,this.stateDeco);if(o.total<i)return;let a,s,c=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,i=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=c){let r=wq(o,c),a=((this.visibleBottom-this.visibleTop)/2+i)/t.height;e=r-a,n=r+a}else e=(this.visibleTop-t.top-i)/t.height,n=(this.visibleBottom-t.top+i)/t.height;a=bq(o,e),s=bq(o,n)}else{let n=o.total*this.heightOracle.charWidth,i=r*this.heightOracle.charWidth,l=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+l<this.pixelViewport.left&&(l=n.size-n.displaySize);let u,d,p=this.pixelViewport.left+l,h=this.pixelViewport.right+l;if(null!=c){let e=wq(o,c),t=((h-p)/2+i)/n;u=e-t,d=e+t}else u=(p-i)/n,d=(h+i)/n;a=bq(o,u),s=bq(o,d)}a>t.from&&l(t.from,a,t,o),s<t.to&&l(s,t.to,t,o)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(s):s(e);return a}gapSize(e,t,n,r){let o=wq(r,n)-wq(r,t);return this.heightOracle.lineWrapping?e.height*o:r.total*this.heightOracle.charWidth*o}updateLineGaps(e){mq.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ZW.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];lW.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(8&r);t++){let o=this.visibleRanges[t],i=n[t];o.from==i.from&&o.to==i.to||(r|=4,e&&e.mapPos(o.from,-1)==i.from&&e.mapPos(o.to,1)==i.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Oq(this.heightMap.lineAt(e,tq.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Oq(this.heightMap.lineAt(this.scaler.fromDOM(e),tq.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Oq(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class yq{constructor(e,t){this.from=e,this.to=t}}function bq({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:o}=t[e],i=o-n;if(r<=i)return n+r;r-=i}}function wq(e,t){let n=0;for(let{from:r,to:o}of e.ranges){if(t<=o){n+=t-r;break}n+=o-r}return n/e.total}const kq={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};class Eq{constructor(e,t,n){let r=0,o=0,i=0;this.viewports=n.map(({from:n,to:o})=>{let i=t.lineAt(n,tq.ByPos,e,0,0).top,a=t.lineAt(o,tq.ByPos,e,0,0).bottom;return r+=a-i,{from:n,to:o,top:i,bottom:a,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=i+(e.top-o)*this.scale,i=e.domBottom=e.domTop+(e.bottom-e.top),o=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.top)return r+(e-n)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);n=o.bottom,r=o.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.domTop)return n+(e-r)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);n=o.bottom,r=o.domBottom}}eq(e){return e instanceof Eq&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function Oq(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new eq(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>Oq(e,t)):e._content)}const xq=yB.define({combine:e=>e.join(" ")}),Sq=yB.define({combine:e=>e.indexOf(!0)>-1}),_q=xW.newName(),Cq=xW.newName(),Pq=xW.newName(),Tq={"&light":"."+Cq,"&dark":"."+Pq};function Aq(e,t,n){return new xW(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}const Mq=Aq("."+_q,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Tq),Nq={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Dq=HW.ie&&HW.ie_version<=11;class Iq{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new vU,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(HW.ie&&HW.ie_version<=11||HW.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!HW.android||!1===e.constructor.EDIT_CONTEXT||HW.chrome&&HW.chrome_version<126||(this.editContext=new jq(e),e.state.facet(sV)&&(e.contentDOM.editContext=this.editContext.editContext)),Dq&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(sV)?n.root.activeElement!=this.dom:!lU(this.dom,r))return;let o=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);o&&o.isWidget()&&o.widget.ignoreEvent(e)?t||(this.selectionChanged=!1):(HW.ie&&HW.ie_version<=11||HW.android&&HW.chrome)&&!n.state.selection.main.empty&&r.focusNode&&cU(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=iU(e.root);if(!t)return!1;let n=HW.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Rq(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?Rq(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=lU(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,hU(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:(n=e,r=hU(n))}else{if(n==e)return!0;r=uU(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Nq),Dq&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Dq&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&EU(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let o of e){let e=this.readMutation(o);e&&(e.typeOver&&(r=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&lU(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new gH(this.view,e,t,n);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=yH(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=Lq(t,e.previousSibling||e.target.previousSibling,-1),r=Lq(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(sV)!=e.state.facet(sV)&&(e.view.contentDOM.editContext=e.state.facet(sV)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Lq(e,t,n){for(;t;){let r=CV.get(t);if(r&&r.parent==e)return r;let o=t.parentNode;t=o!=e.dom?o:n>0?t.nextSibling:t.previousSibling}return null}function Rq(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return cU(a.node,a.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}class jq{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:o,head:i}=r,a=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:a,drifted:!1});let s=l-a>n.text.length;a==this.from&&o<this.from?a=o:l==this.to&&o>this.to&&(l=o);let c=wH(e.state.sliceDoc(a,l),n.text,(s?r.from:r.to)-a,s?"end":null);if(!c){let t=mB.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));return void(t.main.eq(r)||e.dispatch({selection:t,userEvent:"select"}))}let u={from:c.from+a,to:c.toA+a,insert:Hz.of(n.text.slice(c.from,c.toB).split("\n"))};if((HW.mac||HW.android)&&u.from==i-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(u={from:a,to:l,insert:Hz.of([n.text.replace("."," ")])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);bH(e,u,mB.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],o=null;for(let t=this.toEditorPos(n.rangeStart),i=this.toEditorPos(n.rangeEnd);t<i;t++){let n=e.coordsForChar(t);o=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||o||new DOMRect,r.push(o)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let o=this.toEditorPos(e.rangeStart),i=this.toEditorPos(e.rangeEnd);if(o<i){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(r)?1:2}px`;n.push(ZW.mark({attributes:{style:e}}).range(o,i))}}}e.dispatch({effects:aV.of(ZW.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=iU(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((o,i,a,l,s)=>{if(n)return;let c=s.length-(i-o);if(r&&i>=r.to){if(r.from==o&&r.to==i&&r.insert.eq(s))return r=this.pendingContextChange=null,t+=c,void(this.to+=c);r=null,this.revertPending(e.state)}if(o+=t,(i+=t)<=this.from)this.from+=c,this.to+=c;else if(o<this.to){if(o<this.from||i>this.to||this.to-this.from+s.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(o),this.toContextPos(i),s.toString()),this.to+=c}t+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==r||this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Fq{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new vq(e.state||tW.create(e)),e.scrollTo&&e.scrollTo.is(iV)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(uV).map(e=>new pV(e));for(let e of this.plugins)e.update(this);this.observer=new Iq(this),this.inputState=new kH(this),this.inputState.ensureHandlers(this.plugins),this.docView=new XV(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=1==e.length&&e[0]instanceof qB?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,r=!1,o=this.state;for(let t of e){if(t.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=t.state}if(this.destroyed)return void(this.viewState.state=o);let i=this.hasFocus,a=0,l=null;e.some(e=>e.annotation(qH))?(this.inputState.notifiedFocused=i,a=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,l=QH(o,i),l||(a=1));let s=this.observer.delayedAndroidKey,c=null;if(s?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(tW.phrases)!=this.state.facet(tW.phrases))return this.setState(o);t=SV.create(this,o,e),t.flags|=a;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new oV(e.empty?e:mB.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(iV)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=Wq.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(OV)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(t.startState.facet(xq)!=t.state.facet(xq)&&(this.viewState.mustMeasureContent=!0),(n||r||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(XU))try{e(t)}catch(e){lV(this.state,e,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!yH(this,c)&&s.force&&EU(this.contentDOM,s.key,s.keyCode)})}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new vq(e),this.plugins=e.facet(uV).map(e=>new pV(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new XV(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(uV),n=e.state.facet(uV);if(t!=n){let r=[];for(let o of n){let n=t.indexOf(o);if(n<0)r.push(new pV(o));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){lV(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:i}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(OU(n))o=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);o=e.from,i=e.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];4&a||([this.measureRequests,l]=[l,this.measureRequests]);let s=l.map(e=>{try{return e.read(this)}catch(e){return lV(this.state,e),Bq}}),c=SV.create(this,this.state,[]),u=!1;c.flags|=a,t?t.flags|=a:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c),u&&this.docViewUpdate());for(let e=0;e<l.length;e++)if(s[e]!=Bq)try{let t=l[e];t.write&&t.write(s[e],this)}catch(e){lV(this.state,e)}if(u&&this.docView.updateSelection(!0),!c.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,i=-1;continue}{let e=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-i;if(e>1||e<-1){r+=e,n.scrollTop=r/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(XU))e(t)}get themeClasses(){return _q+" "+(this.state.facet(Sq)?Pq:Cq)+" "+this.state.facet(xq)}updateAttrs(){let e=Uq(this,hV,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(sV)?"true":"false",class:"cm-content",style:`${HW.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Uq(this,fV,t);let n=this.observer.ignore(()=>{let n=GW(this.contentDOM,this.contentAttrs,t),r=GW(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(Fq.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(OV);let e=this.state.facet(Fq.cspNonce);xW.mount(this.root,this.styleModules.concat(Mq).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return aH(this,e,rH(this,e,t,n))}moveByGroup(e,t){return aH(this,e,rH(this,e,t,t=>function(e,t,n){let r=e.state.charCategorizer(t),o=r(n);return e=>{let t=r(e);return o==ZB.Space&&(o=t),o==t}}(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),o=n[t?n.length-1:0];return mB.cursor(o.side(t,r)+e.from,o.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let o=nH(e,t.head,t.assoc||-1),i=r&&o.type==KW.Text&&(e.lineWrapping||o.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>o.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(o.from),a=e.posAtCoords({x:n==(r==CU.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=a)return mB.cursor(a,n?-1:1)}return mB.cursor(n?o.to:o.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return aH(this,e,function(e,t,n,r){let o=t.head,i=n?1:-1;if(o==(n?e.state.doc.length:0))return mB.cursor(o,t.assoc);let a,l=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(o,t.assoc||-1),u=e.documentTop;if(c)null==l&&(l=c.left-s.left),a=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(o);null==l&&(l=Math.min(s.right-s.left,e.defaultCharacterWidth*(o-t.from))),a=(i<0?t.top:t.bottom)+u}let d=s.left+l,p=null!=r?r:e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=sH(e,{x:d,y:a+(p+t)*i},!1,i);return mB.cursor(n.pos,n.assoc,void 0,l)}}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=sH(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),sH(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),o=this.bidiSpans(r);return fU(n,o[jU.find(o,e-r.from,-1,t)].dir==CU.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(tV)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>zq)return UU(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||FU(r.isolates,t=wV(this,e))))return r.order;t||(t=wV(this,e));let r=function(e,t,n){if(!e)return[new jU(0,0,t==TU?1:0)];if(t==PU&&!n.length&&!RU.test(e))return UU(e.length);if(n.length)for(;e.length>zU.length;)zU[zU.length]=256;let r=[],o=t==PU?0:1;return WU(e,o,o,n,0,e.length,r),r}(e.text,n,t);return this.bidiCache.push(new Wq(e.from,e.to,n,t,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||HW.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{wU(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return iV.of(new oV("number"==typeof e?mB.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return iV.of(new oV(mB.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return dV.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return dV.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=xW.newName(),r=[xq.of(n),OV.of(Aq(`.${n}`,e))];return t&&t.dark&&r.push(Sq.of(!0)),r}static baseTheme(e){return CB.lowest(OV.of(Aq("."+_q,e,Tq)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&CV.get(n)||CV.get(e);return(null===(t=null==r?void 0:r.root)||void 0===t?void 0:t.view)||null}}Fq.styleModule=OV,Fq.inputHandler=KU,Fq.clipboardInputFilter=JU,Fq.clipboardOutputFilter=eV,Fq.scrollHandler=rV,Fq.focusChangeEffect=ZU,Fq.perLineTextDirection=tV,Fq.exceptionSink=YU,Fq.updateListener=XU,Fq.editable=sV,Fq.mouseSelectionStyle=GU,Fq.dragMovesSelection=$U,Fq.clickAddsSelectionRange=QU,Fq.decorations=mV,Fq.blockWrappers=gV,Fq.outerDecorations=vV,Fq.atomicRanges=yV,Fq.bidiIsolatedRanges=bV,Fq.scrollMargins=kV,Fq.darkTheme=Sq,Fq.cspNonce=yB.define({combine:e=>e.length?e[0]:""}),Fq.contentAttributes=fV,Fq.editorAttributes=hV,Fq.lineWrapping=Fq.contentAttributes.of({class:"cm-lineWrapping"}),Fq.announce=HB.define();const zq=4096,Bq={};class Wq{constructor(e,t,n,r,o,i){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=o,this.order=i}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:CU.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let i=e[o];i.dir!=r||t.touchesRange(i.from,i.to)||n.push(new Wq(t.mapPos(i.from,1),t.mapPos(i.to,-1),i.dir,i.isolates,!1,i.order))}return n}}function Uq(e,t,n){for(let r=e.state.facet(t),o=r.length-1;o>=0;o--){let t=r[o],i="function"==typeof t?t(e):t;i&&qW(i,n)}return n}const Vq=HW.mac?"mac":HW.windows?"win":HW.linux?"linux":"key";function Hq(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const qq=CB.default(Fq.domEventHandlers({keydown:(e,t)=>Zq(Gq(t.state),e,t,"editor")})),Qq=yB.define({enables:qq}),$q=new WeakMap;function Gq(e){let t=e.facet(Qq),n=$q.get(t);return n||$q.set(t,n=function(e,t=Vq){let n=Object.create(null),r=Object.create(null),o=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,r,i,a,l)=>{var s,c;let u=n[e]||(n[e]=Object.create(null)),d=r.split(/ (?!$)/).map(e=>function(e,t){const n=e.split(/-(?!$)/);let r,o,i,a,l=n[n.length-1];"Space"==l&&(l=" ");for(let e=0;e<n.length-1;++e){const l=n[e];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);"mac"==t?a=!0:o=!0}}return r&&(l="Alt-"+l),o&&(l="Ctrl-"+l),a&&(l="Meta-"+l),i&&(l="Shift-"+l),l}(e,t));for(let t=1;t<d.length;t++){let n=d.slice(0,t).join(" ");o(n,!0),u[n]||(u[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Yq={view:t,prefix:n,scope:e};return setTimeout(()=>{Yq==r&&(Yq=null)},Xq),!0}]})}let p=d.join(" ");o(p,!1);let h=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(s=u._any)||void 0===s?void 0:s.run)||void 0===c?void 0:c.slice())||[]});i&&h.run.push(i),a&&(h.preventDefault=!0),l&&(h.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:o}=r;for(let t in e)e[t].run.push(e=>o(e,Kq))}let o=r[t]||r.key;if(o)for(let t of e)i(t,o,r.run,r.preventDefault,r.stopPropagation),r.shift&&i(t,"Shift-"+o,r.shift,r.preventDefault,r.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let Yq=null;const Xq=4e3;let Kq=null;function Zq(e,t,n,r){Kq=t;let o=function(e){var t=!(TW&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||AW&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?PW:CW)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=rB(tB(o,0))==o.length&&" "!=o,a="",l=!1,s=!1,c=!1;Yq&&Yq.view==n&&Yq.scope==r&&(a=Yq.prefix+" ",_H.indexOf(t.keyCode)<0&&(s=!0,Yq=null));let u,d,p=new Set,h=e=>{if(e){for(let t of e.run)if(!p.has(t)&&(p.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),s=!0)}return!1},f=e[r];return f&&(h(f[a+Hq(o,t,!i)])?l=!0:!i||!(t.altKey||t.metaKey||t.ctrlKey)||HW.windows&&t.ctrlKey&&t.altKey||HW.mac&&t.altKey&&!t.ctrlKey&&!t.metaKey||!(u=CW[t.keyCode])||u==o?i&&t.shiftKey&&h(f[a+Hq(o,t,!0)])&&(l=!0):(h(f[a+Hq(u,t,!0)])||t.shiftKey&&(d=PW[t.keyCode])!=o&&d!=u&&h(f[a+Hq(d,t,!1)]))&&(l=!0),!l&&h(f._any)&&(l=!0)),s&&(l=!0),l&&c&&t.stopPropagation(),Kq=null,l}class Jq{constructor(e,t,n,r,o){this.className=e,this.left=t,this.top=n,this.width=r,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let o=eQ(e);return[new Jq(t,r.left-o.left,r.top-o.top,null,r.bottom-r.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),o=Math.min(n.to,e.viewport.to),i=e.textDirection==CU.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),s=eQ(e),c=a.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=l.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=l.right-(u?parseInt(u.paddingRight):0),h=nH(e,r,1),f=nH(e,o,-1),m=h.type==KW.Text?h:null,g=f.type==KW.Text?f:null;if(m&&(e.lineWrapping||h.widgetLineBreaks)&&(m=tQ(e,r,1,m)),g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=tQ(e,o,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(b(n.from,n.to,m));{let t=m?b(n.from,null,m):w(h,!1),r=g?b(null,n.to,g):w(f,!0),o=[];return(m||h).to<(g||f).from-(m&&g?1:0)||h.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?o.push(v(d,t.bottom,p,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==KW.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),y(t).concat(o).concat(y(r))}function v(e,n,r,o){return new Jq(t,e-s.left,n-s.top,r-e,o-n)}function y({top:e,bottom:t,horizontal:n}){let r=[];for(let o=0;o<n.length;o+=2)r.push(v(n[o],e,n[o+1],t));return r}function b(t,n,r){let o=1e9,a=-1e9,l=[];function s(t,n,s,c,u){let h=e.coordsAtPos(t,t==r.to?-2:2),f=e.coordsAtPos(s,s==r.from?2:-2);h&&f&&(o=Math.min(h.top,f.top,o),a=Math.max(h.bottom,f.bottom,a),u==CU.LTR?l.push(i&&n?d:h.left,i&&c?p:f.right):l.push(!i&&c?d:f.left,!i&&n?p:h.right))}let c=null!=t?t:r.from,u=null!=n?n:r.to;for(let r of e.visibleRanges)if(r.to>c&&r.from<u)for(let o=Math.max(r.from,c),i=Math.min(r.to,u);;){let r=e.state.doc.lineAt(o);for(let a of e.bidiSpans(r)){let e=a.from+r.from,l=a.to+r.from;if(e>=i)break;l>o&&s(Math.max(e,o),null==t&&e<=c,Math.min(l,i),null==n&&l>=u,a.dir)}if(o=r.to+1,o>=i)break}return 0==l.length&&s(c,null==t,u,null==n,e.textDirection),{top:o,bottom:a,horizontal:l}}function w(e,t){let n=l.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function eQ(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==CU.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function tQ(e,t,n,r){let o=e.coordsAtPos(t,2*n);if(!o)return r;let i=e.dom.getBoundingClientRect(),a=(o.top+o.bottom)/2,l=e.posAtCoords({x:i.left+1,y:a}),s=e.posAtCoords({x:i.right-1,y:a});return null==l||null==s?r:{from:Math.max(r.from,Math.min(l,s)),to:Math.min(r.to,Math.max(l,s))}}class nQ{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(rQ)!=e.state.facet(rQ)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(rQ);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;e==this.scaleX&&t==this.scaleY||(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{return n=e,r=this.drawn[t],!(n.constructor==r.constructor&&n.eq(r));var n,r})){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,HW.safari&&HW.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const rQ=yB.define();function oQ(e){return[dV.define(t=>new nQ(t,e)),rQ.of(e)]}const iQ=yB.define({combine:e=>nW(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function aQ(e){return e.startState.facet(iQ)!=e.state.facet(iQ)}const lQ=oQ({above:!0,markers(e){let{state:t}=e,n=t.facet(iQ),r=[];for(let o of t.selection.ranges){let i=o==t.selection.main;if(o.empty||n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=o.empty?o:mB.cursor(o.head,o.head>o.anchor?-1:1);for(let o of Jq.forRange(e,t,n))r.push(o)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=aQ(e);return n&&sQ(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){sQ(t.state,e)},class:"cm-cursorLayer"});function sQ(e,t){t.style.animationDuration=e.facet(iQ).cursorBlinkRate+"ms"}const cQ=oQ({above:!1,markers:e=>e.state.selection.ranges.map(t=>t.empty?[]:Jq.forRange(e,"cm-selectionBackground",t)).reduce((e,t)=>e.concat(t)),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||aQ(e),class:"cm-selectionLayer"}),uQ=CB.highest(Fq.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),dQ=HB.define({map:(e,t)=>null==e?null:t.mapPos(e)}),pQ=SB.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(dQ)?t.value:e,e))}),hQ=dV.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(pQ);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(pQ)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(pQ),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(pQ)!=e&&this.view.dispatch({effects:dQ.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function fQ(e,t,n,r,o){t.lastIndex=0;for(let i,a=e.iterRange(n,r),l=n;!a.next().done;l+=a.value.length)if(!a.lineBreak)for(;i=t.exec(a.value);)o(l+i.index,i)}class mQ{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:o,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,o)=>r(o,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,r,o)=>{let i=n(e,t,r);i&&o(r,r+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,r,o)=>o(r,r+e[0].length,n)}this.boundary=o,this.maxLength=i}createDeco(e){let t=new sW,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:o,to:i}of n)o=Math.max(e.state.doc.lineAt(o).from,o-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),r.length&&r[r.length-1].to>=o?r[r.length-1].to=i:r.push({from:o,to:i});return r}(e,this.maxLength))fQ(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,o,i,a)=>{a>=e.view.viewport.from&&i<=e.view.viewport.to&&(n=Math.min(i,n),r=Math.max(a,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let o of e.visibleRanges){let i=Math.max(o.from,n),a=Math.min(o.to,r);if(a>=i){let n=e.state.doc.lineAt(i),r=n.to<a?e.state.doc.lineAt(a):n,l=Math.max(o.from,n.from),s=Math.min(o.to,r.to);if(this.boundary){for(;i>n.from;i--)if(this.boundary.test(n.text[i-1-n.from])){l=i;break}for(;a<r.to;a++)if(this.boundary.test(r.text[a-r.from])){s=a;break}}let c,u=[],d=(e,t,n)=>u.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=l-n.from;(c=this.regexp.exec(n.text))&&c.index<s-n.from;)this.addMatch(c,e,c.index+n.from,d);else fQ(e.state.doc,this.regexp,l,s,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:l,filterTo:s,filter:(e,t)=>e<l||t>s,add:u})}}return t}}const gQ=null!=/x/.unicode?"gu":"g",vQ=new RegExp("[\0-\b\n--\u2028\u2029\ufeff-]",gQ),yQ={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let bQ=null;const wQ=yB.define({combine(e){let t=nW(e,{render:null,specialChars:vQ,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==bQ&&"undefined"!=typeof document&&document.body){let t=document.body.style;bQ=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return bQ||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,gQ)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,gQ)),t}});let kQ=null;class EQ extends XW{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function(e){return e>=32?"•":10==e?"":String.fromCharCode(9216+e)}(this.code),n=e.state.phrase("Control character")+" "+(yQ[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let o=document.createElement("span");return o.textContent=t,o.title=n,o.setAttribute("aria-label",n),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class OQ extends XW{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const xQ=ZW.line({class:"cm-activeLine"}),SQ=dV.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let o=e.lineBlockAt(r.head);o.from>t&&(n.push(xQ.range(o.from)),t=o.from)}return ZW.set(n)}},{decorations:e=>e.decorations});class _Q extends XW{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?sU(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=fU(t[0],"rtl"!=n.direction),o=parseInt(n.lineHeight);return r.bottom-r.top>1.5*o?{left:r.left,right:r.right,top:r.top,bottom:r.top+o}:r}ignoreEvent(){return!1}}const CQ=2e3;function PQ(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),o=n-r.from,i=o>CQ?-1:o==r.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):bW(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:i,off:o}}const TQ={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},AQ={style:"cursor: crosshair"},MQ="-10000px";class NQ{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let o=null;this.tooltipViews=this.tooltips.map(e=>o=n(e,o))}update(e,t){var n;let r=e.state.facet(this.facet),o=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],a=t?[]:null;for(let n=0;n<o.length;n++){let r=o[n],l=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(l=e)}if(l<0)i[n]=this.createTooltipView(r,n?i[n-1]:null),a&&(a[n]=!!r.above);else{let r=i[n]=this.tooltipViews[l];a&&(a[n]=t[l]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)i.indexOf(e)<0&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(a.forEach((e,n)=>t[n]=e),t.length=a.length),this.input=r,this.tooltips=o,this.tooltipViews=i,!0}}function DQ(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const IQ=yB.define({combine:e=>{var t,n,r;return{position:HW.ios?"absolute":(null===(t=e.find(e=>e.position))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find(e=>e.parent))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(r=e.find(e=>e.tooltipSpace))||void 0===r?void 0:r.tooltipSpace)||DQ}}}),LQ=new WeakMap,RQ=dV.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(IQ);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new NQ(e,BQ,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(IQ);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=MQ,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(HW.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),o=EV(this.view);return{visible:{left:r.left+o.left,top:r.top+o.top,right:r.right-o.right,bottom:r.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(IQ).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{visible:n,space:r,scaleX:o,scaleY:i}=e,a=[];for(let l=0;l<this.manager.tooltips.length;l++){let s=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,d=e.pos[l],p=e.size[l];if(!d||!1!==s.clip&&(d.bottom<=Math.max(n.top,r.top)||d.top>=Math.min(n.bottom,r.bottom)||d.right<Math.max(n.left,r.left)-.1||d.left>Math.min(n.right,r.right)+.1)){u.style.top=MQ;continue}let h=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=h?7:0,m=p.right-p.left,g=null!==(t=LQ.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||zQ,y=this.view.textDirection==CU.LTR,b=p.width>r.right-r.left?y?r.left:r.right-p.width:y?Math.max(r.left,Math.min(d.left-(h?14:0)+v.x,r.right-m)):Math.min(Math.max(r.left,d.left-m+(h?14:0)-v.x),r.right-m),w=this.above[l];!s.strictSide&&(w?d.top-g-f-v.y<r.top:d.bottom+g+f+v.y>r.bottom)&&w==r.bottom-d.bottom>d.top-r.top&&(w=this.above[l]=!w);let k=(w?d.top-r.top:r.bottom-d.bottom)-f;if(k<g&&!1!==c.resize){if(k<this.view.defaultLineHeight){u.style.top=MQ;continue}LQ.set(c,g),u.style.height=(g=k)/i+"px"}else u.style.height&&(u.style.height="");let E=w?d.top-g-f-v.y:d.bottom+f+v.y,O=b+m;if(!0!==c.overlap)for(let e of a)e.left<O&&e.right>b&&e.top<E+g&&e.bottom>E&&(E=w?e.top-g-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(E-e.parent.top)/i+"px",jQ(u,(b-e.parent.left)/o)):(u.style.top=E/i+"px",jQ(u,b/o)),h){let e=d.left+(y?v.x:-v.x)-(b+14-7);h.style.left=e/o+"px"}!0!==c.overlap&&a.push({left:b,top:E,right:O,bottom:E+g}),u.classList.toggle("cm-tooltip-above",w),u.classList.toggle("cm-tooltip-below",!w),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=MQ}},{eventObservers:{scroll(){this.maybeMeasure()}}});function jQ(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const FQ=Fq.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),zQ={x:0,y:0},BQ=yB.define({enables:[RQ,FQ]}),WQ=yB.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class UQ{static create(e){return new UQ(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new NQ(e,WQ,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(void 0!==r)if(void 0===t)t=r;else if(t!==r)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const VQ=BQ.compute([WQ],e=>{let t=e.facet(WQ);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos})),create:UQ.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class HQ{constructor(e,t,n,r,o){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,o=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),null==r)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),a=i&&i.dir==CU.RTL?-1:1;o=t.x<n.left?-a:a}let i=this.source(e,r,o);if(null==i?void 0:i.then){let t=this.pending={pos:r};i.then(n=>{this.pending==t&&(this.pending=null,!n||Array.isArray(n)&&!n.length||e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>lV(e.state,t,"hover tooltip"))}else!i||Array.isArray(i)&&!i.length||e.dispatch({effects:this.setHover.of(Array.isArray(i)?i:[i])})}get tooltip(){let e=this.view.plugin(RQ),t=e?e.manager.tooltips.findIndex(e=>e.create==UQ.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:o}=this;if(r.length&&o&&!function(e,t){let n,{left:r,right:o,top:i,bottom:a}=e.getBoundingClientRect();if(n=e.querySelector(".cm-tooltip-arrow")){let e=n.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=r-qQ&&t.clientX<=o+qQ&&t.clientY>=i-qQ&&t.clientY<=a+qQ}(o.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,i=null!==(n=null===(t=r[0])||void 0===t?void 0:t.end)&&void 0!==n?n:o;(o==i?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,r,o){let i=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(i.left>r||i.right<r||i.top>o||Math.min(i.bottom,a)<o)return!1;let l=e.posAtCoords({x:r,y:o},!1);return l>=t&&l<=n}(this.view,o,i,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const qQ=4;function QQ(e,t={}){let n=HB.define(),r=SB.define({create:()=>[],update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,iB.TrackDel);if(null!=e){let o=Object.assign(Object.create(null),n);o.pos=e,null!=o.end&&(o.end=r.changes.mapPos(o.end)),t.push(o)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(GQ)&&(e=[]);return e},provide:e=>WQ.from(e)});return{active:r,extension:[r,dV.define(o=>new HQ(o,e,r,n,t.hoverTime||300)),VQ]}}function $Q(e,t){let n=e.plugin(RQ);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const GQ=HB.define(),YQ=yB.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function XQ(e,t){let n=e.plugin(KQ),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const KQ=dV.fromClass(class{constructor(e){this.input=e.state.facet(e$),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(YQ);this.top=new ZQ(e,!0,t.topContainer),this.bottom=new ZQ(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(YQ);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new ZQ(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new ZQ(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(e$);if(n!=this.input){let t=n.filter(e=>e),r=[],o=[],i=[],a=[];for(let n of t){let t,l=this.specs.indexOf(n);l<0?(t=n(e.view),a.push(t)):(t=this.panels[l],t.update&&t.update(e)),r.push(t),(t.top?o:i).push(t)}this.specs=t,this.panels=r,this.top.sync(o),this.bottom.sync(i);for(let e of a)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Fq.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class ZQ{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=JQ(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=JQ(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function JQ(e){let t=e.nextSibling;return e.remove(),t}const e$=yB.define({enables:KQ});class t$ extends rW{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}t$.prototype.elementClass="",t$.prototype.toDOM=void 0,t$.prototype.mapMode=iB.TrackBefore,t$.prototype.startSide=t$.prototype.endSide=-1,t$.prototype.point=!0;const n$=yB.define(),r$=yB.define(),o$={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>lW.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},i$=yB.define();function a$(e){return[s$(),i$.of({...o$,...e})]}const l$=yB.define({combine:e=>e.some(e=>e)});function s$(e){let t=[c$];return e&&!1===e.fixed&&t.push(l$.of(!0)),t}const c$=dV.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(i$).map(t=>new h$(e,t)),this.fixed=!e.state.facet(l$);for(let e of this.gutters)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<.8*(n.to-n.from))}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(l$)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=lW.iter(this.view.state.facet(n$),this.view.viewport.from),r=[],o=this.gutters.map(e=>new p$(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let i of e.type)if(i.type==KW.Text&&t){d$(n,r,i.from);for(let e of o)e.line(this.view,i,r);t=!1}else if(i.widget)for(let e of o)e.widget(this.view,i)}else if(e.type==KW.Text){d$(n,r,e.from);for(let t of o)t.line(this.view,e,r)}else if(e.widget)for(let t of o)t.widget(this.view,e);for(let e of o)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(i$),n=e.state.facet(i$),r=e.docChanged||e.heightChanged||e.viewportChanged||!lW.eq(e.startState.facet(n$),e.state.facet(n$),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let o=[];for(let r of n){let n=t.indexOf(r);n<0?o.push(new h$(this.view,r)):(this.gutters[n].update(e),o.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),o.indexOf(e)<0&&e.destroy();for(let e of o)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=o}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>Fq.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,o=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==CU.LTR?{left:r,right:o}:{right:r,left:o}})});function u$(e){return Array.isArray(e)?e:[e]}function d$(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class p${constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=lW.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,o=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==r.elements.length){let t=new f$(e,i,o,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,i,o,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];d$(this.cursor,r,t.from),n.length&&(r=r.concat(n));let o=this.gutter.config.lineMarker(e,t,r);o&&r.unshift(o);let i=this.gutter;(0!=r.length||i.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(r$)){let o=n(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class h${constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let o,i=r.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,r)&&r.preventDefault()});this.markers=u$(t.markers(e)),t.initialSpacer&&(this.spacer=new f$(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=u$(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!lW.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class f${constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let o=0,i=0;;){let a=i,l=o<t.length?t[o++]:null,s=!1;if(l){let e=l.elementClass;e&&(n+=" "+e);for(let e=i;e<this.markers.length;e++)if(this.markers[e].compare(l)){a=e,s=!0;break}}else a=this.markers.length;for(;i<a;){let e=this.markers[i++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!l)break;l.toDOM&&(s?r=r.nextSibling:this.dom.insertBefore(l.toDOM(e),r)),s&&i++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}const m$=yB.define(),g$=yB.define(),v$=yB.define({combine:e=>nW(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],o=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||o(e,t,n):o}return n}})});class y$ extends t${constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function b$(e,t){return e.state.facet(v$).formatNumber(t,e.state)}const w$=i$.compute([v$],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(m$),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new y$(b$(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(g$)){let o=r(e,t,n);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(v$)!=e.state.facet(v$),initialSpacer:e=>new y$(b$(e,k$(e.state.doc.lines))),updateSpacer(e,t){let n=b$(t.view,k$(t.view.state.doc.lines));return n==e.number?e:new y$(n)},domEventHandlers:e.facet(v$).domEventHandlers,side:"before"}));function k$(e){let t=9;for(;t<e;)t=10*t+9;return t}const E$=new class extends t${constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},O$=n$.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.head).from;o>n&&(n=o,t.push(E$.range(o)))}return lW.of(t)});var x$;const S$=new Hj;const _$=new Hj;class C${constructor(e,t,n=[],r=""){this.data=e,this.name=r,tW.prototype.hasOwnProperty("tree")||Object.defineProperty(tW.prototype,"tree",{get(){return A$(this)}}),this.parser=t,this.extension=[z$.of(this),tW.languageData.of((e,t,n)=>{let r=P$(e,t,n),o=r.type.prop(S$);if(!o)return[];let i=e.facet(o),a=r.type.prop(_$);if(a){let o=r.resolve(t-r.from,n);for(let t of a)if(t.test(o,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i})].concat(n)}isActiveAt(e,t,n=-1){return P$(e,t,n).type.prop(S$)==this.data}findRegions(e){let t=e.facet(z$);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(S$)==this.data)return void n.push({from:t,to:t+e.length});let o=e.prop(Hj.mounted);if(o){if(o.tree.prop(S$)==this.data){if(o.overlay)for(let e of o.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(o.overlay){let e=n.length;if(r(o.tree,o.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let o=e.children[n];o instanceof Zj&&r(o,e.positions[n]+t)}};return r(A$(e),0),n}get allowsNesting(){return!0}}function P$(e,t,n){let r=e.facet(z$),o=A$(e).topNode;if(!r||r.allowsNesting)for(let e=o;e;e=e.enter(t,n,Kj.ExcludeBuffers))e.type.isTop&&(o=e);return o}C$.setState=HB.define();class T$ extends C${constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=(n=e.languageData,yB.define({combine:n?e=>e.concat(n):void 0}));var n;return new T$(t,e.parser.configure({props:[S$.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new T$(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function A$(e){let t=e.field(C$.state,!1);return t?t.tree:Zj.empty}class M${constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let N$=null;class D${constructor(e,t,n=[],r,o,i,a,l){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=o,this.viewport=i,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new D$(e,t,[],Zj.empty,0,n,[],null)}startParse(){return this.parser.startParse(new M$(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=Zj.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(vF.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(vF.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=N$;N$=this;try{return e()}finally{N$=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=I$(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:o,viewport:i,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,o)=>t.push({fromA:e,toA:n,fromB:r,toB:o})),n=vF.applyChanges(n,t),r=Zj.empty,o=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&a.push({from:n,to:r})}}}return new D$(this.parser,t,n,r,o,i,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=I$(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends yF{createParse(t,n,r){let o=r[0].from,i=r[r.length-1].to;return{parsedPos:o,advance(){let t=N$;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new Zj($j.none,[],[],i-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return N$}}function I$(e,t,n){return vF.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class L${constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new L$(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=D$.create(e.facet(z$).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new L$(n)}}C$.state=SB.define({create:L$.init,update(e,t){for(let e of t.effects)if(e.is(C$.setState))return e.value;return t.startState.facet(z$)!=t.state.facet(z$)?L$.init(t.state):e.apply(t)}});let R$=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(R$=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const j$="undefined"!=typeof navigator&&(null===(x$=navigator.scheduling)||void 0===x$?void 0:x$.isInputPending)?()=>navigator.scheduling.isInputPending():null,F$=dV.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(C$.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(C$.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=R$(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,o=n.field(C$.state);if(o.tree==o.context.tree&&o.context.isDone(r+1e5))return;let i=Date.now()+Math.min(this.chunkBudget,100,e&&!j$?Math.max(25,e.timeRemaining()-5):1e9),a=o.context.treeLen<r&&n.doc.length>r+1e3,l=o.context.work(()=>j$&&j$()||Date.now()>i,r+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:C$.setState.of(new L$(o.context))})),this.chunkBudget>0&&(!l||a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>lV(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),z$=yB.define({combine:e=>e.length?e[0]:null,enables:e=>[C$.state,F$,Fq.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class B${constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const W$=yB.define(),U$=yB.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function V$(e){let t=e.facet(U$);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function H$(e,t){let n="",r=e.tabSize,o=e.facet(U$)[0];if("\t"==o){for(;t>=r;)n+="\t",t-=r;o=" "}for(let e=0;e<t;e++)n+=o;return n}function q$(e,t){e instanceof tW&&(e=new Q$(e));for(let n of e.state.facet(W$)){let r=n(e,t);if(void 0!==r)return r}let n=A$(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),o=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(o!=r.node){let e=[];for(let t=o;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return G$(r,e,n)}(e,n,t):null}class Q${constructor(e,t={}){this.state=e,this.options=t,this.unit=V$(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:o}=this.options;return null!=r&&r>=n.from&&r<=n.to?o&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),o=this.countColumn(n,e-r),i=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return i>-1&&(o+=i-this.countColumn(n,n.search(/\S|$/))),o}countColumn(e,t=e.length){return bW(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let e=o(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const $$=new Hj;function G$(e,t,n){for(let r=e;r;r=r.next){let e=Y$(r.node);if(e)return e(K$.create(t,n,r))}return 0}function Y$(e){let t=e.type.prop($$);if(t)return t;let n,r=e.firstChild;if(r&&(n=r.type.prop(Hj.closedBy))){let t=e.lastChild,r=t&&n.indexOf(t.name)>-1;return e=>function(e,t,n,r,o){let i=e.textAfter,a=i.match(/^\s*/)[0].length,l=r&&i.slice(a,a+r.length)==r||o==e.pos+a,s=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let o=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),a=null==o||o<=i.from?i.to:Math.min(i.to,o);for(let e=n.to;;){let o=t.childAfter(e);if(!o||o==r)return null;if(!o.type.isSkipped){if(o.from>=a)return null;let e=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+e}}e=o.to}}(e):null;return s?l?e.column(s.from):e.column(s.to):e.baseIndent+(l?0:e.unit*n)}(e,!0,1,void 0,r&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?X$:null}function X$(){return 0}class K$ extends Q${constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new K$(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Z$(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return G$(this.context.next,this.base,this.pos)}}function Z$(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function J$({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}const eG=yB.define(),tG=new Hj;function nG(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function rG(e,t,n){for(let r of e.facet(eG)){let o=r(e,t,n);if(o)return o}return function(e,t,n){let r=A$(e);if(r.length<n)return null;let o=null;for(let i=r.resolveStack(n,1);i;i=i.next){let a=i.node;if(a.to<=n||a.from>n)continue;if(o&&a.from<t)break;let l=a.type.prop(tG);if(l&&(a.to<r.length-50||r.length==e.doc.length||!nG(a))){let r=l(a,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function oG(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const iG=HB.define({map:oG}),aG=HB.define({map:oG});function lG(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}const sG=SB.define({create:()=>ZW.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=cG(e,t,n)),e=e.map(t.changes);for(let n of t.effects)if(n.is(iG)&&!dG(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(gG),o=r?ZW.replace({widget:new wG(r(t.state,n.value))}):bG;e=e.update({add:[o.range(n.value.from,n.value.to)]})}else n.is(aG)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=cG(e,t.selection.main.head)),e},provide:e=>Fq.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],o=e[n++];if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid JSON for fold state");t.push(bG.range(r,o))}return ZW.set(t,!0)}});function cG(e,t,n=t){let r=!1;return e.between(t,n,(e,o)=>{e<n&&o>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function uG(e,t,n){var r;let o=null;return null===(r=e.field(sG,!1))||void 0===r||r.between(t,n,(e,t)=>{(!o||o.from>e)&&(o={from:e,to:t})}),o}function dG(e,t,n){let r=!1;return e.between(t,t,(e,o)=>{e==t&&o==n&&(r=!0)}),r}function pG(e,t){return e.field(sG,!1)?t:t.concat(HB.appendConfig.of(vG()))}function hG(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,o=e.state.doc.lineAt(t.to).number;return Fq.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${o}.`)}const fG=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of lG(e)){let n=rG(e.state,t.from,t.to);if(n)return e.dispatch({effects:pG(e.state,[iG.of(n),hG(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(sG,!1))return!1;let t=[];for(let n of lG(e)){let r=uG(e.state,n.from,n.to);r&&t.push(aG.of(r),hG(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let o=e.lineBlockAt(r),i=rG(t,o.from,o.to);i&&n.push(iG.of(i)),r=(i?e.lineBlockAt(i.to):o).to+1}return n.length&&e.dispatch({effects:pG(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(sG,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(aG.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],mG={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},gG=yB.define({combine:e=>nW(e,mG)});function vG(e){let t=[sG,OG];return e&&t.push(gG.of(e)),t}function yG(e,t){let{state:n}=e,r=n.facet(gG),o=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=uG(e.state,n.from,n.to);r&&e.dispatch({effects:aG.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,o,t);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=o,i}const bG=ZW.replace({widget:new class extends XW{toDOM(e){return yG(e,null)}}});class wG extends XW{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return yG(e,this.value)}}const kG={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class EG extends t${constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}const OG=Fq.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class xG{constructor(e,t){let n;function r(e){let t=xW.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const o="string"==typeof t.all?t.all:t.all?r(t.all):void 0,i=t.scope;this.scope=i instanceof C$?e=>e.prop(S$)==i.data:i?e=>e==i:void 0,this.style=ZF(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:o}).style,this.module=n?new xW(n):null,this.themeType=t.themeType}static define(e,t){return new xG(e,t||{})}}const SG=yB.define(),_G=yB.define({combine:e=>e.length?[e[0]]:null});function CG(e){let t=e.facet(SG);return t.length?t:e.facet(_G)}function PG(e,t){let n,r=[AG];return e instanceof xG&&(e.module&&r.push(Fq.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?r.push(_G.of(e)):n?r.push(SG.computeN([Fq.darkTheme],t=>t.facet(Fq.darkTheme)==("dark"==n)?[e]:[])):r.push(SG.of(e)),r}class TG{constructor(e){this.markCache=Object.create(null),this.tree=A$(e.state),this.decorations=this.buildDeco(e,CG(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=A$(e.state),n=CG(e.state),r=n!=CG(e.startState),{viewport:o}=e.view,i=e.changes.mapPos(this.decoratedTo,1);t.length<o.to&&!r&&t.type==this.tree.type&&i>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=i):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return ZW.none;let n=new sW;for(let{from:r,to:o}of e.visibleRanges)JF(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=ZW.mark({class:r})))},r,o);return n.finish()}}const AG=CB.high(dV.fromClass(TG,{decorations:e=>e.decorations})),MG=xG.define([{tag:gz.meta,color:"#404740"},{tag:gz.link,textDecoration:"underline"},{tag:gz.heading,textDecoration:"underline",fontWeight:"bold"},{tag:gz.emphasis,fontStyle:"italic"},{tag:gz.strong,fontWeight:"bold"},{tag:gz.strikethrough,textDecoration:"line-through"},{tag:gz.keyword,color:"#708"},{tag:[gz.atom,gz.bool,gz.url,gz.contentSeparator,gz.labelName],color:"#219"},{tag:[gz.literal,gz.inserted],color:"#164"},{tag:[gz.string,gz.deleted],color:"#a11"},{tag:[gz.regexp,gz.escape,gz.special(gz.string)],color:"#e40"},{tag:gz.definition(gz.variableName),color:"#00f"},{tag:gz.local(gz.variableName),color:"#30a"},{tag:[gz.typeName,gz.namespace],color:"#085"},{tag:gz.className,color:"#167"},{tag:[gz.special(gz.variableName),gz.macroName],color:"#256"},{tag:gz.definition(gz.propertyName),color:"#00c"},{tag:gz.comment,color:"#940"},{tag:gz.invalid,color:"#f00"}]),NG=Fq.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),DG="()[]{}",IG=yB.define({combine:e=>nW(e,{afterCursor:!0,brackets:DG,maxScanDistance:1e4,renderMatch:jG})}),LG=ZW.mark({class:"cm-matchingBracket"}),RG=ZW.mark({class:"cm-nonmatchingBracket"});function jG(e){let t=[],n=e.matched?LG:RG;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const FG=SB.define({create:()=>ZW.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(IG);for(let e of t.state.selection.ranges){if(!e.empty)continue;let o=VG(t.state,e.head,-1,r)||e.head>0&&VG(t.state,e.head-1,1,r)||r.afterCursor&&(VG(t.state,e.head,1,r)||e.head<t.state.doc.length&&VG(t.state,e.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,t.state)))}return ZW.set(n,!0)},provide:e=>Fq.decorations.from(e)}),zG=[FG,NG],BG=new Hj;function WG(e,t,n){let r=e.prop(t<0?Hj.openedBy:Hj.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function UG(e){let t=e.type.prop(BG);return t?t(e.node):e}function VG(e,t,n,r={}){let o=r.maxScanDistance||1e4,i=r.brackets||DG,a=A$(e),l=a.resolveInner(t,n);for(let e=l;e;e=e.parent){let r=WG(e.type,n,i);if(r&&e.from<e.to){let o=UG(e);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return HG(0,0,n,e,o,r,i)}}return function(e,t,n,r,o,i,a){let l=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=a.indexOf(l);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=i;){let i=u.value;n<0&&(e+=i.length);let l=t+e*n;for(let e=n>0?0:i.length-1,t=n>0?i.length:-1;e!=t;e+=n){let t=a.indexOf(i[e]);if(!(t<0||r.resolveInner(l+e,1).type!=o))if(t%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:l+e,to:l+e+1},matched:t>>1==s>>1};d--}}n>0&&(e+=i.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,a,l.type,o,i)}function HG(e,t,n,r,o,i,a){let l=r.parent,s={from:o.from,to:o.to},c=0,u=null==l?void 0:l.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do{if(n<0?u.to<=r.from:u.from>=r.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from<u.to){let e=UG(u);return{start:s,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(WG(u.type,n,a))c++;else if(WG(u.type,-n,a)){if(0==c){let e=UG(u);return{start:s,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:s,matched:!1}}const qG=Object.create(null),QG=[$j.none],$G=[],GG=Object.create(null),YG=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])YG[e]=KG(qG,t);function XG(e,t){$G.indexOf(e)>-1||($G.push(e),console.warn(t))}function KG(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||gz[n];r?"function"==typeof r?t.length?t=t.map(r):XG(n,`Modifier ${n} used at start of tag`):t.length?XG(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:XG(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),o=r+" "+n.map(e=>e.id),i=GG[o];if(i)return i.id;let a=GG[o]=$j.define({id:QG.length,name:r,props:[YF({[r]:n})]});return QG.push(a),a.id}CU.RTL,CU.LTR;let ZG=null;function JG(){if(!ZG&&"object"==typeof document&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)"cssText"!=r&&"cssFloat"!=r&&"string"==typeof e[r]&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));ZG=t.sort().map(e=>({type:"property",label:e,apply:e+": "}))}return ZG||[]}const eY=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),tY=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),nY=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),rY=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),oY=/^(\w[\w-]*|-\w[\w-]*|)$/,iY=/^-(-[\w-]*)?$/,aY=new gF,lY=["Declaration"];function sY(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function cY(e,t,n){if(t.to-t.from>4096){let r=aY.get(t);if(r)return r;let o=[],i=new Set,a=t.cursor(Kj.IncludeAnonymous);if(a.firstChild())do{for(let t of cY(e,a.node,n))i.has(t.label)||(i.add(t.label),o.push(t))}while(a.nextSibling());return aY.set(t,o),o}{let r=[],o=new Set;return t.cursor().iterate(t=>{var i;if(n(t)&&t.matchContext(lY)&&":"==(null===(i=t.node.nextSibling)||void 0===i?void 0:i.name)){let n=e.sliceString(t.from,t.to);o.has(n)||(o.add(n),r.push({label:n,type:"variable"}))}}),r}}const uY=e=>t=>{let{state:n,pos:r}=t,o=A$(n).resolveInner(r,-1),i=o.type.isError&&o.from==o.to-1&&"-"==n.doc.sliceString(o.from,o.to);if("PropertyName"==o.name||(i||"TagName"==o.name)&&/^(Block|Styles)$/.test(o.resolve(o.to).name))return{from:o.from,options:JG(),validFor:oY};if("ValueName"==o.name)return{from:o.from,options:tY,validFor:oY};if("PseudoClassName"==o.name)return{from:o.from,options:eY,validFor:oY};if(e(o)||(t.explicit||i)&&function(e,t){var n;if(("("==e.name||e.type.isError)&&(e=e.parent||e),"ArgList"!=e.name)return!1;let r=null===(n=e.parent)||void 0===n?void 0:n.firstChild;return"Callee"==(null==r?void 0:r.name)&&"var"==t.sliceString(r.from,r.to)}(o,n.doc))return{from:e(o)||i?o.from:r,options:cY(n.doc,sY(o),e),validFor:iY};if("TagName"==o.name){for(let{parent:e}=o;e;e=e.parent)if("Block"==e.name)return{from:o.from,options:JG(),validFor:oY};return{from:o.from,options:nY,validFor:oY}}if("AtKeyword"==o.name)return{from:o.from,options:rY,validFor:oY};if(!t.explicit)return null;let a=o.resolve(r),l=a.childBefore(r);return l&&":"==l.name&&"PseudoClassSelector"==a.name?{from:r,options:eY,validFor:oY}:l&&":"==l.name&&"Declaration"==a.name||"ArgList"==a.name?{from:r,options:tY,validFor:oY}:"Block"==a.name||"Styles"==a.name?{from:r,options:JG(),validFor:oY}:null},dY=uY(e=>"VariableName"==e.name),pY=T$.define({name:"css",parser:Nz.configure({props:[$$.add({Declaration:J$()}),tG.add({"Block KeyframeList":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function hY(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r];"string"==typeof o?e.setAttribute(r,o):null!=o&&(e[r]=o)}t++}for(;t<arguments.length;t++)fY(e,arguments[t]);return e}function fY(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)fY(e,t[n])}}class mY{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class gY{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(AY).markerFilter;r&&(e=r(e,n));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),i=new sW,a=[],l=0,s=n.doc.iter(),c=0,u=n.doc.length;for(let e=0;;){let t,n,r=e==o.length?null:o[e];if(!r&&!a.length)break;if(a.length)t=l,n=a.reduce((e,t)=>Math.min(e,t.to),r&&r.from>t?r.from:1e8);else{if(t=r.from,t>u)break;n=r.to,a.push(r),e++}for(;e<o.length;){let r=o[e];if(r.from!=t||!(r.to>r.from||r.to==t)){n=Math.min(r.from,n);break}a.push(r),e++,n=Math.min(r.to,n)}n=Math.min(n,u);let d=!1;if(a.some(e=>e.from==t&&(e.to==n||n==u))&&(d=t==n,!d&&n-t<10)){let e=t-(c+s.value.length);e>0&&(s.next(e),c=t);for(let e=t;;){if(e>=n){d=!0;break}if(!s.lineBreak&&c+s.value.length>e)break;e=c+s.value.length,c+=s.value.length,s.next()}}let p=UY(a);if(d)i.add(t,t,ZW.widget({widget:new LY(p),diagnostics:a.slice()}));else{let e=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");i.add(t,n,ZW.mark({class:"cm-lintRange cm-lintRange-"+p+e,diagnostics:a.slice(),inclusiveEnd:a.some(e=>e.to>n)}))}if(l=n,l==u)break;for(let e=0;e<a.length;e++)a[e].to<=l&&a.splice(e--,1)}let d=i.finish();return new gY(d,t,vY(d))}}function vY(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:o})=>{if(!(t&&o.diagnostics.indexOf(t)<0))if(r){if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new mY(r.from,n,r.diagnostic)}else r=new mY(e,n,t||o.diagnostics[0])}),r}function yY(e,t){let n=t.pos,r=t.end||n,o=e.state.facet(AY).hideOn(e,n,r);if(null!=o)return o;let i=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(wY))&&!e.changes.touchesRange(i.from,Math.max(i.to,r)))}function bY(e,t){return e.field(OY,!1)?t:t.concat(HB.appendConfig.of(XY))}const wY=HB.define(),kY=HB.define(),EY=HB.define(),OY=SB.define({create:()=>new gY(ZW.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,o=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=vY(n,e.selected.diagnostic,o)||vY(n,null,o)}!n.size&&o&&t.state.facet(AY).autoPanel&&(o=null),e=new gY(n,o,r)}for(let n of t.effects)if(n.is(wY)){let r=t.state.facet(AY).autoPanel?n.value.length?jY.open:null:e.panel;e=gY.init(n.value,r,t.state)}else n.is(kY)?e=new gY(e.diagnostics,n.value?jY.open:null,e.selected):n.is(EY)&&(e=new gY(e.diagnostics,e.panel,n.value));return e},provide:e=>[e$.from(e,e=>e.panel),Fq.decorations.from(e,e=>e.diagnostics)]}),xY=ZW.mark({class:"cm-lintRange cm-lintRange-active"});function SY(e,t,n){let r,{diagnostics:o}=e.state.field(OY),i=-1,a=-1;o.between(t-(n<0?1:0),t+(n>0?1:0),(e,o,{spec:l})=>{if(t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t<o||n<0)))return r=l.diagnostics,i=e,a=o,!1});let l=e.state.facet(AY).tooltipFilter;return r&&l&&(r=l(r,e.state)),r?{pos:i,end:a,above:e.state.doc.lineAt(i).to<a,create:()=>({dom:_Y(e,r)})}:null}function _Y(e,t){return hY("ul",{class:"cm-tooltip-lint"},t.map(t=>IY(e,t,!1)))}const CY=e=>{let t=e.state.field(OY,!1);return!(!t||!t.panel||(e.dispatch({effects:kY.of(!1)}),0))},PY=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(OY,!1);t&&t.panel||e.dispatch({effects:bY(e.state,[kY.of(!0)])});let n=XQ(e,jY.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(OY,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!(!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),0))}}],TY=dV.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(AY);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(AY);t.length&&function(e,t,n){let r=[],o=-1;for(let i of e)i.then(n=>{r.push(n),clearTimeout(o),r.length==e.length?t(r):o=setTimeout(()=>t(r),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:bY(e,[wY.of(t)])}}(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{lV(this.view.state,e)})}}update(e){let t=e.state.facet(AY);(e.docChanged||t!=e.startState.facet(AY)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),AY=yB.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...nW(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:MY,tooltipFilter:MY,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,o)=>e(n,r,o)||t(n,r,o):e:t,autoPanel:(e,t)=>e||t})})});function MY(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function NY(e,t={}){return[AY.of({source:e,config:t}),TY,XY]}function DY(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function IY(e,t,n){var r;let o=n?DY(t.actions):[];return hY("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},hY("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(r=t.actions)||void 0===r?void 0:r.map((n,r)=>{let i=!1,a=r=>{if(r.preventDefault(),i)return;i=!0;let o=vY(e.state.field(OY).diagnostics,t);o&&n.apply(e,o.from,o.to)},{name:l}=n,s=o[r]?l.indexOf(o[r]):-1,c=s<0?l:[l.slice(0,s),hY("u",l.slice(s,s+1)),l.slice(s+1)];return hY("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:a,onmousedown:a,"aria-label":` Action: ${l}${s<0?"":` (access key "${o[r]})"`}.`},c)}),t.source&&hY("div",{class:"cm-diagnosticSource"},t.source))}class LY extends XW{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return hY("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class RY{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=IY(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class jY{constructor(e){this.view=e,this.items=[],this.list=hY("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)CY(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],r=DY(n.actions);for(let o=0;o<r.length;o++)if(r[o].toUpperCase().charCodeAt(0)==t.keyCode){let t=vY(this.view.state.field(OY).diagnostics,n);t&&n.actions[o].apply(e,t.from,t.to)}}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=hY("div",{class:"cm-panel-lint"},this.list,hY("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>CY(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(OY).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(OY),n=0,r=!1,o=null,i=new Set;for(e.between(0,this.view.state.doc.length,(e,a,{spec:l})=>{for(let e of l.diagnostics){if(i.has(e))continue;i.add(e);let a,l=-1;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){l=t;break}l<0?(a=new RY(this.view,e),this.items.splice(n,0,a),r=!0):(a=this.items[l],l>n&&(this.items.splice(n,l-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),o=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new RY(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=vY(this.view.state.field(OY).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:EY.of(t)})}static open(e){return new jY(e)}}function FY(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function zY(e){return FY(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const BY=Fq.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:zY("#d11")},".cm-lintRange-warning":{backgroundImage:zY("orange")},".cm-lintRange-info":{backgroundImage:zY("#999")},".cm-lintRange-hint":{backgroundImage:zY("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function WY(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function UY(e){let t="hint",n=1;for(let r of e){let e=WY(r.severity);e>n&&(n=e,t=r.severity)}return t}class VY extends t${constructor(e){super(),this.diagnostics=e,this.severity=UY(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,r=e.state.facet(KY).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>function(e,t,n){function r(){let r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:$Y.of({pos:r.from,above:!1,clip:!1,create:()=>({dom:_Y(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=r=>{let o=t.getBoundingClientRect();if(!(r.clientX>o.left-10&&r.clientX<o.right+10&&r.clientY>o.top-10&&r.clientY<o.bottom+10)){for(let e=r.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),e.state.field(GY)&&e.dispatch({effects:$Y.of(null)})}};window.addEventListener("mousemove",n)}(e,t)}let{hoverTime:o}=e.state.facet(KY),i=setTimeout(r,o);t.onmouseout=()=>{clearTimeout(i),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(i),i=setTimeout(r,o)}}(e,t,n)),t}}function HY(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new VY(n[e]).range(+e));return lW.of(r,!0)}const qY=a$({class:"cm-gutter-lint",markers:e=>e.state.field(QY),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(QY).between(n.from,n.to,(e,t,o)=>{e>n.from&&e<n.to&&r.push(...o.diagnostics)}),r.length?new VY(r):null}}),QY=SB.define({create:()=>lW.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(KY).markerFilter;for(let r of t.effects)if(r.is(wY)){let o=r.value;n&&(o=n(o||[],t.state)),e=HY(t.state.doc,o.slice(0))}return e}}),$Y=HB.define(),GY=SB.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=yY(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is($Y)?t.value:e,e)),provide:e=>BQ.from(e)}),YY=Fq.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:FY('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:FY('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:FY('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),XY=[OY,Fq.decorations.compute([OY],e=>{let{selected:t,panel:n}=e.field(OY);return t&&n&&t.from!=t.to?ZW.set([xY.range(t.from,t.to)]):ZW.none}),QQ(SY,{hideOn:yY}),BY],KY=yB.define({combine:e=>nW(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function ZY(e={}){return[KY.of(e),QY,qY,YY,GY]}function JY(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);return!!o&&(r(n.update(o)),!0)}}const eX=JY(aX,0),tX=JY(iX,0),nX=JY((e,t)=>iX(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=n.to<=r.to?r:e.doc.lineAt(n.to);o.from>r.from&&o.from==n.to&&(o=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let i=t.length-1;i>=0&&t[i].to>r.from?t[i].to=o.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return t}(t)),0);function rX(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const oX=50;function iX(e,t,n=t.selection.ranges){let r=n.map(e=>rX(t,e.from).block);if(!r.every(e=>e))return null;let o=n.map((e,n)=>function(e,{open:t,close:n},r,o){let i,a,l=e.sliceDoc(r-oX,r),s=e.sliceDoc(o,o+oX),c=/\s*$/.exec(l)[0].length,u=/^\s*/.exec(s)[0].length,d=l.length-c;if(l.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:o+u,margin:u&&1}};o-r<=2*oX?i=a=e.sliceDoc(r,o):(i=e.sliceDoc(r,r+oX),a=e.sliceDoc(o-oX,o));let p=/^\s*/.exec(i)[0].length,h=/\s*$/.exec(a)[0].length,f=a.length-h-n.length;return i.slice(p,p+t.length)==t&&a.slice(f,f+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(i.charAt(p+t.length))?1:0},close:{pos:o-h-n.length,margin:/\s/.test(a.charAt(f-1))?1:0}}:null}(t,r[n],e.from,e.to));if(2!=e&&!o.every(e=>e))return{changes:t.changes(n.map((e,t)=>o[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&o.some(e=>e)){let e=[];for(let t,n=0;n<o.length;n++)if(t=o[n]){let o=r[n],{open:i,close:a}=t;e.push({from:i.pos-o.open.length,to:i.pos+i.margin},{from:a.pos-a.margin,to:a.pos+o.close.length})}return{changes:e}}return null}function aX(e,t,n=t.selection.ranges){let r=[],o=-1;for(let{from:e,to:i}of n){let n=r.length,a=1e9,l=rX(t,e).line;if(l){for(let n=e;n<=i;){let s=t.doc.lineAt(n);if(s.from>o&&(e==i||i>s.from)){o=s.from;let e=/^\s*/.exec(s.text)[0].length,t=e==s.length,n=s.text.slice(e,e+l.length)==l?e:-1;e<s.text.length&&e<a&&(a=e),r.push({line:s,comment:n,token:l,indent:e,empty:t,single:!1})}n=s.to+1}if(a<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=a);r.length==n+1&&(r[n].single=!0)}}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:o,empty:i,single:a}of r)!a&&i||e.push({from:t.from+o,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:o}of r)if(n>=0){let r=t.from+n,i=r+o.length;" "==t.text[i-t.from]&&i++,e.push({from:r,to:i})}return{changes:e}}return null}const lX=WB.define(),sX=WB.define(),cX=yB.define(),uX=yB.define({combine:e=>nW(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),dX=SB.define({create:()=>CX.empty,update(e,t){let n=t.state.facet(uX),r=t.annotation(lX);if(r){let o=vX.fromTransaction(t,r.selection),i=r.side,a=0==i?e.undone:e.done;return a=o?yX(a,a.length,n.minDepth,o):EX(a,t.startState.selection),new CX(0==i?r.rest:a,0==i?a:r.rest)}let o=t.annotation(sX);if("full"!=o&&"before"!=o||(e=e.isolate()),!1===t.annotation(qB.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=vX.fromTransaction(t),a=t.annotation(qB.time),l=t.annotation(qB.userEvent);return i?e=e.addChanges(i,a,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),"full"!=o&&"after"!=o||(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new CX(e.done.map(vX.fromJSON),e.undone.map(vX.fromJSON))});function pX(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(dX,!1);if(!o)return!1;let i=o.pop(e,n,t);return!!i&&(r(i),!0)}}const hX=pX(0,!1),fX=pX(1,!1),mX=pX(0,!0),gX=pX(1,!0);class vX{constructor(e,t,n,r,o){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new vX(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new vX(e.changes&&lB.fromJSON(e.changes),[],e.mapped&&aB.fromJSON(e.mapped),e.startSelection&&mB.fromJSON(e.startSelection),e.selectionsAfter.map(mB.fromJSON))}static fromTransaction(e,t){let n=wX;for(let t of e.startState.facet(cX)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new vX(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,wX)}static selection(e){return new vX(void 0,wX,void 0,void 0,e)}}function yX(e,t,n,r){let o=t+1>n+20?t-n-1:0,i=e.slice(o,t);return i.push(r),i}function bX(e,t){return e.length?t.length?e.concat(t):e:t}const wX=[],kX=200;function EX(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-kX));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),yX(e,e.length-1,1e9,n.setSelAfter(r)))}return[vX.selection([t])]}function OX(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function xX(e,t){if(!e.length)return e;let n=e.length,r=wX;for(;n;){let o=SX(e[n-1],t,r);if(o.changes&&!o.changes.empty||o.effects.length){let t=e.slice(0,n);return t[n-1]=o,t}t=o.mapped,n--,r=o.selectionsAfter}return r.length?[vX.selection(r)]:wX}function SX(e,t,n){let r=bX(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):wX,n);if(!e.changes)return vX.selection(r);let o=e.changes.map(t),i=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(i):i;return new vX(o,HB.mapEffects(e.effects,t),a,e.startSelection.map(i),r)}const _X=/^(input\.type|delete)($|\.)/;class CX{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new CX(this.done,this.undone):this}addChanges(e,t,n,r,o){let i=this.done,a=i[i.length-1];return i=a&&a.changes&&!a.changes.empty&&e.changes&&(!n||_X.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,function(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,o,i)=>{for(let e=0;e<n.length;){let t=n[e++],a=n[e++];i>=t&&o<=a&&(r=!0)}}),r}(a.changes,e.changes))||"input.type.compose"==n)?yX(i,i.length-1,r.minDepth,new vX(e.changes.compose(a.changes),bX(HB.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,wX)):yX(i,i.length,r.minDepth,e),new CX(i,wX,t,n)}addSelection(e,t,n,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:wX;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1],a=e,i.ranges.length==a.ranges.length&&0===i.ranges.filter((e,t)=>e.empty!=a.ranges[t].empty).length)?this:new CX(EX(this.done,e),this.undone,t,n);var i,a}addMapping(e){return new CX(xX(this.done,e),xX(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let o=r[r.length-1],i=o.selectionsAfter[0]||t.selection;if(n&&o.selectionsAfter.length)return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:lX.of({side:e,rest:OX(r),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let n=1==r.length?wX:r.slice(0,r.length-1);return o.mapped&&(n=xX(n,o.mapped)),t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:lX.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}CX.empty=new CX(wX,wX);const PX=[{key:"Mod-z",run:hX,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:fX,preventDefault:!0},{linux:"Ctrl-Shift-z",run:fX,preventDefault:!0},{key:"Mod-u",run:mX,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:gX,preventDefault:!0}];function TX(e,t){return mB.create(e.ranges.map(t),e.mainIndex)}function AX(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function MX({state:e,dispatch:t},n){let r=TX(e.selection,n);return!r.eq(e.selection,!0)&&(t(AX(e,r)),!0)}function NX(e,t){return mB.cursor(t?e.to:e.from)}function DX(e,t){return MX(e,n=>n.empty?e.moveByChar(n,t):NX(n,t))}function IX(e){return e.textDirectionAt(e.state.selection.main.head)==CU.LTR}const LX=e=>DX(e,!IX(e)),RX=e=>DX(e,IX(e));function jX(e,t){return MX(e,n=>n.empty?e.moveByGroup(n,t):NX(n,t))}function FX(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function zX(e,t,n){let r,o,i=A$(e).resolveInner(t.head),a=n?Hj.closedBy:Hj.openedBy;for(let r=t.head;;){let t=n?i.childAfter(r):i.childBefore(r);if(!t)break;FX(e,t,a)?i=t:r=n?t.to:t.from}return o=i.type.prop(a)&&(r=n?VG(e,i.from,1):VG(e,i.to,-1))&&r.matched?n?r.end.to:r.end.from:n?i.to:i.from,mB.cursor(o,n?-1:1)}function BX(e,t){return MX(e,n=>{if(!n.empty)return NX(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;const WX=e=>BX(e,!1),UX=e=>BX(e,!0);function VX(e){let t,n=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,o=0;if(n){for(let t of e.state.facet(Fq.scrollMargins)){let n=t(e);(null==n?void 0:n.top)&&(r=Math.max(null==n?void 0:n.top,r)),(null==n?void 0:n.bottom)&&(o=Math.max(null==n?void 0:n.bottom,o))}t=e.scrollDOM.clientHeight-r-o}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:o,selfScroll:n,height:Math.max(e.defaultLineHeight,t-5)}}function HX(e,t){let n,r=VX(e),{state:o}=e,i=TX(o.selection,n=>n.empty?e.moveVertically(n,t,r.height):NX(n,t));if(i.eq(o.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(o.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+r.marginTop,s=a.bottom-r.marginBottom;t&&t.top>l&&t.bottom<s&&(n=Fq.scrollIntoView(i.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(AX(o,i),{effects:n}),!0}const qX=e=>HX(e,!1),QX=e=>HX(e,!0);function $X(e,t,n){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(o=mB.cursor(r.from+n))}return o}function GX(e,t){let n=TX(e.state.selection,e=>{let n=t(e);return mB.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(AX(e.state,n)),!0)}function YX(e,t){return GX(e,n=>e.moveByChar(n,t))}const XX=e=>YX(e,!IX(e)),KX=e=>YX(e,IX(e));function ZX(e,t){return GX(e,n=>e.moveByGroup(n,t))}function JX(e,t){return GX(e,n=>e.moveVertically(n,t))}const eK=e=>JX(e,!1),tK=e=>JX(e,!0);function nK(e,t){return GX(e,n=>e.moveVertically(n,t,VX(e).height))}const rK=e=>nK(e,!1),oK=e=>nK(e,!0),iK=({state:e,dispatch:t})=>(t(AX(e,{anchor:0})),!0),aK=({state:e,dispatch:t})=>(t(AX(e,{anchor:e.doc.length})),!0),lK=({state:e,dispatch:t})=>(t(AX(e,{anchor:e.selection.main.anchor,head:0})),!0),sK=({state:e,dispatch:t})=>(t(AX(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function cK(e,t){let{state:n}=e,r=n.selection,o=n.selection.ranges.slice();for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head);if(t?i.to<e.state.doc.length:i.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<i.from||r.head>i.to){o.some(e=>e.head==r.head)||o.push(r);break}if(r.head==n.head)break;n=r}}return o.length!=r.ranges.length&&(e.dispatch(AX(n,mB.create(o,o.length-1))),!0)}function uK(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,o=r.changeByRange(r=>{let{from:o,to:i}=r;if(o==i){let a=t(r);a<o?(n="delete.backward",a=dK(e,a,!1)):a>o&&(n="delete.forward",a=dK(e,a,!0)),o=Math.min(o,a),i=Math.max(i,a)}else o=dK(e,o,!1),i=dK(e,i,!0);return o==i?{range:r}:{changes:{from:o,to:i},range:mB.cursor(o,o<r.head?-1:1)}});return!o.changes.empty&&(e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?Fq.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function dK(e,t,n){if(e instanceof Fq)for(let r of e.state.facet(Fq.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}const pK=(e,t,n)=>uK(e,r=>{let o,i,a=r.from,{state:l}=e,s=l.doc.lineAt(a);if(n&&!t&&a>s.from&&a<s.from+200&&!/[^ \t]/.test(o=s.text.slice(0,a-s.from))){if("\t"==o[o.length-1])return a-1;let e=bW(o,l.tabSize)%V$(l)||V$(l);for(let t=0;t<e&&" "==o[o.length-1-t];t++)a--;i=a}else i=eB(s.text,a-s.from,t,t)+s.from,i==a&&s.number!=(t?l.doc.lines:1)?i+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(i-s.from,a-s.from))&&(i=eB(s.text,i-s.from,!1,!1)+s.from);return i}),hK=e=>pK(e,!1,!0),fK=e=>pK(e,!0,!1),mK=(e,t)=>uK(e,n=>{let r=n.head,{state:o}=e,i=o.doc.lineAt(r),a=o.charCategorizer(r);for(let e=null;;){if(r==(t?i.to:i.from)){r==n.head&&i.number!=(t?o.doc.lines:1)&&(r+=t?1:-1);break}let l=eB(i.text,r-i.from,t)+i.from,s=i.text.slice(Math.min(r,l)-i.from,Math.max(r,l)-i.from),c=a(s);if(null!=e&&c!=e)break;" "==s&&r==n.head||(e=c),r=l}return r}),gK=e=>mK(e,!1);function vK(e){let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.from),i=e.doc.lineAt(r.to);if(r.empty||r.to!=i.from||(i=e.doc.lineAt(r.to-1)),n>=o.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(r)}else t.push({from:o.from,to:i.to,ranges:[r]});n=i.number+1}return t}function yK(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let t of vK(e)){if(n?t.to==e.doc.length:0==t.from)continue;let i=e.doc.lineAt(n?t.to+1:t.from-1),a=i.length+1;if(n){r.push({from:t.to,to:i.to},{from:t.from,insert:i.text+e.lineBreak});for(let n of t.ranges)o.push(mB.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)))}else{r.push({from:i.from,to:t.from},{from:t.to,insert:e.lineBreak+i.text});for(let e of t.ranges)o.push(mB.range(e.anchor-a,e.head-a))}}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:mB.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}function bK(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of vK(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const wK=kK(!1);function kK(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:o}=n,i=t.doc.lineAt(r),a=!e&&r==o&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,r=A$(e).resolveInner(t),o=r.childBefore(t),i=r.childAfter(t);return o&&i&&o.to<=t&&i.from>=t&&(n=o.type.prop(Hj.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(o.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(o.to,i.from))?{from:o.to,to:i.from}:null}(t,r);e&&(r=o=(o<=i.to?i:t.doc.lineAt(o)).to);let l=new Q$(t,{simulateBreak:r,simulateDoubleBreak:!!a}),s=q$(l,r);for(null==s&&(s=bW(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));o<i.to&&/\s/.test(i.text[o-i.from]);)o++;a?({from:r,to:o}=a):r>i.from&&r<i.from+100&&!/\S/.test(i.text.slice(0,r))&&(r=i.from);let c=["",H$(t,s)];return a&&c.push(H$(t,l.lineIndent(i.from,-1))),{changes:{from:r,to:o,insert:Hz.of(c)},range:mB.cursor(r+1+c[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function EK(e,t){let n=-1;return e.changeByRange(r=>{let o=[];for(let i=r.from;i<=r.to;){let a=e.doc.lineAt(i);a.number>n&&(r.empty||r.to>a.from)&&(t(a,o,r),n=a.number),i=a.to+1}let i=e.changes(o);return{changes:o,range:mB.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const OK=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(EK(e,(t,n)=>{n.push({from:t.from,insert:e.facet(U$)})}),{userEvent:"input.indent"})),!0),xK=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(EK(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let o=bW(r,e.tabSize),i=0,a=H$(e,Math.max(0,o-V$(e)));for(;i<r.length&&i<a.length&&r.charCodeAt(i)==a.charCodeAt(i);)i++;n.push({from:t.from+i,to:t.from+r.length,insert:a.slice(i)})}),{userEvent:"delete.dedent"})),!0),SK=[{key:"Ctrl-b",run:LX,shift:XX,preventDefault:!0},{key:"Ctrl-f",run:RX,shift:KX},{key:"Ctrl-p",run:WX,shift:eK},{key:"Ctrl-n",run:UX,shift:tK},{key:"Ctrl-a",run:e=>MX(e,t=>mB.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>GX(e,t=>mB.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>MX(e,t=>mB.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>GX(e,t=>mB.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:fK},{key:"Ctrl-h",run:hK},{key:"Ctrl-k",run:e=>uK(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:gK},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Hz.of(["",""])},range:mB.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),o=n==r.from?n-1:eB(r.text,n-r.from,!1)+r.from,i=n==r.to?n+1:eB(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(o,n))},range:mB.cursor(i)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:QX}],_K=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>MX(e,t=>zX(e.state,t,!IX(e))),shift:e=>GX(e,t=>zX(e.state,t,!IX(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>MX(e,t=>zX(e.state,t,IX(e))),shift:e=>GX(e,t=>zX(e.state,t,IX(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>yK(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>bK(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>yK(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>bK(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>cK(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>cK(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=mB.create([n.main]):n.main.empty||(r=mB.create([mB.cursor(n.main.head)])),!!r&&(t(AX(e,r)),!0)}},{key:"Mod-Enter",run:kK(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=vK(e).map(({from:t,to:n})=>mB.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:mB.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=TX(e.selection,t=>{let n=A$(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return mB.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(AX(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:xK},{key:"Mod-]",run:OK},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Q$(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),o=EK(e,(t,o,i)=>{let a=q$(r,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let l=/^\s*/.exec(t.text)[0],s=H$(e,a);(l!=s||i.from<t.from+l.length)&&(n[t.from]=a,o.push({from:t.from,to:t.from+l.length,insert:s}))});return o.changes.empty||t(e.update(o,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(vK(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=TX(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),o=e.coordsAtPos(t.head,t.assoc||1);o&&(n=r.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let r=!1,o=TX(e.selection,t=>{let o=VG(e,t.head,-1)||VG(e,t.head,1)||t.head>0&&VG(e,t.head-1,1)||t.head<e.doc.length&&VG(e,t.head+1,-1);if(!o||!o.end)return t;r=!0;let i=o.start.from==t.head?o.end.to:o.end.from;return n?mB.range(t.anchor,i):mB.cursor(i)});return!!r&&(t(AX(e,o)),!0)}(e,t,!1)},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=rX(e.state,n.from);return r.line?eX(e):!!r.block&&nX(e)}},{key:"Alt-A",run:tX},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:LX,shift:XX,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>jX(e,!IX(e)),shift:e=>ZX(e,!IX(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>MX(e,t=>$X(e,t,!IX(e))),shift:e=>GX(e,t=>$X(e,t,!IX(e))),preventDefault:!0},{key:"ArrowRight",run:RX,shift:KX,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>jX(e,IX(e)),shift:e=>ZX(e,IX(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>MX(e,t=>$X(e,t,IX(e))),shift:e=>GX(e,t=>$X(e,t,IX(e))),preventDefault:!0},{key:"ArrowUp",run:WX,shift:eK,preventDefault:!0},{mac:"Cmd-ArrowUp",run:iK,shift:lK},{mac:"Ctrl-ArrowUp",run:qX,shift:rK},{key:"ArrowDown",run:UX,shift:tK,preventDefault:!0},{mac:"Cmd-ArrowDown",run:aK,shift:sK},{mac:"Ctrl-ArrowDown",run:QX,shift:oK},{key:"PageUp",run:qX,shift:rK},{key:"PageDown",run:QX,shift:oK},{key:"Home",run:e=>MX(e,t=>$X(e,t,!1)),shift:e=>GX(e,t=>$X(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:iK,shift:lK},{key:"End",run:e=>MX(e,t=>$X(e,t,!0)),shift:e=>GX(e,t=>$X(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:aK,shift:sK},{key:"Enter",run:wK,shift:wK},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:hK,shift:hK,preventDefault:!0},{key:"Delete",run:fK,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:gK,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>mK(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>uK(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>uK(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(SK.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),CK={key:"Tab",run:OK,shift:xK},PK="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class TK{constructor(e,t,n=0,r=e.length,o,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?e=>o(PK(e)):PK,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return tB(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=nB(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=rB(e);let r=this.normalize(t);if(r.length)for(let e=0,o=n;;e++){let i=r.charCodeAt(e),a=this.match(i,o,this.bufferPos+this.bufferStart);if(e==r.length-1){if(a)return this.value=a,this;break}o==n&&e<t.length&&t.charCodeAt(e)==i&&o++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let o=this.matches[t],i=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,i=!0)),i||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(TK.prototype[Symbol.iterator]=function(){return this});const AK={from:-1,to:-1,match:/.*/.exec("")},MK="gm"+(null==/x/.unicode?"":"u");class NK{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=AK,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new LK(e,t,n,r,o);this.re=new RegExp(t,MK+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let i=e.lineAt(r);this.curLineStart=i.from,this.matchPos=RK(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=RK(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const DK=new WeakMap;class IK{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=DK.get(e);if(!r||r.from>=n||r.to<=t){let r=new IK(t,e.sliceString(t,n));return DK.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:o,from:i}=r;return i>t&&(o=e.sliceString(t,i)+o,i=t),r.to<n&&(o+=e.sliceString(r.to,n)),DK.set(e,new IK(i,o)),new IK(t,o.slice(t-i,n-i))}}class LK{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=AK,this.matchPos=RK(e,r),this.re=new RegExp(t,MK+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=IK.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=RK(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=IK.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function RK(e,t){if(t>=e.length)return t;let n,r=e.lineAt(t);for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}function jK(e){let t=hY("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,o=r.doc.lineAt(r.selection.main.head),[,i,a,l,s]=n,c=l?+l.slice(1):0,u=a?+a:o.number;if(a&&s){let e=u/100;i&&(e=e*("-"==i?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else a&&i&&(u=u*("-"==i?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),p=mB.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[FK.of(!1),Fq.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:hY("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:FK.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},hY("label",e.state.phrase("Go to line"),": ",t)," ",hY("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),hY("button",{name:"close",onclick:()=>{e.dispatch({effects:FK.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["×"]))}}"undefined"!=typeof Symbol&&(NK.prototype[Symbol.iterator]=LK.prototype[Symbol.iterator]=function(){return this});const FK=HB.define(),zK=SB.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(FK)&&(e=n.value);return e},provide:e=>e$.from(e,e=>e?jK:null)}),BK=Fq.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),WK={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},UK=yB.define({combine:e=>nW(e,WK,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),VK=ZW.mark({class:"cm-selectionMatch"}),HK=ZW.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function qK(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==ZB.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==ZB.Word)}const QK=dV.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(UK),{state:n}=e,r=n.selection;if(r.ranges.length>1)return ZW.none;let o,i=r.main,a=null;if(i.empty){if(!t.highlightWordAroundCursor)return ZW.none;let e=n.wordAt(i.head);if(!e)return ZW.none;a=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return ZW.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!qK(a,n,i.from,i.to)||!function(e,t,n,r){return e(t.sliceDoc(n,n+1))==ZB.Word&&e(t.sliceDoc(r-1,r))==ZB.Word}(a,n,i.from,i.to))return ZW.none}else if(o=n.sliceDoc(i.from,i.to),!o)return ZW.none}let l=[];for(let r of e.visibleRanges){let e=new TK(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!a||qK(a,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?l.push(HK.range(r,o)):(r>=i.to||o<=i.from)&&l.push(VK.range(r,o)),l.length>t.maxMatches))return ZW.none}}return ZW.set(l)}},{decorations:e=>e.decorations}),$K=Fq.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),GK=yB.define({combine:e=>nW(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new OZ(e),scrollToMatch:e=>Fq.scrollIntoView(e)})});class YK{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,MK),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new nZ(this):new ZK(this)}getCursor(e,t=0,n){let r=e.doc?e:tW.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?JK(this,r,t,n):KK(this,r,t,n)}}class XK{constructor(e){this.spec=e}}function KK(e,t,n,r){return new TK(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?function(e,t){return(n,r,o,i)=>((i>n||i+o.length<r)&&(i=Math.max(0,n-2),o=e.sliceString(i,Math.min(e.length,r+2))),!(t(eZ(o,n-i))==ZB.Word&&t(tZ(o,n-i))==ZB.Word||t(tZ(o,r-i))==ZB.Word&&t(eZ(o,r-i))==ZB.Word))}(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}class ZK extends XK{constructor(e){super(e)}nextMatch(e,t,n){let r=KK(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=KK(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),o=KK(this.spec,e,n,r),i=null;for(;!o.nextOverlapping().done;)i=o.value;if(i)return i;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),!r||r.from==t&&r.to==n?null:r}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=KK(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=KK(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}function JK(e,t,n,r){return new NK(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(o=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(o(eZ(n.input,n.index))!=ZB.Word||o(tZ(n.input,n.index))!=ZB.Word)&&(o(tZ(n.input,n.index+n[0].length))!=ZB.Word||o(eZ(n.input,n.index+n[0].length))!=ZB.Word)):void 0},n,r);var o}function eZ(e,t){return e.slice(eB(e,t,!1),t)}function tZ(e,t){return e.slice(t,eB(e,t))}class nZ extends XK{nextMatch(e,t,n){let r=JK(this.spec,e,n,e.doc.length).next();return r.done&&(r=JK(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-1e4*r),i=JK(this.spec,e,o,n),a=null;for(;!i.next().done;)a=i.value;if(a&&(o==t||a.from>o+10))return a;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=JK(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=JK(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}const rZ=HB.define(),oZ=HB.define(),iZ=SB.define({create:e=>new aZ(vZ(e).create(),null),update(e,t){for(let n of t.effects)n.is(rZ)?e=new aZ(n.value.create(),e.panel):n.is(oZ)&&(e=new aZ(e.query,n.value?gZ:null));return e},provide:e=>e$.from(e,e=>e.panel)});class aZ{constructor(e,t){this.query=e,this.panel=t}}const lZ=ZW.mark({class:"cm-searchMatch"}),sZ=ZW.mark({class:"cm-searchMatch cm-searchMatch-selected"}),cZ=dV.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(iZ))}update(e){let t=e.state.field(iZ);(t!=e.startState.field(iZ)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return ZW.none;let{view:n}=this,r=new sW;for(let t=0,o=n.visibleRanges,i=o.length;t<i;t++){let{from:a,to:l}=o[t];for(;t<i-1&&l>o[t+1].from-500;)l=o[++t].to;e.highlight(n.state,a,l,(e,t)=>{let o=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,o?sZ:lZ)})}return r.finish()}},{decorations:e=>e.decorations});function uZ(e){return t=>{let n=t.state.field(iZ,!1);return n&&n.query.spec.valid?e(t,n):wZ(t)}}const dZ=uZ((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=mB.single(r.from,r.to),i=e.state.facet(GK);return e.dispatch({selection:o,effects:[CZ(e,r),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),bZ(e),!0}),pZ=uZ((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let i=mB.single(o.from,o.to),a=e.state.facet(GK);return e.dispatch({selection:i,effects:[CZ(e,o),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),bZ(e),!0}),hZ=uZ((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:mB.create(n.map(e=>mB.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),fZ=uZ((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,r,r);if(!i)return!1;let a,l,s=i,c=[],u=[];s.from==r&&s.to==o&&(l=n.toText(t.getReplacement(s)),c.push({from:s.from,to:s.to,insert:l}),s=t.nextMatch(n,s.from,s.to),u.push(Fq.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let d=e.state.changes(c);return s&&(a=mB.single(s.from,s.to).map(d),u.push(CZ(e,s)),u.push(n.facet(GK).scrollToMatch(a.main,e))),e.dispatch({changes:d,selection:a,effects:u,userEvent:"input.replace"}),!0}),mZ=uZ((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Fq.announce.of(r),userEvent:"input.replace.all"}),!0});function gZ(e){return e.state.facet(GK).createPanel(e)}function vZ(e,t){var n,r,o,i,a;let l=e.selection.main,s=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!s)return t;let c=e.facet(GK);return new YK({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:c.caseSensitive,literal:null!==(o=null==t?void 0:t.literal)&&void 0!==o?o:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(a=null==t?void 0:t.wholeWord)&&void 0!==a?a:c.wholeWord})}function yZ(e){let t=XQ(e,gZ);return t&&t.dom.querySelector("[main-field]")}function bZ(e){let t=yZ(e);t&&t==e.root.activeElement&&t.select()}const wZ=e=>{let t=e.state.field(iZ,!1);if(t&&t.panel){let n=yZ(e);if(n&&n!=e.root.activeElement){let r=vZ(e.state,t.query.spec);r.valid&&e.dispatch({effects:rZ.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[oZ.of(!0),t?rZ.of(vZ(e.state,t.query.spec)):HB.appendConfig.of(TZ)]});return!0},kZ=e=>{let t=e.state.field(iZ,!1);if(!t||!t.panel)return!1;let n=XQ(e,gZ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:oZ.of(!1)}),!0},EZ=[{key:"Mod-f",run:wZ,scope:"editor search-panel"},{key:"F3",run:dZ,shift:pZ,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:dZ,shift:pZ,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:kZ,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,i=[],a=0;for(let t=new TK(e.doc,e.sliceDoc(r,o));!t.next().done;){if(i.length>1e3)return!1;t.value.from==r&&(a=i.length),i.push(mB.range(t.value.from,t.value.to))}return t(e.update({selection:mB.create(i,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=XQ(e,jK);if(!t){let n=[FK.of(!0)];null==e.state.field(zK,!1)&&n.push(HB.appendConfig.of([zK,BK])),e.dispatch({effects:n}),t=XQ(e,jK)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=mB.create(n.ranges.map(t=>e.wordAt(t.head)||mB.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let o=function(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let n=!1,o=new TK(e.doc,t,r[r.length-1].to);;){if(o.next(),!o.done){if(n&&r.some(e=>e.from==o.value.from))continue;if(i){let t=e.wordAt(o.value.from);if(!t||t.from!=o.value.from||t.to!=o.value.to)continue}return o.value}if(n)return null;o=new TK(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}}(e,r);return!!o&&(t(e.update({selection:e.selection.addRange(mB.range(o.from,o.to),!1),effects:Fq.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class OZ{constructor(e){this.view=e;let t=this.query=e.state.field(iZ).query.spec;function n(e,t,n){return hY("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=hY("input",{value:t.search,placeholder:xZ(e,"Find"),"aria-label":xZ(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=hY("input",{value:t.replace,placeholder:xZ(e,"Replace"),"aria-label":xZ(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=hY("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=hY("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=hY("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=hY("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>dZ(e),[xZ(e,"next")]),n("prev",()=>pZ(e),[xZ(e,"previous")]),n("select",()=>hZ(e),[xZ(e,"all")]),hY("label",null,[this.caseField,xZ(e,"match case")]),hY("label",null,[this.reField,xZ(e,"regexp")]),hY("label",null,[this.wordField,xZ(e,"by word")]),...e.state.readOnly?[]:[hY("br"),this.replaceField,n("replace",()=>fZ(e),[xZ(e,"replace")]),n("replaceAll",()=>mZ(e),[xZ(e,"replace all")])],hY("button",{name:"close",onclick:()=>kZ(e),"aria-label":xZ(e,"close"),type:"button"},["×"])])}commit(){let e=new YK({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:rZ.of(e)}))}keydown(e){var t,n;t=this.view,n=e,Zq(Gq(t.state),n,t,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?pZ:dZ)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),fZ(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(rZ)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(GK).top}}function xZ(e,t){return e.state.phrase(t)}const SZ=30,_Z=/[\s\.,:;?!]/;function CZ(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,i=Math.max(r.from,t-SZ),a=Math.min(o,n+SZ),l=e.state.sliceDoc(i,a);if(i!=r.from)for(let e=0;e<SZ;e++)if(!_Z.test(l[e+1])&&_Z.test(l[e])){l=l.slice(e);break}if(a!=o)for(let e=l.length-1;e>l.length-SZ;e--)if(!_Z.test(l[e-1])&&_Z.test(l[e])){l=l.slice(0,e);break}return Fq.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${r.number}.`)}const PZ=Fq.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),TZ=[iZ,CB.low(cZ),PZ];class AZ{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=A$(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),o=r.search(IZ(e,!1));return o<0?null:{from:n+o,to:this.pos,text:r.slice(o)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function MZ(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class NZ{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function DZ(e){return e.selection.main.from}function IZ(e,t){var n;let{source:r}=e,o=t&&"^"!=r[0],i="$"!=r[r.length-1];return o||i?new RegExp(`${o?"^":""}(?:${r})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const LZ=WB.define();function RZ(e,t,n,r){let{main:o}=e.selection,i=n-o.from,a=r-o.from;return{...e.changeByRange(l=>{if(l!=o&&n!=r&&e.sliceDoc(l.from+i,l.from+a)!=e.sliceDoc(n,r))return{range:l};let s=e.toText(t);return{changes:{from:l.from+i,to:r==o.from?l.to:l.from+a,insert:s},range:mB.cursor(l.from+i+s.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const jZ=new WeakMap;function FZ(e){if(!Array.isArray(e))return e;let t=jZ.get(e);return t||jZ.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=MZ(t)+MZ(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}(t);return e=>{let o=e.matchBefore(r);return o||e.explicit?{from:o?o.from:e.pos,options:t,validFor:n}:null}}(e)),t}const zZ=HB.define(),BZ=HB.define();class WZ{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=tB(e,t),r=rB(n);this.chars.push(n);let o=e.slice(t,t+r),i=o.toUpperCase();this.folded.push(tB(i==o?o.toLowerCase():i,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:o,byWord:i}=this;if(1==t.length){let r=tB(e,0),o=rB(r),i=o==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;i+=-200}return this.ret(i,[0,o])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,s=0;if(a<0){for(let o=0,i=Math.min(e.length,200);o<i&&s<l;){let i=tB(e,o);i!=t[s]&&i!=n[s]||(r[s++]=o),o+=rB(i)}if(s<l)return null}let c=0,u=0,d=!1,p=0,h=-1,f=-1,m=/[a-z]/.test(e),g=!0;for(let r=0,s=Math.min(e.length,200),v=0;r<s&&u<l;){let s=tB(e,r);a<0&&(c<l&&s==t[c]&&(o[c++]=r),p<l&&(s==t[p]||s==n[p]?(0==p&&(h=r),f=r+1,p++):p=0));let y,b=s<255?s>=48&&s<=57||s>=97&&s<=122?2:s>=65&&s<=90?1:0:(y=nB(s))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!r||1==b&&m||0==v&&0!=b)&&(t[u]==s||n[u]==s&&(d=!0)?i[u++]=r:i.length&&(g=!1)),v=b,r+=rB(s)}return u==l&&0==i[0]&&g?this.result((d?-200:0)-100,i,e):p==l&&0==h?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==l?this.ret(-900-e.length,[h,f]):u==l?this.result((d?-200:0)-100-700+(g?0:-1100),i,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}result(e,t,n){let r=[],o=0;for(let e of t){let t=e+(this.astral?rB(tB(n,e)):1);o&&r[o-1]==e?r[o-1]=t:(r[o++]=e,r[o++]=t)}return this.ret(e-n.length,r)}}class UZ{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const VZ=yB.define({combine:e=>nW(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:qZ,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>HZ(e(n),t(n)),optionClass:(e,t)=>n=>HZ(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function HZ(e,t){return e?t?e+" "+t:e:t}function qZ(e,t,n,r,o,i){let a,l,s=e.textDirection==CU.RTL,c=s,u=!1,d="top",p=t.left-o.left,h=o.right-t.right,f=r.right-r.left,m=r.bottom-r.top;if(c&&p<Math.min(f,h)?c=!1:!c&&h<Math.min(f,p)&&(c=!0),f<=(c?p:h))a=Math.max(o.top,Math.min(n.top,o.bottom-m))-t.top,l=Math.min(400,c?p:h);else{u=!0,l=Math.min(400,(s?t.right:o.right-t.left)-30);let e=o.bottom-t.bottom;e>=m||e>t.top?a=n.bottom-t.top:(d="bottom",a=t.bottom-n.top)}return{style:`${d}: ${a/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${l/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":c?"left":"right")}}function QZ(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class $Z{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:o,selected:i}=r.open,a=e.state.facet(VZ);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,r){let o=document.createElement("span");o.className="cm-completionLabel";let i=e.displayLabel||e.label,a=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>a&&o.appendChild(document.createTextNode(i.slice(a,t)));let l=o.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(i.slice(t,n))),l.className="cm-completionMatchedText",a=n}return a<i.length&&o.appendChild(document.createTextNode(i.slice(a))),o},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=QZ(o.length,i,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:r}=e.state.field(t).open;for(let t,o=n.target;o&&o!=this.dom;o=o.parentNode)if("LI"==o.nodeName&&(t=/-(\d+)$/.exec(o.id))&&+t[1]<r.length)return this.applyCompletion(e,r[+t[1]]),void n.preventDefault()}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(VZ).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:BZ.of(null)})}),this.showOptions(o,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:o,selected:i,disabled:a}=n.open;r.open&&r.open.options==o||(this.range=QZ(o.length,i,e.state.facet(VZ).maxRenderedOptions),this.showOptions(o,n.id)),this.updateSel(),a!=(null===(t=r.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=QZ(t.options.length,t.selected,this.view.state.facet(VZ).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:o}=r;if(!o)return;let i="string"==typeof o?document.createTextNode(o):o(r);if(!i)return;"then"in i?i.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>lV(this.view.state,e,"completion info")):(this.addInfoPane(i,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)"LI"==n.nodeName&&n.id?r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby")):r--;return t&&function(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/o:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/o)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),o=this.space;if(!o){let e=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(o.bottom,t.bottom)-10||r.bottom<Math.max(o.top,t.top)+10?null:this.view.state.facet(VZ).positionInfo(this.view,t,r,n,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",e=>{e.target==r&&e.preventDefault()});let o=null;for(let i=n.from;i<n.to;i++){let{completion:a,match:l}=e[i],{section:s}=a;if(s){let e="string"==typeof s?s:s.name;e!=o&&(i>n.from||0==n.from)&&(o=e,"string"!=typeof s&&s.header?r.appendChild(s.header(s)):r.appendChild(document.createElement("completion-section")).textContent=e)}const c=r.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(a);u&&(c.className=u);for(let e of this.optionContent){let t=e(a,this.view.state,this.view,l);t&&c.appendChild(t)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function GZ(e,t){return n=>new $Z(n,e,t)}function YZ(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class XZ{constructor(e,t,n,r,o,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=o,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new XZ(this.options,eJ(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,o,i){if(r&&!i&&e.some(e=>e.isPending))return r.setDisabled();let a=function(e,t){let n=[],r=null,o=null,i=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some(t=>t.name==e)||r.push("string"==typeof t?{name:e}:t)}},a=t.facet(VZ);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)i(new NZ(t,r.source,e?e(t):[],1e9-n.length));else{let n,l=t.sliceDoc(r.from,r.to),s=a.filterStrict?new UZ(l):new WZ(l);for(let t of r.result.options)if(n=s.match(t.label)){let a=t.displayLabel?e?e(t,n.matched):[]:n.matched,l=n.score+(t.boost||0);if(i(new NZ(t,r.source,a,l)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;o||(o=Object.create(null)),o[e]=Math.max(l,o[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,i=(e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?o[t.name]-o[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(i))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let l=[],s=null,c=a.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;!s||s.label!=t.label||s.detail!=t.detail||null!=s.type&&null!=t.type&&s.type!=t.type||s.apply!=t.apply||s.boost!=t.boost?l.push(e):YZ(e.completion)>YZ(s)&&(l[l.length-1]=e),s=e.completion}return l}(e,t);if(!a.length)return r&&e.some(e=>e.isPending)?r.setDisabled():null;let l=t.facet(VZ).selectOnOpen?0:-1;if(r&&r.selected!=l&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<a.length;t++)if(a[t].completion==e){l=t;break}}return new XZ(a,eJ(n,l),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:cJ,above:o.aboveCursor},r?r.timestamp:Date.now(),l,!1)}map(e){return new XZ(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new XZ(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class KZ{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new KZ(tJ,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(VZ),r=(n.override||t.languageDataAt("autocomplete",DZ(t)).map(FZ)).map(t=>(this.active.find(e=>e.source==t)||new rJ(t,this.active.some(e=>0!=e.state)?1:0)).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let o=this.open,i=e.effects.some(e=>e.is(iJ));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let o=n==e.length,i=r==t.length;if(o||i)return o==i;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)||i?o=XZ.build(r,t,this.id,o,n,i):o&&o.disabled&&!r.some(e=>e.isPending)&&(o=null),!o&&r.every(e=>!e.isPending)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new rJ(e.source,0):e));for(let t of e.effects)t.is(aJ)&&(o=o&&o.setSelected(t.value,this.id));return r==this.active&&o==this.open?this:new KZ(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ZZ:JZ}}const ZZ={"aria-autocomplete":"list"},JZ={};function eJ(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const tJ=[];function nJ(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(LZ);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class rJ{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=nJ(e,t),r=this;(8&n||16&n&&this.touches(e))&&(r=new rJ(r.source,0)),4&n&&0==r.state&&(r=new rJ(this.source,1)),r=r.updateFor(e,n);for(let t of e.effects)if(t.is(zZ))r=new rJ(r.source,1,t.value);else if(t.is(BZ))r=new rJ(r.source,0);else if(t.is(iJ))for(let e of t.value)e.source==r.source&&(r=e);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(DZ(e.state))}}class oJ extends rJ{constructor(e,t,n,r,o,i){super(e,3,t),this.limit=n,this.result=r,this.from=o,this.to=i}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let o=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),a=DZ(e.state);if(a>i||!r||2&t&&(DZ(e.startState)==this.from||a<this.limit))return new rJ(this.source,4&t?1:0);let l=e.changes.mapPos(this.limit);return function(e,t,n,r){if(!e)return!1;let o=t.sliceDoc(n,r);return"function"==typeof e?e(o,n,r,t):IZ(e,!0).test(o)}(r.validFor,e.state,o,i)?new oJ(this.source,this.explicit,l,r,o,i):r.update&&(r=r.update(r,o,i,new AZ(e.state,a,!1)))?new oJ(this.source,this.explicit,l,r,r.from,null!==(n=r.to)&&void 0!==n?n:DZ(e.state)):new rJ(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new oJ(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new rJ(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}const iJ=HB.define({map:(e,t)=>e.map(e=>e.map(t))}),aJ=HB.define(),lJ=SB.define({create:()=>KZ.start(),update:(e,t)=>e.update(t),provide:e=>[BQ.from(e,e=>e.tooltip),Fq.contentAttributes.from(e,e=>e.attrs)]});function sJ(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(lJ).active.find(e=>e.source==t.source);return r instanceof oJ&&("string"==typeof n?e.dispatch({...RZ(e.state,n,r.from,r.to),annotations:LZ.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}const cJ=GZ(lJ,sJ);function uJ(e,t="option"){return n=>{let r=n.state.field(lJ,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(VZ).interactionDelay)return!1;let o,i=1;"page"==t&&(o=$Q(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,l=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:a-1;return l<0?l="page"==t?0:a-1:l>=a&&(l="page"==t?a-1:0),n.dispatch({effects:aJ.of(l)}),!0}}const dJ=e=>!!e.state.field(lJ,!1)&&(e.dispatch({effects:zZ.of(!0)}),!0);class pJ{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const hJ=dV.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(lJ).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(lJ),n=e.state.facet(VZ);if(!e.selectionSet&&!e.docChanged&&e.startState.field(lJ)==t)return;let r=e.transactions.some(e=>{let t=nJ(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){lV(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(zZ)))&&(this.pendingStart=!0);let o=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),o):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(lJ);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(VZ).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=DZ(t),r=new AZ(t,n,e.explicit,this.view),o=new pJ(e,r);this.running.push(o),Promise.resolve(e.source(r)).then(e=>{o.context.aborted||(o.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:BZ.of(null)}),lV(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(VZ).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(VZ),r=this.view.state.field(lJ);for(let o=0;o<this.running.length;o++){let i=this.running[o];if(void 0===i.done)continue;if(this.running.splice(o--,1),i.done){let r=DZ(i.updates.length?i.updates[0].startState:this.view.state),o=Math.min(r,i.done.from+(i.active.explicit?0:1)),a=new oJ(i.active.source,i.active.explicit,o,i.done,i.done.from,null!==(e=i.done.to)&&void 0!==e?e:r);for(let e of i.updates)a=a.update(e,n);if(a.hasResult()){t.push(a);continue}}let a=r.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(null==i.done){let e=new rJ(i.active.source,0);for(let t of i.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(a)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:iJ.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(lJ,!1);if(t&&t.tooltip&&this.view.state.facet(VZ).closeOnBlur){let n=t.open&&$Q(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:BZ.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:zZ.of(!1)}),20),this.composing=0}}}),fJ="object"==typeof navigator&&/Win/.test(navigator.platform),mJ=CB.highest(Fq.domEventHandlers({keydown(e,t){let n=t.state.field(lJ,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&(!fJ||!e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],o=n.active.find(e=>e.source==r.source),i=r.completion.commitCharacters||o.result.commitCharacters;return i&&i.indexOf(e.key)>-1&&sJ(t,r),!1}})),gJ=Fq.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),vJ={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yJ=HB.define({map(e,t){let n=t.mapPos(e,-1,iB.TrackAfter);return null==n?void 0:n}}),bJ=new class extends rW{};bJ.startSide=1,bJ.endSide=-1;const wJ=SB.define({create:()=>lW.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(yJ)&&(e=e.update({add:[bJ.range(n.value,n.value+1)]}));return e}}),kJ="()[]{}<>«»»«[]{}";function EJ(e){for(let t=0;t<16;t+=2)if(kJ.charCodeAt(t)==e)return kJ.charAt(t+1);return nB(e<128?e:e+1)}function OJ(e,t){return e.languageDataAt("closeBrackets",t)[0]||vJ}const xJ="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),SJ=Fq.inputHandler.of((e,t,n,r)=>{if((xJ?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(r.length>2||2==r.length&&1==rB(tB(r,0))||t!=o.from||n!=o.to)return!1;let i=function(e,t){let n=OJ(e,e.selection.main.head),r=n.brackets||vJ.brackets;for(let o of r){let i=EJ(tB(o,0));if(t==o)return i==o?MJ(e,o,r.indexOf(o+o+o)>-1,n):TJ(e,o,i,n.before||vJ.before);if(t==i&&CJ(e,e.selection.main.from))return AJ(e,0,i)}return null}(e.state,r);return!!i&&(e.dispatch(i),!0)}),_J=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=OJ(e,e.selection.main.head).brackets||vJ.brackets,r=null,o=e.changeByRange(t=>{if(t.empty){let r=function(e,t){let n=e.sliceString(t-2,t);return rB(tB(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let o of n)if(o==r&&PJ(e.doc,t.head)==EJ(tB(o,0)))return{changes:{from:t.head-o.length,to:t.head+o.length},range:mB.cursor(t.head-o.length)}}return{range:r=t}});return r||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function CJ(e,t){let n=!1;return e.field(wJ).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function PJ(e,t){let n=e.sliceString(t,t+2);return n.slice(0,rB(tB(n,0)))}function TJ(e,t,n,r){let o=null,i=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:yJ.of(i.to+t.length),range:mB.range(i.anchor+t.length,i.head+t.length)};let a=PJ(e.doc,i.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:i.head},effects:yJ.of(i.head+t.length),range:mB.cursor(i.head+t.length)}:{range:o=i}});return o?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function AJ(e,t,n){let r=null,o=e.changeByRange(t=>t.empty&&PJ(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:mB.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function MJ(e,t,n,r){let o=r.stringPrefixes||vJ.stringPrefixes,i=null,a=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:yJ.of(r.to+t.length),range:mB.range(r.anchor+t.length,r.head+t.length)};let a,l=r.head,s=PJ(e.doc,l);if(s==t){if(NJ(e,l))return{changes:{insert:t+t,from:l},effects:yJ.of(l+t.length),range:mB.cursor(l+t.length)};if(CJ(e,l)){let r=n&&e.sliceDoc(l,l+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+r.length,insert:r},range:mB.cursor(l+r.length)}}}else{if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(a=DJ(e,l-2*t.length,o))>-1&&NJ(e,a))return{changes:{insert:t+t+t+t,from:l},effects:yJ.of(l+t.length),range:mB.cursor(l+t.length)};if(e.charCategorizer(l)(s)!=ZB.Word&&DJ(e,l,o)>-1&&!function(e,t,n,r){let o=A$(e).resolveInner(t,-1),i=r.reduce((e,t)=>Math.max(e,t.length),0);for(let a=0;a<5;a++){let a=e.sliceDoc(o.from,Math.min(o.to,o.from+n.length+i)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let t=o.firstChild;for(;t&&t.from==o.from&&t.to-t.from>n.length+l;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let s=o.to==t&&o.parent;if(!s)break;o=s}return!1}(e,l,t,o))return{changes:{insert:t+t,from:l},effects:yJ.of(l+t.length),range:mB.cursor(l+t.length)}}return{range:i=r}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function NJ(e,t){let n=A$(e).resolveInner(t+1);return n.parent&&n.from==t}function DJ(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=ZB.Word)return t;for(let o of n){let n=t-o.length;if(e.sliceDoc(n,t)==o&&r(e.sliceDoc(n-1,n))!=ZB.Word)return n}return-1}const IJ=[{key:"Ctrl-Space",run:dJ},{mac:"Alt-`",run:dJ},{mac:"Alt-i",run:dJ},{key:"Escape",run:e=>{let t=e.state.field(lJ,!1);return!(!t||!t.active.some(e=>0!=e.state)||(e.dispatch({effects:BZ.of(null)}),0))}},{key:"ArrowDown",run:uJ(!0)},{key:"ArrowUp",run:uJ(!1)},{key:"PageDown",run:uJ(!0,"page")},{key:"PageUp",run:uJ(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(lJ,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(VZ).interactionDelay)&&sJ(e,t.open.options[t.open.selected])}}],LJ=CB.highest(Qq.computeN([VZ],e=>e.facet(VZ).defaultKeymap?[IJ]:[]));var RJ=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(_J)),!1!==e.defaultKeymap&&(n=n.concat(_K)),!1!==e.searchKeymap&&(n=n.concat(EZ)),!1!==e.historyKeymap&&(n=n.concat(PX)),!1!==e.foldKeymap&&(n=n.concat(fG)),!1!==e.completionKeymap&&(n=n.concat(IJ)),!1!==e.lintKeymap&&(n=n.concat(PY));var r=[];return!1!==e.lineNumbers&&r.push(function(e={}){return[v$.of(e),s$(),w$]}()),!1!==e.highlightActiveLineGutter&&r.push(O$),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[wQ.of(e),kQ||(kQ=dV.fromClass(class{constructor(e){this.view=e,this.decorations=ZW.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(wQ)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new mQ({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:o}=n.state,i=tB(t[0],0);if(9==i){let e=o.lineAt(r),t=n.state.tabSize,i=bW(e.text,t,r-e.from);return ZW.replace({widget:new OQ((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=ZW.replace({widget:new EQ(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(wQ);e.startState.facet(wQ)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&r.push(function(e={}){return[dX,uX.of(e),Fq.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?hX:"historyRedo"==e.inputType?fX:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t={...kG,...e},n=new EG(t,!0),r=new EG(t,!1),o=dV.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(z$)!=e.state.facet(z$)||e.startState.field(sG,!1)!=e.state.field(sG,!1)||A$(e.startState)!=A$(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new sW;for(let o of e.viewportLineBlocks){let i=uG(e.state,o.from,o.to)?r:rG(e.state,o.from,o.to)?n:null;i&&t.add(o.from,o.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[o,a$({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.markers)||lW.empty},initialSpacer:()=>new EG(t,!1),domEventHandlers:{...i,click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let r=uG(e.state,t.from,t.to);if(r)return e.dispatch({effects:aG.of(r)}),!0;let o=rG(e.state,t.from,t.to);return!!o&&(e.dispatch({effects:iG.of(o)}),!0)}}}),vG()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[iQ.of(e),lQ,cQ,uQ,nV.of(!0)]}()),!1!==e.dropCursor&&r.push([pQ,hQ]),!1!==e.allowMultipleSelections&&r.push(tW.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(tW.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,o=n.lineAt(r);if(r>o.from+200)return e;let i=n.sliceString(o.from,r);if(!t.some(e=>e.test(i)))return e;let{state:a}=e,l=-1,s=[];for(let{head:e}of a.selection.ranges){let t=a.doc.lineAt(e);if(t.from==l)continue;l=t.from;let n=q$(a,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],o=H$(a,n);r!=o&&s.push({from:t.from,to:t.from+r.length,insert:o})}return s.length?[e,{changes:s,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&r.push(PG(MG,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[IG.of(e),zG]}()),!1!==e.closeBrackets&&r.push([SJ,wJ]),!1!==e.autocompletion&&r.push(function(e={}){return[mJ,lJ,VZ.of(e),hJ,LJ,gJ]}()),!1!==e.rectangularSelection&&r.push(function(){let e=e=>e.altKey&&0==e.button;return Fq.mouseSelectionStyle.of((t,n)=>e(n)?function(e,t){let n=PQ(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),o=e.state.doc.lineAt(t);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},r=r.map(e.changes)}},get(t,o,i){let a=PQ(e,t);if(!a)return r;let l=function(e,t,n){let r=Math.min(t.line,n.line),o=Math.max(t.line,n.line),i=[];if(t.off>CQ||n.off>CQ||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let t=r;t<=o;t++){let n=e.doc.line(t);n.length<=l&&i.push(mB.range(n.from+a,n.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let t=r;t<=o;t++){let n=e.doc.line(t),r=wW(n.text,a,e.tabSize,!0);if(r<0)i.push(mB.cursor(n.to));else{let t=wW(n.text,l,e.tabSize);i.push(mB.range(n.from+r,n.from+t))}}}return i}(e.state,n,a);return l.length?i?mB.create(l.concat(r.ranges)):mB.create(l):r}}:null}(t,n):null)}()),!1!==t&&r.push(function(e={}){let[t,n]=TQ[e.key||"Alt"],r=dV.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,Fq.contentAttributes.of(e=>{var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.isDown)?AQ:null})]}()),!1!==e.highlightActiveLine&&r.push(SQ),!1!==e.highlightSelectionMatches&&r.push(function(){let e=[$K,QK];return e}()),e.tabSize&&"number"==typeof e.tabSize&&r.push(U$.of(" ".repeat(e.tabSize))),r.concat([Qq.of(n.flat())]).filter(Boolean)};const jJ="#e06c75",FJ="#abb2bf",zJ="#7d8799",BJ="#d19a66",WJ="#2c313a",UJ="#282c34",VJ="#353a42",HJ="#528bff",qJ=[Fq.theme({"&":{color:FJ,backgroundColor:UJ},".cm-content":{caretColor:HJ},".cm-cursor, .cm-dropCursor":{borderLeftColor:HJ},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:FJ},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:UJ,color:zJ,border:"none"},".cm-activeLineGutter":{backgroundColor:WJ},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:VJ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:VJ,borderBottomColor:VJ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:WJ,color:FJ}}},{dark:!0}),PG(xG.define([{tag:gz.keyword,color:"#c678dd"},{tag:[gz.name,gz.deleted,gz.character,gz.propertyName,gz.macroName],color:jJ},{tag:[gz.function(gz.variableName),gz.labelName],color:"#61afef"},{tag:[gz.color,gz.constant(gz.name),gz.standard(gz.name)],color:BJ},{tag:[gz.definition(gz.name),gz.separator],color:FJ},{tag:[gz.typeName,gz.className,gz.number,gz.changed,gz.annotation,gz.modifier,gz.self,gz.namespace],color:"#e5c07b"},{tag:[gz.operator,gz.operatorKeyword,gz.url,gz.escape,gz.regexp,gz.link,gz.special(gz.string)],color:"#56b6c2"},{tag:[gz.meta,gz.comment],color:zJ},{tag:gz.strong,fontWeight:"bold"},{tag:gz.emphasis,fontStyle:"italic"},{tag:gz.strikethrough,textDecoration:"line-through"},{tag:gz.link,color:zJ,textDecoration:"underline"},{tag:gz.heading,fontWeight:"bold",color:jJ},{tag:[gz.atom,gz.bool,gz.special(gz.variableName)],color:BJ},{tag:[gz.processingInstruction,gz.string,gz.inserted],color:"#98c379"},{tag:gz.invalid,color:"#ffffff"}]))];var QJ=Fq.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),$J=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:o="light",placeholder:i="",basicSetup:a=!0}=e,l=[];switch(t&&l.unshift(Qq.of([CK])),a&&("boolean"==typeof a?l.unshift(RJ()):l.unshift(RJ(a))),i&&l.unshift(function(e){let t=dV.fromClass(class{constructor(t){this.view=t,this.placeholder=e?ZW.set([ZW.widget({widget:new _Q(e),side:1}).range(0)]):ZW.none}get decorations(){return this.view.state.doc.length?ZW.none:this.placeholder}},{decorations:e=>e.decorations});return"string"==typeof e?[t,Fq.contentAttributes.of({"aria-placeholder":e})]:t}(i)),o){case"light":l.push(QJ);break;case"dark":l.push(qJ);break;case"none":break;default:l.push(o)}return!1===n&&l.push(Fq.editable.of(!1)),r&&l.push(tW.readOnly.of(!0)),[...l]};class GJ{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class YJ{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var XJ=null,KJ=WB.define(),ZJ=[];var JJ=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],e0=(0,oe.forwardRef)((e,t)=>{var{className:n,value:r="",selection:o,extensions:i=[],onChange:a,onStatistics:l,onCreateEditor:s,onUpdate:c,autoFocus:u,theme:d="light",height:p,minHeight:h,maxHeight:f,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:b,indentWithTab:w,editable:k,readOnly:E,root:O,initialState:x}=e,S=Ft(e,JJ),_=(0,oe.useRef)(null),{state:C,view:P,container:T,setContainer:A}=function(e){var{value:t,selection:n,onChange:r,onStatistics:o,onCreateEditor:i,onUpdate:a,extensions:l=ZJ,autoFocus:s,theme:c="light",height:u=null,minHeight:d=null,maxHeight:p=null,width:h=null,minWidth:f=null,maxWidth:m=null,placeholder:g="",editable:v=!0,readOnly:y=!1,indentWithTab:b=!0,basicSetup:w=!0,root:k,initialState:E}=e,[O,x]=(0,oe.useState)(),[S,_]=(0,oe.useState)(),[C,P]=(0,oe.useState)(),T=(0,oe.useState)(()=>({current:null}))[0],A=(0,oe.useState)(()=>({current:null}))[0],M=Fq.theme({"&":{height:u,minHeight:d,maxHeight:p,width:h,minWidth:f,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),N=Fq.updateListener.of(e=>{if(e.docChanged&&"function"==typeof r&&!e.transactions.some(e=>e.annotation(KJ))){T.current?T.current.reset():(T.current=new GJ(()=>{if(A.current){var e=A.current;A.current=null,e()}T.current=null},200),("undefined"==typeof window?new YJ:(XJ||(XJ=new YJ),XJ)).add(T.current));var t=e.state.doc.toString();r(t,e)}o&&o((e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}))(e))}),D=[N,M,...$J({theme:c,editable:v,readOnly:y,placeholder:g,indentWithTab:b,basicSetup:w})];return a&&"function"==typeof a&&D.push(Fq.updateListener.of(a)),D=D.concat(l),(0,oe.useLayoutEffect)(()=>{if(O&&!C){var e={doc:t,selection:n,extensions:D},r=E?tW.fromJSON(E.json,e,E.fields):tW.create(e);if(P(r),!S){var o=new Fq({state:r,parent:O,root:k});_(o),i&&i(o,r)}}return()=>{S&&(P(void 0),_(void 0))}},[O,C]),(0,oe.useEffect)(()=>{e.container&&x(e.container)},[e.container]),(0,oe.useEffect)(()=>()=>{S&&(S.destroy(),_(void 0)),T.current&&(T.current.cancel(),T.current=null)},[S]),(0,oe.useEffect)(()=>{s&&S&&S.focus()},[s,S]),(0,oe.useEffect)(()=>{S&&S.dispatch({effects:HB.reconfigure.of(D)})},[c,l,u,d,p,h,f,m,g,v,y,b,w,r,a]),(0,oe.useEffect)(()=>{if(void 0!==t){var e=S?S.state.doc.toString():"";if(S&&t!==e){var n=()=>{S&&t!==S.state.doc.toString()&&S.dispatch({changes:{from:0,to:S.state.doc.toString().length,insert:t||""},annotations:[KJ.of(!0)]})};T.current&&!T.current.isDone?A.current=n:n()}}},[t,S]),{state:C,setState:P,view:S,setView:_,container:O,setContainer:x}}({root:O,value:r,autoFocus:u,theme:d,height:p,minHeight:h,maxHeight:f,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:b,indentWithTab:w,editable:k,readOnly:E,selection:o,onChange:a,onStatistics:l,onCreateEditor:s,onUpdate:c,extensions:i,initialState:x});(0,oe.useImperativeHandle)(t,()=>({editor:_.current,state:C,view:P}),[_,T,C,P]);var M=(0,oe.useCallback)(e=>{_.current=e,A(e)},[A]);if("string"!=typeof r)throw new Error("value must be typeof string but got "+typeof r);var N="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,QP.jsx)("div",re({ref:M,className:N+(n?" "+n:"")},S))});e0.displayName="CodeMirror";const t0=e0,n0=0,r0=1,o0=2,i0=3,a0=4,l0=5,s0=7,c0=9,u0=10,d0=11,p0=12,h0=13,f0=14,m0=15,g0=16,v0=17,y0=18,b0=19,w0=20,k0=21,E0=22,O0=23,x0=24,S0=25,_0=0;function C0(e){return e>=48&&e<=57}function P0(e){return C0(e)||e>=65&&e<=70||e>=97&&e<=102}function T0(e){return e>=65&&e<=90}function A0(e){return function(e){return T0(e)||function(e){return e>=97&&e<=122}(e)}(e)||function(e){return e>=128}(e)||95===e}function M0(e){return A0(e)||C0(e)||45===e}function N0(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function D0(e){return 10===e||13===e||12===e}function I0(e){return D0(e)||32===e||9===e}function L0(e,t){return 92===e&&!D0(t)&&t!==_0}function R0(e,t,n){return 45===e?A0(t)||45===t||L0(t,n):!!A0(e)||92===e&&L0(e,t)}function j0(e,t,n){return 43===e||45===e?C0(t)?2:46===t&&C0(n)?3:0:46===e?C0(t)?2:0:C0(e)?1:0}function F0(e){return 65279===e||65534===e?1:0}const z0=new Array(128),B0=130;for(let e=0;e<z0.length;e++)z0[e]=(I0(e)?B0:C0(e)&&131)||A0(e)&&132||N0(e)&&133||e||128;function W0(e){return e<128?z0[e]:132}function U0(e,t){return t<e.length?e.charCodeAt(t):0}function V0(e,t,n){return 13===n&&10===U0(e,t+1)?2:1}function H0(e,t,n){let r=e.charCodeAt(t);return T0(r)&&(r|=32),r===n}function q0(e,t,n,r){if(n-t!==r.length)return!1;if(t<0||n>e.length)return!1;for(let o=t;o<n;o++){const n=r.charCodeAt(o-t);let i=e.charCodeAt(o);if(T0(i)&&(i|=32),i!==n)return!1}return!0}function Q0(e,t){for(;t<e.length&&I0(e.charCodeAt(t));t++);return t}function $0(e,t){for(;t<e.length&&C0(e.charCodeAt(t));t++);return t}function G0(e,t){if(P0(U0(e,(t+=2)-1))){for(const n=Math.min(e.length,t+5);t<n&&P0(U0(e,t));t++);const n=U0(e,t);I0(n)&&(t+=V0(e,t,n))}return t}function Y0(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!M0(n)){if(!L0(n,U0(e,t+1)))break;t=G0(e,t)-1}}return t}function X0(e,t){let n=e.charCodeAt(t);if(43!==n&&45!==n||(n=e.charCodeAt(t+=1)),C0(n)&&(t=$0(e,t+1),n=e.charCodeAt(t)),46===n&&C0(e.charCodeAt(t+1))&&(t=$0(e,t+=2)),H0(e,t,101)){let r=0;n=e.charCodeAt(t+1),45!==n&&43!==n||(r=1,n=e.charCodeAt(t+2)),C0(n)&&(t=$0(e,t+1+r+1))}return t}function K0(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(41===n){t++;break}L0(n,U0(e,t+1))&&(t=G0(e,t))}return t}function Z0(e){if(1===e.length&&!P0(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(0===t||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const J0=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function e1(e=null,t){return null===e||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}function t1(e){const t=e.source,n=t.length,r=t.length>0?F0(t.charCodeAt(0)):0,o=e1(e.lines,n),i=e1(e.columns,n);let a=e.startLine,l=e.startColumn;for(let e=r;e<n;e++){const r=t.charCodeAt(e);o[e]=a,i[e]=l++,10!==r&&13!==r&&12!==r||(13===r&&e+1<n&&10===t.charCodeAt(e+1)&&(e++,o[e]=a,i[e]=l),a++,l=1)}o[n]=a,i[n]=l,e.lines=o,e.columns=i,e.computed=!0}class n1{constructor(e,t,n,r){this.setSource(e,t,n,r),this.lines=null,this.columns=null}setSource(e="",t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||t1(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||t1(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}}const r1=16777215,o1=24,i1=new Uint8Array(32);function a1(e){return 0!==i1[e]}i1[o0]=E0,i1[k0]=E0,i1[b0]=w0,i1[O0]=x0;class l1{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){const n=(e=String(e||"")).length,r=e1(this.offsetAndType,e.length+1),o=e1(this.balance,e.length+1);let i=0,a=-1,l=0,s=e.length;this.offsetAndType=null,this.balance=null,o.fill(0),t(e,(e,t,n)=>{const c=i++;if(r[c]=e<<o1|n,-1===a&&(a=t),o[c]=s,e===l){const e=o[s];o[s]=c,s=e,l=i1[r[e]>>o1]}else a1(e)&&(s=c,l=i1[e])}),r[i]=n0<<o1|n,o[i]=i;for(let e=0;e<i;e++){const t=o[e];if(t<=e){const n=o[t];n!==e&&(o[e]=n)}else t>i&&(o[e]=i)}this.source=e,this.firstCharOffset=-1===a?0:a,this.tokenCount=i,this.offsetAndType=r,this.balance=o,this.reset(),this.next()}lookupType(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e]>>o1:n0}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>o1;if(n!==h0&&n!==S0&&0===e--)return n}return n0}lookupOffset(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e-1]&r1:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>o1;if(n!==h0&&n!==S0&&0===e--)return t-this.tokenIndex}return n0}lookupValue(e,t){return(e+=this.tokenIndex)<this.tokenCount&&q0(this.source,this.offsetAndType[e-1]&r1,this.offsetAndType[e]&r1,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&r1:this.offsetAndType[this.tokenCount]&r1:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===c0&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===c0&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&r1,t=this.offsetAndType[t],this.tokenType=t>>o1,this.tokenEnd=t&r1):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>o1,this.tokenEnd=e&r1):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=n0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===h0||this.tokenType===S0;)this.next()}skipUntilBalanced(e,t){let n=e,r=0,o=0;e:for(;n<this.tokenCount&&(r=this.balance[n],!(r<e));n++)switch(o=n>0?this.offsetAndType[n-1]&r1:this.firstCharOffset,t(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:a1(this.offsetAndType[n]>>o1)&&(n=r)}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){const r=n,o=this.offsetAndType[t],i=o&r1;n=i,e(o>>o1,r,i,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,r,o)=>{e[o]={idx:o,type:J0[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}}function s1(e,t){function n(t){return t<a?e.charCodeAt(t):0}function r(){return c=X0(e,c),R0(n(c),n(c+1),n(c+2))?(l=p0,void(c=Y0(e,c))):37===n(c)?(l=d0,void c++):void(l=u0)}function o(){const t=c;return c=Y0(e,c),q0(e,t,c,"url")&&40===n(c)?(c=Q0(e,c+1),34===n(c)||39===n(c)?(l=o0,void(c=t+4)):void function(){for(l=s0,c=Q0(e,c);c<e.length;c++){const t=e.charCodeAt(c);switch(W0(t)){case 41:return void c++;case B0:return c=Q0(e,c),41===n(c)||c>=e.length?void(c<e.length&&c++):(c=K0(e,c),void(l=8));case 34:case 39:case 40:case 133:return c=K0(e,c),void(l=8);case 92:if(L0(t,n(c+1))){c=G0(e,c)-1;break}return c=K0(e,c),void(l=8)}}}()):40===n(c)?(l=o0,void c++):void(l=r0)}function i(t){for(t||(t=n(c++)),l=l0;c<e.length;c++){const r=e.charCodeAt(c);switch(W0(r)){case t:return void c++;case B0:if(D0(r))return c+=V0(e,c,r),void(l=6);break;case 92:if(c===e.length-1)break;const o=n(c+1);D0(o)?c+=V0(e,c+1,o):L0(r,o)&&(c=G0(e,c)-1)}}}const a=(e=String(e||"")).length;let l,s=F0(n(0)),c=s;for(;c<a;){const a=e.charCodeAt(c);switch(W0(a)){case B0:l=h0,c=Q0(e,c+1);break;case 34:i();break;case 35:M0(n(c+1))||L0(n(c+1),n(c+2))?(l=a0,c=Y0(e,c+1)):(l=c0,c++);break;case 39:i();break;case 40:l=k0,c++;break;case 41:l=E0,c++;break;case 43:j0(a,n(c+1),n(c+2))?r():(l=c0,c++);break;case 44:l=y0,c++;break;case 45:j0(a,n(c+1),n(c+2))?r():45===n(c+1)&&62===n(c+2)?(l=m0,c+=3):R0(a,n(c+1),n(c+2))?o():(l=c0,c++);break;case 46:j0(a,n(c+1),n(c+2))?r():(l=c0,c++);break;case 47:42===n(c+1)?(l=S0,c=e.indexOf("*/",c+2),c=-1===c?e.length:c+2):(l=c0,c++);break;case 58:l=g0,c++;break;case 59:l=v0,c++;break;case 60:33===n(c+1)&&45===n(c+2)&&45===n(c+3)?(l=f0,c+=4):(l=c0,c++);break;case 64:R0(n(c+1),n(c+2),n(c+3))?(l=i0,c=Y0(e,c+1)):(l=c0,c++);break;case 91:l=b0,c++;break;case 92:L0(a,n(c+1))?o():(l=c0,c++);break;case 93:l=w0,c++;break;case 123:l=O0,c++;break;case 125:l=x0,c++;break;case 131:r();break;case 132:o();break;default:l=c0,c++}t(l,s,s=c)}}let c1=null;class u1{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return u1.createItem(e)}allocateCursor(e,t){let n;return null!==c1?(n=c1,c1=c1.cursor,n.prev=e,n.next=t,n.cursor=this.cursor):n={prev:e,next:t,cursor:this.cursor},this.cursor=n,n}releaseCursor(){const{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=c1,c1=e}updateCursors(e,t,n,r){let{cursor:o}=this;for(;null!==o;)o.prev===e&&(o.prev=t),o.next===n&&(o.next=r),o=o.cursor}*[Symbol.iterator](){for(let e=this.head;null!==e;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;null!==t;t=t.next)e++;return e}get isEmpty(){return null===this.head}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let t=null;this.head=null;for(let n of e){const e=u1.createItem(n);null!==t?t.next=e:this.head=e,e.prev=t,t=e}return this.tail=t,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){const n=this.allocateCursor(null,this.head);for(;null!==n.next;){const r=n.next;n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t=this){const n=this.allocateCursor(this.tail,null);for(;null!==n.prev;){const r=n.prev;n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t,n=this){let r,o=this.allocateCursor(null,this.head),i=t;for(;null!==o.next;)r=o.next,o.next=r.next,i=e.call(n,i,r.data,r,this);return this.releaseCursor(),i}reduceRight(e,t,n=this){let r,o=this.allocateCursor(this.tail,null),i=t;for(;null!==o.prev;)r=o.prev,o.prev=r.prev,i=e.call(n,i,r.data,r,this);return this.releaseCursor(),i}some(e,t=this){for(let n=this.head;null!==n;n=n.next)if(e.call(t,n.data,n,this))return!0;return!1}map(e,t=this){const n=new u1;for(let r=this.head;null!==r;r=r.next)n.appendData(e.call(t,r.data,r,this));return n}filter(e,t=this){const n=new u1;for(let r=this.head;null!==r;r=r.next)e.call(t,r.data,r,this)&&n.appendData(r.data);return n}nextUntil(e,t,n=this){if(null===e)return;const r=this.allocateCursor(null,e);for(;null!==r.next;){const e=r.next;if(r.next=e.next,t.call(n,e.data,e,this))break}this.releaseCursor()}prevUntil(e,t,n=this){if(null===e)return;const r=this.allocateCursor(e,null);for(;null!==r.prev;){const e=r.prev;if(r.prev=e.prev,t.call(n,e.data,e,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const e=new u1;for(let t of this)e.appendData(t);return e}prepend(e){return this.updateCursors(null,e,this.head,e),null!==this.head?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(u1.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(u1.createItem(e))}insert(e,t=null){if(null!==t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,t){return this.insert(u1.createItem(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(null!==e.next)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(u1.createItem(e))}pop(){return null!==this.tail?this.remove(this.tail):null}unshift(e){this.prepend(u1.createItem(e))}shift(){return null!==this.head?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return null===e.head||(null!=t?(this.updateCursors(t.prev,e.tail,t,e.head),null!==t.prev?(t.prev.next=e.head,e.head.prev=t.prev):this.head=e.head,t.prev=e.tail,e.tail.next=t):(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null),this}replace(e,t){"head"in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}}function d1(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}\n`)}})}function p1({source:e,line:t,column:n,baseLine:r,baseColumn:o},i){function a(e,t){return l.slice(e,t).map((t,n)=>String(e+n+1).padStart(u)+" |"+t).join("\n")}const l=("\n".repeat(Math.max(r-1,0))+" ".repeat(Math.max(o-1,0))+e).split(/\r\n?|\n|\f/),s=Math.max(1,t-i)-1,c=Math.min(t+i,l.length+1),u=Math.max(4,String(c).length)+1;let d=0;(n+=3*(l[t-1].substr(0,n-1).match(/\t/g)||[]).length)>100&&(d=n-60+3,n=58);for(let e=s;e<=c;e++)e>=0&&e<l.length&&(l[e]=l[e].replace(/\t/g," "),l[e]=(d>0&&l[e].length>d?"…":"")+l[e].substr(d,98)+(l[e].length>d+100-1?"…":""));return[a(s,t),new Array(n+u+2).join("-")+"^",a(t,c)].filter(Boolean).join("\n").replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function h1(e,t,n,r,o,i=1,a=1){return Object.assign(d1("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment:e=>p1({source:t,line:r,column:o,baseLine:i,baseColumn:a},isNaN(e)?0:e),get formattedMessage(){return`Parse error: ${e}\n`+p1({source:t,line:r,column:o,baseLine:i,baseColumn:a},2)}})}function f1(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case S0:this.next();continue;case h0:n=!0,this.next();continue}let o=e.getNode.call(this,r);if(void 0===o)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,r),n=!1),t.push(o)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}const m1=()=>{};function g1(e){return function(){return this[e]()}}function v1(e){const t=Object.create(null);for(const n of Object.keys(e)){const r=e[n],o=r.parse||r;o&&(t[n]=o)}return t}var y1=o(1527);const b1=new Set(["Atrule","Selector","Declaration"]),w1=(e,t)=>{if(e===c0&&(e=t),"string"==typeof e){const t=e.charCodeAt(0);return t>127?32768:t<<8}return e},k1=[[r0,r0],[r0,o0],[r0,s0],[r0,8],[r0,"-"],[r0,u0],[r0,d0],[r0,p0],[r0,m0],[r0,k0],[i0,r0],[i0,o0],[i0,s0],[i0,8],[i0,"-"],[i0,u0],[i0,d0],[i0,p0],[i0,m0],[a0,r0],[a0,o0],[a0,s0],[a0,8],[a0,"-"],[a0,u0],[a0,d0],[a0,p0],[a0,m0],[p0,r0],[p0,o0],[p0,s0],[p0,8],[p0,"-"],[p0,u0],[p0,d0],[p0,p0],[p0,m0],["#",r0],["#",o0],["#",s0],["#",8],["#","-"],["#",u0],["#",d0],["#",p0],["#",m0],["-",r0],["-",o0],["-",s0],["-",8],["-","-"],["-",u0],["-",d0],["-",p0],["-",m0],[u0,r0],[u0,o0],[u0,s0],[u0,8],[u0,u0],[u0,d0],[u0,p0],[u0,"%"],[u0,m0],["@",r0],["@",o0],["@",s0],["@",8],["@","-"],["@",m0],[".",u0],[".",d0],[".",p0],["+",u0],["+",d0],["+",p0],["/","*"]],E1=k1.concat([[r0,a0],[p0,a0],[a0,a0],[i0,k0],[i0,l0],[i0,g0],[d0,d0],[d0,p0],[d0,o0],[d0,"-"],[E0,r0],[E0,o0],[E0,d0],[E0,p0],[E0,a0],[E0,"-"]]);function O1(e){const t=new Set(e.map(([e,t])=>w1(e)<<16|w1(t)));return function(e,n,r){const o=w1(n,r),i=r.charCodeAt(0);return(45===i&&n!==r0&&n!==o0&&n!==m0||43===i?t.has(e<<16|i<<8):t.has(e<<16|o))&&this.emit(" ",h0,!0),o}}const x1=O1(k1),S1=O1(E1);function _1(e,t){if("function"==typeof t){let n=null;return void e.children.forEach(e=>{null!==n&&t.call(this,n),this.node(e),n=e})}e.children.forEach(this.node,this)}function C1(e){s1(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}const{hasOwnProperty:P1}=Object.prototype,T1=function(){};function A1(e){return"function"==typeof e?e:T1}function M1(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function N1(e,t){const n=t.structure,r=[];for(const e in n){if(!1===P1.call(n,e))continue;let t=n[e];const o={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(const e of t)null===e?o.nullable=!0:"string"==typeof e?o.type="node":Array.isArray(e)&&(o.type="list");o.type&&r.push(o)}return r.length?{context:t.walkContext,fields:r}:null}function D1(e,t){const n=e.fields.slice(),r=e.context,o="string"==typeof r;return t&&n.reverse(),function(e,i,a,l){let s;o&&(s=i[r],i[r]=e);for(const r of n){const n=e[r.name];if(!r.nullable||n)if("list"===r.type){if(t?n.reduceRight(l,!1):n.reduce(l,!1))return!0}else if(a(n))return!0}o&&(i[r]=s)}}function I1({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}}}function L1(e){return e}function R1(e,t,n,r){let o;switch(e.type){case"Group":o=function(e,t,n,r){const o=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(e=>R1(e,t,n,r)).join(o);return e.explicit||n?(r||","===i[0]?"[":"[ ")+i+(r?"]":" ]"):i}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return R1(e.term,t,n,r)+t(function(e){const{min:t,max:n,comma:r}=e;return 0===t&&0===n?r?"#?":"*":0===t&&1===n?"?":1===t&&0===n?r?"#":"+":1===t&&1===n?"":(r?"#":"")+(t===n?"{"+t+"}":"{"+t+","+(0!==n?n:"")+"}")}(e),e);case"Boolean":o="<boolean-expr["+R1(e.term,t,n,r)+"]>";break;case"Type":o="<"+e.name+(e.opts?t(function(e){if("Range"===e.type)return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function j1(e,t){let n=L1,r=!1,o=!1;return"function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),o=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),R1(e,n,r,o)}const F1={offset:0,line:1,column:1};function z1(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?B1(n):n:null}function B1({offset:e,line:t,column:n},r){const o={offset:e,line:t,column:n};if(r){const e=r.split(/\n|\r\n?|\f/);o.offset+=r.length,o.line+=e.length-1,o.column=1===e.length?o.column+r.length:e.pop().length+1}return o}const W1=function(e,t){const n=d1("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},U1=function(e,t,n,r){const o=d1("SyntaxMatchError",e),{css:i,mismatchOffset:a,mismatchLength:l,start:s,end:c}=function(e,t){const n=e.tokens,r=e.longestMatch,o=r<n.length&&n[r].node||null,i=o!==t?o:null;let a,l,s=0,c=0,u=0,d="";for(let e=0;e<n.length;e++){const t=n[e].value;e===r&&(c=t.length,s=d.length),null!==i&&n[e].node===i&&(e<=r?u++:u=0),d+=t}return r===n.length||u>1?(a=z1(i||t,"end")||B1(F1,d),l=B1(a)):(a=z1(i,"start")||B1(z1(t,"start")||F1,d.slice(0,s)),l=z1(i,"end")||B1(a,d.substr(s,c))),{css:d,mismatchOffset:s,mismatchLength:c,start:a,end:l}}(r,n);return o.rawMessage=e,o.syntax=t?j1(t):"<generic>",o.css=i,o.mismatchOffset=a,o.mismatchLength=l,o.message=e+"\n syntax: "+o.syntax+"\n value: "+(i||"<empty string>")+"\n --------"+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,s),o.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:s,end:c},o},V1=new Map,H1=new Map,q1=45,Q1=function(e){if(V1.has(e))return V1.get(e);const t=e.toLowerCase();let n=V1.get(t);if(void 0===n){const e=G1(t,0),r=e?"":Y1(t,0);n=Object.freeze({basename:t.substr(r.length),name:t,prefix:r,vendor:r,custom:e})}return V1.set(e,n),n},$1=function(e){if(H1.has(e))return H1.get(e);let t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");const r=G1(t,n.length);if(!r&&(t=t.toLowerCase(),H1.has(t))){const n=H1.get(t);return H1.set(e,n),n}const o=r?"":Y1(t,n.length),i=t.substr(0,n.length+o.length),a=Object.freeze({basename:t.substr(i.length),name:t.substr(n.length),hack:n,vendor:o,prefix:i,custom:r});return H1.set(e,a),a};function G1(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===q1&&e.charCodeAt(t+1)===q1}function Y1(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===q1&&e.charCodeAt(t+1)!==q1){const n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}const X1=["initial","inherit","unset","revert","revert-layer"],K1=45,Z1=!0;function J1(e,t){return null!==e&&e.type===c0&&e.value.charCodeAt(0)===t}function e2(e,t,n){for(;null!==e&&(e.type===h0||e.type===S0);)e=n(++t);return t}function t2(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(43===o||o===K1){if(n)return 0;t++}for(;t<e.value.length;t++)if(!C0(e.value.charCodeAt(t)))return 0;return r+1}function n2(e,t,n){let r=!1,o=e2(e,t,n);if(null===(e=n(o)))return t;if(e.type!==u0){if(!J1(e,43)&&!J1(e,K1))return t;if(r=!0,o=e2(n(++o),o,n),null===(e=n(o))||e.type!==u0)return 0}if(!r){const t=e.value.charCodeAt(0);if(43!==t&&t!==K1)return 0}return t2(e,r?0:1,r,o)}function r2(e,t){return null!==e&&e.type===c0&&e.value.charCodeAt(0)===t}function o2(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(45===i&&n&&0!==r)return o2(e,t+r+1,!1),6;if(!P0(i))return 0;if(++r>6)return 0}return r}function i2(e,t,n){if(!e)return 0;for(;r2(n(t),63);){if(++e>6)return 0;t++}return t}const a2=["calc(","-moz-calc(","-webkit-calc("],l2=new Map([[o0,E0],[k0,E0],[b0,w0],[O0,x0]]);function s2(e,t){return t<e.length?e.charCodeAt(t):0}function c2(e,t){return q0(e,0,e.length,t)}function u2(e,t){for(let n=0;n<t.length;n++)if(c2(e,t[n]))return!0;return!1}function d2(e,t){return t===e.length-2&&92===s2(e,t)&&C0(s2(e,t+1))}function p2(e,t,n){if(e&&"Range"===e.type){const r=Number(void 0!==n&&n!==t.length?t.substr(0,n):t);if(isNaN(r))return!0;if(null!==e.min&&r<e.min&&"string"!=typeof e.min)return!0;if(null!==e.max&&r>e.max&&"string"!=typeof e.max)return!0}return!1}function h2(e){return function(t,n,r){return null===t?0:t.type===o0&&u2(t.value,a2)?function(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case x0:case E0:case w0:if(e.type!==n)break e;if(n=r.pop(),0===r.length){o++;break e}break;case o0:case k0:case b0:case O0:r.push(n),n=l2.get(e.type)}o++}while(e=t(o));return o}(t,n):e(t,n,r)}}function f2(e){return function(t){return null===t||t.type!==e?0:1}}function m2(e){return null===e||e.type!==r0||45!==s2(e.value,0)||45!==s2(e.value,1)?0:1}function g2(e){return e&&(e=new Set(e)),function(t,n,r){if(null===t||t.type!==p0)return 0;const o=X0(t.value,0);if(null!==e){const n=t.value.indexOf("\\",o),r=-1!==n&&d2(t.value,n)?t.value.substring(o,n):t.value.substr(o);if(!1===e.has(r.toLowerCase()))return 0}return p2(r,t.value,o)?0:1}}function v2(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===u0&&0===Number(t.value)?1:e(t,n,r)}}const y2={"ident-token":f2(r0),"function-token":f2(o0),"at-keyword-token":f2(i0),"hash-token":f2(a0),"string-token":f2(l0),"bad-string-token":f2(6),"url-token":f2(s0),"bad-url-token":f2(8),"delim-token":f2(c0),"number-token":f2(u0),"percentage-token":f2(d0),"dimension-token":f2(p0),"whitespace-token":f2(h0),"CDO-token":f2(f0),"CDC-token":f2(m0),"colon-token":f2(g0),"semicolon-token":f2(v0),"comma-token":f2(y0),"[-token":f2(b0),"]-token":f2(w0),"(-token":f2(k0),")-token":f2(E0),"{-token":f2(O0),"}-token":f2(x0)},b2={string:f2(l0),ident:f2(r0),percentage:h2(function(e,t,n){return null===e||e.type!==d0||p2(n,e.value,e.value.length-1)?0:1}),zero:v2(),number:h2(function(e,t,n){if(null===e)return 0;const r=X0(e.value,0);return r===e.value.length||d2(e.value,r)?p2(n,e.value,r)?0:1:0}),integer:h2(function(e,t,n){if(null===e||e.type!==u0)return 0;let r=43===s2(e.value,0)||45===s2(e.value,0)?1:0;for(;r<e.value.length;r++)if(!C0(s2(e.value,r)))return 0;return p2(n,e.value,r)?0:1}),"custom-ident":function(e){if(null===e||e.type!==r0)return 0;const t=e.value.toLowerCase();return u2(t,X1)||c2(t,"default")?0:1},"dashed-ident":m2,"custom-property-name":function(e){return m2(e)?"--"===e.value?0:1:0},"hex-color":function(e){if(null===e||e.type!==a0)return 0;const t=e.value.length;if(4!==t&&5!==t&&7!==t&&9!==t)return 0;for(let n=1;n<t;n++)if(!P0(s2(e.value,n)))return 0;return 1},"id-selector":function(e){return null===e||e.type!==a0?0:R0(s2(e.value,1),s2(e.value,2),s2(e.value,3))?1:0},"an-plus-b":function(e,t){let n=0;if(!e)return 0;if(e.type===u0)return t2(e,0,!1,n);if(e.type===r0&&e.value.charCodeAt(0)===K1){if(!H0(e.value,1,110))return 0;switch(e.value.length){case 2:return n2(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==K1?0:(n=e2(t(++n),n,t),t2(e=t(n),0,Z1,n));default:return e.value.charCodeAt(2)!==K1?0:t2(e,3,Z1,n)}}else if(e.type===r0||J1(e,43)&&t(n+1).type===r0){if(e.type!==r0&&(e=t(++n)),null===e||!H0(e.value,0,110))return 0;switch(e.value.length){case 1:return n2(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==K1?0:(n=e2(t(++n),n,t),t2(e=t(n),0,Z1,n));default:return e.value.charCodeAt(1)!==K1?0:t2(e,2,Z1,n)}}else if(e.type===p0){let r=e.value.charCodeAt(0),o=43===r||r===K1?1:0,i=o;for(;i<e.value.length&&C0(e.value.charCodeAt(i));i++);return i===o?0:H0(e.value,i,110)?i+1===e.value.length?n2(t(++n),n,t):e.value.charCodeAt(i+1)!==K1?0:i+2===e.value.length?(n=e2(t(++n),n,t),t2(e=t(n),0,Z1,n)):t2(e,i+2,Z1,n):0}return 0},urange:function(e,t){let n=0;if(null===e||e.type!==r0||!H0(e.value,0,117))return 0;if(null===(e=t(++n)))return 0;if(r2(e,43))return null===(e=t(++n))?0:e.type===r0?i2(o2(e,0,!0),++n,t):r2(e,63)?i2(1,++n,t):0;if(e.type===u0){const r=o2(e,1,!0);return 0===r?0:null===(e=t(++n))?n:e.type===p0||e.type===u0?function(e){return 45===e.value.charCodeAt(0)}(e)&&o2(e,1,!1)?n+1:0:i2(r,n,t)}return e.type===p0?i2(o2(e,1,!0),++n,t):0},"declaration-value":function(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case x0:case E0:case w0:if(e.type!==n)break e;n=r.pop();break;case v0:if(0===n)break e;break;case c0:if(0===n&&"!"===e.value)break e;break;case o0:case k0:case b0:case O0:r.push(n),n=l2.get(e.type)}o++}while(e=t(o));return o},"any-value":function(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case x0:case E0:case w0:if(e.type!==n)break e;n=r.pop();break;case o0:case k0:case b0:case O0:r.push(n),n=l2.get(e.type)}o++}while(e=t(o));return o}};function w2(e){const{angle:t,decibel:n,frequency:r,flex:o,length:i,resolution:a,semitones:l,time:s}=e||{};return{dimension:h2(g2(null)),angle:h2(g2(t)),decibel:h2(g2(n)),frequency:h2(g2(r)),flex:h2(g2(o)),length:h2(v2(g2(i))),resolution:h2(g2(a)),semitones:h2(g2(l)),time:h2(g2(s))}}const k2=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],E2=["deg","grad","rad","turn"],O2=["s","ms"],x2=["hz","khz"],S2=["dpi","dpcm","dppx","x"],_2=["fr"],C2=["db"],P2=["st"];function T2(e,t,n){return Object.assign(d1("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+"\n "+t+"\n--"+new Array((n||t.length)+1).join("-")+"^"})}const A2=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0);class M2{constructor(e){this.str=e,this.pos=0}charCodeAt(e){return e<this.str.length?this.str.charCodeAt(e):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(e=this.charCode()){return e<128&&1===A2[e]}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(e){return this.charCodeAt(this.findWsEnd(e))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(e){for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(13!==t&&10!==t&&12!==t&&32!==t&&9!==t)break}return e}substringToPos(e){return this.str.substring(this.pos,this.pos=e)}eat(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(e){throw new T2(e,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let e=this.pos;for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t>=128||0===A2[t])break}return this.pos===e&&this.error("Expect a keyword"),this.substringToPos(e)}scanNumber(){let e=this.pos;for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t<48||t>57)break}return this.pos===e&&this.error("Expect a number"),this.substringToPos(e)}scanString(){const e=this.str.indexOf("'",this.pos+1);return-1===e&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(e+1)}}const N2=123,D2={" ":1,"&&":2,"||":3,"|":4};function I2(e){let t=null,n=null;return e.eat(N2),e.skipWs(),t=e.scanNumber(e),e.skipWs(),44===e.charCode()?(e.pos++,e.skipWs(),125!==e.charCode()&&(n=e.scanNumber(e),e.skipWs())):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function L2(e,t){const n=function(e){let t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,e.charCode()===N2?t=I2(e):63===e.charCode()?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case N2:t=I2(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,35===e.charCode()&&43===e.charCodeAt(e.pos-1)?L2(e,n):n):t}function R2(e){const t=e.peek();return""===t?null:L2(e,{type:"Token",value:t})}function j2(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort((e,t)=>D2[e]-D2[t]);t.length>0;){r=t.shift();let o=0,i=0;for(;o<e.length;o++){const t=e[o];"Combinator"===t.type&&(t.value===r?(-1===i&&(i=o-1),e.splice(o,1),o--):(-1!==i&&o-i>1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}-1!==i&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function F2(e,t){const n=Object.create(null),r=[];let o,i=null,a=e.pos;for(;e.charCode()!==t&&(o=z2(e,t));)"Spaces"!==o.type&&("Combinator"===o.type?(null!==i&&"Combinator"!==i.type||(e.pos=a,e.error("Unexpected combinator")),n[o.value]=!0):null!==i&&"Combinator"!==i.type&&(n[" "]=!0,r.push({type:"Combinator",value:" "})),r.push(o),i=o,a=e.pos);return null!==i&&"Combinator"===i.type&&(e.pos-=a,e.error("Unexpected combinator")),{type:"Group",terms:r,combinator:j2(r,n)||" ",disallowEmpty:!1,explicit:!1}}function z2(e,t){let n=e.charCode();switch(n){case 93:break;case 91:return L2(e,function(e,t){let n;return e.eat(91),n=F2(e,t),e.eat(93),n.explicit=!0,33===e.charCode()&&(e.pos++,n.disallowEmpty=!0),n}(e,t));case 60:return 39===e.nextCharCode()?function(e){let t;return e.eat(60),e.eat(39),t=e.scanWord(),e.eat(39),e.eat(62),L2(e,{type:"Property",name:t})}(e):function(e){let t,n=null;if(e.eat(60),t=e.scanWord(),"boolean-expr"===t){e.eat(91);const t=F2(e,93);return e.eat(93),e.eat(62),L2(e,{type:"Boolean",term:1===t.terms.length?t.terms[0]:t})}return 40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(e.skipWs(),n=function(e){let t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():(t=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(44),e.skipWs(),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(n+=e.scanWord())),e.eat(93),{type:"Range",min:t,max:n}}(e)),e.eat(62),L2(e,{type:"Type",name:t,opts:n})}(e);case 124:return{type:"Combinator",value:e.substringToPos(e.pos+(124===e.nextCharCode()?2:1))};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return L2(e,{type:"String",value:e.scanString()});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:e.scanSpaces()};case 64:return n=e.nextCharCode(),e.isNameCharCode(n)?(e.pos++,{type:"AtKeyword",name:e.scanWord()}):R2(e);case 42:case 43:case 63:case 35:case 33:break;case N2:if(n=e.nextCharCode(),n<48||n>57)return R2(e);break;default:return e.isNameCharCode(n)?function(e){const t=e.scanWord();return 40===e.charCode()?(e.pos++,{type:"Function",name:t}):L2(e,{type:"Keyword",name:t})}(e):R2(e)}}function B2(e){const t=new M2(e),n=F2(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type?n.terms[0]:n}const W2=function(){};const U2={decorator(e){const t=[];let n=null;return{...e,node(t){const r=n;n=t,e.node.call(this,t),n=r},emit(e,r,o){t.push({type:r,value:e,node:o?null:n})},result:()=>t}}};const V2={type:"Match"},H2={type:"Mismatch"},q2={type:"DisallowEmpty"};function Q2(e,t,n){return t===V2&&n===H2||e===V2&&t===V2&&n===V2?e:("If"===e.type&&e.else===H2&&t===V2&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function $2(e){return e.length>2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function G2(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&$2(e.name)}function Y2(e,t=" ",n=!1){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:n}}function X2(e,t,n=new Set){if(!n.has(e))switch(n.add(e),e.type){case"If":e.match=X2(e.match,t,n),e.then=X2(e.then,t,n),e.else=X2(e.else,t,n);break;case"Type":return t[e.name]||e}return e}function K2(e,t,n){switch(e){case" ":{let e=V2;for(let n=t.length-1;n>=0;n--)e=Q2(t[n],e,H2);return e}case"|":{let e=H2,n=null;for(let r=t.length-1;r>=0;r--){let o=t[r];if(G2(o)&&(null===n&&r>0&&G2(t[r-1])&&(n=Object.create(null),e=Q2({type:"Enum",map:n},V2,e)),null!==n)){const e=($2(o.name)?o.name.slice(0,-1):o.name).toLowerCase();if(e in n==0){n[e]=o;continue}}n=null,e=Q2(o,V2,e)}return e}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let n=H2;for(let r=t.length-1;r>=0;r--){const o=t[r];let i;i=t.length>1?K2(e,t.filter(function(e){return e!==o}),!1):V2,n=Q2(o,i,n)}return n}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?V2:H2;for(let n=t.length-1;n>=0;n--){const o=t[n];let i;i=t.length>1?K2(e,t.filter(function(e){return e!==o}),!0):V2,r=Q2(o,i,r)}return r}}}function Z2(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=K2(e.combinator,e.terms.map(Z2),!1);return e.disallowEmpty&&(t=Q2(t,q2,H2)),t}case"Multiplier":return function(e){let t=V2,n=Z2(e.term);if(0===e.max)n=Q2(n,q2,H2),t=Q2(n,null,H2),t.then=Q2(V2,V2,t),e.comma&&(t.then.else=Q2({type:"Comma",syntax:e},t,H2));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==V2&&(t=Q2({type:"Comma",syntax:e},t,H2)),t=Q2(n,Q2(V2,V2,t),H2);if(0===e.min)t=Q2(V2,V2,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==V2&&(t=Q2({type:"Comma",syntax:e},t,H2)),t=Q2(n,t,H2);return t}(e);case"Boolean":{const t=Z2(e.term),n=Z2(Y2([Y2([{type:"Keyword",name:"not"},{type:"Type",name:"!boolean-group"}]),Y2([{type:"Type",name:"!boolean-group"},Y2([{type:"Multiplier",comma:!1,min:0,max:0,term:Y2([{type:"Keyword",name:"and"},{type:"Type",name:"!boolean-group"}])},{type:"Multiplier",comma:!1,min:0,max:0,term:Y2([{type:"Keyword",name:"or"},{type:"Type",name:"!boolean-group"}])}],"|")])],"|")),r=Z2(Y2([{type:"Type",name:"!term"},Y2([{type:"Token",value:"("},{type:"Type",name:"!self"},{type:"Token",value:")"}]),{type:"Type",name:"general-enclosed"}],"|"));return X2(r,{"!term":t,"!self":n}),X2(n,{"!boolean-group":r}),n}case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return 3===e.value.length?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function J2(e,t){return"string"==typeof e&&(e=B2(e)),{type:"MatchGraph",match:Z2(e),syntax:t||null,source:e}}const{hasOwnProperty:e3}=Object.prototype,t3="Match";let n3=0;function r3(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=t.charCodeAt(n);let o=e.charCodeAt(n);if(o>=65&&o<=90&&(o|=32),o!==r)return!1}return!0}function o3(e){return null===e||e.type===y0||e.type===o0||e.type===k0||e.type===b0||e.type===O0||function(e){return e.type===c0&&"?"!==e.value}(e)}function i3(e){return null===e||e.type===E0||e.type===w0||e.type===x0||e.type===c0&&"/"===e.value}function a3(e,t,n){const r=function(e,t,n){function r(){do{y++,v=y<e.length?e[y]:null}while(null!==v&&(v.type===h0||v.type===S0))}function o(t){const n=y+t;return n<e.length?e[n]:null}function i(e,t){return{nextState:e,matchStack:w,syntaxStack:d,thenStack:p,tokenIndex:y,prev:t}}function a(e){p={nextState:e,matchStack:w,syntaxStack:d,prev:p}}function l(e){h=i(e,h)}function s(){w={type:1,syntax:t.syntax,token:v,prev:w},r(),f=null,y>b&&(b=y)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||null!==d&&d.opts||null,prev:d},w={type:2,syntax:t.syntax,token:w.token,prev:w}}function u(){w=2===w.type?w.prev:{type:3,syntax:d.syntax,token:w.token,prev:w},d=d.prev}let d=null,p=null,h=null,f=null,m=0,g=null,v=null,y=-1,b=0,w={type:0,syntax:null,token:null,prev:null};for(r();null===g&&++m<15e3;)switch(t.type){case"Match":if(null===p){if(null!==v&&(y!==e.length-1||"\\0"!==v.value&&"\\9"!==v.value)){t=H2;break}g=t3;break}if((t=p.nextState)===q2){if(p.matchStack===w){t=H2;break}t=V2}for(;p.syntaxStack!==d;)u();p=p.prev;break;case"Mismatch":if(null!==f&&!1!==f)(null===h||y>h.tokenIndex)&&(h=f,f=!1);else if(null===h){g="Mismatch";break}t=h.nextState,p=h.thenStack,d=h.syntaxStack,w=h.matchStack,y=h.tokenIndex,v=y<e.length?e[y]:null,h=h.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==H2&&l(t.else),t.then!==V2&&a(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const e=t.syntax.terms;if(t.index===e.length){if(0===t.mask||t.syntax.all){t=H2;break}t=V2;break}if(t.mask===(1<<e.length)-1){t=V2;break}for(;t.index<e.length;t.index++){const n=1<<t.index;if(0===(t.mask&n)){l(t),a({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|n}),t=e[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(null!==v){let e=v.value.toLowerCase();if(-1!==e.indexOf("\\")&&(e=e.replace(/\\[09].*$/,"")),e3.call(t.map,e)){t=t.map[e];break}}t=H2;break;case"Generic":{const e=null!==d?d.opts:null,n=y+Math.floor(t.fn(v,o,e));if(!isNaN(n)&&n>y){for(;y<n;)s();t=V2}else t=H2;break}case"Type":case"Property":{const e="Type"===t.type?"types":"properties",r=e3.call(n,e)?n[e][t.name]:null;if(!r||!r.match)throw new Error("Bad syntax reference: "+("Type"===t.type?"<"+t.name+">":"<'"+t.name+"'>"));if(!1!==f&&null!==v&&"Type"===t.type&&("custom-ident"===t.name&&v.type===r0||"length"===t.name&&"0"===v.value)){null===f&&(f=i(t,h)),t=H2;break}c(),t=r.matchRef||r.match;break}case"Keyword":{const e=t.name;if(null!==v){let n=v.value;if(-1!==n.indexOf("\\")&&(n=n.replace(/\\[09].*$/,"")),r3(n,e)){s(),t=V2;break}}t=H2;break}case"AtKeyword":case"Function":if(null!==v&&r3(v.value,t.name)){s(),t=V2;break}t=H2;break;case"Token":if(null!==v&&v.value===t.value){s(),t=V2;break}t=H2;break;case"Comma":null!==v&&v.type===y0?o3(w.token)?t=H2:(s(),t=i3(v)?H2:V2):t=o3(w.token)||i3(v)?V2:H2;break;case"String":let r="",m=y;for(;m<e.length&&r.length<t.value.length;m++)r+=e[m].value;if(r3(r,t.value)){for(;y<m;)s();t=V2}else t=H2;break;default:throw new Error("Unknown node type: "+t.type)}switch(n3+=m,g){case null:console.warn("[csstree-match] BREAK after 15000 iterations"),g="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",w=null;break;case t3:for(;null!==d;)u();break;default:w=null}return{tokens:e,reason:g,iterations:m,match:w,longestMatch:b}}(e,t,n||{});if(null===r.match)return r;let o=r.match,i=r.match={syntax:t.syntax||null,match:[]};const a=[i];for(o=function(e){let t=null,n=null,r=e;for(;null!==r;)n=r.prev,r.prev=t,t=r,r=n;return t}(o).prev;null!==o;){switch(o.type){case 2:i.match.push(i={syntax:o.syntax,match:[]}),a.push(i);break;case 3:a.pop(),i=a[a.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return r}function l3(e){function t(e){return null!==e&&("Type"===e.type||"Property"===e.type||"Keyword"===e.type)}let n=null;return null!==this.matched&&function r(o){if(Array.isArray(o.match)){for(let e=0;e<o.match.length;e++)if(r(o.match[e]))return t(o.syntax)&&n.unshift(o.syntax),!0}else if(o.node===e)return n=t(o.syntax)?[o.syntax]:[],!0;return!1}(this.matched),n}function s3(e,t){return d3(this,e,e=>"Type"===e.type&&e.name===t)}function c3(e,t){return d3(this,e,e=>"Property"===e.type&&e.name===t)}function u3(e){return d3(this,e,e=>"Keyword"===e.type)}function d3(e,t,n){const r=l3.call(e,t);return null!==r&&r.some(n)}function p3(e){return"node"in e?e.node:p3(e.match[0])}function h3(e){return"node"in e?e.node:h3(e.match[e.match.length-1])}function f3(e,t,n,r,o){const i=[];return null!==n.matched&&function n(a){if(null!==a.syntax&&a.syntax.type===r&&a.syntax.name===o){const n=p3(a),r=h3(a);e.syntax.walk(t,function(e,t,o){if(e===n){const e=new u1;do{if(e.appendData(t.data),t.data===r)break;t=t.next}while(null!==t);i.push({parent:o,nodes:e})}})}Array.isArray(a.match)&&a.match.forEach(n)}(n.matched),i}const{hasOwnProperty:m3}=Object.prototype;function g3(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0}function v3(e){return Boolean(e)&&g3(e.offset)&&g3(e.line)&&g3(e.column)}function y3(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(let o in n){let i=!0;if(!1!==m3.call(n,o)){if("type"===o)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===o){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)o+=".source";else if(v3(n.loc.start)){if(v3(n.loc.end))continue;o+=".end"}else o+=".start";i=!1}else if(t.hasOwnProperty(o)){i=!1;for(let e=0;!i&&e<t[o].length;e++){const r=t[o][e];switch(r){case String:i="string"==typeof n[o];break;case Boolean:i="boolean"==typeof n[o];break;case null:i=null===n[o];break;default:"string"==typeof r?i=n[o]&&n[o].type===r:Array.isArray(r)&&(i=n[o]instanceof u1)}}}else r(n,"Unknown field `"+o+"` for "+e+" node type");i||r(n,"Bad value for `"+e+"."+o+"`")}}for(const o in t)m3.call(t,o)&&!1===m3.call(n,o)&&r(n,"Field `"+e+"."+o+"` is missed")}}function b3(e,t){const n=[];for(let r=0;r<e.length;r++){const o=e[r];if(o===String||o===Boolean)n.push(o.name.toLowerCase());else if(null===o)n.push("null");else if("string"==typeof o)n.push(o);else{if(!Array.isArray(o))throw new Error("Wrong value `"+o+"` in `"+t+"` structure definition");n.push("List<"+(b3(o,t)||"any")+">")}}return n.join(" | ")}function w3(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const t in n){if(!1===m3.call(n,t))continue;const i=r[t]=Array.isArray(n[t])?n[t].slice():[n[t]];o[t]=b3(i,e+"."+t)}return{docs:o,check:y3(e,r)}}function k3(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:j1(e[o].syntax,{compact:t}));return r}function E3(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:j1(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&k3(i.descriptors,t,n)};return r}function O3(e,t,r){return{matched:e,iterations:r,error:t,...n}}function x3(e,t,n,r){const o=function(e,t){return"string"==typeof e?function(e){const t=[];return s1(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}(e):t.generate(e,U2)}(n,e.syntax);let i;return function(e){for(let t=0;t<e.length;t++)if("var("===e[t].value.toLowerCase())return!0;return!1}(o)?O3(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=a3(o,e.cssWideKeywordsSyntax,e)),r&&i.match||(i=a3(o,t.match,e),i.match)?O3(i.match,null,i.iterations):O3(null,new U1(i.reason,t.syntax,n,i),i.iterations))}class S3{constructor(e,n,r){if(this.cssWideKeywords=X1,this.syntax=n,this.generic=!1,this.units={...t},this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=r||function(e){const t={};if(e.node)for(const n in e.node)if(m3.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=w3(n,r)}return t}(e),e){if(e.cssWideKeywords&&(this.cssWideKeywords=e.cssWideKeywords),e.units)for(const n of Object.keys(t))Array.isArray(e.units[n])&&(this.units[n]=e.units[n]);if(e.types)for(const[t,n]of Object.entries(e.types))this.addType_(t,n);if(e.generic){this.generic=!0;for(const[e,t]of Object.entries((o=this.units,{...y2,...b2,...w2(o)})))this.addType_(e,t)}if(e.atrules)for(const[t,n]of Object.entries(e.atrules))this.addAtrule_(t,n);if(e.properties)for(const[t,n]of Object.entries(e.properties))this.addProperty_(t,n)}var o;this.cssWideKeywordsSyntax=J2(this.cssWideKeywords.join(" | "))}checkStructure(e){function t(e,t){r.push({node:e,message:t})}const n=this.structure,r=[];return this.syntax.walk(e,function(e){n.hasOwnProperty(e.type)?n[e.type].check(e,t):t(e,"Unknown node type `"+e.type+"`")}),!!r.length&&r}createDescriptor(e,t,n,r=null){const o={type:t,name:n},i={type:t,name:n,parent:r,serializable:"string"==typeof e||e&&"string"==typeof e.type,syntax:null,match:null,matchRef:null};return"function"==typeof e?i.match=J2(e,o):("string"==typeof e?Object.defineProperty(i,"syntax",{get:()=>(Object.defineProperty(i,"syntax",{value:B2(e)}),i.syntax)}):i.syntax=e,Object.defineProperty(i,"match",{get:()=>(Object.defineProperty(i,"match",{value:J2(i.syntax,o)}),i.match)}),"Property"===t&&Object.defineProperty(i,"matchRef",{get(){const e=i.syntax,t=function(e){const t=e.terms[0];return!1===e.explicit&&1===e.terms.length&&"Multiplier"===t.type&&!0===t.comma}(e)?J2({...e,terms:[e.terms[0].term]},o):null;return Object.defineProperty(i,"matchRef",{value:t}),t}})),i}addAtrule_(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n),Object.create(null)):null})}addProperty_(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))}addType_(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e))}checkAtruleName(e){if(!this.getAtrule(e))return new W1("Unknown at-rule","@"+e)}checkAtrulePrelude(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e);return!r.prelude&&t?new SyntaxError("At-rule `@"+e+"` should not contain a prelude"):!r.prelude||t||x3(this,r.prelude,"",!1).matched?void 0:new SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e),o=Q1(t);return r.descriptors?r.descriptors[o.name]||r.descriptors[o.basename]?void 0:new W1("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")}checkPropertyName(e){if(!this.getProperty(e))return new W1("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return O3(null,n);const r=this.getAtrule(e);return r.prelude?x3(this,r.prelude,t||"",!1):O3(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return O3(null,r);const o=this.getAtrule(e),i=Q1(t);return x3(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return"Declaration"!==e.type?O3(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if($1(e).custom)return O3(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?O3(null,n):x3(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?x3(this,n,t,!1):O3(null,new W1("Unknown type",e))}match(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),x3(this,e,t,!1)):O3(null,new W1("Bad syntax"))}findValueFragments(e,t,n,r){return f3(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return f3(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){const r=[];return this.syntax.walk(e,{visit:"Declaration",enter:e=>{r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}}),r}getAtrule(e,t=!0){const n=Q1(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){const n=$1(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(e,t){return t?`<${e}>`:`<'${e}'>`}function t(i,a,l,s){if(l.has(a))return l.get(a);l.set(a,!1),null!==s.syntax&&function(e,t,n){let r=W2,o=W2;if(r=t,r===W2&&o===W2)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(r.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":case"Boolean":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}o.call(n,t)}(e)}(s.syntax,function(s){if("Type"!==s.type&&"Property"!==s.type)return;const c="Type"===s.type?i.types:i.properties,u="Type"===s.type?r:o;hasOwnProperty.call(c,s.name)?t(i,s.name,u,c[s.name])&&(n.push(`${e(a,l===r)} used broken syntax definition ${e(s.name,"Type"===s.type)}`),l.set(a,!0)):(n.push(`${e(a,l===r)} used missed syntax definition ${e(s.name,"Type"===s.type)}`),l.set(a,!0))},this)}const n=[];let r=new Map,o=new Map;for(const e in this.types)t(this,e,r,this.types[e]);for(const e in this.properties)t(this,e,o,this.properties[e]);const i=[...r.keys()].filter(e=>r.get(e)),a=[...o.keys()].filter(e=>o.get(e));return i.length||a.length?{errors:n,types:i,properties:a}:null}dump(e,t){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:k3(this.types,!t,e),properties:k3(this.properties,!t,e),atrules:E3(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}}function _3(e,t){return"string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function C3(e,t){const n=Object.create(null);for(const[r,o]of Object.entries(e))if(o){n[r]={};for(const e of Object.keys(o))t.includes(e)&&(n[r][e]=o[e])}return n}function P3(e,t){const n={...e};for(const[r,o]of Object.entries(t))switch(r){case"generic":n[r]=Boolean(o);break;case"cssWideKeywords":n[r]=e[r]?[...e[r],...o]:o||[];break;case"units":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]=Array.isArray(t)?t:[];break;case"atrules":n[r]={...e[r]};for(const[e,t]of Object.entries(o)){const o=n[r][e]||{},i=n[r][e]={prelude:o.prelude||null,descriptors:{...o.descriptors}};if(t){i.prelude=t.prelude?_3(i.prelude,t.prelude):i.prelude||null;for(const[e,n]of Object.entries(t.descriptors||{}))i.descriptors[e]=n?_3(i.descriptors[e],n):null;Object.keys(i.descriptors).length||(i.descriptors=null)}}break;case"types":case"properties":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]=_3(n[r][e],t);break;case"scope":case"features":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]={...n[r][e],...t};break;case"parseContext":n[r]={...e[r],...o};break;case"atrule":case"pseudo":n[r]={...e[r],...C3(o,["parse"])};break;case"node":n[r]={...e[r],...C3(o,["name","structure","parse","generate","walkContext"])}}return n}function T3(t){const n=function(e){let t="",n="<unknown>",r=!1,o=m1,i=!1;const a=new n1,l=Object.assign(new l1,function(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:v1(e.atrule),pseudo:v1(e.pseudo),node:v1(e.node)};for(const[n,r]of Object.entries(e.parseContext))switch(typeof r){case"function":t.context[n]=r;break;case"string":t.context[n]=g1(r)}return{config:t,...t,...t.node}}(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:f1,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:e=>123===e?1:0,consumeUntilLeftCurlyBracketOrSemicolon:e=>123===e||59===e?1:0,consumeUntilExclamationMarkOrSemicolon:e=>33===e||59===e?1:0,consumeUntilSemicolonIncluded:e=>59===e?2:0,createList:()=>new u1,createSingleNodeList:e=>(new u1).appendData(e),getFirstListNode:e=>e&&e.first,getLastListNode:e=>e&&e.last,parseWithFallback(e,t){const n=this.tokenIndex;try{return e.call(this)}catch(e){if(i)throw e;this.skip(n-this.tokenIndex);const r=t.call(this);return i=!0,o(e,r),i=!1,r}},lookupNonWSType(e){let t;do{if(t=this.lookupType(e++),t!==h0&&t!==S0)return t}while(0!==t);return 0},charCodeAt:e=>e>=0&&e<t.length?t.charCodeAt(e):0,substring:(e,n)=>t.substring(e,n),substrToCursor(e){return this.source.substring(e,this.tokenStart)},cmpChar:(e,n)=>H0(t,e,n),cmpStr:(e,n,r)=>q0(t,e,n,r),consume(e){const t=this.tokenStart;return this.eat(e),this.substrToCursor(t)},consumeFunctionName(){const e=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(o0),e},consumeNumber(e){const n=t.substring(this.tokenStart,X0(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){const t=J0[e].slice(0,-6).replace(/-/g," ").replace(/^./,e=>e.toUpperCase());let n=`${/[[\](){}]/.test(t)?`"${t}"`:t} is expected`,r=this.tokenStart;switch(e){case r0:this.tokenType===o0||this.tokenType===s0?(r=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case a0:this.isDelim(35)&&(this.next(),r++,n="Name is expected");break;case d0:this.tokenType===u0&&(r=this.tokenEnd,n="Percent sign is expected")}this.error(n,r)}this.next()},eatIdent(e){this.tokenType===r0&&!1!==this.lookupValue(0,e)||this.error(`Identifier "${e}" is expected`),this.next()},eatDelim(e){this.isDelim(e)||this.error(`Delim "${String.fromCharCode(e)}" is expected`),this.next()},getLocation:(e,t)=>r?a.getLocationRange(e,t,n):null,getLocationFromList(e){if(r){const t=this.getFirstListNode(e),r=this.getLastListNode(e);return a.getLocationRange(null!==t?t.loc.start.offset-a.startOffset:this.tokenStart,null!==r?r.loc.end.offset-a.startOffset:this.tokenStart,n)}return null},error(e,n){const r=void 0!==n&&n<t.length?a.getLocation(n):this.eof?a.getLocation(function(e,t){for(;t>=0&&I0(e.charCodeAt(t));t--);return t+1}(t,t.length-1)):a.getLocation(this.tokenStart);throw new h1(e||"Unexpected input",t,r.offset,r.line,r.column,a.startLine,a.startColumn)}});return Object.assign(function(e,s){t=e,s=s||{},l.setSource(t,s1),a.setSource(t,s.offset,s.line,s.column),n=s.filename||"<unknown>",r=Boolean(s.positions),o="function"==typeof s.onParseError?s.onParseError:m1,i=!1,l.parseAtrulePrelude=!("parseAtrulePrelude"in s)||Boolean(s.parseAtrulePrelude),l.parseRulePrelude=!("parseRulePrelude"in s)||Boolean(s.parseRulePrelude),l.parseValue=!("parseValue"in s)||Boolean(s.parseValue),l.parseCustomProperty="parseCustomProperty"in s&&Boolean(s.parseCustomProperty);const{context:c="default",onComment:u}=s;if(c in l.context==0)throw new Error("Unknown context `"+c+"`");"function"==typeof u&&l.forEachToken((e,n,r)=>{if(e===S0){const e=l.getLocation(n,r),o=q0(t,r-2,r,"*/")?t.slice(n+2,r-2):t.slice(n+2,r);u(o,e)}});const d=l.context[c].call(l,s);return l.eof||l.error(),d},{SyntaxError:h1,config:l.config})}(t),r=function(e){const t=function(e){const t={};for(const n in e.node)if(P1.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=N1(0,r)}return t}(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const e in t)P1.call(t,e)&&null!==t[e]&&(n[e]=D1(t[e],!1),r[e]=D1(t[e],!0));const a=I1(n),l=I1(r),s=function(e,s){function c(e,t,n){const r=u.call(f,e,t,n);return r===o||r!==i&&(!(!p.hasOwnProperty(e.type)||!p[e.type](e,f,c,h))||d.call(f,e,t,n)===o)}let u=T1,d=T1,p=n,h=(e,t,n,r)=>e||c(t,n,r);const f={break:o,skip:i,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof s)u=s;else if(s&&(u=A1(s.enter),d=A1(s.leave),s.reverse&&(p=r),s.visit)){if(a.hasOwnProperty(s.visit))p=s.reverse?l[s.visit]:a[s.visit];else if(!t.hasOwnProperty(s.visit))throw new Error("Bad value `"+s.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");u=M1(u,s.visit),d=M1(d,s.visit)}if(u===T1&&d===T1)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(e)};return s.break=o,s.skip=i,s.find=function(e,t){let n=null;return s(e,function(e,r,i){if(t.call(this,e,r,i))return n=e,o}),n},s.findLast=function(e,t){let n=null;return s(e,{reverse:!0,enter(e,r,i){if(t.call(this,e,r,i))return n=e,o}}),n},s.findAll=function(e,t){const n=[];return s(e,function(e,r,o){t.call(this,e,r,o)&&n.push(e)}),n},s}(t),o=function(t){const n=new Map;for(let[e,r]of Object.entries(t.node))"function"==typeof(r.generate||r)&&n.set(e,r.generate||r);return function(t,r){let o="",i=0,a={node(e){if(!n.has(e.type))throw new Error("Unknown node type: "+e.type);n.get(e.type).call(l,e)},tokenBefore:S1,token(e,t){i=this.tokenBefore(i,e,t),this.emit(t,e,!1),e===c0&&92===t.charCodeAt(0)&&this.emit("\n",h0,!0)},emit(e){o+=e},result:()=>o};r&&("function"==typeof r.decorator&&(a=r.decorator(a)),r.sourceMap&&(a=function(e){const t=new y1.x,n={line:1,column:0},r={line:0,column:0},o={line:1,column:0},i={generated:o};let a=1,l=0,s=!1;const c=e.node;e.node=function(e){if(e.loc&&e.loc.start&&b1.has(e.type)){const c=e.loc.start.line,u=e.loc.start.column-1;r.line===c&&r.column===u||(r.line=c,r.column=u,n.line=a,n.column=l,s&&(s=!1,n.line===o.line&&n.column===o.column||t.addMapping(i)),s=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}c.call(this,e),s&&b1.has(e.type)&&(o.line=a,o.column=l)};const u=e.emit;e.emit=function(e,t,n){for(let t=0;t<e.length;t++)10===e.charCodeAt(t)?(a++,l=0):l++;u(e,t,n)};const d=e.result;return e.result=function(){return s&&t.addMapping(i),{css:d(),map:t}},e}(a)),r.mode in e&&(a.tokenBefore=e[r.mode]));const l={node:e=>a.node(e),children:_1,token:(e,t)=>a.token(e,t),tokenize:C1};return a.node(t),a.result()}}(t),{fromPlainObject:i,toPlainObject:a}=function(e){return{fromPlainObject:t=>(e(t,{enter(e){e.children&&e.children instanceof u1==0&&(e.children=(new u1).fromArray(e.children))}}),t),toPlainObject:t=>(e(t,{leave(e){e.children&&e.children instanceof u1&&(e.children=e.children.toArray())}}),t)}}(r),l={lexer:null,createLexer:e=>new S3(e,l,l.lexer.structure),tokenize:s1,parse:n,generate:o,walk:r,find:r.find,findLast:r.findLast,findAll:r.findAll,fromPlainObject:i,toPlainObject:a,fork(e){const n=P3({},t);return T3("function"==typeof e?e(n):P3(n,e))}};return l.lexer=new S3({generic:t.generic,cssWideKeywords:t.cssWideKeywords,units:t.units,types:t.types,atrules:t.atrules,properties:t.properties,node:t.node},l),l}const A3=43,M3=45,N3=110,D3=!0,I3=!1;function L3(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for(r!==A3&&r!==M3||(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)C0(this.charCodeAt(n))||this.error("Integer is expected",n)}function R3(e){return L3.call(this,0,e)}function j3(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case N3:n="N is expected";break;case M3:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function F3(){let e=0,t=0,n=this.tokenType;for(;n===h0||n===S0;)n=this.lookupType(++e);if(n!==u0){if(!this.isDelim(A3,e)&&!this.isDelim(M3,e))return null;t=this.isDelim(A3,e)?A3:M3;do{n=this.lookupType(++e)}while(n===h0||n===S0);n!==u0&&(this.skip(e),R3.call(this,D3))}return e>0&&this.skip(e),0===t&&(n=this.charCodeAt(this.tokenStart),n!==A3&&n!==M3&&this.error("Number sign is expected")),R3.call(this,0!==t),t===M3?"-"+this.consume(u0):this.consume(u0)}const z3="AnPlusB",B3={a:[String,null],b:[String,null]};function W3(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===u0)R3.call(this,I3),n=this.consume(u0);else if(this.tokenType===r0&&this.cmpChar(this.tokenStart,M3))switch(t="-1",j3.call(this,1,N3),this.tokenEnd-this.tokenStart){case 2:this.next(),n=F3.call(this);break;case 3:j3.call(this,2,M3),this.next(),this.skipSC(),R3.call(this,D3),n="-"+this.consume(u0);break;default:j3.call(this,2,M3),L3.call(this,3,D3),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===r0||this.isDelim(A3)&&this.lookupType(1)===r0){let r=0;switch(t="1",this.isDelim(A3)&&(r=1,this.next()),j3.call(this,0,N3),this.tokenEnd-this.tokenStart){case 1:this.next(),n=F3.call(this);break;case 2:j3.call(this,1,M3),this.next(),this.skipSC(),R3.call(this,D3),n="-"+this.consume(u0);break;default:j3.call(this,1,M3),L3.call(this,2,D3),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===p0){const r=this.charCodeAt(this.tokenStart),o=r===A3||r===M3;let i=this.tokenStart+o;for(;i<this.tokenEnd&&C0(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),j3.call(this,i-this.tokenStart,N3),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=F3.call(this)):(j3.call(this,i-this.tokenStart+1,M3),i+2===this.tokenEnd?(this.next(),this.skipSC(),R3.call(this,D3),n="-"+this.consume(u0)):(L3.call(this,i-this.tokenStart+2,D3),this.next(),n=this.substrToCursor(i+1)))}else this.error();return null!==t&&t.charCodeAt(0)===A3&&(t=t.substr(1)),null!==n&&n.charCodeAt(0)===A3&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function U3(e){if(e.a){const t=("+1"===e.a||"1"===e.a?"n":"-1"===e.a&&"-n")||e.a+"n";if(e.b){const n="-"===e.b[0]||"+"===e.b[0]?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}function V3(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function H3(){for(let e,t=1;e=this.lookupType(t);t++){if(e===x0)return!0;if(e===O0||e===i0)return!1}return!1}const q3="Atrule",Q3="atrule",$3={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function G3(e=!1){const t=this.tokenStart;let n,r,o=null,i=null;switch(this.eat(i0),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),!1===this.eof&&this.tokenType!==O0&&this.tokenType!==v0&&(o=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),V3):V3.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case v0:this.next();break;case O0:i=hasOwnProperty.call(this.atrule,r)&&"function"==typeof this.atrule[r].block?this.atrule[r].block.call(this,e):this.Block(H3.call(this))}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:o,block:i}}function Y3(e){this.token(i0,"@"+e.name),null!==e.prelude&&this.node(e.prelude),e.block?this.node(e.block):this.token(v0,";")}const X3="AtrulePrelude",K3="atrulePrelude",Z3={children:[[]]};function J3(e){let t=null;return null!==e&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),!0!==this.eof&&this.tokenType!==O0&&this.tokenType!==v0&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function e5(e){this.children(e)}const t5=36,n5=42,r5=61,o5=94,i5=124,a5=126;function l5(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(n5)?(t=!0,this.next()):this.isDelim(i5)||this.eat(r0),this.isDelim(i5)?this.charCodeAt(this.tokenStart+1)!==r5?(this.next(),this.eat(r0)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function s5(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==r5&&t!==a5&&t!==o5&&t!==t5&&t!==n5&&t!==i5&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==r5&&(this.isDelim(r5)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const c5="AttributeSelector",u5={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function d5(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(b0),this.skipSC(),t=l5.call(this),this.skipSC(),this.tokenType!==w0&&(this.tokenType!==r0&&(n=s5.call(this),this.skipSC(),r=this.tokenType===l0?this.String():this.Identifier(),this.skipSC()),this.tokenType===r0&&(o=this.consume(r0),this.skipSC())),this.eat(w0),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:o}}function p5(e){this.token(c0,"["),this.node(e.name),null!==e.matcher&&(this.tokenize(e.matcher),this.node(e.value)),null!==e.flags&&this.token(r0,e.flags),this.token(c0,"]")}const h5=38;function f5(){return this.Raw(null,!0)}function m5(){return this.parseWithFallback(this.Rule,f5)}function g5(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function v5(){if(this.tokenType===v0)return g5.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,g5);return this.tokenType===v0&&this.next(),e}const y5="Block",b5="block",w5={children:[["Atrule","Rule","Declaration"]]};function k5(e){const t=e?v5:m5,n=this.tokenStart;let r=this.createList();this.eat(O0);e:for(;!this.eof;)switch(this.tokenType){case x0:break e;case h0:case S0:this.next();break;case i0:r.push(this.parseWithFallback(this.Atrule.bind(this,e),f5));break;default:e&&this.isDelim(h5)?r.push(m5.call(this)):r.push(t.call(this))}return this.eof||this.eat(x0),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function E5(e){this.token(O0,"{"),this.children(e,e=>{"Declaration"===e.type&&this.token(v0,";")}),this.token(x0,"}")}const O5="Brackets",x5={children:[[]]};function S5(e,t){const n=this.tokenStart;let r=null;return this.eat(b0),r=e.call(this,t),this.eof||this.eat(w0),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function _5(e){this.token(c0,"["),this.children(e),this.token(c0,"]")}const C5="CDC",P5=[];function T5(){const e=this.tokenStart;return this.eat(m0),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function A5(){this.token(m0,"--\x3e")}const M5="CDO",N5=[];function D5(){const e=this.tokenStart;return this.eat(f0),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function I5(){this.token(f0,"\x3c!--")}const L5=46,R5="ClassSelector",j5={name:String};function F5(){return this.eatDelim(L5),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(r0)}}function z5(e){this.token(c0,"."),this.token(r0,e.name)}const B5=43,W5=47,U5=62,V5=126,H5="Combinator",q5={name:String};function Q5(){const e=this.tokenStart;let t;switch(this.tokenType){case h0:t=" ";break;case c0:switch(this.charCodeAt(this.tokenStart)){case U5:case B5:case V5:this.next();break;case W5:this.next(),this.eatIdent("deep"),this.eatDelim(W5);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function $5(e){this.tokenize(e.name)}const G5=42,Y5=47,X5="Comment",K5={value:String};function Z5(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(S0),t-e+2>=2&&this.charCodeAt(t-2)===G5&&this.charCodeAt(t-1)===Y5&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function J5(e){this.token(S0,"/*"+e.value+"*/")}const e4=new Set([g0,E0,n0]),t4="Condition",n4={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function r4(e){return this.lookupTypeNonSC(1)===r0&&e4.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const o4={media:r4,container:r4,supports(){return this.SupportsDeclaration()}};function i4(e="media"){const t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case S0:case h0:this.next();continue;case r0:t.push(this.Identifier());break;case k0:{let n=this.parseWithFallback(()=>o4[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(k0);const t=this.Condition(e);return this.eat(E0),t},()=>this.GeneralEnclosed(e))),t.push(n);break}case o0:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function a4(e){e.children.forEach(e=>{"Condition"===e.type?(this.token(k0,"("),this.node(e),this.token(E0,")")):this.node(e)})}const l4=33,s4=35,c4=36,u4=38,d4=42,p4=43,h4=47;function f4(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function m4(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function g4(){const e=this.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.eof&&this.tokenType!==v0&&!1===this.isDelim(l4)&&!1===this.isBalanceEdge(e)&&this.error(),t}const v4="Declaration",y4="declaration",b4={important:[Boolean,String],property:String,value:["Value","Raw"]};function w4(){const e=this.tokenStart,t=this.tokenIndex,n=E4.call(this),r=G1(n),o=r?this.parseCustomProperty:this.parseValue,i=r?m4:f4;let a,l=!1;this.skipSC(),this.eat(g0);const s=this.tokenIndex;if(r||this.skipSC(),a=o?this.parseWithFallback(g4,i):i.call(this,this.tokenIndex),r&&"Value"===a.type&&a.children.isEmpty)for(let e=s-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===h0){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(l4)&&(l=O4.call(this),this.skipSC()),!1===this.eof&&this.tokenType!==v0&&!1===this.isBalanceEdge(t)&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:l,property:n,value:a}}function k4(e){this.token(r0,e.property),this.token(g0,":"),this.node(e.value),e.important&&(this.token(c0,"!"),this.token(r0,!0===e.important?"important":e.important))}function E4(){const e=this.tokenStart;if(this.tokenType===c0)switch(this.charCodeAt(this.tokenStart)){case d4:case c4:case p4:case s4:case u4:this.next();break;case h4:this.next(),this.isDelim(h4)&&this.next()}return this.tokenType===a0?this.eat(a0):this.eat(r0),this.substrToCursor(e)}function O4(){this.eat(c0),this.skipSC();const e=this.consume(r0);return"important"===e||e}const x4=38;function S4(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const _4="DeclarationList",C4={children:[["Declaration","Atrule","Rule"]]};function P4(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case h0:case S0:case v0:this.next();break;case i0:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),S4));break;default:this.isDelim(x4)?e.push(this.parseWithFallback(this.Rule,S4)):e.push(this.parseWithFallback(this.Declaration,S4))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function T4(e){this.children(e,e=>{"Declaration"===e.type&&this.token(v0,";")})}const A4="Dimension",M4={value:String,unit:String};function N4(){const e=this.tokenStart,t=this.consumeNumber(p0);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function D4(e){this.token(p0,e.value+e.unit)}const I4=47,L4="Feature",R4={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function j4(e){const t=this.tokenStart;let n,r=null;if(this.eat(k0),this.skipSC(),n=this.consume(r0),this.skipSC(),this.tokenType!==E0){switch(this.eat(g0),this.skipSC(),this.tokenType){case u0:r=this.lookupNonWSType(1)===c0?this.Ratio():this.Number();break;case p0:r=this.Dimension();break;case r0:r=this.Identifier();break;case o0:r=this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(I4)&&this.error(),e},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(E0),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:r}}function F4(e){this.token(k0,"("),this.token(r0,e.name),null!==e.value&&(this.token(g0,":"),this.node(e.value)),this.token(E0,")")}const z4="FeatureFunction",B4={kind:String,feature:String,value:["Declaration","Selector"]};function W4(e,t){const n=(this.features[e]||{})[t];return"function"!=typeof n&&this.error(`Unknown feature ${t}()`),n}function U4(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),r=W4.call(this,e,n.toLowerCase());this.skipSC();const o=this.parseWithFallback(()=>{const e=this.tokenIndex,t=r.call(this);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.Raw(null,!1));return this.eof||this.eat(E0),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:o}}function V4(e){this.token(o0,e.feature+"("),this.node(e.value),this.token(E0,")")}const H4=47,q4=60,Q4=61,$4=62,G4="FeatureRange",Y4={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function X4(){switch(this.skipSC(),this.tokenType){case u0:return this.isDelim(H4,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case p0:return this.Dimension();case r0:return this.Identifier();case o0:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(H4)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function K4(e){if(this.skipSC(),this.isDelim(q4)||this.isDelim($4)){const e=this.source[this.tokenStart];return this.next(),this.isDelim(Q4)?(this.next(),e+"="):e}if(this.isDelim(Q4))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function Z4(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(k0);const n=X4.call(this),r=K4.call(this,"Identifier"===n.type),o=X4.call(this);let i=null,a=null;return this.lookupNonWSType(0)!==E0&&(i=K4.call(this),a=X4.call(this)),this.skipSC(),this.eat(E0),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:o,rightComparison:i,right:a}}function J4(e){this.token(k0,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(E0,")")}const e6="Function",t6="function",n6={name:String,children:[[]]};function r6(e,t){const n=this.tokenStart,r=this.consumeFunctionName(),o=r.toLowerCase();let i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(E0),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}function o6(e){this.token(o0,e.name+"("),this.children(e),this.token(E0,")")}const i6="GeneralEnclosed",a6={kind:String,function:[String,null],children:[[]]};function l6(e){const t=this.tokenStart;let n=null;this.tokenType===o0?n=this.consumeFunctionName():this.eat(k0);const r=this.parseWithFallback(()=>{const e=this.tokenIndex,t=this.readSequence(this.scope.Value);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(E0),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:r}}function s6(e){e.function?this.token(o0,e.function+"("):this.token(k0,"("),this.children(e),this.token(E0,")")}const c6="XXX",u6="Hash",d6={value:String};function p6(){const e=this.tokenStart;return this.eat(a0),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function h6(e){this.token(a0,"#"+e.value)}const f6="Identifier",m6={name:String};function g6(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(r0)}}function v6(e){this.token(r0,e.name)}const y6="IdSelector",b6={name:String};function w6(){const e=this.tokenStart;return this.eat(a0),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function k6(e){this.token(c0,"#"+e.name)}const E6=46,O6="Layer",x6={name:String};function S6(){let e=this.tokenStart,t=this.consume(r0);for(;this.isDelim(E6);)this.eat(c0),t+="."+this.consume(r0);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function _6(e){this.tokenize(e.name)}const C6="LayerList",P6={children:[["Layer"]]};function T6(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===y0);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function A6(e){this.children(e,()=>this.token(y0,","))}const M6="MediaQuery",N6={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function D6(){const e=this.tokenStart;let t=null,n=null,r=null;if(this.skipSC(),this.tokenType===r0&&this.lookupTypeNonSC(1)!==k0){const e=this.consume(r0),o=e.toLowerCase();switch("not"===o||"only"===o?(this.skipSC(),t=o,n=this.consume(r0)):n=e,this.lookupTypeNonSC(0)){case r0:this.skipSC(),this.eatIdent("and"),r=this.Condition("media");break;case O0:case v0:case y0:case n0:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case r0:case k0:case o0:r=this.Condition("media");break;case O0:case v0:case n0:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:r}}function I6(e){e.mediaType?(e.modifier&&this.token(r0,e.modifier),this.token(r0,e.mediaType),e.condition&&(this.token(r0,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const L6="MediaQueryList",R6={children:[["MediaQuery"]]};function j6(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===y0);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function F6(e){this.children(e,()=>this.token(y0,","))}const z6=38,B6="NestingSelector",W6={};function U6(){const e=this.tokenStart;return this.eatDelim(z6),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function V6(){this.token(c0,"&")}const H6="Nth",q6={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function Q6(){this.skipSC();const e=this.tokenStart;let t,n=e,r=null;return t=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),n=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),n=this.tokenStart),{type:"Nth",loc:this.getLocation(e,n),nth:t,selector:r}}function $6(e){this.node(e.nth),null!==e.selector&&(this.token(r0,"of"),this.node(e.selector))}const G6="Number",Y6={value:String};function X6(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(u0)}}function K6(e){this.token(u0,e.value)}const Z6="Operator",J6={value:String};function e8(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function t8(e){this.tokenize(e.value)}const n8="Parentheses",r8={children:[[]]};function o8(e,t){const n=this.tokenStart;let r=null;return this.eat(k0),r=e.call(this,t),this.eof||this.eat(E0),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function i8(e){this.token(k0,"("),this.children(e),this.token(E0,")")}const a8="Percentage",l8={value:String};function s8(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(d0)}}function c8(e){this.token(d0,e.value+"%")}const u8="PseudoClassSelector",d8="function",p8={name:String,children:[["Raw"],null]};function h8(){const e=this.tokenStart;let t,n,r=null;return this.eat(g0),this.tokenType===o0?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==E0?r=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(E0)):t=this.consume(r0),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function f8(e){this.token(g0,":"),null===e.children?this.token(r0,e.name):(this.token(o0,e.name+"("),this.children(e),this.token(E0,")"))}const m8="PseudoElementSelector",g8="function",v8={name:String,children:[["Raw"],null]};function y8(){const e=this.tokenStart;let t,n,r=null;return this.eat(g0),this.eat(g0),this.tokenType===o0?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==E0?r=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(E0)):t=this.consume(r0),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function b8(e){this.token(g0,":"),this.token(g0,":"),null===e.children?this.token(r0,e.name):(this.token(o0,e.name+"("),this.children(e),this.token(E0,")"))}const w8=47;function k8(){switch(this.skipSC(),this.tokenType){case u0:return this.Number();case o0:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const E8="Ratio",O8={left:["Number","Function"],right:["Number","Function",null]};function x8(){const e=this.tokenStart,t=k8.call(this);let n=null;return this.skipSC(),this.isDelim(w8)&&(this.eatDelim(w8),n=k8.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function S8(e){this.node(e.left),this.token(c0,"/"),e.right?this.node(e.right):this.node(u0,1)}function _8(){return this.tokenIndex>0&&this.lookupType(-1)===h0?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const C8="Raw",P8={value:String};function T8(e,t){const n=this.getTokenStart(this.tokenIndex);let r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),r=t&&this.tokenStart>n?_8.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(n,r),value:this.substring(n,r)}}function A8(e){this.tokenize(e.value)}function M8(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function N8(){const e=this.SelectorList();return"Raw"!==e.type&&!1===this.eof&&this.tokenType!==O0&&this.error(),e}const D8="Rule",I8="rule",L8={prelude:["SelectorList","Raw"],block:["Block"]};function R8(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return n=this.parseRulePrelude?this.parseWithFallback(N8,M8):M8.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function j8(e){this.node(e.prelude),this.node(e.block)}const F8="Scope",z8={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function B8(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===k0&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(E0)),this.lookupNonWSType(0)===r0&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(k0),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(E0)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function W8(e){e.root&&(this.token(k0,"("),this.node(e.root),this.token(E0,")")),e.limit&&(this.token(r0,"to"),this.token(k0,"("),this.node(e.limit),this.token(E0,")"))}const U8="Selector",V8={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function H8(){const e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function q8(e){this.children(e)}const Q8="SelectorList",$8="selector",G8={children:[["Selector","Raw"]]};function Y8(){const e=this.createList();for(;!this.eof&&(e.push(this.Selector()),this.tokenType===y0);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function X8(e){this.children(e,()=>this.token(y0,","))}const K8=92,Z8=34,J8=39;function e7(e){const t=e.length,n=e.charCodeAt(0),r=n===Z8||n===J8?1:0,o=1===r&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let i="";for(let n=r;n<=o;n++){let r=e.charCodeAt(n);if(r===K8){if(n===o){n!==t-1&&(i=e.substr(n+1));break}if(r=e.charCodeAt(++n),L0(K8,r)){const t=n-1,r=G0(e,t);n=r-1,i+=Z0(e.substring(t+1,r))}else 13===r&&10===e.charCodeAt(n+1)&&n++}else i+=e[n]}return i}const t7="String",n7={value:String};function r7(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:e7(this.consume(l0))}}function o7(e){this.token(l0,function(e){const t=Z8;let n="",r=!1;for(let o=0;o<e.length;o++){const i=e.charCodeAt(o);0!==i?i<=31||127===i?(n+="\\"+i.toString(16),r=!0):i===t||i===K8?(n+="\\"+e.charAt(o),r=!1):(r&&(P0(i)||I0(i))&&(n+=" "),n+=e.charAt(o),r=!1):n+="�"}return'"'+n+'"'}(e.value))}const i7=33;function a7(){return this.Raw(null,!1)}const l7="StyleSheet",s7="stylesheet",c7={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function u7(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case h0:this.next();continue;case S0:if(this.charCodeAt(this.tokenStart+2)!==i7){this.next();continue}n=this.Comment();break;case f0:n=this.CDO();break;case m0:n=this.CDC();break;case i0:n=this.parseWithFallback(this.Atrule,a7);break;default:n=this.parseWithFallback(this.Rule,a7)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function d7(e){this.children(e)}const p7="SupportsDeclaration",h7={declaration:"Declaration"};function f7(){const e=this.tokenStart;this.eat(k0),this.skipSC();const t=this.Declaration();return this.eof||this.eat(E0),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function m7(e){this.token(k0,"("),this.node(e.declaration),this.token(E0,")")}const g7=42,v7=124;function y7(){this.tokenType!==r0&&!1===this.isDelim(g7)&&this.error("Identifier or asterisk is expected"),this.next()}const b7="TypeSelector",w7={name:String};function k7(){const e=this.tokenStart;return this.isDelim(v7)?(this.next(),y7.call(this)):(y7.call(this),this.isDelim(v7)&&(this.next(),y7.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function E7(e){this.tokenize(e.name)}const O7=43,x7=45,S7=63;function _7(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===x7&&t&&0!==n)return _7.call(this,e+n+1,!1),-1;P0(o)||this.error(t&&0!==n?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",r),++n>6&&this.error("Too many hex digits",r)}return this.next(),n}function C7(e){let t=0;for(;this.isDelim(S7);)++t>e&&this.error("Too many question marks"),this.next()}function P7(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===O7?"Plus sign":"Hyphen minus")+" is expected")}function T7(){let e=0;switch(this.tokenType){case u0:if(e=_7.call(this,1,!0),this.isDelim(S7)){C7.call(this,6-e);break}if(this.tokenType===p0||this.tokenType===u0){P7.call(this,x7),_7.call(this,1,!1);break}break;case p0:e=_7.call(this,1,!0),e>0&&C7.call(this,6-e);break;default:if(this.eatDelim(O7),this.tokenType===r0){e=_7.call(this,0,!0),e>0&&C7.call(this,6-e);break}if(this.isDelim(S7)){this.next(),C7.call(this,5);break}this.error("Hex digit or question mark is expected")}}const A7="UnicodeRange",M7={value:String};function N7(){const e=this.tokenStart;return this.eatIdent("u"),T7.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function D7(e){this.tokenize(e.value)}const I7=32,L7=92,R7=34,j7=39,F7=40,z7=41,B7="Url",W7={value:String};function U7(){const e=this.tokenStart;let t;switch(this.tokenType){case s0:t=function(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===z7?t-2:t-1,o="";for(;n<r&&I0(e.charCodeAt(n));)n++;for(;n<r&&I0(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let n=e.charCodeAt(i);if(n===L7){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(n=e.charCodeAt(++i),L0(L7,n)){const t=i-1,n=G0(e,t);i=n-1,o+=Z0(e.substring(t+1,n))}else 13===n&&10===e.charCodeAt(i+1)&&i++}else o+=e[i]}return o}(this.consume(s0));break;case o0:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(o0),this.skipSC(),t=e7(this.consume(l0)),this.skipSC(),this.eof||this.eat(E0);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function V7(e){this.token(s0,function(e){let t="",n=!1;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);0!==o?o<=31||127===o?(t+="\\"+o.toString(16),n=!0):o===I7||o===L7||o===R7||o===j7||o===F7||o===z7?(t+="\\"+e.charAt(r),n=!1):(n&&P0(o)&&(t+=" "),t+=e.charAt(r),n=!1):t+="�"}return"url("+t+")"}(e.value))}const H7="Value",q7={children:[[]]};function Q7(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function $7(e){this.children(e)}const G7=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Y7="WhiteSpace",X7={value:String};function K7(){return this.eat(h0),G7}function Z7(e){this.token(h0,e.value)}const J7={generic:!0,cssWideKeywords:X1,generic:!0,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|x|y","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hwb()":"hwb( [<hue>|none] [<percentage>|none] [<percentage>|none] [/ [<alpha-value>|none]]? )","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>|<timeline-range-name> <percentage>","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","light-dark()":"light-dark( <color> , <color> )","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [[<angle>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list> )","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","name-repeat":"repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( [<length [0,∞]>|none] )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )","polar-color-space":"hsl|hwb|lch|oklch",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pow()":"pow( <calc-sum> , <calc-sum> )","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>|<legacy-pseudo-element-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )",ratio:"<number [0,∞]> [/ <number [0,∞]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rectangular-color-space":"srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( <number-percentage> )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )","scroll()":"scroll( [<axis>||<scroller>]? )",scroller:"root|nearest|self","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","sign()":"sign( <calc-sum> )","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( <calc-sum> )","single-animation":"<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<dashed-ident>|<scroll()>|<view()>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","easing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","transition-behavior-value":"normal|allow-discrete","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","view()":"view( [<axis>||<'view-timeline-inset'>]? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-size":"intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","absolute-color-base":"<hex-color>|<absolute-color-function>|<named-color>|transparent","absolute-color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>",age:"child|young|old","anchor-name":"<dashed-ident>","attr-name":"<wq-name>","attr-fallback":"<any-value>","bg-clip":"<box>|border|text",bottom:"<length>|auto","container-name":"<custom-ident>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont",left:"<length>|auto","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>","device-cmyk()":"<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>","legacy-device-cmyk-syntax":"device-cmyk( <number>#{4} )","modern-device-cmyk-syntax":"device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )","cmyk-component":"<number>|<percentage>|none","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>","custom-color-space":"<dashed-ident>",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","palette-identifier":"<dashed-ident>",right:"<length>|auto","scope-start":"<forgiving-selector-list>","scope-end":"<forgiving-selector-list>","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-selector-list>","selector-list":"<complex-selector-list>","complex-real-selector-list":"<complex-real-selector>#","simple-selector-list":"<simple-selector>#","relative-real-selector-list":"<relative-real-selector>#","complex-selector-unit":"[<compound-selector>? <pseudo-compound-selector>*]!","complex-real-selector":"<compound-selector> [<combinator>? <compound-selector>]*","relative-real-selector":"<combinator>? <complex-real-selector>","pseudo-compound-selector":"<pseudo-element-selector> <pseudo-class-selector>*","simple-selector":"<type-selector>|<subclass-selector>","legacy-pseudo-element-selector":"':' [before|after|first-line|first-letter]","single-animation-composition":"replace|add|accumulate","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,∞]>","color()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","predefined-rgb":"srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","xyz-space":"xyz|xyz-d50|xyz-d65","oklab()":"oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","oklch()":"oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","offset-path":"<ray()>|<url>|<basic-shape>","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [round <'border-radius'>]? )","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","style-feature":"<declaration>","style-query":"<style-condition>|<style-feature>","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box","inset-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","position-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","anchor()":"anchor( <anchor-element>?&&<anchor-side> , <length-percentage>? )","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size()":"anchor-size( [<anchor-element>||<anchor-size>]? , <length-percentage>? )","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-element":"<dashed-ident>","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","font-variant-css2":"normal|small-caps","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert|revert-layer","anchor-name":"none|<dashed-ident>#","anchor-scope":"none|all|<dashed-ident>#",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-range":"[<'animation-range-start'> <'animation-range-end'>?]#","animation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-timing-function":"<easing-function>#","animation-timeline":"<single-animation-timeline>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto||<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end",caret:"<'caret-color'>||<'caret-shape'>","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none","clip-rule":"nonzero|evenodd",color:"<color>","color-interpolation-filters":"auto|sRGB|linearRGB","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-width":"auto? [none|<length>]",container:"<'container-name'> [/ <'container-type'>]?","container-name":"none|<custom-ident>+","container-type":"normal||[size|inline-size]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>]+]?","content-visibility":"visible|auto|hidden","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",d:"none|path( <string> )",cx:"<length>|<percentage>",cy:"<length>|<percentage>",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-palette":"normal|light|dark|<palette-identifier>","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps||position]","font-synthesis-position":"auto|none","font-synthesis-small-caps":"auto|none","font-synthesis-style":"auto|none","font-synthesis-weight":"auto|none","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-emoji":"normal|text|emoji|unicode","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter","forced-color-adjust":"auto|none|preserve-parent-color",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","hyphenate-character":"auto|<string>","hyphenate-limit-chars":"[auto|<integer>]{1,3}",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>","input-security":"auto|none",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>","interpolate-size":"numeric-only|allow-keywords",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|<offset-path>||<coord-box>","offset-position":"normal|auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-width'>||<'outline-style'>||<'outline-color'>]","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,∞]>","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto",overlay:"none|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>",page:"auto|<custom-ident>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky","position-anchor":"auto|<anchor-name>","position-area":"none|<position-area>","position-try":"<'position-try-order'>? <'position-try-fallbacks'>","position-try-fallbacks":"none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#","position-try-order":"normal|<try-size>","position-visibility":"always|[anchors-valid||anchors-visible||no-overflow]","print-color-adjust":"economy|exact",quotes:"none|auto|[<string> <string>]+",r:"<length>|<percentage>",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length>|<percentage>",ry:"<length>|<percentage>",scale:"none|[<number>|<percentage>]{1,3}","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-timeline":"[<'scroll-timeline-name'>||<'scroll-timeline-axis'>]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<'opacity'>","stroke-width":"<svg-length>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-anchor":"start|middle|end","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"auto|[over|under]&&[right|left]?","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-spacing-trim":"space-all|normal|space-first|trim-start|trim-both|trim-all|auto","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]","text-wrap":"<'text-wrap-mode'>||<'text-wrap-style'>","text-wrap-mode":"auto|wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-behavior":"<transition-behavior-value>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vector-effect":"none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>","view-timeline":"[<'view-timeline-name'> <'view-timeline-axis'>?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"none|<dashed-ident>#","view-transition-name":"none|<custom-ident>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces|[<'white-space-collapse'>||<'text-wrap'>||<'white-space-trim'>]","white-space-collapse":"collapse|discard|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word|auto-phrase","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",x:"<length>|<percentage>",y:"<length>|<percentage>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|never|always","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]","white-space-trim":"none|discard-before||discard-after||discard-inner"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,∞]>","font-family":"<family-name>#","override-colors":"[<integer [0,∞]> <absolute-color-base>]#"}},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]","page-orientation":"upright|rotate-left|rotate-right",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},"position-try":{prelude:"<dashed-ident>",descriptors:{top:"<'top'>",left:"<'left'>",bottom:"<'bottom'>",right:"<'right'>","inset-block-start":"<'inset-block-start'>","inset-block-end":"<'inset-block-end'>","inset-inline-start":"<'inset-inline-start'>","inset-inline-end":"<'inset-inline-end'>","inset-block":"<'inset-block'>","inset-inline":"<'inset-inline'>",inset:"<'inset'>","margin-top":"<'margin-top'>","margin-left":"<'margin-left'>","margin-bottom":"<'margin-bottom'>","margin-right":"<'margin-right'>","margin-block-start":"<'margin-block-start'>","margin-block-end":"<'margin-block-end'>","margin-inline-start":"<'margin-inline-start'>","margin-inline-end":"<'margin-inline-end'>",margin:"<'margin'>","margin-block":"<'margin-block'>","margin-inline":"<'margin-inline'>",width:"<'width'>",height:"<'height'>","min-width":"<'min-width'>","min-height":"<'min-height'>","max-width":"<'max-width'>","max-height":"<'max-height'>","block-size":"<'block-size'>","inline-size":"<'inline-size'>","min-block-size":"<'min-block-size'>","min-inline-size":"<'min-inline-size'>","max-block-size":"<'max-block-size'>","max-inline-size":"<'max-inline-size'>","align-self":"<'align-self'>|anchor-center","justify-self":"<'justify-self'>|anchor-center"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<declaration-value>?"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},nest:{prelude:"<complex-selector-list>",descriptors:null}},node:J};function e9(e){switch(this.tokenType){case a0:return this.Hash();case y0:return this.Operator();case k0:return this.Parentheses(this.readSequence,e.recognizer);case b0:return this.Brackets(this.readSequence,e.recognizer);case l0:return this.String();case p0:return this.Dimension();case d0:return this.Percentage();case u0:return this.Number();case o0:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case s0:return this.Url();case r0:return this.cmpChar(this.tokenStart,117)&&this.cmpChar(this.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case c0:{const e=this.charCodeAt(this.tokenStart);if(47===e||42===e||43===e||45===e)return this.Operator();35===e&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const t9={getNode:e9},n9={onWhiteSpace:function(e,t){null!==t.last&&"Combinator"!==t.last.type&&null!==e&&"Combinator"!==e.type&&t.push({type:"Combinator",loc:null,name:" "})},getNode:function(){switch(this.tokenType){case b0:return this.AttributeSelector();case a0:return this.IdSelector();case g0:return this.lookupType(1)===g0?this.PseudoElementSelector():this.PseudoClassSelector();case r0:return this.TypeSelector();case u0:case d0:return this.Percentage();case p0:46===this.charCodeAt(this.tokenStart)&&this.error("Identifier is expected",this.tokenStart+1);break;case c0:switch(this.charCodeAt(this.tokenStart)){case 43:case 62:case 126:case 47:return this.Combinator();case 46:return this.ClassSelector();case 42:case 124:return this.TypeSelector();case 35:return this.IdSelector();case 38:return this.NestingSelector()}}}};function r9(e){return null!==e&&"Operator"===e.type&&("-"===e.value[e.value.length-1]||"+"===e.value[e.value.length-1])}const o9={getNode:e9,onWhiteSpace(e,t){r9(e)&&(e.value=" "+e.value),r9(t.last)&&(t.last.value+=" ")},expression:function(){return this.createSingleNodeList(this.Raw(null,!1))},var:function(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===y0){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if("Value"===n.type&&n.children.isEmpty)for(let e=t-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===h0){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}e.push(n)}return e}},i9=new Set(["none","and","not","or"]),a9={parse:{prelude(){const e=this.createList();if(this.tokenType===r0){const t=this.substring(this.tokenStart,this.tokenEnd);i9.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},l9={parse:{prelude:null,block(){return this.Block(!0)}}};function s9(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==E0&&this.error()}},t||(()=>this.Raw(null,!0)))}const c9={layer(){this.skipSC();const e=this.createList(),t=s9.call(this,this.Layer);return"Raw"===t.type&&""===t.value||e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=s9.call(this,this.Declaration,()=>s9.call(this,()=>this.Condition("supports")));return"Raw"===t.type&&""===t.value||e.push(t),e}},u9={container:a9,"font-face":l9,import:{parse:{prelude(){const e=this.createList();switch(this.tokenType){case l0:e.push(this.String());break;case s0:case o0:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===r0&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===o0&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,c9)),this.skipSC(),this.tokenType===o0&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,c9)),this.lookupNonWSType(0)!==r0&&this.lookupNonWSType(0)!==k0||e.push(this.MediaQueryList()),e},block:null}},layer:{parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},media:{parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},nest:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},page:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},scope:{parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},"starting-style":{parse:{prelude:null,block(e=!1){return this.Block(e)}}},supports:{parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}},d9={parse(){return this.createSingleNodeList(this.SelectorList())}},p9={parse(){return this.createSingleNodeList(this.Selector())}},h9={parse(){return this.createSingleNodeList(this.Identifier())}},f9={parse:function(){const e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case r0:e.push(this.Identifier());break;case l0:e.push(this.String());break;case y0:e.push(this.Operator());break;case E0:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}},m9={parse(){return this.createSingleNodeList(this.Nth())}},g9={dir:h9,has:d9,lang:f9,matches:d9,is:d9,"-moz-any":d9,"-webkit-any":d9,where:d9,not:d9,"nth-child":m9,"nth-last-child":m9,"nth-last-of-type":m9,"nth-of-type":m9,slotted:p9,host:p9,"host-context":p9},v9={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:ee,atrule:u9,pseudo:g9,node:te},y9=(e=>T3(P3({},e)))({...J7,...v9,node:J}),{tokenize:b9,parse:w9,generate:k9,lexer:E9,createLexer:O9,walk:x9,find:S9,findLast:_9,findAll:C9,toPlainObject:P9,fromPlainObject:T9,fork:A9}=y9;function M9(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 N9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M9(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const D9=gn(function(e,t){var n,r,o,i,a,l,s=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor",c=null!==(r=null===(o=e.settingsPage)||void 0===o?void 0:o[s])&&void 0!==r?r:{},u=null!==(i=null!==(a=e.settingsPage.customCSS)&&void 0!==a?a:null===(l=e.settingsPage)||void 0===l||null===(l=l.settings)||void 0===l?void 0:l.customCSS)&&void 0!==i?i:"";return N9(N9({},t),{},{platform:s,settings:c,code:u})},function(e){return{setCode:function(t){return e(function(e){return{type:wi.SET_CUSTOM_CSS,customCSS:e}}(t))}}})(function(e){var t=e.code,n=e.setCode,r=(0,oe.useCallback)(function(e,t){n(e)},[]);return React.createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-custom-css"},React.createElement(t0,{value:t,height:"300px",theme:"light",onChange:r,extensions:[new B$(pY,pY.data.of({autocomplete:dY})),ZY(),NY(function(e){var t=[],n=e.state.doc.toString();try{w9(n,{positions:!0,onParseError:function(n){var r=n.line,o=n.column,i=e.state.doc.line(r);t.push({from:i.from+o-1,to:i.from+o,severity:"error",message:n.formattedMessage||n.message})}})}catch(e){console.error("CSSTree parse failed:",e)}return t})]}))});var I9=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];function L9(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 R9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L9(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var j9=function(e,t){var n=e.id,r=e.onChange,o=void 0===r?null:r,i=e.onBlur,a=void 0===i?null:i,l=e.name,s=e.placeholder,c=void 0===s?null:s,u=e.type,d=void 0===u?"text":u,p=(e.withP,e.label),h=e.icon,f=e.typeChange,m=void 0===f?void 0:f,g=e.error,v=Wn(e,I9),y=pe((0,oe.useState)(d),2),b=y[0],w=y[1],k=null!=n?n:l,E={type:b,name:l,id:k};return(0,oe.useEffect)(function(){m&&w(d)},[]),null!=c&&(E=R9(R9({},E),{},{placeholder:c})),null!=a&&(E=R9(R9({},E),{},{onBlur:a})),null!=o&&(E=R9(R9({},E),{},{onChange:o})),ae().createElement("div",{className:"templately-setting-input templately-setting-input-".concat(null!=d?d:"text")},p&&"checkbox"!==d&&"radio"!==d?ae().createElement("label",{htmlFor:k,className:"templately-setting-input-label"},p):"",ae().createElement("div",{className:"".concat(m?"has-change-button":""," ").concat(h?"has-icon":""," ").concat(null!=g&&g.hasError?"has-error":"")},null!=h?h:"",ae().createElement("input",re({ref:t},E,v)),m?ae().createElement("button",{onClick:function(){w(b===d?null==m?void 0:m.type:d)}},b===d?null==m?void 0:m.primaryText:null==m?void 0:m.secondaryText):""),!p||"checkbox"!==d&&"radio"!==d?"":ae().createElement("label",{htmlFor:k,className:"templately-setting-input-label"},p),(null==g?void 0:g.hasError)&&ae().createElement("div",{className:"templately-setting-error-message"},ae().createElement(zn,null),null==g?void 0:g.errorMessage))};const F9=ae().forwardRef(j9);function z9(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 B9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z9(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const W9=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d,p,h,f,m,g,v,y,b,w=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor",k=null!==(r=null===(o=e.settingsPage)||void 0===o?void 0:o[w])&&void 0!==r?r:{},E=(null===(i=e.settingsPage.settings)||void 0===i?void 0:i[w],null!==(a=null!==(l=null===(s=e.settingsPage)||void 0===s?void 0:s.siteTitle)&&void 0!==l?l:null===(c=e.settingsPage)||void 0===c||null===(c=c.settings)||void 0===c?void 0:c.siteTitle)&&void 0!==a?a:""),O=null!==(u=null!==(d=null===(p=e.settingsPage)||void 0===p?void 0:p.siteTagline)&&void 0!==d?d:null===(h=e.settingsPage)||void 0===h||null===(h=h.settings)||void 0===h?void 0:h.siteTagline)&&void 0!==u?u:"",x=null!==(f=null!==(m=null===(g=e.settingsPage)||void 0===g?void 0:g.logoImage)&&void 0!==m?m:null===(v=e.settingsPage)||void 0===v||null===(v=v.settings)||void 0===v?void 0:v.site_logo)&&void 0!==f?f:null;return x||(x={url:"",id:"",size:211}),x.size||(x.size=211),B9(B9({},t),{},{platform:w,settings:k,siteTitle:E,siteTagline:O,logoImage:x,templatelySettings:null!==(y=null===(b=e.settingsPage)||void 0===b?void 0:b.settings)&&void 0!==y?y:{}})},function(e){return{setSiteTitle:function(t){return e(function(e){return{type:wi.SET_SITE_TITLE,siteTitle:e}}(t))},setSiteTagline:function(t){return e(function(e){return{type:wi.SET_SITE_TAGLINE,siteTagline:e}}(t))},setLogoImage:function(t){return e(function(e){return{type:wi.SET_LOGO_IMAGE,logoImage:e}}(t))}}})(function(e){e.platform;var t=e.siteTitle,n=e.setSiteTitle,r=e.siteTagline,o=e.setSiteTagline,i=e.logoImage,a=e.setLogoImage,l=(e.templatelySettings,function(e){e.preventDefault(),e.stopPropagation(),a({url:"",id:"",size:i.size})});return React.createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-general"},React.createElement(F9,{type:"text",label:(0,At.__)("Site Title","templately"),value:t,onChange:function(e){return n(e.target.value)}}),React.createElement(F9,{type:"text",label:(0,At.__)("Site Tagline","templately"),value:r,onChange:function(e){return o(e.target.value)}}),React.createElement("div",{className:"templately-setting-file-uploader-wrapper"},React.createElement("h4",{className:"templately-title"},"Upload a logo"),React.createElement("p",{className:"templately-info"},"Upload a logo for your site. You can upload/update it anytime later."),React.createElement(VM.MediaUpload,{onSelect:function(e){var t,n;a(B9(B9({},i),{},{url:null!==(t=null==e?void 0:e.url)&&void 0!==t?t:"",id:null!==(n=null==e?void 0:e.id)&&void 0!==n?n:""}))},allowedTypes:["image"],value:i.url,render:function(e){var t=e.open;return React.createElement("button",{onClick:t,className:"templately-setting-file-uploader"},React.createElement("span",{className:"icon"},i.url&&React.createElement(React.Fragment,null,React.createElement("span",{className:"templately-setting-file-remove-button",onClick:l},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 -0.5 21 21"},React.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},React.createElement("g",{fill:"#fff",transform:"translate(-179 -360)"},React.createElement("g",{transform:"translate(56 160)"},React.createElement("path",{d:"M130.35 216h2.1v-8h-2.1v8zm4.2 0h2.1v-8h-2.1v8zm-6.3 2h10.5v-12h-10.5v12zm2.1-14h6.3v-2h-6.3v2zm8.4 0v-4h-10.5v4H123v2h3.15v14h14.7v-14H144v-2h-5.25z"})))))),React.createElement("img",{src:i.url,alt:""})),!i.url&&React.createElement(iI,null)),React.createElement("span",{className:"content"},React.createElement("span",{className:"title"},React.createElement("span",{className:"highlighted"},"Click to upload")," logo"),React.createElement("span",{className:"info"},"SVG, PNG, JPG or GIF (max. 800x400 px)")))}})))}),U9=function(e){return ae().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},ae().createElement("path",{fillRule:"evenodd",d:"M12 22c-4.714 0-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12s0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22zM8.97 8.97a.75.75 0 011.06 0L12 10.94l1.97-1.97a.75.75 0 011.06 1.06L13.06 12l1.97 1.97a.75.75 0 11-1.06 1.06L12 13.06l-1.97 1.97a.75.75 0 11-1.06-1.06L10.94 12l-1.97-1.97a.75.75 0 010-1.06z",clipRule:"evenodd"}))},V9=function(){var e=pe((0,oe.useState)(!1),2),t=e[0],n=e[1],r=function(){Tl.close()};return ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-display-condition-modal-header"},ae().createElement("div",{className:"templately-logo"}),ae().createElement("button",{className:"close-button",onClick:r},ae().createElement(U9,null))),ae().createElement("div",{className:"templately-display-condition-modal-body"},!t&&ae().createElement("div",{className:"normal"},ae().createElement("h2",null,(0,At.__)("Are you sure you want to revert to your old website?","templately")),ae().createElement("div",{className:"warning-text"},(0,At.__)("Warning: This will remove your existing settings and content with the previous one.","templately"))),ae().createElement("div",{className:"reverting",style:{display:t?"":"none"}},ae().createElement(_l,null),ae().createElement("div",null,ae().createElement("p",null,(0,At.__)("Restoring previous version of your website. This usually takes a few moments. Please wait…","templately"))))),ae().createElement("div",{className:"templately-display-condition-modal-footer"},ae().createElement(vl,{className:"confirm-revert",disabled:t,onClick:function(e){var t;n(!0);var r=null===(t=e.target.closest(".templately-sweetalert"))||void 0===t?void 0:t.querySelector(".swal2-icon");r&&(r.style.display="none");var o=(0,Ci.addQueryArgs)(ajaxurl,{action:"templately_pack_import_revert",nonce:window.templately.nonce});ba(o,{}).then(function(e){var t=e.response,r=e.error;n(!1),r?Tl.close({success:!1,error:r}):(Tl.close(t),null!=t&&t.success)})},label:t?(0,At.__)("Processing...","templately"):(0,At.__)("Yes, Revert","templately")}),ae().createElement(vl,{disabled:t,onClick:r,label:(0,At.__)("Cancel","templately")})))};function H9(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 q9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H9(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Q9=gn(function(e,t){var n,r,o=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return q9(q9({},t),{},{platform:o,hasRevert:null!==(r=e.settingsPage.settings.has_revert)&&void 0!==r&&r})},function(e){return{}})(function(e){var t=e.hasRevert,n=(0,oe.useMemo)(function(){return{key:"success",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong while creating workspace for you. Try Later or Contact support.","templately"),args:{timer:null,showCloseButton:!0,showCancelButton:!0,cancelButtonText:"Close"}},success:{title:(0,At.__)("Successfully Reverted","templately"),content:(0,At.__)("Old website has been successfully restored.","templately"),args:{timer:null,showCloseButton:!0,showConfirmButton:!0,confirmButtonText:"Visit Site"}}}},[]);return ae().createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-miscellaneous"},ae().createElement("div",{className:"templately-setting-miscellaneous-panel"},ae().createElement("h3",{className:"templately-title"},"Revert to previous website"),ae().createElement("p",{className:"templately-sub-title"},"Here you can revert back to your old website. We will restore previous settings, posts, pages, menus, etc."),ae().createElement("button",{onClick:function(e){e.preventDefault(),Al({icon:"warning",onConfirm:function(e){var t;if(null!=e&&null!==(t=e.data)&&void 0!==t&&t.site_url){var r=e.data.site_url;n.success.args.confirmButtonText='<a href="'.concat(r,'" target="_blank">Visit Site</a>'),n.success.args.didDestroy=function(t){e.success&&e.data.redirect&&setTimeout(function(){window.location.reload()},500)}}Ml(n,e)},html:ae().createElement(V9,null),didDestroy:function(){}},!0).then(function(e){e.success})},className:"templately-button",disabled:!t,title:t?"templately":"Nothing to revert"},ae().createElement("span",null,"Revert Now"))))}),$9=function(e){var t,n=e.title,r=e.children,o=e.current,i=e.setCurrent,a=e.id,l=pe((0,oe.useState)(null!==(t=e.initialCollapsed)&&void 0!==t&&t),2),s=l[0],c=l[1];return(0,oe.useEffect)(function(){null!=o&&null!=a&&c(o!=a)},[o]),ae().createElement("div",{className:"templately-setting-new-collapser"},ae().createElement("div",{className:"templately-setting-new-collapser-header ".concat(s?"collapsed":"show"),onClick:function(){null!=o&&null!=a?i(s?a:-1):c(!s)}},ae().createElement("h4",{className:"templately-setting-title"},n),ae().createElement("div",{className:"templately-setting-icon"},ae().createElement(Cn,null))),ae().createElement("div",{className:"templately-setting-new-collapser-body ".concat(s?"collapsed":"show")},ae().createElement("div",{className:"templately-setting-new-collapser-body-inner"},r)))};function G9(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 Y9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G9(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var X9=["Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"],K9=function(e,t){if(e&&"Default"!==e&&!X9.includes(e)){var n={ru_RU:"cyrillic",uk:"cyrillic",bg_BG:"cyrillic",vi:"vietnamese",el:"greek",he_IL:"hebrew"},r="https://fonts.googleapis.com/css?family="+e+":100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic";n[t]&&(r+="&subset="+n[t]);var o='link[href="'+r+'"]',i=document.createElement("link");if(i.href=r,i.rel="stylesheet",i.type="text/css",i.crossOrigin="anonymous",!document.querySelector(o)){var a=document.querySelectorAll("link"),l=a[a.length-1];l?l.after(i):document.body.appendChild(i)}}},Z9=["options","children","maxHeight","getValue","loadedFonts"];function J9(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 eee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J9(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var tee=ae().createContext({}),nee=function(e){var t=e.children,n=e.index,r=(e.style,e.isScrolling),o=ae().useContext(tee),i=o.setSize,a=o.windowWidth,l=o.loadedFonts,s=o.options,c=ae().useRef(),u=s[n];return(0,oe.useEffect)(function(){r||!u.value||l.current.includes(u.value)||(K9(u.value,window.templately.locale),l.current=[].concat(Ul(l.current),[u.value]))},[]),(0,oe.useEffect)(function(){i(n,c.current.getBoundingClientRect().height)},[a]),ae().createElement("div",{ref:c},t)};function ree(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 oee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ree(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ree(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const iee=function(e){var t,n,r=e.label,o=e.title,i=void 0===o?"":o,a=e.screen,l=e.setScreen,s=e.field,c=e.typography,u=e.setTypography,d=null!==(t=c[s][a].value)&&void 0!==t?t:"",p=null!==(n=c[s][a].unit)&&void 0!==n?n:"px",h=function(e,t){var n=t[e]||{};return Y9(Y9({},{px:{min:0,max:100,step:1},em:{min:.1,max:10,step:.1},rem:{min:.1,max:10,step:.1},vh:{min:0,max:100,step:1},vw:{min:0,max:100,step:1}}[e]),n)}(p,{selectedSize:{px:{min:1,max:200},em:{max:20},rem:{max:20},vw:{min:.1,max:10,step:.1}},selectedLetterSpacing:{px:{min:-5,max:10,step:.1},em:{min:0,max:1,step:.01},rem:{min:0,max:1,step:.01}},selectedLineHeight:{px:{min:1}}}[s]),f=h.min,m=h.max,g=h.step,v=Math.max(f,Math.min(m,d)),y=function(e){u("".concat(s,".").concat(a,".value"),e),c[s][a].unit||u("".concat(s,".").concat(a,".unit"),p)},b=function(e){l(e)};return(0,oe.useEffect)(function(){c[s][a].unit||u("".concat(s,".").concat(a,".unit"),"px")},[]),ae().createElement("div",{className:"templately-setting-typography-picker-field"},ae().createElement("label",{className:"templately-setting-typography-picker-field-label"},ae().createElement("span",{title:i},r),ae().createElement("div",{className:"templately-setting-device-dropdown"},ae().createElement("button",{className:"templately-setting-device-dropdown-selected"},"desktop"===a?ae().createElement("span",{className:"dashicons dashicons-desktop"}):"tablet"===a?ae().createElement("span",{className:"dashicons dashicons-tablet"}):ae().createElement("span",{className:"dashicons dashicons-smartphone"})),ae().createElement("ul",{className:"templately-setting-device-dropdown-menu"},ae().createElement("li",{className:"templately-setting-device-dropdown-menu-item ".concat("desktop"===a?"active":""),onClick:function(){return b("desktop")}},ae().createElement("span",{className:"dashicons dashicons-desktop"})),ae().createElement("li",{className:"templately-setting-device-dropdown-menu-item ".concat("tablet"===a?"active":""),onClick:function(){return b("tablet")}},ae().createElement("span",{className:"dashicons dashicons-tablet"})),ae().createElement("li",{className:"templately-setting-device-dropdown-menu-item ".concat("mobile"===a?"active":""),onClick:function(){return b("mobile")}},ae().createElement("span",{className:"dashicons dashicons-smartphone"}))))),ae().createElement("div",{className:"templately-setting-typography-picker-field-inner"},ae().createElement(nI.TextControl,{min:f,max:m,step:g,value:d,onChange:y,type:"number",label:"Text Control",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),ae().createElement(nI.SelectControl,{value:p||defaultUnit,onChange:function(e){u("".concat(s,".").concat(a),{unit:e,value:null})},options:[{label:"PX",value:"px"},{label:"EM",value:"em"},{label:"REM",value:"rem"},{label:"VW",value:"vw"},{label:"VH",value:"vh"}],label:"Select Option",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),ae().createElement(sI.Range,{values:[v],step:g,min:f,max:m,onChange:function(e){return y(e[0])},renderTrack:function(e){var t=e.props,n=e.children;return ae().createElement("div",{onMouseDown:t.onMouseDown,onTouchStart:t.onTouchStart,style:oee(oee({},t.style),{},{height:"12px",display:"flex",width:"100%"})},ae().createElement("div",{ref:t.ref,style:{height:"2px",width:"100%",borderRadius:"2px",background:(0,sI.getTrackBackground)({values:[v],colors:["#798294","#798294"],min:f,max:m}),alignSelf:"center"}},n))},renderThumb:function(e){var t=e.props,n=e.isDragged;return ae().createElement("div",re({},t,{key:t.key,style:oee(oee({},t.style),{},{height:"12px",width:"12px",borderRadius:"12px",backgroundColor:"#D0D5DD",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0px 2px 6px rgba(16, 24, 40, 0.059)"})}),ae().createElement("div",{style:{height:"12px",width:"12px",borderRadius:"12px",backgroundColor:n?"#548BF4":"#D0D5DD"}}))}})))};function aee(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 lee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aee(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const see=function(e){e.normalizedTypography;var t=e.setShowPicker,n=e.typography,r=e.setTypography,o=e.fontList,i=e.reset,a=e.screen,l=e.setScreen,s=e.closeRef,c=[{label:"Default",value:""},{label:"Uppercase",value:"uppercase"},{label:"Lowercase",value:"lowercase"},{label:"Capitalize",value:"capitalize"},{label:"Normal",value:"none"}],u=[{label:"Default",value:""},{label:"Overline",value:"overline"},{label:"Line Through",value:"line-through"},{label:"Underline",value:"underline"},{label:"Underline Overline",value:"underline overline"},{label:"Initial",value:"initial"},{label:"None",value:"none"}],d=[{value:"100",label:"100 (Thin)"},{value:"200",label:"200 (Extra Light)"},{value:"300",label:"300 (Light)"},{value:"400",label:"400 (Normal)"},{value:"500",label:"500 (Medium)"},{value:"600",label:"600 (Semi Bold)"},{value:"700",label:"700 (Bold)"},{value:"800",label:"800 (Extra Bold)"},{value:"900",label:"900 (Black)"},{value:"",label:"Default"},{value:"normal",label:"Normal"},{value:"bold",label:"Bold"}];return(0,oe.useEffect)(function(){K9(n.selectedFont,window.templately.locale)},[n.selectedFont]),ae().createElement("td",{className:"templately-setting-typography-picker-wrapper"},ae().createElement("div",{className:"templately-setting-typography-picker",ref:s},ae().createElement("div",{className:"templately-setting-typography-picker-title-wrapper"},ae().createElement("div",{className:"templately-setting-typography-picker-title-inner"},ae().createElement("h4",{className:"templately-setting-typography-picker-title"},null==n?void 0:n.title),ae().createElement("button",{className:"templately-setting-typography-picker-reset-button",onClick:i},ae().createElement(XD,null))),ae().createElement("button",{className:"templately-setting-typography-picker-close-button",onClick:function(){return t(!1)}},ae().createElement(oI,null))),ae().createElement("div",{className:"templately-setting-typography-picker-preview",style:{fontFamily:n.selectedFont,fontSize:"40px",lineHeight:"1.5"}},"Ag"),ae().createElement("div",{className:"templately-setting-typography-picker-field"},ae().createElement("label",{htmlFor:"",className:"templately-setting-typography-picker-field-label"},"Family"),ae().createElement("div",{className:"templately-setting-typography-picker-field-inner"},ae().createElement(Fg,{isSearchable:!0,menuPlacement:"top",value:o.find(function(e){return e.value===n.selectedFont}),options:o,onChange:function(e){return r("selectedFont",e.value)},components:{MenuList:function(t){return function(e){var t,n=e.options,r=e.children,o=e.maxHeight,i=e.getValue,a=e.loadedFonts,l=(Wn(e,Z9),pe(i(),1)[0]),s=null!==(t=n.indexOf(l))&&void 0!==t?t:0,c=ae().useRef(),u=ae().useRef({}),d=ae().useCallback(function(e,t){var n;u.current=eee(eee({},u.current),{},Tt({},e,t)),null===(n=c.current)||void 0===n||n.resetAfterIndex(e)},[]),p=function(){var e=pe((0,oe.useState)([0,0]),2),t=e[0],n=e[1];return(0,oe.useLayoutEffect)(function(){function e(){n([window.innerWidth,window.innerHeight])}return window.addEventListener("resize",e),e(),function(){return window.removeEventListener("resize",e)}},[]),t}(),h=pe(p,1)[0];return(0,oe.useEffect)(function(){var e;null===(e=c.current)||void 0===e||e.scrollToItem(s,"center")},[]),ae().createElement(tee.Provider,{value:{setSize:d,windowWidth:h,loadedFonts:a,options:n,listRef:c}},ae().createElement("div",null,ae().createElement(DI,{useIsScrolling:!0,height:o,itemSize:function(e){return u.current[e]||35},itemCount:r.length,ref:c},function(e){var t=e.index,o=e.style,i=(e.data,e.isScrolling);return ae().createElement("div",{style:eee(eee({},o),{},{fontFamily:n[t].value})},ae().createElement(nee,{index:t,style:o,isScrolling:i},r[t]))})))}(lee(lee({},t),{},{loadedFonts:e.loadedFonts}))}},className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"}))),ae().createElement(iee,{label:"Size",screen:a,setScreen:l,typography:n,setTypography:r,field:"selectedSize"}),ae().createElement(iee,{label:"Line",title:"Line Height",screen:a,setScreen:l,field:"selectedLineHeight",typography:n,setTypography:r}),ae().createElement(iee,{label:"Letter",title:"Letter Spacing",screen:a,setScreen:l,field:"selectedLetterSpacing",typography:n,setTypography:r}),ae().createElement("div",{className:"templately-setting-typography-picker-field"},ae().createElement("label",{htmlFor:"",className:"templately-setting-typography-picker-field-label"},"Weight"),ae().createElement("div",{className:"templately-setting-typography-picker-field-inner"},ae().createElement(Fg,{isSearchable:!0,menuPlacement:"top",value:d.find(function(e){return e.value===n.selectedFontWeight}),options:d,onChange:function(e){return r("selectedFontWeight",e.value)},className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"}))),ae().createElement("div",{className:"templately-setting-typography-picker-field"},ae().createElement("label",{htmlFor:"",className:"templately-setting-typography-picker-field-label"},"Transform"),ae().createElement("div",{className:"templately-setting-typography-picker-field-inner"},ae().createElement(Fg,{isSearchable:!0,menuPlacement:"top",defaultValue:c.find(function(e){return e.value==n.transform}),onChange:function(e){return r("transform",e.value)},options:c,className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"}))),ae().createElement("div",{className:"templately-setting-typography-picker-field"},ae().createElement("label",{htmlFor:"",className:"templately-setting-typography-picker-field-label"},"Decoration"),ae().createElement("div",{className:"templately-setting-typography-picker-field-inner"},ae().createElement(Fg,{isSearchable:!0,menuPlacement:"top",defaultValue:u.find(function(e){return e.value==n.decoration}),onChange:function(e){return r("decoration",e.value)},options:u,className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"})))))};var cee=function(e){var t=e.setTypographyPickerOpen,n=e.normalizedTypography,r=e.typography,o=e.setTypography,i=e.fontList,a=e.reset,l=e.screen,s=e.setScreen,c=pe((0,oe.useState)(!1),2),u=c[0],d=c[1],p=(0,oe.useRef)(null);return null!=r&&r.selectedFont?r.selectedFont:(0,At.__)("Default","templately"),(0,oe.useEffect)(function(){t(u)},[u]),function(e){(0,oe.useEffect)(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&d(!1)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[e])}(p),(0,oe.useEffect)(function(){K9(r.selectedFont,window.templately.locale)},[r.selectedFont]),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-setting-typography-panel-item",key:null==r?void 0:r._id},ae().createElement("div",{className:"templately-setting-typography-mini-preview",style:{fontFamily:r.selectedFont}},"Ag"),ae().createElement("div",{className:"templately-setting-typography-title"},r.title),ae().createElement("div",{className:"templately-setting-typography-popup-button",onClick:function(){return d(!u)}},ae().createElement(Ln,null)),u&&ae().createElement(see,{normalizedTypography:n,setShowPicker:d,typography:r,setTypography:o,fontList:i,reset:a,screen:l,setScreen:s,loadedFonts:e.loadedFonts,closeRef:p})))};function uee(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 dee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uee(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const pee=gn(function(e,t){var n,r,o,i,a,l,s,c=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return dee(dee({},t),{},{platform:c,settings:null!==(r=null===(o=e.settingsPage.settings)||void 0===o?void 0:o[c])&&void 0!==r?r:{},screen:null!==(i=null===(a=e.settingsPage)||void 0===a||null===(a=a[c])||void 0===a?void 0:a.screen)&&void 0!==i?i:"desktop",selectedTypography:null!==(l=null===(s=e.settingsPage)||void 0===s||null===(s=s[c])||void 0===s?void 0:s.selectedTypography)&&void 0!==l?l:{}})},function(e){return{setScreen:function(t){return e(function(e){return{type:wi.SET_SCREEN,screen:e}}(t))},setSelectedTypography:function(t){return e((n=t,{type:wi.SET_SELECTED_TYPOGRAPHY,typography:n}));var n}}})(function(e){e.settings;var t=e.platform,n=e.screen,r=e.setScreen,o=e.selectedTypography,i=e.setSelectedTypography,a=pe((0,oe.useState)(0),2),l=a[0],s=a[1],c=pe((0,oe.useState)(!1),2),u=c[0],d=c[1],p=(0,oe.useRef)([]),h=pe((0,oe.useState)([]),2),f=h[0],m=h[1],g=oe.useContext(ot),v=g.normalizedTypography,y=g.groupedData,b=(0,oe.useMemo)(function(){var e=X9.map(function(e){return{value:e,label:e}});return[{value:"",label:(0,At.__)("Default","templately")},{label:(0,At.__)("System","templately"),isDisabled:!0}].concat(Ul(e),[{label:(0,At.__)("Google","templately"),isDisabled:!0}],Ul(f))},[f]);return(0,oe.useEffect)(function(){s(0),(0,_a.isEmpty)(o)&&i(v)},[t]),(0,oe.useEffect)(function(){var e={action:"templately_pack_google_font",nonce:window.templately.nonce,page:0},t=(0,Ci.addQueryArgs)(window.ajaxurl,e);ba(t,{}).then(function(e){var t,n=e.response,r=e.error;r?console.error("Error fetching Google fonts:",r):(null==n||null===(t=n.data)||void 0===t?void 0:t.length)>0&&m(n.data.map(function(e){return{value:e.family,label:e.family,variants:e.variants.map(function(e){return{value:e,label:e}})}}))})},[]),ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-typography"},ae().createElement("div",{className:"templately-setting-typography-picker-section"},ae().createElement("div",{className:"templately-setting-typography-picker-section-label-wrapper"},ae().createElement("div",{style:{display:"flex",alignItems:"center",gap:10}},ae().createElement("label",{className:"templately-setting-typography-picker-section-label"},"Typography"),ae().createElement("div",{className:"templately-setting-device-tab"},ae().createElement("button",{className:"templately-setting-device-tab-button ".concat("desktop"===n?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return r("desktop")}},ae().createElement("span",{className:"dashicons dashicons-desktop"})),ae().createElement("button",{className:"templately-setting-device-tab-button ".concat("tablet"===n?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return r("tablet")}},ae().createElement("span",{className:"dashicons dashicons-tablet"})),ae().createElement("button",{className:"templately-setting-device-tab-button ".concat("mobile"===n?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return r("mobile")}},ae().createElement("span",{className:"dashicons dashicons-smartphone"})))),ae().createElement("button",{className:"templately-setting-typography-picker-reset-button",onClick:function(){i(v)}},ae().createElement(XD,null))),ae().createElement("div",{className:"templately-setting-typography-panel-wrapper"},y.map(function(e,t){var a=e.key,c=e.items;return ae().createElement($9,{title:a,key:a,initialCollapsed:!0,current:l,setCurrent:s,id:t},ae().createElement("div",{className:"templately-setting-typography-panel"},c&&c.map(function(e){var t=e._id;return o[t]?ae().createElement(cee,{key:t,setTypographyPickerOpen:d,reset:function(){return function(e){i(dee(dee({},o),{},Tt({},e,v[e])))}(t)},normalizedTypography:v,typography:o[t],setTypography:function(e,n){return function(e,t,n){var r=Va(o,"".concat(e,".").concat(t),n);i(r)}(t,e,n)},fontList:b,screen:n,setScreen:r,loadedFonts:p}):null})))})))),u&&ae().createElement("div",{className:"templately-setting-overlay"}))});function hee(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 fee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hee(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const mee=gn(function(e,t){var n,r,o,i,a;return fee(fee({},t),{},{settingsPlatform:null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor",isLoggedIn:null!==e.profile.data,user:null!==(r=e.profile)&&void 0!==r&&r,redirect:null===(o=e.general)||void 0===o?void 0:o.redirect,isGloballySigned:null!==(i=null===(a=e.profile)||void 0===a?void 0:a.is_globally_signed)&&void 0!==i&&i})},function(e){return{setPlatform:function(t){return e(fv(t))},resetFilter:function(){return e(gv())},isVerifiedProfile:function(t){return e(Qi(t))}}})(function(e){var t=pe(Ct(),1)[0],n=rt(),r=tt(),o=(it(),kn());return(0,oe.useEffect)(function(){var t,r,i;null!==e.redirect&&(o(Bi({trying_logout:!0,isGloballySigned:null==e?void 0:e.isGloballySigned,global_user:null!==(t=null===(r=e.redirect)||void 0===r?void 0:r.user)&&void 0!==t?t:void 0})),n(ub(null===(i=e.redirect)||void 0===i?void 0:i.url)))},[e.redirect]),(0,oe.useEffect)(function(){if(null!=e&&e.platform&&e.setPlatform(e.platform),"templately_settings"!==(null==t?void 0:t.get("page"))||null!=t&&t.get("path")){if(e.route){var r={};null!=e&&e.platform&&(r={platform:null==e?void 0:e.platform}),n(ub(e.route,r))}else t.get("path")&&"/"!==(null==t?void 0:t.get("path"))||("gutenberg"===(null==e?void 0:e.platform)&&n(ub("gutenberg/packs",{platform:"gutenberg",isGutenbergEditor:!0})),"elementor"!==(null==e?void 0:e.platform)&&void 0!==(null==e?void 0:e.platform)||n(ub("elementor/packs")));return function(){if(void 0!==e.route){var t,r=cb(),o=null===(t=r.path)||void 0===t?void 0:t.startsWith("clouds/save-template");n(ub(o?"":r.path,{closing:!0}))}}}n(ub("settings/".concat(e.settingsPlatform,"/general")))},[]),(0,oe.useEffect)(function(){var t;!1!==(null==r||null===(t=r.state)||void 0===t?void 0:t.resetFilter)&&e.resetFilter()},[r]),(0,oe.useEffect)(function(){var e=function(e){var r;if(!e.metaKey&&!e.ctrlKey){var o=e.target.closest("a");if(o){var i=o.getAttribute("href");if(i){var a=new URLSearchParams(null===(r=i.split("?"))||void 0===r?void 0:r[1]).get("page"),l=null;if("templately"===a)l=ub("elementor/packs");else if("templately_settings"===a){var s,c=Ya("/settings/:platform/:tab",t.get("path"));l=ub(["settings",null!=c&&c.platform||null!==(s=window.templately)&&void 0!==s&&null!==(s=s.settings)&&void 0!==s&&s.has_elementor?"elementor":"gutenberg","general"])}l&&(e.preventDefault(),n(l),document.querySelectorAll("#toplevel_page_templately li").forEach(function(e){return e.classList.remove("current")}),o.parentNode.classList.add("current"))}}}},r=document.querySelector("#toplevel_page_templately");if(r){var o;r.addEventListener("click",e);var i=null!==(o=t.get("path"))&&void 0!==o?o:"",a=null;if("elementor/packs"===i?a="admin.php?page=templately":i.startsWith("settings/")&&(a="admin.php?page=templately_settings"),i&&a){r.querySelectorAll("li.current").forEach(function(e){return e.classList.remove("current")});var l=r.querySelector('ul.wp-submenu a[href="'.concat(a,'"]'));l&&l.parentNode.classList.add("current")}}return function(){r&&r.removeEventListener("click",e)}},[n]),lt([{element:ae().createElement(Oj,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"/sign-in",index:!0,exact:!0,element:ae().createElement(VC,null)}]},{path:"/settings",exact:!0,element:ae().createElement(Rj,null),children:(0,ce.applyFilters)("templately.settings.routes",[{index:!0,element:ae().createElement(gt,{to:"elementor/general",replace:!0})},{path:":platform/general",element:ae().createElement(W9,null)},{path:":platform/miscellaneous",element:ae().createElement(Q9,null)},{path:":platform/custom_css",element:ae().createElement(D9,null)},{path:":platform/typography",element:ae().createElement(pee,null)},{path:":platform/colors",element:ae().createElement(Bj,null)}])},{element:ae().createElement(Oj,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"/:platform/:type",exact:!0,element:ae().createElement(Tj,re({},Ya("/:platform/:type",t.get("path")),{query:t.get("q")}))},{path:"/:platform/:type/:slug",exact:!0,element:ae().createElement(ZR,{params:Ya("/:platform/:type/:slug",t.get("path"))})},{path:"/:platform/templates",exact:!0,element:ae().createElement(Sj,null)}]},{element:ae().createElement(Oj,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"clouds",exact:!0,element:ae().createElement(xj,null),children:[{path:"workspace",element:ae().createElement(EC,null)},{path:"workspace/:slug",element:ae().createElement(iC,Ya("/clouds/workspace/:slug",t.get("path")))},{path:"shared-workspace",element:ae().createElement(EC,{shared:!0})},{path:"shared-workspace/:slug",element:ae().createElement(iC,re({shared:!0},Ya("/clouds/shared-workspace/:slug",t.get("path"))))},{path:"save-template",element:ae().createElement(kC,e)},{index:!0,element:ae().createElement(wC,{title:"My Clouds",q:t.get("q")})}]},{element:ae().createElement(xj,null),children:[{exact:!0,path:"downloads",element:ae().createElement(sC,null)},{exact:!0,path:"favourites",element:ae().createElement(dC,null)},{exact:!0,path:"purchased-items",element:ae().createElement(gC,null)}]}]},{path:"*",element:ae().createElement(gt,{to:ub("elementor/packs")})}])});function gee(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}const vee=function(e){var t,n=function(e,t){var r=e.find(function(e){return t==e.value});if(r)return r;var o,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return gee(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)?gee(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(a.options){var l=n(a.options,t);if(l)return l}}}catch(e){i.e(e)}finally{i.f()}},r=0===(null===(t=e.value)||void 0===t?void 0:t.length)?e.options[0]:n(e.options,e.value);return ae().createElement(Fg,re({isSearchable:!1,classNamePrefix:"templately-condition"},e,{className:"".concat(e.className," templately-condition"),value:r}))};var yee=["update"];const bee=function(e){var t=e.update,n=Wn(e,yee),r=[{value:"include",label:(0,At.__)("Include","templately")},{value:"exclude",label:(0,At.__)("Exclude","templately")}];return ae().createElement(vee,{options:r,onChange:function(e){return t(n.id,{type:e.value,name:"general",sub_name:"",sub_id:""})},value:n.type,className:"templately-condition-type"})};var wee=["update"];const kee=function(e){var t=e.update,n=Wn(e,wee);return ae().createElement(vee,{options:n.options,onChange:function(e){return t(n.id,{name:e.value,sub_name:"",sub_id:""})},value:n.name,className:"templately-condition-name"})};var Eee=["update"];const Oee=function(e){var t=e.update,n=Wn(e,Eee);return"general"!==n.name&&n.subOptions.length?ae().createElement(vee,{options:n.subOptions,onChange:function(e){return t(n.id,{sub_name:e.value,sub_id:""})},value:n.sub_name,className:"templately-condition-sub-name"}):""};var xee=["update"];const See=function(e){var t=e.update,n=Wn(e,xee);if(!n.sub_name||null==n||!n.subIdAutocomplete||!Object.keys(null==n?void 0:n.subIdAutocomplete).length)return"";var r=pe($E(n.subIdAutocomplete,n.sub_id),2),o=r[0],i=r[1];return ae().createElement(vee,{value:n.sub_id,options:o,onInputChange:function(e){return i(e)},onChange:function(e){var r;return t(n.id,{sub_id:null!==(r=null==e?void 0:e.value)&&void 0!==r?r:""})},className:"templately-condition-id",isSearchable:!0,isClearable:!0})},_ee=function(){var e,t=aO(),n=t.conditions,r=t.updateCondition,o=t.createCondition,i=t.removeCondition,a=(t.isSaving,null===(e=Object.values(n))||void 0===e?void 0:e.map(function(e){return ae().createElement("div",{className:"templately-display-condition-wrapper",key:e.id},ae().createElement("div",{className:"templately-display-condition"},ae().createElement(bee,re({},e,{update:r})),ae().createElement(kee,re({},e,{update:r})),ae().createElement(Oee,re({},e,{update:r})),ae().createElement(See,re({},e,{update:r}))),ae().createElement("button",{onClick:function(){return i(e.id)},className:"delete-button"},ae().createElement(U9,null)))}));return ae().createElement("div",{className:"templately-display-conditions"},a,ae().createElement(vl,{onClick:o,label:(0,At.__)("Add New Condition","templately")}))},Cee=function(){var e=aO(),t=e.saveConditions,n=e.isSaving;return ae().createElement("div",{className:"templately-display-condition-modal-footer"},ae().createElement(vl,{disabled:n,onClick:t,label:n?(0,At.__)("Saving...","templately"):(0,At.__)("Save & Close","templately")}))},Pee=function(){return ae().createElement("div",{className:"templately-display-condition-modal-header"},ae().createElement("div",{className:"templately-logo"},ae().createElement(Nn,{width:"37.66px",className:"vector-logo"}),ae().createElement(Dn,{className:"text-logo"})),ae().createElement("button",{className:"close-button",onClick:function(){window.TemplatelyAppManager.close("templately-edit-conditions-app")}},ae().createElement(U9,null)))};function Tee(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 Aee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tee(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Mee=gn(function(e,t){var n,r,o,i;return Aee(Aee({},t),{},{isLoading:null!==(n=e.conditions.isLoading)&&void 0!==n&&n,conditions:null!==(r=e.conditions.conditions)&&void 0!==r?r:[],conditionsByTemplate:null!==(o=null===(i=e.conditions.conditionsByTemplate)||void 0===i?void 0:i[null==t?void 0:t.templateID])&&void 0!==o?o:[]})},function(e){return{getConditions:function(t){return e(function(e){return{type:$r,template_id:e}}(t))}}})(function(e){var t;if((0,oe.useEffect)(function(){e.getConditions(e.templateID)},[]),e.isLoading)return ae().createElement("div",{className:"templately-display-condition-loader"},ae().createElement(_l,null));var n={id:e.templateID,conditions:[]};return(null===(t=e.conditionsByTemplate)||void 0===t?void 0:t.length)>0&&(n.conditions=e.conditionsByTemplate),ae().createElement(ae().Fragment,null,ae().createElement(iO,{template:n},ae().createElement("div",{className:"templately-display-condition-modal-wrapper"},ae().createElement(Pee,null),ae().createElement("div",{className:"templately-display-condition-modal-body"},ae().createElement("h1",null,"Where Do You Want to Display This Template"),ae().createElement("p",null,"Set the conditions that determine where your Template is used throughout your site.",ae().createElement("br",null),"For example, choose 'Entire Site' to display the template across your site."),ae().createElement(_ee,null)),ae().createElement(Cee,null))))});function Nee(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 Dee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nee(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Iee=function(){var e,t,n=pe((0,oe.useState)(!1),2),r=n[0],o=n[1],i=pe((0,oe.useState)({platform:"elementor",type:"",title:""}),2),a=i[0],l=i[1],s=function(){var e=Ei(xi().mark(function e(){var t,n,r,i;return xi().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),e.next=1,wa("/templately/v1/create-template",Dee({nonce:templately.nonce},a));case 1:t=e.sent,n=t.response,r=t.error,n&&(i=new URL(n))&&(window.location.href=i.href),r&&console.error("Error: Template Creation",r),o(!1);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();return ae().createElement("div",{className:"templately-theme-builder-modal-html-body-inner"},ae().createElement(nI.RadioControl,{className:"templately-theme-builder__choose-platform",selected:null==a?void 0:a.platform,options:[{label:"Elementor",value:"elementor"},{label:"Gutenberg",value:"gutenberg"}],onChange:function(e){return l(Dee(Dee({},a),{},{platform:e}))}}),ae().createElement("div",{className:"templately-theme-builder__choose-type-wrapper"},ae().createElement("label",null,"Chose the type of template you want to work on"),ae().createElement(Fg,{isSearchable:!1,className:"templately-theme-builder__choose-type",classNamePrefix:"templately-theme-builder__choose-type",placeholder:(0,At.__)("Select template type","templately"),required:!0,noOptionsMessage:function(){return(0,At.__)("No type Found","templately")},options:null===(e=templately)||void 0===e?void 0:e.types,onChange:function(e){return l(Dee(Dee({},a),{},{type:null==e?void 0:e.value}))}})),ae().createElement(nI.TextControl,{className:"templately-theme-builder__choose-title",label:"Name your template",value:null===(t=templately)||void 0===t?void 0:t.title,placeholder:"Enter template name (optional)",onChange:function(e){return l(Dee(Dee({},a),{},{title:e}))}}),ae().createElement("button",{className:"submit-button ".concat(""===(null==a?void 0:a.type)||r?"disabled":""),onClick:s,disabled:r||!(null!=a&&a.type)},(0,At.__)("Create Template","templately")))},Lee=function(){return ae().createElement("span",{onClick:function(){Al({showConfirmButton:!1,showDenyButton:!1,icon:!1,title:!1,showCloseButton:!0,customClass:{container:"templately-theme-builder-modal-container",popup:"templately-theme-builder-modal-popup",closeButton:"templately-theme-builder-modal-close-button",htmlContainer:"templately-theme-builder-modal-html"},html:ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-theme-builder-modal-html-header"},ae().createElement("h3",{className:"templately-title"},(0,At.__)("Templates Make your Work More Efficient","templately")),ae().createElement("p",{className:"templately-details"},(0,At.__)("Templates help you create different sections of your site, and with just a single click, you can reuse them whenever needed","templately"))),ae().createElement("div",{className:"templately-theme-builder-modal-html-body"},ae().createElement(Iee,null)))},!0).then(function(e){})}},(0,At.__)("Add New Template","templately"))},Ree=function(e){return ae().createElement(Lee,null)},jee=function(){var e=pe((0,oe.useState)(!1),2),t=e[0],n=e[1],r=function(){Tl.close()};return ae().createElement(ae().Fragment,null,ae().createElement("div",{className:"templately-display-condition-modal-header"},ae().createElement("div",{className:"templately-logo"}),ae().createElement("button",{className:"close-button",onClick:r},ae().createElement(U9,null))),ae().createElement("div",{className:"templately-display-condition-modal-body"},!t&&ae().createElement("div",{className:"normal"},ae().createElement("h2",null,(0,At.__)("Are you sure you want to revert to your old website?","templately")),ae().createElement("div",{className:"warning-text"},(0,At.__)("Warning: This will remove your existing settings and content with the previous one.","templately"))),ae().createElement("div",{className:"reverting",style:{display:t?"":"none"}},ae().createElement(_l,null),ae().createElement("div",null,ae().createElement("p",null,(0,At.__)("Restoring previous version of your website. This usually takes a few moments. Please wait…","templately"))))),ae().createElement("div",{className:"templately-display-condition-modal-footer"},ae().createElement(vl,{className:"confirm-revert",disabled:t,onClick:function(e){var t;n(!0);var r=null===(t=e.target.closest(".templately-sweetalert"))||void 0===t?void 0:t.querySelector(".swal2-icon");r&&(r.style.display="none");var o=(0,Ci.addQueryArgs)(ajaxurl,{action:"templately_pack_import_revert",nonce:window.templately.nonce});ba(o,{}).then(function(e){var t=e.response,r=e.error;n(!1),r?Tl.close({success:!1,error:r}):(Tl.close(t),null!=t&&t.success)})},label:t?(0,At.__)("Processing...","templately"):(0,At.__)("Yes, Revert","templately")}),ae().createElement(vl,{disabled:t,onClick:r,label:(0,At.__)("Cancel","templately")})))},Fee=function(e){var t=(0,oe.useMemo)(function(){return{key:"success",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong while creating workspace for you. Try Later or Contact support.","templately"),args:{timer:null,showCloseButton:!0,showCancelButton:!0,cancelButtonText:"Close"}},success:{title:(0,At.__)("Successfully Reverted","templately"),content:(0,At.__)("Old website has been successfully restored.","templately"),args:{timer:null,showCloseButton:!0,showConfirmButton:!0,confirmButtonText:"Visit Site"}}}},[]);return ae().createElement("span",{onClick:function(e){e.preventDefault(),Al({icon:"warning",onConfirm:function(e){var n;if(null!=e&&null!==(n=e.data)&&void 0!==n&&n.site_url){var r=e.data.site_url;t.success.args.confirmButtonText='<a href="'.concat(r,'" target="_blank">Visit Site</a>'),t.success.args.didDestroy=function(t){e.success&&e.data.redirect&&setTimeout(function(){window.location=e.data.redirect},500)}}Ml(t,e)},html:ae().createElement(jee,null),didDestroy:function(){}},!0).then(function(e){e.success})}},(0,At.__)("Revert Now","templately"))},zee=function(e){var t=pe((0,oe.useState)({action:sb.action,location:sb.location}),2),n=t[0],r=t[1];return(0,oe.useLayoutEffect)(function(){return sb.listen(function(e,t){r({action:t,location:e})})},[sb]),ae().createElement(ae().StrictMode,null,ae().createElement(Jy,{value:{store:Kx,history:sb}},ae().createElement(jt,{displayName:"ReduxProvider",store:Kx,context:Mt},(null==e?void 0:e.conditions)&&ae().createElement(Mee,e),(null==e?void 0:e.revert)&&ae().createElement(Fee,e),!(null!=e&&e.settings)&&!(null!=e&&e.conditions)&&!(null!=e&&e.revert)&&!e.addNewTemplate&&ae().createElement(yt,{location:n.location,basename:"/",navigator:sb,navigationType:n.action},ae().createElement(mee,e)))))};window.wp.domReady,(0,ce.addFilter)("templately_before_content_header","templately",function(e){return React.createElement(HC,e)});var Bee=function(e){return React.createElement("div",{className:"templately-gutenberg"},React.createElement(zee,re({platform:"gutenberg"},e)))};if(null!=document.getElementById("templatelyAdmin")&&(document.querySelectorAll(".toplevel_page_templately #wpbody-content > .notice, #ehe-admin-cb").forEach(function(e){return e.remove()}),se().render(React.createElement(zee,{root:!0}),document.getElementById("templatelyAdmin"))),null!=document.getElementById("templatelyAdminSetting")&&(document.querySelectorAll(".templately_page_templately_settings #wpbody-content > .notice, #ehe-admin-cb").forEach(function(e){return e.remove()}),se().render(React.createElement(zee,{isSettings:!0}),document.getElementById("templatelyAdminSetting"))),null!=document.getElementById("templately-theme-builder-admin-header")){var Wee=document.querySelector(".post-type-templately_library a.page-title-action");Wee&&(se().render(React.createElement(Ree,{platform:"elementor"}),Wee),Wee.classList.add("rendered"),Wee.addEventListener("click",function(e){e.preventDefault()}))}window.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".templately-edit-conditions").forEach(function(e){e.addEventListener("click",function(t){t.preventDefault();var n=e.getAttribute("data-template_id");window.TemplatelyAppManager.open({templateID:n},"templately-edit-conditions-app","conditions"),document.querySelector(".templately-edit-conditions-app-wrapper.open").addEventListener("click",function(e){e.target.matches(".templately-edit-conditions-app-wrapper.open")&&window.TemplatelyAppManager.close("templately-edit-conditions-app")})})})}),function(e){e.TemplatelyAppManager={open:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"elementor",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return this.id=t,this.platform=n,null===r&&"elementor"===n&&(r=React.createElement(zee,re({platform:"elementor"},e))),null===r&&"gutenberg"===n&&(t=document.getElementById(t),r=React.createElement(Bee,e)),null===r&&"conditions"===n&&(t=document.getElementById(t),r=React.createElement(zee,re({conditions:!0,root:!0},e)),t.parentElement.classList.add("open")),se().render(r,t)},close:function(t){var n,r;if(null!==(r=t=null!==(n=this.id)&&void 0!==n?n:t)&&void 0!==r&&r.tagName||(t=document.getElementById(t)),t.parentElement.classList.contains("open")&&t.parentElement.classList.remove("open"),"elementor"!==this.platform)return se().unmountComponentAtNode(t);e.TemplatelyModal.hide()}}}(window);var Uee=function(){var e=document.getElementById("templatelyAdmin");if("templatelyAdmin"===(null==e?void 0:e.id)){if(window.scrollY+window.innerHeight===document.documentElement.scrollHeight){var t=document.querySelector(".templately-sidebar-filter-buttons");t&&(t.style.bottom="40px")}var n=document.querySelector("#adminmenuwrap"),r=document.querySelector("body"),o=document.querySelector(".toplevel_page_templately");(null==n?void 0:n.offsetHeight)>(null==r?void 0:r.offsetHeight)?"object"==ne(o)&&"BODY"===(null==o?void 0:o.nodeName)&&(o.style.height=(null==n?void 0:n.offsetHeight)+"px"):o.style.height="100%"}};if(window.addEventListener("DOMContentLoaded",Uee),window.addEventListener("resize",Uee),window.addEventListener("scroll",function(){var e=document.getElementById("templatelyAdmin");if("templatelyAdmin"===(null==e?void 0:e.id)){var t=document.querySelector(".templately-sidebar-filter-buttons");if(null!=t){var n=window.scrollY+window.innerHeight,r=document.documentElement.scrollHeight,o=r-40;t.style.bottom=n>=o?n-o+"px":"0px",n===r?t.classList.add("tsfb-scroll-end"):t.classList.remove("tsfb-scroll-end")}}}),"undefined"!=typeof window&&(window.TemplatelyLibrary={components:{CustomizerIsolated:XI,ImageReplacePanelIsolated:cD},hooks:{useCustomizerData:KI,useImageReplacePanel:yD,useFullSiteImport:QE},utils:{initializeImageMappings:BM,executeAIContentWorkflow:LM}},window.TemplatelyCustomizerIsolated=XI,window.TemplatelyImageReplacePanelIsolated=cD),null!=document.getElementById("templately-fsi-revert-wrapper")){var Vee=document.getElementById("templately-fsi-revert-wrapper"),Hee=Vee.getElementsByTagName("button");if(Hee&&Hee[0]){se().render(React.createElement(Fee,null),Hee[0]);var qee=Vee.parentNode.querySelector(".subsubsub"),Qee=Vee.parentNode.parentNode.querySelector("#posts-filter");Vee.style.display="block",qee.style.display="none",Qee.style.display="none"}}})()})();
Copyright ©2021 || Defacer Indonesia