PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.3.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.3.0
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
← All changes | admin-core/assets/build/editor-app.js +57 -52 3.1.1 → 3.3.0 View file →
@@ -1,64 +1,69 @@
1 -(()=>{var e,t,n,r={5858(e,t,n){"use strict";var r={};n.r(r),n.d(r,{Button:()=>nE,CaptionLabel:()=>rE,Chevron:()=>oE,Day:()=>aE,DayButton:()=>iE,Dropdown:()=>sE,DropdownNav:()=>lE,Footer:()=>cE,Month:()=>uE,MonthCaption:()=>dE,MonthGrid:()=>fE,Months:()=>pE,MonthsDropdown:()=>mE,Nav:()=>hE,NextMonthButton:()=>gE,Option:()=>wE,PreviousMonthButton:()=>yE,Root:()=>bE,Select:()=>vE,Week:()=>xE,WeekNumber:()=>_E,WeekNumberHeader:()=>ME,Weekday:()=>NE,Weekdays:()=>EE,Weeks:()=>IE,YearsDropdown:()=>SE});var o={};n.r(o),n.d(o,{formatCaption:()=>DE,formatDay:()=>jE,formatMonthCaption:()=>CE,formatMonthDropdown:()=>AE,formatWeekNumber:()=>LE,formatWeekNumberHeader:()=>OE,formatWeekdayName:()=>TE,formatYearCaption:()=>PE,formatYearDropdown:()=>zE});var a={};n.r(a),n.d(a,{labelCaption:()=>FE,labelDay:()=>UE,labelDayButton:()=>RE,labelGrid:()=>BE,labelGridcell:()=>QE,labelMonthDropdown:()=>VE,labelNav:()=>YE,labelNext:()=>ZE,labelPrevious:()=>WE,labelWeekNumber:()=>HE,labelWeekNumberHeader:()=>$E,labelWeekday:()=>GE,labelYearDropdown:()=>XE});const i=window.wp.element;var s=n(1609),l=n.t(s,2),c=n.n(s),u=n(5338);const d=(0,s.createContext)(),f=()=>(0,s.useContext)(d);var p;const m={settingsProcess:!1,unsavedChanges:!1,page_builder:cartflows_admin?.page_builder?cartflows_admin.page_builder:"other",license_status:null!==(p=cartflows_admin?.license_status)&&void 0!==p?p:"",canvasMode:(()=>{try{return"true"===localStorage.getItem("wcf_canvas_mode_enabled")}catch(e){return!1}})()};n(5146);var h=n(6347),g=n(7387),w=n(4499),y=n(8168),b=n(8587),v=n(1561),x=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,w.createBrowserHistory)(t.props),t}return(0,g.A)(t,e),t.prototype.render=function(){return c().createElement(h.Router,{history:this.history,children:this.props.children})},t}(c().Component);c().Component;var N=function(e,t){return"function"==typeof e?e(t):e},E=function(e,t){return"string"==typeof e?(0,w.createLocation)(e,null,null,t):e},_=function(e){return e},M=c().forwardRef;void 0===M&&(M=_);var I=M(function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,a=(0,b.A)(e,["innerRef","navigate","onClick"]),i=a.target,s=(0,y.A)({},a,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||i&&"_self"!==i||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return s.ref=_!==M&&t||n,c().createElement("a",s)}),S=M(function(e,t){var n=e.component,r=void 0===n?I:n,o=e.replace,a=e.to,i=e.innerRef,s=(0,b.A)(e,["component","replace","to","innerRef"]);return c().createElement(h.__RouterContext.Consumer,null,function(e){e||(0,v.A)(!1);var n=e.history,l=E(N(a,e.location),e.location),u=l?n.createHref(l):"",d=(0,y.A)({},s,{href:u,navigate:function(){var t=N(a,e.location),r=(0,w.createPath)(e.location)===(0,w.createPath)(E(t));(o||r?n.replace:n.push)(t)}});return _!==M?d.ref=t||i:d.innerRef=i,c().createElement(r,d)})}),k=function(e){return e},D=c().forwardRef;void 0===D&&(D=k),D(function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,a=void 0===o?"active":o,i=e.activeStyle,s=e.className,l=e.exact,u=e.isActive,d=e.location,f=e.sensitive,p=e.strict,m=e.style,g=e.to,w=e.innerRef,x=(0,b.A)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return c().createElement(h.__RouterContext.Consumer,null,function(e){e||(0,v.A)(!1);var n=d||e.location,o=E(N(g,n),n),b=o.pathname,_=b&&b.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),M=_?(0,h.matchPath)(n.pathname,{path:_,exact:l,sensitive:f,strict:p}):null,I=!!(u?u(M,n):M),C="function"==typeof s?s(I):s,j="function"==typeof m?m(I):m;I&&(C=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return e}).join(" ")}(C,a),j=(0,y.A)({},j,i));var A=(0,y.A)({"aria-current":I&&r||null,className:C,style:j,to:o},x);return k!==D?A.ref=t||w:A.innerRef=w,c().createElement(S,A)})});const C=window.wp.i18n;var j=n(4848);const A=e=>{const t=z(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),T(n,t)||O(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},T=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?T(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},L=/^\[(.+)\]$/,O=e=>{if(L.test(e)){const t=L.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},z=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return B(Object.entries(e.classGroups),n).forEach(([e,n])=>{P(n,r,e,t)}),r},P=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?U(e)?void P(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,o])=>{P(o,R(t,e),n,r)});(""===e?t:R(t,e)).classGroupId=n})},R=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},U=e=>e.isThemeGetter,B=(e,t)=>t?e.map(([e,n])=>{const r=n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e);return[e,r]}):e,F=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},Q=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],a=t.length,i=e=>{const n=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===o&&(r||e.slice(c,c+a)===t)){n.push(e.slice(l,c)),l=c+a;continue}if("/"===u){i=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===n.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:n,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return n?e=>n({className:e,parseClassName:i}):i},V=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},Y=/\s+/;function Z(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=W(e))&&(r&&(r+=" "),r+=t);return r}const W=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=W(e[r]))&&(n&&(n+=" "),n+=t);return n};function G(e,...t){let n,r,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:F(e.cacheSize),parseClassName:Q(e),...A(e)}))(l),r=n.cache.get,o=n.cache.set,a=i,i(s)};function i(e){const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(Y);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?" "+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?" "+s:s);continue}f=!1}const m=V(l).join(":"),h=c?m+"!":m,g=h+p;if(a.includes(g))continue;a.push(g);const w=o(p,f);for(let e=0;e<w.length;++e){const t=w[e];a.push(h+t)}s=t+(s.length>0?" "+s:s)}return s})(e,n);return o(e,a),a}return function(){return a(Z.apply(null,arguments))}}const H=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},$=/^\[(?:([a-z-]+):)?(.+)\]$/i,X=/^\d+\/\d+$/,q=new Set(["px","full","screen"]),J=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,K=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,te=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,re=e=>ae(e)||q.has(e)||X.test(e),oe=e=>ye(e,"length",be),ae=e=>Boolean(e)&&!Number.isNaN(Number(e)),ie=e=>ye(e,"number",ae),se=e=>Boolean(e)&&Number.isInteger(Number(e)),le=e=>e.endsWith("%")&&ae(e.slice(0,-1)),ce=e=>$.test(e),ue=e=>J.test(e),de=new Set(["length","size","percentage"]),fe=e=>ye(e,de,ve),pe=e=>ye(e,"position",ve),me=new Set(["image","url"]),he=e=>ye(e,me,Ne),ge=e=>ye(e,"",xe),we=()=>!0,ye=(e,t,n)=>{const r=$.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},be=e=>K.test(e)&&!ee.test(e),ve=()=>!1,xe=e=>te.test(e),Ne=e=>ne.test(e),Ee=(Symbol.toStringTag,()=>{const e=H("colors"),t=H("spacing"),n=H("blur"),r=H("brightness"),o=H("borderColor"),a=H("borderRadius"),i=H("borderSpacing"),s=H("borderWidth"),l=H("contrast"),c=H("grayscale"),u=H("hueRotate"),d=H("invert"),f=H("gap"),p=H("gradientColorStops"),m=H("gradientColorStopPositions"),h=H("inset"),g=H("margin"),w=H("opacity"),y=H("padding"),b=H("saturate"),v=H("scale"),x=H("sepia"),N=H("skew"),E=H("space"),_=H("translate"),M=()=>["auto",ce,t],I=()=>[ce,t],S=()=>["",re,oe],k=()=>["auto",ae,ce],D=()=>["","0",ce],C=()=>[ae,ce];return{cacheSize:500,separator:":",theme:{colors:[we],spacing:[re,oe],blur:["none","",ue,ce],brightness:C(),borderColor:[e],borderRadius:["none","","full",ue,ce],borderSpacing:I(),borderWidth:S(),contrast:C(),grayscale:D(),hueRotate:C(),invert:D(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[le,oe],inset:M(),margin:M(),opacity:C(),padding:I(),saturate:C(),scale:C(),sepia:D(),skew:C(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ce]}],container:["container"],columns:[{columns:[ue]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",ce]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",se,ce]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ce]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",se,ce]}],"grid-cols":[{"grid-cols":[we]}],"col-start-end":[{col:["auto",{span:["full",se,ce]},ce]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[we]}],"row-start-end":[{row:["auto",{span:[se,ce]},ce]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ce]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ce]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ce,t]}],"min-w":[{"min-w":[ce,t,"min","max","fit"]}],"max-w":[{"max-w":[ce,t,"none","full","min","max","fit","prose",{screen:[ue]},ue]}],h:[{h:[ce,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ce,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ce,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ce,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ue,oe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ie]}],"font-family":[{font:[we]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ce]}],"line-clamp":[{"line-clamp":["none",ae,ie]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",re,ce]}],"list-image":[{"list-image":["none",ce]}],"list-style-type":[{list:["none","disc","decimal",ce]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",re,oe]}],"underline-offset":[{"underline-offset":["auto",re,ce]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",pe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},he]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[re,ce]}],"outline-w":[{outline:[re,oe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:S()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[re,oe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ue,ge]}],"shadow-color":[{shadow:[we]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ue,ce]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ce]}],duration:[{duration:C()}],ease:[{ease:["linear","in","out","in-out",ce]}],delay:[{delay:C()}],animate:[{animate:["none","spin","ping","pulse","bounce",ce]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[se,ce]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ce]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[re,oe,ie]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),_e=G(Ee);function Me(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Me(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ie(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Me(e))&&(r&&(r+=" "),r+=t);return r}const Se=(...e)=>_e(Ie(...e)),ke=(...e)=>(...t)=>e.filter(Boolean).forEach(e=>e?.(...t)),De=e=>{const t={0:"gap-0",xxs:"gap-1",xs:"gap-2",sm:"gap-3",md:"gap-4",lg:"gap-5",xl:"gap-6","2xl":"gap-8"};return t[e]||t.md},Ce={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},je=()=>{const e=window.navigator?.userAgentData?.platform||window.navigator.platform;let t="null";return["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(e)?t="Mac OS":["Win32","Win64","Windows","WinCE"].includes(e)&&(t="Windows"),t},Ae=(e,t)=>{if(!(typeof window>"u"))try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},Te=e=>{if(typeof window>"u")return null;try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return console.error(e),null}},Le=({children:e,gap:t="lg",className:n,...r})=>(0,j.jsx)("div",{className:Se("w-full box-border flex items-center justify-between bg-background-primary p-5 min-h-16",De(t),n),...r,children:e});Le.displayName="Topbar";const Oe=({gap:e="sm",children:t,className:n})=>(0,j.jsx)("div",{className:Se("flex items-center",De(e),n),children:t});Oe.displayName="Topbar.Left";const ze=({gap:e="md",children:t,align:n="center",className:r})=>{const o={left:"justify-start",center:"justify-center",right:"justify-end"}[n];return(0,j.jsx)("div",{className:Se("flex items-center grow",De(e),o,r),children:t})};ze.displayName="Topbar.Middle";const Pe=({gap:e="sm",children:t,className:n})=>(0,j.jsx)("div",{className:Se("flex items-center",De(e),n),children:t});Pe.displayName="Topbar.Right";const Re=({children:e,className:t})=>(0,j.jsx)("div",{className:Se("flex items-center [&>svg]:block h-full",t),children:e});function Ue(){return"undefined"!=typeof window}function Be(e){return Ve(e)?(e.nodeName||"").toLowerCase():"#document"}function Fe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Qe(e){var t;return null==(t=(Ve(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ve(e){return!!Ue()&&(e instanceof Node||e instanceof Fe(e).Node)}function Ye(e){return!!Ue()&&(e instanceof Element||e instanceof Fe(e).Element)}function Ze(e){return!!Ue()&&(e instanceof HTMLElement||e instanceof Fe(e).HTMLElement)}function We(e){return!(!Ue()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Fe(e).ShadowRoot)}function Ge(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function He(e){return/^(table|td|th)$/.test(Be(e))}function $e(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}Re.displayName="Topbar.Item",Le.Left=Oe,Le.Middle=ze,Le.Right=Pe,Le.Item=Re;const Xe=/transform|translate|scale|rotate|perspective|filter/,qe=/paint|layout|strict|content/,Je=e=>!!e&&"none"!==e;let Ke;function et(e){const t=Ye(e)?rt(e):e;return Je(t.transform)||Je(t.translate)||Je(t.scale)||Je(t.rotate)||Je(t.perspective)||!tt()&&(Je(t.backdropFilter)||Je(t.filter))||Xe.test(t.willChange||"")||qe.test(t.contain||"")}function tt(){return null==Ke&&(Ke="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ke}function nt(e){return/^(html|body|#document)$/.test(Be(e))}function rt(e){return Fe(e).getComputedStyle(e)}function ot(e){return Ye(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function at(e){if("html"===Be(e))return e;const t=e.assignedSlot||e.parentNode||We(e)&&e.host||Qe(e);return We(t)?t.host:t}function it(e){const t=at(e);return nt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ze(t)&&Ge(t)?t:it(t)}function st(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=it(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=Fe(o);if(a){const e=lt(i);return t.concat(i,i.visualViewport||[],Ge(o)?o:[],e&&n?st(e):[])}return t.concat(o,st(o,[],n))}function lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ct(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function ut(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&We(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function dt(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function ft(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function pt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(gt()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function mt(e){return!ft().includes("jsdom/")&&(!gt()&&0===e.width&&0===e.height||gt()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function ht(){return/apple/i.test(navigator.vendor)}function gt(){const e=/android/i;return e.test(dt())||e.test(ft())}function wt(){return dt().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function yt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function bt(e){return(null==e?void 0:e.ownerDocument)||document}function vt(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function xt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Nt(e){return Ze(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Et(e){e.preventDefault(),e.stopPropagation()}function _t(e){return!!e&&"combobox"===e.getAttribute("role")&&Nt(e)}const Mt=Math.min,It=Math.max,St=Math.round,kt=Math.floor,Dt=e=>({x:e,y:e}),Ct={left:"right",right:"left",bottom:"top",top:"bottom"};function jt(e,t,n){return It(e,Mt(t,n))}function At(e,t){return"function"==typeof e?e(t):e}function Tt(e){return e.split("-")[0]}function Lt(e){return e.split("-")[1]}function Ot(e){return"x"===e?"y":"x"}function zt(e){return"y"===e?"height":"width"}function Pt(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Rt(e){return Ot(Pt(e))}function Ut(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Bt=["left","right"],Ft=["right","left"],Qt=["top","bottom"],Vt=["bottom","top"];function Yt(e){const t=Tt(e);return Ct[t]+e.slice(t.length)}function Zt(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 Wt(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}}var Gt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),Ht="undefined"==typeof Element,$t=Ht?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Xt=!Ht&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},qt=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):qt(e.parentNode))},Jt=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var a=o.shift();if(!qt(a,!1))if("SLOT"===a.tagName){var i=a.assignedElements(),s=i.length?i:a.children,l=Jt(s,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{$t.call(a,Gt)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),u=!qt(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&u){var d=Jt(!0===c?a.children:c.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:a,candidates:d})}else o.unshift.apply(o,a.children)}}return r},Kt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},en=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Kt(e)?0:e.tabIndex},tn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},nn=function(e){return"INPUT"===e.tagName},rn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},on=function(e,t){return!(t.disabled||function(e){return nn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=$t.call(e,"details>summary:first-of-type")?e.parentElement:e;if($t.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return rn(e)}else{if("function"==typeof r){for(var a=e;e;){var i=e.parentElement,s=Xt(e);if(i&&!i.shadowRoot&&!0===r(i))return rn(e);e=e.assignedSlot?e.assignedSlot:i||s===e.ownerDocument?i:s.host}e=a}if(function(e){var t,n,r,o,a=e&&Xt(e),i=null===(t=a)||void 0===t?void 0:t.host,s=!1;if(a&&a!==e)for(s=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&i;){var l,c,u;s=!(null===(c=i=null===(l=a=Xt(i))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(i))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!$t.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},an=function(e,t){return!(function(e){return function(e){return nn(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Xt(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||en(t)<0||!on(e,t))},sn=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ln=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,a=o?e.scopeParent:e,i=function(e,t){var n=en(e);return n<0&&t&&!Kt(e)?0:n}(a,o),s=o?ln(e.candidates):a;0===i?o?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:i,item:e,isScope:o,content:s})}),n.sort(tn).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},cn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Jt([e],t.includeContainer,{filter:an.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:sn}):function(e,t,n){if(qt(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Gt));return t&&$t.call(e,Gt)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,an.bind(null,t)),ln(n)},un=n(5795);function dn(e,t,n){let{reference:r,floating:o}=e;const a=Pt(t),i=Rt(t),s=zt(i),l=Tt(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Lt(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function fn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=At(t,e),m=Zt(p),h=s[f?"floating"===d?"reference":"floating":d],g=Wt(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),w="floating"===d?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},v=Wt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:l}):w);return{top:(g.top-v.top+m.top)/b.y,bottom:(v.bottom-g.bottom+m.bottom)/b.y,left:(g.left-v.left+m.left)/b.x,right:(v.right-g.right+m.right)/b.x}}const pn=new Set(["left","top"]);function mn(e){const t=rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ze(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=St(n)!==a||St(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function hn(e){return Ye(e)?e:e.contextElement}function gn(e){const t=hn(e);if(!Ze(t))return Dt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=mn(t);let i=(a?St(n.width):n.width)/r,s=(a?St(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const wn=Dt(0);function yn(e){const t=Fe(e);return tt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wn}function bn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=hn(e);let i=Dt(1);t&&(r?Ye(r)&&(i=gn(r)):i=gn(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Fe(e))&&t}(a,n,r)?yn(a):Dt(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=Fe(a),t=r&&Ye(r)?Fe(r):r;let n=e,o=lt(n);for(;o&&r&&t!==n;){const e=gn(o),t=o.getBoundingClientRect(),r=rt(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=Fe(o),o=lt(n)}}return Wt({width:u,height:d,x:l,y:c})}function vn(e,t){const n=ot(e).scrollLeft;return t?t.left+n:bn(Qe(e)).left+n}function xn(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vn(e,n),y:n.top+t.scrollTop}}function Nn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Fe(e),r=Qe(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=tt();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=vn(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,i=Math.abs(r.clientWidth-t.clientWidth-o);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Qe(e),n=ot(e),r=e.ownerDocument.body,o=It(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=It(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+vn(e);const s=-n.scrollTop;return"rtl"===rt(r).direction&&(i+=It(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(Qe(e));else if(Ye(t))r=function(e,t){const n=bn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=Ze(e)?gn(e):Dt(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=yn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wt(r)}function En(e,t){const n=at(e);return!(n===t||!Ye(n)||nt(n))&&("fixed"===rt(n).position||En(n,t))}function Mn(e,t,n){const r=Ze(t),o=Qe(t),a="fixed"===n,i=bn(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Dt(0);function c(){l.x=vn(o)}if(r||!r&&!a)if(("body"!==Be(t)||Ge(o))&&(s=ot(t)),r){const e=bn(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!r&&o&&c();const u=!o||r||a?Dt(0):xn(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function In(e){return"static"===rt(e).position}function Sn(e,t){if(!Ze(e)||"fixed"===rt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Qe(e)===n&&(n=n.ownerDocument.body),n}function kn(e,t){const n=Fe(e);if($e(e))return n;if(!Ze(e)){let t=at(e);for(;t&&!nt(t);){if(Ye(t)&&!In(t))return t;t=at(t)}return n}let r=Sn(e,t);for(;r&&He(r)&&In(r);)r=Sn(r,t);return r&&nt(r)&&In(r)&&!et(r)?n:r||function(e){let t=at(e);for(;Ze(t)&&!nt(t);){if(et(t))return t;if($e(t))return null;t=at(t)}return null}(e)||n}const Dn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=Qe(r),s=!!t&&$e(t.floating);if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Dt(1);const u=Dt(0),d=Ze(r);if((d||!d&&!a)&&(("body"!==Be(r)||Ge(i))&&(l=ot(r)),d)){const e=bn(r);c=gn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||a?Dt(0):xn(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Qe,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?$e(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=st(e,[],!1).filter(e=>Ye(e)&&"body"!==Be(e)),o=null;const a="fixed"===rt(e).position;let i=a?at(e):e;for(;Ye(i)&&!nt(i);){const t=rt(i),n=et(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||Ge(i)&&!n&&En(e,i))?r=r.filter(e=>e!==i):o=t,i=at(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=Nn(t,a[0],o);let s=i.top,l=i.right,c=i.bottom,u=i.left;for(let e=1;e<a.length;e++){const n=Nn(t,a[e],o);s=It(n.top,s),l=Mt(n.right,l),c=Mt(n.bottom,c),u=It(n.left,u)}return{width:l-u,height:c-s,x:u,y:s}},getOffsetParent:kn,getElementRects:async function(e){const t=this.getOffsetParent||kn,n=this.getDimensions,r=await n(e.floating);return{reference:Mn(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}=mn(e);return{width:t,height:n}},getScale:gn,isElement:Ye,isRTL:function(e){return"rtl"===rt(e).direction}};function Cn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=hn(e),u=o||a?[...c?st(c):[],...t?st(t):[]]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=Qe(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const m={rootMargin:-kt(d)+"px "+-kt(o.clientWidth-(u+f))+"px "+-kt(o.clientHeight-(d+p))+"px "+-kt(u)+"px",threshold:It(0,Mt(1,l))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||Cn(c,e.getBoundingClientRect())||i(),h=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),a}(c,n):null;let f,p=-1,m=null;i&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),t&&m.observe(t));let h=l?bn(e):null;return l&&function t(){const r=bn(e);h&&!Cn(h,r)&&n(),h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const An=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=At(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const w=Tt(o),y=Pt(s),b=Tt(s)===s,v=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!h?[Yt(s)]:function(e){const t=Yt(e);return[Ut(e),t,Ut(t)]}(s)),N="none"!==m;!f&&N&&x.push(...function(e,t,n,r){const o=Lt(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Ft:Bt:t?Bt:Ft;case"left":case"right":return t?Qt:Vt;default:return[]}}(Tt(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Ut)))),a}(s,h,m,v));const E=[s,...x],_=await l.detectOverflow(t,g),M=[];let I=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&M.push(_[w]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Lt(e),o=Rt(e),a=zt(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Yt(i)),[i,Yt(i)]}(o,i,v);M.push(_[e[0]],_[e[1]])}if(I=[...I,{placement:o,overflows:M}],!M.every(e=>e<=0)){var S,k;const e=((null==(S=a.flip)?void 0:S.index)||0)+1,t=E[e];if(t&&("alignment"!==d||y===Pt(t)||I.every(e=>Pt(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(k=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!n)switch(p){case"bestFit":{var D;const e=null==(D=I.filter(e=>{if(N){const t=Pt(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:D[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Tn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=At(e,t)||{};if(null==c)return{};const d=Zt(u),f={x:n,y:r},p=Rt(o),m=zt(p),h=await i.getDimensions(c),g="y"===p,w=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",v=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],N=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let E=N?N[b]:0;E&&await(null==i.isElement?void 0:i.isElement(N))||(E=s.floating[b]||a.floating[m]);const _=v/2-x/2,M=E/2-h[m]/2-1,I=Mt(d[w],M),S=Mt(d[y],M),k=I,D=E-h[m]-S,C=E/2-h[m]/2+_,j=jt(k,C,D),A=!l.arrow&&null!=Lt(o)&&C!==j&&a.reference[m]/2-(C<k?I:S)-h[m]/2<0,T=A?C<k?C-k:C-D:0;return{[p]:f[p]+T,data:{[p]:j,centerOffset:C-j-T,...A&&{alignmentOffset:T}},reset:A}}}),Ln=(e,t,n)=>{const r=new Map,o={platform:Dn,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=i.detectOverflow?i:{...i,detectOverflow:fn},l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=dn(c,r,l),f=r,p=0;const m={};for(let n=0;n<a.length;n++){const h=a[n];if(!h)continue;const{name:g,fn:w}=h,{x:y,y:b,data:v,reset:x}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=b?b:d,m[g]={...m[g],...v},x&&p<50&&(p++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(c=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=dn(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}})(e,t,{...o,platform:a})};var On="undefined"!=typeof document?s.useLayoutEffect:function(){};function zn(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(!zn(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||zn(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Pn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rn(e,t){const n=Pn(e);return Math.round(t*n)/n}function Un(e){const t=s.useRef(e);return On(()=>{t.current=e}),t}const Bn=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=Tt(n),s=Lt(n),l="y"===Pt(n),c=pn.has(i)?-1:1,u=a&&l?-1:1,d=At(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fn=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:a}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=At(e,t),u={x:n,y:r},d=await a.detectOverflow(t,c),f=Pt(Tt(o)),p=Ot(f);let m=u[p],h=u[f];if(i){const e="y"===p?"bottom":"right";m=jt(m+d["y"===p?"top":"left"],m,m-d[e])}if(s){const e="y"===f?"bottom":"right";h=jt(h+d["y"===f?"top":"left"],h,h-d[e])}const g=l.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[f]:s}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qn=(e,t)=>{const n=An(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vn=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=At(e,t),u=await i.detectOverflow(t,c),d=Tt(o),f=Lt(o),p="y"===Pt(o),{width:m,height:h}=a.floating;let g,w;"top"===d||"bottom"===d?(g=d,w=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,g="end"===f?"top":"bottom");const y=h-u.top-u.bottom,b=m-u.left-u.right,v=Mt(h-u[g],y),x=Mt(m-u[w],b),N=!t.middlewareData.shift;let E=v,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),N&&!f){const e=It(u.left,0),t=It(u.right,0),n=It(u.top,0),r=It(u.bottom,0);p?_=m-2*(0!==e||0!==t?e+t:It(u.left,u.right)):E=h-2*(0!==n||0!==r?n+r:It(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:E});const M=await i.getDimensions(s.floating);return m!==M.width||h!==M.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{const n=(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?Tn({element:n.current,padding:r}).fn(t):{}:n?Tn({element:n,padding:r}).fn(t):{}}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn={...l},Wn=Zn.useInsertionEffect||(e=>e());function Gn(e){const t=s.useRef(()=>{});return Wn(()=>{t.current=e}),s.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}const Hn="ArrowUp",$n="ArrowDown",Xn="ArrowLeft",qn="ArrowRight";function Jn(e,t,n){return Math.floor(e/t)!==n}function Kn(e,t){return t<0||t>=e.current.length}function er(e,t){return nr(e,{disabledIndices:t})}function tr(e,t){return nr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nr(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:a=1}=void 0===t?{}:t;const i=e.current;let s=n;do{s+=r?-a:a}while(s>=0&&s<=i.length-1&&ar(i,s,o));return s}function rr(e,t,n,r,o){if(-1===e)return-1;const a=n.indexOf(e),i=t[e];switch(o){case"tl":return a;case"tr":return i?a+i.width-1:a;case"bl":return i?a+(i.height-1)*r:a;case"br":return n.lastIndexOf(e)}}function or(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function ar(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}var ir="undefined"!=typeof document?s.useLayoutEffect:s.useEffect;function sr(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const lr=s.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function cr(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,a]=s.useState(()=>new Map),i=s.useCallback(e=>{a(t=>new Map(t).set(e,null))},[]),l=s.useCallback(e=>{a(t=>{const n=new Map(t);return n.delete(e),n})},[]);return ir(()=>{const e=new Map(o);Array.from(e.keys()).sort(sr).forEach((t,n)=>{e.set(t,n)}),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||a(e)},[o]),s.createElement(lr.Provider,{value:s.useMemo(()=>({register:i,unregister:l,map:o,elementsRef:n,labelsRef:r}),[i,l,o,n,r])},t)}function ur(){return ur=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},ur.apply(this,arguments)}let dr=!1,fr=0;const pr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fr++,mr=Zn.useId||function(){const[e,t]=s.useState(()=>dr?pr():void 0);return ir(()=>{null==e&&t(pr())},[]),s.useEffect(()=>{dr=!0},[]),e},hr=s.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:a}},width:i=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:p,style:{transform:m,...h}={},...g}=e,w=mr(),[y,b]=s.useState(!1);if(ir(()=>{r&&"rtl"===rt(r).direction&&b(!0)},[r]),!r)return null;const[v,x]=n.split("-"),N="top"===v||"bottom"===v;let E=d;(N&&null!=a&&a.x||!N&&null!=a&&a.y)&&(E=null);const _=2*u,M=_/2,I=i/2*(c/-8+1),S=l/2*c/4,k=!!p,D=E&&"end"===x?"bottom":"top";let C=E&&"end"===x?"right":"left";E&&y&&(C="end"===x?"left":"right");const j=null!=(null==o?void 0:o.x)?E||o.x:"",A=null!=(null==o?void 0:o.y)?E||o.y:"",T=p||"M0,0 H"+i+" L"+(i-I)+","+(l-S)+" Q"+i/2+","+l+" "+I+","+(l-S)+" Z",L={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[v];return s.createElement("svg",ur({},g,{"aria-hidden":!0,ref:t,width:k?i:i+_,height:i,viewBox:"0 0 "+i+" "+(l>i?l:i),style:{position:"absolute",pointerEvents:"none",[C]:j,[D]:A,[v]:N||k?"100%":"calc(100% - "+_/2+"px)",transform:[L,m].filter(e=>!!e).join(" "),...h}}),_>0&&s.createElement("path",{clipPath:"url(#"+w+")",fill:"none",stroke:f,strokeWidth:_+(p?0:1),d:T}),s.createElement("path",{stroke:_&&!p?g.fill:"none",d:T}),s.createElement("clipPath",{id:w},s.createElement("rect",{x:-M,y:M*(k?-1:1),width:i+_,height:i})))});const gr=s.createContext(null),wr=s.createContext(null),yr=()=>{var e;return(null==(e=s.useContext(gr))?void 0:e.id)||null},br=()=>s.useContext(wr);function vr(e){return"data-floating-ui-"+e}function xr(e){const t=(0,s.useRef)(e);return ir(()=>{t.current=e}),t}const Nr=vr("safe-polygon");function Er(e,t,n){return n&&!yt(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let _r=0;function Mr(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(_r);const a=()=>null==e?void 0:e.focus({preventScroll:n});o?a():_r=requestAnimationFrame(a)}function Ir(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(r);return n}let Sr=new WeakMap,kr=new WeakSet,Dr={},Cr=0;const jr=e=>e&&(e.host||jr(e.parentNode));function Ar(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=bt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,i=(s=t,e.map(e=>{if(s.contains(e))return e;const t=jr(e);return s.contains(t)?t:null}).filter(e=>null!=e));var s;const l=new Set,c=new Set(i),u=[];Dr[o]||(Dr[o]=new WeakMap);const d=Dr[o];return i.forEach(function e(t){t&&!l.has(t)&&(l.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!c.has(t)&&[].forEach.call(t.children,t=>{if("script"!==Be(t))if(l.has(t))e(t);else{const e=a?t.getAttribute(a):null,n=null!==e&&"false"!==e,r=(Sr.get(t)||0)+1,i=(d.get(t)||0)+1;Sr.set(t,r),d.set(t,i),u.push(t),1===r&&n&&kr.add(t),1===i&&t.setAttribute(o,""),!n&&a&&t.setAttribute(a,"true")}})}(t),l.clear(),Cr++,()=>{u.forEach(e=>{const t=(Sr.get(e)||0)-1,n=(d.get(e)||0)-1;Sr.set(e,t),d.set(e,n),t||(!kr.has(e)&&a&&e.removeAttribute(a),kr.delete(e)),n||e.removeAttribute(o)}),Cr--,Cr||(Sr=new WeakMap,Sr=new WeakMap,kr=new WeakSet,Dr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Tr=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Lr(e,t){const n=cn(e,Tr());"prev"===t&&n.reverse();const r=n.indexOf(ct(bt(e)));return n.slice(r+1)[0]}function Or(){return Lr(document.body,"next")}function zr(){return Lr(document.body,"prev")}function Pr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ut(n,r)}function Rr(e){cn(e,Tr()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Ur(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const Br={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Fr(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const Qr=s.forwardRef(function(e,t){const[n,r]=s.useState();ir(()=>(ht()&&r("button"),document.addEventListener("keydown",Fr),()=>{document.removeEventListener("keydown",Fr)}),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[vr("focus-guard")]:"",style:Br};return s.createElement("span",ur({},e,o))}),Vr=s.createContext(null),Yr=vr("portal");function Zr(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,a=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=mr(),o=Wr(),[a,i]=s.useState(null),l=s.useRef(null);return ir(()=>()=>{null==a||a.remove(),queueMicrotask(()=>{l.current=null})},[a]),ir(()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(Yr,""),e.appendChild(n),l.current=n,i(n)},[t,r]),ir(()=>{if(null===n)return;if(!r)return;if(l.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!Ye(e)&&(e=e.current),e=e||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,e.appendChild(a));const s=document.createElement("div");s.id=r,s.setAttribute(Yr,""),e=a||e,e.appendChild(s),l.current=s,i(s)},[t,n,r,o]),a}({id:n,root:r}),[i,l]=s.useState(null),c=s.useRef(null),u=s.useRef(null),d=s.useRef(null),f=s.useRef(null),p=null==i?void 0:i.modal,m=null==i?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!(!r&&!a);return s.useEffect(()=>{if(a&&o&&!p)return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){a&&Pr(e)&&("focusin"===e.type?Ur:Rr)(a)}},[a,o,p]),s.useEffect(()=>{a&&(m||Ur(a))},[m,a]),s.createElement(Vr.Provider,{value:s.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:a,setFocusManagerState:l}),[o,a])},h&&a&&s.createElement(Qr,{"data-type":"outside",ref:c,onFocus:e=>{if(Pr(e,a)){var t;null==(t=d.current)||t.focus()}else{const e=zr()||(null==i?void 0:i.refs.domReference.current);null==e||e.focus()}}}),h&&a&&s.createElement("span",{"aria-owns":a.id,style:Br}),a&&un.createPortal(t,a),h&&a&&s.createElement(Qr,{"data-type":"outside",ref:u,onFocus:e=>{if(Pr(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Or()||(null==i?void 0:i.refs.domReference.current);null==t||t.focus(),(null==i?void 0:i.closeOnFocusOut)&&(null==i||i.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Wr=()=>s.useContext(Vr),Gr="data-floating-ui-focusable";function Hr(e){return e?e.hasAttribute(Gr)?e:e.querySelector("["+Gr+"]")||e:null}let $r=[];function Xr(e){$r=$r.filter(e=>e.isConnected);let t=e;if(t&&"body"!==Be(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==$t.call(e,Gt)&&an(t,e)}(t,Tr())){const e=cn(t,Tr())[0];e&&(t=e)}$r.push(t),$r.length>20&&($r=$r.slice(-20))}}function qr(){return $r.slice().reverse().find(e=>e.isConnected)}const Jr=s.forwardRef(function(e,t){return s.createElement("button",ur({},e,{type:"button",ref:t,tabIndex:-1,style:Br}))});function Kr(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:a=!0,initialFocus:i=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:p,refs:m,nodeId:h,onOpenChange:g,events:w,dataRef:y,floatingId:b,elements:{domReference:v,floating:x}}=t,N="number"==typeof i&&i<0,E=_t(v)&&N,_="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||a,M=xr(o),I=xr(i),S=xr(l),k=br(),D=Wr(),C=s.useRef(null),j=s.useRef(null),A=s.useRef(!1),T=s.useRef(!1),L=s.useRef(-1),O=null!=D,z=Hr(x),P=Gn(function(e){return void 0===e&&(e=z),e?cn(e,Tr()):[]}),R=Gn(e=>{const t=P(e);return M.current.map(e=>v&&"reference"===e?v:z&&"floating"===e?z:t).filter(Boolean).flat()});function U(e){return!r&&d&&u?s.createElement(Jr,{ref:"start"===e?C:j,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}s.useEffect(()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){ut(z,ct(bt(z)))&&0===P().length&&!E&&Et(e);const t=R(),n=xt(e);"reference"===M.current[0]&&n===v&&(Et(e),e.shiftKey?Mr(t[t.length-1]):Mr(t[1])),"floating"===M.current[1]&&n===z&&e.shiftKey&&(Et(e),Mr(t[0]))}}const t=bt(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,v,z,u,M,E,P,R]),s.useEffect(()=>{if(!r&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=xt(e),n=P().indexOf(t);-1!==n&&(L.current=n)}},[r,x,P]),s.useEffect(()=>{if(!r&&f)return x&&Ze(v)?(v.addEventListener("focusout",t),v.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{v.removeEventListener("focusout",t),v.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){T.current=!0,setTimeout(()=>{T.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(ut(v,t)||ut(x,t)||ut(t,x)||ut(null==D?void 0:D.portalNode,t)||null!=t&&t.hasAttribute(vr("focus-guard"))||k&&(Ir(k.nodesRef.current,h).find(e=>{var n,r;return ut(null==(n=e.context)?void 0:n.elements.floating,t)||ut(null==(r=e.context)?void 0:r.elements.domReference,t)})||function(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(k.nodesRef.current,h).find(e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(c&&n&&ct(bt(z))===bt(z).body){Ze(z)&&z.focus();const e=L.current,t=P(),n=t[e]||t[t.length-1]||z;Ze(n)&&n.focus()}!E&&u||!t||!n||T.current||t===qr()||(A.current=!0,g(!1,e,"focus-out"))})}},[r,v,x,z,u,h,k,D,g,f,c,P,E]),s.useEffect(()=>{var e;if(r)return;const t=Array.from((null==D||null==(e=D.portalNode)?void 0:e.querySelectorAll("["+vr("portal")+"]"))||[]);if(x){const e=[x,...t,C.current,j.current,M.current.includes("reference")||E?v:null].filter(e=>null!=e),n=u||E?Ar(e,_,!_):Ar(e);return()=>{n()}}},[r,v,x,u,M,D,E,_]),ir(()=>{if(r||!Ze(z))return;const e=ct(bt(z));queueMicrotask(()=>{const t=R(z),n=I.current,r=("number"==typeof n?t[n]:n.current)||z,o=ut(z,e);N||o||!p||Mr(r,{preventScroll:r===z})})},[r,p,z,N,R,I]),ir(()=>{if(r||!z)return;let e=!1;const t=bt(z),n=ct(t);let o=y.current.openEvent;function a(t){let{open:n,reason:r,event:a,nested:i}=t;n&&(o=a),"escape-key"===r&&m.domReference.current&&Xr(m.domReference.current),"hover"===r&&"mouseleave"===a.type&&(A.current=!0),"outside-press"===r&&(i?(A.current=!1,e=!0):A.current=!(pt(a)||mt(a)))}Xr(n),w.on("openchange",a);const i=t.createElement("span");return i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,Br),O&&v&&v.insertAdjacentElement("afterend",i),()=>{w.off("openchange",a);const n=ct(t),r=ut(x,n)||k&&Ir(k.nodesRef.current,h).some(e=>{var t;return ut(null==(t=e.context)?void 0:t.elements.floating,n)});(r||o&&["click","mousedown"].includes(o.type))&&m.domReference.current&&Xr(m.domReference.current);const s="boolean"==typeof S.current?qr()||i:S.current.current||i;queueMicrotask(()=>{S.current&&!A.current&&Ze(s)&&(s===n||n===t.body||r)&&s.focus({preventScroll:e}),i.remove()})}},[r,x,z,S,y,m,w,k,h,O,v]),s.useEffect(()=>{queueMicrotask(()=>{A.current=!1})},[r]),ir(()=>{if(!r&&D)return D.setFocusManagerState({modal:u,closeOnFocusOut:f,open:p,onOpenChange:g,refs:m}),()=>{D.setFocusManagerState(null)}},[r,D,u,p,g,m,f]),ir(()=>{if(r)return;if(!z)return;if("function"!=typeof MutationObserver)return;if(N)return;const e=()=>{const e=z.getAttribute("tabindex"),t=P(),n=ct(bt(x)),r=t.indexOf(n);-1!==r&&(L.current=r),M.current.includes("floating")||n!==m.domReference.current&&0===t.length?"0"!==e&&z.setAttribute("tabindex","0"):"-1"!==e&&z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,x,z,m,M,P,N]);const B=!r&&_&&(!u||!E)&&(O||u);return s.createElement(s.Fragment,null,B&&s.createElement(Qr,{"data-type":"inside",ref:null==D?void 0:D.beforeInsideRef,onFocus:e=>{if(u){const e=R();Mr("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=D&&D.preserveTabOrder&&D.portalNode)if(A.current=!1,Pr(e,D.portalNode)){const e=Or()||v;null==e||e.focus()}else{var t;null==(t=D.beforeOutsideRef.current)||t.focus()}}}),!E&&U("start"),n,U("end"),B&&s.createElement(Qr,{"data-type":"inside",ref:null==D?void 0:D.afterInsideRef,onFocus:e=>{if(u)Mr(R()[0]);else if(null!=D&&D.preserveTabOrder&&D.portalNode)if(f&&(A.current=!0),Pr(e,D.portalNode)){const e=zr()||v;null==e||e.focus()}else{var t;null==(t=D.afterOutsideRef.current)||t.focus()}}}))}let eo=0,to=()=>{};const no=s.forwardRef(function(e,t){const{lockScroll:n=!1,...r}=e;return ir(()=>{if(n)return eo++,1===eo&&(to=function(){const e=/iP(hone|ad|od)|iOS/.test(dt()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,a=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var i,s;const e=(null==(i=window.visualViewport)?void 0:i.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,a))}}()),()=>{eo--,0===eo&&to()}},[n]),s.createElement("div",ur({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function ro(e){return Ze(e.target)&&"BUTTON"===e.target.tagName}function oo(e){return Nt(e)}function ao(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:a}}=e,{enabled:i=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=t,p=s.useRef(),m=s.useRef(!1),h=s.useMemo(()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){const t=p.current;0===e.button&&"click"!==l&&(yt(t,!0)&&u||(!n||!c||o.current.openEvent&&f&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=p.current;"mousedown"===l&&p.current?p.current=void 0:yt(t,!0)&&u||(!n||!c||o.current.openEvent&&f&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){p.current=void 0,e.defaultPrevented||!d||ro(e)||(" "!==e.key||oo(a)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||ro(e)||oo(a)||" "===e.key&&m.current&&(m.current=!1,r(!n||!c,e.nativeEvent,"click"))}}),[o,a,l,u,d,r,n,f,c]);return s.useMemo(()=>i?{reference:h}:{},[i,h])}const io={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},so={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},lo=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function co(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:a}=e,{enabled:i=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:h}=t,g=br(),w=Gn("function"==typeof c?c:()=>!1),y="function"==typeof c?w:c,b=s.useRef(!1),v=s.useRef(!1),{escapeKey:x,outsidePress:N}=lo(m),{escapeKey:E,outsidePress:_}=lo(h),M=s.useRef(!1),I=Gn(e=>{var t;if(!n||!i||!l||"Escape"!==e.key)return;if(M.current)return;const o=null==(t=a.current.floatingContext)?void 0:t.nodeId,s=g?Ir(g.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),s.length>0)){let e=!0;if(s.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),S=Gn(e=>{var t;const n=()=>{var t;I(e),null==(t=xt(e))||t.removeEventListener("keydown",n)};null==(t=xt(e))||t.addEventListener("keydown",n)}),k=Gn(e=>{var t;const n=b.current;b.current=!1;const i=v.current;if(v.current=!1,"click"===u&&i)return;if(n)return;if("function"==typeof y&&!y(e))return;const s=xt(e),l="["+vr("inert")+"]",c=bt(o.floating).querySelectorAll(l);let d=Ye(s)?s:null;for(;d&&!nt(d);){const e=at(d);if(nt(e)||!Ye(e))break;d=e}if(c.length&&Ye(s)&&!s.matches("html,body")&&!ut(s,o.floating)&&Array.from(c).every(e=>!ut(d,e)))return;if(Ze(s)&&j){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let r=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===rt(s).direction&&(r=e.offsetX<=s.offsetWidth-s.clientWidth),r||t&&e.offsetY>s.clientHeight)return}const f=null==(t=a.current.floatingContext)?void 0:t.nodeId,p=g&&Ir(g.nodesRef.current,f).some(t=>{var n;return vt(e,null==(n=t.context)?void 0:n.elements.floating)});if(vt(e,o.floating)||vt(e,o.domReference)||p)return;const m=g?Ir(g.nodesRef.current,f):[];if(m.length>0){let e=!0;if(m.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),D=Gn(e=>{var t;const n=()=>{var t;k(e),null==(t=xt(e))||t.removeEventListener(u,n)};null==(t=xt(e))||t.addEventListener(u,n)});s.useEffect(()=>{if(!n||!i)return;a.current.__escapeKeyBubbles=x,a.current.__outsidePressBubbles=N;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function s(){window.clearTimeout(e),M.current=!0}function c(){e=window.setTimeout(()=>{M.current=!1},tt()?5:0)}const d=bt(o.floating);l&&(d.addEventListener("keydown",E?S:I,E),d.addEventListener("compositionstart",s),d.addEventListener("compositionend",c)),y&&d.addEventListener(u,_?D:k,_);let f=[];return p&&(Ye(o.domReference)&&(f=st(o.domReference)),Ye(o.floating)&&(f=f.concat(st(o.floating))),!Ye(o.reference)&&o.reference&&o.reference.contextElement&&(f=f.concat(st(o.reference.contextElement)))),f=f.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),f.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{l&&(d.removeEventListener("keydown",E?S:I,E),d.removeEventListener("compositionstart",s),d.removeEventListener("compositionend",c)),y&&d.removeEventListener(u,_?D:k,_),f.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[a,o,l,y,u,n,r,p,i,x,N,I,E,S,k,_,D]),s.useEffect(()=>{b.current=!1},[y,u]);const C=s.useMemo(()=>({onKeyDown:I,[io[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}}),[I,r,d,f]),j=s.useMemo(()=>({onKeyDown:I,onMouseDown(){v.current=!0},onMouseUp(){v.current=!0},[so[u]]:()=>{b.current=!0}}),[I,u]);return s.useMemo(()=>i?{reference:C,floating:j}:{},[i,C,j])}function uo(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=mr(),a=s.useRef({}),[i]=s.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),l=null!=yr(),[c,u]=s.useState(r.reference),d=Gn((e,t,r)=>{a.current.openEvent=e?t:void 0,i.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)}),f=s.useMemo(()=>({setPositionReference:u}),[]),p=s.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return s.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:p,events:i,floatingId:o,refs:f}),[t,d,p,i,o,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[a,i]=s.useState(null),[l,c]=s.useState(null),u=(null==o?void 0:o.domReference)||a,d=s.useRef(null),f=br();ir(()=>{u&&(d.current=u)},[u]);const p=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=s.useState(r);zn(p,r)||m(r);const[h,g]=s.useState(null),[w,y]=s.useState(null),b=s.useCallback(e=>{e!==E.current&&(E.current=e,g(e))},[]),v=s.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=a||h,N=i||w,E=s.useRef(null),_=s.useRef(null),M=s.useRef(d),I=null!=c,S=Un(c),k=Un(o),D=Un(u),C=s.useCallback(()=>{if(!E.current||!_.current)return;const e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),Ln(E.current,_.current,e).then(e=>{const t={...e,isPositioned:!1!==D.current};j.current&&!zn(M.current,t)&&(M.current=t,un.flushSync(()=>{f(t)}))})},[p,t,n,k,D]);On(()=>{!1===u&&M.current.isPositioned&&(M.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const j=s.useRef(!1);On(()=>(j.current=!0,()=>{j.current=!1}),[]),On(()=>{if(x&&(E.current=x),N&&(_.current=N),x&&N){if(S.current)return S.current(x,N,C);C()}},[x,N,C,S,I]);const A=s.useMemo(()=>({reference:E,floating:_,setReference:b,setFloating:v}),[b,v]),T=s.useMemo(()=>({reference:x,floating:N}),[x,N]),L=s.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Rn(T.floating,d.x),r=Rn(T.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...Pn(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,T.floating,d.x,d.y]);return s.useMemo(()=>({...d,update:C,refs:A,elements:T,floatingStyles:L}),[d,C,A,T,L])}({...e,elements:{...o,...l&&{reference:l}}}),m=s.useCallback(e=>{const t=Ye(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),p.refs.setReference(t)},[p.refs]),h=s.useCallback(e=>{(Ye(e)||null===e)&&(d.current=e,i(e)),(Ye(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!Ye(e))&&p.refs.setReference(e)},[p.refs]),g=s.useMemo(()=>({...p.refs,setReference:h,setPositionReference:m,domReference:d}),[p.refs,h,m]),w=s.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),y=s.useMemo(()=>({...p,...r,refs:g,elements:w,nodeId:t}),[p,g,w,t,r]);return ir(()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),s.useMemo(()=>({...p,context:y,refs:g,elements:w}),[p,g,w,y])}const fo="active",po="selected";function mo(e,t,n){const r=new Map,o="item"===n;let a=e;if(o&&e){const{[fo]:t,[po]:__,...n}=e;a=n}return{..."floating"===n&&{tabIndex:-1,[Gr]:""},...a,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,a]=t;var i;o&&[fo,po].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof a&&(null==(i=r.get(n))||i.push(a),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=a)}),e):e,{})}}function ho(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=s.useCallback(t=>mo(t,e,"reference"),t),a=s.useCallback(t=>mo(t,e,"floating"),n),i=s.useCallback(t=>mo(t,e,"item"),r);return s.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:i}),[o,a,i])}let go=!1;function wo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function yo(e,t){return wo(t,e===Hn||e===$n,e===Xn||e===qn)}function bo(e,t,n){return wo(t,e===$n,n?e===Xn:e===qn)||"Enter"===e||" "===e||""===e}function vo(e,t,n){return wo(t,n?e===qn:e===Xn,e===Hn)}function xo(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:a,activeIndex:i,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:p=!1,rtl:m=!1,virtual:h=!1,focusItemOnOpen:g="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:v="vertical",cols:x=1,scrollItemIntoView:N=!0,virtualItemRef:E,itemSizes:_,dense:M=!1}=t,I=xr(Hr(o.floating)),S=yr(),k=br(),D=Gn(l),C=_t(o.domReference),j=s.useRef(g),A=s.useRef(null!=u?u:-1),T=s.useRef(null),L=s.useRef(!0),O=s.useRef(D),z=s.useRef(!!o.floating),P=s.useRef(n),R=s.useRef(!1),U=s.useRef(!1),B=xr(b),F=xr(n),Q=xr(N),V=xr(u),[Y,Z]=s.useState(),[W,G]=s.useState(),H=Gn(function(e,t,n){function r(e){h?(Z(e.id),null==k||k.events.emit("virtualfocus",e),E&&(E.current=e)):Mr(e,{preventScroll:!0,sync:!(!wt()||!ht())&&(go||R.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame(()=>{const a=e.current[t.current]||o;if(!a)return;o||r(a);const i=Q.current;i&&X&&(n||!L.current)&&(null==a.scrollIntoView||a.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))})});ir(()=>{document.createElement("div").focus({get preventScroll(){return go=!0,!1}})},[]),ir(()=>{c&&(n&&o.floating?j.current&&null!=u&&(U.current=!0,A.current=u,D(u)):z.current&&(A.current=-1,O.current(null)))},[c,n,o.floating,u,D]),ir(()=>{if(c&&n&&o.floating)if(null==i){if(R.current=!1,null!=V.current)return;if(z.current&&(A.current=-1,H(a,A)),(!P.current||!z.current)&&j.current&&(null!=T.current||!0===j.current&&null==T.current)){let e=0;const t=()=>{null==a.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(A.current=null==T.current||bo(T.current,v,m)||p?er(a,B.current):tr(a,B.current),T.current=null,D(A.current))};t()}}else Kn(a,i)||(A.current=i,H(a,A,U.current),U.current=!1)},[c,n,o.floating,i,V,p,a,v,m,D,H,B]),ir(()=>{var e;if(!c||o.floating||!k||h||!z.current)return;const t=k.nodesRef.current,n=null==(e=t.find(e=>e.id===S))||null==(e=e.context)?void 0:e.elements.floating,r=ct(bt(o.floating)),a=t.some(e=>e.context&&ut(e.context.elements.floating,r));n&&!a&&L.current&&n.focus({preventScroll:!0})},[c,o.floating,k,S,h]),ir(()=>{if(c&&k&&h&&!S)return k.events.on("virtualfocus",e),()=>{k.events.off("virtualfocus",e)};function e(e){G(e.id),E&&(E.current=e)}},[c,k,h,S,E]),ir(()=>{O.current=D,z.current=!!o.floating}),ir(()=>{n||(T.current=null)},[n]),ir(()=>{P.current=n},[n]);const $=null!=i,X=s.useMemo(()=>{function e(e){if(!n)return;const t=a.current.indexOf(e);-1!==t&&D(t)}const t={onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...w&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;L.current&&"touch"!==t&&(A.current=-1,H(a,A),D(null),h||Mr(I.current,{preventScroll:!0}))}}};return t},[n,I,H,w,a,D,h]),q=Gn(e=>{if(L.current=!1,R.current=!0,229===e.which)return;if(!F.current&&e.currentTarget===I.current)return;if(p&&vo(e.key,v,m))return Et(e),r(!1,e.nativeEvent,"list-navigation"),void(Ze(o.domReference)&&(h?null==k||k.events.emit("virtualfocus",o.domReference):o.domReference.focus()));const t=A.current,i=er(a,b),s=tr(a,b);if(C||("Home"===e.key&&(Et(e),A.current=i,D(A.current)),"End"===e.key&&(Et(e),A.current=s,D(A.current))),x>1){const t=_||Array.from({length:a.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let o=0;return e.forEach((e,a)=>{let{width:i,height:s}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<s;r++)e.push(o+n+r*t);o%t+i<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=a}),l=!0):o++}}),[...r]}(t,x,M),r=n.findIndex(e=>null!=e&&!ar(a.current,e,b)),o=n.reduce((e,t,n)=>null==t||ar(a.current,t,b)?e:n,-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,rtl:a,cols:i,disabledIndices:s,minIndex:l,maxIndex:c,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===Hn){if(d&&Et(n),-1===u)f=c;else if(f=nr(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:s}),o&&(u-i<l||f<0)){const e=u%i,t=c%i,n=c-(t-e);f=t===e?c:t>e?n:n-i}Kn(e,f)&&(f=u)}if(n.key===$n&&(d&&Et(n),-1===u?f=l:(f=nr(e,{startingIndex:u,amount:i,disabledIndices:s}),o&&u+i>c&&(f=nr(e,{startingIndex:u%i-i,amount:i,disabledIndices:s}))),Kn(e,f)&&(f=u)),"both"===r){const t=kt(u/i);n.key===(a?Xn:qn)&&(d&&Et(n),u%i!==i-1?(f=nr(e,{startingIndex:u,disabledIndices:s}),o&&Jn(f,i,t)&&(f=nr(e,{startingIndex:u-u%i-1,disabledIndices:s}))):o&&(f=nr(e,{startingIndex:u-u%i-1,disabledIndices:s})),Jn(f,i,t)&&(f=u)),n.key===(a?qn:Xn)&&(d&&Et(n),u%i!==0?(f=nr(e,{startingIndex:u,decrement:!0,disabledIndices:s}),o&&Jn(f,i,t)&&(f=nr(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s}))):o&&(f=nr(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s})),Jn(f,i,t)&&(f=u));const r=kt(c/i)===t;Kn(e,f)&&(f=o&&r?n.key===(a?qn:Xn)?c:nr(e,{startingIndex:u-u%i-1,disabledIndices:s}):u)}return f}({current:n.map(e=>null!=e?a.current[e]:null)},{event:e,orientation:v,loop:f,rtl:m,cols:x,disabledIndices:or([...b||a.current.map((e,t)=>ar(a.current,t)?t:void 0),void 0],n),minIndex:r,maxIndex:o,prevIndex:rr(A.current>s?i:A.current,t,n,x,e.key===$n?"bl":e.key===(m?Xn:qn)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(A.current=l,D(A.current)),"both"===v)return}if(yo(e.key,v)){if(Et(e),n&&!h&&ct(e.currentTarget.ownerDocument)===e.currentTarget)return A.current=bo(e.key,v,m)?i:s,void D(A.current);bo(e.key,v,m)?A.current=f?t>=s?d&&t!==a.current.length?-1:i:nr(a,{startingIndex:t,disabledIndices:b}):Math.min(s,nr(a,{startingIndex:t,disabledIndices:b})):A.current=f?t<=i?d&&-1!==t?a.current.length:s:nr(a,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(i,nr(a,{startingIndex:t,decrement:!0,disabledIndices:b})),Kn(a,A.current)?D(null):D(A.current)}}),J=s.useMemo(()=>h&&n&&$&&{"aria-activedescendant":W||Y},[h,n,$,W,Y]),K=s.useMemo(()=>({"aria-orientation":"both"===v?void 0:v,...!_t(o.domReference)&&J,onKeyDown:q,onPointerMove(){L.current=!0}}),[J,q,o.domReference,v]),ee=s.useMemo(()=>{function e(e){"auto"===g&&pt(e.nativeEvent)&&(j.current=!0)}return{...J,onKeyDown(e){L.current=!1;const t=e.key.startsWith("Arrow"),o=["Home","End"].includes(e.key),i=t||o,s=function(e,t,n){return wo(t,n?e===Xn:e===qn,e===$n)}(e.key,v,m),l=vo(e.key,v,m),c=yo(e.key,v),d=(p?s:c)||"Enter"===e.key||""===e.key.trim();if(h&&n){const t=null==k?void 0:k.nodesRef.current.find(e=>null==e.parentId),n=k&&t?function(e,t){let n,r=-1;return function t(o,a){a>r&&(n=o,r=a),Ir(e,o).forEach(e=>{t(e.id,a+1)})}(t,0),e.find(e=>e.id===n)}(k.nodesRef.current,t.id):null;if(i&&n&&E){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||l){var f,g;const r=(null==(f=n.context)?void 0:f.elements.domReference)===e.currentTarget,o=l&&!r?null==(g=n.context)?void 0:g.elements.domReference:s?a.current.find(e=>(null==e?void 0:e.id)===Y):null;o&&(Et(e),o.dispatchEvent(t),G(void 0))}var w;if((c||o)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Et(e),void(null==(w=n.context.elements.domReference)||w.dispatchEvent(t))}return q(e)}(n||y||!t)&&(d&&(T.current=p&&c?null:e.key),p?s&&(Et(e),n?(A.current=er(a,B.current),D(A.current)):r(!0,e.nativeEvent,"list-navigation")):c&&(null!=u&&(A.current=u),Et(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):q(e),n&&D(A.current)))},onFocus(){n&&!h&&D(null)},onPointerDown:function(e){j.current=g,"auto"===g&&mt(e.nativeEvent)&&(j.current=!0)},onMouseDown:e,onClick:e}},[Y,J,q,B,g,a,p,D,r,n,y,v,m,u,k,h,E]);return s.useMemo(()=>c?{reference:ee,floating:K,item:X}:{},[c,ee,K,X])}const No=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Eo(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:a=!0,role:i="dialog"}=t,l=null!=(n=No.get(i))?n:i,c=mr(),u=null!=yr(),d=s.useMemo(()=>"tooltip"===l||"label"===i?{["aria-"+("label"===i?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?o:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===i&&{"aria-autocomplete":"none"},..."combobox"===i&&{"aria-autocomplete":"list"}},[l,o,u,r,c,i]),f=s.useMemo(()=>{const e={id:o,...l&&{role:l}};return"tooltip"===l||"label"===i?e:{...e,..."menu"===l&&{"aria-labelledby":c}}},[l,o,c,i]),p=s.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(i){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}},[o,i]);return s.useMemo(()=>a?{reference:d,floating:f,item:p}:{},[a,d,f,p])}const _o=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Mo(e,t){return"function"==typeof e?e(t):e}function Io(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:a,duration:i=250}=t,l=e.placement,c=l.split("-")[0],u=s.useMemo(()=>({side:c,placement:l}),[c,l]),d="number"==typeof i,f=(d?i:i.open)||0,p=(d?i:i.close)||0,[m,h]=s.useState(()=>({...Mo(a,u),...Mo(n,u)})),{isMounted:g,status:w}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,a=("number"==typeof o?o:o.close)||0,[i,l]=s.useState("unmounted"),c=function(e,t){const[n,r]=s.useState(e);return e&&!n&&r(!0),s.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,a);return c||"close"!==i||l("unmounted"),ir(()=>{if(r){if(n){l("initial");const e=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(e)}}l("close")}},[n,r]),{isMounted:c,status:i}}(e,{duration:i}),y=xr(n),b=xr(r),v=xr(o),x=xr(a);return ir(()=>{const e=Mo(y.current,u),t=Mo(v.current,u),n=Mo(x.current,u),r=Mo(b.current,u)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===w&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===w&&h({transitionProperty:Object.keys(r).map(_o).join(","),transitionDuration:f+"ms",...n,...r}),"close"===w){const r=t||e;h({transitionProperty:Object.keys(r).map(_o).join(","),transitionDuration:p+"ms",...n,...r})}},[p,v,y,b,x,f,w,u]),{isMounted:g,styles:m}}function So(e,t){const[n,r]=e;let o=!1;const a=t.length;for(let e=0,i=a-1;e<a;i=e++){const[a,s]=t[e]||[0,0],[l,c]=t[i]||[0,0];s>=r!=c>=r&&n<=(l-a)*(r-s)/(c-s)+a&&(o=!o)}return o}function ko(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,a=!1,i=null,s=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:p,tree:m}=e;return function(e){function h(){clearTimeout(o),f()}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:w}=e,y=[g,w],b=xt(e),v="mouseleave"===e.type,x=ut(d.floating,b),N=ut(d.domReference,b),E=d.domReference.getBoundingClientRect(),_=d.floating.getBoundingClientRect(),M=u.split("-")[0],I=n>_.right-_.width/2,S=c>_.bottom-_.height/2,k=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,E),D=_.width>E.width,C=_.height>E.height,j=(D?E:_).left,A=(D?E:_).right,T=(C?E:_).top,L=(C?E:_).bottom;if(x&&(a=!0,!v))return;if(N&&(a=!1),N&&!v)return void(a=!0);if(v&&Ye(e.relatedTarget)&&ut(d.floating,e.relatedTarget))return;if(m&&Ir(m.nodesRef.current,p).some(e=>{let{context:t}=e;return null==t?void 0:t.open}))return;if("top"===M&&c>=E.bottom-1||"bottom"===M&&c<=E.top+1||"left"===M&&n>=E.right-1||"right"===M&&n<=E.left+1)return h();let O=[];switch(M){case"top":O=[[j,E.top+1],[j,_.bottom-1],[A,_.bottom-1],[A,E.top+1]];break;case"bottom":O=[[j,_.top+1],[j,E.bottom-1],[A,E.bottom-1],[A,_.top+1]];break;case"left":O=[[_.right-1,L],[_.right-1,T],[E.left+1,T],[E.left+1,L]];break;case"right":O=[[E.right-1,L],[E.right-1,T],[_.left+1,T],[_.left+1,L]]}if(!So([g,w],O)){if(a&&!k)return h();if(!v&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===s||0===r)return i=e,s=t,l=n,null;const o=e-i,a=t-s,c=Math.sqrt(o*o+a*a);return i=e,s=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return h()}So([g,w],function(e){let[n,r]=e;switch(M){case"top":return[[D?n+t/2:I?n+4*t:n-4*t,r+t+1],[D?n-t/2:I?n+4*t:n-4*t,r+t+1],[_.left,I||D?_.bottom-t:_.top],[_.right,I?D?_.bottom-t:_.top:_.bottom-t]];case"bottom":return[[D?n+t/2:I?n+4*t:n-4*t,r-t],[D?n-t/2:I?n+4*t:n-4*t,r-t],[_.left,I||D?_.top+t:_.bottom],[_.right,I?D?_.top+t:_.bottom:_.top+t]];case"left":{const e=[n+t+1,C?r+t/2:S?r+4*t:r-4*t],o=[n+t+1,C?r-t/2:S?r+4*t:r-4*t];return[[S||C?_.right-t:_.left,_.top],[S?C?_.right-t:_.left:_.right-t,_.bottom],e,o]}case"right":return[[n-t,C?r+t/2:S?r+4*t:r-4*t],[n-t,C?r-t/2:S?r+4*t:r-4*t],[S||C?_.left+t:_.right,_.top],[S?C?_.left+t:_.right:_.left+t,_.bottom]]}}([n,c]))?!a&&r&&(o=window.setTimeout(h,40)):h()}}};return c.__options={blockPointerEvents:n},c}const Do=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Co=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");var jo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ao=(0,s.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...l},c)=>(0,s.createElement)("svg",{ref:c,...jo,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Co("lucide",o),...l},[...i.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(a)?a:[a]])),To=(e,t)=>{const n=(0,s.forwardRef)(({className:n,...r},o)=>(0,s.createElement)(Ao,{ref:o,iconNode:t,className:Co(`lucide-${Do(e)}`,n),...r}));return n.displayName=`${e}`,n},Lo=To("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Oo=To("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),zo=To("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Po=To("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Ro=(0,s.forwardRef)((e,t)=>{const{variant:n="primary",size:r="md",type:o="button",tag:a="button",className:i,children:l,disabled:c=!1,destructive:u=!1,icon:d=null,iconPosition:f="left",loading:p=!1,...m}=e,h=u&&"focus:ring-focus-error",g=p?"opacity-50 disabled:cursor-not-allowed":"",w={primary:"text-text-on-color bg-button-primary hover:bg-button-primary-hover outline-button-primary hover:outline-button-primary-hover shadow-xs disabled:shadow-none focus:shadow-none disabled:bg-button-disabled disabled:outline-button-disabled",secondary:"text-text-on-color bg-button-secondary hover:bg-button-secondary-hover outline-button-secondary hover:outline-button-secondary-hover shadow-xs focus:shadow-none disabled:shadow-none disabled:bg-button-disabled disabled:outline-button-disabled",outline:"text-button-tertiary-color outline-border-subtle bg-button-tertiary shadow-sm focus:shadow-none hover:bg-button-tertiary-hover hover:outline-border-subtle disabled:bg-button-tertiary disabled:outline-border-disabled",ghost:"text-text-primary bg-transparent outline-transparent hover:bg-button-tertiary-hover",link:"outline-none text-link-primary bg-transparent hover:text-link-primary-hover hover:underline p-0 border-0 leading-none"}[n],y=u&&!c?{primary:"bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",secondary:"bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",outline:"text-button-danger outline outline-1 outline-button-danger hover:outline-button-danger bg-button-tertiary hover:bg-field-background-error",ghost:"text-button-danger hover:bg-field-background-error",link:"text-button-danger hover:text-button-danger-secondary"}[n]:"",b={xs:"p-1 rounded [&>svg]:size-4",sm:"p-2 rounded [&>svg]:size-4 gap-0.5",md:"p-2.5 rounded-md text-sm [&>svg]:size-5 gap-1",lg:"p-3 rounded-lg text-base [&>svg]:size-6 gap-1"}[r];let v,x=null,N="";return d&&(N="flex items-center justify-center","left"===f?v=d:x=d),(0,j.jsxs)(a,{ref:t,type:o,className:Se(N,"outline outline-1 border-none cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",b,w,y,h,g,{"cursor-default":c},i),disabled:c,"aria-disabled":c,...m,children:[(0,j.jsx)(s.Fragment,{children:v},"left-icon"),l?(0,j.jsx)("span",{className:"px-1",children:l}):null,(0,j.jsx)(s.Fragment,{children:x},"right-icon")]})});Ro.displayName="Button";const Uo="light",Bo="neutral",Fo=({icon:e,theme:t=Uo,variant:n=Bo})=>{const r="[&>svg]:h-5 [&>svg]:w-5",o=(({theme:e=Uo,variant:t=Bo})=>{let n="light"===e?"text-icon-secondary":"text-icon-inverse";return n={info:"light"===e?"text-support-info":"text-support-info-inverse",success:"light"===e?"text-support-success":"text-support-success-inverse",warning:"light"===e?"text-support-warning":"text-support-warning-inverse",error:"light"===e?"text-support-error":"text-support-error-inverse"}[t]||n,n})({theme:t,variant:n});if(e&&(0,s.isValidElement)(e))return(0,s.cloneElement)(e,{className:Se(r,o,e?.props?.className??"")});const a={neutral:(0,j.jsx)(Lo,{className:Se(r,o)}),info:(0,j.jsx)(Lo,{className:Se(r,o)}),success:(0,j.jsx)(Oo,{className:Se(r,o)}),warning:(0,j.jsx)(zo,{className:Se(r,o)}),error:(0,j.jsx)(Po,{className:Se(r,o)})};return a[n]||a.neutral},Qo=({actionType:e="button",onAction:t=()=>{},actionLabel:n="",theme:r=Uo})=>{const o="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none";let a="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===r&&(a="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),e){case"button":return(0,j.jsx)(Ro,{variant:"outline",size:"xs",onClick:t,className:Se("rounded",o,a,"dark"===r?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white"),children:n});case"link":return(0,j.jsx)(Ro,{variant:"link",size:"xs",onClick:t,className:Se(o,a),children:n});default:return null}},Vo=({theme:e=Uo,title:t="",inline:n=!1})=>t?(0,j.jsx)("span",{className:Se("block",{light:"text-text-primary",dark:"text-text-inverse"}[e],"text-sm leading-5 font-semibold",n?"inline":"block"),children:t}):null,Yo=({theme:e=Uo,content:t="",inline:n=!1})=>t?(0,j.jsx)("span",{className:Se({light:"text-text-primary",dark:"text-text-inverse"}[e],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal [word-break:break-word]",n?"inline":"block"),children:t}):null,Zo=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},Wo=({variant:e="dark",placement:t="bottom",title:n="",content:r,arrow:o=!1,open:a,setOpen:i,children:l,className:c,tooltipPortalRoot:u,tooltipPortalId:d,boundary:f="clippingAncestors",strategy:p="fixed",offset:m=8,triggers:h=["hover","focus"],interactive:g=!1})=>{const w=(0,s.useMemo)(()=>"boolean"==typeof a&&"function"==typeof i,[a,i]),[y,b]=(0,s.useState)(!1),v=(0,s.useRef)(null),{refs:x,floatingStyles:N,context:E}=uo({open:w?a:y,onOpenChange:w?i:b,placement:t,strategy:p,middleware:[Bn(m),Qn({boundary:f}),Fn({boundary:f}),Yn({element:v})],whileElementsMounted:jn}),_=ao(E,{enabled:!w&&h.includes("click")}),M=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:a,elements:i}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:p=!0}=t,m=br(),h=yr(),g=xr(u),w=xr(c),y=xr(n),b=s.useRef(),v=s.useRef(-1),x=s.useRef(),N=s.useRef(-1),E=s.useRef(!0),_=s.useRef(!1),M=s.useRef(()=>{}),I=s.useRef(!1),S=s.useCallback(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t},[o]);s.useEffect(()=>{if(l)return a.on("openchange",e),()=>{a.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(v.current),clearTimeout(N.current),E.current=!0,I.current=!1)}},[l,a]),s.useEffect(()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){S()&&r(!1,e,"hover")}const t=bt(i.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[i.floating,n,r,l,g,S]);const k=s.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Er(w.current,"close",b.current);o&&!x.current?(clearTimeout(v.current),v.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(clearTimeout(v.current),r(!1,e,n))},[w,r]),D=Gn(()=>{M.current(),x.current=void 0}),C=Gn(()=>{if(_.current){const e=bt(i.floating).body;e.style.pointerEvents="",e.removeAttribute(Nr),_.current=!1}}),j=Gn(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));s.useEffect(()=>{if(l&&Ye(i.domReference)){var e;const r=i.domReference;return n&&r.addEventListener("mouseleave",s),null==(e=i.floating)||e.addEventListener("mouseleave",s),p&&r.addEventListener("mousemove",t,{once:!0}),r.addEventListener("mouseenter",t),r.addEventListener("mouseleave",a),()=>{var e;n&&r.removeEventListener("mouseleave",s),null==(e=i.floating)||e.removeEventListener("mouseleave",s),p&&r.removeEventListener("mousemove",t),r.removeEventListener("mouseenter",t),r.removeEventListener("mouseleave",a)}}function t(e){if(clearTimeout(v.current),E.current=!1,d&&!yt(b.current)||f>0&&!Er(w.current,"open"))return;const t=Er(w.current,"open",b.current);t?v.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function a(e){if(j())return;M.current();const t=bt(i.floating);if(clearTimeout(N.current),I.current=!1,g.current&&o.current.floatingContext){n||clearTimeout(v.current),x.current=g.current({...o.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){C(),D(),j()||k(e,!0,"safe-polygon")}});const r=x.current;return t.addEventListener("mousemove",r),void(M.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!ut(i.floating,e.relatedTarget))&&k(e)}function s(e){j()||o.current.floatingContext&&(null==g.current||g.current({...o.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){C(),D(),j()||k(e)}})(e))}},[i,l,e,d,f,p,k,D,C,r,n,y,m,w,g,o,j]),ir(()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&S()){_.current=!0;const e=i.floating;if(Ye(i.domReference)&&e){var t;const n=bt(i.floating).body;n.setAttribute(Nr,"");const r=i.domReference,o=null==m||null==(t=m.nodesRef.current.find(e=>e.id===h))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[l,n,h,i,m,g,S]),ir(()=>{n||(b.current=void 0,I.current=!1,D(),C())},[n,D,C]),s.useEffect(()=>()=>{D(),clearTimeout(v.current),clearTimeout(N.current),C()},[l,i.domReference,D,C]);const A=s.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){E.current||y.current||r(!0,t,"hover")}d&&!yt(b.current)||n||0===f||I.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(N.current),"touch"===b.current?o():(I.current=!0,N.current=window.setTimeout(o,f)))}}},[d,r,n,y,f]),T=s.useMemo(()=>({onMouseEnter(){clearTimeout(v.current)},onMouseLeave(e){j()||k(e.nativeEvent,!1)}}),[k,j]);return s.useMemo(()=>l?{reference:A,floating:T}:{},[l,A,T])}(E,{move:!1,enabled:!w&&h.includes("hover"),...g&&{handleClose:ko()}}),I=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:a,elements:i}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=s.useRef(!1),d=s.useRef(),f=s.useRef(!0);s.useEffect(()=>{if(!l)return;const e=Fe(i.domReference);function t(){!n&&Ze(i.domReference)&&i.domReference===ct(bt(i.domReference))&&(u.current=!0)}function r(){f.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}},[i.domReference,n,l]),s.useEffect(()=>{if(l)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}},[o,l]),s.useEffect(()=>()=>{clearTimeout(d.current)},[]);const p=s.useMemo(()=>({onPointerDown(e){mt(e.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=xt(e.nativeEvent);if(c&&Ye(t))try{if(ht()&&wt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!f.current&&!Nt(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=Ye(t)&&t.hasAttribute(vr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout(()=>{var e;const s=ct(i.domReference?i.domReference.ownerDocument:document);(t||s!==i.domReference)&&(ut(null==(e=a.current.floatingContext)?void 0:e.refs.floating.current,s)||ut(i.domReference,s)||o||r(!1,n,"focus"))})}}),[a,i.domReference,r,c]);return s.useMemo(()=>l?{reference:p}:{},[l,p])}(E,{enabled:!w&&h.includes("focus")}),S=co(E),k=Eo(E,{role:"tooltip"}),{getReferenceProps:D,getFloatingProps:C}=ho([_,M,I,S,k]),{isMounted:A,styles:T}=Io(E,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),L={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"}[e],O="dark"===e?"text-tooltip-background-dark":"text-tooltip-background-light";return(0,j.jsxs)(s.Fragment,{children:[(0,s.isValidElement)(l)&&(0,j.jsx)(s.Fragment,{children:(0,s.cloneElement)(l,{ref:Zo(l.ref,x.setReference),className:Se(l.props.className),...D()})},"tooltip-reference"),(0,j.jsx)(Zr,{id:d,root:u,children:A&&(0,j.jsxs)("div",{className:Se("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",L,"max-w-80 w-fit",c),ref:x.setFloating,style:{...N,...T},...C(),children:[(0,j.jsxs)("div",{children:[!!n&&(0,j.jsx)("span",{className:"font-semibold",children:n},"tooltip-title"),!!r&&(0,j.jsx)("div",{className:"font-normal",children:r},"tooltip-content")]}),o&&(0,j.jsx)(hr,{ref:v,context:E,className:Se("fill-current",O)})]})})]})};function Go(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy((...t)=>e(...t),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}function Ho(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}Wo.displayName="Tooltip";const $o=e=>Array.isArray(e);function Xo(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function qo(e){return"string"==typeof e||Array.isArray(e)}function Jo(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ko(e,t,n,r){if("function"==typeof t){const[o,a]=Jo(r);t=t(void 0!==n?n:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=Jo(r);t=t(void 0!==n?n:e.custom,o,a)}return t}function ea(e,t,n){const r=e.getProps();return Ko(r,t,void 0!==n?n:r.custom,e)}const ta=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],na=["initial",...ta];function ra(e){let t;return()=>(void 0===t&&(t=e()),t)}const oa=ra(()=>void 0!==window.ScrollTimeline);class aa{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map(n=>oa()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0);return()=>{n.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ia extends aa{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function sa(e,t){return e?e[t]||e.default||e:void 0}const la=2e4;function ca(e){let t=0,n=e.next(t);for(;!n.done&&t<la;)t+=50,n=e.next(t);return t>=la?1/0:t}function ua(e){return"function"==typeof e}function da(e,t){e.timeline=t,e.onfinish=null}const fa=e=>Array.isArray(e)&&"number"==typeof e[0],pa={linearEasing:void 0};function ma(e,t){const n=ra(e);return()=>{var e;return null!==(e=pa[t])&&void 0!==e?e:n()}}const ha=ma(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),ga=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},wa=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let t=0;t<o;t++)r+=e(ga(0,o-1,t))+", ";return`linear(${r.substring(0,r.length-2)})`};function ya(e){return Boolean("function"==typeof e&&ha()||!e||"string"==typeof e&&(e in va||ha())||fa(e)||Array.isArray(e)&&e.every(ya))}const ba=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,va={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ba([0,.65,.55,1]),circOut:ba([.55,0,1,.45]),backIn:ba([.31,.01,.66,-.59]),backOut:ba([.33,1.53,.69,.99])};function xa(e,t){return e?"function"==typeof e&&ha()?wa(e,t):fa(e)?ba(e):Array.isArray(e)?e.map(e=>xa(e,t)||va.easeOut):va[e]:void 0}const Na={x:!1,y:!1};function Ea(){return Na.x||Na.y}function _a(e,t){const n=function(e){if(e instanceof Element)return[e];if("string"==typeof e){let t=document;const n=t.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ma(e){return t=>{"touch"===t.pointerType||Ea()||e(t)}}const Ia=(e,t)=>!!t&&(e===t||Ia(e,t.parentElement)),Sa=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,ka=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),Da=new WeakSet;function Ca(e){return t=>{"Enter"===t.key&&e(t)}}function ja(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Aa(e){return Sa(e)&&!Ea()}const Ta=e=>1e3*e,La=e=>e/1e3,Oa=e=>e,za=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pa=new Set(za),Ra=new Set(["width","height","top","left","right","bottom",...za]),Ua=e=>$o(e)?e[e.length-1]||0:e,Ba=["read","resolveKeyframes","update","preRender","render","postRender"];function Fa(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,i=Ba.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&r?t:n;return o&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{i=e,r?o=!0:(r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,o&&(o=!1,l.process(e)))}};return l}(a),e),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=i,p=()=>{const a=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))};return{schedule:Ba.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(p)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<Ba.length;t++)i[Ba[t]].cancel(e)},state:o,steps:i}}const{schedule:Qa,cancel:Va,state:Ya,steps:Za}=Fa("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Oa,!0);let Wa;function Ga(){Wa=void 0}const Ha={now:()=>(void 0===Wa&&Ha.set(Ya.isProcessing?Ya.timestamp:performance.now()),Wa),set:e=>{Wa=e,queueMicrotask(Ga)}};function $a(e,t){-1===e.indexOf(t)&&e.push(t)}function Xa(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class qa{constructor(){this.subscriptions=[]}add(e){return $a(this.subscriptions,e),()=>Xa(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ja(e,t){return t?e*(1e3/t):0}const Ka={current:void 0};class ei{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Ha.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Ha.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new qa);const n=this.events[e].add(t);return"change"===e?()=>{n(),Qa.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Ka.current&&Ka.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Ha.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Ja(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ti(e,t){return new ei(e,t)}function ni(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ti(n))}const ri=e=>Boolean(e&&e.getVelocity);function oi(e,t){const n=e.getValue("willChange");if(function(e){return Boolean(ri(e)&&e.add)}(n))return n.add(t)}const ai=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ii="data-"+ai("framerAppearId");function si(e){return e.props[ii]}const li=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ci(e,t,n,r){if(e===t&&n===r)return Oa;return o=>0===o||1===o?o:li(function(e,t,n,r,o){let a,i,s=0;do{i=t+(n-t)/2,a=li(i,r,o)-e,a>0?n=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(o,0,1,e,n),t,r)}const ui=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,di=e=>t=>1-e(1-t),fi=ci(.33,1.53,.69,.99),pi=di(fi),mi=ui(pi),hi=e=>(e*=2)<1?.5*pi(e):.5*(2-Math.pow(2,-10*(e-1))),gi=e=>1-Math.sin(Math.acos(e)),wi=di(gi),yi=ui(gi),bi=e=>/^0[^.\s]+$/u.test(e);function vi(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||bi(e)}const xi=(e,t,n)=>n>t?t:n<e?e:n,Ni={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Ei={...Ni,transform:e=>xi(0,1,e)},_i={...Ni,default:1},Mi=e=>Math.round(1e5*e)/1e5,Ii=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Si=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ki=(e,t)=>n=>Boolean("string"==typeof n&&Si.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Di=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,a,i,s]=r.match(Ii);return{[e]:parseFloat(o),[t]:parseFloat(a),[n]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},Ci={...Ni,transform:e=>Math.round((e=>xi(0,255,e))(e))},ji={test:ki("rgb","red"),parse:Di("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ci.transform(e)+", "+Ci.transform(t)+", "+Ci.transform(n)+", "+Mi(Ei.transform(r))+")"},Ai={test:ki("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:ji.transform},Ti=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Li=Ti("deg"),Oi=Ti("%"),zi=Ti("px"),Pi=Ti("vh"),Ri=Ti("vw"),Ui={...Oi,parse:e=>Oi.parse(e)/100,transform:e=>Oi.transform(100*e)},Bi={test:ki("hsl","hue"),parse:Di("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Oi.transform(Mi(t))+", "+Oi.transform(Mi(n))+", "+Mi(Ei.transform(r))+")"},Fi={test:e=>ji.test(e)||Ai.test(e)||Bi.test(e),parse:e=>ji.test(e)?ji.parse(e):Bi.test(e)?Bi.parse(e):Ai.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?ji.transform(e):Bi.transform(e)},Qi=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Vi="number",Yi="color",Zi=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wi(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(Zi,e=>(Fi.test(e)?(r.color.push(a),o.push(Yi),n.push(Fi.parse(e))):e.startsWith("var(")?(r.var.push(a),o.push("var"),n.push(e)):(r.number.push(a),o.push(Vi),n.push(parseFloat(e))),++a,"${}")).split("${}");return{values:n,split:i,indexes:r,types:o}}function Gi(e){return Wi(e).values}function Hi(e){const{split:t,types:n}=Wi(e),r=t.length;return e=>{let o="";for(let a=0;a<r;a++)if(o+=t[a],void 0!==e[a]){const t=n[a];o+=t===Vi?Mi(e[a]):t===Yi?Fi.transform(e[a]):e[a]}return o}}const $i=e=>"number"==typeof e?0:e,Xi={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Ii))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Qi))||void 0===n?void 0:n.length)||0)>0},parse:Gi,createTransformer:Hi,getAnimatableNone:function(e){const t=Gi(e);return Hi(e)(t.map($i))}},qi=new Set(["brightness","contrast","saturate","opacity"]);function Ji(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Ii)||[];if(!r)return e;const o=n.replace(r,"");let a=qi.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+o+")"}const Ki=/\b([a-z-]*)\(.*?\)/gu,es={...Xi,getAnimatableNone:e=>{const t=e.match(Ki);return t?t.map(Ji).join(" "):e}},ts={borderWidth:zi,borderTopWidth:zi,borderRightWidth:zi,borderBottomWidth:zi,borderLeftWidth:zi,borderRadius:zi,radius:zi,borderTopLeftRadius:zi,borderTopRightRadius:zi,borderBottomRightRadius:zi,borderBottomLeftRadius:zi,width:zi,maxWidth:zi,height:zi,maxHeight:zi,top:zi,right:zi,bottom:zi,left:zi,padding:zi,paddingTop:zi,paddingRight:zi,paddingBottom:zi,paddingLeft:zi,margin:zi,marginTop:zi,marginRight:zi,marginBottom:zi,marginLeft:zi,backgroundPositionX:zi,backgroundPositionY:zi},ns={rotate:Li,rotateX:Li,rotateY:Li,rotateZ:Li,scale:_i,scaleX:_i,scaleY:_i,scaleZ:_i,skew:Li,skewX:Li,skewY:Li,distance:zi,translateX:zi,translateY:zi,translateZ:zi,x:zi,y:zi,z:zi,perspective:zi,transformPerspective:zi,opacity:Ei,originX:Ui,originY:Ui,originZ:zi},rs={...Ni,transform:Math.round},os={...ts,...ns,zIndex:rs,size:zi,fillOpacity:Ei,strokeOpacity:Ei,numOctaves:rs},as={...os,color:Fi,backgroundColor:Fi,outlineColor:Fi,fill:Fi,stroke:Fi,borderColor:Fi,borderTopColor:Fi,borderRightColor:Fi,borderBottomColor:Fi,borderLeftColor:Fi,filter:es,WebkitFilter:es},is=e=>as[e];function ss(e,t){let n=is(e);return n!==es&&(n=Xi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ls=new Set(["auto","none","0"]),cs=e=>e===Ni||e===zi,us=(e,t)=>parseFloat(e.split(", ")[t]),ds=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return us(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?us(t[1],e):0}},fs=new Set(["x","y","z"]),ps=za.filter(e=>!fs.has(e)),ms={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ds(4,13),y:ds(5,14)};ms.translateX=ms.x,ms.translateY=ms.y;const hs=new Set;let gs=!1,ws=!1;function ys(){if(ws){const e=Array.from(hs).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return ps.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}ws=!1,gs=!1,hs.forEach(e=>e.complete()),hs.clear()}function bs(){hs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ws=!0)})}class vs{constructor(e,t,n,r,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(hs.add(this),gs||(gs=!0,Qa.read(bs),Qa.resolveKeyframes(ys))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==r?void 0:r.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===o&&r.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),hs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,hs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let xs=Oa,Ns=Oa;const Es=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_s=e=>t=>"string"==typeof t&&t.startsWith(e),Ms=_s("--"),Is=_s("var(--"),Ss=e=>!!Is(e)&&ks.test(e.split("/*")[0].trim()),ks=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ds=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Cs(e,t,n=1){Ns(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Ds.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return Es(e)?parseFloat(e):e}return Ss(o)?Cs(o,t,n+1):o}const js=e=>t=>t.test(e),As=[Ni,zi,Oi,Li,Ri,Pi,{test:e=>"auto"===e,parse:e=>e}],Ts=e=>As.find(js(e));class Ls extends vs{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if("string"==typeof r&&(r=r.trim(),Ss(r))){const o=Cs(r,t.current);void 0!==o&&(e[n]=o),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Ra.has(n)||2!==e.length)return;const[r,o]=e,a=Ts(r),i=Ts(o);if(a!==i)if(cs(a)&&cs(i))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)vi(e[t])&&n.push(t);n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!ls.has(t)&&Wi(t).values.length&&(r=e[o]),o++}if(r&&n)for(const o of t)e[o]=ss(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ms[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const a=r.length-1,i=r[a];r[a]=ms[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Os=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Xi.test(e)&&"0"!==e||e.startsWith("url(")));function zs(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=Os(o,t),s=Os(a,t);return xs(i===s,`You are trying to animate ${t} from "${o}" to "${a}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${a} via the \`style\` property.`),!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||ua(n))&&r)}const Ps=e=>null!==e;function Rs(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Ps),a=t&&"loop"!==n&&t%2==1?0:o.length-1;return a&&void 0!==r?r:o[a]}class Us{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ha.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:a,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(bs(),ys()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Ha.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:a,onComplete:i,onUpdate:s,isGenerator:l}=this.options;if(!l&&!zs(e,n,r,o)){if(!a)return s&&s(Rs(e,this.options,t)),i&&i(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Bs=(e,t,n)=>e+(t-e)*n;function Fs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Qs(e,t){return n=>n>0?t:e}const Vs=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Ys=[Ai,ji,Bi];function Zs(e){const t=(n=e,Ys.find(e=>e.test(n)));var n;if(xs(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===Bi&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,a=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;o=Fs(s,r,e+1/3),a=Fs(s,r,e),i=Fs(s,r,e-1/3)}else o=a=i=n;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:r}}(r)),r}const Ws=(e,t)=>{const n=Zs(e),r=Zs(t);if(!n||!r)return Qs(e,t);const o={...n};return e=>(o.red=Vs(n.red,r.red,e),o.green=Vs(n.green,r.green,e),o.blue=Vs(n.blue,r.blue,e),o.alpha=Bs(n.alpha,r.alpha,e),ji.transform(o))},Gs=(e,t)=>n=>t(e(n)),Hs=(...e)=>e.reduce(Gs),$s=new Set(["none","hidden"]);function Xs(e,t){return n=>Bs(e,t,n)}function qs(e){return"number"==typeof e?Xs:"string"==typeof e?Ss(e)?Qs:Fi.test(e)?Ws:el:Array.isArray(e)?Js:"object"==typeof e?Fi.test(e)?Ws:Ks:Qs}function Js(e,t){const n=[...e],r=n.length,o=e.map((e,n)=>qs(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function Ks(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=qs(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const el=(e,t)=>{const n=Xi.createTransformer(t),r=Wi(e),o=Wi(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?$s.has(e)&&!o.values.length||$s.has(t)&&!r.values.length?function(e,t){return $s.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Hs(Js(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][o[i]],l=null!==(n=e.values[s])&&void 0!==n?n:0;r[a]=l,o[i]++}return r}(r,o),o.values),n):(xs(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Qs(e,t))};function tl(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?Bs(e,t,n):qs(e)(e,t)}function nl(e,t,n){const r=Math.max(t-5,0);return Ja(n-e(r),t-r)}const rl=.01,ol=2,al=.005,il=.5;function sl(e,t){return e*Math.sqrt(1-t*t)}const ll=["duration","bounce"],cl=["stiffness","damping","mass"];function ul(e,t){return t.some(t=>void 0!==e[t])}function dl(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const a=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!ul(e,cl)&&ul(e,ll))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),o=r*r,a=2*xi(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:1,stiffness:o,damping:a}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:r=1}){let o,a;xs(e<=Ta(10),"Spring duration must be 10 seconds or less");let i=1-t;i=xi(.05,1,i),e=xi(.01,10,La(e)),i<1?(o=t=>{const r=t*i,o=r*e;return.001-(r-n)/sl(t,i)*Math.exp(-o)},a=t=>{const r=t*i*e,a=r*n+n,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=sl(Math.pow(t,2),i);return(.001-o(t)>0?-1:1)*((a-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}(o,a,5/e);if(e=Ta(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*i*Math.sqrt(r*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-La(n.velocity||0)}),m=f||0,h=c/(2*Math.sqrt(l*u)),g=i-a,w=La(Math.sqrt(l/u)),y=Math.abs(g)<5;let b;if(r||(r=y?rl:ol),o||(o=y?al:il),h<1){const e=sl(w,h);b=t=>{const n=Math.exp(-h*w*t);return i-n*((m+h*w*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===h)b=e=>i-Math.exp(-w*e)*(g+(m+w*g)*e);else{const e=w*Math.sqrt(h*h-1);b=t=>{const n=Math.exp(-h*w*t),r=Math.min(e*t,300);return i-n*((m+h*w*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const v={calculatedDuration:p&&d||null,next:e=>{const t=b(e);if(p)s.done=e>=d;else{let n=0;h<1&&(n=0===e?Ta(m):nl(b,e,t));const a=Math.abs(n)<=r,l=Math.abs(i-t)<=o;s.done=a&&l}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(ca(v),la),t=wa(t=>v.next(e*t).value,e,30);return e+"ms "+t}};return v}function fl({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},p=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let m=n*t;const h=d+m,g=void 0===i?h:i(h);g!==h&&(m=g-d);const w=e=>-m*Math.exp(-e/r),y=e=>g+w(e),b=e=>{const t=w(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let v,x;const N=e=>{var t;t=f.value,(void 0!==s&&t<s||void 0!==l&&t>l)&&(v=e,x=dl({keyframes:[f.value,p(f.value)],velocity:nl(y,e,f.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return N(0),{calculatedDuration:null,next:e=>{let t=!1;return x||void 0!==v||(t=!0,b(e),N(e)),void 0!==v&&e>=v?x.next(e-v):(!t&&b(e),f)}}}const pl=ci(.42,0,1,1),ml=ci(0,0,.58,1),hl=ci(.42,0,.58,1),gl={linear:Oa,easeIn:pl,easeInOut:hl,easeOut:ml,circIn:gi,circInOut:yi,circOut:wi,backIn:pi,backInOut:mi,backOut:fi,anticipate:hi},wl=e=>{if(fa(e)){Ns(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return ci(t,n,r,o)}return"string"==typeof e?(Ns(void 0!==gl[e],`Invalid easing type '${e}'`),gl[e]):e};function yl({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(wl):wl(r),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=ga(0,t,r);e.push(Bs(n,1,o))}}(t,e.length-1),t}(t),e),s=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const a=e.length;if(Ns(a===t.length,"Both input and output ranges must be the same length"),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||tl,a=e.length-1;for(let n=0;n<a;n++){let a=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||Oa:t;a=Hs(e,a)}r.push(a)}return r}(t,r,o),l=s.length,c=n=>{if(i&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const o=ga(e[r],e[r+1],n);return s[r](o)};return n?t=>c(xi(e[0],e[a-1],t)):c}(i,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map(()=>c||hl).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const bl=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Qa.update(t,!0),stop:()=>Va(t),now:()=>Ya.isProcessing?Ya.timestamp:Ha.now()}},vl={decay:fl,inertia:fl,tween:yl,keyframes:yl,spring:dl},xl=e=>e/100;class Nl extends Us{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options,a=(null==r?void 0:r.KeyframeResolver)||vs;this.resolver=new a(o,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=this.options,i=ua(t)?t:vl[t]||yl;let s,l;i!==yl&&"number"!=typeof e[0]&&(s=Hs(xl,tl(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-a})),null===c.calculatedDuration&&(c.calculatedDuration=ca(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:s,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:a,mapPercentToKeyframes:i,keyframes:s,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:f,repeatType:p,repeatDelay:m,onUpdate:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),w=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1),Boolean(t%2)&&("reverse"===p?(n=1-n,m&&(n-=m/u)):"mirror"===p&&(b=a)),y=xi(0,1,n)*u}const v=w?{done:!1,value:s[0]}:b.next(y);i&&(v.value=i(v.value));let{done:x}=v;w||null===l||(x=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const N=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return N&&void 0!==r&&(v.value=Rs(s,this.options,r)),h&&h(v.value),N&&this.finish(),v}get duration(){const{resolved:e}=this;return e?La(e.calculatedDuration):0}get time(){return La(this.currentTime)}set time(e){e=Ta(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=La(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=bl,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const El=new Set(["opacity","clipPath","filter","transform"]),_l=ra(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ml={anticipate:hi,backInOut:mi,circInOut:yi};class Il extends Us{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new Ls(o,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:o,type:a,motionValue:i,name:s,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&ha()&&o in Ml&&(o=Ml[o]),function(e){return ua(e.type)||"spring"===e.type||!ya(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:s,element:l,...c}=this.options,u=function(e,t){const n=new Nl({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let a=0;for(;!r.done&&a<2e4;)r=n.sample(a),o.push(r.value),a+=10;return{times:void 0,keyframes:o,duration:a-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,r=u.times,o=u.ease,a="keyframes"}const c=function(e,t,n,{delay:r=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=xa(s,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"})}(i.owner.current,s,e,{...this.options,duration:n,times:r,ease:o});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(da(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;i.set(Rs(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:r,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return La(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return La(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Ta(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Oa;const{animation:n}=t;da(n,e)}else this.pendingTimeline=e;return Oa}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:a,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:s,element:l,...c}=this.options,u=new Nl({...c,keyframes:n,duration:r,type:o,ease:a,times:i,isGenerator:!0}),d=Ta(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:s}=this.options;s&&s(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:a,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return _l()&&n&&El.has(n)&&!s&&!l&&!r&&"mirror"!==o&&0!==a&&"inertia"!==i}}const Sl={type:"spring",stiffness:500,damping:25,restSpeed:10},kl={type:"keyframes",duration:.8},Dl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Cl=(e,{keyframes:t})=>t.length>2?kl:Pa.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Sl:Dl,jl=(e,t,n,r={},o,a)=>i=>{const s=sa(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c-=Ta(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(s)||(u={...u,...Cl(e,u)}),u.duration&&(u.duration=Ta(u.duration)),u.repeatDelay&&(u.repeatDelay=Ta(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!a&&void 0!==t.get()){const e=Rs(u.keyframes,s);if(void 0!==e)return Qa.update(()=>{u.onUpdate(e),u.onComplete()}),new ia([])}return!a&&Il.supports(u)?new Il(u):new Nl(u)};function Al({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Tl(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var a;let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(a=e.latestValues[t])&&void 0!==a?a:null),o=l[t];if(void 0===o||u&&Al(u,t))continue;const s={delay:n,...sa(i||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=si(e);if(n){const e=window.MotionHandoffAnimation(n,t,Qa);null!==e&&(s.startTime=e,d=!0)}}oi(e,t),r.start(jl(t,r,o,e.shouldReduceMotion&&Ra.has(t)?{type:!1}:s,e,d));const f=r.animation;f&&c.push(f)}return s&&Promise.all(c).then(()=>{Qa.update(()=>{s&&function(e,t){const n=ea(e,t);let{transitionEnd:r={},transition:o={},...a}=n||{};a={...a,...r};for(const t in a)ni(e,t,Ua(a[t]))}(e,s)})}),c}function Ll(e,t,n={}){var r;const o=ea(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(a=n.transitionOverride);const i=o?()=>Promise.all(Tl(e,o,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,n=0,r=0,o=1,a){const i=[],s=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(Ol).forEach((e,r)=>{e.notify("AnimationStart",t),i.push(Ll(e,t,{...a,delay:n+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+r,i,s,n)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(n.delay)])}function Ol(e,t){return e.sortNodePosition(t)}const zl=na.length;function Pl(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Pl(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<zl;n++){const r=na[n],o=e.props[r];(qo(o)||!1===o)&&(t[r]=o)}return t}const Rl=[...ta].reverse(),Ul=ta.length;function Bl(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>Ll(e,t,n));r=Promise.all(o)}else if("string"==typeof t)r=Ll(e,t,n);else{const o="function"==typeof t?ea(e,t,n.custom):t;r=Promise.all(Tl(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=Vl(),r=!0;const o=t=>(n,r)=>{var o;const a=ea(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...r}=a;n={...n,...r,...t}}return n};function a(a){const{props:i}=e,s=Pl(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<Ul;t++){const f=Rl[t],p=n[f],m=void 0!==i[f]?i[f]:s[f],h=qo(m),g=f===a?p.isActive:null;!1===g&&(d=t);let w=m===s[f]&&m!==i[f]&&h;if(w&&r&&e.manuallyAnimateOnMount&&(w=!1),p.protectedKeys={...u},!p.isActive&&null===g||!m&&!p.prevProp||Ho(m)||"boolean"==typeof m)continue;const y=Fl(p.prevProp,m);let b=y||f===a&&p.isActive&&!w&&h||t>d&&h,v=!1;const x=Array.isArray(m)?m:[m];let N=x.reduce(o(f),{});!1===g&&(N={});const{prevResolvedValues:E={}}=p,_={...E,...N},M=t=>{b=!0,c.has(t)&&(v=!0,c.delete(t)),p.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in _){const t=N[e],n=E[e];if(u.hasOwnProperty(e))continue;let r=!1;r=$o(t)&&$o(n)?!Xo(t,n):t!==n,r?null!=t?M(e):c.add(e):void 0!==t&&c.has(e)?M(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=N,p.isActive&&(u={...u,...N}),r&&e.blockInitialAnimation&&(b=!1),b&&(!w||!y||v)&&l.push(...x.map(e=>({animation:e,options:{type:f}})))}if(c.size){const t={};c.forEach(n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null}),l.push({animation:t})}let f=Boolean(l.length);return!r||!1!==i.initial&&i.initial!==i.animate||e.manuallyAnimateOnMount||(f=!1),r=!1,f?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)}),n[t].isActive=r;const i=a(t);for(const e in n)n[e].protectedKeys={};return i},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Vl(),r=!0}}}function Fl(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Xo(t,e)}function Ql(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vl(){return{animate:Ql(!0),whileInView:Ql(),whileHover:Ql(),whileTap:Ql(),whileDrag:Ql(),whileFocus:Ql(),exit:Ql()}}class Yl{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Zl=0;const Wl={animation:{Feature:class extends Yl{constructor(e){super(e),e.animationState||(e.animationState=Bl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ho(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Yl{constructor(){super(...arguments),this.id=Zl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function Gl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Hl(e){return{point:{x:e.pageX,y:e.pageY}}}function $l(e,t,n,r){return Gl(e,t,(e=>t=>Sa(t)&&e(t,Hl(t)))(n),r)}const Xl=(e,t)=>Math.abs(e-t);class ql{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=ec(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Xl(e.x,t.x),r=Xl(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Ya;this.history.push({...r,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Jl(t,this.transformPagePoint),Qa.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=ec("pointercancel"===e.type?this.lastMoveEventInfo:Jl(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Sa(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const a=Jl(Hl(e),this.transformPagePoint),{point:i}=a,{timestamp:s}=Ya;this.history=[{...i,timestamp:s}];const{onSessionStart:l}=t;l&&l(e,ec(a,this.history)),this.removeListeners=Hs($l(this.contextWindow,"pointermove",this.handlePointerMove),$l(this.contextWindow,"pointerup",this.handlePointerUp),$l(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Va(this.updatePoint)}}function Jl(e,t){return t?{point:t(e.point)}:e}function Kl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ec({point:e},t){return{point:e,delta:Kl(e,nc(t)),offset:Kl(e,tc(t)),velocity:rc(t,.1)}}function tc(e){return e[0]}function nc(e){return e[e.length-1]}function rc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=nc(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ta(t)));)n--;if(!r)return{x:0,y:0};const a=La(o.timestamp-r.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-r.x)/a,y:(o.y-r.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function oc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function ac(e){return e.max-e.min}function ic(e,t,n,r=.5){e.origin=r,e.originPoint=Bs(t.min,t.max,e.origin),e.scale=ac(n)/ac(t),e.translate=Bs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function sc(e,t,n,r){ic(e.x,t.x,n.x,r?r.originX:void 0),ic(e.y,t.y,n.y,r?r.originY:void 0)}function lc(e,t,n){e.min=n.min+t.min,e.max=e.min+ac(t)}function cc(e,t,n){e.min=t.min-n.min,e.max=e.min+ac(t)}function uc(e,t,n){cc(e.x,t.x,n.x),cc(e.y,t.y,n.y)}function dc(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function fc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const pc=.35;function mc(e,t,n){return{min:hc(e,t),max:hc(e,n)}}function hc(e,t){return"number"==typeof e?e:e[t]||0}const gc=()=>({x:{min:0,max:0},y:{min:0,max:0}});function wc(e){return[e("x"),e("y")]}function yc({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function bc(e){return void 0===e||1===e}function vc({scale:e,scaleX:t,scaleY:n}){return!bc(e)||!bc(t)||!bc(n)}function xc(e){return vc(e)||Nc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Nc(e){return Ec(e.x)||Ec(e.y)}function Ec(e){return e&&"0%"!==e}function _c(e,t,n){return n+t*(e-n)}function Mc(e,t,n,r,o){return void 0!==o&&(e=_c(e,o,r)),_c(e,n,r)+t}function Ic(e,t=0,n=1,r,o){e.min=Mc(e.min,t,n,r,o),e.max=Mc(e.max,t,n,r,o)}function Sc(e,{x:t,y:n}){Ic(e.x,t.translate,t.scale,t.originPoint),Ic(e.y,n.translate,n.scale,n.originPoint)}const kc=.999999999999,Dc=1.0000000000001;function Cc(e,t){e.min=e.min+t,e.max=e.max+t}function jc(e,t,n,r,o=.5){Ic(e,t,n,Bs(e.min,e.max,o),r)}function Ac(e,t){jc(e.x,t.x,t.scaleX,t.scale,t.originX),jc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Tc(e,t){return yc(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Lc=({current:e})=>e?e.ownerDocument.defaultView:null,Oc=new WeakMap;class zc{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new ql(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Hl(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(a=n)||"y"===a?Na[a]?null:(Na[a]=!0,()=>{Na[a]=!1}):Na.x||Na.y?null:(Na.x=Na.y=!0,()=>{Na.x=Na.y=!1}),!this.openDragLock))return;var a;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wc(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Oi.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=ac(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&Qa.postRender(()=>o(e,t)),oi(this.visualElement,"transform");const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:i}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&a(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>wc(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Lc(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&Qa.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Pc(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Bs(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Bs(n,e,r.max):Math.min(e,n)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&oc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:dc(e.x,n,o),y:dc(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=pc){return!1===e?e=0:!0===e&&(e=pc),{x:mc(e,"left","right"),y:mc(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&wc(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!oc(e))return!1;const n=e.current;Ns(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Tc(e,n),{scroll:o}=t;return o&&(Cc(r.x,o.offset.x),Cc(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:fc(e.x,t.x),y:fc(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=yc(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=wc(i=>{if(!Pc(i,t,this.currentDirection))return;let l=s&&s[i]||{};a&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[i]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return oi(this.visualElement,e),n.start(jl(e,n,0,t,this.visualElement,!1))}stopAnimation(){wc(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){wc(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){wc(t=>{const{drag:n}=this.getProps();if(!Pc(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[t];o.set(e[t]-Bs(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!oc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};wc(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=ac(e),o=ac(t);return o>r?n=ga(t.min,t.max-r,e.min):r>o&&(n=ga(e.min,e.max-o,t.min)),xi(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),wc(t=>{if(!Pc(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];n.set(Bs(o,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;Oc.set(this.visualElement,this);const e=$l(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();oc(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Qa.read(t);const o=Gl(window,"resize",()=>this.scalePositionWithinConstraints()),a=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(wc(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),e(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:a=pc,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function Pc(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Rc=e=>(t,n)=>{e&&Qa.postRender(()=>e(t,n))},Uc=(0,s.createContext)(null);function Bc(e=!0){const t=(0,s.useContext)(Uc);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,a=(0,s.useId)();(0,s.useEffect)(()=>{e&&o(a)},[e]);const i=(0,s.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,i]:[!0]}const Fc=(0,s.createContext)({}),Qc=(0,s.createContext)({}),Vc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Yc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Zc={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!zi.test(e))return e;e=parseFloat(e)}return`${Yc(e,t.target.x)}% ${Yc(e,t.target.y)}%`}},Wc={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Xi.parse(e);if(o.length>5)return r;const a=Xi.createTransformer(e),i="number"!=typeof o[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const c=Bs(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),a(o)}},Gc={},{schedule:Hc,cancel:$c}=Fa(queueMicrotask,!1);class Xc extends s.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var a;a=Jc,Object.assign(Gc,a),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Vc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,a=n.projection;return a?(a.isPresent=o,r||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||Qa.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Hc.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function qc(e){const[t,n]=Bc(),r=(0,s.useContext)(Fc);return(0,j.jsx)(Xc,{...e,layoutGroup:r,switchLayoutGroup:(0,s.useContext)(Qc),isPresent:t,safeToRemove:n})}const Jc={borderRadius:{...Zc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zc,borderTopRightRadius:Zc,borderBottomLeftRadius:Zc,borderBottomRightRadius:Zc,boxShadow:Wc},Kc=(e,t)=>e.depth-t.depth;class eu{constructor(){this.children=[],this.isDirty=!1}add(e){$a(this.children,e),this.isDirty=!0}remove(e){Xa(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Kc),this.isDirty=!1,this.children.forEach(e)}}function tu(e){const t=ri(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const nu=["TopLeft","TopRight","BottomLeft","BottomRight"],ru=nu.length,ou=e=>"string"==typeof e?parseFloat(e):e,au=e=>"number"==typeof e||zi.test(e);function iu(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const su=cu(0,.5,wi),lu=cu(.5,.95,Oa);function cu(e,t,n){return r=>r<e?0:r>t?1:n(ga(e,t,r))}function uu(e,t){e.min=t.min,e.max=t.max}function du(e,t){uu(e.x,t.x),uu(e.y,t.y)}function fu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function pu(e,t,n,r,o){return e=_c(e-=t,1/n,r),void 0!==o&&(e=_c(e,1/o,r)),e}function mu(e,t,[n,r,o],a,i){!function(e,t=0,n=1,r=.5,o,a=e,i=e){if(Oi.test(t)&&(t=parseFloat(t),t=Bs(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=Bs(a.min,a.max,r);e===a&&(s-=t),e.min=pu(e.min,t,n,s,o),e.max=pu(e.max,t,n,s,o)}(e,t[n],t[r],t[o],t.scale,a,i)}const hu=["x","scaleX","originX"],gu=["y","scaleY","originY"];function wu(e,t,n,r){mu(e.x,t,hu,n?n.x:void 0,r?r.x:void 0),mu(e.y,t,gu,n?n.y:void 0,r?r.y:void 0)}function yu(e){return 0===e.translate&&1===e.scale}function bu(e){return yu(e.x)&&yu(e.y)}function vu(e,t){return e.min===t.min&&e.max===t.max}function xu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Nu(e,t){return xu(e.x,t.x)&&xu(e.y,t.y)}function Eu(e){return ac(e.x)/ac(e.y)}function _u(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Mu{constructor(){this.members=[]}add(e){$a(this.members,e),e.scheduleRender()}remove(e){if(Xa(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Iu={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Su="undefined"!=typeof window&&void 0!==window.MotionDebug,ku=["","X","Y","Z"],Du={visibility:"hidden"};let Cu=0;function ju(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Au(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=si(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Qa,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Au(r)}function Tu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Cu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Su&&(Iu.totalNodes=Iu.resolvedTargetDeltas=Iu.recalculatedProjection=0),this.nodes.forEach(zu),this.nodes.forEach(Vu),this.nodes.forEach(Yu),this.nodes.forEach(Pu),Su&&window.MotionDebug.record(Iu)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new eu)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new qa),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=t)instanceof SVGElement&&"svg"!==r.tagName,this.instance=t;const{layoutId:o,layout:a,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(a||o)&&(this.isLayoutDirty=!0),e){let n;const r=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Ha.now(),r=({timestamp:o})=>{const a=o-n;a>=t&&(Va(r),e(a-t))};return Qa.read(r,!0),()=>Va(r)}(r,250),Vc.hasAnimatedSinceResize&&(Vc.hasAnimatedSinceResize=!1,this.nodes.forEach(Qu))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&i&&(o||a)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||i.getDefaultTransition()||Xu,{onLayoutAnimationStart:a,onLayoutAnimationComplete:s}=i.getProps(),l=!this.targetLayout||!Nu(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...sa(o,"layout"),onPlay:a,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Qu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Va(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Zu),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Au(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Uu);this.isUpdating||this.nodes.forEach(Bu),this.isUpdating=!1,this.nodes.forEach(Fu),this.nodes.forEach(Lu),this.nodes.forEach(Ou),this.clearAllSnapshots();const e=Ha.now();Ya.delta=xi(0,1e3/60,e-Ya.timestamp),Ya.timestamp=e,Ya.isProcessing=!0,Za.update.process(Ya),Za.preRender.process(Ya),Za.render.process(Ya),Ya.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Hc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ru),this.sharedNodes.forEach(Wu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Qa.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Qa.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!bu(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,a=r!==this.prevTransformTemplateValue;e&&(t||xc(this.latestValues)||a)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),Ku((r=n).x),Ku(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(td)){const{scroll:e}=this.root;e&&(Cc(n.x,e.offset.x),Cc(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(du(n,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return n;for(let t=0;t<this.path.length;t++){const r=this.path[t],{scroll:o,options:a}=r;r!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&du(n,e),Cc(n.x,o.offset.x),Cc(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};du(n,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ac(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),xc(r.latestValues)&&Ac(n,r.latestValues)}return xc(this.latestValues)&&Ac(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};du(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!n.instance)continue;if(!xc(n.latestValues))continue;vc(n.latestValues)&&n.updateSnapshot();const r=gc();du(r,n.measurePageBox()),wu(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return xc(this.latestValues)&&wu(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ya.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(this.layout&&(o||a)){if(this.resolvedRelativeTargetAt=Ya.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},uc(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),du(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var i,s,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),i=this.target,s=this.relativeTarget,l=this.relativeParent.target,lc(i.x,s.x,l.x),lc(i.y,s.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):du(this.target,this.layout.layoutBox),Sc(this.target,this.targetDelta)):du(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},uc(this.relativeTargetOrigin,this.target,e.target),du(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Su&&Iu.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!vc(this.parent.latestValues)&&!Nc(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===Ya.timestamp&&(r=!1),r)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;du(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let a,i;t.x=t.y=1;for(let s=0;s<o;s++){a=n[s],i=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&"contents"===o.props.style.display||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ac(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Sc(e,i)),r&&xc(a.latestValues)&&Ac(e,a.latestValues))}t.x<Dc&&t.x>kc&&(t.x=1),t.y<Dc&&t.y>kc&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(fu(this.prevProjectionDelta.x,this.projectionDelta.x),fu(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),sc(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===i&&this.treeScale.y===s&&_u(this.projectionDelta.x,this.prevProjectionDelta.x)&&_u(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Su&&Iu.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(s&&!c&&!0===this.options.crossfade&&!this.path.some($u));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;Gu(a.x,e.x,n),Gu(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(uc(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){Hu(e.x,t.x,n.x,r),Hu(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,i,n),d&&function(e,t){return vu(e.x,t.x)&&vu(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),du(d,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,n,r,o,a){o?(e.opacity=Bs(0,void 0!==n.opacity?n.opacity:1,su(r)),e.opacityExit=Bs(void 0!==t.opacity?t.opacity:1,0,lu(r))):a&&(e.opacity=Bs(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o<ru;o++){const a=`border${nu[o]}Radius`;let i=iu(t,a),s=iu(n,a);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||au(i)===au(s)?(e[a]=Math.max(Bs(ou(i),ou(s),r),0),(Oi.test(s)||Oi.test(i))&&(e[a]+="%")):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Bs(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Va(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Qa.update(()=>{Vc.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=ri(0)?0:ti(0);return r.start(jl("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&ed(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=ac(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=ac(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}du(t,n),Ac(t,o),sc(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Mu),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&ju("z",e,r,this.animationValues);for(let t=0;t<ku.length;t++)ju(`rotate${ku[t]}`,e,r,this.animationValues),ju(`skew${ku[t]}`,e,r,this.animationValues);e.render();for(const t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Du;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=tu(null==e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=tu(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!xc(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=a.animationValues||a.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,n){let r="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==n?void 0:n.z)||0;if((o||a||i)&&(r=`translate3d(${o}px, ${a}px, ${i}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),a&&(r+=`rotateY(${a}deg) `),i&&(r+=`skewX(${i}deg) `),s&&(r+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return 1===s&&1===l||(r+=`scale(${s}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(r.transform=o(i,r.transform));const{x:s,y:l}=this.projectionDelta;r.transformOrigin=`${100*s.origin}% ${100*l.origin}% 0`,a.animationValues?r.opacity=a===this?null!==(n=null!==(t=i.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r.opacity=a===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in Gc){if(void 0===i[e])continue;const{correct:t,applyTo:n}=Gc[e],o="none"===r.transform?i[e]:t(i[e],a);if(n){const e=n.length;for(let t=0;t<e;t++)r[n[t]]=o}else r[e]=o}return this.options.layoutId&&(r.pointerEvents=a===this?tu(null==e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(Uu),this.root.sharedNodes.clear()}}}function Lu(e){e.updateLayout()}function Ou(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;"size"===o?wc(e=>{const r=a?n.measuredBox[e]:n.layoutBox[e],o=ac(r);r.min=t[e].min,r.max=r.min+o}):ed(o,n.layoutBox,t)&&wc(r=>{const o=a?n.measuredBox[r]:n.layoutBox[r],i=ac(t[r]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};sc(i,t,n.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?sc(s,e.applyTransform(r,!0),n.measuredBox):sc(s,t,n.layoutBox);const l=!bu(i);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:a}=r;if(o&&a){const i={x:{min:0,max:0},y:{min:0,max:0}};uc(i,n.layoutBox,o.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};uc(s,t,a.layoutBox),Nu(i,s)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=i,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function zu(e){Su&&Iu.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Pu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ru(e){e.clearSnapshot()}function Uu(e){e.clearMeasurements()}function Bu(e){e.isLayoutDirty=!1}function Fu(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Qu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Vu(e){e.resolveTargetDelta()}function Yu(e){e.calcProjection()}function Zu(e){e.resetSkewAndRotation()}function Wu(e){e.removeLeadSnapshot()}function Gu(e,t,n){e.translate=Bs(t.translate,0,n),e.scale=Bs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Hu(e,t,n,r){e.min=Bs(t.min,n.min,r),e.max=Bs(t.max,n.max,r)}function $u(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Xu={duration:.45,ease:[.4,0,.1,1]},qu=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ju=qu("applewebkit/")&&!qu("chrome/")?Math.round:Oa;function Ku(e){e.min=Ju(e.min),e.max=Ju(e.max)}function ed(e,t,n){return"position"===e||"preserve-aspect"===e&&!function(e,t){return Math.abs(e-t)<=.2}(Eu(t),Eu(n))}function td(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const nd=Tu({attachResizeListener:(e,t)=>Gl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rd={current:void 0},od=Tu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rd.current){const e=new nd({});e.mount(window),e.setOptions({layoutScroll:!0}),rd.current=e}return rd.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),ad={pan:{Feature:class extends Yl{constructor(){super(...arguments),this.removePointerDownListener=Oa}onPointerDown(e){this.session=new ql(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Lc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Rc(e),onStart:Rc(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Qa.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=$l(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Yl{constructor(e){super(e),this.removeGroupControls=Oa,this.removeListeners=Oa,this.controls=new zc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Oa}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:od,MeasureLayout:qc}};function id(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&Qa.postRender(()=>o(t,Hl(t)))}function sd(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const o=r["onTap"+("End"===n?"":n)];o&&Qa.postRender(()=>o(t,Hl(t)))}const ld=new WeakMap,cd=new WeakMap,ud=e=>{const t=ld.get(e.target);t&&t(e)},dd=e=>{e.forEach(ud)};const fd={some:0,all:1},pd={inView:{Feature:class extends Yl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:fd[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;cd.has(n)||cd.set(n,{});const r=cd.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(dd,{root:e,...t})),r[o]}(t);return ld.set(e,n),r.observe(e),()=>{ld.delete(e),r.unobserve(e)}}(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Yl{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,a]=_a(e,n),i=e=>{const r=e.currentTarget;if(!Aa(e)||Da.has(r))return;Da.add(r);const a=t(e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Aa(e)&&Da.has(r)&&(Da.delete(r),"function"==typeof a&&a(e,{success:t}))},s=e=>{i(e,n.useGlobalTarget||Ia(r,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return r.forEach(e=>{(function(e){return ka.has(e.tagName)||-1!==e.tabIndex})(e)||null!==e.getAttribute("tabindex")||(e.tabIndex=0),(n.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ca(()=>{if(Da.has(n))return;ja(n,"down");const e=Ca(()=>{ja(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>ja(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,o),o)}),a}(e,e=>(sd(this.node,e,"Start"),(e,{success:t})=>sd(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Yl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Hs(Gl(this.node.current,"focus",()=>this.onFocus()),Gl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Yl{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,a]=_a(e,n),i=Ma(e=>{const{target:n}=e,r=t(e);if("function"!=typeof r||!n)return;const a=Ma(e=>{r(e),n.removeEventListener("pointerleave",a)});n.addEventListener("pointerleave",a,o)});return r.forEach(e=>{e.addEventListener("pointerenter",i,o)}),a}(e,e=>(id(this.node,e,"Start"),e=>id(this.node,e,"End"))))}unmount(){}}}},md={layout:{ProjectionNode:od,MeasureLayout:qc}},hd=(0,s.createContext)({strict:!1}),gd=(0,s.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),wd=(0,s.createContext)({});function yd(e){return Ho(e.animate)||na.some(t=>qo(e[t]))}function bd(e){return Boolean(yd(e)||e.variants)}function vd(e){return Array.isArray(e)?e.join(" "):e}const xd="undefined"!=typeof window,Nd={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ed={};for(const e in Nd)Ed[e]={isEnabled:t=>Nd[e].some(e=>!!t[e])};const _d=Symbol.for("motionComponentSymbol");function Md(e,t,n){return(0,s.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):oc(n)&&(n.current=r))},[t])}const Id=xd?s.useLayoutEffect:s.useEffect;function Sd(e,t,n,r,o){var a,i;const{visualElement:l}=(0,s.useContext)(wd),c=(0,s.useContext)(hd),u=(0,s.useContext)(Uc),d=(0,s.useContext)(gd).reducedMotion,f=(0,s.useRef)(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const p=f.current,m=(0,s.useContext)(Qc);!p||p.projection||!o||"html"!==p.type&&"svg"!==p.type||function(e,t,n,r){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kd(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(i)||s&&oc(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(f.current,n,o,m);const h=(0,s.useRef)(!1);(0,s.useInsertionEffect)(()=>{p&&h.current&&p.update(n,u)});const g=n[ii],w=(0,s.useRef)(Boolean(g)&&!(null===(a=window.MotionHandoffIsComplete)||void 0===a?void 0:a.call(window,g))&&(null===(i=window.MotionHasOptimisedAnimation)||void 0===i?void 0:i.call(window,g)));return Id(()=>{p&&(h.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),Hc.render(p.render),w.current&&p.animationState&&p.animationState.animateChanges())}),(0,s.useEffect)(()=>{p&&(!w.current&&p.animationState&&p.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,g)}),w.current=!1))}),p}function kd(e){if(e)return!1!==e.options.allowProjection?e.projection:kd(e.parent)}function Dd({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var a,i;function l(e,a){let i;const l={...(0,s.useContext)(gd),...e,layoutId:Cd(e)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(yd(e)){const{initial:t,animate:n}=e;return{initial:!1===t||qo(t)?t:void 0,animate:qo(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,s.useContext)(wd));return(0,s.useMemo)(()=>({initial:t,animate:n}),[vd(t),vd(n)])}(e),d=r(e,c);if(!c&&xd){(0,s.useContext)(hd).strict;const e=function(e){const{drag:t,layout:n}=Ed;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);i=e.MeasureLayout,u.visualElement=Sd(o,d,l,t,e.ProjectionNode)}return(0,j.jsxs)(wd.Provider,{value:u,children:[i&&u.visualElement?(0,j.jsx)(i,{visualElement:u.visualElement,...l}):null,n(o,e,Md(d,u.visualElement,a),d,c,u.visualElement)]})}e&&function(e){for(const t in e)Ed[t]={...Ed[t],...e[t]}}(e),l.displayName=`motion.${"string"==typeof o?o:`create(${null!==(i=null!==(a=o.displayName)&&void 0!==a?a:o.name)&&void 0!==i?i:""})`}`;const c=(0,s.forwardRef)(l);return c[_d]=o,c}function Cd({layoutId:e}){const t=(0,s.useContext)(Fc).id;return t&&void 0!==e?t+"-"+e:e}const jd=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ad(e){return"string"==typeof e&&!e.includes("-")&&!!(jd.indexOf(e)>-1||/[A-Z]/u.test(e))}function Td(e){const t=(0,s.useRef)(null);return null===t.current&&(t.current=e()),t.current}const Ld=e=>(t,n)=>{const r=(0,s.useContext)(wd),o=(0,s.useContext)(Uc),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,a){const i={latestValues:Od(r,o,a,e),renderState:t()};return n&&(i.onMount=e=>n({props:r,current:e,...i}),i.onUpdate=e=>n(e)),i}(e,t,r,o);return n?a():Td(a)};function Od(e,t,n,r){const o={},a=r(e,{});for(const e in a)o[e]=tu(a[e]);let{initial:i,animate:s}=e;const l=yd(e),c=bd(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!Ho(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=Ko(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const e in n){let t=n[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const zd=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Pd={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rd=za.length;function Ud(e,t,n){const{style:r,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const e in t){const n=t[e];if(Pa.has(e))i=!0;else if(Ms(e))o[e]=n;else{const t=zd(n,os[e]);e.startsWith("origin")?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(i||n?r.transform=function(e,t,n){let r="",o=!0;for(let a=0;a<Rd;a++){const i=za[a],s=e[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||n){const e=zd(s,os[i]);l||(o=!1,r+=`${Pd[i]||i}(${e}) `),n&&(t[i]=e)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const Bd={offset:"stroke-dashoffset",array:"stroke-dasharray"},Fd={offset:"strokeDashoffset",array:"strokeDasharray"};function Qd(e,t,n){return"string"==typeof e?e:zi.transform(t+n*e)}function Vd(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},u,d){if(Ud(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(void 0!==o||void 0!==a||p.transform)&&(p.transformOrigin=function(e,t,n){return`${Qd(t,e.x,e.width)} ${Qd(n,e.y,e.height)}`}(m,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==i&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const a=o?Bd:Fd;e[a.offset]=zi.transform(-r);const i=zi.transform(t),s=zi.transform(n);e[a.array]=`${i} ${s}`}(f,i,s,l,!1)}const Yd=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Zd(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Wd=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Gd(e,t,n,r){Zd(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Wd.has(n)?n:ai(n),t.attrs[n])}function Hd(e,{layout:t,layoutId:n}){return Pa.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Gc[e]||"opacity"===e)}function $d(e,t,n){var r;const{style:o}=e,a={};for(const i in o)(ri(o[i])||t.style&&ri(t.style[i])||Hd(i,e)||void 0!==(null===(r=null==n?void 0:n.getValue(i))||void 0===r?void 0:r.liveStyle))&&(a[i]=o[i]);return a}function Xd(e,t,n){const r=$d(e,t,n);for(const n in e)(ri(e[n])||ri(t[n]))&&(r[-1!==za.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}const qd=["x","y","width","height","cx","cy","r"],Jd={useVisualState:Ld({scrapeMotionValuesFromProps:Xd,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let a=!!e.drag;if(!a)for(const e in o)if(Pa.has(e)){a=!0;break}if(!a)return;let i=!t;if(t)for(let n=0;n<qd.length;n++){const r=qd[n];e[r]!==t[r]&&(i=!0)}i&&Qa.read(()=>{!function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(e){t.dimensions={x:0,y:0,width:0,height:0}}}(n,r),Qa.render(()=>{Vd(r,o,Yd(n.tagName),e.transformTemplate),Gd(n,r)})})}})},Kd={useVisualState:Ld({scrapeMotionValuesFromProps:$d,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function ef(e,t,n){for(const r in t)ri(t[r])||Hd(r,n)||(e[r]=t[r])}function tf(e,t){const n={},r=function(e,t){const n={};return ef(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,s.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Ud(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const nf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function rf(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||nf.has(e)}let of=e=>!rf(e);try{(af=require("@emotion/is-prop-valid").default)&&(of=e=>e.startsWith("on")?!rf(e):af(e))}catch(e){}var af;function sf(e,t,n,r){const o=(0,s.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Vd(n,t,Yd(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};ef(t,e.style,e),o.style={...t,...o.style}}return o}function lf(e=!1){return(t,n,r,{latestValues:o},a)=>{const i=(Ad(t)?sf:tf)(n,o,a,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(of(o)||!0===n&&rf(o)||!t&&!rf(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c=t!==s.Fragment?{...l,...i,ref:r}:{},{children:u}=n,d=(0,s.useMemo)(()=>ri(u)?u.get():u,[u]);return(0,s.createElement)(t,{...c,children:d})}}function cf(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Dd({...Ad(n)?Jd:Kd,preloadedFeatures:e,useRender:lf(r),createVisualElement:t,Component:n})}}const uf={current:null},df={current:!1},ff=[...As,Fi,Xi],pf=new WeakMap,mf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hf{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=vs,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=Ha.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Qa.render(this.render,!1,!0))};const{latestValues:s,renderState:l,onUpdate:c}=a;this.onUpdate=c,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=i,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=yd(t),this.isVariantNode=bd(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==s[e]&&ri(t)&&t.set(s[e],!1)}}mount(e){this.current=e,pf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),df.current||function(){if(df.current=!0,xd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>uf.current=e.matches;e.addListener(t),t()}else uf.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||uf.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){pf.delete(this.current),this.projection&&this.projection.unmount(),Va(this.notifyUpdate),Va(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Pa.has(e),r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Qa.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Ed){const t=Ed[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<mf.length;t++){const n=mf[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=e["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const o=t[r],a=n[r];if(ri(o))e.addValue(r,o);else if(ri(a))e.addValue(r,ti(o,{owner:e}));else if(a!==o)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,ti(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=ti(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Es(r)||bi(r))?r=parseFloat(r):(o=r,!ff.find(js(o))&&Xi.test(t)&&(r=ss(e,t))),this.setBaseTarget(e,ri(r)?r.get():r)),ri(r)?r.get():r;var o}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=Ko(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||ri(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new qa),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class gf extends hf{constructor(){super(...arguments),this.KeyframeResolver=Ls}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ri(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class wf extends gf{constructor(){super(...arguments),this.type="html",this.renderInstance=Zd}readValueFromInstance(e,t){if(Pa.has(t)){const e=is(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Ms(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Tc(e,t)}build(e,t,n){Ud(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return $d(e,t,n)}}class yf extends gf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=gc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Pa.has(t)){const e=is(t);return e&&e.default||0}return t=Wd.has(t)?t:ai(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Xd(e,t,n)}build(e,t,n){Vd(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Gd(e,t,0,r)}mount(e){this.isSVGTag=Yd(e.tagName),super.mount(e)}}const bf=(e,t)=>Ad(e)?new yf(t):new wf(t,{allowProjection:e!==s.Fragment}),vf=Go(cf({...Wl,...pd,...ad,...md},bf)),xf=(0,s.createContext)({}),Nf=xf.Provider,Ef=()=>(0,s.useContext)(xf),_f=(e,t,n)=>{if(!e||!t)return{open:()=>({}),closed:()=>({})};const r=e?.getBoundingClientRect(),o=t?.getBoundingClientRect(),a=n?r?.x-o?.x+r?.width/2:o?.width-(o?.right-r?.x)+r?.width/2,i=r?.y-o?.y+r?.height/2;return{open:(e=1e3)=>({clipPath:`circle(${2*e+200}px at ${a}px ${i}px)`,background:"rgb(255, 255, 255, 1)",transition:{type:"spring",stiffness:20,restDelta:2,background:{duration:0}}}),closed:{clipPath:`circle(${r?.width/2}px at ${a}px ${i}px)`,background:"rgb(255, 255, 255, 0)",transition:{delay:.5,type:"spring",stiffness:400,damping:40,background:{duration:0,delay:1e3}}}}},Mf=e=>(0,j.jsx)(vf.path,{className:"stroke-icon-primary",fill:"transparent",strokeWidth:"3",strokeLinecap:"round",...e}),If=({className:e})=>{const{toggleOpen:t,setTriggerRef:n}=Ef();return(0,j.jsx)(Ro,{ref:n,className:Se("relative z-[1] rounded-full hover:shadow-sm focus:[box-shadow:none] pointer-events-auto bg-background-primary",e),variant:"ghost",size:"xs",onClick:t,"aria-label":"Toggle menu",icon:(0,j.jsxs)(vf.svg,{className:"shrink-0 stroke-icon-primary",width:"23",height:"23",variants:{open:{viewBox:"0 0 20 20"},closed:{viewBox:"0 0 23 18"}},children:[(0,j.jsx)(Mf,{variants:{closed:{d:"M 2 2.5 L 20 2.5"},open:{d:"M 3 16.5 L 17 2.5"}}}),(0,j.jsx)(Mf,{d:"M 2 9.423 L 20 9.423",variants:{closed:{opacity:1},open:{opacity:0}},transition:{duration:.1}}),(0,j.jsx)(Mf,{variants:{closed:{d:"M 2 16.346 L 20 16.346"},open:{d:"M 3 2.5 L 17 16.346"}}})]})})},Sf={open:{transition:{staggerChildren:.07,delayChildren:.2}},closed:{transition:{staggerChildren:.05,staggerDirection:-1}}},kf=({tag:e="a",active:t,icon:n,iconPosition:r="left",className:o,children:a,...i})=>{let l=null,c=null;const u=n&&(0,s.isValidElement)(n)?(0,s.cloneElement)(n,{key:"left-icon",className:Se("size-5",t?"text-brand-800":"text-icon-secondary",n.props?.className??"")}):null;switch(r){case"left":l=u;break;case"right":c=u;break;default:l=null,c=null}return(0,j.jsx)(Cf,{children:(0,j.jsxs)(e,{className:Se("w-full no-underline hover:no-underline text-text-primary text-lg font-medium flex items-center gap-2 px-2.5 py-1.5 rounded-md hover:bg-background-secondary hover:text-text-primary focus:outline-none focus:shadow-none transition ease-in-out duration-150",t?"text-text-primary bg-background-secondary":"text-text-secondary",o),...i,children:[!!l&&l,(0,j.jsx)("span",{className:"contents",children:a}),!!c&&c]})})},Df={open:{y:0,opacity:1,transition:{y:{stiffness:1e3,velocity:-100}}},closed:{y:50,opacity:0,transition:{y:{stiffness:1e3}}}},Cf=({children:e})=>(0,j.jsx)(vf.li,{className:"m-0 p-0 flex items-center justify-start w-full",variants:Df,whileHover:{scale:1.05},whileTap:{scale:.95},children:e}),jf=({children:e,className:t})=>{const{triggerRef:n,triggerOnRight:r,triggerOnLeft:o}=Ef(),[a,i]=(0,s.useState)(null);return n?(0,j.jsxs)(vf.div,{ref:i,className:Se("absolute top-0 bottom-0 w-80 h-screen",r?"right-0":"left-0",t),children:[a&&(0,j.jsx)(vf.div,{className:Se("bg-background-primary shadow-lg absolute top-0 bottom-0 w-80 border-y-0 border-l-0 border-r border-solid border-border-subtle",r?"right-0":"left-0"),variants:_f(n,a,o??!1)}),(0,j.jsx)(vf.ul,{variants:Sf,className:Se("relative mt-14 mb-0 w-full px-5 pb-5 pt-2 flex flex-col items-start justify-start gap-0.5",t),children:e})]}):null},Af=({className:e,children:t})=>{const[n,r]=function(...e){const t=(0,s.useRef)(0),[n,r]=(0,s.useState)(e[t.current]),o=(0,s.useCallback)(n=>{t.current="number"!=typeof n?((e,t,n)=>{const r=t-0;return((n-0)%r+r)%r+0})(0,e.length,t.current+1):n,r(e[t.current])},[e.length,...e]);return[n,o]}(!1,!0),[o,a]=(0,s.useState)(null),i=(0,s.useRef)(null),{height:l}=(e=>{const t=(0,s.useRef)({width:0,height:0});return(0,s.useEffect)(()=>{e.current&&(t.current.width=e.current.offsetWidth,t.current.height=e.current.offsetHeight)},[]),t.current})(i),{isRight:c=!1,isLeft:u=!0}=(e=>{if(!e)return{error:"Element not found."};const t=e.getBoundingClientRect(),n=window.innerWidth,r=n/2,o=t.right<r,a=t.left>r;return{isLeft:o,isRight:a,isCenter:!o&&!a,elementRect:{left:t.left,right:t.right,width:t.width},viewport:{width:n,center:r}}})(o);return(0,j.jsx)(Nf,{value:{isOpen:n,toggleOpen:r,setTriggerRef:e=>{(0,s.startTransition)(()=>{a(e)})},triggerRef:o,triggerOnRight:c,triggerOnLeft:u},children:(0,j.jsx)("div",{className:Se("size-6 z-[1]",e),children:(0,j.jsx)(vf.nav,{className:"h-full",initial:!1,animate:n?"open":"closed",custom:l,variants:{open:{pointerEvents:"auto"},closed:{pointerEvents:"none"}},ref:i,children:t})})})};Af.displayName="HamburgerMenu",If.displayName="HamburgerMenu.Toggle",jf.displayName="HamburgerMenu.Options",kf.displayName="HamburgerMenu.Option",Af.Options=jf,Af.Option=kf,Af.Toggle=If;const Tf=To("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Lf=(0,s.forwardRef)(({label:e="",size:t="sm",className:n="",type:r="pill",variant:o="neutral",icon:a=null,disabled:i=!1,onClose:s=()=>{},closable:l=!1,onMouseDown:c=()=>{},disableHover:u=!1},d)=>{const f={neutral:"bg-badge-background-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"};let p="",m="group relative justify-center flex items-center cursor-pointer";const h={xxs:"[&>svg]:size-3",xs:"[&>svg]:size-3",sm:"[&>svg]:size-3",md:"[&>svg]:size-4",lg:"[&>svg]:size-5"};return i?(p=f.disabled,m+=" cursor-not-allowed disabled"):p=f[o],e?(0,j.jsxs)("span",{className:Se("font-medium border-badge-border-gray flex items-center justify-center border border-solid box-border max-w-full transition-colors duration-150 ease-in-out",{xxs:"py-0.5 px-0.5 text-xs h-4",xs:"py-0.5 px-1 text-xs h-5",sm:"py-1 px-1.5 text-xs h-6",md:"py-1 px-1.5 text-sm h-7",lg:"py-1 px-1.5 text-base h-8"}[t],{pill:"rounded-full",rounded:"rounded"}[r],"gap-0.5",p,!u&&{neutral:"hover:bg-badge-hover-gray",red:"hover:bg-badge-hover-red",yellow:"hover:bg-badge-hover-yellow",green:"hover:bg-badge-hover-green",blue:"hover:bg-badge-hover-sky",inverse:"hover:bg-badge-hover-inverse",disabled:"hover:bg-badge-hover-disabled"}[o],n),ref:d,children:[a?(0,j.jsx)("span",{className:Se("justify-center flex items-center",h[t]),children:a}):null,(0,j.jsx)("span",{className:"px-1 truncate inline-block",children:e}),l&&(0,j.jsxs)("span",{className:Se(m,h[t]),onMouseDown:c,role:"button",tabIndex:0,...!i&&{onClick:s},children:[(0,j.jsx)("span",{className:"sr-only",children:`Remove ${e}`}),(0,j.jsx)(Tf,{}),(0,j.jsx)("span",{className:"absolute -inset-1"})]})]}):null});Lf.displayName="Badge";const Of=(0,s.forwardRef)(({children:e=null,tag:t="label",size:n="sm",className:r="",variant:o="neutral",required:a=!1,...i},s)=>{if(!e)return null;let l="";return a&&(l="after:content-['*'] after:text-field-required after:ml-0.5"),(0,j.jsx)(t,{ref:s,className:Se("font-medium text-field-label flex items-center gap-0.5",{xs:"text-xs [&>*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[n],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[o],l,{neutral:"",help:"font-normal",error:"font-normal",disabled:""}?.[o],r),...i,children:e})});function zf({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}Of.displayName="Label";const Pf=s.forwardRef(zf);var Rf=n(6942),Uf=n.n(Rf);const Bf=n.p+"images/cartflows-symbol.4a28363b.png";var Ff=function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(i,s)}l((r=r.apply(e,t||[])).next())})};const Qf={rssFeedURL:"",selector:"",uniqueKey:"",loaderIcon:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">\n\t<circle cx="50" cy="50" fill="none" stroke="#9f9f9f" stroke-width="10" r="35" stroke-dasharray="164.93361431346415 56.97787143782138">\n\t\t<animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"></animateTransform>\n\t</circle>\n\t</svg>',viewAll:{link:"",label:"View All"},triggerButton:{label:"",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.61703 13.1998C8.04294 13.1503 7.46192 13.125 6.875 13.125H6.25C4.17893 13.125 2.5 11.4461 2.5 9.375C2.5 7.30393 4.17893 5.625 6.25 5.625H6.875C7.46192 5.625 8.04294 5.59972 8.61703 5.55018M8.61703 13.1998C8.82774 14.0012 9.1031 14.7764 9.43719 15.5195C9.64341 15.9782 9.48685 16.5273 9.05134 16.7787L8.50441 17.0945C8.04492 17.3598 7.45466 17.1921 7.23201 16.7106C6.70983 15.5811 6.30451 14.3866 6.03155 13.1425M8.61703 13.1998C8.29598 11.9787 8.125 10.6968 8.125 9.375C8.125 8.05316 8.29598 6.77125 8.61703 5.55018M8.61703 13.1998C11.25 13.427 13.737 14.1643 15.9789 15.3124M8.61703 5.55018C11.25 5.323 13.737 4.58569 15.9789 3.43757M15.9789 3.43757C15.8808 3.12162 15.7751 2.80903 15.662 2.5M15.9789 3.43757C16.4247 4.87356 16.7131 6.37885 16.8238 7.93326M15.9789 15.3124C15.8808 15.6284 15.7751 15.941 15.662 16.25M15.9789 15.3124C16.4247 13.8764 16.7131 12.3711 16.8238 10.8167M16.8238 7.93326C17.237 8.2772 17.5 8.79539 17.5 9.375C17.5 9.95461 17.237 10.4728 16.8238 10.8167M16.8238 7.93326C16.8578 8.40942 16.875 8.8902 16.875 9.375C16.875 9.8598 16.8578 10.3406 16.8238 10.8167" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',beforeBtn:"",afterBtn:"",className:"",onClick:()=>{}},notification:{setLastPostUnixTime:null,getLastPostUnixTime:null},flyout:{title:"What's New?",innerContent:{titleLink:!0,additionalClasses:[]},excerpt:{wordLimit:500,moreSymbol:"&hellip;",readMore:{label:"Read More",className:""}},className:"",closeOnEsc:!0,closeOnOverlayClick:!0,closeBtnIcon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 18L18 6M6 6L18 18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',formatDate:null,onOpen:()=>{},onClose:()=>{},onReady:()=>{}}};class Vf{constructor(e){this.rssFeedURLs=[],this.lastPostUnixTime=0,this.multiLastPostUnixTime={},this.notificationsCount=0,this.multiNotificationCount={},this.hasNewFeeds=!1,this.multiHasNewFeeds={},this.validateArgs(e),this.parseDefaults(e),this.setElement(),this.getElement()?(this.setID(),this.setRSSFeedURLs(),Yf.setInstanceID(this.getID()),this.RSS_Fetch_Instance=new Zf(this),this.RSS_View_Instance=new Wf(this),this.setNotificationsCount(),this.setTriggers()):console.warn("WNR: Cannot find element with",this.getArgs().selector)}validateArgs(e){["rssFeedURL","selector","uniqueKey"].forEach(t=>{if(!e[t])throw new Error(`${t} is a required argument. It cannot be empty or undefined.`);if("rssFeedURL"===t){const n=e[t];Array.isArray(n)&&n.forEach(e=>{if(!(null==e?void 0:e.key))throw new Error(`The parameter "key" is required for "${t}" parameter in multi-feed mode.`);if(e.key.includes(" "))throw new Error(`The parameter "key" cannot have spaces for "${t}" parameter in multi-feed mode. Ref Key: "${e.key}"`)})}})}parseDefaults(e){var t,n;this.args=Object.assign(Object.assign(Object.assign({},Qf),e),{viewAll:Object.assign(Object.assign({},Qf.viewAll),null==e?void 0:e.viewAll),triggerButton:Object.assign(Object.assign({},Qf.triggerButton),null==e?void 0:e.triggerButton),flyout:Object.assign(Object.assign(Object.assign({},Qf.flyout),null==e?void 0:e.flyout),{innerContent:Object.assign(Object.assign({},Qf.flyout.innerContent),null===(t=null==e?void 0:e.flyout)||void 0===t?void 0:t.innerContent),excerpt:Object.assign(Object.assign({},Qf.flyout.excerpt),null===(n=null==e?void 0:e.flyout)||void 0===n?void 0:n.excerpt)})})}getArgs(){return this.args}setElement(){this.element=document.querySelector(this.args.selector)}getElement(){return this.element}setID(){const e=[this.getArgs().selector,this.getArgs().uniqueKey],t=this.getArgs().rssFeedURL;Array.isArray(t)?t.forEach(t=>{e.push(t.key)}):e.push(t),this.ID=btoa(e.join("-")).slice(-12).replace(/=/g,"")+"-"+this.getArgs().uniqueKey}isMultiFeedRSS(){return"string"!=typeof this.getArgs().rssFeedURL}setRSSFeedURLs(){const e=this.getArgs().rssFeedURL;this.isMultiFeedRSS()?Array.isArray(e)&&e.forEach(e=>{this.rssFeedURLs.push(e)}):this.rssFeedURLs.push({key:null,label:"",url:e.toString()})}getRSSFeedURLs(){return this.rssFeedURLs}getID(){return this.ID}setNotificationsCount(){return Ff(this,void 0,void 0,function*(){yield Promise.all(this.getRSSFeedURLs().map(e=>Ff(this,[e],void 0,function*({key:e}){let t=0;t="function"==typeof this.getArgs().notification.getLastPostUnixTime?yield this.getArgs().notification.getLastPostUnixTime(e,this):Yf.getLastPostUnixTime(e),this.isMultiFeedRSS()?this.multiLastPostUnixTime[e]=+t:this.lastPostUnixTime=+t}))),yield this.RSS_Fetch_Instance.fetchData().then(e=>{Object.keys(e).forEach(t=>{const n=e[t];if(!n.length)return;this.multiNotificationCount[t]=0;const r=+n[0].date,o=this.isMultiFeedRSS()?this.multiLastPostUnixTime[t]:this.lastPostUnixTime;r>o&&(n.forEach(e=>{e.date>o&&(this.isMultiFeedRSS()&&(this.multiNotificationCount[t]++,this.multiHasNewFeeds[t]=!0),this.notificationsCount++,this.hasNewFeeds=!0)}),this.RSS_View_Instance.setNotification(this.notificationsCount))})}).catch(console.error)})}getNotificationsCount(){return this.notificationsCount}setTriggers(){const e=document.getElementById(this.RSS_View_Instance.getTriggerButtonID()),t=document.getElementById(this.RSS_View_Instance.getFlyoutID()),n=t.querySelector(".whats-new-rss-flyout-inner-content"),r=document.getElementById(this.RSS_View_Instance.getFlyoutCloseBtnID()),o=document.getElementById(this.RSS_View_Instance.getFlyoutMultiFeedNavID()),a=e=>{this.RSS_Fetch_Instance.fetchData().then(r=>{n.innerHTML="";const o=r[e];if(!o.length)return;const a=+o[0].date,i=this.isMultiFeedRSS()?this.multiLastPostUnixTime[e]:this.lastPostUnixTime;o.forEach(t=>{const r=!!i&&t.date>i,o=this.getArgs().flyout.innerContent.titleLink?`<a href="${t.postLink}" target="_blank">\n\t\t\t\t\t\t\t\t<h2>${t.title}</h2>\n\t\t\t\t\t\t\t</a>`:`<h2>${t.title}</h2>`,a=`\n\t\t\t\t\t\t\t\t<div class="rss-content-header">\n\t\t\t\t\t\t\t\t\t<p>${this.RSS_View_Instance.formatDate(new Date(t.date))}</p>\n\t\t\t\t\t\t\t\t\t${o}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t${this.RSS_View_Instance.createExcerpt(t.description,t.postLink,this.getArgs().flyout.excerpt)}\n\t\t\t\t\t\t\t\t${this.RSS_View_Instance.listChildrenPosts(t.children)}\n\t\t\t\t\t\t\t`,s=this.getArgs().flyout.innerContent.additionalClasses;e&&s.push("`inner-content-item-feed-key-${key}`"),n.innerHTML+=this.RSS_View_Instance.innerContentWrapper(a,r,s.join(" "))}),this.getArgs().viewAll.link&&(n.innerHTML+=this.RSS_View_Instance.innerContentWrapper(`\n\t\t\t\t\t\t\t<a href="${this.getArgs().viewAll.link}" class="button view-all">${this.getArgs().viewAll.label}</a>\n\t\t\t\t\t\t\t`)),this.RSS_View_Instance.setIsLoading(!1),t.classList.add("ready"),this.getArgs().flyout.onReady(this),t.focus(),this.isMultiFeedRSS()||(this.lastPostUnixTime=a,this.hasNewFeeds&&("function"==typeof this.getArgs().notification.setLastPostUnixTime?this.getArgs().notification.setLastPostUnixTime(a,e):Yf.setLastPostUnixTime(a,e)))}).catch(console.error)};e.addEventListener("click",e=>{e.preventDefault();const n=window.innerWidth-document.documentElement.clientWidth;if(this.getArgs().triggerButton.onClick(this),this.RSS_View_Instance.setIsLoading(!0),t.removeAttribute("style"),t.classList.remove("closed"),t.classList.add("open"),document.body.classList.add("whats-new-rss-is-active"),n){const e=document.getElementById("whats-new-rss-styles");(null==e?void 0:e.sheet)&&e.sheet.insertRule(`.whats-new-rss-is-active { background-color: yellow; padding-right: ${n}px; }`,e.sheet.cssRules.length)}if(this.getArgs().flyout.onOpen(this),!this.isMultiFeedRSS())return void a(null);const r=o.querySelectorAll("button");r.forEach(e=>{this.RSS_View_Instance.setMultiFeedTabNotificationCount(e.dataset.feedKey,this.multiNotificationCount[e.dataset.feedKey]),e.addEventListener("click",t=>{t.preventDefault();const n=e.dataset.feedKey;this.multiNotificationCount[n]=0,this.RSS_Fetch_Instance.fetchData().then(e=>{const t=e[n][0].date;this.multiLastPostUnixTime[n]=t,!0===this.multiHasNewFeeds[n]&&("function"==typeof this.getArgs().notification.setLastPostUnixTime?this.getArgs().notification.setLastPostUnixTime(t,n):Yf.setLastPostUnixTime(t,n)),this.multiHasNewFeeds[n]=!1}).catch(console.error),r.forEach(e=>{e.classList.remove("selected");const t=e.dataset.feedKey,r=`.inner-content-item-feed-key-${t}`;document.querySelectorAll(r).forEach(e=>{n!==t?e.classList.add("hidden"):e.classList.remove("hidden")})}),e.classList.add("selected"),a(n)})}),r[0].click()});const i=()=>{t.classList.add("closed"),t.classList.remove("open"),t.classList.remove("ready"),document.body.classList.remove("whats-new-rss-is-active"),this.isMultiFeedRSS()?this.RSS_View_Instance.setNotification(Object.values(this.multiNotificationCount).filter(Boolean).length):(this.hasNewFeeds=!1,this.RSS_View_Instance.setNotification(!1)),n.innerHTML="",this.getArgs().flyout.onClose(this),e.focus()};this.getArgs().flyout.closeOnEsc&&document.addEventListener("keydown",function(e){"Escape"===e.key&&t.classList.contains("open")&&i()}),this.getArgs().flyout.closeOnOverlayClick&&t.querySelector(".whats-new-rss-flyout-overlay").addEventListener("click",i),r.addEventListener("click",i)}}class Yf{static setInstanceID(e){this.instanceID||(this.instanceID=e)}static prefixer(e,t=""){if(!this.instanceID)throw new Error("Instance ID not set.");return t?`${this.keys[e]}-${this.instanceID}-${t}`:`${this.keys[e]}-${this.instanceID}`}static _setDataExpiry(e=""){const t=(new Date).getTime()+864e5;sessionStorage.setItem(this.prefixer("SESSION_DATA_EXPIRY",e),JSON.stringify(t))}static _isDataExpired(e=""){const t=this.prefixer("SESSION_DATA_EXPIRY",e),n=window.sessionStorage.getItem(t);if(!n)return!0;const r=JSON.parse(n);return(new Date).getTime()>r&&(window.sessionStorage.removeItem(t),!0)}static setSessionData(e,t=""){return this._setDataExpiry(t),window.sessionStorage.setItem(this.prefixer("SESSION",t),e)}static getSessionData(e=""){return this._isDataExpired(e)?"{}":window.sessionStorage.getItem(this.prefixer("SESSION",e))}static setLastPostUnixTime(e,t=""){return window.localStorage.setItem(this.prefixer("LAST_LATEST_POST",t),e.toString())}static getLastPostUnixTime(e=""){return+window.localStorage.getItem(this.prefixer("LAST_LATEST_POST",e))}}Yf.keys={SESSION_DATA_EXPIRY:"whats-new-cache-expiry",LAST_LATEST_POST:"whats-new-last-unixtime",SESSION:"whats-new-cache"};class Zf{constructor(e){this.data={},this.RSS=e,this.RSS.getRSSFeedURLs().forEach(e=>{const t=JSON.parse(Yf.getSessionData(e.key));t&&t.length&&(this.data[e.key]=t)})}fetchData(){return Ff(this,void 0,void 0,function*(){if(Object.keys(this.data).length)return this.data;const e=this.RSS.getRSSFeedURLs().map(e=>Ff(this,void 0,void 0,function*(){this.data[e.key]=[];const t=yield fetch(e.url);let n=yield t.text();n=n.replace(/&raquo;/g,"&amp;raquo;"),(new DOMParser).parseFromString(n,"text/xml").querySelectorAll("item").forEach(t=>{var n;const r=t.querySelector("title").textContent,o=t.querySelector("link").textContent,a=t.querySelector("content\\:encoded, encoded"),i=a?a.textContent:"",s=t.querySelector("pubDate").innerHTML;this.data[e.key].push({title:r,date:s?+new Date(s):null,postLink:o,description:i.replace(/<a\b((?:(?!target=)[^>])*)>/g,'<a$1 target="_blank">').replace(/<p>\s*<\/p>/g,""),children:JSON.parse((null===(n=t.querySelector("children"))||void 0===n?void 0:n.innerHTML)||"{}")})}),Yf.setSessionData(JSON.stringify(this.data[e.key]),e.key)}));return yield Promise.all(e),this.data})}}class Wf{constructor(e){this.RSS=e,this.createTriggerButton(),this.createFlyOut()}getTriggerButtonID(){return`whats-new-rss-btn-${this.RSS.getID()}`}getFlyoutID(){return`whats-new-rss-flyout-${this.RSS.getID()}`}getFlyoutCloseBtnID(){return`whats-new-rss-flyout-close-${this.RSS.getID()}`}getFlyoutMultiFeedNavID(){return`whats-new-rss-flyout-multi-feed-nav-${this.RSS.getID()}`}setIsLoading(e=!1){const t=document.getElementById(this.getFlyoutID());e?t.classList.add("is-loading"):t.classList.remove("is-loading")}setNotification(e){const t=document.querySelector(`#${this.getTriggerButtonID()} .whats-new-rss-notification-badge`);e?(this.RSS.isMultiFeedRSS()?(t.innerHTML="",t.classList.add("is-multi-feed")):t.innerHTML=e>9?"9+":e.toString(),t.classList.remove("hide")):t.classList.add("hide")}createTriggerButton(){let e="";const t=this.RSS.getArgs().triggerButton.label;e=t?`\n\t\t\t${this.RSS.getArgs().triggerButton.beforeBtn}\n\t\t\t<a class="whats-new-rss-trigger-button has-label" id="${this.getTriggerButtonID()}">\n\t\t\t\t<div class="icon-badge">\n\t\t\t\t\t${this.RSS.getArgs().triggerButton.icon}\n\t\t\t\t\t<div class="whats-new-rss-notification-badge hide">0</div>\n\t\t\t\t</div>\n\t\t\t\t${t}\n\t\t\t</a>\n\t\t\t${this.RSS.getArgs().triggerButton.afterBtn}\n\t\t\t`:`\n\t\t\t${this.RSS.getArgs().triggerButton.beforeBtn}\n\t\t\t<a class="whats-new-rss-trigger-button" id="${this.getTriggerButtonID()}">\n\t\t\t\t${this.RSS.getArgs().triggerButton.icon}\n\t\t\t\t<div class="whats-new-rss-notification-badge hide">0</div>\n\t\t\t</a>\n\t\t\t${this.RSS.getArgs().triggerButton.afterBtn}\n\t\t\t`,this.RSS.getElement().innerHTML+=e}createFlyOut(){const e=["whats-new-rss-flyout","closed"];this.RSS.getArgs().flyout.className&&e.push(this.RSS.getArgs().flyout.className);let t=[];this.RSS.isMultiFeedRSS()&&(t.push(`<nav id="${this.getFlyoutMultiFeedNavID()}" class="whats-new-rss-multi-feed-nav">`),this.RSS.getRSSFeedURLs().forEach(e=>{t.push(`<button type="button" data-feed-key="${e.key}">\n\t\t\t\t\t\t${e.label}\n\t\t\t\t\t\t<div class="new-notification-count"></div>\n\t\t\t\t\t</button>\n\t\t\t\t\t`)}),t.push("</nav>"));const n=document.createElement("div");n.setAttribute("id",this.getFlyoutID()),n.setAttribute("class",e.join(" ")),n.setAttribute("role","dialog"),n.setAttribute("style","visibility:hidden"),n.innerHTML=`\n\t\t<div class="whats-new-rss-flyout-contents">\n\n\t\t\t<div class="whats-new-rss-flyout-inner-header">\n\n\t\t\t\t<div class="whats-new-rss-flyout-inner-header__title-icon-wrapper">\n\t\t\t\t\t<h3>${this.RSS.getArgs().flyout.title}</h3>\n\n\t\t\t\t\t<span class="whats-new-rss-flyout-inner-header__loading-icon">\n\t\t\t\t\t${this.RSS.getArgs().loaderIcon}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\n\t\t\t\t<button type="button" id="${this.getFlyoutCloseBtnID()}">${this.RSS.getArgs().flyout.closeBtnIcon}</button>\n\t\t\t</div>\n\n\t\t\t${t.join("")}\n\n\t\t\t<div class="whats-new-rss-flyout-inner-content">\n\t\t\t\t<div class="skeleton-container">\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t</div>\n\n\t\t<div class="whats-new-rss-flyout-overlay"></div>\n\t\t`,document.body.appendChild(n)}setMultiFeedTabNotificationCount(e,t=0){const n=document.querySelector(`#${this.getFlyoutMultiFeedNavID()} button[data-feed-key="${e}"]`);if(!n)return;const r=n.querySelector(".new-notification-count");if(t){const e=t>9?"9+":t;r.innerHTML=e.toString()}else r.innerHTML=""}innerContentWrapper(e,t=!1,n=""){const r=["whats-new-rss-flyout-inner-content-item"];return t&&r.push("rss-new-post"),n&&r.push(n),`\n\t\t<div class="${r.join(" ")}">\n\t\t\t${t?'<small class="new-post-badge">New ✨</small>':""}\n\t\t\t${e}\n\t\t</div>\n\t\t`}createExcerpt(e,t,n){const{wordLimit:r,moreSymbol:o,readMore:a}=n;if(!r)return e;const i=e.replace(/<[^>]*>/g,"").split(/\s+/);let s=i.slice(0,r).join(" ");return o&&(s+=o),r>i.length?e:t&&(null==a?void 0:a.label)?`<p>${s} <a href="${t}" target="_blank" class="${a.className}">${a.label}</a></p>`:`<p>${s}</p>`}listChildrenPosts(e){const t=Object.values(e);if(!t.length)return"";const n=document.createElement("details"),r=document.createElement("summary"),o=document.createElement("div");return t.forEach(e=>{const t=(new DOMParser).parseFromString(e.post_content,"text/html"),n=document.createElement("div");n.classList.add("sub-version-item"),n.innerHTML=`\n\t\t\t\t<div class="sub-version-header">\n\t\t\t\t\t<h4 class="sub-version-title">${e.post_title}</h4>\n\t\t\t\t\t<span class="sub-version-date">${this.formatDate(new Date(e.post_date))}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class="sub-version-content">${t.documentElement.textContent}</div>\n\t\t\t`,o.appendChild(n)}),r.innerHTML='<p class="text-see-more">See More</p><p class="text-see-less">See Less</p>',n.appendChild(r),n.appendChild(o),o.classList.add("sub-version-items-wrapper"),n.classList.add("whats-new-rss-sub-version-details"),n.outerHTML}formatDate(e){if("function"==typeof this.RSS.getArgs().flyout.formatDate)return this.RSS.getArgs().flyout.formatDate(e);const t=new Date,n=e.getTime(),r=t.getTime()-n,o=36e5,a=24*o,i=7*a,s=30*a;if(r<6e4)return"Just now";if(r<o){const e=Math.floor(r/6e4);return`${e} minute${e>1?"s":""} ago`}if(r<a){const e=Math.floor(r/o);return`${e} hour${e>1?"s":""} ago`}if(r<i){const e=Math.floor(r/a);return`${e} day${e>1?"s":""} ago`}if(r<s){const e=Math.floor(r/i);return`${e} week${e>1?"s":""} ago`}{const e=Math.floor(r/s);return`${e} month${e>1?"s":""} ago`}}}const Gf=function(){const e=cartflows_admin?.whats_new_rss_feed;return function({selector:e,...t}){const n=(0,s.useRef)(null);(0,s.useEffect)(()=>{var r;return async function(){const e="whats-new-rss-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=await async function(){return'@import url(https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap);.whats-new-rss-is-active{overflow:hidden}.whats-new-rss-trigger-button{display:flex;align-items:center;position:relative;width:auto;padding:0!important;cursor:pointer}.whats-new-rss-trigger-button.has-label{align-items:end;gap:10px}.whats-new-rss-trigger-button.has-label .icon-badge{position:relative;line-height:1}.whats-new-rss-trigger-button.has-label .icon-badge .whats-new-rss-notification-badge{top:-12px;right:-10px}.whats-new-rss-trigger-button .whats-new-rss-notification-badge{position:absolute;top:-8px;right:-9px;width:18px;height:18px;font-size:10px;line-height:20px;text-align:center;border-radius:10px;color:#fff;background:#ff580e;display:flex;align-items:center;justify-content:center;transition:transform .2s ease-in-out}.whats-new-rss-trigger-button .whats-new-rss-notification-badge.is-multi-feed{top:-2px;right:-2px;font-size:0;width:10px;height:10px}.whats-new-rss-trigger-button .whats-new-rss-notification-badge.hide{display:none!important}.whats-new-rss-trigger-button:hover .whats-new-rss-notification-badge{transform:unset}.whats-new-rss-flyout{position:fixed;top:0;right:0;bottom:0;width:100%;z-index:99999;transition:visibility .3s ease-in-out;font-family:Figtree,sans-serif;height:100vh;font-size:15px;font-weight:400;line-height:20px;color:#374151;margin-bottom:5px}.whats-new-rss-flyout *,.whats-new-rss-flyout ::after,.whats-new-rss-flyout ::before{box-sizing:border-box}.whats-new-rss-flyout .lightbox-trigger,.whats-new-rss-flyout.hidden{display:none}.whats-new-rss-flyout.is-loading .whats-new-rss-flyout-inner-header__loading-icon{display:block;margin:auto}.whats-new-rss-flyout.is-loading .whats-new-rss-flyout-inner-header__loading-icon svg{display:block;background:0 0;width:25px;height:25px}.whats-new-rss-flyout p{font-size:14px;font-weight:400;line-height:20px;color:#374151;margin-bottom:15px}.whats-new-rss-flyout p a{color:#1170ff}.whats-new-rss-flyout .wp-block-uagb-buttons{background:#ff6c0a;padding:10px 18px;width:fit-content;color:#fff;border-radius:6px;box-shadow:0 1px 2px rgba(0,0,0,.05);margin-bottom:15px}.whats-new-rss-flyout .wp-block-uagb-buttons .uagb-button__link{color:#fff;font-size:1rem;font-weight:600;line-height:1.5rem}.whats-new-rss-flyout .ast-oembed-container{position:relative;padding-top:56.25%;height:0;overflow:hidden;max-width:100%;height:auto}.whats-new-rss-flyout .wp-has-aspect-ratio iframe{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.whats-new-rss-flyout .whats-new-rss-flyout-contents{position:fixed;display:flex;right:0;width:30%;height:100%;flex-direction:column;background-color:#fff;transition:transform .3s ease-in-out;z-index:9999}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header{display:flex;justify-content:space-between;align-items:center;padding:16px!important;border-bottom:1px solid #e5e7eb}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header [id^=whats-new-rss-flyout-close-]{width:24px;height:24px;display:flex;align-items:center;justify-content:center}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header button{border:none;background:0 0;font-size:30px;cursor:pointer;color:#111827;padding:0;margin:0;box-shadow:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header .whats-new-rss-flyout-inner-header__title-icon-wrapper{display:flex;gap:10px;padding:0 4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header .whats-new-rss-flyout-inner-header__title-icon-wrapper h3{margin:0;padding:0;color:#111827;font-weight:600;font-size:16px;line-height:24px;margin-bottom:0!important}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav{display:flex;padding:0 30px;border-bottom:1px solid #e5e7eb;gap:2em;overflow:auto;white-space:nowrap}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button{position:relative;background:0 0;color:inherit;padding:15px 0;border-bottom:2px solid transparent}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button:focus,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button:hover{border-color:inherit}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button.selected{border-color:#5d5d5d}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button .new-notification-count{position:absolute;top:0;right:-10px;width:20px;font-size:10px;line-height:20px;text-align:center;border-radius:10px;color:#fff;background:red}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content{flex:1;overflow-y:auto}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .skeleton-container{margin:30px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item{border-bottom:1px solid #d8dfe9;padding:20px;color:#374151;font-weight:400;font-size:14px;line-height:20px;display:flex;flex-direction:column}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1){margin:8px 0 8px 0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:first-child{margin-top:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1):is(ul){margin-top:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1):is(div):has(figure){margin-bottom:12px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item img{margin:0!important}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .wp-smiley{display:inline-block;margin:0;min-height:1em;margin-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>*{margin:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h2{font-size:22px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h3{font-size:20px;font-weight:600;line-height:1.5em;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h4{font-size:18px;font-weight:600;line-height:1.5em;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h5{font-size:16px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h6{font-size:13px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.skeleton-row{height:25vh;margin:40px 0;background:linear-gradient(90deg,#eee 25%,#ddd 50%,#eee 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.rss-new-post{position:relative}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.rss-new-post .new-post-badge{background:#ff6c0a;border-radius:4px;top:22px;right:24px;padding:0 4px;color:#fff;position:absolute}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header{display:flex;flex-direction:column;gap:4px;padding:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header p{color:#6b7280;margin:0;padding:0;font-weight:500;line-height:16px;font-size:12px;margin-bottom:0!important}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header h2{margin:0;color:#111827;font-weight:600;line-height:30px;font-size:20px;padding:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item p{padding:0;font-size:14px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item a{color:#1170ff;text-decoration:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure{margin:10px 0;margin-bottom:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure.wp-block-embed.is-type-video{position:relative;width:100%;height:0;padding-bottom:56.25%}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;max-width:100%}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item img{box-sizing:border-box;height:auto;max-width:100%;vertical-align:bottom;margin-bottom:15px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item video{vertical-align:middle;width:100%}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item strong{font-weight:600}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul{padding-inline-start:20px;margin-left:10px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol li,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul li{font-size:14px;font-weight:400;line-height:20px;color:#374151;margin:0 0 4px 0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol li:last-child,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul li:last-child{margin-bottom:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul{list-style-type:disc}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol{list-style-type:decimal}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details{line-height:20px;font-size:.9em;margin:10px 0;background:#f9fafb}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary{display:flex;justify-content:space-between;cursor:pointer;padding:20px 15px;height:1em;line-height:20px;font-weight:800}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary::after{content:"⌃";font-size:20px;transform:rotateX(180deg);font-weight:800}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary .text-see-more{display:block}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary .text-see-less{display:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary{border-bottom:1px solid #e2e8f0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary::after{transform:rotateX(45deg)}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary .text-see-more{display:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary .text-see-less{display:block}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item{position:relative;padding:1em;border-bottom:1px solid #e2e8f0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item .sub-version-header{display:flex;justify-content:space-between}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item .sub-version-content{margin-top:1em}.whats-new-rss-flyout .whats-new-rss-flyout-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.5);transition:all .3s ease-in-out}.whats-new-rss-flyout.closed{visibility:hidden}.whats-new-rss-flyout.closed .whats-new-rss-flyout-overlay{opacity:0;visibility:hidden}.whats-new-rss-flyout.closed .whats-new-rss-flyout-contents{transform:translateX(100%)}.whats-new-rss-flyout .whats-new-rss-flyout-inner-header__loading-icon{display:none}@keyframes shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}@media screen and (max-width:1024px){.whats-new-rss-flyout .whats-new-rss-flyout-contents{width:40%}}@media screen and (max-width:768px){.whats-new-rss-flyout .whats-new-rss-flyout-contents{width:85%}}'}(),document.head.appendChild(t)}}(),n.current||(n.current=(r={selector:e,...t},new Vf(r))),()=>{n.current&&"function"==typeof n.current.destroy&&n.current.destroy()}},[e,...Object.values(t)]),n.current}({uniqueKey:"cartflows",rssFeedURL:1<e.length?e:e[0]?.url,selector:"#wcf-whats-new-content",triggerButton:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 m-1 text-text-primary"><path d="m3 11 18-5v12L3 13v-2z"/><path d="M11.6 16.8a3 3 0 1 1-5.8-1.6"/></svg>'},flyout:{title:(0,C.__)("What's New?","cartflows"),formatDate:e=>`${e.toLocaleDateString("en-US",{weekday:"long"})} ${e.toLocaleDateString("en-US",{month:"long"})} ${e.getDate()}, ${e.getFullYear()}`}}),(0,i.createElement)("div",{id:"wcf-whats-new-content",className:"[&>a]:p-0.5 [&>a]:pl-0"})},Hf=To("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]),$f=To("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);var Xf=n(1455),qf=n.n(Xf);const Jf=(e,t=!0)=>new Promise((n,r)=>{const o=new window.FormData;o.append("action","cartflows_activate_plugin"),o.append("init",e.init),o.append("security",cartflows_admin.activate_plugin_nonce),qf()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(e=>{console.log("Helper.js",e),e.success?(n(e),t&&window.location.reload()):r(e)})});function Kf({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const ep=s.forwardRef(Kf),tp=function(){const e=cartflows_admin?.cf_pro_status,t=(0,C.__)("upgrading to PRO","cartflows"),n=!wcfCartflowsPro()&&"inactive"===e,[r,o]=(0,s.useState)(!1),a=getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans);let l="";return n?l=(0,C.__)("activating CartFlows Pro","cartflows"):wcfCartflowsPro()||(l=t),(0,i.createElement)("div",{className:"bg-primary-50 p-3 z-20 relative"},(0,i.createElement)("p",{className:"wcf-main-upgrade-pro-notice text-sm flex justify-center m-0"},(0,C.__)("You're on","cartflows")," ",(0,i.createElement)("span",{className:"font-semibold"},(0,C.__)("CartFlows Free.","cartflows")," "),(0,C.__)("Unlock upsells, order bumps & more revenue by","cartflows")," ",n?(0,i.createElement)("span",{className:"text-brand-600 hover:text-brand-800 font-semibold flex items-center gap-1 cursor-pointer",onClick:()=>{o(!0),Jf({slug:"cartflows-pro",init:"cartflows-pro/cartflows-pro.php",name:"cartflows-pro"}).then(e=>{console.log(e),o(!0)}).catch(e=>{console.log(e),o(!1)})}},r&&(0,i.createElement)(Pf,{className:`w-4 h-4 stroke-2 ${r?"wcf-processing animate-spin":""} `}),r?(0,C.__)("Activating","cartflows"):l):(0,i.createElement)("a",{href:a,target:"_blank",className:"text-brand-600 hover:text-brand-800 font-semibold flex items-center gap-1",rel:"noreferrer"},l,(0,i.createElement)(ep,{className:"w-4 h-[18px] stroke-2 text-brand-500"}))))};class np extends s.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function rp({children:e,isPresent:t}){const n=(0,s.useId)(),r=(0,s.useRef)(null),o=(0,s.useRef)({width:0,height:0,top:0,left:0}),{nonce:a}=(0,s.useContext)(gd);return(0,s.useInsertionEffect)(()=>{const{width:e,height:i,top:s,left:l}=o.current;if(t||!r.current||!e||!i)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return a&&(c.nonce=a),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${i}px !important;\n top: ${s}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[t]),(0,j.jsx)(np,{isPresent:t,childRef:r,sizeRef:o,children:s.cloneElement(e,{ref:r})})}const op=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:a,mode:i})=>{const l=Td(ap),c=(0,s.useId)(),u=(0,s.useCallback)(e=>{l.set(e,!0);for(const e of l.values())if(!e)return;r&&r()},[l,r]),d=(0,s.useMemo)(()=>({id:c,initial:t,isPresent:n,custom:o,onExitComplete:u,register:e=>(l.set(e,!1),()=>l.delete(e))}),a?[Math.random(),u]:[n,u]);return(0,s.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[n]),s.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),"popLayout"===i&&(e=(0,j.jsx)(rp,{isPresent:n,children:e})),(0,j.jsx)(Uc.Provider,{value:d,children:e})};function ap(){return new Map}const ip=e=>e.key||"";function sp(e){const t=[];return s.Children.forEach(e,e=>{(0,s.isValidElement)(e)&&t.push(e)}),t}const lp=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:a="sync",propagate:i=!1})=>{const[l,c]=Bc(i),u=(0,s.useMemo)(()=>sp(e),[e]),d=i&&!l?[]:u.map(ip),f=(0,s.useRef)(!0),p=(0,s.useRef)(u),m=Td(()=>new Map),[h,g]=(0,s.useState)(u),[w,y]=(0,s.useState)(u);Id(()=>{f.current=!1,p.current=u;for(let e=0;e<w.length;e++){const t=ip(w[e]);d.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}},[w,d.length,d.join("-")]);const b=[];if(u!==h){let e=[...u];for(let t=0;t<w.length;t++){const n=w[t],r=ip(n);d.includes(r)||(e.splice(t,0,n),b.push(n))}return"wait"===a&&b.length&&(e=b),y(sp(e)),void g(u)}const{forceRender:v}=(0,s.useContext)(Fc);return(0,j.jsx)(j.Fragment,{children:w.map(e=>{const s=ip(e),h=!(i&&!l)&&(u===w||d.includes(s));return(0,j.jsx)(op,{isPresent:h,initial:!(f.current&&!n)&&void 0,custom:h?void 0:t,presenceAffectsLayout:o,mode:a,onExitComplete:h?void 0:()=>{if(!m.has(s))return;m.set(s,!0);let e=!0;m.forEach(t=>{t||(e=!1)}),e&&(null==v||v(),y(p.current),i&&(null==c||c()),r&&r())},children:e},s)})})},cp=To("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),up=(0,s.createContext)({}),dp=()=>(0,s.useContext)(up),fp=({size:e="md",children:t,className:n})=>(0,j.jsx)(up.Provider,{value:{size:e},children:(0,j.jsx)("div",{className:Se("flex flex-col bg-background-primary p-2",n),children:t})});fp.displayName="Menu";const pp=({heading:e,arrow:t=!1,showArrowOnHover:n=!1,open:r=!0,onClick:o,children:a,className:i})=>{const[l,c]=(0,s.useState)(r),[u,d]=(0,s.useState)(!1),{size:f}=dp(),p={sm:"text-xs",md:"text-sm"}[f??"md"],m={sm:"size-4",md:"size-5"}[f??"md"],h=()=>{c(!l),o&&o(!l)};return(0,j.jsxs)("div",{children:[!!e&&(0,j.jsxs)("div",{role:"button",tabIndex:0,onClick:h,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&h()},onMouseEnter:()=>n&&d(!0),onMouseLeave:()=>n&&d(!1),className:Se("text-text-primary bg-transparent cursor-pointer flex justify-between items-center gap-1",p,e?"p-1":"p-0",i),"aria-expanded":l,children:[(0,j.jsx)("span",{className:"text-text-tertiary",children:e}),t&&(0,j.jsx)(vf.span,{className:"flex items-center text-border-strong",initial:"hidden",animate:n?l||u?"visible":"hidden":"visible",exit:"hidden",variants:{visible:{opacity:1},hidden:{opacity:0}},transition:{duration:.15},children:(0,j.jsx)(vf.span,{className:"inline-flex p-1",variants:{open:{rotate:180},closed:{rotate:0}},animate:l?"open":"closed",transition:{duration:.15},children:(0,j.jsx)(cp,{className:Se("shrink-0",m)})})})]}),(0,j.jsx)(lp,{initial:!1,children:l&&(0,j.jsx)(vf.ul,{role:"menu",variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow flex gap-0.5 flex-col m-0 bg-white rounded p-0",children:a})})]})};pp.displayName="Menu.List";const mp=({disabled:e=!1,active:t,onClick:n,children:r,className:o,...a})=>{const{size:i}=dp(),s={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"}[i??"md"];return(0,j.jsx)("li",{role:"menuitem",tabIndex:e?-1:0,onClick:e?void 0:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&n?.()},className:Se("flex p-1 gap-1 items-center bg-transparent border-none rounded text-text-secondary cursor-pointer m-0",s,"hover:bg-background-secondary hover:text-text-primary",e?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",t?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"","transition-colors duration-300 ease-in-out",o),"aria-disabled":e,...a,children:r})};mp.displayName="Menu.Item";const hp=({variant:e="solid",className:t})=>{const n={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"}[e];return(0,j.jsx)("li",{className:"m-0 p-0 list-none",role:"separator","aria-hidden":"true",children:(0,j.jsx)("hr",{className:Se("w-full border-0 border-t border-border-subtle",n,t)})})};hp.displayName="Menu.Separator",fp.List=pp,fp.Item=mp,fp.Separator=hp;const gp=(0,s.createContext)({}),yp=()=>(0,s.useContext)(gp),bp=({placement:e="bottom",offset:t=10,boundary:n="clippingAncestors",children:r,className:o})=>{const[a,i]=(0,s.useState)(!1),{refs:l,floatingStyles:c,context:u}=uo({open:a,onOpenChange:i,placement:e,strategy:"fixed",middleware:[Bn(t),Qn({boundary:n}),Fn({boundary:n})],whileElementsMounted:jn}),d=ao(u),f=co(u),p=Eo(u,{role:"menu"}),{getReferenceProps:m,getFloatingProps:h}=ho([d,f,p]),{isMounted:g,styles:w}=Io(u,{duration:150,initial:{opacity:0,scale:.95},open:{opacity:1,scale:1},close:{opacity:0,scale:.95}}),y=()=>i(e=>!e);return(0,j.jsx)(gp.Provider,{value:{refs:l,handleClose:()=>i(!1),isMounted:g,styles:w,floatingStyles:c,getFloatingProps:h},children:(0,j.jsxs)("div",{className:Se("relative inline-block",o),children:[s.Children.map(r,e=>s.isValidElement(e)&&"DropdownMenu.Trigger"===e?.type?.displayName?(0,s.cloneElement)(e,{ref:l.setReference,onClick:y,...m()}):null),s.Children.toArray(r).filter(e=>s.isValidElement(e)&&["DropdownMenu.Portal","DropdownMenu.ContentWrapper"].includes(e.type.displayName||"")).map(e=>e)]})})};bp.displayName="DropdownMenu";const vp=({children:e,className:t})=>{const{refs:n,floatingStyles:r,getFloatingProps:o,isMounted:a,styles:i}=yp();return a&&(0,j.jsx)("div",{ref:n.setFloating,className:t,style:{...r,...i},...o(),children:s.Children.map(e,e=>"DropdownMenu.Content"===e?.type?.displayName?e:null)})};vp.displayName="DropdownMenu.ContentWrapper";const xp=({children:e,root:t,id:n})=>(0,j.jsx)(Zr,{id:n,root:t,children:e});xp.displayName="DropdownMenu.Portal";const Np=s.forwardRef(({children:e,className:t,...n},r)=>(0,s.isValidElement)(e)?s.cloneElement(e,{className:Se(t,e.props.className),ref:r,...n}):(0,j.jsx)("div",{ref:r,className:Se("cursor-pointer",t),role:"button",tabIndex:0,...n,children:e}));Np.displayName="DropdownMenu.Trigger";const Ep=({children:e,className:t,...n})=>(0,j.jsx)("div",{className:Se("border border-solid border-border-subtle rounded-md shadow-lg overflow-hidden",t),children:(0,j.jsx)(fp,{...n,children:e})});Ep.displayName="DropdownMenu.Content";const _p=e=>(0,j.jsx)(fp.List,{...e});_p.displayName="DropdownMenu.List";const Mp=({children:e,as:t=fp.Item,...n})=>{const{handleClose:r}=yp();return e?t===s.Fragment&&(0,s.isValidElement)(e)?(0,s.cloneElement)(e,{onClick:ke(e.props?.onClick,r)}):(0,j.jsx)(t,{...n,className:Se("px-2",n.className),onClick:ke(n.onClick,r),children:e}):null};Mp.displayName="DropdownMenu.Item";const Ip=e=>(0,j.jsx)(fp.Separator,{...e});function Sp({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}Ip.displayName="DropdownMenu.Separator",bp.Trigger=Np,bp.Content=Ep,bp.List=_p,bp.Item=Mp,bp.Separator=Ip,bp.Portal=xp,bp.ContentWrapper=vp;const kp=s.forwardRef(Sp);function Dp({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"}))}const Cp=s.forwardRef(Dp);function jp({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 9v.906a2.25 2.25 0 0 1-1.183 1.981l-6.478 3.488M2.25 9v.906a2.25 2.25 0 0 0 1.183 1.981l6.478 3.488m8.839 2.51-4.66-2.51m0 0-1.023-.55a2.25 2.25 0 0 0-2.134 0l-1.022.55m0 0-4.661 2.51m16.5 1.615a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V8.844a2.25 2.25 0 0 1 1.183-1.981l7.5-4.039a2.25 2.25 0 0 1 2.134 0l7.5 4.039a2.25 2.25 0 0 1 1.183 1.98V19.5Z"}))}const Ap=s.forwardRef(jp);function Tp({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const Lp=s.forwardRef(Tp),Op=[{label:(0,C.__)("Funnels","cartflows"),type:"flows",icon:kp},{label:(0,C.__)("Conversions","cartflows"),type:"conversion",icon:Cp},{label:(0,C.__)("Opt-in","cartflows"),type:"optin",icon:Ap}],zp=function({menu:e,isEditorApp:t,activePage:n,activePath:r}){const o=n===e.slug&&r===e.path,a=(0,h.useHistory)(),s=Uf()("h-full text-sm font-medium no-underline px-1 content-center relative inline-flex items-center gap-1 focus:outline-none focus:[box-shadow:none] bg-transparent border-0 shadow-none outline-none cursor-pointer hover:text-brand-500 transition-colors duration-200",{'text-brand-500 before:content-[""] before:absolute before:h-px before:bg-brand-500 before:bottom-0 before:inset-x-0':o,"text-text-secondary":!o});return(0,i.createElement)(bp,{placement:"bottom-start",className:"h-full ss-007"},(0,i.createElement)(bp.Trigger,null,(0,i.createElement)("button",{className:s},(0,i.createElement)("span",{className:"relative h-full inline-flex items-center gap-1"},e.name,(0,i.createElement)(Lp,{className:"w-4 h-4","aria-hidden":"true"})))),(0,i.createElement)(bp.ContentWrapper,null,(0,i.createElement)(bp.Content,{size:"sm"},(0,i.createElement)(bp.List,null,Op.map(n=>(0,i.createElement)(bp.Item,{key:n.type,onClick:()=>((n=null)=>{const r=`admin.php?page=${e.slug}&path=${e.path}`;t?window.location.href=n?`${r}&type=${n}`:r:a.push({pathname:"admin.php",search:n?`?page=${e.slug}&path=${e.path}&type=${n}`:`?page=${e.slug}&path=${e.path}`})})(n.type),className:"hover:bg-brand-25 hover:text-brand-600"},(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(n.icon,{className:"w-4 h-4 stroke-[1.5]","aria-hidden":"true"}),n.label)))))))},Pp=({label:e="PRO"})=>(0,i.createElement)(Lf,{label:e,size:"xs",type:"pill",className:"!bg-brand-25 !text-brand-600 !border-brand-500/20",disableHover:!0}),Rp=({title:e,children:t,onClick:n,icon:r})=>(0,i.createElement)(Le.Item,{className:"p-1 gap-2"},(0,i.createElement)(Wo,{content:e,placement:"bottom",variant:"dark"},t||(0,i.createElement)(Ro,{size:"xs",variant:"ghost",className:"p-0 focus:[box-shadow:none] [box-shadow:none] text-text-primary",onClick:n,icon:r}))),Up=function(){const[{license_status:e,canvasMode:t}]=f(),n=cartflows_admin?.current_user_can_manage_cartflows,[r,o]=(0,s.useState)({isProcessing:!1,buttonText:""}),{isProcessing:a,buttonText:l}=r,c=[{name:(0,C.__)("Dashboard","cartflows"),slug:cartflows_admin.home_slug,path:"",url:"",visible:!0},{name:(0,C.__)("Funnels","cartflows"),slug:cartflows_admin.home_slug,path:"flows",url:"",visible:!0},{name:(0,C.__)("Store Checkout","cartflows"),slug:cartflows_admin.home_slug,path:"store-checkout",url:""!==cartflows_admin.global_checkout_id?"&action=wcf-edit-flow&flow_id="+cartflows_admin.global_checkout_id:"",visible:!0},{name:(0,C.__)("Analytics","cartflows"),slug:cartflows_admin.home_slug,path:"analytics",url:"",visible:n},{name:(0,C.__)("Settings","cartflows"),slug:cartflows_admin.home_slug,path:"settings",url:"",visible:n},{name:(0,C.__)("Learn","cartflows"),slug:cartflows_admin.home_slug,path:"learn",url:"",visible:!0},{name:(0,C.__)("Free vs Pro","cartflows"),slug:cartflows_admin.home_slug,path:"free-vs-pro",url:"",visible:!wcfCartflowsPro()}].filter(e=>e.visible),u=(0,h.useHistory)(),d=new URLSearchParams((0,h.useLocation)()?.search),p=d.get("page")?d.get("page"):cartflows_admin.home_slug;let m=d.get("path")?d.get("path"):"";"store-checkout-library"===m&&(m="store-checkout");const g=["wcf-edit-flow","wcf-edit-step"].includes(d.get("action"));let w="",y="",b="";const v=cartflows_admin?.cf_pro_status;wcfCartflowsPro()||"inactive"!==v?wcfCartflowsPro()?wcfCartflowsPro()&&"Activated"!==e?(w=(0,C.__)("Unlicensed","cartflows"),y=cartflows_admin.cf_pro_type):(w=(0,C.__)("Licensed","cartflows"),y=cartflows_admin.cf_pro_type):w=(0,C.__)("Upgrade to Pro","cartflows"):(w=(0,C.__)("Activate CartFlows Pro","cartflows"),b="activate");const x=function(e){if(e.preventDefault(),"activate"===b){const e="cartflows-pro",t="cartflows-pro/cartflows-pro.php",n="cartflows-pro";o({isProcessing:!0,buttonText:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
2 -(0,C.__)("Activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}),Jf({slug:e,init:t,name:n}).then(()=>{o({isProcessing:!0,buttonText:(0,C.__)("Successfully Activated","cartflows")}),setTimeout(()=>{o({isProcessing:!1,buttonText:(0,C.__)("Activated","cartflows")})},3e3)}).catch(()=>{o({isProcessing:!1,buttonText:(0,C.__)("Activation Failed","cartflows")})})}b||u.push({pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=settings&tab=license`})},N=e=>`admin.php?page=${e.slug}${""!==e.path?"&path="+e.path:""}${e.url}`,E=e=>Uf()("h-full text-sm font-medium no-underline px-1 content-center relative focus:outline-none focus:[box-shadow:none] hover:text-brand-500 transition-colors duration-200",{'text-brand-500 before:content-[""] before:absolute before:h-px before:bg-brand-500 before:bottom-0 before:inset-x-0':e,"text-text-secondary":!e});return(0,i.createElement)(i.Fragment,null,!wcfCartflowsPro()&&!t&&(0,i.createElement)(tp,null),(0,i.createElement)("div",{className:"wcf-main--nav-menu sticky top-0 sm:top-8 z-20"},(0,i.createElement)(Le,{className:"py-0 px-4 min-h-0 h-14 gap-4 shadow-sm bg-background-primary backdrop-blur-[5px]"},(0,i.createElement)(Le.Left,{className:"gap-3"},(0,i.createElement)(Le.Item,{className:"w-auto h-auto lg:hidden"},(0,i.createElement)(Af,null,(0,i.createElement)(Af.Toggle,{className:"size-6"}),(0,i.createElement)(Af.Options,null,c.map(e=>(0,i.createElement)(Af.Option,{key:e.name,active:p===e.slug&&m===e.path,href:N(e),iconPosition:"left",rel:"noopener noreferrer",tag:"a",target:"_self"},e.name)),!wcfCartflowsPro()&&(0,i.createElement)(Af.Option,{href:getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans),iconPosition:"left",rel:"noopener noreferrer",tag:"a",target:"_blank",className:"text-link-primary gap-1"},(0,C.__)("Upgrade to Pro","cartflows")," ",(0,i.createElement)(Hf,{className:"!size-5"}))))),(0,i.createElement)(Le.Item,null,(0,i.createElement)("img",{className:"block h-8 w-auto",src:Bf,alt:"CartFlows"}))),(0,i.createElement)(Le.Middle,{align:"left",className:"h-full hidden lg:flex"},(0,i.createElement)(Le.Item,null,(0,i.createElement)("nav",{className:"flex items-center gap-4 h-full"},c.map(e=>"analytics"===e.path?(0,i.createElement)(zp,{key:e.name,menu:e,isEditorApp:g,activePage:p,activePath:m}):(e=>{const t=p===e.slug&&m===e.path;return g?(0,i.createElement)("a",{key:e.name,href:N(e),className:E(t)},e.name):(0,i.createElement)(S,{key:e.name,to:{pathname:"admin.php",search:`?page=${e.slug}${""!==e.path?"&path="+e.path:""}${e.url}`},className:E(t)},e.name)})(e)))),!wcfCartflowsPro()&&(0,i.createElement)(Le.Item,null,"inactive"===v?(0,i.createElement)(Ro,{icon:a?(0,i.createElement)(Pf,{className:"w-4 h-4 animate-spin"}):null,iconPosition:"left",variant:"link",size:"sm",className:"h-full text-link-primary text-sm font-semibold no-underline hover:no-underline hover:text-link-primary-hover px-1 content-center [box-shadow:none] focus:[box-shadow:none] focus:outline-none",onClick:x},a?l:w):(0,i.createElement)(Ro,{icon:(0,i.createElement)(Hf,{className:"!size-5"}),iconPosition:"right",variant:"link",size:"sm",className:"h-full text-link-primary text-sm font-semibold no-underline hover:no-underline hover:text-link-primary-hover px-1 content-center [box-shadow:none] focus:[box-shadow:none] focus:outline-none",onClick:()=>window.open(getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans),"_blank","noreferrer")},w))),(0,i.createElement)(Le.Right,null,wcfCartflowsPro()&&(0,i.createElement)(Le.Item,null,(0,i.createElement)(Ro,{variant:"ghost",className:"p-0 hover:bg-transparent focus:[box-shadow:none] [box-shadow:none]",onClick:t=>{"Activated"!==e&&x(t)},icon:(0,i.createElement)(Lf,{label:w,size:"xs",variant:"Activated"===e?"green":"red"})})),(0,i.createElement)(Le.Item,{className:"flex gap-3 items-center"},(0,i.createElement)(Of,{size:"xs",variant:"neutral",className:"text-text-tertiary"},`v${cartflows_admin?.cartflows_current_version}`),wcfCartflowsPro()?(0,i.createElement)(Pp,{label:y.toUpperCase()}):(0,i.createElement)(Lf,{label:(0,C.__)("Free","cartflows"),className:"text-text-tertiary uppercase",size:"xs",variant:"neutral",type:"pill"})),(0,i.createElement)(Rp,{title:(0,C.__)("Documentation","cartflows"),icon:(0,i.createElement)($f,{className:"size-4"}),onClick:()=>window.open("https://cartflows.com/docs/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs","_blank","noopener noreferrer")}),0<cartflows_admin?.whats_new_rss_feed?.length&&(0,i.createElement)(Rp,{title:(0,C.__)("What's New","cartflows")},(0,i.createElement)(Gf,null))))))},Bp={flow_id:cartflows_admin?.flow_id?cartflows_admin?.flow_id:0,is_cf_pro:!!cartflows_admin?.is_pro&&cartflows_admin.is_pro,page_slug:cartflows_admin?.home_slug?cartflows_admin.home_slug:"cartflows",page_builder:cartflows_admin?.page_builder?cartflows_admin.page_builder:"other",global_checkout:parseInt(cartflows_admin.global_checkout),flows:[],flow_analytics:{},flow_settings:{},title:!1,flow_title:"",flow_slug:"",flow_link:"#",is_flow_instant_checkout:!1,emptySteps:!1,steps:[],options:null,current_step:null,flow_type:"flows",status:null,step_id:0,admin_url:"test_url",page_builder_name:cartflows_admin?.page_builder_name?cartflows_admin.page_builder_name:"",step_data:{},view_url:"#",edit_url:"#",edit_builder_url:"#",settings_data:{},step_title:!1,step_slug:"",design_settings:null,page_settings:null,billing_fields:null,shipping_fields:null,ob_id:null,current_ob:null,suretriggers_config:[]},Fp=(e,t)=>{switch(t.type){case"SET_FLOW_DATA":return t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.slug,{...e,title:t.data.title,flow_title:t.data.title,flow_slug:t.data.slug,flow_link:t.data.link,status:t.data.status,steps:t.data.steps,flow_settings:t.data.settings_data,emptySteps:t.data.steps.length<1,options:{...e.options,...t.data.options},flow_analytics:t.data.flow_analytics,is_flow_instant_checkout:t?.data?.options["instant-layout-style"]||!1};case"SET_FLOW_ANALYTICS":return{...e,flow_analytics:t.flow_analytics.data};case"SET_OPTION":const n=e.options;return n[t.name]=t.value,{...e,options:n};case"SET_FLOW_TITLE":return e.options.post_title=t.title,{...e,title:t.title};case"SET_STEPS":return{...e,steps:t.steps};case"SET_GLOBAL_CHECKOUT":return{...e,global_checkout:t.global_checkout};case"SET_STORE_STEPS":const r=[],o=[];e.steps.map(function(e){return"checkout"===e.type&&r.push(e),"landing"===e.type&&o.push(e),""});let a=[];return a=a.concat(r,o),t.steps.map(function(e){return void 0!==e.type&&a.push(e),""}),a=[...new Map(a.map(e=>[e.id,e])).values()],{...e,steps:a};case"SET_STEP_DATA":return t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.step_post_name,{...e,flow_title:t.data.flow_title,view_url:t.data.view,edit_url:t.data.edit?t.data.edit.replace(/&amp;/g,"&"):"",edit_builder_url:t.data.page_builder_edit?t.data.page_builder_edit.replace(/&amp;/g,"&"):"",step_data:t.data,settings_data:t.data.settings_data,design_settings:t.data.design_settings,page_settings:t.data.page_settings,custom_fields:t.data.custom_fields,billing_fields:t.data.billing_fields,shipping_fields:t.data.shipping_fields,options:{...e.options,...t.data.options},step_title:t.data.title,step_slug:t.data.step_post_name,step_id:t.data.id};case"SET_STEP_TITLE":return e.options.post_title=t.title,{...e,step_title:t.title};case"SET_OB_TITLE":const i=e.options[t.name].findIndex(e=>e.id===t.ob_id);return e.options[t.name][i].title=t.title,{...e};case"SET_OB_STATUS":const s=e.options[t.name].findIndex(e=>e.id===t.ob_id);return e.options[t.name][s].status=t.newStatus,{...e};case"SET_STEP_VIEW_URL":return{...e,view_url:t.step_view_url};case"SET_FIELDS":return"billing"===t.field_type?{...e,billing_fields:t.fields}:{...e,shipping_fields:t.fields};case"SET_OB_OPTION":const l=e.current_ob;return l[t.name]=t.value,{...e,current_ob:l};case"UPDATE_OPTIONS":return{...e,options:t.options};case"ADD_CHECKOUT_PRODUCT":const c=e.options[t.field_name];return c&&(c.push(t.product_data),e.options[t.field_name]=c),{...e};case"ADD_OPTIN_PRODUCT":case"ADD_OFFER_PRODUCT":return e.options[t.field_name]=t.product_data,{...e};case"ADD_OB_PRODUCT":return{...e,current_ob:{...e.current_ob,product:t.product.product,product_image:t.product.product_image,desc_text:t.product.desc_text}};case"REMOVE_OB_PRODUCT":const u=e.current_ob;return u.product="",u.product_image=cartflows_admin.image_placeholder,u.desc_text="Lorem Ipsum has been the industry standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.",e.current_ob=u,{...e};case"REMOVE_OFFER_PRODUCT":case"REMOVE_OPTIN_PRODUCT":return e.options[t.field_name]&&(e.options[t.field_name]=""),{...e};case"REMOVE_CHECKOUT_PRODUCT":const d=t.unique_id,f=e.options[t.field_name];return d&&f&&(e.options[t.field_name]=f.filter(function(e){return e.unique_id!==d})),{...e};case"UPDATE_CHECKOUT_PRODUCTS":return e.options[t.field_name]=t.products,{...e};case"UPDATE_ORDER_BUMP":return e.options[t.name]=t.order_bumps,{...e};case"REMOVE_ORDER_BUMP":const p=t.ob_id,m=e.options[t.name];return e.options[t.name]=m.filter(function(e){return e.id!==p}),{...e};case"SET_CURRENT_OB":const h=e.options["wcf-order-bumps"].findIndex(e=>e.id===t.ob_id);return e.options["wcf-order-bumps"][h]=t.current_ob,{...e,ob_id:t.ob_id,current_ob:t.current_ob};case"ADD_NEW_OB_GROUP":const g=e.current_ob[t.name];return g&&(g.push(t.newGroup),e.current_ob[t.name]=g),{...e};case"ADD_NEW_GROUP":const w=e.options[t.name];return w&&(w.push(t.newGroup),e.options[t.name]=w),{...e};case"ADD_NEW_OB_RULE":const y=e.current_ob[t.name],b=t.group_id;if(y&&b){for(const e of y)if(b===e.group_id){e.rules.push(t.newRule);break}e.current_ob[t.name]=y}return{...e};case"ADD_NEW_RULE":const v=e.options[t.name],x=t.group_id;if(v&&x){for(const e of v)if(x===e.group_id){e.rules.push(t.newRule);break}e.options[t.name]=v}return{...e};case"REMOVE_OB_RULE":const N=e.current_ob[t.name];for(let e=0;e<N.length;e++)if(t.group_id===N[e].group_id){const n=N[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){N[e].rules.splice(r,1);break}0===N[e].rules.length&&N.splice(e,1)}return e.current_ob[t.name]=N,{...e};case"REMOVE_RULE":const E=e.options[t.name];for(let e=0;e<E.length;e++)if(t.group_id===E[e].group_id){const n=E[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){E[e].rules.splice(r,1);break}0===E[e].rules.length&&E.splice(e,1)}return e.options[t.name]=E,{...e};case"RESET_OB_RULE_VALUE":const _=e.current_ob[t.name];for(const e of _)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.current_ob[t.name]=_,{...e};case"RESET_RULE_VALUE":const M=e.options[t.name];for(const e of M)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.options[t.name]=M,{...e};case"SET_RULES_GROUPS":return e.options[t.fieldName]=t.groups,{...e};case"SET_OB_RULES_GROUPS":return e.current_ob[t.fieldName]=t.groups,{...e};case"SET_OB":return e.options[t.fieldName]=t.obs,{...e};case"SET_SURETRIGGERS_CONFIG":return t.config&&setSureTriggersConfig(t.config),{...e,suretriggers_config:t};default:return e}},Qp=(0,s.createContext)(),Vp=({reducer:e,initialState:t,children:n})=>(0,i.createElement)(Qp.Provider,{value:(0,s.useReducer)(e,t)},n),Yp=()=>(0,s.useContext)(Qp);var Zp=n(5901),Wp=function(){return Wp=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},Wp.apply(this,arguments)};function Gp(e,t){for(var n={},r={},o=e.split("~~"),a=!1,i=0;o.length>i;i++){for(var s=o[i].split("~"),l=0;l<s.length;l+=2){var c=s[l],u=s[l+1],d="&"+c+";";n[d]=u,a&&(n["&"+c]=u),r[u]=d}a=!0}return t?{entities:Wp(Wp({},n),t.entities),characters:Wp(Wp({},r),t.characters)}:{entities:n,characters:r}}var Hp={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/&notin;|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/&centerdot;|&copysr;|&divideontimes;|&gtcc;|&gtcir;|&gtdot;|&gtlPar;|&gtquest;|&gtrapprox;|&gtrarr;|&gtrdot;|&gtreqless;|&gtreqqless;|&gtrless;|&gtrsim;|&ltcc;|&ltcir;|&ltdot;|&lthree;|&ltimes;|&ltlarr;|&ltquest;|&ltrPar;|&ltri;|&ltrie;|&ltrif;|&notin;|&notinE;|&notindot;|&notinva;|&notinvb;|&notinvc;|&notni;|&notniva;|&notnivb;|&notnivc;|&parallel;|&timesb;|&timesbar;|&timesd;|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},$p={};$p.xml=Gp("lt~<~gt~>~quot~\"~apos~'~amp~&"),$p.html4=Gp("apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~‌~zwj~‍~lrm~‎~rlm~‏~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~­~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~\"~amp~&~lt~<~gt~>"),$p.html5=Gp('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~⁡~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~⁣~InvisibleTimes~⁢~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~​~NegativeThickSpace~​~NegativeThinSpace~​~NegativeVeryThinSpace~​~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~⁠~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~\t~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~  ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~​~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~⁡~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~⁣~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~⁢~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®',$p.html4);var Xp={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},qp=String.fromCodePoint||function(e){return String.fromCharCode(Math.floor((e-65536)/1024)+55296,(e-65536)%1024+56320)},Jp=(String.prototype.codePointAt,function(){return Jp=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},Jp.apply(this,arguments)}),Kp=Jp(Jp({},$p),{all:$p.html5}),em={scope:"body",level:"all"},tm=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,nm=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,rm={xml:{strict:tm,attribute:nm,body:Hp.xml},html4:{strict:tm,attribute:nm,body:Hp.html4},html5:{strict:tm,attribute:nm,body:Hp.html5}},om=Jp(Jp({},rm),{all:rm.html5}),am=String.fromCharCode,im=am(65533);function sm(e,t){var n=void 0===t?em:t,r=n.level,o=void 0===r?"all":r,a=n.scope,i=void 0===a?"xml"===o?"strict":"body":a;if(!e)return"";var s=om[o][i],l=Kp[o].entities,c="attribute"===i,u="strict"===i;return e.replace(s,function(e){return function(e,t,n,r){var o=e,a=e[e.length-1];if(n&&"="===a)o=e;else if(r&&";"!==a)o=e;else{var i=t[e];if(i)o=i;else if("&"===e[0]&&"#"===e[1]){var s=e[2],l="x"==s||"X"==s?parseInt(e.substr(3),16):parseInt(e.substr(2));o=l>=1114111?im:l>65535?qp(l):am(Xp[l]||l)}}return o}(e,l,c,u)})}function lm(e,t){return"yes"===t&&["checkout","thankyou","upsell","downsell"].includes(e)}function cm(){return(0,i.createElement)("div",null,(0,i.createElement)("span",{className:"wcf-tooltip-heading text-xs font-semibold mb-1 block"},(0,C.__)("Step Editing is Disabled","cartflows")),(0,i.createElement)("div",{className:"wcf-tooltip-desc text-xs font-normal normal-case"},(0,C.__)("You can't edit this step directly because Instant Layout is turned on in the funnel settings. To make design changes, go to the Design tab inside this step's settings.","cartflows")))}function um(e,t,n){return sm(e.length>t?e.substring(0,n)+"...":e)}cartflows_admin.admin_base_slug,cartflows_admin.admin_base_url;const dm=new function(){const e=this;this.compare=function(e,t,n){switch(n){case"==":return e==t;case"!=":return e!=t;case"!==":return e!==t;case"in":return-1!==t.indexOf(e);case"!in":return-1===t.indexOf(e);case"contains":return-1!==e.indexOf(t);case"!contains":return-1===e.indexOf(t);case"<":return e<t;case"<=":return e<=t;case">":return e>t;case">=":return e>=t;default:return e===t}},this.check=function(t,n){const r="or"===t.relation;let o=!r;return!Array.isArray(t?.fields)||(t.fields.map(function(t){let a;return a=t.fields?e.check(t,n):e.compare(n[t.name],t.value,t.operator),r?(a&&(o=!0),!a):a?"":o=!1}),o)},this.isActiveControl=function(t,n){const r=!!t?.conditions&&t?.conditions;return!(r&&!e.check(r,n))}};function fm(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}let pm=1;const mm=new class{#e;#t;constructor(){this.#e=[],this.#t=[]}subscribe(e){return this.#t.push(e),()=>{this.#t=this.#t.filter(t=>t!==e)}}publish(e){this.#t.forEach(t=>t(e))}add(e){this.#e.push(e),this.publish(e)}remove(e){return this.#e=this.#e.filter(t=>t.id!==e),e}create(e){const{id:t,message:n="",jsx:r,...o}=e;if(!n&&"function"!=typeof r)return;const a="number"==typeof t?t:pm++;return this.#e.find(e=>e.id===a)&&(this.#e=this.#e.map(e=>e.id===a?(this.publish({...e,title:n,jsx:r,...o}),{...e,title:n,jsx:r,...o}):e)),this.add({id:a,title:n,jsx:r,...o}),a}update(e,t){const{render:n}=t;let r=t;switch(typeof n){case"function":r={jsx:n,...t};break;case"string":r={title:n,...t}}this.#e=this.#e.map(t=>t.id===e?(this.publish({...t,...r}),{...t,...r}):t)}dismiss(e){return e||this.#e.forEach(e=>this.#t.forEach(t=>t({id:e.id,dismiss:!0}))),this.#t.forEach(t=>t({id:e,dismiss:!0})),e}history(){return this.#e}default(e="",t={}){return this.create({message:e,type:"neutral",...t})}success(e="",t={}){return this.create({message:e,type:"success",...t})}error(e="",t={}){return this.create({message:e,type:"error",...t})}warning(e="",t={}){return this.create({message:e,type:"warning",...t})}info(e="",t={}){return this.create({message:e,type:"info",...t})}custom(e,t={}){return this.create({jsx:e,type:"custom",...t})}},hm=Object.seal(Object.assign((e,t)=>mm.default(e,t),{success:mm.success.bind(mm),error:mm.error.bind(mm),warning:mm.warning.bind(mm),info:mm.info.bind(mm),custom:mm.custom.bind(mm),dismiss:mm.dismiss.bind(mm),update:mm.update.bind(mm)},{getHistory:mm.history.bind(mm)})),gm={sm:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"}},wm={sm:{xs:"gap-2",sm:"gap-4",md:"gap-5",lg:"gap-6",xl:"gap-6","2xl":"gap-8"},md:{xs:"md:gap-2",sm:"md:gap-4",md:"md:gap-5",lg:"md:gap-6",xl:"md:gap-6","2xl":"md:gap-8"},lg:{xs:"lg:gap-2",sm:"lg:gap-4",md:"lg:gap-5",lg:"lg:gap-6",xl:"lg:gap-6","2xl":"lg:gap-8"}},ym={sm:{xs:"gap-x-2",sm:"gap-x-4",md:"gap-x-5",lg:"gap-x-6",xl:"gap-x-6","2xl":"gap-x-8"},md:{xs:"md:gap-x-2",sm:"md:gap-x-4",md:"md:gap-x-5",lg:"md:gap-x-6",xl:"md:gap-x-6","2xl":"md:gap-x-8"},lg:{xs:"lg:gap-x-2",sm:"lg:gap-x-4",md:"lg:gap-x-5",lg:"lg:gap-x-6",xl:"lg:gap-x-6","2xl":"lg:gap-x-8"}},bm={sm:{xs:"gap-y-2",sm:"gap-y-4",md:"gap-y-5",lg:"gap-y-6",xl:"gap-y-6","2xl":"gap-y-8"},md:{xs:"md:gap-y-2",sm:"md:gap-y-4",md:"md:gap-y-5",lg:"md:gap-y-6",xl:"md:gap-y-6","2xl":"md:gap-y-8"},lg:{xs:"lg:gap-y-2",sm:"lg:gap-y-4",md:"lg:gap-y-5",lg:"lg:gap-y-6",xl:"lg:gap-y-6","2xl":"lg:gap-y-8"}},vm={sm:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},xm={sm:{1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4",5:"col-start-5",6:"col-start-6",7:"col-start-7",8:"col-start-8",9:"col-start-9",10:"col-start-10",11:"col-start-11",12:"col-start-12"},md:{1:"md:col-start-1",2:"md:col-start-2",3:"md:col-start-3",4:"md:col-start-4",5:"md:col-start-5",6:"md:col-start-6",7:"md:col-start-7",8:"md:col-start-8",9:"md:col-start-9",10:"md:col-start-10",11:"md:col-start-11",12:"md:col-start-12"},lg:{1:"lg:col-start-1",2:"lg:col-start-2",3:"lg:col-start-3",4:"lg:col-start-4",5:"lg:col-start-5",6:"lg:col-start-6",7:"lg:col-start-7",8:"lg:col-start-8",9:"lg:col-start-9",10:"lg:col-start-10",11:"lg:col-start-11",12:"lg:col-start-12"}},Nm={sm:{row:"grid-flow-row",column:"grid-flow-col","row-dense":"grid-flow-row-dense","column-dense":"grid-flow-col-dense"},md:{row:"md:grid-flow-row",column:"md:grid-flow-col","row-dense":"md:grid-flow-row-dense","column-dense":"md:grid-flow-col-dense"},lg:{row:"lg:grid-flow-row",column:"lg:grid-flow-col","row-dense":"lg:grid-flow-row-dense","column-dense":"lg:grid-flow-col-dense"}},Em={sm:{normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"},md:{normal:"md:justify-normal",start:"md:justify-start",end:"md:justify-end",center:"md:justify-center",between:"md:justify-between",around:"md:justify-around",evenly:"md:justify-evenly",stretch:"md:justify-stretch"},lg:{normal:"lg:justify-normal",start:"lg:justify-start",end:"lg:justify-end",center:"lg:justify-center",between:"lg:justify-between",around:"lg:justify-around",evenly:"lg:justify-evenly",stretch:"lg:justify-stretch"}},_m={sm:{start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},md:{start:"md:items-start",end:"md:items-end",center:"md:items-center",baseline:"md:items-baseline",stretch:"md:items-stretch"},lg:{start:"lg:items-start",end:"lg:items-end",center:"lg:items-center",baseline:"lg:items-baseline",stretch:"lg:items-stretch"}},Mm={sm:{start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"},md:{start:"md:self-start",end:"md:self-end",center:"md:self-center",baseline:"md:self-baseline",stretch:"md:self-stretch"},lg:{start:"lg:self-start",end:"lg:self-end",center:"lg:self-center",baseline:"lg:self-baseline",stretch:"lg:self-stretch"}},Im={sm:{auto:"justify-self-auto",start:"justify-self-start",end:"justify-self-end",center:"justify-self-center",baseline:"justify-self-baseline",stretch:"justify-self-stretch"},md:{auto:"md:justify-self-auto",start:"md:justify-self-start",end:"md:justify-self-end",center:"md:justify-self-center",baseline:"md:justify-self-baseline",stretch:"md:justify-self-stretch"},lg:{auto:"lg:justify-self-auto",start:"lg:justify-self-start",end:"lg:justify-self-end",center:"lg:justify-self-center",baseline:"lg:justify-self-baseline",stretch:"lg:justify-self-stretch"}},Sm={sm:{row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},md:{row:"md:flex-row","row-reverse":"md:flex-row-reverse",column:"md:flex-col","column-reverse":"md:flex-col-reverse"},lg:{row:"lg:flex-row","row-reverse":"lg:flex-row-reverse",column:"lg:flex-col","column-reverse":"lg:flex-col-reverse"}},km={sm:{wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse",nowrap:"flex-nowrap"},md:{wrap:"md:flex-wrap","wrap-reverse":"md:flex-wrap-reverse",nowrap:"md:flex-nowrap"},lg:{wrap:"lg:flex-wrap","wrap-reverse":"lg:flex-wrap-reverse",nowrap:"lg:flex-nowrap"}},Dm={sm:{1:"w-full",2:"w-1/2",3:"w-1/3",4:"w-1/4",5:"w-1/5",6:"w-1/6",7:"w-1/7",8:"w-1/8",9:"w-1/9",10:"w-1/10",11:"w-1/11",12:"w-1/12"},md:{1:"md:w-full",2:"md:w-1/2",3:"md:w-1/3",4:"md:w-1/4",5:"md:w-1/5",6:"md:w-1/6",7:"md:w-1/7",8:"md:w-1/8",9:"md:w-1/9",10:"md:w-1/10",11:"md:w-1/11",12:"md:w-1/12"},lg:{1:"lg:w-full",2:"lg:w-1/2",3:"lg:w-1/3",4:"lg:w-1/4",5:"lg:w-1/5",6:"lg:w-1/6",7:"lg:w-1/7",8:"lg:w-1/8",9:"lg:w-1/9",10:"lg:w-1/10",11:"lg:w-1/11",12:"lg:w-1/12"}},Cm={sm:{1:"order-1",2:"order-2",3:"order-3",4:"order-4",5:"order-5",6:"order-6",7:"order-7",8:"order-8",9:"order-9",10:"order-10",11:"order-11",12:"order-12",first:"order-first",last:"order-last",none:"order-none"},md:{1:"md:order-1",2:"md:order-2",3:"md:order-3",4:"md:order-4",5:"md:order-5",6:"md:order-6",7:"md:order-7",8:"md:order-8",9:"md:order-9",10:"md:order-10",11:"md:order-11",12:"md:order-12",first:"md:order-first",last:"md:order-last",none:"md:order-none"},lg:{1:"lg:order-1",2:"lg:order-2",3:"lg:order-3",4:"lg:order-4",5:"lg:order-5",6:"lg:order-6",7:"lg:order-7",8:"lg:order-8",9:"lg:order-9",10:"lg:order-10",11:"lg:order-11",12:"lg:order-12",first:"lg:order-first",last:"lg:order-last",none:"lg:order-none"}},jm={sm:{0:"grow-0",1:"grow"},md:{0:"md:grow-0",1:"md:grow"},lg:{0:"lg:grow-0",1:"lg:grow"}},Am={sm:{0:"shrink-0",1:"shrink"},md:{0:"md:shrink-0",1:"md:shrink"},lg:{0:"lg:shrink-0",1:"lg:shrink"}},Tm=(e,t,n,r="sm")=>{const o=[];switch(typeof e){case"object":for(const[r,a]of Object.entries(e))t[r]&&o.push(t?.[r]?.[a]??t?.[r]?.[n?.[r]]??"");break;case"string":case"number":const a=r;o.push(t?.[a]?.[e]??t?.[a]?.[n?.[a]]??"");break;default:if(void 0===e)break;o.push(t?.[r]?.[n]??"")}return o.join(" ")},Lm=({className:e,cols:t,gap:n,gapX:r,gapY:o,align:a,justify:i,gridFlow:s,colsSubGrid:l=!1,rowsSubGrid:c=!1,autoRows:u=!1,autoCols:d=!1,children:f,...p})=>{const m=Tm(t,gm,1),h=Tm(n,wm,"sm"),g=Tm(r,ym,""),w=Tm(o,bm,""),y=Tm(a,_m,""),b=Tm(i,Em,""),v=Tm(s,Nm,"");return(0,j.jsx)("div",{className:Se("grid",{"grid-cols-subgrid":l,"grid-rows-subgrid":c,"auto-cols-auto":d,"auto-rows-auto":u},m,h,g,w,y,b,v,e),...p,children:f})};Lm.Item=({className:e,children:t,colSpan:n,colStart:r,alignSelf:o,justifySelf:a,...i})=>{const s=Tm(n,vm,0),l=Tm(r,xm,0),c=Tm(o,Mm,""),u=Tm(a,Im,"");return(0,j.jsx)("div",{className:Se(s,l,c,u,e),...i,children:t})};const Om=(0,s.createContext)({}),zm=({containerType:e="flex",gap:t="sm",gapX:n,gapY:r,direction:o,justify:a,align:i,wrap:s,cols:l,className:c,children:u,...d})=>{if("grid"===e)return(0,j.jsx)(Om.Provider,{value:{containerType:e},children:(0,j.jsx)(Lm,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:u,align:i,justify:a,...d})});const f=Tm(s,km,""),p=Tm(t,wm,"sm"),m=Tm(n,ym,""),h=Tm(r,bm,""),g=Tm(o,Sm,""),w=Tm(a,Em,""),y=Tm(i,_m,""),b=Se("flex",f,p,m,h,g,w,y,c);return(0,j.jsx)(Om.Provider,{value:{containerType:e,cols:l},children:"flex"===e?(0,j.jsx)("div",{className:b,children:u}):(0,j.jsx)(Lm,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:u,align:i,justify:a,...d})})},Pm=({grow:e,shrink:t,order:n,alignSelf:r,justifySelf:o,className:a,children:i,...l})=>{const{containerType:c,cols:u}=(0,s.useContext)(Om);if("grid"===c)return(0,j.jsx)(Lm.Item,{className:a,alignSelf:r,justifySelf:o,children:i,...l});const d=Tm(r,Mm,""),f=Tm(o,Im,""),p=Tm(e,jm,0),m=Tm(t,Am,0),h=Tm(n,Cm,0),g=Tm(u,Dm,1);return(0,j.jsx)("div",{className:Se("box-border",p,m,h,d,f,g,a),children:i})};zm.Item=Pm,zm.displayName="Container",Pm.displayName="Container.Item";const Rm={400:"font-normal",500:"font-medium",600:"font-semibold",700:"font-bold"},Um={36:"text-4xl",30:"text-3xl",24:"text-2xl",20:"text-xl",18:"text-lg",16:"text-base",14:"text-sm",12:"text-xs"},Bm={44:"leading-11",38:"leading-9.5",32:"leading-8",30:"leading-7.5",28:"leading-7",24:"leading-6",20:"leading-5",16:"leading-4"},Fm={2:"tracking-2"},Qm={brand600:"text-brand-primary-600",link:"text-link-primary",primary:"text-text-primary",secondary:"text-text-secondary",tertiary:"text-text-tertiary",disabled:"text-text-disabled",help:"text-field-helper",label:"text-field-label",info:"text-support-info",success:"text-support-success",warning:"text-support-warning",error:"text-support-error",inverse:"text-text-on-color"},Vm=(0,s.forwardRef)(function({as:e,children:t,weight:n,size:r,lineHeight:o,letterSpacing:a,color:i="primary",className:s,...l},c){return(0,j.jsx)(e||"p",{ref:c,className:Se("m-0 p-0",n?Rm[n]:"",r?Um[r]:"",o?Bm[o]:"",a?Fm[a]:"",i?Qm[i]:"",s),...l,children:t})});var Ym=n(442);const Zm=Ym.default||Ym;function Wm({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))}const Gm=s.forwardRef(Wm);function Hm({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const $m=s.forwardRef(Hm);function Xm({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6a7.5 7.5 0 1 0 7.5 7.5h-7.5V6Z"}),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5H21A7.5 7.5 0 0 0 13.5 3v7.5Z"}))}const qm=s.forwardRef(Xm);function Jm({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}const Km=s.forwardRef(Jm);function eh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 18.75h-9m9 0a3 3 0 0 1 3 3h-15a3 3 0 0 1 3-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 0 1-.982-3.172M9.497 14.25a7.454 7.454 0 0 0 .981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 0 0 7.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 0 0 2.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 0 1 2.916.52 6.003 6.003 0 0 1-5.395 4.972m0 0a6.726 6.726 0 0 1-2.749 1.35m0 0a6.772 6.772 0 0 1-3.044 0"}))}const th=s.forwardRef(eh);function nh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25"}))}const rh=s.forwardRef(nh);function oh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 11.25-3-3m0 0-3 3m3-3v7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const ah=s.forwardRef(oh);function ih({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"}))}const sh=s.forwardRef(ih),lh=function(e){const{id:t,control_id:n,onClickEvents:r,actions:o,type:a,setShowAbtestUpgradePopup:s=()=>{}}=e,[{license_status:l}]=f();return(0,i.createElement)(bp,{placement:"bottom-end",className:"wcf-step-row__actions-menu"},(0,i.createElement)(bp.Trigger,null,(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"text-text-secondary hover:text-text-primary","aria-label":(0,C.__)("More Options","cartflows")},(0,i.createElement)(sh,{className:"h-5 w-5","aria-hidden":"true"}))),(0,i.createElement)(bp.ContentWrapper,{className:"z-20"},(0,i.createElement)(bp.Content,{size:"sm",className:"wcf-step-actions-menu__dropdown_menu"},(0,i.createElement)(bp.List,null,o.map(e=>{var o;const c=e.text;let u=!1,d=!1;if((!wcfCartflowsPro()&&e?.pro||"abtest"===e.slug&&!wcfCartflowsTypePro())&&(u=!0),wcfCartflowsPro()&&e?.pro&&"Activated"!==l&&(d=!0),"automation"===e.slug&&"downsell"!==a&&"upsell"!==a&&"checkout"!==a)return null;const f=u||d,p=f&&"abtest"===e.slug;return(0,i.createElement)(bp.Item,{key:e?.text,disabled:f&&!p,className:`wcf-step__action-btn hover:!bg-brand-25 hover:!text-brand-600 aria-disabled:!text-text-on-button-disabled aria-disabled:hover:!text-text-on-button-disabled aria-disabled:hover:!bg-transparent ${null!==(o=e.class)&&void 0!==o?o:""} ${p?"!cursor-not-allowed !text-text-on-button-disabled hover:!text-text-on-button-disabled hover:!bg-transparent":""}`,onClick:()=>{if(p)s("show");else if(!f)if("#"===e?.link&&r[e.slug]){const o={preventDefault:()=>{},target:{getAttribute:r=>"data-action"===r?e.ajaxcall:"data-id"===r?t:"data-control-id"===r?n:null},currentTarget:{getAttribute:r=>"data-action"===r?e.ajaxcall:"data-id"===r?t:"data-control-id"===r?n:null}};r[e.slug](o)}else e?.link&&"#"!==e?.link&&(window.location.href=e.link)}},(0,i.createElement)("span",{className:"flex items-center gap-2"},function(e){let t="";switch(e){case"clone":t=(0,i.createElement)(Gm,{className:"w-4 h-4 stroke-[1.5]"});break;case"delete":t=(0,i.createElement)($m,{className:"w-4 h-4 stroke-[1.5]"});break;case"abtest":t=(0,i.createElement)(qm,{className:"w-4 h-4 stroke-[1.5]"});break;case"archived":t=(0,i.createElement)(Km,{className:"w-4 h-4 stroke-[1.5]"});break;case"winner":t=(0,i.createElement)(th,{className:"w-4 h-4 stroke-[1.5]"});break;case"automation":t=(0,i.createElement)(rh,{className:"w-4 h-4 stroke-[1.5]"});break;default:t=(0,i.createElement)(ah,{className:"w-4 h-4 stroke-[1.5]"})}return t}(e.slug),(0,i.createElement)("span",{className:"wcf-step-row__btn-text"},c," ",(u||d)&&(0,i.createElement)("span",{className:"text-brand-600"},(0,C.__)("(Pro)","cartflows")),e?.tag&&(0,i.createElement)("span",{className:"wcf-step-row__btn-text--tag text-brand-brand-600"}," ",e?.tag," "))))})))))},ch="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNzI3XzIzNzEpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPGNpcmNsZSBjeD0iMTciIGN5PSIxNiIgcj0iMyIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNMTQgMjkuNEMxNCAyNy4xNTk4IDE0IDI2LjAzOTcgMTQuNDM2IDI1LjE4NEMxNC44MTk1IDI0LjQzMTQgMTUuNDMxNCAyMy44MTk1IDE2LjE4NCAyMy40MzZDMTcuMDM5NyAyMyAxOC4xNTk4IDIzIDIwLjQgMjNIMTA3LjZDMTA5Ljg0IDIzIDExMC45NiAyMyAxMTEuODE2IDIzLjQzNkMxMTIuNTY5IDIzLjgxOTUgMTEzLjE4MSAyNC40MzE0IDExMy41NjQgMjUuMTg0QzExNCAyNi4wMzk3IDExNCAyNy4xNTk4IDExNCAyOS40VjU0LjZDMTE0IDU2Ljg0MDIgMTE0IDU3Ljk2MDMgMTEzLjU2NCA1OC44MTZDMTEzLjE4MSA1OS41Njg2IDExMi41NjkgNjAuMTgwNSAxMTEuODE2IDYwLjU2NEMxMTAuOTYgNjEgMTA5Ljg0IDYxIDEwNy42IDYxSDIwLjRDMTguMTU5OCA2MSAxNy4wMzk3IDYxIDE2LjE4NCA2MC41NjRDMTUuNDMxNCA2MC4xODA1IDE0LjgxOTUgNTkuNTY4NiAxNC40MzYgNTguODE2QzE0IDU3Ljk2MDMgMTQgNTYuODQwMiAxNCA1NC42VjI5LjRaIiBmaWxsPSIjRTVFN0VCIi8+CjxjaXJjbGUgY3g9IjkxIiBjeT0iNDIiIHI9IjE1IiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNOTAuMDI5MSAzMC45MzI3QzkwLjI3OTQgMjkuOTE4OSA5MS43MjA2IDI5LjkxODkgOTEuOTcwOSAzMC45MzI3TDkzLjgyNTEgMzguNDQzN0M5My45MTQxIDM4LjgwNDMgOTQuMTk1NyAzOS4wODU5IDk0LjU1NjMgMzkuMTc0OUwxMDIuMDY3IDQxLjAyOTFDMTAzLjA4MSA0MS4yNzk0IDEwMy4wODEgNDIuNzIwNiAxMDIuMDY3IDQyLjk3MDlMOTQuNTU2MyA0NC44MjUxQzk0LjE5NTcgNDQuOTE0MSA5My45MTQxIDQ1LjE5NTcgOTMuODI1MSA0NS41NTYzTDkxLjk3MDkgNTMuMDY3M0M5MS43MjA2IDU0LjA4MTEgOTAuMjc5NCA1NC4wODExIDkwLjAyOTEgNTMuMDY3M0w4OC4xNzQ5IDQ1LjU1NjNDODguMDg1OSA0NS4xOTU3IDg3LjgwNDMgNDQuOTE0MSA4Ny40NDM3IDQ0LjgyNTFMNzkuOTMyNyA0Mi45NzA5Qzc4LjkxODkgNDIuNzIwNiA3OC45MTg5IDQxLjI3OTQgNzkuOTMyNyA0MS4wMjkxTDg3LjQ0MzcgMzkuMTc0OUM4Ny44MDQzIDM5LjA4NTkgODguMDg1OSAzOC44MDQzIDg4LjE3NDkgMzguNDQzN0w5MC4wMjkxIDMwLjkzMjdaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgMzZDMjAgMzUuNDQ3NyAyMC40NDc3IDM1IDIxIDM1SDUzQzUzLjU1MjMgMzUgNTQgMzUuNDQ3NyA1NCAzNkM1NCAzNi41NTIzIDUzLjU1MjMgMzcgNTMgMzdIMjFDMjAuNDQ3NyAzNyAyMCAzNi41NTIzIDIwIDM2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIwIDQxQzIwIDQwLjQ0NzcgMjAuNDQ3NyA0MCAyMSA0MEg0NUM0NS41NTIzIDQwIDQ2IDQwLjQ0NzcgNDYgNDFDNDYgNDEuNTUyMyA0NS41NTIzIDQyIDQ1IDQySDIxQzIwLjQ0NzcgNDIgMjAgNDEuNTUyMyAyMCA0MVoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCA0OEMyMCA0Ni44OTU0IDIxLjA2NiA0NiAyMi4zODEgNDZIMzQuNjE5QzM1LjkzNCA0NiAzNyA0Ni44OTU0IDM3IDQ4QzM3IDQ5LjEwNDYgMzUuOTM0IDUwIDM0LjYxOSA1MEgyMi4zODFDMjEuMDY2IDUwIDIwIDQ5LjEwNDYgMjAgNDhaIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgMTZDOTcgMTQuODk1NCA5OC4wNjYgMTQgOTkuMzgxIDE0SDExMS42MTlDMTEyLjkzNCAxNCAxMTQgMTQuODk1NCAxMTQgMTZDMTE0IDE3LjEwNDYgMTEyLjkzNCAxOCAxMTEuNjE5IDE4SDk5LjM4MUM5OC4wNjYgMTggOTcgMTcuMTA0NiA5NyAxNloiIGZpbGw9IiM5Q0EzQUYiLz4KPHBhdGggZD0iTTIyIDc5LjRDMjIgNzcuMTU5OCAyMiA3Ni4wMzk3IDIyLjQzNiA3NS4xODRDMjIuODE5NSA3NC40MzE0IDIzLjQzMTQgNzMuODE5NSAyNC4xODQgNzMuNDM2QzI1LjAzOTcgNzMgMjYuMTU5OCA3MyAyOC40IDczSDU0LjZDNTYuODQwMiA3MyA1Ny45NjAzIDczIDU4LjgxNiA3My40MzZDNTkuNTY4NiA3My44MTk1IDYwLjE4MDUgNzQuNDMxNCA2MC41NjQgNzUuMTg0QzYxIDc2LjAzOTcgNjEgNzcuMTU5OCA2MSA3OS40Vjk3LjZDNjEgOTkuODQwMiA2MSAxMDAuOTYgNjAuNTY0IDEwMS44MTZDNjAuMTgwNSAxMDIuNTY5IDU5LjU2ODYgMTAzLjE4MSA1OC44MTYgMTAzLjU2NEM1Ny45NjAzIDEwNCA1Ni44NDAyIDEwNCA1NC42IDEwNEgyOC40QzI2LjE1OTggMTA0IDI1LjAzOTcgMTA0IDI0LjE4NCAxMDMuNTY0QzIzLjQzMTQgMTAzLjE4MSAyMi44MTk1IDEwMi41NjkgMjIuNDM2IDEwMS44MTZDMjIgMTAwLjk2IDIyIDk5Ljg0MDIgMjIgOTcuNlY3OS40WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDg4QzcwIDg3LjQ0NzcgNzAuNDQ3NyA4NyA3MSA4N0gxMDNDMTAzLjU1MiA4NyAxMDQgODcuNDQ3NyAxMDQgODhDMTA0IDg4LjU1MjMgMTAzLjU1MiA4OSAxMDMgODlINzFDNzAuNDQ3NyA4OSA3MCA4OC41NTIzIDcwIDg4WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDgzQzcwIDgyLjQ0NzcgNzAuNDQ3NyA4MiA3MSA4MkgxMDNDMTAzLjU1MiA4MiAxMDQgODIuNDQ3NyAxMDQgODNDMTA0IDgzLjU1MjMgMTAzLjU1MiA4NCAxMDMgODRINzFDNzAuNDQ3NyA4NCA3MCA4My41NTIzIDcwIDgzWiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDc3QzcwIDc2LjQ0NzcgNzAuNDQ3NyA3NiA3MSA3Nkg4N0M4Ny41NTIzIDc2IDg4IDc2LjQ0NzcgODggNzdDODggNzcuNTUyMyA4Ny41NTIzIDc4IDg3IDc4SDcxQzcwLjQ0NzcgNzggNzAgNzcuNTUyMyA3MCA3N1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03MCA5M0M3MCA5Mi40NDc3IDcwLjQ0NzcgOTIgNzEgOTJIOTVDOTUuNTUyMyA5MiA5NiA5Mi40NDc3IDk2IDkzQzk2IDkzLjU1MjMgOTUuNTUyMyA5NCA5NSA5NEg3MUM3MC40NDc3IDk0IDcwIDkzLjU1MjMgNzAgOTNaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMTAwQzcwIDk4Ljg5NTQgNzEuMDY2IDk4IDcyLjM4MSA5OEg4NC42MTlDODUuOTM0IDk4IDg3IDk4Ljg5NTQgODcgMTAwQzg3IDEwMS4xMDUgODUuOTM0IDEwMiA4NC42MTkgMTAySDcyLjM4MUM3MS4wNjYgMTAyIDcwIDEwMS4xMDUgNzAgMTAwWiIgZmlsbD0iIzlDQTNBRiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzcyN18yMzcxIiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIvPgo8ZmVPZmZzZXQgZHk9IjQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMTYgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",uh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNzI3XzIzNzMpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPHBhdGggZD0iTTggMTcuNkM4IDE0LjIzOTcgOCAxMi41NTk1IDguNjUzOTYgMTEuMjc2MUM5LjIyOTIgMTAuMTQ3MSAxMC4xNDcxIDkuMjI5MiAxMS4yNzYxIDguNjUzOTZDMTIuNTU5NSA4IDE0LjIzOTcgOCAxNy42IDhIMTEwLjRDMTEzLjc2IDggMTE1LjQ0IDggMTE2LjcyNCA4LjY1Mzk2QzExNy44NTMgOS4yMjkyIDExOC43NzEgMTAuMTQ3MSAxMTkuMzQ2IDExLjI3NjFDMTIwIDEyLjU1OTUgMTIwIDE0LjIzOTcgMTIwIDE3LjZWNDBIOFYxNy42WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCAyNkMyMCAyNC44OTU0IDIxLjA2NiAyNCAyMi4zODEgMjRIMzQuNjE5QzM1LjkzNCAyNCAzNyAyNC44OTU0IDM3IDI2QzM3IDI3LjEwNDYgMzUuOTM0IDI4IDM0LjYxOSAyOEgyMi4zODFDMjEuMDY2IDI4IDIwIDI3LjEwNDYgMjAgMjZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgMzNDMjAgMzIuNDQ3NyAyMC40NDc3IDMyIDIxIDMySDUzQzUzLjU1MjMgMzIgNTQgMzIuNDQ3NyA1NCAzM0M1NCAzMy41NTIzIDUzLjU1MjMgMzQgNTMgMzRIMjFDMjAuNDQ3NyAzNCAyMCAzMy41NTIzIDIwIDMzWiIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9Ijk2IiBjeT0iMzEiIHI9IjMiIGZpbGw9IiNFNUU3RUIiLz4KPGNpcmNsZSBjeD0iODciIGN5PSIzMSIgcj0iMyIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSIxMDUiIGN5PSIzMSIgcj0iMyIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDE2LjAwMDJDNzAgMTUuNDQ4IDcwLjQ0NzcgMTUuMDAwMiA3MSAxNS4wMDAySDc5Qzc5LjU1MjMgMTUuMDAwMiA4MCAxNS40NDggODAgMTYuMDAwMkM4MCAxNi41NTI1IDc5LjU1MjMgMTcuMDAwMiA3OSAxNy4wMDAySDcxQzcwLjQ0NzcgMTcuMDAwMiA3MCAxNi41NTI1IDcwIDE2LjAwMDJaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODQgMTYuMDAwMkM4NCAxNS40NDggODQuNDQ3NyAxNS4wMDAyIDg1IDE1LjAwMDJIOTNDOTMuNTUyMyAxNS4wMDAyIDk0IDE1LjQ0OCA5NCAxNi4wMDAyQzk0IDE2LjU1MjUgOTMuNTUyMyAxNy4wMDAyIDkzIDE3LjAwMDJIODVDODQuNDQ3NyAxNy4wMDAyIDg0IDE2LjU1MjUgODQgMTYuMDAwMloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OCAxNkM5OCAxNS40NDc3IDk4LjQ0NzcgMTUgOTkgMTVIMTA3QzEwNy41NTIgMTUgMTA4IDE1LjQ0NzcgMTA4IDE2QzEwOCAxNi41NTIzIDEwNy41NTIgMTcgMTA3IDE3SDk5Qzk4LjQ0NzcgMTcgOTggMTYuNTUyMyA5OCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDU2QzIwIDU0Ljg5NTQgMjAuODk1NCA1NCAyMiA1NEg2M0M2NC4xMDQ2IDU0IDY1IDU0Ljg5NTQgNjUgNTZWNThDNjUgNTkuMTA0NiA2NC4xMDQ2IDYwIDYzIDYwSDIyQzIwLjg5NTQgNjAgMjAgNTkuMTA0NiAyMCA1OFY1NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDY2QzIwIDY0Ljg5NTQgMjAuODk1NCA2NCAyMiA2NEg2M0M2NC4xMDQ2IDY0IDY1IDY0Ljg5NTQgNjUgNjZWNjhDNjUgNjkuMTA0NiA2NC4xMDQ2IDcwIDYzIDcwSDIyQzIwLjg5NTQgNzAgMjAgNjkuMTA0NiAyMCA2OFY2NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDg2QzIwIDg0Ljg5NTQgMjAuODk1NCA4NCAyMiA4NEg2M0M2NC4xMDQ2IDg0IDY1IDg0Ljg5NTQgNjUgODZWOThDNjUgOTkuMTA0NiA2NC4xMDQ2IDEwMCA2MyAxMDBIMjJDMjAuODk1NCAxMDAgMjAgOTkuMTA0NiAyMCA5OFY4NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCA0OUMyMCA0OC40NDc3IDIwLjQ0NzcgNDggMjEgNDhIMzdDMzcuNTUyMyA0OCAzOCA0OC40NDc3IDM4IDQ5QzM4IDQ5LjU1MjMgMzcuNTUyMyA1MCAzNyA1MEgyMUMyMC40NDc3IDUwIDIwIDQ5LjU1MjMgMjAgNDlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgNzlDMjAgNzguNDQ3NyAyMC40NDc3IDc4IDIxIDc4SDM3QzM3LjU1MjMgNzggMzggNzguNDQ3NyAzOCA3OUMzOCA3OS41NTIzIDM3LjU1MjMgODAgMzcgODBIMjFDMjAuNDQ3NyA4MCAyMCA3OS41NTIzIDIwIDc5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNMjAgMTA2QzIwIDEwNC44OTUgMjAuODk1NCAxMDQgMjIgMTA0SDYzQzY0LjEwNDYgMTA0IDY1IDEwNC44OTUgNjUgMTA2VjEwOEM2NSAxMDkuMTA1IDY0LjEwNDYgMTEwIDYzIDExMEgyMkMyMC44OTU0IDExMCAyMCAxMDkuMTA1IDIwIDEwOFYxMDZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik03NCA5M0M3NCA5MS44OTU0IDc0Ljg5NTQgOTEgNzYgOTFIOTNDOTQuMTA0NiA5MSA5NSA5MS44OTU0IDk1IDkzVjk1Qzk1IDk2LjEwNDYgOTQuMTA0NiA5NyA5MyA5N0g3NkM3NC44OTU0IDk3IDc0IDk2LjEwNDYgNzQgOTVWOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik05NyA5M0M5NyA5MS44OTU0IDk3Ljg5NTQgOTEgOTkgOTFIMTA2QzEwNy4xMDUgOTEgMTA4IDkxLjg5NTQgMTA4IDkzVjk1QzEwOCA5Ni4xMDQ2IDEwNy4xMDUgOTcgMTA2IDk3SDk5Qzk3Ljg5NTQgOTcgOTcgOTYuMTA0NiA5NyA5NVY5M1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTc0IDU2Qzc0IDU0Ljg5NTQgNzQuODk1NCA1NCA3NiA1NEgxMDZDMTA3LjEwNSA1NCAxMDggNTQuODk1NCAxMDggNTZWODRDMTA4IDg1LjEwNDYgMTA3LjEwNSA4NiAxMDYgODZINzZDNzQuODk1NCA4NiA3NCA4NS4xMDQ2IDc0IDg0VjU2WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03NiA1M0gxMDZDMTA3LjY1NyA1MyAxMDkgNTQuMzQzMSAxMDkgNTZWODRDMTA5IDg1LjY1NjkgMTA3LjY1NyA4NyAxMDYgODdINzZDNzQuMzQzMSA4NyA3MyA4NS42NTY5IDczIDg0VjU2QzczIDU0LjM0MzEgNzQuMzQzMSA1MyA3NiA1M1pNNzYgNTRDNzQuODk1NCA1NCA3NCA1NC44OTU0IDc0IDU2Vjg0Qzc0IDg1LjEwNDYgNzQuODk1NCA4NiA3NiA4NkgxMDZDMTA3LjEwNSA4NiAxMDggODUuMTA0NiAxMDggODRWNTZDMTA4IDU0Ljg5NTQgMTA3LjEwNSA1NCAxMDYgNTRINzZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzcgODFDNzcgODAuNDQ3NyA3Ny40NDc3IDgwIDc4IDgwSDgzQzgzLjU1MjMgODAgODQgODAuNDQ3NyA4NCA4MUM4NCA4MS41NTIzIDgzLjU1MjMgODIgODMgODJINzhDNzcuNDQ3NyA4MiA3NyA4MS41NTIzIDc3IDgxWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTc3IDc2Qzc3IDc1LjQ0NzcgNzcuNDQ3NyA3NSA3OCA3NUg4N0M4Ny41NTIzIDc1IDg4IDc1LjQ0NzcgODggNzZDODggNzYuNTUyMyA4Ny41NTIzIDc3IDg3IDc3SDc4Qzc3LjQ0NzcgNzcgNzcgNzYuNTUyMyA3NyA3NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04NiA2NkM4NiA2NS40NDc3IDg2LjQ0NzcgNjUgODcgNjVIOTRDOTQuNTUyMyA2NSA5NSA2NS40NDc3IDk1IDY2Qzk1IDY2LjU1MjMgOTQuNTUyMyA2NyA5NCA2N0g4N0M4Ni40NDc3IDY3IDg2IDY2LjU1MjMgODYgNjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODYgNjlDODYgNjguNDQ3NyA4Ni40NDc3IDY4IDg3IDY4SDg4Qzg4LjU1MjMgNjggODkgNjguNDQ3NyA4OSA2OUM4OSA2OS41NTIzIDg4LjU1MjMgNzAgODggNzBIODdDODYuNDQ3NyA3MCA4NiA2OS41NTIzIDg2IDY5WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTc3IDU5Qzc3IDU4LjQ0NzcgNzcuNDQ3NyA1OCA3OCA1OEg4NUM4NS41NTIzIDU4IDg2IDU4LjQ0NzcgODYgNTlDODYgNTkuNTUyMyA4NS41NTIzIDYwIDg1IDYwSDc4Qzc3LjQ0NzcgNjAgNzcgNTkuNTUyMyA3NyA1OVoiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05NyA4MUM5NyA4MC40NDc3IDk3LjQ0NzcgODAgOTggODBIMTA0QzEwNC41NTIgODAgMTA1IDgwLjQ0NzcgMTA1IDgxQzEwNSA4MS41NTIzIDEwNC41NTIgODIgMTA0IDgySDk4Qzk3LjQ0NzcgODIgOTcgODEuNTUyMyA5NyA4MVoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OSA3NkM5OSA3NS40NDc3IDk5LjQ0NzcgNzUgMTAwIDc1SDEwNEMxMDQuNTUyIDc1IDEwNSA3NS40NDc3IDEwNSA3NkMxMDUgNzYuNTUyMyAxMDQuNTUyIDc3IDEwNCA3N0gxMDBDOTkuNDQ3NyA3NyA5OSA3Ni41NTIzIDk5IDc2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTk5IDY4Qzk5IDY3LjQ0NzcgOTkuNDQ3NyA2NyAxMDAgNjdIMTA0QzEwNC41NTIgNjcgMTA1IDY3LjQ0NzcgMTA1IDY4QzEwNSA2OC41NTIzIDEwNC41NTIgNjkgMTA0IDY5SDEwMEM5OS40NDc3IDY5IDk5IDY4LjU1MjMgOTkgNjhaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgNTlDOTcgNTguNDQ3NyA5Ny40NDc3IDU4IDk4IDU4SDEwNEMxMDQuNTUyIDU4IDEwNSA1OC40NDc3IDEwNSA1OUMxMDUgNTkuNTUyMyAxMDQuNTUyIDYwIDEwNCA2MEg5OEM5Ny40NDc3IDYwIDk3IDU5LjU1MjMgOTcgNTlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik03NyA2NkM3NyA2NC44OTU0IDc3Ljg5NTQgNjQgNzkgNjRIODJDODMuMTA0NiA2NCA4NCA2NC44OTU0IDg0IDY2VjY5Qzg0IDcwLjEwNDYgODMuMTA0NiA3MSA4MiA3MUg3OUM3Ny44OTU0IDcxIDc3IDcwLjEwNDYgNzcgNjlWNjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzMgNDlDNzMgNDguNDQ3NyA3My40NDc3IDQ4IDc0IDQ4SDkwQzkwLjU1MjMgNDggOTEgNDguNDQ3NyA5MSA0OUM5MSA0OS41NTIzIDkwLjU1MjMgNTAgOTAgNTBINzRDNzMuNDQ3NyA1MCA3MyA0OS41NTIzIDczIDQ5WiIgZmlsbD0iI0QxRDVEQiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzcyN18yMzczIiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIvPgo8ZmVPZmZzZXQgZHk9IjQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMTYgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",dh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMTAzM18xMDEyNSkiPgo8cmVjdCB4PSI4IiB5PSI4IiB3aWR0aD0iMTEyIiBoZWlnaHQ9IjExMiIgcng9IjYiIGZpbGw9IiNGOUZBRkIiLz4KPC9nPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODQgMTZDODQgMTUuNDQ3NyA4NC40NDc3IDE1IDg1IDE1SDkzQzkzLjU1MjMgMTUgOTQgMTUuNDQ3NyA5NCAxNkM5NCAxNi41NTIzIDkzLjU1MjMgMTcgOTMgMTdIODVDODQuNDQ3NyAxNyA4NCAxNi41NTIzIDg0IDE2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDE2QzcwIDE1LjQ0NzcgNzAuNDQ3NyAxNSA3MSAxNUg3OUM3OS41NTIzIDE1IDgwIDE1LjQ0NzcgODAgMTZDODAgMTYuNTUyMyA3OS41NTIzIDE3IDc5IDE3SDcxQzcwLjQ0NzcgMTcgNzAgMTYuNTUyMyA3MCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OCAxNkM5OCAxNS40NDc3IDk4LjQ0NzcgMTUgOTkgMTVIMTA3QzEwNy41NTIgMTUgMTA4IDE1LjQ0NzcgMTA4IDE2QzEwOCAxNi41NTIzIDEwNy41NTIgMTcgMTA3IDE3SDk5Qzk4LjQ0NzcgMTcgOTggMTYuNTUyMyA5OCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTI3IDUxQzI3IDQ4Ljc5MDkgMjguNzkwOSA0NyAzMSA0N0g5N0M5OS4yMDkxIDQ3IDEwMSA0OC43OTA5IDEwMSA1MVY3OUMxMDEgODEuMjA5MSA5OS4yMDkxIDgzIDk3IDgzSDMxQzI4Ljc5MDkgODMgMjcgODEuMjA5MSAyNyA3OVY1MVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzEgNDZIOTdDOTkuNzYxNCA0NiAxMDIgNDguMjM4NiAxMDIgNTFWNzlDMTAyIDgxLjc2MTQgOTkuNzYxNCA4NCA5NyA4NEgzMUMyOC4yMzg2IDg0IDI2IDgxLjc2MTQgMjYgNzlWNTFDMjYgNDguMjM4NiAyOC4yMzg2IDQ2IDMxIDQ2Wk0zMSA0N0MyOC43OTA5IDQ3IDI3IDQ4Ljc5MDkgMjcgNTFWNzlDMjcgODEuMjA5MSAyOC43OTA5IDgzIDMxIDgzSDk3Qzk5LjIwOTEgODMgMTAxIDgxLjIwOTEgMTAxIDc5VjUxQzEwMSA0OC43OTA5IDk5LjIwOTEgNDcgOTcgNDdIMzFaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik0zMCA1My4yQzMwIDUyLjA3OTkgMzAgNTEuNTE5OCAzMC4yMTggNTEuMDkyQzMwLjQwOTcgNTAuNzE1NyAzMC43MTU3IDUwLjQwOTcgMzEuMDkyIDUwLjIxOEMzMS41MTk4IDUwIDMyLjA3OTkgNTAgMzMuMiA1MEg1Ni44QzU3LjkyMDEgNTAgNTguNDgwMiA1MCA1OC45MDggNTAuMjE4QzU5LjI4NDMgNTAuNDA5NyA1OS41OTAzIDUwLjcxNTcgNTkuNzgyIDUxLjA5MkM2MCA1MS41MTk4IDYwIDUyLjA3OTkgNjAgNTMuMlY3Ni44QzYwIDc3LjkyMDEgNjAgNzguNDgwMiA1OS43ODIgNzguOTA4QzU5LjU5MDMgNzkuMjg0MyA1OS4yODQzIDc5LjU5MDMgNTguOTA4IDc5Ljc4MkM1OC40ODAyIDgwIDU3LjkyMDEgODAgNTYuOCA4MEgzMy4yQzMyLjA3OTkgODAgMzEuNTE5OCA4MCAzMS4wOTIgNzkuNzgyQzMwLjcxNTcgNzkuNTkwMyAzMC40MDk3IDc5LjI4NDMgMzAuMjE4IDc4LjkwOEMzMCA3OC40ODAyIDMwIDc3LjkyMDEgMzAgNzYuOFY1My4yWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDYzQzYzIDYyLjQ0NzcgNjMuNDQ3NyA2MiA2NCA2Mkg4OEM4OC41NTIzIDYyIDg5IDYyLjQ0NzcgODkgNjNDODkgNjMuNTUyMyA4OC41NTIzIDY0IDg4IDY0SDY0QzYzLjQ0NzcgNjQgNjMgNjMuNTUyMyA2MyA2M1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA1OUM2MyA1OC40NDc3IDYzLjQ0NzcgNTggNjQgNThIOTRDOTQuNTUyMyA1OCA5NSA1OC40NDc3IDk1IDU5Qzk1IDU5LjU1MjMgOTQuNTUyMyA2MCA5NCA2MEg2NEM2My40NDc3IDYwIDYzIDU5LjU1MjMgNjMgNTlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNTRDNjMgNTMuNDQ3NyA2My40NDc3IDUzIDY0IDUzSDc2Qzc2LjU1MjMgNTMgNzcgNTMuNDQ3NyA3NyA1NEM3NyA1NC41NTIzIDc2LjU1MjMgNTUgNzYgNTVINjRDNjMuNDQ3NyA1NSA2MyA1NC41NTIzIDYzIDU0WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTgzIDc1QzgzIDc0LjQ0NzcgODMuMzUxOCA3NCA4My43ODU3IDc0SDkzLjIxNDNDOTMuNjQ4MiA3NCA5NCA3NC40NDc3IDk0IDc1Qzk0IDc1LjU1MjMgOTMuNjQ4MiA3NiA5My4yMTQzIDc2SDgzLjc4NTdDODMuMzUxOCA3NiA4MyA3NS41NTIzIDgzIDc1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDY4QzYzIDY3LjQ0NzcgNjMuNDQ3NyA2NyA2NCA2N0g2NkM2Ni41NTIzIDY3IDY3IDY3LjQ0NzcgNjcgNjhDNjcgNjguNTUyMyA2Ni41NTIzIDY5IDY2IDY5SDY0QzYzLjQ0NzcgNjkgNjMgNjguNTUyMyA2MyA2OFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02OSA2OEM2OSA2Ny40NDc3IDY5LjQ0NzcgNjcgNzAgNjdINzNDNzMuNTUyMyA2NyA3NCA2Ny40NDc3IDc0IDY4Qzc0IDY4LjU1MjMgNzMuNTUyMyA2OSA3MyA2OUg3MEM2OS40NDc3IDY5IDY5IDY4LjU1MjMgNjkgNjhaIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNzVDNjMgNzMuODk1NCA2NC4wNjYgNzMgNjUuMzgxIDczSDc3LjYxOUM3OC45MzQgNzMgODAgNzMuODk1NCA4MCA3NUM4MCA3Ni4xMDQ2IDc4LjkzNCA3NyA3Ny42MTkgNzdINjUuMzgxQzY0LjA2NiA3NyA2MyA3Ni4xMDQ2IDYzIDc1WiIgZmlsbD0iIzlDQTNBRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4IDM3QzQ4IDM2LjQ0NzcgNDguNDQ3NyAzNiA0OSAzNkg3OUM3OS41NTIzIDM2IDgwIDM2LjQ0NzcgODAgMzdDODAgMzcuNTUyMyA3OS41NTIzIDM4IDc5IDM4SDQ5QzQ4LjQ0NzcgMzggNDggMzcuNTUyMyA0OCAzN1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01NyAzMkM1NyAzMS40NDc3IDU3LjQ0NzcgMzEgNTggMzFINzBDNzAuNTUyMyAzMSA3MSAzMS40NDc3IDcxIDMyQzcxIDMyLjU1MjMgNzAuNTUyMyAzMyA3MCAzM0g1OEM1Ny40NDc3IDMzIDU3IDMyLjU1MjMgNTcgMzJaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik00NC4wMjYxIDU0LjE4MjdDNDQuMjY2MSA1My4xNTE4IDQ1LjczMzkgNTMuMTUxOCA0NS45NzM5IDU0LjE4MjdMNDcuNDQ4NiA2MC41MTZDNDcuNTYxNCA2MS4wMDAxIDQ4LjAxMjYgNjEuMzI4IDQ4LjUwNzkgNjEuMjg1Nkw1NC45ODY5IDYwLjczMUM1Ni4wNDE1IDYwLjY0MDcgNTYuNDk1MSA2Mi4wMzY3IDU1LjU4ODggNjIuNTgzNkw1MC4wMjEyIDY1Ljk0MzJDNDkuNTk1NiA2Ni4yIDQ5LjQyMzMgNjYuNzMwNCA0OS42MTY2IDY3LjE4ODRMNTIuMTQ2MiA3My4xNzg5QzUyLjU1NzkgNzQuMTU0IDUxLjM3MDUgNzUuMDE2OCA1MC41NzAzIDc0LjMyMzhMNDUuNjU0NiA3MC4wNjY5QzQ1LjI3ODkgNjkuNzQxNSA0NC43MjExIDY5Ljc0MTUgNDQuMzQ1NCA3MC4wNjY5TDM5LjQyOTcgNzQuMzIzOEMzOC42Mjk1IDc1LjAxNjggMzcuNDQyMSA3NC4xNTQgMzcuODUzOCA3My4xNzg5TDQwLjM4MzQgNjcuMTg4NEM0MC41NzY3IDY2LjczMDQgNDAuNDA0NCA2Ni4yIDM5Ljk3ODggNjUuOTQzMkwzNC40MTEyIDYyLjU4MzZDMzMuNTA0OSA2Mi4wMzY3IDMzLjk1ODQgNjAuNjQwNyAzNS4wMTMxIDYwLjczMUw0MS40OTIxIDYxLjI4NTZDNDEuOTg3NCA2MS4zMjggNDIuNDM4NiA2MS4wMDAxIDQyLjU1MTQgNjAuNTE2TDQ0LjAyNjEgNTQuMTgyN1oiIGZpbGw9IiNEMUQ1REIiLz4KPGRlZnM+CjxmaWx0ZXIgaWQ9ImZpbHRlcjBfZF8xMDMzXzEwMTI1IiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd18xMDMzXzEwMTI1Ii8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzEwMzNfMTAxMjUiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTAzM18xMDEyNSIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",fh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMzI1Ml8xMjc0MDIpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPGNpcmNsZSBjeD0iMTciIGN5PSIxNiIgcj0iMyIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg0IDE2Qzg0IDE1LjQ0NzcgODQuNDQ3NyAxNSA4NSAxNUg5M0M5My41NTIzIDE1IDk0IDE1LjQ0NzcgOTQgMTZDOTQgMTYuNTUyMyA5My41NTIzIDE3IDkzIDE3SDg1Qzg0LjQ0NzcgMTcgODQgMTYuNTUyMyA4NCAxNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03MCAxNkM3MCAxNS40NDc3IDcwLjQ0NzcgMTUgNzEgMTVINzlDNzkuNTUyMyAxNSA4MCAxNS40NDc3IDgwIDE2QzgwIDE2LjU1MjMgNzkuNTUyMyAxNyA3OSAxN0g3MUM3MC40NDc3IDE3IDcwIDE2LjU1MjMgNzAgMTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTggMTZDOTggMTUuNDQ3NyA5OC40NDc3IDE1IDk5IDE1SDEwN0MxMDcuNTUyIDE1IDEwOCAxNS40NDc3IDEwOCAxNkMxMDggMTYuNTUyMyAxMDcuNTUyIDE3IDEwNyAxN0g5OUM5OC40NDc3IDE3IDk4IDE2LjU1MjMgOTggMTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik0yNyA1MUMyNyA0OC43OTA5IDI4Ljc5MDkgNDcgMzEgNDdIOTdDOTkuMjA5MSA0NyAxMDEgNDguNzkwOSAxMDEgNTFWNzlDMTAxIDgxLjIwOTEgOTkuMjA5MSA4MyA5NyA4M0gzMUMyOC43OTA5IDgzIDI3IDgxLjIwOTEgMjcgNzlWNTFaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMxIDQ2SDk3Qzk5Ljc2MTQgNDYgMTAyIDQ4LjIzODYgMTAyIDUxVjc5QzEwMiA4MS43NjE0IDk5Ljc2MTQgODQgOTcgODRIMzFDMjguMjM4NiA4NCAyNiA4MS43NjE0IDI2IDc5VjUxQzI2IDQ4LjIzODYgMjguMjM4NiA0NiAzMSA0NlpNMzEgNDdDMjguNzkwOSA0NyAyNyA0OC43OTA5IDI3IDUxVjc5QzI3IDgxLjIwOTEgMjguNzkwOSA4MyAzMSA4M0g5N0M5OS4yMDkxIDgzIDEwMSA4MS4yMDkxIDEwMSA3OVY1MUMxMDEgNDguNzkwOSA5OS4yMDkxIDQ3IDk3IDQ3SDMxWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBkPSJNMzAgNTMuMkMzMCA1Mi4wNzk5IDMwIDUxLjUxOTggMzAuMjE4IDUxLjA5MkMzMC40MDk3IDUwLjcxNTcgMzAuNzE1NyA1MC40MDk3IDMxLjA5MiA1MC4yMThDMzEuNTE5OCA1MCAzMi4wNzk5IDUwIDMzLjIgNTBINTYuOEM1Ny45MjAxIDUwIDU4LjQ4MDIgNTAgNTguOTA4IDUwLjIxOEM1OS4yODQzIDUwLjQwOTcgNTkuNTkwMyA1MC43MTU3IDU5Ljc4MiA1MS4wOTJDNjAgNTEuNTE5OCA2MCA1Mi4wNzk5IDYwIDUzLjJWNzYuOEM2MCA3Ny45MjAxIDYwIDc4LjQ4MDIgNTkuNzgyIDc4LjkwOEM1OS41OTAzIDc5LjI4NDMgNTkuMjg0MyA3OS41OTAzIDU4LjkwOCA3OS43ODJDNTguNDgwMiA4MCA1Ny45MjAxIDgwIDU2LjggODBIMzMuMkMzMi4wNzk5IDgwIDMxLjUxOTggODAgMzEuMDkyIDc5Ljc4MkMzMC43MTU3IDc5LjU5MDMgMzAuNDA5NyA3OS4yODQzIDMwLjIxOCA3OC45MDhDMzAgNzguNDgwMiAzMCA3Ny45MjAxIDMwIDc2LjhWNTMuMloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA2M0M2MyA2Mi40NDc3IDYzLjQ0NzcgNjIgNjQgNjJIODhDODguNTUyMyA2MiA4OSA2Mi40NDc3IDg5IDYzQzg5IDYzLjU1MjMgODguNTUyMyA2NCA4OCA2NEg2NEM2My40NDc3IDY0IDYzIDYzLjU1MjMgNjMgNjNaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNTlDNjMgNTguNDQ3NyA2My40NDc3IDU4IDY0IDU4SDk0Qzk0LjU1MjMgNTggOTUgNTguNDQ3NyA5NSA1OUM5NSA1OS41NTIzIDk0LjU1MjMgNjAgOTQgNjBINjRDNjMuNDQ3NyA2MCA2MyA1OS41NTIzIDYzIDU5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDU0QzYzIDUzLjQ0NzcgNjMuNDQ3NyA1MyA2NCA1M0g3NkM3Ni41NTIzIDUzIDc3IDUzLjQ0NzcgNzcgNTRDNzcgNTQuNTUyMyA3Ni41NTIzIDU1IDc2IDU1SDY0QzYzLjQ0NzcgNTUgNjMgNTQuNTUyMyA2MyA1NFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA2OEM2MyA2Ny40NDc3IDYzLjQ0NzcgNjcgNjQgNjdINjZDNjYuNTUyMyA2NyA2NyA2Ny40NDc3IDY3IDY4QzY3IDY4LjU1MjMgNjYuNTUyMyA2OSA2NiA2OUg2NEM2My40NDc3IDY5IDYzIDY4LjU1MjMgNjMgNjhaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjkgNjhDNjkgNjcuNDQ3NyA2OS40NDc3IDY3IDcwIDY3SDczQzczLjU1MjMgNjcgNzQgNjcuNDQ3NyA3NCA2OEM3NCA2OC41NTIzIDczLjU1MjMgNjkgNzMgNjlINzBDNjkuNDQ3NyA2OSA2OSA2OC41NTIzIDY5IDY4WiIgZmlsbD0iIzlDQTNBRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDc1QzYzIDczLjg5NTQgNjQuMDY2IDczIDY1LjM4MSA3M0g4MS42MTlDODIuOTM0IDczIDg0IDczLjg5NTQgODQgNzVDODQgNzYuMTA0NiA4Mi45MzQgNzcgODEuNjE5IDc3SDY1LjM4MUM2NC4wNjYgNzcgNjMgNzYuMTA0NiA2MyA3NVoiIGZpbGw9IiM5Q0EzQUYiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00OCAzN0M0OCAzNi40NDc3IDQ4LjQ0NzcgMzYgNDkgMzZINzlDNzkuNTUyMyAzNiA4MCAzNi40NDc3IDgwIDM3QzgwIDM3LjU1MjMgNzkuNTUyMyAzOCA3OSAzOEg0OUM0OC40NDc3IDM4IDQ4IDM3LjU1MjMgNDggMzdaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNTcgMzJDNTcgMzEuNDQ3NyA1Ny40NDc3IDMxIDU4IDMxSDcwQzcwLjU1MjMgMzEgNzEgMzEuNDQ3NyA3MSAzMkM3MSAzMi41NTIzIDcwLjU1MjMgMzMgNzAgMzNINThDNTcuNDQ3NyAzMyA1NyAzMi41NTIzIDU3IDMyWiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNDMuMDY4OCA1Ny4xNzI3QzQzLjYwMDEgNTUuMTk5MyA0Ni4zOTk5IDU1LjE5OTMgNDYuOTMxMiA1Ny4xNzI3TDQ3Ljg4MjYgNjAuNzA2MUM0OC4wNjc5IDYxLjM5NDQgNDguNjA1NiA2MS45MzIxIDQ5LjI5MzkgNjIuMTE3NEw1Mi44MjczIDYzLjA2ODhDNTQuODAwNyA2My42MDAxIDU0LjgwMDcgNjYuMzk5OSA1Mi44MjczIDY2LjkzMTJMNDkuMjkzOSA2Ny44ODI2QzQ4LjYwNTYgNjguMDY3OSA0OC4wNjc5IDY4LjYwNTYgNDcuODgyNiA2OS4yOTM5TDQ2LjkzMTIgNzIuODI3M0M0Ni4zOTk5IDc0LjgwMDcgNDMuNjAwMSA3NC44MDA3IDQzLjA2ODggNzIuODI3M0w0Mi4xMTc0IDY5LjI5MzlDNDEuOTMyMSA2OC42MDU2IDQxLjM5NDQgNjguMDY3OSA0MC43MDYxIDY3Ljg4MjZMMzcuMTcyNyA2Ni45MzEyQzM1LjE5OTMgNjYuMzk5OSAzNS4xOTkzIDYzLjYwMDEgMzcuMTcyNyA2My4wNjg4TDQwLjcwNjEgNjIuMTE3NEM0MS4zOTQ0IDYxLjkzMjEgNDEuOTMyMSA2MS4zOTQ0IDQyLjExNzQgNjAuNzA2MUw0My4wNjg4IDU3LjE3MjdaIiBmaWxsPSIjRDFENURCIi8+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMzI1Ml8xMjc0MDIiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIi8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=",ph="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMjEzNl8xMjUzNjgpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPHBhdGggZD0iTTggMTcuNkM4IDE0LjIzOTcgOCAxMi41NTk1IDguNjUzOTYgMTEuMjc2MUM5LjIyOTIgMTAuMTQ3MSAxMC4xNDcxIDkuMjI5MiAxMS4yNzYxIDguNjUzOTZDMTIuNTU5NSA4IDE0LjIzOTcgOCAxNy42IDhINDZWNzAuNEM0NiA3My43NjAzIDQ2IDc1LjQ0MDUgNDUuMzQ2IDc2LjcyMzlDNDQuNzcwOCA3Ny44NTI5IDQzLjg1MjkgNzguNzcwOCA0Mi43MjM5IDc5LjM0NkM0MS40NDA1IDgwIDM5Ljc2MDMgODAgMzYuNCA4MEg4VjE3LjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik03MCAzNkM3MCAzNC44OTU0IDcwLjg5NTQgMzQgNzIgMzRIMTA4QzEwOS4xMDUgMzQgMTEwIDM0Ljg5NTQgMTEwIDM2VjM4QzExMCAzOS4xMDQ2IDEwOS4xMDUgNDAgMTA4IDQwSDcyQzcwLjg5NTQgNDAgNzAgMzkuMTA0NiA3MCAzOFYzNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTcwIDQ1QzcwIDQzLjg5NTQgNzAuODk1NCA0MyA3MiA0M0gxMDhDMTA5LjEwNSA0MyAxMTAgNDMuODk1NCAxMTAgNDVWNDdDMTEwIDQ4LjEwNDYgMTA5LjEwNSA0OSAxMDggNDlINzJDNzAuODk1NCA0OSA3MCA0OC4xMDQ2IDcwIDQ3VjQ1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNzAgNTRDNzAgNTIuODk1NCA3MC44OTU0IDUyIDcyIDUySDg1Qzg2LjEwNDYgNTIgODcgNTIuODk1NCA4NyA1NFY1NkM4NyA1Ny4xMDQ2IDg2LjEwNDYgNTggODUgNThINzJDNzAuODk1NCA1OCA3MCA1Ny4xMDQ2IDcwIDU2VjU0WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNOTAgNTRDOTAgNTIuODk1NCA5MC44OTU0IDUyIDkyIDUySDEwNUMxMDYuMTA1IDUyIDEwNyA1Mi44OTU0IDEwNyA1NFY1NkMxMDcgNTcuMTA0NiAxMDYuMTA1IDU4IDEwNSA1OEg5MkM5MC44OTU0IDU4IDkwIDU3LjEwNDYgOTAgNTZWNTRaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMjlDNzAgMjguNDQ3NyA3MC40NDc3IDI4IDcxIDI4SDg3Qzg3LjU1MjMgMjggODggMjguNDQ3NyA4OCAyOUM4OCAyOS41NTIzIDg3LjU1MjMgMzAgODcgMzBINzFDNzAuNDQ3NyAzMCA3MCAyOS41NTIzIDcwIDI5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNzAgNjRDNzAgNjIuODk1NCA3MC44OTU0IDYyIDcyIDYySDk2Qzk3LjEwNDYgNjIgOTggNjIuODk1NCA5OCA2NFY2NkM5OCA2Ny4xMDQ2IDk3LjEwNDYgNjggOTYgNjhINzJDNzAuODk1NCA2OCA3MCA2Ny4xMDQ2IDcwIDY2VjY0WiIgZmlsbD0iIzlDQTNBRiIvPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgMTZDOTcgMTQuODk1NCA5OC4wNjYgMTQgOTkuMzgxIDE0SDExMS42MTlDMTEyLjkzNCAxNCAxMTQgMTQuODk1NCAxMTQgMTZDMTE0IDE3LjEwNDYgMTEyLjkzNCAxOCAxMTEuNjE5IDE4SDk5LjM4MUM5OC4wNjYgMTggOTcgMTcuMTA0NiA5NyAxNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTMwIDMyLjRDMzAgMzAuMTU5OCAzMCAyOS4wMzk3IDMwLjQzNiAyOC4xODRDMzAuODE5NSAyNy40MzE0IDMxLjQzMTQgMjYuODE5NSAzMi4xODQgMjYuNDM2QzMzLjAzOTcgMjYgMzQuMTU5OCAyNiAzNi40IDI2SDU1LjZDNTcuODQwMiAyNiA1OC45NjAzIDI2IDU5LjgxNiAyNi40MzZDNjAuNTY4NiAyNi44MTk1IDYxLjE4MDUgMjcuNDMxNCA2MS41NjQgMjguMTg0QzYyIDI5LjAzOTcgNjIgMzAuMTU5OCA2MiAzMi40VjY3LjZDNjIgNjkuODQwMiA2MiA3MC45NjAzIDYxLjU2NCA3MS44MTZDNjEuMTgwNSA3Mi41Njg2IDYwLjU2ODYgNzMuMTgwNSA1OS44MTYgNzMuNTY0QzU4Ljk2MDMgNzQgNTcuODQwMiA3NCA1NS42IDc0SDM2LjRDMzQuMTU5OCA3NCAzMy4wMzk3IDc0IDMyLjE4NCA3My41NjRDMzEuNDMxNCA3My4xODA1IDMwLjgxOTUgNzIuNTY4NiAzMC40MzYgNzEuODE2QzMwIDcwLjk2MDMgMzAgNjkuODQwMiAzMCA2Ny42VjMyLjRaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik0yOCAzMC40QzI4IDI4LjE1OTggMjggMjcuMDM5NyAyOC40MzYgMjYuMTg0QzI4LjgxOTUgMjUuNDMxNCAyOS40MzE0IDI0LjgxOTUgMzAuMTg0IDI0LjQzNkMzMS4wMzk3IDI0IDMyLjE1OTggMjQgMzQuNCAyNEg1My42QzU1Ljg0MDIgMjQgNTYuOTYwMyAyNCA1Ny44MTYgMjQuNDM2QzU4LjU2ODYgMjQuODE5NSA1OS4xODA1IDI1LjQzMTQgNTkuNTY0IDI2LjE4NEM2MCAyNy4wMzk3IDYwIDI4LjE1OTggNjAgMzAuNFY2NS42QzYwIDY3Ljg0MDIgNjAgNjguOTYwMyA1OS41NjQgNjkuODE2QzU5LjE4MDUgNzAuNTY4NiA1OC41Njg2IDcxLjE4MDUgNTcuODE2IDcxLjU2NEM1Ni45NjAzIDcyIDU1Ljg0MDIgNzIgNTMuNiA3MkgzNC40QzMyLjE1OTggNzIgMzEuMDM5NyA3MiAzMC4xODQgNzEuNTY0QzI5LjQzMTQgNzEuMTgwNSAyOC44MTk1IDcwLjU2ODYgMjguNDM2IDY5LjgxNkMyOCA2OC45NjAzIDI4IDY3Ljg0MDIgMjggNjUuNlYzMC40WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zMyA1N0MzMyA1Ni40NDc3IDMzLjI4OTcgNTYgMzMuNjQ3MSA1Nkg1NC4zNTI5QzU0LjcxMDMgNTYgNTUgNTYuNDQ3NyA1NSA1N0M1NSA1Ny41NTIzIDU0LjcxMDMgNTggNTQuMzUyOSA1OEgzMy42NDcxQzMzLjI4OTcgNTggMzMgNTcuNTUyMyAzMyA1N1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNiA2MkMzNiA2MS40NDc3IDM2LjI5MjcgNjEgMzYuNjUzOCA2MUg1Mi4zNDYyQzUyLjcwNzMgNjEgNTMgNjEuNDQ3NyA1MyA2MkM1MyA2Mi41NTIzIDUyLjcwNzMgNjMgNTIuMzQ2MiA2M0gzNi42NTM4QzM2LjI5MjcgNjMgMzYgNjIuNTUyMyAzNiA2MloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTQzLjA2NTMgMzQuNDU4NUM0My4zOTIxIDMzLjU5OSA0NC42MDc5IDMzLjU5OSA0NC45MzQ3IDM0LjQ1ODVMNDcuNjgzOCA0MS42ODg5QzQ3LjcyMTggNDEuNzg5IDQ3Ljc3NTcgNDEuODgyMyA0Ny44NDM0IDQxLjk2NTNMNTIuNzMwNiA0Ny45NjEzQzUzLjMxMTUgNDguNjc0IDUyLjcwMzYgNDkuNzI3IDUxLjc5NTkgNDkuNTgwM0w0NC4xNTk2IDQ4LjM0NThDNDQuMDUzOSA0OC4zMjg3IDQzLjk0NjEgNDguMzI4NyA0My44NDA0IDQ4LjM0NThMMzYuMjA0MSA0OS41ODAzQzM1LjI5NjQgNDkuNzI3IDM0LjY4ODUgNDguNjc0IDM1LjI2OTQgNDcuOTYxM0w0MC4xNTY2IDQxLjk2NTNDNDAuMjI0MyA0MS44ODIzIDQwLjI3ODIgNDEuNzg5IDQwLjMxNjIgNDEuNjg4OUw0My4wNjUzIDM0LjQ1ODVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgOTZDNzAgOTUuNDQ3NyA3MC40NDc3IDk1IDcxIDk1SDk5Qzk5LjU1MjMgOTUgMTAwIDk1LjQ0NzcgMTAwIDk2QzEwMCA5Ni41NTIzIDk5LjU1MjMgOTcgOTkgOTdINzFDNzAuNDQ3NyA5NyA3MCA5Ni41NTIzIDcwIDk2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDEwMEM3MCA5OS40NDc3IDcwLjQ0NzcgOTkgNzEgOTlIOTJDOTIuNTUyMyA5OSA5MyA5OS40NDc3IDkzIDEwMEM5MyAxMDAuNTUyIDkyLjU1MjMgMTAxIDkyIDEwMUg3MUM3MC40NDc3IDEwMSA3MCAxMDAuNTUyIDcwIDEwMFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03NiAxMDVDNzYgMTA0LjQ0OCA3Ni40NDc3IDEwNCA3NyAxMDRIODRDODQuNTUyMyAxMDQgODUgMTA0LjQ0OCA4NSAxMDVDODUgMTA1LjU1MiA4NC41NTIzIDEwNiA4NCAxMDZINzdDNzYuNDQ3NyAxMDYgNzYgMTA1LjU1MiA3NiAxMDVaIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9IjcyIiBjeT0iMTA1IiByPSIyIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjggOTZDMjggOTUuNDQ3NyAyOC40NDc3IDk1IDI5IDk1SDU3QzU3LjU1MjMgOTUgNTggOTUuNDQ3NyA1OCA5NkM1OCA5Ni41NTIzIDU3LjU1MjMgOTcgNTcgOTdIMjlDMjguNDQ3NyA5NyAyOCA5Ni41NTIzIDI4IDk2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTI4IDEwMEMyOCA5OS40NDc3IDI4LjQ0NzcgOTkgMjkgOTlINTBDNTAuNTUyMyA5OSA1MSA5OS40NDc3IDUxIDEwMEM1MSAxMDAuNTUyIDUwLjU1MjMgMTAxIDUwIDEwMUgyOUMyOC40NDc3IDEwMSAyOCAxMDAuNTUyIDI4IDEwMFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNCAxMDVDMzQgMTA0LjQ0OCAzNC40NDc3IDEwNCAzNSAxMDRINDJDNDIuNTUyMyAxMDQgNDMgMTA0LjQ0OCA0MyAxMDVDNDMgMTA1LjU1MiA0Mi41NTIzIDEwNiA0MiAxMDZIMzVDMzQuNDQ3NyAxMDYgMzQgMTA1LjU1MiAzNCAxMDVaIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9IjMwIiBjeT0iMTA1IiByPSIyIiBmaWxsPSIjRDFENURCIi8+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMjEzNl8xMjUzNjgiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4Ii8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4Ii8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4IiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=",mh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMTAzM18xMDE2MikiPgo8cmVjdCB4PSI4IiB5PSI4IiB3aWR0aD0iMTEyIiBoZWlnaHQ9IjExMiIgcng9IjYiIGZpbGw9IiNGOUZBRkIiLz4KPC9nPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTggMTZDOTggMTUuNDQ3NyA5OC40NDc3IDE1IDk5IDE1SDEwN0MxMDcuNTUyIDE1IDEwOCAxNS40NDc3IDEwOCAxNkMxMDggMTYuNTUyMyAxMDcuNTUyIDE3IDEwNyAxN0g5OUM5OC40NDc3IDE3IDk4IDE2LjU1MjMgOTggMTZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMTZDNzAgMTUuNDQ3NyA3MC40NDc3IDE1IDcxIDE1SDc5Qzc5LjU1MjMgMTUgODAgMTUuNDQ3NyA4MCAxNkM4MCAxNi41NTIzIDc5LjU1MjMgMTcgNzkgMTdINzFDNzAuNDQ3NyAxNyA3MCAxNi41NTIzIDcwIDE2WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg0IDE2Qzg0IDE1LjQ0NzcgODQuNDQ3NyAxNSA4NSAxNUg5M0M5My41NTIzIDE1IDk0IDE1LjQ0NzcgOTQgMTZDOTQgMTYuNTUyMyA5My41NTIzIDE3IDkzIDE3SDg1Qzg0LjQ0NzcgMTcgODQgMTYuNTUyMyA4NCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHJlY3QgeD0iMzcuNSIgeT0iNDMuNSIgd2lkdGg9IjUyIiBoZWlnaHQ9IjU2IiByeD0iMi41IiBmaWxsPSJ3aGl0ZSIgc3Ryb2tlPSIjRjNGNEY2Ii8+CjxwYXRoIGQ9Ik00MSA1NkM0MSA1NC44OTU0IDQxLjg5NTQgNTQgNDMgNTRINTJDNTMuMTA0NiA1NCA1NCA1NC44OTU0IDU0IDU2QzU0IDU3LjEwNDYgNTMuMTA0NiA1OCA1MiA1OEg0M0M0MS44OTU0IDU4IDQxIDU3LjEwNDYgNDEgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik01NyA1NkM1NyA1NC44OTU0IDU3Ljg5NTQgNTQgNTkgNTRINjhDNjkuMTA0NiA1NCA3MCA1NC44OTU0IDcwIDU2QzcwIDU3LjEwNDYgNjkuMTA0NiA1OCA2OCA1OEg1OUM1Ny44OTU0IDU4IDU3IDU3LjEwNDYgNTcgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik03MyA1NkM3MyA1NC44OTU0IDczLjg5NTQgNTQgNzUgNTRIODRDODUuMTA0NiA1NCA4NiA1NC44OTU0IDg2IDU2Qzg2IDU3LjEwNDYgODUuMTA0NiA1OCA4NCA1OEg3NUM3My44OTU0IDU4IDczIDU3LjEwNDYgNzMgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA3MkM0MSA3MC44OTU0IDQxLjg5NTQgNzAgNDMgNzBINTZDNTcuMTA0NiA3MCA1OCA3MC44OTU0IDU4IDcyQzU4IDczLjEwNDYgNTcuMTA0NiA3NCA1NiA3NEg0M0M0MS44OTU0IDc0IDQxIDczLjEwNDYgNDEgNzJaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA3MkM2MiA3MC44OTU0IDYyLjg5NTQgNzAgNjQgNzBIODNDODQuMTA0NiA3MCA4NSA3MC44OTU0IDg1IDcyQzg1IDczLjEwNDYgODQuMTA0NiA3NCA4MyA3NEg2NEM2Mi44OTU0IDc0IDYyIDczLjEwNDYgNjIgNzJaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA3OUM0MSA3Ny44OTU0IDQxLjg5NTQgNzcgNDMgNzdINTZDNTcuMTA0NiA3NyA1OCA3Ny44OTU0IDU4IDc5QzU4IDgwLjEwNDYgNTcuMTA0NiA4MSA1NiA4MUg0M0M0MS44OTU0IDgxIDQxIDgwLjEwNDYgNDEgNzlaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA3OUM2MiA3Ny44OTU0IDYyLjg5NTQgNzcgNjQgNzdINzdDNzguMTA0NiA3NyA3OSA3Ny44OTU0IDc5IDc5Qzc5IDgwLjEwNDYgNzguMTA0NiA4MSA3NyA4MUg2NEM2Mi44OTU0IDgxIDYyIDgwLjEwNDYgNjIgNzlaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA4NkM0MSA4NC44OTU0IDQxLjg5NTQgODQgNDMgODRINTZDNTcuMTA0NiA4NCA1OCA4NC44OTU0IDU4IDg2QzU4IDg3LjEwNDYgNTcuMTA0NiA4OCA1NiA4OEg0M0M0MS44OTU0IDg4IDQxIDg3LjEwNDYgNDEgODZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA4NkM2MiA4NC44OTU0IDYyLjg5NTQgODQgNjQgODRINzhDNzkuMTA0NiA4NCA4MCA4NC44OTU0IDgwIDg2QzgwIDg3LjEwNDYgNzkuMTA0NiA4OCA3OCA4OEg2NEM2Mi44OTU0IDg4IDYyIDg3LjEwNDYgNjIgODZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA5M0M0MSA5MS44OTU0IDQxLjg5NTQgOTEgNDMgOTFINTZDNTcuMTA0NiA5MSA1OCA5MS44OTU0IDU4IDkzQzU4IDk0LjEwNDYgNTcuMTA0NiA5NSA1NiA5NUg0M0M0MS44OTU0IDk1IDQxIDk0LjEwNDYgNDEgOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA5M0M2MiA5MS44OTU0IDYyLjg5NTQgOTEgNjQgOTFIODFDODIuMTA0NiA5MSA4MyA5MS44OTU0IDgzIDkzQzgzIDk0LjEwNDYgODIuMTA0NiA5NSA4MSA5NUg2NEM2Mi44OTU0IDk1IDYyIDk0LjEwNDYgNjIgOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDEgNDkuNUM0MSA0OC42NzE2IDQxLjY3MTYgNDggNDIuNSA0OEg2Mi41QzYzLjMyODQgNDggNjQgNDguNjcxNiA2NCA0OS41QzY0IDUwLjMyODQgNjMuMzI4NCA1MSA2Mi41IDUxSDQyLjVDNDEuNjcxNiA1MSA0MSA1MC4zMjg0IDQxIDQ5LjVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDEgNjUuNUM0MSA2NC42NzE2IDQxLjY3MTYgNjQgNDIuNSA2NEg2Mi41QzYzLjMyODQgNjQgNjQgNjQuNjcxNiA2NCA2NS41QzY0IDY2LjMyODQgNjMuMzI4NCA2NyA2Mi41IDY3SDQyLjVDNDEuNjcxNiA2NyA0MSA2Ni4zMjg0IDQxIDY1LjVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDQgMzVDNDQgMzQuNDQ3NyA0NC40NDc3IDM0IDQ1IDM0SDgzQzgzLjU1MjMgMzQgODQgMzQuNDQ3NyA4NCAzNUM4NCAzNS41NTIzIDgzLjU1MjMgMzYgODMgMzZINDVDNDQuNDQ3NyAzNiA0NCAzNS41NTIzIDQ0IDM1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUzIDMwLjVDNTMgMjkuNjcxNiA1My42NzE2IDI5IDU0LjUgMjlINzIuNUM3My4zMjg0IDI5IDc0IDI5LjY3MTYgNzQgMzAuNUM3NCAzMS4zMjg0IDczLjMyODQgMzIgNzIuNSAzMkg1NC41QzUzLjY3MTYgMzIgNTMgMzEuMzI4NCA1MyAzMC41WiIgZmlsbD0iI0QxRDVEQiIvPgo8Y2lyY2xlIGN4PSI2My41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSI1NS41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSI3MS41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzEwMzNfMTAxNjIiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzEwMzNfMTAxNjIiLz4KPGZlT2Zmc2V0IGR5PSI0Ii8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjMiLz4KPGZlQ29tcG9zaXRlIGluMj0iaGFyZEFscGhhIiBvcGVyYXRvcj0ib3V0Ii8+CjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwLjE2IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTAzM18xMDE2MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd18xMDMzXzEwMTYyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=",hh=(0,s.createContext)({}),gh=()=>(0,s.useContext)(hh),wh={open:{opacity:1},exit:{opacity:0}},yh={duration:.2},bh=({open:e,setOpen:t,children:n,trigger:r=null,className:o,exitOnClickOutside:a=!1,exitOnEsc:i=!0,design:l="simple",scrollLock:c=!0})=>{const u=void 0!==e&&void 0!==t,[d,f]=(0,s.useState)(!1),p=(0,s.useRef)(null),m=(0,s.useRef)(null),h=(0,s.useMemo)(()=>u?e:d,[e,d]),g=(0,s.useMemo)(()=>u?t:f,[f,t]),{refs:w,context:y}=uo({open:h,onOpenChange:g}),b=ao(y),v=co(y,{enabled:a||i,escapeKey:i,outsidePress:e=>!!a&&!e?.target?.closest("ul.fui-toast-container")}),x=Eo(y,{role:"dialog"}),{getFloatingProps:N}=ho([b,v,x]),E=()=>{h||g(!0)},_=(0,s.useCallback)(()=>(0,s.isValidElement)(r)?(0,s.cloneElement)(r,{onClick:ke(E,r?.props?.onClick),ref:w.setReference,"aria-haspopup":"dialog","aria-expanded":h}):"function"==typeof r?r({onClick:E}):null,[r,E,w.setReference,h]);return(0,j.jsxs)(j.Fragment,{children:[_(),(0,j.jsx)(hh.Provider,{value:{open:h,setOpen:g,handleClose:()=>{h&&g(!1)},design:l,context:y,getFloatingProps:N,refs:w,dialogContainerRef:m,dialogRef:p,scrollLock:c,className:o},children:n})]})};bh.displayName="Dialog";const vh=({children:e,className:t})=>{const{open:n,handleClose:r,context:o,getFloatingProps:a,dialogRef:i,scrollLock:s,dialogContainerRef:l,className:c,refs:u}=gh();return(0,j.jsx)(lp,{children:n&&(0,j.jsx)(no,{ref:l,lockScroll:s,className:Se("z-999999",c),"aria-modal":"true",children:(0,j.jsx)(Kr,{context:o,...u?.reference&&{returnFocus:u.reference},children:(0,j.jsx)(vf.div,{className:"fixed inset-0 overflow-y-auto",initial:"exit",animate:"open",exit:"exit",variants:wh,role:"dialog","aria-modal":"true",transition:yh,children:(0,j.jsx)("div",{className:"flex items-center justify-center min-h-full",children:(0,j.jsx)("div",{ref:e=>{e&&(i.current=e,o&&o.refs.setFloating(e))},...a?.(),className:Se("flex flex-col gap-5 w-120 h-fit bg-background-primary border border-solid border-border-subtle rounded-xl shadow-soft-shadow-2xl my-5 overflow-hidden",t),children:"function"==typeof e?e({close:r}):e})})})})})})};vh.displayName="Dialog.Panel";const xh=({children:e,...t})=>(0,j.jsx)(Zr,{...t,children:e});xh.displayName="Dialog.Portal";const Nh=({className:e,...t})=>{const{open:n,dialogContainerRef:r}=gh();return r?.current?(0,j.jsx)(j.Fragment,{children:(0,un.createPortal)((0,j.jsx)(lp,{children:n&&(0,j.jsx)(vf.div,{className:Se("fixed inset-0 -z-10 bg-background-inverse/90",e),...t,initial:"exit",animate:"open",exit:"exit",variants:wh,transition:yh})}),r.current)}):null};Nh.displayName="Dialog.Backdrop";const Eh=({children:e,className:t,...n})=>(0,j.jsx)("div",{className:Se("space-y-2 px-5 pt-5 pb-1",t),...n,children:e});Eh.displayName="Dialog.Header";const _h=({children:e,as:t="h3",className:n,...r})=>(0,j.jsx)(t,{className:Se("text-base font-semibold text-text-primary m-0 p-0",n),...r,children:e});_h.displayName="Dialog.Title";const Mh=({children:e,as:t="p",className:n,...r})=>(0,j.jsx)(t,{className:Se("text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",n),...r,children:e});Mh.displayName="Dialog.Description";const Ih=({className:e,...t})=>(0,j.jsx)("button",{className:Se("bg-transparent inline-flex justify-center items-center border-0 p-1 m-0 cursor-pointer focus:outline-none outline-none shadow-none",e),"aria-label":"Close dialog",...t,children:(0,j.jsx)(Tf,{className:"size-4 text-text-primary shrink-0"})}),Sh=({children:e,as:t=s.Fragment,...n})=>{const{handleClose:r}=gh();return e?t===s.Fragment?"function"==typeof e?e({close:r}):(0,s.cloneElement)(e,{onClick:r}):(0,j.jsx)(t,{...n,onClick:r,"aria-label":"Close dialog",children:e}):(0,j.jsx)(Ih,{onClick:r,...n})};Sh.displayName="Dialog.CloseButton";const kh=({children:e,className:t,...n})=>(0,j.jsx)("div",{className:Se("px-5",t),...n,children:e});kh.displayName="Dialog.Body";const Dh=({children:e,className:t})=>{const{design:n,handleClose:r}=gh();return(0,j.jsx)("div",{className:Se("p-4 flex justify-end gap-3",{"bg-background-secondary":"footer-divided"===n},t),children:e?"function"==typeof e?e({close:r}):e:null})};function Ch({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}Dh.displayName="Dialog.Footer",bh.Panel=vh,bh.Portal=xh,bh.Title=_h,bh.Description=Mh,bh.CloseButton=Sh,bh.Header=Eh,bh.Body=kh,bh.Footer=Dh,bh.Backdrop=Nh;const jh=s.forwardRef(Ch),Ah=e=>(0,i.createElement)("span",{className:`inline-block h-18 w-18 animate-spin rounded-full border-2 border-solid border-brand-500 border-r-transparent align-[-0.125em] mr-1 ${e.className?e.className:""}`});function Th(e){if(e)return(0,i.createElement)(bh,{open:e.isOpen,setOpen:t=>{t||e.onClose()},exitOnClickOutside:!1,exitOnEsc:!1,className:"wcf-confirm-popup"},(0,i.createElement)(bh.Panel,{className:"wcf-confirm-popup-wrapper !p-3 !gap-4"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)("div",{className:"flex gap-2.5 p-2"},(0,i.createElement)(jh,{className:"w-6 h-6 text-support-warning shrink-0 mt-0.5","aria-hidden":"true"}),(0,i.createElement)("div",{className:"flex flex-col gap-1.5 flex-1 min-w-0"},(0,i.createElement)("div",{className:"flex items-center justify-between"},(0,i.createElement)(bh.Title,{className:"!text-lg"},e.title),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)("p",{className:"text-sm text-text-secondary m-0"},e.description))),(0,i.createElement)(bh.Footer,{className:"!p-2 flex gap-3 justify-end"},(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:e.onClose},e.cancelBtnText),(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:e.onConfirm,disabled:e.isLoading},e.isLoading?(0,i.createElement)(Ah,{className:"border-white border-r-transparent"}):e.actionBtnText))))}const Lh=(0,s.createContext)();function Oh(){return(0,s.useContext)(Lh)}function zh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const Ph=s.forwardRef(zh);function Rh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Uh=s.forwardRef(Rh);function Bh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Fh=s.forwardRef(Bh);function Qh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"}))}const Vh=s.forwardRef(Qh);function Yh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Zh=s.forwardRef(Yh);function Wh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const Gh=s.forwardRef(Wh);function Hh({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const $h=s.forwardRef(Hh);var Xh=n(4601),qh=n(9296);const Jh=function(e){var t;const{is_cf_pro:n,global_checkout:r,flow_id:o,control_id:a,step_id:l,title:c,type:u,actions:d,menu_actions:f,ab_test_ui:p,offer_no_next_step:m,offer_yes_next_step:h,setShowAbtestUpgradePopup:g=()=>{},step_disabled:w}=e,y=l;let{has_product_assigned:b,is_variation:v}=e;const[{flow_type:x,flow_analytics:N,is_flow_instant_checkout:E}]=Yp(),[_,M]=(0,s.useState)(!1),I=(0,s.useRef)(),k=N?N.all_steps:"",D=v?e.control_id:l,j=k?k.find(e=>e.id===D):[],A=Oh(),T=(0,qh.W6)();"landing"!==u&&"thankyou"!==u||(b=!0);const L=lm(u,E);return(0,i.createElement)("div",{className:`wcf-step-wrap--container w-full py-4 px-4 flex items-center gap-2 ${p?"border-b border-solid border-border-subtle":""} ${w?"invalid-step step-disabled touch-none !bg-background-secondary !text-text-disabled !border-0 rounded-lg":""}`},!p&&(0,i.createElement)("div",{className:"wcf-steps--sortable-toggle flex cursor-move text-text-secondary"},(0,i.createElement)(sh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,i.createElement)(sh,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,i.createElement)(zm,{gap:"lg",direction:{sm:"column",md:"row"},align:{md:"center"},className:Uf()("wcf-step w-full",p?"ml-8":"",_?"step-overlay":"",b||y===r?"":"wcf-step__no-product")},(0,i.createElement)(zm.Item,{className:"wcf-step--content flex items-center gap-4 w-full sm:w-[50%] min-w-0"},(0,i.createElement)("img",{src:function(){let e="";switch(u){case"landing":e=ch;break;case"checkout":e=uh;break;case"optin":e=ph;break;case"thankyou":e=mh;break;case"upsell":e=dh;break;case"downsell":e=fh}return e}(),alt:u,className:"sm:block lg:block hidden rounded-lg sm:w-[72px] sm:h-[72px] w-[62px] h-[62px]"}),(0,i.createElement)("div",{className:"wcf-steps--title-wrap flex flex-col gap-1"},(0,i.createElement)("div",{className:"wcf-step__col-tags sm:flex items-center gap-2 grid grid-cols-2"},(0,i.createElement)(Vm,{as:"span",size:14,weight:400,color:"secondary",className:"capitalize"},"thankyou"===u?(0,C.__)("Thank You","cartflows"):u),("upsell"!==u&&"downsell"!==u||wcfCartflowsTypePlusPro())&&w?(0,i.createElement)(Lf,{label:(0,C.__)("Disabled","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,i.createElement)(Ph,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}):null,function(){let t="";if(p)if(a===l)t=(0,i.createElement)(Lf,{label:(0,C.__)("Control","cartflows"),size:"xs",type:"pill",variant:"blue"});else{const{var_badge_count:n}=e;t=(0,i.createElement)(Lf,{label:(0,C.sprintf)(/* translators: %d is replaced with the count */ /* translators: %d is replaced with the count */
3 -(0,C.__)("Variation-%d","cartflows"),n),size:"xs",type:"pill",variant:"inverse"})}return t}(),!b&&"storeCheckout"!==x&&(0,i.createElement)(Lf,{label:(0,C.__)("No Product Assigned","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,i.createElement)(Ph,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),!b&&"storeCheckout"===x&&"checkout"!==u&&(0,i.createElement)(Lf,{label:(0,C.__)("No Product Assigned","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,i.createElement)(Ph,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),b&&"storeCheckout"===x&&"checkout"===u&&(0,i.createElement)(Lf,{label:(0,C.__)("Store Checkout - Remove selected checkout product","cartflows"),size:"xs",type:"rounded",variant:"red",className:"wcf-global-checkout-error-badge",icon:(0,i.createElement)(Ph,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),function(){let e="";return!wcfCartflowsTypePlusPro()||"upsell"!==u&&"downsell"!==u?wcfCartflowsTypePlusPro()||"upsell"!==u&&"downsell"!==u||(e=(0,i.createElement)(Pp,null)):e=h&&m?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:um(h,35,25),placement:"top"},(0,i.createElement)(Lf,{label:(0,C.__)("Offer Accepted","cartflows"),size:"xs",type:"rounded",variant:"green",icon:(0,i.createElement)(Uh,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:um(m,35,25),placement:"top"},(0,i.createElement)(Lf,{label:(0,C.__)("Offer Rejected","cartflows"),size:"xs",type:"rounded",variant:"yellow",icon:(0,i.createElement)(Fh,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}))):(0,i.createElement)(Lf,{label:(0,C.__)("Invalid Position","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,i.createElement)(Ph,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),e}()),(0,i.createElement)("div",{className:"wcf-step__title"},(0,i.createElement)("a",{className:`\n\t\t\t\t\t\t\t\t\tfont-medium text-base sm:text-lg text-text-primary hover:text-brand-brand-600 no-underline\n\t\t\t\t\t\t\t\t\t${L?"disabled pointer-events-none":""}\n\t\t\t\t\t\t\t\t`,href:null!==(t=d[1]?.link)&&void 0!==t?t:"#","aria-disabled":L,tabIndex:L?-1:0},um(c,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))),(0,i.createElement)(zm.Item,{className:"wcf-step--stats-content w-full sm:w-[30%]"},(0,i.createElement)("div",{className:"wcf-step--stats-content__info flex text-center justify-around items-center gap-4"},(0,i.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,i.createElement)(Vm,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,C.__)("Views","cartflows")),N?(0,i.createElement)(Vm,{as:"div",size:16,weight:600,color:"primary"},function(){let e=0;return N&&j&&(e=v?j["visits-ab"][l].total_visits:j.visits.total_visits),e}()):(0,i.createElement)("div",{className:"flex justify-center mt-1"},(0,i.createElement)(Vh,{className:"w-4 h-4 text-icon-secondary","aria-hidden":"true"}))),(0,i.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,i.createElement)(Vm,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,C.__)("Conversions","cartflows")),N?(0,i.createElement)(Vm,{as:"div",size:16,weight:600,color:"primary"},"thankyou"!==u?function(){let e=0;return N&&j&&(e=v?j["visits-ab"][l].conversions:j.visits.conversions),e}():"-"):(0,i.createElement)("div",{className:"flex justify-center mt-1"},(0,i.createElement)(Vh,{className:"w-4 h-4 text-icon-secondary","aria-hidden":"true"}))),(0,i.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,i.createElement)(Vm,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,C.__)("Revenue","cartflows")),N?(0,i.createElement)(Vm,{as:"div",size:16,weight:600,color:"primary"},"thankyou"!==u&&"landing"!==u?function(){let e=0;return N&&j&&(e=v?j["visits-ab"][l].revenue:j.visits.revenue),0!==e?Zm(e):e}():"-"):(0,i.createElement)("div",{className:"flex justify-center mt-1"},(0,i.createElement)(Vh,{className:"w-4 h-4 text-icon-secondary","aria-hidden":"true"}))))),(0,i.createElement)(zm.Item,{className:"wcf-step--actions-col w-full sm:w-[15%]"},(0,i.createElement)("div",{className:"wcf-step--actions",ref:I},(0,i.createElement)("div",{className:"wcf-step--action-btns"},(0,i.createElement)("div",{className:"wcf-step--action__basic-btns flex items-center sm:justify-evenly justify-between"},d.map(e=>{var t;if("view"!==e.slug&&"edit"!==e.slug)return null;const n=L&&"edit"===e.slug,r=n?cm():(0,C.sprintf)(
1 +(()=>{var e,t,n,r={6709(e,t,n){"use strict";var r={};n.r(r),n.d(r,{Button:()=>WI,CaptionLabel:()=>HI,Chevron:()=>QI,Day:()=>$I,DayButton:()=>XI,Dropdown:()=>JI,DropdownNav:()=>qI,Footer:()=>KI,Month:()=>eM,MonthCaption:()=>tM,MonthGrid:()=>nM,Months:()=>rM,MonthsDropdown:()=>oM,Nav:()=>aM,NextMonthButton:()=>iM,Option:()=>sM,PreviousMonthButton:()=>lM,Root:()=>cM,Select:()=>uM,Week:()=>dM,WeekNumber:()=>mM,WeekNumberHeader:()=>hM,Weekday:()=>fM,Weekdays:()=>pM,Weeks:()=>gM,YearsDropdown:()=>wM});var o={};n.r(o),n.d(o,{formatCaption:()=>bM,formatDay:()=>xM,formatMonthCaption:()=>vM,formatMonthDropdown:()=>NM,formatWeekNumber:()=>MM,formatWeekNumberHeader:()=>EM,formatWeekdayName:()=>IM,formatYearCaption:()=>SM,formatYearDropdown:()=>_M});var a={};n.r(a),n.d(a,{labelCaption:()=>CM,labelDay:()=>jM,labelDayButton:()=>DM,labelGrid:()=>kM,labelGridcell:()=>AM,labelMonthDropdown:()=>TM,labelNav:()=>LM,labelNext:()=>OM,labelPrevious:()=>zM,labelWeekNumber:()=>RM,labelWeekNumberHeader:()=>UM,labelWeekday:()=>PM,labelYearDropdown:()=>BM});const i=window.wp.element,s=(0,i.createContext)();window.cartflows=window.cartflows||{},window.cartflows.settingsContext=s;const l=()=>(0,i.useContext)(s);var c;const u={settingsProcess:!1,unsavedChanges:!1,page_builder:cartflows_admin?.page_builder?cartflows_admin.page_builder:"other",license_status:null!==(c=cartflows_admin?.license_status)&&void 0!==c?c:"",canvasMode:(()=>{try{return"true"===localStorage.getItem("wcf_canvas_mode_enabled")}catch(e){return!1}})()};n(5146);var d=n(6347),f=n(7387),p=n(1609),m=n.t(p,2),h=n.n(p),g=n(4499),w=n(8168),y=n(8587),b=n(1561),v=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,g.createBrowserHistory)(t.props),t}return(0,f.A)(t,e),t.prototype.render=function(){return h().createElement(d.Router,{history:this.history,children:this.props.children})},t}(h().Component);h().Component;var x=function(e,t){return"function"==typeof e?e(t):e},N=function(e,t){return"string"==typeof e?(0,g.createLocation)(e,null,null,t):e},I=function(e){return e},M=h().forwardRef;void 0===M&&(M=I);var E=M(function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,a=(0,y.A)(e,["innerRef","navigate","onClick"]),i=a.target,s=(0,w.A)({},a,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||i&&"_self"!==i||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return s.ref=I!==M&&t||n,h().createElement("a",s)}),_=M(function(e,t){var n=e.component,r=void 0===n?E:n,o=e.replace,a=e.to,i=e.innerRef,s=(0,y.A)(e,["component","replace","to","innerRef"]);return h().createElement(d.__RouterContext.Consumer,null,function(e){e||(0,b.A)(!1);var n=e.history,l=N(x(a,e.location),e.location),c=l?n.createHref(l):"",u=(0,w.A)({},s,{href:c,navigate:function(){var t=x(a,e.location),r=(0,g.createPath)(e.location)===(0,g.createPath)(N(t));(o||r?n.replace:n.push)(t)}});return I!==M?u.ref=t||i:u.innerRef=i,h().createElement(r,u)})}),S=function(e){return e},D=h().forwardRef;void 0===D&&(D=S),D(function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,a=void 0===o?"active":o,i=e.activeStyle,s=e.className,l=e.exact,c=e.isActive,u=e.location,f=e.sensitive,p=e.strict,m=e.style,g=e.to,v=e.innerRef,I=(0,y.A)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return h().createElement(d.__RouterContext.Consumer,null,function(e){e||(0,b.A)(!1);var n=u||e.location,o=N(x(g,n),n),y=o.pathname,M=y&&y.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),E=M?(0,d.matchPath)(n.pathname,{path:M,exact:l,sensitive:f,strict:p}):null,j=!!(c?c(E,n):E),k="function"==typeof s?s(j):s,C="function"==typeof m?m(j):m;j&&(k=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return e}).join(" ")}(k,a),C=(0,w.A)({},C,i));var A=(0,w.A)({"aria-current":j&&r||null,className:k,style:C,to:o},I);return S!==D?A.ref=t||v:A.innerRef=v,h().createElement(_,A)})});const j=window.wp.i18n,k=window.wp.hooks;var C=n(4848);const A=e=>{const t=z(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),T(n,t)||O(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},T=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?T(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const a=e.join("-");return t.validators.find(({validator:e})=>e(a))?.classGroupId},L=/^\[(.+)\]$/,O=e=>{if(L.test(e)){const t=L.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},z=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return B(Object.entries(e.classGroups),n).forEach(([e,n])=>{P(n,r,e,t)}),r},P=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?U(e)?void P(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,o])=>{P(o,R(t,e),n,r)});(""===e?t:R(t,e)).classGroupId=n})},R=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},U=e=>e.isThemeGetter,B=(e,t)=>t?e.map(([e,n])=>{const r=n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e);return[e,r]}):e,F=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},Y=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],a=t.length,i=e=>{const n=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===o&&(r||e.slice(c,c+a)===t)){n.push(e.slice(l,c)),l=c+a;continue}if("/"===u){i=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===n.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:n,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return n?e=>n({className:e,parseClassName:i}):i},Z=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},V=/\s+/;function G(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=W(e))&&(r&&(r+=" "),r+=t);return r}const W=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=W(e[r]))&&(n&&(n+=" "),n+=t);return n};function H(e,...t){let n,r,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:F(e.cacheSize),parseClassName:Y(e),...A(e)}))(l),r=n.cache.get,o=n.cache.set,a=i,i(s)};function i(e){const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(V);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?" "+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?" "+s:s);continue}f=!1}const m=Z(l).join(":"),h=c?m+"!":m,g=h+p;if(a.includes(g))continue;a.push(g);const w=o(p,f);for(let e=0;e<w.length;++e){const t=w[e];a.push(h+t)}s=t+(s.length>0?" "+s:s)}return s})(e,n);return o(e,a),a}return function(){return a(G.apply(null,arguments))}}const Q=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},$=/^\[(?:([a-z-]+):)?(.+)\]$/i,X=/^\d+\/\d+$/,J=new Set(["px","full","screen"]),q=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,K=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,te=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,re=e=>ae(e)||J.has(e)||X.test(e),oe=e=>ye(e,"length",be),ae=e=>Boolean(e)&&!Number.isNaN(Number(e)),ie=e=>ye(e,"number",ae),se=e=>Boolean(e)&&Number.isInteger(Number(e)),le=e=>e.endsWith("%")&&ae(e.slice(0,-1)),ce=e=>$.test(e),ue=e=>q.test(e),de=new Set(["length","size","percentage"]),fe=e=>ye(e,de,ve),pe=e=>ye(e,"position",ve),me=new Set(["image","url"]),he=e=>ye(e,me,Ne),ge=e=>ye(e,"",xe),we=()=>!0,ye=(e,t,n)=>{const r=$.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},be=e=>K.test(e)&&!ee.test(e),ve=()=>!1,xe=e=>te.test(e),Ne=e=>ne.test(e),Ie=(Symbol.toStringTag,()=>{const e=Q("colors"),t=Q("spacing"),n=Q("blur"),r=Q("brightness"),o=Q("borderColor"),a=Q("borderRadius"),i=Q("borderSpacing"),s=Q("borderWidth"),l=Q("contrast"),c=Q("grayscale"),u=Q("hueRotate"),d=Q("invert"),f=Q("gap"),p=Q("gradientColorStops"),m=Q("gradientColorStopPositions"),h=Q("inset"),g=Q("margin"),w=Q("opacity"),y=Q("padding"),b=Q("saturate"),v=Q("scale"),x=Q("sepia"),N=Q("skew"),I=Q("space"),M=Q("translate"),E=()=>["auto",ce,t],_=()=>[ce,t],S=()=>["",re,oe],D=()=>["auto",ae,ce],j=()=>["","0",ce],k=()=>[ae,ce];return{cacheSize:500,separator:":",theme:{colors:[we],spacing:[re,oe],blur:["none","",ue,ce],brightness:k(),borderColor:[e],borderRadius:["none","","full",ue,ce],borderSpacing:_(),borderWidth:S(),contrast:k(),grayscale:j(),hueRotate:k(),invert:j(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[le,oe],inset:E(),margin:E(),opacity:k(),padding:_(),saturate:k(),scale:k(),sepia:j(),skew:k(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",ce]}],container:["container"],columns:[{columns:[ue]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",ce]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",se,ce]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ce]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",se,ce]}],"grid-cols":[{"grid-cols":[we]}],"col-start-end":[{col:["auto",{span:["full",se,ce]},ce]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[we]}],"row-start-end":[{row:["auto",{span:[se,ce]},ce]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ce]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ce]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ce,t]}],"min-w":[{"min-w":[ce,t,"min","max","fit"]}],"max-w":[{"max-w":[ce,t,"none","full","min","max","fit","prose",{screen:[ue]},ue]}],h:[{h:[ce,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ce,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ce,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ce,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ue,oe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ie]}],"font-family":[{font:[we]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ce]}],"line-clamp":[{"line-clamp":["none",ae,ie]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",re,ce]}],"list-image":[{"list-image":["none",ce]}],"list-style-type":[{list:["none","disc","decimal",ce]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",re,oe]}],"underline-offset":[{"underline-offset":["auto",re,ce]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",pe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},he]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[re,ce]}],"outline-w":[{outline:[re,oe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:S()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[re,oe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ue,ge]}],"shadow-color":[{shadow:[we]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ue,ce]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ce]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",ce]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",ce]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[se,ce]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ce]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[re,oe,ie]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Me=H(Ie);function Ee(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ee(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _e(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ee(e))&&(r&&(r+=" "),r+=t);return r}const Se=(...e)=>Me(_e(...e)),De=(...e)=>(...t)=>e.filter(Boolean).forEach(e=>e?.(...t)),je=e=>{const t={0:"gap-0",xxs:"gap-1",xs:"gap-2",sm:"gap-3",md:"gap-4",lg:"gap-5",xl:"gap-6","2xl":"gap-8"};return t[e]||t.md},ke={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},Ce=()=>{if(typeof window>"u")return"null";const e=window.navigator?.userAgentData?.platform||window.navigator.platform;let t="null";return["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(e)?t="Mac OS":["Win32","Win64","Windows","WinCE"].includes(e)&&(t="Windows"),t},Ae=(e,t)=>{if(!(typeof window>"u"))try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},Te=e=>{if(typeof window>"u")return null;try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return console.error(e),null}},Le=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e))),Oe=({children:e,gap:t="lg",className:n,...r})=>(0,C.jsx)("header",{className:Se("w-full box-border flex items-center justify-between bg-background-primary p-5 min-h-16",je(t),n),...r,children:e});Oe.displayName="Topbar";const ze=({gap:e="sm",children:t,className:n})=>(0,C.jsx)("div",{className:Se("flex items-center",je(e),n),children:t});ze.displayName="Topbar.Left";const Pe=({gap:e="md",children:t,align:n="center",className:r})=>{const o={left:"justify-start",center:"justify-center",right:"justify-end"}[n];return(0,C.jsx)("div",{className:Se("flex items-center grow",je(e),o,r),children:t})};Pe.displayName="Topbar.Middle";const Re=({gap:e="sm",children:t,className:n})=>(0,C.jsx)("div",{className:Se("flex items-center",je(e),n),children:t});Re.displayName="Topbar.Right";const Ue=({children:e,className:t})=>(0,C.jsx)("div",{className:Se("flex items-center [&>svg]:block h-full",t),children:e});function Be(){return"undefined"!=typeof window}function Fe(e){return Ve(e)?(e.nodeName||"").toLowerCase():"#document"}function Ye(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ze(e){var t;return null==(t=(Ve(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ve(e){return!!Be()&&(e instanceof Node||e instanceof Ye(e).Node)}function Ge(e){return!!Be()&&(e instanceof Element||e instanceof Ye(e).Element)}function We(e){return!!Be()&&(e instanceof HTMLElement||e instanceof Ye(e).HTMLElement)}function He(e){return!(!Be()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ye(e).ShadowRoot)}function Qe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ot(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function $e(e){return/^(table|td|th)$/.test(Fe(e))}function Xe(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}Ue.displayName="Topbar.Item",Oe.Left=ze,Oe.Middle=Pe,Oe.Right=Re,Oe.Item=Ue;const Je=/transform|translate|scale|rotate|perspective|filter/,qe=/paint|layout|strict|content/,Ke=e=>!!e&&"none"!==e;let et;function tt(e){const t=Ge(e)?ot(e):e;return Ke(t.transform)||Ke(t.translate)||Ke(t.scale)||Ke(t.rotate)||Ke(t.perspective)||!nt()&&(Ke(t.backdropFilter)||Ke(t.filter))||Je.test(t.willChange||"")||qe.test(t.contain||"")}function nt(){return null==et&&(et="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),et}function rt(e){return/^(html|body|#document)$/.test(Fe(e))}function ot(e){return Ye(e).getComputedStyle(e)}function at(e){return Ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function it(e){if("html"===Fe(e))return e;const t=e.assignedSlot||e.parentNode||He(e)&&e.host||Ze(e);return He(t)?t.host:t}function st(e){const t=it(e);return rt(t)?(e.ownerDocument||e).body:We(t)&&Qe(t)?t:st(t)}function lt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=st(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=Ye(o);if(a){const e=ct(i);return t.concat(i,i.visualViewport||[],Qe(o)?o:[],e&&n?lt(e):[])}return t.concat(o,lt(o,[],n))}function ct(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ut(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function dt(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&He(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ft(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function pt(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function mt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(wt()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function ht(e){return!pt().includes("jsdom/")&&(!wt()&&0===e.width&&0===e.height||wt()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function gt(){return/apple/i.test(navigator.vendor)}function wt(){const e=/android/i;return e.test(ft())||e.test(pt())}function yt(){return ft().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function bt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function vt(e){return(null==e?void 0:e.ownerDocument)||document}function xt(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Nt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function It(e){return We(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Mt(e){e.preventDefault(),e.stopPropagation()}function Et(e){return!!e&&"combobox"===e.getAttribute("role")&&It(e)}const _t=Math.min,St=Math.max,Dt=Math.round,jt=Math.floor,kt=e=>({x:e,y:e}),Ct={left:"right",right:"left",bottom:"top",top:"bottom"};function At(e,t,n){return St(e,_t(t,n))}function Tt(e,t){return"function"==typeof e?e(t):e}function Lt(e){return e.split("-")[0]}function Ot(e){return e.split("-")[1]}function zt(e){return"x"===e?"y":"x"}function Pt(e){return"y"===e?"height":"width"}function Rt(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Ut(e){return zt(Rt(e))}function Bt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ft=["left","right"],Yt=["right","left"],Zt=["top","bottom"],Vt=["bottom","top"];function Gt(e){const t=Lt(e);return Ct[t]+e.slice(t.length)}function Wt(e){return"number"!=typeof e?function(e){var t,n,r,o;return{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}}(e):{top:e,right:e,bottom:e,left:e}}function Ht(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}}var Qt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),$t="undefined"==typeof Element,Xt=$t?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Jt=!$t&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},qt=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):qt(e.parentNode))},Kt=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var a=o.shift();if(!qt(a,!1))if("SLOT"===a.tagName){var i=a.assignedElements(),s=i.length?i:a.children,l=Kt(s,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{Xt.call(a,Qt)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),u=!qt(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&u){var d=Kt(!0===c?a.children:c.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:a,candidates:d})}else o.unshift.apply(o,a.children)}}return r},en=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!en(e)?0:e.tabIndex},nn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},rn=function(e){return"INPUT"===e.tagName},on=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},an=function(e,t){return!(t.disabled||function(e){return rn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=Xt.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Xt.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return on(e)}else{if("function"==typeof r){for(var a=e;e;){var i=e.parentElement,s=Jt(e);if(i&&!i.shadowRoot&&!0===r(i))return on(e);e=e.assignedSlot?e.assignedSlot:i||s===e.ownerDocument?i:s.host}e=a}if(function(e){var t,n,r,o,a=e&&Jt(e),i=null===(t=a)||void 0===t?void 0:t.host,s=!1;if(a&&a!==e)for(s=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&i;){var l,c,u;s=!(null===(c=i=null===(l=a=Jt(i))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(i))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Xt.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},sn=function(e,t){return!(function(e){return function(e){return rn(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Jt(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||tn(t)<0||!an(e,t))},ln=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},cn=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,a=o?e.scopeParent:e,i=function(e,t){var n=tn(e);return n<0&&t&&!en(e)?0:n}(a,o),s=o?cn(e.candidates):a;0===i?o?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:i,item:e,isScope:o,content:s})}),n.sort(nn).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},un=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Kt([e],t.includeContainer,{filter:sn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ln}):function(e,t,n){if(qt(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Qt));return t&&Xt.call(e,Qt)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,sn.bind(null,t)),cn(n)};const dn=window.ReactDOM;function fn(e,t,n){let{reference:r,floating:o}=e;const a=Rt(t),i=Ut(t),s=Pt(i),l=Lt(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}const m=Ot(t);return m&&(p[i]+=f*("end"===m?1:-1)*(n&&c?-1:1)),p}async function pn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Tt(t,e),m=Wt(p),h=s[f?"floating"===d?"reference":"floating":d],g=Ht(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(h)))||n?h:h.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),w="floating"===d?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},v=Ht(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:l}):w);return{top:(g.top-v.top+m.top)/b.y,bottom:(v.bottom-g.bottom+m.bottom)/b.y,left:(g.left-v.left+m.left)/b.x,right:(v.right-g.right+m.right)/b.x}}const mn=new Set(["left","top"]);function hn(e){const t=ot(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=We(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=Dt(n)!==a||Dt(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function gn(e){return Ge(e)?e:e.contextElement}function wn(e){const t=gn(e);if(!We(t))return kt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=hn(t);let i=(a?Dt(n.width):n.width)/r,s=(a?Dt(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const yn=kt(0);function bn(e){const t=Ye(e);return nt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:yn}function vn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=gn(e);let i=kt(1);t&&(r?Ge(r)&&(i=wn(r)):i=wn(e));const s=function(e,t,n){return void 0===t&&(t=!1),!!n&&t&&n===Ye(e)}(a,n,r)?bn(a):kt(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a&&r){const e=Ye(a),t=Ge(r)?Ye(r):r;let n=e,o=ct(n);for(;o&&t!==n;){const e=wn(o),t=o.getBoundingClientRect(),r=ot(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=Ye(o),o=ct(n)}}return Ht({width:u,height:d,x:l,y:c})}function xn(e,t){const n=at(e).scrollLeft;return t?t.left+n:vn(Ze(e)).left+n}function Nn(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xn(e,n),y:n.top+t.scrollTop}}function In(e,t,n){let r;if("viewport"===t||"layoutViewport"===t)r=function(e,t,n){void 0===n&&(n="viewport");const r="layoutViewport"===n,o=Ye(e),a=Ze(e),i=o.visualViewport;let s=a.clientWidth,l=a.clientHeight,c=0,u=0;if(i){const e=!nt()||"fixed"===t;r?e||(c=-i.offsetLeft,u=-i.offsetTop):(s=i.width,l=i.height,e&&(c=i.offsetLeft,u=i.offsetTop))}if(xn(a)<=0){const e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(a.clientWidth-t.clientWidth-r),i="stable both-edges"===getComputedStyle(a).scrollbarGutter?o/2:o;i<=25&&(s-=i)}return{width:s,height:l,x:c,y:u}}(e,n,t);else if("document"===t)r=function(e){const t=at(e),n=e.ownerDocument.body,r=St(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=St(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-t.scrollLeft+xn(e);const i=-t.scrollTop;return"rtl"===ot(n).direction&&(a+=St(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:a,y:i}}(Ze(e));else if(Ge(t))r=function(e,t){const n=vn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=wn(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=bn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ht(r)}function Mn(e,t,n){const r=We(t),o=Ze(t),a="fixed"===n,i=vn(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=kt(0);if((r||!a)&&(("body"!==Fe(t)||Qe(o))&&(s=at(t)),r)){const e=vn(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!r&&o&&(l.x=xn(o));const c=!o||r||a?kt(0):Nn(o,s);return{x:i.left+s.scrollLeft-l.x-c.x,y:i.top+s.scrollTop-l.y-c.y,width:i.width,height:i.height}}function En(e){return"static"===ot(e).position}function Sn(e,t){if(!We(e)||"fixed"===ot(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Ze(e)===n&&(n=n.ownerDocument.body),n}function Dn(e,t){const n=Ye(e);if(Xe(e))return n;if(!We(e)){let t=it(e);for(;t&&!rt(t);){if(Ge(t)&&!En(t))return t;t=it(t)}return n}let r=Sn(e,t);for(;r&&$e(r)&&En(r);)r=Sn(r,t);return r&&rt(r)&&En(r)&&!tt(r)?n:r||function(e){let t=it(e);for(;We(t)&&!rt(t);){if(tt(t))return t;if(Xe(t))return null;t=it(t)}return null}(e)||n}const jn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=Ze(r),s=!!t&&Xe(t.floating);if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=kt(1);const u=kt(0),d=We(r);if((d||!a)&&(("body"!==Fe(r)||Qe(i))&&(l=at(r)),d)){const e=vn(r);c=wn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||a?kt(0):Nn(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Ze,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?Xe(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=lt(e,[],!1).filter(e=>Ge(e)&&"body"!==Fe(e)),o=null;const a="fixed"===ot(e).position;let i=a?it(e):e;for(;Ge(i)&&!rt(i);){const e=ot(i),t=tt(i),n=o?o.position:a?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==i),i=it(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=In(t,a[0],o);let s=i.top,l=i.right,c=i.bottom,u=i.left;for(let e=1;e<a.length;e++){const n=In(t,a[e],o);s=St(n.top,s),l=_t(n.right,l),c=_t(n.bottom,c),u=St(n.left,u)}return{width:l-u,height:c-s,x:u,y:s}},getOffsetParent:Dn,getElementRects:async function(e){const t=this.getOffsetParent||Dn,n=this.getDimensions,r=await n(e.floating);return{reference:Mn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){const{width:t,height:n}=hn(e);return{width:t,height:n}},getScale:wn,isElement:Ge,isRTL:function(e){return"rtl"===ot(e).direction}};function kn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=gn(e),u=o||a?[...c?lt(c):[],...t?lt(t):[]]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t,n){let r,o=null;const a=Ze(e);function i(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function s(n,l){void 0===n&&(n=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(n||t(),!f||!p)return;const m={rootMargin:-jt(d)+"px "+-jt(a.clientWidth-(u+f))+"px "+-jt(a.clientHeight-(d+p))+"px "+-jt(u)+"px",threshold:St(0,_t(1,l))||1};let h=!0;function g(t){const n=t[0].intersectionRatio;if(!kn(c,e.getBoundingClientRect()))return s();if(n!==l){if(!h)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}h=!1}try{o=new IntersectionObserver(g,{...m,root:a.ownerDocument})}catch(e){o=new IntersectionObserver(g,m)}o.observe(e)}const l=Ye(e),c=()=>s(n);return l.addEventListener("resize",c),s(!0),()=>{l.removeEventListener("resize",c),i()}}(c,n,a):null;let f,p=-1,m=null;i&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),t&&m.observe(t));let h=l?vn(e):null;return l&&function t(){const r=vn(e);h&&!kn(h,r)&&n(),h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const An=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=Tt(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const w=Lt(o),y=Rt(s),b=Lt(s)===s,v=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!h?[Gt(s)]:function(e){const t=Gt(e);return[Bt(e),t,Bt(t)]}(s)),N="none"!==m;!f&&N&&x.push(...function(e,t,n,r){const o=Ot(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Yt:Ft:t?Ft:Yt;case"left":case"right":return t?Zt:Vt;default:return[]}}(Lt(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Bt)))),a}(s,h,m,v));const I=[s,...x],M=await l.detectOverflow(t,g),E=[];let _=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&E.push(M[w]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Ot(e),o=Ut(e),a=Pt(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Gt(i)),[i,Gt(i)]}(o,i,v);E.push(M[e[0]],M[e[1]])}if(_=[..._,{placement:o,overflows:E}],!E.every(e=>e<=0)){var S,D;const e=((null==(S=a.flip)?void 0:S.index)||0)+1,t=I[e];if(t&&("alignment"!==d||y===Rt(t)||_.every(e=>Rt(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(D=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:D.placement;if(!n)switch(p){case"bestFit":{var j;const e=null==(j=_.filter(e=>{if(N){const t=Rt(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:j[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Tn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Tt(e,t)||{};if(null==c)return{};const d=Wt(u),f={x:n,y:r},p=Ut(o),m=Pt(p),h=await i.getDimensions(c),g="y"===p,w=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",v=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],N=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let I=N?N[b]:0;I&&await(null==i.isElement?void 0:i.isElement(N))||(I=s.floating[b]||a.floating[m]);const M=v/2-x/2,E=I/2-h[m]/2-1,_=_t(d[w],E),S=_t(d[y],E),D=I-h[m]-S,j=I/2-h[m]/2+M,k=At(_,j,D),C=!l.arrow&&null!=Ot(o)&&j!==k&&a.reference[m]/2-(j<_?_:S)-h[m]/2<0,A=C?j<_?j-_:j-D:0;return{[p]:f[p]+A,data:{[p]:k,centerOffset:j-k-A,...C&&{alignmentOffset:A}},reset:C}}}),Ln=(e,t,n)=>{const r=new Map,o=null!=n?n:{},a={...jn,...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=i.detectOverflow?i:{...i,detectOverflow:pn},l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=fn(c,r,l),f=r,p=0;const m={};for(let n=0;n<a.length;n++){const h=a[n];if(!h)continue;const{name:g,fn:w}=h,{x:y,y:b,data:v,reset:x}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=b?b:d,m[g]={...m[g],...v},x&&p<50&&(p++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(c=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=fn(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}})(e,t,{...o,platform:a})};var On="undefined"!=typeof document?p.useLayoutEffect:function(){};function zn(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(!zn(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||zn(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Pn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rn(e,t){const n=Pn(e);return Math.round(t*n)/n}function Un(e){const t=p.useRef(e);return On(()=>{t.current=e}),t}const Bn=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=Lt(n),s=Ot(n),l="y"===Rt(n),c=mn.has(i)?-1:1,u=a&&l?-1:1,d=Tt(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fn=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:a}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Tt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,c),f=Rt(o),p=zt(f);let m=u[p],h=u[f];const g=(e,t)=>At(t+d["y"===e?"top":"left"],t,t-d["y"===e?"bottom":"right"]);i&&(m=g(p,m)),s&&(h=g(f,h));const w=l.fn({...t,[p]:m,[f]:h});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:i,[f]:s}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{const n=An(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:a}=t,{apply:i=()=>{},...s}=Tt(e,t),l=await o.detectOverflow(t,s),c=Lt(n),u=Ot(n),d="y"===Rt(n),{width:f,height:p}=r.floating;let m,h;"top"===c||"bottom"===c?(m=c,h=u===(await(null==o.isRTL?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(h=c,m="end"===u?"top":"bottom");const g=p-l.top-l.bottom,w=f-l.left-l.right,y=_t(p-l[m],g),b=_t(f-l[h],w),v=t.middlewareData.shift,x=!v;let N=y,I=b;null!=v&&v.enabled.x&&(I=w),null!=v&&v.enabled.y&&(N=g),x&&!u&&(d?I=f-2*St(l.left,l.right):N=p-2*St(l.top,l.bottom)),await i({...t,availableWidth:I,availableHeight:N});const M=await o.getDimensions(a.floating);return f!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vn=(e,t)=>{const n=(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?Tn({element:n.current,padding:r}).fn(t):{}:n?Tn({element:n,padding:r}).fn(t):{}}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gn={...m},Wn=Gn.useInsertionEffect||(e=>e());function Hn(e){const t=p.useRef(()=>{});return Wn(()=>{t.current=e}),p.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}const Qn="ArrowUp",$n="ArrowDown",Xn="ArrowLeft",Jn="ArrowRight";function qn(e,t,n){return Math.floor(e/t)!==n}function Kn(e,t){return t<0||t>=e.current.length}function er(e,t){return nr(e,{disabledIndices:t})}function tr(e,t){return nr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nr(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:a=1}=void 0===t?{}:t;const i=e.current;let s=n;do{s+=r?-a:a}while(s>=0&&s<=i.length-1&&ar(i,s,o));return s}function rr(e,t,n,r,o){if(-1===e)return-1;const a=n.indexOf(e),i=t[e];switch(o){case"tl":return a;case"tr":return i?a+i.width-1:a;case"bl":return i?a+(i.height-1)*r:a;case"br":return n.lastIndexOf(e)}}function or(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function ar(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}var ir="undefined"!=typeof document?p.useLayoutEffect:p.useEffect;function sr(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const lr=p.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function cr(e){const{children:t,elementsRef:n,labelsRef:r}=e,[o,a]=p.useState(()=>new Map),i=p.useCallback(e=>{a(t=>new Map(t).set(e,null))},[]),s=p.useCallback(e=>{a(t=>{const n=new Map(t);return n.delete(e),n})},[]);return ir(()=>{const e=new Map(o);Array.from(e.keys()).sort(sr).forEach((t,n)=>{e.set(t,n)}),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(o,e)||a(e)},[o]),p.createElement(lr.Provider,{value:p.useMemo(()=>({register:i,unregister:s,map:o,elementsRef:n,labelsRef:r}),[i,s,o,n,r])},t)}function ur(){return ur=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},ur.apply(this,arguments)}let dr=!1,fr=0;const pr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fr++,mr=Gn.useId||function(){const[e,t]=p.useState(()=>dr?pr():void 0);return ir(()=>{null==e&&t(pr())},[]),p.useEffect(()=>{dr=!0},[]),e},hr=p.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:a}},width:i=14,height:s=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:u,stroke:d,d:f,style:{transform:m,...h}={},...g}=e,w=mr(),[y,b]=p.useState(!1);if(ir(()=>{r&&"rtl"===ot(r).direction&&b(!0)},[r]),!r)return null;const[v,x]=n.split("-"),N="top"===v||"bottom"===v;let I=u;(N&&null!=a&&a.x||!N&&null!=a&&a.y)&&(I=null);const M=2*c,E=M/2,_=i/2*(l/-8+1),S=s/2*l/4,D=!!f,j=I&&"end"===x?"bottom":"top";let k=I&&"end"===x?"right":"left";I&&y&&(k="end"===x?"left":"right");const C=null!=(null==o?void 0:o.x)?I||o.x:"",A=null!=(null==o?void 0:o.y)?I||o.y:"",T=f||"M0,0 H"+i+" L"+(i-_)+","+(s-S)+" Q"+i/2+","+s+" "+_+","+(s-S)+" Z",L={top:D?"rotate(180deg)":"",left:D?"rotate(90deg)":"rotate(-90deg)",bottom:D?"":"rotate(180deg)",right:D?"rotate(-90deg)":"rotate(90deg)"}[v];return p.createElement("svg",ur({},g,{"aria-hidden":!0,ref:t,width:D?i:i+M,height:i,viewBox:"0 0 "+i+" "+(s>i?s:i),style:{position:"absolute",pointerEvents:"none",[k]:C,[j]:A,[v]:N||D?"100%":"calc(100% - "+M/2+"px)",transform:[L,m].filter(e=>!!e).join(" "),...h}}),M>0&&p.createElement("path",{clipPath:"url(#"+w+")",fill:"none",stroke:d,strokeWidth:M+(f?0:1),d:T}),p.createElement("path",{stroke:M&&!f?g.fill:"none",d:T}),p.createElement("clipPath",{id:w},p.createElement("rect",{x:-E,y:E*(D?-1:1),width:i+M,height:i})))});const gr=p.createContext(null),wr=p.createContext(null),yr=()=>{var e;return(null==(e=p.useContext(gr))?void 0:e.id)||null},br=()=>p.useContext(wr);function vr(e){return"data-floating-ui-"+e}function xr(e){const t=(0,p.useRef)(e);return ir(()=>{t.current=e}),t}const Nr=vr("safe-polygon");function Ir(e,t,n){return n&&!bt(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Mr=0;function Er(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Mr);const a=()=>null==e?void 0:e.focus({preventScroll:n});o?a():Mr=requestAnimationFrame(a)}function _r(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(r);return n}let Sr=new WeakMap,Dr=new WeakSet,jr={},kr=0;const Cr=e=>e&&(e.host||Cr(e.parentNode));function Ar(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=vt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",a=r?"inert":n?"aria-hidden":null,i=(s=t,e.map(e=>{if(s.contains(e))return e;const t=Cr(e);return s.contains(t)?t:null}).filter(e=>null!=e));var s;const l=new Set,c=new Set(i),u=[];jr[o]||(jr[o]=new WeakMap);const d=jr[o];return i.forEach(function e(t){t&&!l.has(t)&&(l.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!c.has(t)&&[].forEach.call(t.children,t=>{if("script"!==Fe(t))if(l.has(t))e(t);else{const e=a?t.getAttribute(a):null,n=null!==e&&"false"!==e,r=(Sr.get(t)||0)+1,i=(d.get(t)||0)+1;Sr.set(t,r),d.set(t,i),u.push(t),1===r&&n&&Dr.add(t),1===i&&t.setAttribute(o,""),!n&&a&&t.setAttribute(a,"true")}})}(t),l.clear(),kr++,()=>{u.forEach(e=>{const t=(Sr.get(e)||0)-1,n=(d.get(e)||0)-1;Sr.set(e,t),d.set(e,n),t||(!Dr.has(e)&&a&&e.removeAttribute(a),Dr.delete(e)),n||e.removeAttribute(o)}),kr--,kr||(Sr=new WeakMap,Sr=new WeakMap,Dr=new WeakSet,jr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Tr=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Lr(e,t){const n=un(e,Tr());"prev"===t&&n.reverse();const r=n.indexOf(ut(vt(e)));return n.slice(r+1)[0]}function Or(){return Lr(document.body,"next")}function zr(){return Lr(document.body,"prev")}function Pr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!dt(n,r)}function Rr(e){un(e,Tr()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Ur(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const Br={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Fr(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const Yr=p.forwardRef(function(e,t){const[n,r]=p.useState();ir(()=>(gt()&&r("button"),document.addEventListener("keydown",Fr),()=>{document.removeEventListener("keydown",Fr)}),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[vr("focus-guard")]:"",style:Br};return p.createElement("span",ur({},e,o))}),Zr=p.createContext(null),Vr=vr("portal");function Gr(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,a=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=mr(),o=Wr(),[a,i]=p.useState(null),s=p.useRef(null);return ir(()=>()=>{null==a||a.remove(),queueMicrotask(()=>{s.current=null})},[a]),ir(()=>{if(!r)return;if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(Vr,""),e.appendChild(n),s.current=n,i(n)},[t,r]),ir(()=>{if(null===n)return;if(!r)return;if(s.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!Ge(e)&&(e=e.current),e=e||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,e.appendChild(a));const l=document.createElement("div");l.id=r,l.setAttribute(Vr,""),e=a||e,e.appendChild(l),s.current=l,i(l)},[t,n,r,o]),a}({id:n,root:r}),[i,s]=p.useState(null),l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),d=p.useRef(null),f=null==i?void 0:i.modal,m=null==i?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!(!r&&!a);return p.useEffect(()=>{if(a&&o&&!f)return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){a&&Pr(e)&&("focusin"===e.type?Ur:Rr)(a)}},[a,o,f]),p.useEffect(()=>{a&&(m||Ur(a))},[m,a]),p.createElement(Zr.Provider,{value:p.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[o,a])},h&&a&&p.createElement(Yr,{"data-type":"outside",ref:l,onFocus:e=>{if(Pr(e,a)){var t;null==(t=u.current)||t.focus()}else{const e=zr()||(null==i?void 0:i.refs.domReference.current);null==e||e.focus()}}}),h&&a&&p.createElement("span",{"aria-owns":a.id,style:Br}),a&&dn.createPortal(t,a),h&&a&&p.createElement(Yr,{"data-type":"outside",ref:c,onFocus:e=>{if(Pr(e,a)){var t;null==(t=d.current)||t.focus()}else{const t=Or()||(null==i?void 0:i.refs.domReference.current);null==t||t.focus(),(null==i?void 0:i.closeOnFocusOut)&&(null==i||i.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Wr=()=>p.useContext(Zr),Hr="data-floating-ui-focusable";function Qr(e){return e?e.hasAttribute(Hr)?e:e.querySelector("["+Hr+"]")||e:null}let $r=[];function Xr(e){$r=$r.filter(e=>e.isConnected);let t=e;if(t&&"body"!==Fe(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Xt.call(e,Qt)&&sn(t,e)}(t,Tr())){const e=un(t,Tr())[0];e&&(t=e)}$r.push(t),$r.length>20&&($r=$r.slice(-20))}}function Jr(){return $r.slice().reverse().find(e=>e.isConnected)}const qr=p.forwardRef(function(e,t){return p.createElement("button",ur({},e,{type:"button",ref:t,tabIndex:-1,style:Br}))});function Kr(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:a=!0,initialFocus:i=0,returnFocus:s=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:m,nodeId:h,onOpenChange:g,events:w,dataRef:y,floatingId:b,elements:{domReference:v,floating:x}}=t,N="number"==typeof i&&i<0,I=Et(v)&&N,M="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||a,E=xr(o),_=xr(i),S=xr(s),D=br(),j=Wr(),k=p.useRef(null),C=p.useRef(null),A=p.useRef(!1),T=p.useRef(!1),L=p.useRef(-1),O=null!=j,z=Qr(x),P=Hn(function(e){return void 0===e&&(e=z),e?un(e,Tr()):[]}),R=Hn(e=>{const t=P(e);return E.current.map(e=>v&&"reference"===e?v:z&&"floating"===e?z:t).filter(Boolean).flat()});function U(e){return!r&&u&&c?p.createElement(qr,{ref:"start"===e?k:C,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}p.useEffect(()=>{if(r)return;if(!c)return;function e(e){if("Tab"===e.key){dt(z,ut(vt(z)))&&0===P().length&&!I&&Mt(e);const t=R(),n=Nt(e);"reference"===E.current[0]&&n===v&&(Mt(e),e.shiftKey?Er(t[t.length-1]):Er(t[1])),"floating"===E.current[1]&&n===z&&e.shiftKey&&(Mt(e),Er(t[0]))}}const t=vt(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,v,z,c,E,I,P,R]),p.useEffect(()=>{if(!r&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=Nt(e),n=P().indexOf(t);-1!==n&&(L.current=n)}},[r,x,P]),p.useEffect(()=>{if(!r&&d)return x&&We(v)?(v.addEventListener("focusout",t),v.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{v.removeEventListener("focusout",t),v.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){T.current=!0,setTimeout(()=>{T.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(dt(v,t)||dt(x,t)||dt(t,x)||dt(null==j?void 0:j.portalNode,t)||null!=t&&t.hasAttribute(vr("focus-guard"))||D&&(_r(D.nodesRef.current,h).find(e=>{var n,r;return dt(null==(n=e.context)?void 0:n.elements.floating,t)||dt(null==(r=e.context)?void 0:r.elements.domReference,t)})||function(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(D.nodesRef.current,h).find(e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(l&&n&&ut(vt(z))===vt(z).body){We(z)&&z.focus();const e=L.current,t=P(),n=t[e]||t[t.length-1]||z;We(n)&&n.focus()}!I&&c||!t||!n||T.current||t===Jr()||(A.current=!0,g(!1,e,"focus-out"))})}},[r,v,x,z,c,h,D,j,g,d,l,P,I]),p.useEffect(()=>{var e;if(r)return;const t=Array.from((null==j||null==(e=j.portalNode)?void 0:e.querySelectorAll("["+vr("portal")+"]"))||[]);if(x){const e=[x,...t,k.current,C.current,E.current.includes("reference")||I?v:null].filter(e=>null!=e),n=c||I?Ar(e,M,!M):Ar(e);return()=>{n()}}},[r,v,x,c,E,j,I,M]),ir(()=>{if(r||!We(z))return;const e=ut(vt(z));queueMicrotask(()=>{const t=R(z),n=_.current,r=("number"==typeof n?t[n]:n.current)||z,o=dt(z,e);N||o||!f||Er(r,{preventScroll:r===z})})},[r,f,z,N,R,_]),ir(()=>{if(r||!z)return;let e=!1;const t=vt(z),n=ut(t);let o=y.current.openEvent;function a(t){let{open:n,reason:r,event:a,nested:i}=t;n&&(o=a),"escape-key"===r&&m.domReference.current&&Xr(m.domReference.current),"hover"===r&&"mouseleave"===a.type&&(A.current=!0),"outside-press"===r&&(i?(A.current=!1,e=!0):A.current=!(mt(a)||ht(a)))}Xr(n),w.on("openchange",a);const i=t.createElement("span");return i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,Br),O&&v&&v.insertAdjacentElement("afterend",i),()=>{w.off("openchange",a);const n=ut(t),r=dt(x,n)||D&&_r(D.nodesRef.current,h).some(e=>{var t;return dt(null==(t=e.context)?void 0:t.elements.floating,n)});(r||o&&["click","mousedown"].includes(o.type))&&m.domReference.current&&Xr(m.domReference.current);const s="boolean"==typeof S.current?Jr()||i:S.current.current||i;queueMicrotask(()=>{S.current&&!A.current&&We(s)&&(s===n||n===t.body||r)&&s.focus({preventScroll:e}),i.remove()})}},[r,x,z,S,y,m,w,D,h,O,v]),p.useEffect(()=>{queueMicrotask(()=>{A.current=!1})},[r]),ir(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:g,refs:m}),()=>{j.setFocusManagerState(null)}},[r,j,c,f,g,m,d]),ir(()=>{if(r)return;if(!z)return;if("function"!=typeof MutationObserver)return;if(N)return;const e=()=>{const e=z.getAttribute("tabindex"),t=P(),n=ut(vt(x)),r=t.indexOf(n);-1!==r&&(L.current=r),E.current.includes("floating")||n!==m.domReference.current&&0===t.length?"0"!==e&&z.setAttribute("tabindex","0"):"-1"!==e&&z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,x,z,m,E,P,N]);const B=!r&&M&&(!c||!I)&&(O||c);return p.createElement(p.Fragment,null,B&&p.createElement(Yr,{"data-type":"inside",ref:null==j?void 0:j.beforeInsideRef,onFocus:e=>{if(c){const e=R();Er("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=j&&j.preserveTabOrder&&j.portalNode)if(A.current=!1,Pr(e,j.portalNode)){const e=Or()||v;null==e||e.focus()}else{var t;null==(t=j.beforeOutsideRef.current)||t.focus()}}}),!I&&U("start"),n,U("end"),B&&p.createElement(Yr,{"data-type":"inside",ref:null==j?void 0:j.afterInsideRef,onFocus:e=>{if(c)Er(R()[0]);else if(null!=j&&j.preserveTabOrder&&j.portalNode)if(d&&(A.current=!0),Pr(e,j.portalNode)){const e=zr()||v;null==e||e.focus()}else{var t;null==(t=j.afterOutsideRef.current)||t.focus()}}}))}let eo=0,to=()=>{};const no=p.forwardRef(function(e,t){const{lockScroll:n=!1,...r}=e;return ir(()=>{if(n)return eo++,1===eo&&(to=function(){const e=/iP(hone|ad|od)|iOS/.test(ft()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,a=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var i,s;const e=(null==(i=window.visualViewport)?void 0:i.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,a))}}()),()=>{eo--,0===eo&&to()}},[n]),p.createElement("div",ur({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function ro(e){return We(e.target)&&"BUTTON"===e.target.tagName}function oo(e){return It(e)}function ao(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:a}}=e,{enabled:i=!0,event:s="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,f=p.useRef(),m=p.useRef(!1),h=p.useMemo(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==s&&(bt(t,!0)&&c||(!n||!l||o.current.openEvent&&d&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===s&&f.current?f.current=void 0:bt(t,!0)&&c||(!n||!l||o.current.openEvent&&d&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!u||ro(e)||(" "!==e.key||oo(a)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&r(!n||!l,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!u||ro(e)||oo(a)||" "===e.key&&m.current&&(m.current=!1,r(!n||!l,e.nativeEvent,"click"))}}),[o,a,s,c,u,r,n,d,l]);return p.useMemo(()=>i?{reference:h}:{},[i,h])}const io={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},so={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},lo=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function co(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:a}=e,{enabled:i=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:m,capture:h}=t,g=br(),w=Hn("function"==typeof l?l:()=>!1),y="function"==typeof l?w:l,b=p.useRef(!1),v=p.useRef(!1),{escapeKey:x,outsidePress:N}=lo(m),{escapeKey:I,outsidePress:M}=lo(h),E=p.useRef(!1),_=Hn(e=>{var t;if(!n||!i||!s||"Escape"!==e.key)return;if(E.current)return;const o=null==(t=a.current.floatingContext)?void 0:t.nodeId,l=g?_r(g.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),S=Hn(e=>{var t;const n=()=>{var t;_(e),null==(t=Nt(e))||t.removeEventListener("keydown",n)};null==(t=Nt(e))||t.addEventListener("keydown",n)}),D=Hn(e=>{var t;const n=b.current;b.current=!1;const i=v.current;if(v.current=!1,"click"===c&&i)return;if(n)return;if("function"==typeof y&&!y(e))return;const s=Nt(e),l="["+vr("inert")+"]",u=vt(o.floating).querySelectorAll(l);let d=Ge(s)?s:null;for(;d&&!rt(d);){const e=it(d);if(rt(e)||!Ge(e))break;d=e}if(u.length&&Ge(s)&&!s.matches("html,body")&&!dt(s,o.floating)&&Array.from(u).every(e=>!dt(d,e)))return;if(We(s)&&C){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let r=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===ot(s).direction&&(r=e.offsetX<=s.offsetWidth-s.clientWidth),r||t&&e.offsetY>s.clientHeight)return}const f=null==(t=a.current.floatingContext)?void 0:t.nodeId,p=g&&_r(g.nodesRef.current,f).some(t=>{var n;return xt(e,null==(n=t.context)?void 0:n.elements.floating)});if(xt(e,o.floating)||xt(e,o.domReference)||p)return;const m=g?_r(g.nodesRef.current,f):[];if(m.length>0){let e=!0;if(m.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),j=Hn(e=>{var t;const n=()=>{var t;D(e),null==(t=Nt(e))||t.removeEventListener(c,n)};null==(t=Nt(e))||t.addEventListener(c,n)});p.useEffect(()=>{if(!n||!i)return;a.current.__escapeKeyBubbles=x,a.current.__outsidePressBubbles=N;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),E.current=!0}function u(){e=window.setTimeout(()=>{E.current=!1},nt()?5:0)}const d=vt(o.floating);s&&(d.addEventListener("keydown",I?S:_,I),d.addEventListener("compositionstart",l),d.addEventListener("compositionend",u)),y&&d.addEventListener(c,M?j:D,M);let p=[];return f&&(Ge(o.domReference)&&(p=lt(o.domReference)),Ge(o.floating)&&(p=p.concat(lt(o.floating))),!Ge(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(lt(o.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{s&&(d.removeEventListener("keydown",I?S:_,I),d.removeEventListener("compositionstart",l),d.removeEventListener("compositionend",u)),y&&d.removeEventListener(c,M?j:D,M),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[a,o,s,y,c,n,r,f,i,x,N,_,I,S,D,M,j]),p.useEffect(()=>{b.current=!1},[y,c]);const k=p.useMemo(()=>({onKeyDown:_,[io[d]]:e=>{u&&r(!1,e.nativeEvent,"reference-press")}}),[_,r,u,d]),C=p.useMemo(()=>({onKeyDown:_,onMouseDown(){v.current=!0},onMouseUp(){v.current=!0},[so[c]]:()=>{b.current=!0}}),[_,c]);return p.useMemo(()=>i?{reference:k,floating:C}:{},[i,k,C])}function uo(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=mr(),a=p.useRef({}),[i]=p.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),s=null!=yr(),[l,c]=p.useState(r.reference),u=Hn((e,t,r)=>{a.current.openEvent=e?t:void 0,i.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)}),d=p.useMemo(()=>({setPositionReference:c}),[]),f=p.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return p.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:i,floatingId:o,refs:d}),[t,u,f,i,o,d])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[a,i]=p.useState(null),[s,l]=p.useState(null),c=(null==o?void 0:o.domReference)||a,u=p.useRef(null),d=br();ir(()=>{c&&(u.current=c)},[c]);const f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=p.useState(r);zn(f,r)||m(r);const[h,g]=p.useState(null),[w,y]=p.useState(null),b=p.useCallback(e=>{e!==I.current&&(I.current=e,g(e))},[]),v=p.useCallback(e=>{e!==M.current&&(M.current=e,y(e))},[]),x=a||h,N=i||w,I=p.useRef(null),M=p.useRef(null),E=p.useRef(u),_=null!=l,S=Un(l),D=Un(o),j=Un(c),k=p.useCallback(()=>{if(!I.current||!M.current)return;const e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ln(I.current,M.current,e).then(e=>{const t={...e,isPositioned:!1!==j.current};C.current&&!zn(E.current,t)&&(E.current=t,dn.flushSync(()=>{d(t)}))})},[f,t,n,D,j]);On(()=>{!1===c&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const C=p.useRef(!1);On(()=>(C.current=!0,()=>{C.current=!1}),[]),On(()=>{if(x&&(I.current=x),N&&(M.current=N),x&&N){if(S.current)return S.current(x,N,k);k()}},[x,N,k,S,_]);const A=p.useMemo(()=>({reference:I,floating:M,setReference:b,setFloating:v}),[b,v]),T=p.useMemo(()=>({reference:x,floating:N}),[x,N]),L=p.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Rn(T.floating,u.x),r=Rn(T.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Pn(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,T.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:k,refs:A,elements:T,floatingStyles:L}),[u,k,A,T,L])}({...e,elements:{...o,...s&&{reference:s}}}),m=p.useCallback(e=>{const t=Ge(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),f.refs.setReference(t)},[f.refs]),h=p.useCallback(e=>{(Ge(e)||null===e)&&(u.current=e,i(e)),(Ge(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!Ge(e))&&f.refs.setReference(e)},[f.refs]),g=p.useMemo(()=>({...f.refs,setReference:h,setPositionReference:m,domReference:u}),[f.refs,h,m]),w=p.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),y=p.useMemo(()=>({...f,...r,refs:g,elements:w,nodeId:t}),[f,g,w,t,r]);return ir(()=>{r.dataRef.current.floatingContext=y;const e=null==d?void 0:d.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),p.useMemo(()=>({...f,context:y,refs:g,elements:w}),[f,g,w,y])}const fo="active",po="selected";function mo(e,t,n){const r=new Map,o="item"===n;let a=e;if(o&&e){const{[fo]:t,[po]:__,...n}=e;a=n}return{..."floating"===n&&{tabIndex:-1,[Hr]:""},...a,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,a]=t;var i;o&&[fo,po].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof a&&(null==(i=r.get(n))||i.push(a),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=a)}),e):e,{})}}function ho(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=p.useCallback(t=>mo(t,e,"reference"),t),a=p.useCallback(t=>mo(t,e,"floating"),n),i=p.useCallback(t=>mo(t,e,"item"),r);return p.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:i}),[o,a,i])}let go=!1;function wo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function yo(e,t){return wo(t,e===Qn||e===$n,e===Xn||e===Jn)}function bo(e,t,n){return wo(t,e===$n,n?e===Xn:e===Jn)||"Enter"===e||" "===e||""===e}function vo(e,t,n){return wo(t,n?e===Jn:e===Xn,e===Qn)}function xo(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:a,activeIndex:i,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:f=!1,rtl:m=!1,virtual:h=!1,focusItemOnOpen:g="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:v="vertical",cols:x=1,scrollItemIntoView:N=!0,virtualItemRef:I,itemSizes:M,dense:E=!1}=t,_=xr(Qr(o.floating)),S=yr(),D=br(),j=Hn(s),k=Et(o.domReference),C=p.useRef(g),A=p.useRef(null!=c?c:-1),T=p.useRef(null),L=p.useRef(!0),O=p.useRef(j),z=p.useRef(!!o.floating),P=p.useRef(n),R=p.useRef(!1),U=p.useRef(!1),B=xr(b),F=xr(n),Y=xr(N),Z=xr(c),[V,G]=p.useState(),[W,H]=p.useState(),Q=Hn(function(e,t,n){function r(e){h?(G(e.id),null==D||D.events.emit("virtualfocus",e),I&&(I.current=e)):Er(e,{preventScroll:!0,sync:!(!yt()||!gt())&&(go||R.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame(()=>{const a=e.current[t.current]||o;if(!a)return;o||r(a);const i=Y.current;i&&X&&(n||!L.current)&&(null==a.scrollIntoView||a.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))})});ir(()=>{document.createElement("div").focus({get preventScroll(){return go=!0,!1}})},[]),ir(()=>{l&&(n&&o.floating?C.current&&null!=c&&(U.current=!0,A.current=c,j(c)):z.current&&(A.current=-1,O.current(null)))},[l,n,o.floating,c,j]),ir(()=>{if(l&&n&&o.floating)if(null==i){if(R.current=!1,null!=Z.current)return;if(z.current&&(A.current=-1,Q(a,A)),(!P.current||!z.current)&&C.current&&(null!=T.current||!0===C.current&&null==T.current)){let e=0;const t=()=>{null==a.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(A.current=null==T.current||bo(T.current,v,m)||f?er(a,B.current):tr(a,B.current),T.current=null,j(A.current))};t()}}else Kn(a,i)||(A.current=i,Q(a,A,U.current),U.current=!1)},[l,n,o.floating,i,Z,f,a,v,m,j,Q,B]),ir(()=>{var e;if(!l||o.floating||!D||h||!z.current)return;const t=D.nodesRef.current,n=null==(e=t.find(e=>e.id===S))||null==(e=e.context)?void 0:e.elements.floating,r=ut(vt(o.floating)),a=t.some(e=>e.context&&dt(e.context.elements.floating,r));n&&!a&&L.current&&n.focus({preventScroll:!0})},[l,o.floating,D,S,h]),ir(()=>{if(l&&D&&h&&!S)return D.events.on("virtualfocus",e),()=>{D.events.off("virtualfocus",e)};function e(e){H(e.id),I&&(I.current=e)}},[l,D,h,S,I]),ir(()=>{O.current=j,z.current=!!o.floating}),ir(()=>{n||(T.current=null)},[n]),ir(()=>{P.current=n},[n]);const $=null!=i,X=p.useMemo(()=>{function e(e){if(!n)return;const t=a.current.indexOf(e);-1!==t&&j(t)}const t={onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...w&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;L.current&&"touch"!==t&&(A.current=-1,Q(a,A),j(null),h||Er(_.current,{preventScroll:!0}))}}};return t},[n,_,Q,w,a,j,h]),J=Hn(e=>{if(L.current=!1,R.current=!0,229===e.which)return;if(!F.current&&e.currentTarget===_.current)return;if(f&&vo(e.key,v,m))return Mt(e),r(!1,e.nativeEvent,"list-navigation"),void(We(o.domReference)&&(h?null==D||D.events.emit("virtualfocus",o.domReference):o.domReference.focus()));const t=A.current,i=er(a,b),s=tr(a,b);if(k||("Home"===e.key&&(Mt(e),A.current=i,j(A.current)),"End"===e.key&&(Mt(e),A.current=s,j(A.current))),x>1){const t=M||Array.from({length:a.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let o=0;return e.forEach((e,a)=>{let{width:i,height:s}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<s;r++)e.push(o+n+r*t);o%t+i<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=a}),l=!0):o++}}),[...r]}(t,x,E),r=n.findIndex(e=>null!=e&&!ar(a.current,e,b)),o=n.reduce((e,t,n)=>null==t||ar(a.current,t,b)?e:n,-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,rtl:a,cols:i,disabledIndices:s,minIndex:l,maxIndex:c,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===Qn){if(d&&Mt(n),-1===u)f=c;else if(f=nr(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:s}),o&&(u-i<l||f<0)){const e=u%i,t=c%i,n=c-(t-e);f=t===e?c:t>e?n:n-i}Kn(e,f)&&(f=u)}if(n.key===$n&&(d&&Mt(n),-1===u?f=l:(f=nr(e,{startingIndex:u,amount:i,disabledIndices:s}),o&&u+i>c&&(f=nr(e,{startingIndex:u%i-i,amount:i,disabledIndices:s}))),Kn(e,f)&&(f=u)),"both"===r){const t=jt(u/i);n.key===(a?Xn:Jn)&&(d&&Mt(n),u%i!==i-1?(f=nr(e,{startingIndex:u,disabledIndices:s}),o&&qn(f,i,t)&&(f=nr(e,{startingIndex:u-u%i-1,disabledIndices:s}))):o&&(f=nr(e,{startingIndex:u-u%i-1,disabledIndices:s})),qn(f,i,t)&&(f=u)),n.key===(a?Jn:Xn)&&(d&&Mt(n),u%i!==0?(f=nr(e,{startingIndex:u,decrement:!0,disabledIndices:s}),o&&qn(f,i,t)&&(f=nr(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s}))):o&&(f=nr(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s})),qn(f,i,t)&&(f=u));const r=jt(c/i)===t;Kn(e,f)&&(f=o&&r?n.key===(a?Jn:Xn)?c:nr(e,{startingIndex:u-u%i-1,disabledIndices:s}):u)}return f}({current:n.map(e=>null!=e?a.current[e]:null)},{event:e,orientation:v,loop:d,rtl:m,cols:x,disabledIndices:or([...b||a.current.map((e,t)=>ar(a.current,t)?t:void 0),void 0],n),minIndex:r,maxIndex:o,prevIndex:rr(A.current>s?i:A.current,t,n,x,e.key===$n?"bl":e.key===(m?Xn:Jn)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(A.current=l,j(A.current)),"both"===v)return}if(yo(e.key,v)){if(Mt(e),n&&!h&&ut(e.currentTarget.ownerDocument)===e.currentTarget)return A.current=bo(e.key,v,m)?i:s,void j(A.current);bo(e.key,v,m)?A.current=d?t>=s?u&&t!==a.current.length?-1:i:nr(a,{startingIndex:t,disabledIndices:b}):Math.min(s,nr(a,{startingIndex:t,disabledIndices:b})):A.current=d?t<=i?u&&-1!==t?a.current.length:s:nr(a,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(i,nr(a,{startingIndex:t,decrement:!0,disabledIndices:b})),Kn(a,A.current)?j(null):j(A.current)}}),q=p.useMemo(()=>h&&n&&$&&{"aria-activedescendant":W||V},[h,n,$,W,V]),K=p.useMemo(()=>({"aria-orientation":"both"===v?void 0:v,...!Et(o.domReference)&&q,onKeyDown:J,onPointerMove(){L.current=!0}}),[q,J,o.domReference,v]),ee=p.useMemo(()=>{function e(e){"auto"===g&&mt(e.nativeEvent)&&(C.current=!0)}return{...q,onKeyDown(e){L.current=!1;const t=e.key.startsWith("Arrow"),o=["Home","End"].includes(e.key),i=t||o,s=function(e,t,n){return wo(t,n?e===Xn:e===Jn,e===$n)}(e.key,v,m),l=vo(e.key,v,m),u=yo(e.key,v),d=(f?s:u)||"Enter"===e.key||""===e.key.trim();if(h&&n){const t=null==D?void 0:D.nodesRef.current.find(e=>null==e.parentId),n=D&&t?function(e,t){let n,r=-1;return function t(o,a){a>r&&(n=o,r=a),_r(e,o).forEach(e=>{t(e.id,a+1)})}(t,0),e.find(e=>e.id===n)}(D.nodesRef.current,t.id):null;if(i&&n&&I){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||l){var p,g;const r=(null==(p=n.context)?void 0:p.elements.domReference)===e.currentTarget,o=l&&!r?null==(g=n.context)?void 0:g.elements.domReference:s?a.current.find(e=>(null==e?void 0:e.id)===V):null;o&&(Mt(e),o.dispatchEvent(t),H(void 0))}var w;if((u||o)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Mt(e),void(null==(w=n.context.elements.domReference)||w.dispatchEvent(t))}return J(e)}(n||y||!t)&&(d&&(T.current=f&&u?null:e.key),f?s&&(Mt(e),n?(A.current=er(a,B.current),j(A.current)):r(!0,e.nativeEvent,"list-navigation")):u&&(null!=c&&(A.current=c),Mt(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):J(e),n&&j(A.current)))},onFocus(){n&&!h&&j(null)},onPointerDown:function(e){C.current=g,"auto"===g&&ht(e.nativeEvent)&&(C.current=!0)},onMouseDown:e,onClick:e}},[V,q,J,B,g,a,f,j,r,n,y,v,m,c,D,h,I]);return p.useMemo(()=>l?{reference:ee,floating:K,item:X}:{},[l,ee,K,X])}const No=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Io(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:a=!0,role:i="dialog"}=t,s=null!=(n=No.get(i))?n:i,l=mr(),c=null!=yr(),u=p.useMemo(()=>"tooltip"===s||"label"===i?{["aria-"+("label"===i?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===s?"dialog":s,"aria-controls":r?o:void 0,..."listbox"===s&&{role:"combobox"},..."menu"===s&&{id:l},..."menu"===s&&c&&{role:"menuitem"},..."select"===i&&{"aria-autocomplete":"none"},..."combobox"===i&&{"aria-autocomplete":"list"}},[s,o,c,r,l,i]),d=p.useMemo(()=>{const e={id:o,...s&&{role:s}};return"tooltip"===s||"label"===i?e:{...e,..."menu"===s&&{"aria-labelledby":l}}},[s,o,l,i]),f=p.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(i){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}},[o,i]);return p.useMemo(()=>a?{reference:u,floating:d,item:f}:{},[a,u,d,f])}const Mo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Eo(e,t){return"function"==typeof e?e(t):e}function _o(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:a,duration:i=250}=t,s=e.placement,l=s.split("-")[0],c=p.useMemo(()=>({side:l,placement:s}),[l,s]),u="number"==typeof i,d=(u?i:i.open)||0,f=(u?i:i.close)||0,[m,h]=p.useState(()=>({...Eo(a,c),...Eo(n,c)})),{isMounted:g,status:w}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,a=("number"==typeof o?o:o.close)||0,[i,s]=p.useState("unmounted"),l=function(e,t){const[n,r]=p.useState(e);return e&&!n&&r(!0),p.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,a);return l||"close"!==i||s("unmounted"),ir(()=>{if(r){if(n){s("initial");const e=requestAnimationFrame(()=>{s("open")});return()=>{cancelAnimationFrame(e)}}s("close")}},[n,r]),{isMounted:l,status:i}}(e,{duration:i}),y=xr(n),b=xr(r),v=xr(o),x=xr(a);return ir(()=>{const e=Eo(y.current,c),t=Eo(v.current,c),n=Eo(x.current,c),r=Eo(b.current,c)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===w&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===w&&h({transitionProperty:Object.keys(r).map(Mo).join(","),transitionDuration:d+"ms",...n,...r}),"close"===w){const r=t||e;h({transitionProperty:Object.keys(r).map(Mo).join(","),transitionDuration:f+"ms",...n,...r})}},[f,v,y,b,x,d,w,c]),{isMounted:g,styles:m}}function So(e,t){const[n,r]=e;let o=!1;const a=t.length;for(let e=0,i=a-1;e<a;i=e++){const[a,s]=t[e]||[0,0],[l,c]=t[i]||[0,0];s>=r!=c>=r&&n<=(l-a)*(r-s)/(c-s)+a&&(o=!o)}return o}function Do(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,a=!1,i=null,s=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:p,tree:m}=e;return function(e){function h(){clearTimeout(o),f()}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:w}=e,y=[g,w],b=Nt(e),v="mouseleave"===e.type,x=dt(d.floating,b),N=dt(d.domReference,b),I=d.domReference.getBoundingClientRect(),M=d.floating.getBoundingClientRect(),E=u.split("-")[0],_=n>M.right-M.width/2,S=c>M.bottom-M.height/2,D=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,I),j=M.width>I.width,k=M.height>I.height,C=(j?I:M).left,A=(j?I:M).right,T=(k?I:M).top,L=(k?I:M).bottom;if(x&&(a=!0,!v))return;if(N&&(a=!1),N&&!v)return void(a=!0);if(v&&Ge(e.relatedTarget)&&dt(d.floating,e.relatedTarget))return;if(m&&_r(m.nodesRef.current,p).some(e=>{let{context:t}=e;return null==t?void 0:t.open}))return;if("top"===E&&c>=I.bottom-1||"bottom"===E&&c<=I.top+1||"left"===E&&n>=I.right-1||"right"===E&&n<=I.left+1)return h();let O=[];switch(E){case"top":O=[[C,I.top+1],[C,M.bottom-1],[A,M.bottom-1],[A,I.top+1]];break;case"bottom":O=[[C,M.top+1],[C,I.bottom-1],[A,I.bottom-1],[A,M.top+1]];break;case"left":O=[[M.right-1,L],[M.right-1,T],[I.left+1,T],[I.left+1,L]];break;case"right":O=[[I.right-1,L],[I.right-1,T],[M.left+1,T],[M.left+1,L]]}if(!So([g,w],O)){if(a&&!D)return h();if(!v&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===s||0===r)return i=e,s=t,l=n,null;const o=e-i,a=t-s,c=Math.sqrt(o*o+a*a);return i=e,s=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return h()}So([g,w],function(e){let[n,r]=e;switch(E){case"top":return[[j?n+t/2:_?n+4*t:n-4*t,r+t+1],[j?n-t/2:_?n+4*t:n-4*t,r+t+1],[M.left,_||j?M.bottom-t:M.top],[M.right,_?j?M.bottom-t:M.top:M.bottom-t]];case"bottom":return[[j?n+t/2:_?n+4*t:n-4*t,r-t],[j?n-t/2:_?n+4*t:n-4*t,r-t],[M.left,_||j?M.top+t:M.bottom],[M.right,_?j?M.top+t:M.bottom:M.top+t]];case"left":{const e=[n+t+1,k?r+t/2:S?r+4*t:r-4*t],o=[n+t+1,k?r-t/2:S?r+4*t:r-4*t];return[[S||k?M.right-t:M.left,M.top],[S?k?M.right-t:M.left:M.right-t,M.bottom],e,o]}case"right":return[[n-t,k?r+t/2:S?r+4*t:r-4*t],[n-t,k?r-t/2:S?r+4*t:r-4*t],[S||k?M.left+t:M.right,M.top],[S?k?M.left+t:M.right:M.left+t,M.bottom]]}}([n,c]))?!a&&r&&(o=window.setTimeout(h,40)):h()}}};return c.__options={blockPointerEvents:n},c}const jo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ko=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");var Co={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ao=(0,p.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...s},l)=>(0,p.createElement)("svg",{ref:l,...Co,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:ko("lucide",o),...s},[...i.map(([e,t])=>(0,p.createElement)(e,t)),...Array.isArray(a)?a:[a]])),To=(e,t)=>{const n=(0,p.forwardRef)(({className:n,...r},o)=>(0,p.createElement)(Ao,{ref:o,iconNode:t,className:ko(`lucide-${jo(e)}`,n),...r}));return n.displayName=`${e}`,n},Lo=To("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Oo=To("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),zo=To("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Po=To("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Ro=(0,p.forwardRef)((e,t)=>{const{variant:n="primary",size:r="md",type:o="button",tag:a="button",className:i,children:s,disabled:l=!1,destructive:c=!1,icon:u=null,iconPosition:d="left",loading:f=!1,...m}=e,h=c&&"focus:ring-focus-error",g=f?"opacity-50 disabled:cursor-not-allowed":"",w={primary:"text-text-on-color bg-button-primary hover:bg-button-primary-hover outline-button-primary hover:outline-button-primary-hover shadow-xs disabled:shadow-none focus:shadow-none disabled:bg-button-disabled disabled:outline-button-disabled",secondary:"text-text-on-color bg-button-secondary hover:bg-button-secondary-hover outline-button-secondary hover:outline-button-secondary-hover shadow-xs focus:shadow-none disabled:shadow-none disabled:bg-button-disabled disabled:outline-button-disabled",outline:"text-button-tertiary-color outline-border-subtle bg-button-tertiary shadow-sm focus:shadow-none hover:bg-button-tertiary-hover hover:outline-border-subtle disabled:bg-button-tertiary disabled:outline-border-disabled",ghost:"text-text-primary bg-transparent outline-transparent hover:bg-button-tertiary-hover",link:"outline-none text-link-primary bg-transparent hover:text-link-primary-hover hover:underline p-0 border-0 leading-none"}[n],y=c&&!l?{primary:"bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",secondary:"bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",outline:"text-button-danger outline outline-1 outline-button-danger hover:outline-button-danger bg-button-tertiary hover:bg-field-background-error",ghost:"text-button-danger hover:bg-field-background-error",link:"text-button-danger hover:text-button-danger-secondary"}[n]:"",b={xs:"p-1 rounded [&>svg]:size-4",sm:"p-2 rounded [&>svg]:size-4 gap-0.5",md:"p-2.5 rounded-md text-sm [&>svg]:size-5 gap-1",lg:"p-3 rounded-lg text-base [&>svg]:size-6 gap-1"}[r];let v,x=null,N="";return u&&(N="flex items-center justify-center","left"===d?v=u:x=u),(0,C.jsxs)(a,{ref:t,type:o,className:Se(N,"outline outline-1 border-none cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",b,w,y,h,g,{"cursor-default":l},i),disabled:l,"aria-disabled":l,...f&&{"aria-busy":!0},...m,children:[(0,C.jsx)(p.Fragment,{children:v},"left-icon"),s?(0,C.jsx)("span",{className:"px-1",children:s}):null,(0,C.jsx)(p.Fragment,{children:x},"right-icon")]})});Ro.displayName="Button";const Uo="light",Bo="neutral",Fo=({icon:e,theme:t=Uo,variant:n=Bo})=>{const r="[&>svg]:h-5 [&>svg]:w-5",o=(({theme:e=Uo,variant:t=Bo})=>{let n="light"===e?"text-icon-secondary":"text-icon-inverse";return n={info:"light"===e?"text-support-info":"text-support-info-inverse",success:"light"===e?"text-support-success":"text-support-success-inverse",warning:"light"===e?"text-support-warning":"text-support-warning-inverse",error:"light"===e?"text-support-error":"text-support-error-inverse"}[t]||n,n})({theme:t,variant:n});if(e&&(0,p.isValidElement)(e))return(0,p.cloneElement)(e,{className:Se(r,o,e?.props?.className??"")});const a={neutral:(0,C.jsx)(Lo,{className:Se(r,o)}),info:(0,C.jsx)(Lo,{className:Se(r,o)}),success:(0,C.jsx)(Oo,{className:Se(r,o)}),warning:(0,C.jsx)(zo,{className:Se(r,o)}),error:(0,C.jsx)(Po,{className:Se(r,o)})};return a[n]||a.neutral},Yo=({actionType:e="button",onAction:t=()=>{},actionLabel:n="",theme:r=Uo})=>{const o="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none";let a="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===r&&(a="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),e){case"button":return(0,C.jsx)(Ro,{variant:"outline",size:"xs",onClick:t,className:Se("rounded",o,a,"dark"===r?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white"),children:n});case"link":return(0,C.jsx)(Ro,{variant:"link",size:"xs",onClick:t,className:Se(o,a),children:n});default:return null}},Zo=({theme:e=Uo,title:t="",inline:n=!1})=>t?(0,C.jsx)("span",{className:Se("block",{light:"text-text-primary",dark:"text-text-inverse"}[e],"text-sm leading-5 font-semibold",n?"inline":"block"),children:t}):null,Vo=({theme:e=Uo,content:t="",inline:n=!1})=>t?(0,C.jsx)("span",{className:Se({light:"text-text-primary",dark:"text-text-inverse"}[e],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal [word-break:break-word]",n?"inline":"block"),children:t}):null,Go=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},Wo=({variant:e="dark",placement:t="bottom",title:n="",content:r,arrow:o=!1,open:a,setOpen:i,children:s,className:l,tooltipPortalRoot:c,tooltipPortalId:u,boundary:d="clippingAncestors",strategy:f="fixed",offset:m=8,triggers:h=["hover","focus"],interactive:g=!1})=>{const w=(0,p.useMemo)(()=>"boolean"==typeof a&&"function"==typeof i,[a,i]),[y,b]=(0,p.useState)(!1),v=(0,p.useRef)(null),{refs:x,floatingStyles:N,context:I}=uo({open:w?a:y,onOpenChange:w?i:b,placement:t,strategy:f,middleware:[Bn(m),Yn({boundary:d}),Fn({boundary:d}),Vn({element:v})],whileElementsMounted:Cn}),M=ao(I,{enabled:!w&&h.includes("click")}),E=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:a,elements:i}=e,{enabled:s=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,m=br(),h=yr(),g=xr(c),w=xr(l),y=xr(n),b=p.useRef(),v=p.useRef(-1),x=p.useRef(),N=p.useRef(-1),I=p.useRef(!0),M=p.useRef(!1),E=p.useRef(()=>{}),_=p.useRef(!1),S=p.useCallback(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t},[o]);p.useEffect(()=>{if(s)return a.on("openchange",e),()=>{a.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(v.current),clearTimeout(N.current),I.current=!0,_.current=!1)}},[s,a]),p.useEffect(()=>{if(!s)return;if(!g.current)return;if(!n)return;function e(e){S()&&r(!1,e,"hover")}const t=vt(i.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[i.floating,n,r,s,g,S]);const D=p.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Ir(w.current,"close",b.current);o&&!x.current?(clearTimeout(v.current),v.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(clearTimeout(v.current),r(!1,e,n))},[w,r]),j=Hn(()=>{E.current(),x.current=void 0}),k=Hn(()=>{if(M.current){const e=vt(i.floating).body;e.style.pointerEvents="",e.removeAttribute(Nr),M.current=!1}}),C=Hn(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));p.useEffect(()=>{if(s&&Ge(i.domReference)){var e;const r=i.domReference;return n&&r.addEventListener("mouseleave",l),null==(e=i.floating)||e.addEventListener("mouseleave",l),f&&r.addEventListener("mousemove",t,{once:!0}),r.addEventListener("mouseenter",t),r.addEventListener("mouseleave",a),()=>{var e;n&&r.removeEventListener("mouseleave",l),null==(e=i.floating)||e.removeEventListener("mouseleave",l),f&&r.removeEventListener("mousemove",t),r.removeEventListener("mouseenter",t),r.removeEventListener("mouseleave",a)}}function t(e){if(clearTimeout(v.current),I.current=!1,u&&!bt(b.current)||d>0&&!Ir(w.current,"open"))return;const t=Ir(w.current,"open",b.current);t?v.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function a(e){if(C())return;E.current();const t=vt(i.floating);if(clearTimeout(N.current),_.current=!1,g.current&&o.current.floatingContext){n||clearTimeout(v.current),x.current=g.current({...o.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),j(),C()||D(e,!0,"safe-polygon")}});const r=x.current;return t.addEventListener("mousemove",r),void(E.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!dt(i.floating,e.relatedTarget))&&D(e)}function l(e){C()||o.current.floatingContext&&(null==g.current||g.current({...o.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),j(),C()||D(e)}})(e))}},[i,s,e,u,d,f,D,j,k,r,n,y,m,w,g,o,C]),ir(()=>{var e;if(s&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&S()){M.current=!0;const e=i.floating;if(Ge(i.domReference)&&e){var t;const n=vt(i.floating).body;n.setAttribute(Nr,"");const r=i.domReference,o=null==m||null==(t=m.nodesRef.current.find(e=>e.id===h))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[s,n,h,i,m,g,S]),ir(()=>{n||(b.current=void 0,_.current=!1,j(),k())},[n,j,k]),p.useEffect(()=>()=>{j(),clearTimeout(v.current),clearTimeout(N.current),k()},[s,i.domReference,j,k]);const A=p.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){I.current||y.current||r(!0,t,"hover")}u&&!bt(b.current)||n||0===d||_.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(N.current),"touch"===b.current?o():(_.current=!0,N.current=window.setTimeout(o,d)))}}},[u,r,n,y,d]),T=p.useMemo(()=>({onMouseEnter(){clearTimeout(v.current)},onMouseLeave(e){C()||D(e.nativeEvent,!1)}}),[D,C]);return p.useMemo(()=>s?{reference:A,floating:T}:{},[s,A,T])}(I,{move:!1,enabled:!w&&h.includes("hover"),...g&&{handleClose:Do()}}),_=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:a,elements:i}=e,{enabled:s=!0,visibleOnly:l=!0}=t,c=p.useRef(!1),u=p.useRef(),d=p.useRef(!0);p.useEffect(()=>{if(!s)return;const e=Ye(i.domReference);function t(){!n&&We(i.domReference)&&i.domReference===ut(vt(i.domReference))&&(c.current=!0)}function r(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}},[i.domReference,n,s]),p.useEffect(()=>{if(s)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(c.current=!0)}},[o,s]),p.useEffect(()=>()=>{clearTimeout(u.current)},[]);const f=p.useMemo(()=>({onPointerDown(e){ht(e.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(e){if(c.current)return;const t=Nt(e.nativeEvent);if(l&&Ge(t))try{if(gt()&&yt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!It(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){c.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=Ge(t)&&t.hasAttribute(vr("focus-guard"))&&"outside"===t.getAttribute("data-type");u.current=window.setTimeout(()=>{var e;const s=ut(i.domReference?i.domReference.ownerDocument:document);(t||s!==i.domReference)&&(dt(null==(e=a.current.floatingContext)?void 0:e.refs.floating.current,s)||dt(i.domReference,s)||o||r(!1,n,"focus"))})}}),[a,i.domReference,r,l]);return p.useMemo(()=>s?{reference:f}:{},[s,f])}(I,{enabled:!w&&h.includes("focus")}),S=co(I),D=Io(I,{role:"tooltip"}),{getReferenceProps:j,getFloatingProps:k}=ho([M,E,_,S,D]),{isMounted:A,styles:T}=_o(I,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),L={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"}[e],O="dark"===e?"text-tooltip-background-dark":"text-tooltip-background-light";return(0,C.jsxs)(p.Fragment,{children:[(0,p.isValidElement)(s)&&(0,C.jsx)(p.Fragment,{children:(0,p.cloneElement)(s,{ref:Go(s.ref,x.setReference),className:Se(s.props.className),...j()})},"tooltip-reference"),(0,C.jsx)(Gr,{id:u,root:c,children:A&&(0,C.jsxs)("div",{className:Se("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",L,"max-w-80 w-fit",l),ref:x.setFloating,style:{...N,...T},...k(),children:[(0,C.jsxs)("div",{children:[!!n&&(0,C.jsx)("span",{className:"font-semibold",children:n},"tooltip-title"),!!r&&(0,C.jsx)("div",{className:"font-normal",children:r},"tooltip-content")]}),o&&(0,C.jsx)(hr,{ref:v,context:I,className:Se("fill-current",O)})]})})]})};Wo.displayName="Tooltip";const Ho=To("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Qo=(0,p.forwardRef)(({label:e="",size:t="sm",className:n="",type:r="pill",variant:o="neutral",icon:a=null,disabled:i=!1,onClose:s=()=>{},closable:l=!1,onMouseDown:c=()=>{},disableHover:u=!1},d)=>{const f={neutral:"bg-badge-background-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"};let p="",m="group relative justify-center flex items-center cursor-pointer";const h={xxs:"[&>svg]:size-3",xs:"[&>svg]:size-3",sm:"[&>svg]:size-3",md:"[&>svg]:size-4",lg:"[&>svg]:size-5"};return i?(p=f.disabled,m+=" cursor-not-allowed disabled"):p=f[o],e?(0,C.jsxs)("span",{className:Se("font-medium border-badge-border-gray flex items-center justify-center border border-solid box-border max-w-full transition-colors duration-150 ease-in-out",{xxs:"py-0.5 px-0.5 text-xs h-4",xs:"py-0.5 px-1 text-xs h-5",sm:"py-1 px-1.5 text-xs h-6",md:"py-1 px-1.5 text-sm h-7",lg:"py-1 px-1.5 text-base h-8"}[t],{pill:"rounded-full",rounded:"rounded"}[r],"gap-0.5",p,!u&&{neutral:"hover:bg-badge-hover-gray",red:"hover:bg-badge-hover-red",yellow:"hover:bg-badge-hover-yellow",green:"hover:bg-badge-hover-green",blue:"hover:bg-badge-hover-sky",inverse:"hover:bg-badge-hover-inverse",disabled:"hover:bg-badge-hover-disabled"}[o],n),ref:d,children:[a?(0,C.jsx)("span",{className:Se("justify-center flex items-center",h[t]),children:a}):null,(0,C.jsx)("span",{className:"px-1 truncate inline-block",children:e}),l&&(0,C.jsxs)("button",{type:"button",className:Se(m,h[t],"bg-transparent border-none p-0 m-0"),onMouseDown:c,"aria-label":`Remove ${e}`,disabled:i,...!i&&{onClick:s},children:[(0,C.jsx)(Ho,{"aria-hidden":"true"}),(0,C.jsx)("span",{className:"absolute -inset-1"})]})]}):null});Qo.displayName="Badge";const $o=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xo=(()=>new Set([...$o,"pathRotation"]))(),Jo=(e,t,n)=>n>t?t:n<e?e:n,qo={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Ko={...qo,transform:e=>Jo(0,1,e)},ea={...qo,default:1},ta=e=>Math.round(1e5*e)/1e5,na=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,ra=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oa=(e,t)=>n=>Boolean("string"==typeof n&&ra.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),aa=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,a,i,s]=r.match(na);return{[e]:parseFloat(o),[t]:parseFloat(a),[n]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},ia={...qo,transform:e=>Math.round((e=>Jo(0,255,e))(e))},sa={test:oa("rgb","red"),parse:aa("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ia.transform(e)+", "+ia.transform(t)+", "+ia.transform(n)+", "+ta(Ko.transform(r))+")"},la={test:oa("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:sa.transform},ca=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ua=ca("deg"),da=ca("%"),fa=ca("px"),pa=ca("vh"),ma=ca("vw"),ha=(()=>({...da,parse:e=>da.parse(e)/100,transform:e=>da.transform(100*e)}))(),ga={test:oa("hsl","hue"),parse:aa("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+da.transform(ta(t))+", "+da.transform(ta(n))+", "+ta(Ko.transform(r))+")"},wa={test:e=>sa.test(e)||la.test(e)||ga.test(e),parse:e=>sa.test(e)?sa.parse(e):ga.test(e)?ga.parse(e):la.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?sa.transform(e):ga.transform(e),getAnimatableNone:e=>{const t=wa.parse(e);return t.alpha=0,wa.transform(t)}},ya=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ba="number",va="color",xa=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Na(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(xa,e=>(wa.test(e)?(r.color.push(a),o.push(va),n.push(wa.parse(e))):e.startsWith("var(")?(r.var.push(a),o.push("var"),n.push(e)):(r.number.push(a),o.push(ba),n.push(parseFloat(e))),++a,"${}")).split("${}");return{values:n,split:i,indexes:r,types:o}}function Ia({split:e,types:t}){const n=e.length;return r=>{let o="";for(let a=0;a<n;a++)if(o+=e[a],void 0!==r[a]){const e=t[a];o+=e===ba?ta(r[a]):e===va?wa.transform(r[a]):r[a]}return o}}const Ma={test:function(e){return isNaN(e)&&"string"==typeof e&&(e.match(na)?.length||0)+(e.match(ya)?.length||0)>0},parse:function(e){return Na(e).values},createTransformer:function(e){return Ia(Na(e))},getAnimatableNone:function(e){const t=Na(e);return Ia(t)(t.values.map((e,n)=>((e,t)=>{return"number"==typeof e?t?.trim().endsWith("/")?e:0:"number"==typeof(n=e)?0:wa.test(n)?wa.getAnimatableNone(n):n;var n})(e,t.split[n])))}},Ea=new Set(["brightness","contrast","saturate","opacity"]);function _a(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(na)||[];if(!r)return e;const o=n.replace(r,"");let a=Ea.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+o+")"}const Sa=/\b([a-z-]*)\(.*?\)/gu,Da={...Ma,getAnimatableNone:e=>{const t=e.match(Sa);return t?t.map(_a).join(" "):e}},ja={...Ma,getAnimatableNone:e=>{const t=Ma.parse(e);return Ma.createTransformer(e)(t.map(e=>"number"==typeof e?0:"object"==typeof e?{...e,alpha:1}:e))}},ka={...qo,transform:Math.round},Ca={borderWidth:fa,borderTopWidth:fa,borderRightWidth:fa,borderBottomWidth:fa,borderLeftWidth:fa,borderRadius:fa,borderTopLeftRadius:fa,borderTopRightRadius:fa,borderBottomRightRadius:fa,borderBottomLeftRadius:fa,width:fa,maxWidth:fa,height:fa,maxHeight:fa,top:fa,right:fa,bottom:fa,left:fa,inset:fa,insetBlock:fa,insetBlockStart:fa,insetBlockEnd:fa,insetInline:fa,insetInlineStart:fa,insetInlineEnd:fa,padding:fa,paddingTop:fa,paddingRight:fa,paddingBottom:fa,paddingLeft:fa,paddingBlock:fa,paddingBlockStart:fa,paddingBlockEnd:fa,paddingInline:fa,paddingInlineStart:fa,paddingInlineEnd:fa,margin:fa,marginTop:fa,marginRight:fa,marginBottom:fa,marginLeft:fa,marginBlock:fa,marginBlockStart:fa,marginBlockEnd:fa,marginInline:fa,marginInlineStart:fa,marginInlineEnd:fa,fontSize:fa,backgroundPositionX:fa,backgroundPositionY:fa,rotate:ua,pathRotation:ua,rotateX:ua,rotateY:ua,rotateZ:ua,scale:ea,scaleX:ea,scaleY:ea,scaleZ:ea,skew:ua,skewX:ua,skewY:ua,distance:fa,translateX:fa,translateY:fa,translateZ:fa,x:fa,y:fa,z:fa,perspective:fa,transformPerspective:fa,opacity:Ko,originX:ha,originY:ha,originZ:fa,zIndex:ka,fillOpacity:Ko,strokeOpacity:Ko,numOctaves:ka},Aa={...Ca,color:wa,backgroundColor:wa,outlineColor:wa,fill:wa,stroke:wa,borderColor:wa,borderTopColor:wa,borderRightColor:wa,borderBottomColor:wa,borderLeftColor:wa,filter:Da,WebkitFilter:Da,mask:ja,WebkitMask:ja},Ta=e=>Aa[e],La=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Oa=e=>Boolean(e&&e.getVelocity),za=new Set(["width","height","top","left","right","bottom",...$o]),Pa=e=>t=>t.test(e),Ra=[qo,fa,da,ua,ma,pa,{test:e=>"auto"===e,parse:e=>e}],Ua=e=>Ra.find(Pa(e)),Ba=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Fa=e=>t=>"string"==typeof t&&t.startsWith(e),Ya=Fa("--"),Za=Fa("var(--"),Va=e=>!!Za(e)&&Ga.test(e.split("/*")[0].trim()),Ga=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Wa(e){return"string"==typeof e&&e.split("/*")[0].includes("var(--")}const Ha=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Qa(e,t,n=1){const[r,o]=function(e){const t=Ha.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return Ba(e)?parseFloat(e):e}return Va(o)?Qa(o,t,n+1):o}const $a=e=>180*e/Math.PI,Xa=e=>{const t=$a(Math.atan2(e[1],e[0]));return qa(t)},Ja={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Xa,rotateZ:Xa,skewX:e=>$a(Math.atan(e[1])),skewY:e=>$a(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},qa=e=>((e%=360)<0&&(e+=360),e),Ka=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ei=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ti={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ka,scaleY:ei,scale:e=>(Ka(e)+ei(e))/2,rotateX:e=>qa($a(Math.atan2(e[6],e[5]))),rotateY:e=>qa($a(Math.atan2(-e[2],e[0]))),rotateZ:Xa,rotate:Xa,skewX:e=>$a(Math.atan(e[4])),skewY:e=>$a(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ni(e){return e.includes("scale")?1:0}function ri(e,t){if(!e||"none"===e)return ni(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=ti,o=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Ja,o=t}if(!o)return ni(t);const a=r[t],i=o[1].split(",").map(oi);return"function"==typeof a?a(i):i[a]}function oi(e){return parseFloat(e.trim())}const ai=e=>e===qo||e===fa,ii=new Set(["x","y","z"]),si=$o.filter(e=>!ii.has(e)),li={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const o=e.max-e.min;return"border-box"===r?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const o=e.max-e.min;return"border-box"===r?o:o-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ri(t,"x"),y:(e,{transform:t})=>ri(t,"y")};li.translateX=li.x,li.translateY=li.y;const ci=e=>e,ui={},di=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function fi(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,i=di.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&r?t:n;return o&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(i=e,r)return void(o=!0);r=!0;const a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,o&&(o=!1,l.process(e))}};return l}(a),e),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=i,h=()=>{const a=ui.useManualTiming,i=a?o.timestamp:performance.now();n=!1,a||(o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1)),o.timestamp=i,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:di.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(h)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<di.length;t++)i[di[t]].cancel(e)},state:o,steps:i}}const{schedule:pi,cancel:mi,state:hi,steps:gi}=fi("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:ci,!0),wi=new Set;let yi=!1,bi=!1,vi=!1;function xi(){if(bi){const e=Array.from(wi).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return si.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}bi=!1,yi=!1,wi.forEach(e=>e.complete(vi)),wi.clear()}function Ni(){wi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(bi=!0)})}class Ii{constructor(e,t,n,r,o,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(wi.add(this),yi||(yi=!0,pi.read(Ni),pi.resolveKeyframes(xi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(null===e[0]){const o=r?.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===o&&r.set(e[0])}!function(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),wi.delete(this)}cancel(){"scheduled"===this.state&&(wi.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Mi=e=>/^0[^.\s]+$/u.test(e);function Ei(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||Mi(e)}const _i=new Set([Da,ja]);function Si(e,t){let n=Ta(e);return _i.has(n)||(n=Ma),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Di=new Set(["auto","none","0"]);class ji extends Ii{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if("string"==typeof r&&(r=r.trim(),Va(r))){const o=Qa(r,t.current);void 0!==o&&(e[n]=o),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!za.has(n)||2!==e.length)return;const[r,o]=e,a=Ua(r),i=Ua(o);if(Wa(r)!==Wa(o)&&li[n])this.needsMeasurement=!0;else if(a!==i)if(ai(a)&&ai(i))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else li[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(null===e[t]||Ei(e[t]))&&n.push(t);n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!Di.has(t)&&Na(t).values.length&&(r=e[o]),o++}if(r&&n)for(const o of t)e[o]=Si(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=li[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){const{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);const o=n.length-1,a=n[o];n[o]=li[t](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==a&&void 0===this.finalKeyframe&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const ki=e=>1e3*e,Ci=e=>e/1e3;function Ai(e,t){-1===e.indexOf(t)&&e.push(t)}function Ti(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Li{constructor(){this.subscriptions=[]}add(e){return Ai(this.subscriptions,e),()=>Ti(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Oi(e,t,n){(e=>e.startsWith("--"))(t)?e.style.setProperty(t,n):e.style[t]=n}function zi(e){let t;return()=>(void 0===t&&(t=e()),t)}const Pi={};function Ri(e,t){const n=zi(e);return()=>Pi[t]??n()}const Ui=Ri(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Bi=e=>null!==e;function Fi(e,{repeat:t,repeatType:n="loop"},r,o=1){const a=e.filter(Bi),i=o<0||t&&"loop"!==n&&t%2==1?0:a.length-1;return i&&void 0!==r?r:a[i]}class Yi{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const Zi=e=>Array.isArray(e)&&"number"==typeof e[0],Vi=Ri(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),Gi=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let t=0;t<o;t++)r+=Math.round(1e4*e(t/(o-1)))/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Wi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Hi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wi([0,.65,.55,1]),circOut:Wi([.55,0,1,.45]),backIn:Wi([.31,.01,.66,-.59]),backOut:Wi([.33,1.53,.69,.99])};function Qi(e,t){return e?"function"==typeof e?Vi()?Gi(e,t):"ease-out":Zi(e)?Wi(e):Array.isArray(e)?e.map(e=>Qi(e,t)||Hi.easeOut):Hi[e]:void 0}function $i(e,t,n,{delay:r=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const d=Qi(s,o);Array.isArray(d)&&(u.easing=d);const f={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"};return c&&(f.pseudoElement=c),e.animate(u,f)}function Xi(e){return"function"==typeof e&&"applyToOptions"in e}class Ji extends Yi{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:n,keyframes:r,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:i,onComplete:s}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=e,e.type;const l=function({type:e,...t}){return Xi(e)&&Vi()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}(e);this.animation=$i(t,n,r,l,o),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const e=Fi(r,this.options,i,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Oi(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(e){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;"idle"!==e&&"finished"!==e&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Ci(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ci(e)}get time(){return Ci(Number(this.animation.currentTime)||0)}set time(e){const t=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ki(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Ui()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),ci):r(this)}}const qi=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),{schedule:Ki,cancel:es}=fi(queueMicrotask,!1);let ts;function ns(){ts=void 0}const rs={now:()=>(void 0===ts&&rs.set(hi.isProcessing||ui.useManualTiming?hi.timestamp:performance.now()),ts),set:e=>{ts=e,queueMicrotask(ns)}},os=(e,t)=>t?e*(1e3/t):0,as={current:void 0};class is{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{const t=rs.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=rs.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Li);const n=this.events[e].add(t);return"change"===e?()=>{n(),pi.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return as.current&&as.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=rs.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return os(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ss(e,t){return new is(e,t)}const ls=[...Ra,wa,Ma],cs=new WeakMap;function us(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function ds(e){return"string"==typeof e||Array.isArray(e)}const fs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ps=["initial",...fs];function ms(e){return us(e.animate)||ps.some(t=>ds(e[t]))}function hs(e){return Boolean(ms(e)||e.variants)}const gs={current:null},ws={current:!1},ys="undefined"!=typeof window;function bs(e){const t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function vs(e,t,n,r){if("function"==typeof t){const[o,a]=bs(r);t=t(void 0!==n?n:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=bs(r);t=t(void 0!==n?n:e.custom,o,a)}return t}const xs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ns={};function Is(e){Ns=e}class Ms{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:a,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ii,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=rs.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,pi.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=t.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=s,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=ms(t),this.isVariantNode=hs(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==l[e]&&Oa(t)&&t.set(l[e])}}mount(e){if(this.hasBeenMounted)for(const e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,cs.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ws.current||function(){if(ws.current=!0,ys)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>gs.current=e.matches;e.addEventListener("change",t),t()}else gs.current=!1}(),this.shouldReduceMotion=gs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),mi(this.notifyUpdate),mi(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&qi.has(e)&&this.current instanceof HTMLElement){const{factory:n,keyframes:r,times:o,ease:a,duration:i}=t.accelerate,s=new Ji({element:this.current,name:e,keyframes:r,times:o,ease:a,duration:ki(i)}),l=n(s);return void this.valueSubscriptions.set(e,()=>{l(),s.cancel()})}const n=Xo.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&pi.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o&&o()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Ns){const t=Ns[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<xs.length;t++){const n=xs[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=e["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const o=t[r],a=n[r];if(Oa(o))e.addValue(r,o);else if(Oa(a))e.addValue(r,ss(o,{owner:e}));else if(a!==o)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,ss(void 0!==t?t:o,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=ss(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=void 0===this.latestValues[e]&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(Ba(n)||Mi(n))?n=parseFloat(n):(r=n,!ls.find(Pa(r))&&Ma.test(t)&&(n=Si(e,t))),this.setBaseTarget(e,Oa(n)?n.get():n)),Oa(n)?n.get():n;var r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){const{initial:t}=this.props;let n;if("string"==typeof t||"object"==typeof t){const r=vs(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&void 0!==n)return n;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||Oa(r)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new Li),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Ki.render(this.render)}}class Es extends Ms{constructor(){super(...arguments),this.KeyframeResolver=ji}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){const n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Oa(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function _s(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ss=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Ds={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},js=$o.length;function ks(e,t,n){const{style:r,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const e in t){const n=t[e];if(Xo.has(e))i=!0;else if(Ya(e))o[e]=n;else{const t=Ss(n,Ca[e]);e.startsWith("origin")?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(i||n?r.transform=function(e,t,n){let r="",o=!0;for(let a=0;a<js;a++){const i=$o[a],s=e[i];if(void 0===s)continue;let l=!0;if("number"==typeof s)l=s===(i.startsWith("scale")?1:0);else{const e=parseFloat(s);l=i.startsWith("scale")?1===e:0===e}if(!l||n){const e=Ss(s,Ca[i]);l||(o=!1,r+=`${Ds[i]||i}(${e}) `),n&&(t[i]=e)}}const a=e.pathRotation;return a&&(o=!1,r+=`rotate(${Ss(a,Ca.pathRotation)}) `),r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const Cs={offset:"stroke-dashoffset",array:"stroke-dasharray"},As={offset:"strokeDashoffset",array:"strokeDasharray"},Ts=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ls(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:a=1,pathOffset:i=0,...s},l,c,u){if(ks(e,s,c),l)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox);for(const e of Ts)void 0!==d[e]&&(f[e]=d[e],delete d[e]);void 0!==t&&(d.x=t),void 0!==n&&(d.y=n),void 0!==r&&(d.scale=r),void 0!==o&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const a=o?Cs:As;e[a.offset]=""+-r,e[a.array]=`${t} ${n}`}(d,o,a,i,!1)}const Os=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),zs=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ps(e,{style:t,vars:n},r,o){const a=e.style;let i;for(i in t)a[i]=t[i];for(i in o?.applyProjectionStyles(a,r),n)a.setProperty(i,n[i])}const Rs=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Us(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Bs={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!fa.test(e))return e;e=parseFloat(e)}return`${Us(e,t.target.x)}% ${Us(e,t.target.y)}%`}},Fs=(e,t,n)=>e+(t-e)*n,Ys={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ma.parse(e);if(o.length>5)return r;const a=Ma.createTransformer(e),i="number"!=typeof o[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const c=Fs(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),a(o)}},Zs={borderRadius:{...Bs,applyTo:[...Rs]},borderTopLeftRadius:Bs,borderTopRightRadius:Bs,borderBottomLeftRadius:Bs,borderBottomRightRadius:Bs,boxShadow:Ys};function Vs(e,{layout:t,layoutId:n}){return Xo.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Zs[e]||"opacity"===e)}function Gs(e,t,n){const r=e.style,o=t?.style,a={};if(!r)return a;for(const t in r)(Oa(r[t])||o&&Oa(o[t])||Vs(t,e)||void 0!==n?.getValue(t)?.liveStyle)&&(a[t]=r[t]);return a}function Ws(e,t,n){const r=Gs(e,t,n);for(const n in e)(Oa(e[n])||Oa(t[n]))&&(r[-1!==$o.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}class Hs extends Es{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=La}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Xo.has(t)){const e=Ta(t);return e&&e.default||0}return t=Os.has(t)?t:_s(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ws(e,t,n)}build(e,t,n){Ls(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){!function(e,t,n,r){Ps(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Os.has(n)?n:_s(n),t.attrs[n])}(e,t,0,r)}mount(e){this.isSVGTag=zs(e.tagName),super.mount(e)}}function Qs({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $s(e){return void 0===e||1===e}function Xs({scale:e,scaleX:t,scaleY:n}){return!$s(e)||!$s(t)||!$s(n)}function Js(e){return Xs(e)||qs(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qs(e){return Ks(e.x)||Ks(e.y)}function Ks(e){return e&&"0%"!==e}function el(e,t,n){return n+t*(e-n)}function tl(e,t,n,r,o){return void 0!==o&&(e=el(e,o,r)),el(e,n,r)+t}function nl(e,t=0,n=1,r,o){e.min=tl(e.min,t,n,r,o),e.max=tl(e.max,t,n,r,o)}function rl(e,{x:t,y:n}){nl(e.x,t.translate,t.scale,t.originPoint),nl(e.y,n.translate,n.scale,n.originPoint)}const ol=.999999999999,al=1.0000000000001;function il(e,t){e.min+=t,e.max+=t}function sl(e,t,n,r,o=.5){nl(e,t,n,Fs(e.min,e.max,o),r)}function ll(e,t){return"string"==typeof e?parseFloat(e)/100*(t.max-t.min):e}function cl(e,t,n){const r=n??e;sl(e.x,ll(t.x,r.x),t.scaleX,t.scale,t.originX),sl(e.y,ll(t.y,r.y),t.scaleY,t.scale,t.originY)}function ul(e,t){return Qs(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}class dl extends Es{constructor(){super(...arguments),this.type="html",this.renderInstance=Ps}mount(e){Boolean(e.style),super.mount(e)}readValueFromInstance(e,t){if(Xo.has(t))return this.projection?.isProjecting?ni(t):((e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ri(n,t)})(e,t);{const r=(n=e,window.getComputedStyle(n)),o=(Ya(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return ul(e,t)}build(e,t,n){ks(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Gs(e,t,n)}}const fl=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function pl(e){return"string"==typeof e&&!e.includes("-")&&!!(fl.indexOf(e)>-1||/[A-Z]/u.test(e))}const ml=(e,t)=>t.isSVG??pl(e)?new Hs(t):new dl(t,{allowProjection:e!==p.Fragment}),hl=(0,p.createContext)({}),gl=(0,p.createContext)({strict:!1}),wl=(0,p.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),yl=(0,p.createContext)({});function bl(e){return Array.isArray(e)?e.join(" "):e}function vl(e,t,n){for(const r in t)Oa(t[r])||Vs(r,n)||(e[r]=t[r])}function xl(e,t){const n={},r=function(e,t){const n={};return vl(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,p.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return ks(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Nl(e,t,n,r){const o=(0,p.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ls(n,t,zs(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};vl(t,e.style,e),o.style={...t,...o.style}}return o}const Il=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ml(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Il.has(e)}let El=e=>!Ml(e);try{"function"==typeof(_l=require("@emotion/is-prop-valid").default)&&(El=e=>e.startsWith("on")?!Ml(e):_l(e))}catch{}var _l;function Sl(e,t,n,{latestValues:r},o,a=!1,i){const s=(i??pl(e)?Nl:xl)(t,r,o,e),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||Oa(e[o])||(El(o)||!0===n&&Ml(o)||!t&&!Ml(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(t,"string"==typeof e,a),c=e!==p.Fragment?{...l,...s,ref:n}:{},{children:u}=t,d=(0,p.useMemo)(()=>Oa(u)?u.get():u,[u]);return(0,p.createElement)(e,{...c,children:d})}function Dl(e){return Oa(e)?e.get():e}const jl=(0,p.createContext)(null);function kl(e){const t=(0,p.useRef)(null);return null===t.current&&(t.current=e()),t.current}function Cl(e,t,n,r){const o={},a=r(e,{});for(const e in a)o[e]=Dl(a[e]);let{initial:i,animate:s}=e;const l=ms(e),c=hs(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!us(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=vs(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const e in n){let t=n[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const Al=e=>(t,n)=>{const r=(0,p.useContext)(yl),o=(0,p.useContext)(jl),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:Cl(n,r,o,e),renderState:t()}}(e,t,r,o);return n?a():kl(a)},Tl=Al({scrapeMotionValuesFromProps:Gs,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})}),Ll=Al({scrapeMotionValuesFromProps:Ws,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}})}),Ol={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let zl=!1;function Pl(){return function(){if(zl)return;const e={};for(const t in Ol)e[t]={isEnabled:e=>Ol[t].some(t=>!!e[t])};Is(e),zl=!0}(),Ns}const Rl=Symbol.for("motionComponentSymbol");function Ul(e,t,n){const r=(0,p.useRef)(n);(0,p.useInsertionEffect)(()=>{r.current=n});const o=(0,p.useRef)(null);return(0,p.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());const a=r.current;if("function"==typeof a)if(n){const e=a(n);"function"==typeof e&&(o.current=e)}else o.current?(o.current(),o.current=null):a(n);else a&&(a.current=n)},[t])}const Bl="data-"+_s("framerAppearId"),Fl=(0,p.createContext)({});function Yl(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const Zl="undefined"!=typeof window?p.useLayoutEffect:p.useEffect;function Vl(e,t,n,r,o,a){const{visualElement:i}=(0,p.useContext)(yl),s=(0,p.useContext)(gl),l=(0,p.useContext)(jl),c=(0,p.useContext)(wl),u=c.reducedMotion,d=c.skipAnimations,f=(0,p.useRef)(null),m=(0,p.useRef)(!1);r=r||s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),m.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const h=f.current,g=(0,p.useContext)(Fl);!h||h.projection||!o||"html"!==h.type&&"svg"!==h.type||function(e,t,n,r){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Gl(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(i)||s&&Yl(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(f.current,n,o,g);const w=(0,p.useRef)(!1);(0,p.useInsertionEffect)(()=>{h&&w.current&&h.update(n,l)});const y=n[Bl],b=(0,p.useRef)(Boolean(y)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Zl(()=>{m.current=!0,h&&(w.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),b.current&&h.animationState&&h.animationState.animateChanges())}),(0,p.useEffect)(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),b.current=!1),h.enteringChildren=void 0)}),h}function Gl(e){if(e)return!1!==e.options.allowProjection?e.projection:Gl(e.parent)}function Wl(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&function(e){const t=Pl();for(const n in e)t[n]={...t[n],...e[n]};Is(t)}(r);const a=n?"svg"===n:pl(e),i=a?Ll:Tl;function s(n,r){let s;const l={...(0,p.useContext)(wl),...n,layoutId:Hl(n)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(ms(e)){const{initial:t,animate:n}=e;return{initial:!1===t||ds(t)?t:void 0,animate:ds(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,p.useContext)(yl));return(0,p.useMemo)(()=>({initial:t,animate:n}),[bl(t),bl(n)])}(n),d=i(n,c);if(!c&&"undefined"!=typeof window){(0,p.useContext)(gl).strict;const t=function(e){const t=Pl(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(l);s=t.MeasureLayout,u.visualElement=Vl(e,d,l,o,t.ProjectionNode,a)}return(0,C.jsxs)(yl.Provider,{value:u,children:[s&&u.visualElement?(0,C.jsx)(s,{visualElement:u.visualElement,...l}):null,Sl(e,n,Ul(d,u.visualElement,r),d,c,t,a)]})}s.displayName=`motion.${"string"==typeof e?e:`create(${e.displayName??e.name??""})`}`;const l=(0,p.forwardRef)(s);return l[Rl]=e,l}function Hl({layoutId:e}){const t=(0,p.useContext)(hl).id;return t&&void 0!==e?t+"-"+e:e}function Ql(e,t){if("undefined"==typeof Proxy)return Wl;const n=new Map,r=(n,r)=>Wl(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(o,a)=>"create"===a?r:(n.has(a)||n.set(a,Wl(a,void 0,e,t)),n.get(a))})}class $l{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Xl(e,t,n){const r=e.getProps();return vs(r,t,void 0!==n?n:r.custom,e)}function Jl(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function ql(e,t){const n=e?.[t]??e?.default??e;return n!==e?Jl(n,e):n}const Kl=e=>Array.isArray(e);function ec(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ss(n))}function tc(e){return Kl(e)?e[e.length-1]||0:e}function nc(e,t){const n=e.getValue("willChange");if(function(e){return Boolean(Oa(e)&&e.add)}(n))return n.add(t);if(!n&&ui.WillChange){const n=new ui.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function rc(e){return e.props[Bl]}const oc=(...e)=>e.reduce((e,t)=>n=>t(e(n)));function ac(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ic(e,t){return n=>n>0?t:e}const sc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},lc=[la,sa,ga];function cc(e){const t=(n=e,lc.find(e=>e.test(n)));var n;if(Boolean(t),!Boolean(t))return!1;let r=t.parse(e);return t===ga&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,a=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;o=ac(s,r,e+1/3),a=ac(s,r,e),i=ac(s,r,e-1/3)}else o=a=i=n;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:r}}(r)),r}const uc=(e,t)=>{const n=cc(e),r=cc(t);if(!n||!r)return ic(e,t);const o={...n};return e=>(o.red=sc(n.red,r.red,e),o.green=sc(n.green,r.green,e),o.blue=sc(n.blue,r.blue,e),o.alpha=Fs(n.alpha,r.alpha,e),sa.transform(o))},dc=new Set(["none","hidden"]);function fc(e,t){return n=>Fs(e,t,n)}function pc(e){return"number"==typeof e?fc:"string"==typeof e?Va(e)?ic:wa.test(e)?uc:gc:Array.isArray(e)?mc:"object"==typeof e?wa.test(e)?uc:hc:ic}function mc(e,t){const n=[...e],r=n.length,o=e.map((e,n)=>pc(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function hc(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=pc(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const gc=(e,t)=>{const n=Ma.createTransformer(t),r=Na(e),o=Na(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?dc.has(e)&&!o.values.length||dc.has(t)&&!r.values.length?function(e,t){return dc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):oc(mc(function(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const a=t.types[o],i=e.indexes[a][r[a]],s=e.values[i]??0;n[o]=s,r[a]++}return n}(r,o),o.values),n):ic(e,t)};function wc(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?Fs(e,t,n):pc(e)(e,t)}const yc=e=>{const t=({timestamp:t})=>e(t);return{start:(e=!0)=>pi.update(t,e),stop:()=>mi(t),now:()=>hi.isProcessing?hi.timestamp:rs.now()}},bc=2e4;function vc(e){let t=0,n=e.next(t);for(;!n.done&&t<bc;)t+=50,n=e.next(t);return t>=bc?1/0:t}const xc=.01,Nc=2,Ic=.005,Mc=.5;function Ec(e,t){return e*Math.sqrt(1-t*t)}const _c=["duration","bounce"],Sc=["stiffness","damping","mass"];function Dc(e,t){return t.some(t=>void 0!==e[t])}function jc(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const a=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Dc(e,Sc)&&Dc(e,_c))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),o=r*r,a=2*Jo(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:1,stiffness:o,damping:a}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:r=1}){let o,a;ki(10);let i=1-t;i=Jo(.05,1,i),e=Jo(.01,10,Ci(e)),i<1?(o=t=>{const r=t*i,o=r*e;return.001-(r-n)/Ec(t,i)*Math.exp(-o)},a=t=>{const r=t*i*e,a=r*n+n,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Ec(Math.pow(t,2),i);return(.001-o(t)>0?-1:1)*((a-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}(o,a,5/e);if(e=ki(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*i*Math.sqrt(r*t),duration:e}}}({...e,velocity:0});t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Ci(n.velocity||0)}),m=f||0,h=c/(2*Math.sqrt(l*u)),g=i-a,w=Ci(Math.sqrt(l/u)),y=Math.abs(g)<5;let b,v,x,N,I,M;if(r||(r=y?xc:Nc),o||(o=y?Ic:Mc),h<1)x=Ec(w,h),N=(m+h*w*g)/x,b=e=>{const t=Math.exp(-h*w*e);return i-t*(N*Math.sin(x*e)+g*Math.cos(x*e))},I=h*w*N+g*x,M=h*w*g-N*x,v=e=>Math.exp(-h*w*e)*(I*Math.sin(x*e)+M*Math.cos(x*e));else if(1===h){b=e=>i-Math.exp(-w*e)*(g+(m+w*g)*e);const e=m+w*g;v=t=>Math.exp(-w*t)*(w*e*t-m)}else{const e=w*Math.sqrt(h*h-1);b=t=>{const n=Math.exp(-h*w*t),r=Math.min(e*t,300);return i-n*((m+h*w*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};const t=(m+h*w*g)/e,n=h*w*t-g*e,r=h*w*g-t*e;v=t=>{const o=Math.exp(-h*w*t),a=Math.min(e*t,300);return o*(n*Math.sinh(a)+r*Math.cosh(a))}}const E={calculatedDuration:p&&d||null,velocity:e=>ki(v(e)),next:e=>{if(!p&&h<1){const t=Math.exp(-h*w*e),n=Math.sin(x*e),a=Math.cos(x*e),l=i-t*(N*n+g*a),c=ki(t*(I*n+M*a));return s.done=Math.abs(c)<=r&&Math.abs(i-l)<=o,s.value=s.done?i:l,s}const t=b(e);if(p)s.done=e>=d;else{const n=ki(v(e));s.done=Math.abs(n)<=r&&Math.abs(i-t)<=o}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(vc(E),bc),t=Gi(t=>E.next(e*t).value,e,30);return e+"ms "+t},toTransition:()=>{}};return E}function kc(e,t,n){const r=Math.max(t-5,0);return os(n-e(r),t-r)}function Cc({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},p=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let m=n*t;const h=d+m,g=void 0===i?h:i(h);g!==h&&(m=g-d);const w=e=>-m*Math.exp(-e/r),y=e=>g+w(e),b=e=>{const t=w(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let v,x;const N=e=>{var t;t=f.value,(void 0!==s&&t<s||void 0!==l&&t>l)&&(v=e,x=jc({keyframes:[f.value,p(f.value)],velocity:kc(y,e,f.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return N(0),{calculatedDuration:null,next:e=>{let t=!1;return x||void 0!==v||(t=!0,b(e),N(e)),void 0!==v&&e>=v?x.next(e-v):(!t&&b(e),f)}}}jc.applyToOptions=e=>{const t=function(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(vc(r),bc);return{type:"keyframes",ease:e=>r.next(o*e).value/t,duration:Ci(o)}}(e,100,jc);return e.ease=t.ease,e.duration=ki(t.duration),e.type="keyframes",e};const Ac=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Tc(e,t,n,r){if(e===t&&n===r)return ci;return o=>0===o||1===o?o:Ac(function(e,t,n,r,o){let a,i,s=0;do{i=t+(n-t)/2,a=Ac(i,r,o)-e,a>0?n=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(o,0,1,e,n),t,r)}const Lc=Tc(.42,0,1,1),Oc=Tc(0,0,.58,1),zc=Tc(.42,0,.58,1),Pc=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Rc=e=>t=>1-e(1-t),Uc=Tc(.33,1.53,.69,.99),Bc=Rc(Uc),Fc=Pc(Bc),Yc=e=>e>=1?1:(e*=2)<1?.5*Bc(e):.5*(2-Math.pow(2,-10*(e-1))),Zc=e=>1-Math.sin(Math.acos(e)),Vc=Rc(Zc),Gc=Pc(Zc),Wc={linear:ci,easeIn:Lc,easeInOut:zc,easeOut:Oc,circIn:Zc,circInOut:Gc,circOut:Vc,backIn:Bc,backInOut:Fc,backOut:Uc,anticipate:Yc},Hc=e=>{if(Zi(e)){e.length;const[t,n,r,o]=e;return Tc(t,n,r,o)}return"string"==typeof e?Wc[e]:e},Qc=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};function $c({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Hc):Hc(r),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Qc(0,t,r);e.push(Fs(n,1,o))}}(t,e.length-1),t}(t),e),s=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const a=e.length;if(t.length,1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||ui.mix||wc,a=e.length-1;for(let n=0;n<a;n++){let a=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||ci:t;a=oc(e,a)}r.push(a)}return r}(t,r,o),l=s.length,c=n=>{if(i&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const o=Qc(e[r],e[r+1],n);return s[r](o)};return n?t=>c(Jo(e[0],e[a-1],t)):c}(i,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map(()=>c||zc).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const Xc={decay:Cc,inertia:Cc,tween:$c,keyframes:$c,spring:jc};function Jc(e){"string"==typeof e.type&&(e.type=Xc[e.type])}const qc=e=>e/100;class Kc extends Yi{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==rs.now()&&this.tick(rs.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),!1===e.autoplay&&this.pause()}initAnimation(){const{options:e}=this;Jc(e);const{type:t=$c,repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=e;let{keyframes:i}=e;const s=t||$c;s!==$c&&"number"!=typeof i[0]&&(this.mixKeyframes=oc(qc,wc(i[0],i[1])),i=[0,100]);const l=s({...e,keyframes:i});"mirror"===o&&(this.mirroredGenerator=s({...e,keyframes:[...i].reverse(),velocity:-a})),null===l.calculatedDuration&&(l.calculatedDuration=vc(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=l}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:n,totalDuration:r,mixKeyframes:o,mirroredGenerator:a,resolvedDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=r);let y,b=this.currentTime,v=n;if(u){const e=Math.min(this.currentTime,r)/i;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,u+1),Boolean(t%2)&&("reverse"===d?(n=1-n,f&&(n-=f/i)):"mirror"===d&&(v=a)),b=Jo(0,1,n)*i}w?(this.delayState.value=c[0],y=this.delayState):y=v.next(b),o&&!w&&(y.value=o(y.value));let{done:x}=y;w||null===s||(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const N=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return N&&p!==Cc&&(y.value=Fi(c,this.options,h,this.speed)),m&&m(y.value),N&&this.finish(),y}then(e,t){return this.finished.then(e,t)}get duration(){return Ci(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ci(e)}get time(){return Ci(this.currentTime)}set time(e){e=ki(e),this.currentTime=e,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;return e<=0?this.options.velocity||0:this.generator.velocity?this.generator.velocity(e):kc(e=>this.generator.next(e).value,e,this.generator.next(e).value)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(rs.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Ci(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=yc,startTime:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=t??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(rs.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}const eu={anticipate:Yc,backInOut:Fc,circInOut:Gc};class tu extends Ji{constructor(e){var t;"string"==typeof(t=e).ease&&t.ease in eu&&(t.ease=eu[t.ease]),Jc(e),super(e),void 0!==e.startTime&&!1!==e.autoplay&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:n,onComplete:r,element:o,...a}=this.options;if(!t)return;if(void 0!==e)return void t.set(e);const i=new Kc({...a,autoplay:!1}),s=Math.max(10,rs.now()-this.startTime),l=Jo(0,10,s-10),c=i.sample(s).value,{name:u}=this.options;o&&u&&Oi(o,u,c),t.setWithVelocity(i.sample(Math.max(0,s-l)).value,c,l),i.stop()}}const nu=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Ma.test(e)&&"0"!==e||e.startsWith("url(")));function ru(e){e.duration=0,e.type="keyframes"}const ou=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/,au=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),iu=zi(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class su extends Yi{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:a="loop",keyframes:i,name:s,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rs.now();const d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:a,name:s,motionValue:l,element:c,...u},f=c?.KeyframeResolver||Ii;this.keyframeResolver=new f(i,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;const{name:o,type:a,velocity:i,delay:s,isHandoff:l,onUpdate:c}=n;this.resolvedAt=rs.now();let u=!0;(function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=nu(o,t),s=nu(a,t);return!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||Xi(n))&&r)})(e,o,a,i)||(u=!1,!ui.instantAnimations&&s||c?.(Fi(e,n,t)),e[0]=e[e.length-1],ru(n),n.repeat=0);const d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!l&&function(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:a,type:i,keyframes:s}=e,l=t?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return iu()&&n&&(qi.has(n)||au.has(n)&&function(e){for(let t=0;t<e.length;t++)if("string"==typeof e[t]&&ou.test(e[t]))return!0;return!1}(s))&&("transform"!==n||!u)&&!c&&!r&&"mirror"!==o&&0!==a&&"inertia"!==i}(d),p=d.motionValue?.owner?.current;let m;if(f)try{m=new tu({...d,element:p})}catch{m=new Kc(d)}else m=new Kc(d);m.finished.then(()=>{this.notifyFinished()}).catch(ci),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),vi=!0,Ni(),xi(),vi=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const lu={type:"spring",stiffness:500,damping:25,restSpeed:10},cu={type:"keyframes",duration:.8},uu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},du=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]),fu=(e,t,n,r={},o,a)=>i=>{const s=ql(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c-=ki(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function(e){for(const t in e)if(!du.has(t))return!0;return!1})(s)||Object.assign(u,((e,{keyframes:t})=>t.length>2?cu:Xo.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:lu:uu)(e,u)),u.duration&&(u.duration=ki(u.duration)),u.repeatDelay&&(u.repeatDelay=ki(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(ru(u),0===u.delay&&(d=!0)),(ui.instantAnimations||ui.skipAnimations||o?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,ru(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&void 0!==t.get()){const e=Fi(u.keyframes,s);if(void 0!==e)return void pi.update(()=>{u.onUpdate(e),u.onComplete()})}return s.isSync?new Kc(u):new su(u)};function pu({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function mu(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:a,transitionEnd:i,...s}=t;const l=e.getDefaultTransition();a=a?Jl(a,l):l;const c=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);const d=[],f=o&&e.animationState&&e.animationState.getState()[o],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(const t in s){const r=e.getValue(t,e.latestValues[t]??null),o=s[t];if(void 0===o||f&&pu(f,t))continue;const i={delay:n,...ql(a||{},t)};u&&(i.skipAnimations=!0);const l=r.get();if(void 0!==l&&!r.isAnimating()&&!Array.isArray(o)&&o===l&&!i.velocity){pi.update(()=>r.set(o));continue}let p=!1;if(window.MotionHandoffAnimation){const n=rc(e);if(n){const e=window.MotionHandoffAnimation(n,t,pi);null!==e&&(i.startTime=e,p=!0)}}nc(e,t);const m=c??e.shouldReduceMotion;r.start(fu(t,r,o,m&&za.has(t)?{type:!1}:i,e,p));const h=r.animation;h&&d.push(h)}if(i){const t=()=>pi.update(()=>{i&&function(e,t){const n=Xl(e,t);let{transitionEnd:r={},transition:o={},...a}=n||{};a={...a,...r};for(const t in a)ec(e,t,tc(a[t]))}(e,i)});d.length?Promise.all(d).then(t):t()}return d}function hu(e,t,n,r=0,o=1){const a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),i=e.size,s=(i-1)*r;return"function"==typeof n?n(a,i):1===o?a*r:s-a*r}function gu(e,t,n={}){const r=Xl(e,t,"exit"===n.type?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const a=r?()=>Promise.all(mu(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:a=0,staggerChildren:i,staggerDirection:s}=o;return function(e,t,n=0,r=0,o=0,a=1,i){const s=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),s.push(gu(l,t,{...i,delay:n+("function"==typeof r?0:r)+hu(e.variantChildren,l,r,o,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}(e,t,r,a,i,s,n)}:()=>Promise.resolve(),{when:s}=o;if(s){const[e,t]="beforeChildren"===s?[a,i]:[i,a];return e().then(()=>t())}return Promise.all([a(),i(n.delay)])}const wu=ps.length;function yu(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&yu(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<wu;n++){const r=ps[n],o=e.props[r];(ds(o)||!1===o)&&(t[r]=o)}return t}function bu(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const vu=[...fs].reverse(),xu=fs.length;function Nu(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>gu(e,t,n));r=Promise.all(o)}else if("string"==typeof t)r=gu(e,t,n);else{const o="function"==typeof t?Xl(e,t,n.custom):t;r=Promise.all(mu(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=Eu(),r=!0,o=!1;const a=t=>(n,r)=>{const o=Xl(e,r,"exit"===t?e.presenceContext?.custom:void 0);if(o){const{transition:e,transitionEnd:t,...r}=o;n={...n,...r,...t}}return n};function i(i){const{props:s}=e,l=yu(e.parent)||{},c=[],u=new Set;let d={},f=1/0;for(let t=0;t<xu;t++){const p=vu[t],m=n[p],h=void 0!==s[p]?s[p]:l[p],g=ds(h),w=p===i?m.isActive:null;!1===w&&(f=t);let y=h===l[p]&&h!==s[p]&&g;if(y&&(r||o)&&e.manuallyAnimateOnMount&&(y=!1),m.protectedKeys={...d},!m.isActive&&null===w||!h&&!m.prevProp||us(h)||"boolean"==typeof h)continue;if("exit"===p&&m.isActive&&!0!==w){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}const b=Iu(m.prevProp,h);let v=b||p===i&&m.isActive&&!y&&g||t>f&&g,x=!1;const N=Array.isArray(h)?h:[h];let I=N.reduce(a(p),{});!1===w&&(I={});const{prevResolvedValues:M={}}=m,E={...M,...I},_=t=>{v=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in E){const t=I[e],n=M[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Kl(t)&&Kl(n)?!bu(t,n)||b:t!==n,r?null!=t?_(e):u.add(e):void 0!==t&&u.has(e)?_(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=I,m.isActive&&(d={...d,...I}),(r||o)&&e.blockInitialAnimation&&(v=!1);const S=y&&b;v&&(!S||x)&&c.push(...N.map(t=>{const n={type:p};if("string"==typeof t&&(r||o)&&!S&&e.manuallyAnimateOnMount&&e.parent){const{parent:r}=e,o=Xl(r,t);if(r.enteringChildren&&o){const{delayChildren:t}=o.transition||{};n.delay=hu(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){const t={};if("boolean"!=typeof s.initial){const n=Xl(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let p=Boolean(c.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,o=!1,p?t(c):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;const o=i(t);for(const e in n)n[e].protectedKeys={};return o},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Eu(),o=!0}}}function Iu(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!bu(t,e)}function Mu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Eu(){return{animate:Mu(!0),whileInView:Mu(),whileHover:Mu(),whileTap:Mu(),whileDrag:Mu(),whileFocus:Mu(),exit:Mu()}}let _u=0;const Su={animation:{Feature:class extends $l{constructor(e){super(e),e.animationState||(e.animationState=Nu(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();us(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends $l{constructor(){super(...arguments),this.id=_u++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&!1===n){if(this.isExitComplete){const{initial:e,custom:t}=this.node.getProps();if("string"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)){const n=Xl(this.node,e,t);if(n){const{transition:e,transitionEnd:t,...r}=n;for(const e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}},Du={x:!1,y:!1};function ju(){return Du.x||Du.y}function ku(e){return[e("x"),e("y")]}function Cu(e){return e.max-e.min}function Au(e,t,n,r=.5){e.origin=r,e.originPoint=Fs(t.min,t.max,e.origin),e.scale=Cu(n)/Cu(t),e.translate=Fs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Tu(e,t,n,r){Au(e.x,t.x,n.x,r?r.originX:void 0),Au(e.y,t.y,n.y,r?r.originY:void 0)}function Lu(e,t,n,r=0){const o=r?Fs(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+Cu(t)}function Ou(e,t,n,r=0){const o=r?Fs(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+Cu(t)}function zu(e,t,n,r){Ou(e.x,t.x,n.x,r?.x),Ou(e.y,t.y,n.y,r?.y)}const Pu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),Ru=new Set(["INPUT","SELECT","TEXTAREA"]);function Uu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Bu=e=>"object"==typeof e&&null!==e;function Fu(e){return Bu(e)&&"ownerSVGElement"in e}function Yu(e,t,n){if(null==e)return[];if(e instanceof EventTarget)return[e];if("string"==typeof e){let r=document;t&&(r=t.current);const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(e=>null!=e)}const Zu=new WeakMap;let Vu;const Gu=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:Fu(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Wu=Gu("inline","width","offsetWidth"),Hu=Gu("block","height","offsetHeight");function Qu({target:e,borderBoxSize:t}){Zu.get(e)?.forEach(n=>{n(e,{get width(){return Wu(e,t)},get height(){return Hu(e,t)}})})}function $u(e){e.forEach(Qu)}const Xu=new Set;let Ju;function qu(e,t){return"function"==typeof e?(n=e,Xu.add(n),Ju||(Ju=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xu.forEach(t=>t(e))},window.addEventListener("resize",Ju)),()=>{Xu.delete(n),Xu.size||"function"!=typeof Ju||(window.removeEventListener("resize",Ju),Ju=void 0)}):function(e,t){Vu||"undefined"!=typeof ResizeObserver&&(Vu=new ResizeObserver($u));const n=Yu(e);return n.forEach(e=>{let n=Zu.get(e);n||(n=new Set,Zu.set(e,n)),n.add(t),Vu?.observe(e)}),()=>{n.forEach(e=>{const n=Zu.get(e);n?.delete(t),n?.size||Vu?.unobserve(e)})}}(e,t);var n}const Ku=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function ed(e){return{point:{x:e.pageX,y:e.pageY}}}function td(e,t,n,r){return Uu(e,t,(e=>t=>Ku(t)&&e(t,ed(t)))(n),r)}const nd=({current:e})=>e?e.ownerDocument.defaultView:null,rd=(e,t)=>Math.abs(e-t),od=new Set(["auto","scroll"]);class ad{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:a=3,element:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=id(this.lastRawMoveEventInfo,this.transformPagePoint));const e=ld(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=rd(e.x,t.x),r=rd(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=hi;this.history.push({...r,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=id(t,this.transformPagePoint),pi.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=ld("pointercancel"===e.type?this.lastMoveEventInfo:id(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Ku(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;const s=id(ed(e),this.transformPagePoint),{point:l}=s,{timestamp:c}=hi;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=t;u&&u(e,ld(s,this.history));const d={passive:!0,capture:!0};this.removeListeners=oc(td(this.contextWindow,"pointermove",this.handlePointerMove,d),td(this.contextWindow,"pointerup",this.handlePointerUp,d),td(this.contextWindow,"pointercancel",this.handlePointerUp,d)),i&&this.startScrollTracking(i)}startScrollTracking(e){let t=e.parentElement;for(;t;){const e=getComputedStyle(t);(od.has(e.overflowX)||od.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o=r.x-t.x,a=r.y-t.y;0===o&&0===a||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=a):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=a),this.scrollPositions.set(e,r),pi.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),mi(this.updatePoint)}}function id(e,t){return t?{point:t(e.point)}:e}function sd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ld({point:e},t){return{point:e,delta:sd(e,ud(t)),offset:sd(e,cd(t)),velocity:dd(t,.1)}}function cd(e){return e[0]}function ud(e){return e[e.length-1]}function dd(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=ud(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ki(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>2*ki(t)&&(r=e[1]);const a=Ci(o.timestamp-r.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-r.x)/a,y:(o.y-r.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function fd(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function pd(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const md=.35;function hd(e,t,n){return{min:gd(e,t),max:gd(e,n)}}function gd(e,t){return"number"==typeof e?e:e[t]||0}const wd=new WeakMap;class yd{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:o}=this.getProps();this.panSession=new ad(e,{onSessionStart:e=>{t&&this.snapToCursor(ed(e).point),this.stopAnimation()},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(a=n)||"y"===a?Du[a]?null:(Du[a]=!0,()=>{Du[a]=!1}):Du.x||Du.y?null:(Du.x=Du.y=!0,()=>{Du.x=Du.y=!1}),!this.openDragLock))return;var a;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ku(e=>{let t=this.getAxisMotionValue(e).get()||0;if(da.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=Cu(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&pi.update(()=>o(e,t),!1,!0),nc(this.visualElement,"transform");const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:i}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&pi.update(()=>a(e,t),!1,!0)},onSessionEnd:(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:nd(this.visualElement),element:this.visualElement.current})}stop(e,t){const n=e||this.latestPointerEvent,r=t||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!n)return;const{velocity:a}=r;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&pi.postRender(()=>i(n,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!vd(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Fs(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Fs(n,e,r.max):Math.min(e,n)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Yl(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!n)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:fd(e.x,n,o),y:fd(e.y,t,r)}}(n.layoutBox,e),this.elastic=function(e=md){return!1===e?e=0:!0===e&&(e=md),{x:hd(e,"left","right"),y:hd(e,"top","bottom")}}(t),r!==this.constraints&&!Yl(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&ku(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Yl(e))return!1;const n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const o=function(e,t,n){const r=ul(e,n),{scroll:o}=t;return o&&(il(r.x,o.offset.x),il(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:pd(e.x,t.x),y:pd(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=Qs(e))}return a}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=ku(i=>{if(!vd(i,t,this.currentDirection))return;let l=s&&s[i]||{};!0!==a&&a!==i||(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[i]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return nc(this.visualElement,e),n.start(fu(e,n,0,t,this.visualElement,!1))}stopAnimation(){ku(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){ku(t=>{const{drag:n}=this.getProps();if(!vd(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:a}=r.layout.layoutBox[t],i=o.get()||0;o.set(e[t]-Fs(n,a,.5)+i)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Yl(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ku(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Cu(e),o=Cu(t);return o>r?n=Qc(t.min,t.max-r,e.min):r>o&&(n=Qc(e.min,e.max-o,t.min)),Jo(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ku(t=>{if(!vd(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];n.set(Fs(o,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;wd.set(this.visualElement,this);const e=this.visualElement.current,t=td(e,"pointerdown",t=>{const{drag:n,dragListener:r=!0}=this.getProps(),o=t.target,a=o!==e&&function(e){return Ru.has(e.tagName)||!0===e.isContentEditable}(o);n&&r&&!a&&this.start(t)});let n;const r=()=>{const{dragConstraints:t}=this.getProps();Yl(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(e,t,n){const r=qu(e,bd(n)),o=qu(t,bd(n));return()=>{r(),o()}}(e,t.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,a=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),pi.read(r);const i=Uu(window,"resize",()=>this.scalePositionWithinConstraints()),s=o.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ku(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{i(),t(),a(),s&&s(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:a=md,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function bd(e){let t=!0;return()=>{t?t=!1:e()}}function vd(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const xd=e=>(t,n)=>{e&&pi.update(()=>e(t,n),!1,!0)},Nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Id(e=!0){const t=(0,p.useContext)(jl);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,a=(0,p.useId)();(0,p.useEffect)(()=>{if(e)return o(a)},[e]);const i=(0,p.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,i]:[!0]}let Md=!1;class Ed extends p.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),Md&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,{projection:a}=n;return a?(a.isPresent=o,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Md=!0,r||e.layoutDependency!==t||void 0===t||e.isPresent!==o?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||pi.postRender(()=>{const e=a.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Ki.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Md=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function _d(e){const[t,n]=Id(),r=(0,p.useContext)(hl);return(0,C.jsx)(Ed,{...e,layoutGroup:r,switchLayoutGroup:(0,p.useContext)(Fl),isPresent:t,safeToRemove:n})}const Sd={value:null,addProjectionMetrics:null};const Dd=Rs.length,jd=e=>"string"==typeof e?parseFloat(e):e,kd=e=>"number"==typeof e||fa.test(e);function Cd(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Ad=Ld(0,.5,Vc),Td=Ld(.5,.95,ci);function Ld(e,t,n){return r=>r<e?0:r>t?1:n(Qc(e,t,r))}function Od(e,t){e.min=t.min,e.max=t.max}function zd(e,t){Od(e.x,t.x),Od(e.y,t.y)}function Pd(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Rd(e,t,n,r,o){return e=el(e-=t,1/n,r),void 0!==o&&(e=el(e,1/o,r)),e}function Ud(e,t,[n,r,o],a,i){!function(e,t=0,n=1,r=.5,o,a=e,i=e){if(da.test(t)&&(t=parseFloat(t),t=Fs(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=Fs(a.min,a.max,r);e===a&&(s-=t),e.min=Rd(e.min,t,n,s,o),e.max=Rd(e.max,t,n,s,o)}(e,t[n],t[r],t[o],t.scale,a,i)}const Bd=["x","scaleX","originX"],Fd=["y","scaleY","originY"];function Yd(e,t,n,r){Ud(e.x,t,Bd,n?n.x:void 0,r?r.x:void 0),Ud(e.y,t,Fd,n?n.y:void 0,r?r.y:void 0)}function Zd(e){return 0===e.translate&&1===e.scale}function Vd(e){return Zd(e.x)&&Zd(e.y)}function Gd(e,t){return e.min===t.min&&e.max===t.max}function Wd(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Hd(e,t){return Wd(e.x,t.x)&&Wd(e.y,t.y)}function Qd(e){return Cu(e.x)/Cu(e.y)}function $d(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Xd{constructor(){this.members=[]}add(e){Ai(this.members,e);for(let t=this.members.length-1;t>=0;t--){const n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;const r=n.instance;r&&!1!==r.isConnected||n.snapshot||(Ti(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Ti(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent&&!1!==e.instance?.isConnected)return this.promote(e),!0}return!1}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=n.options,{layoutDependency:o}=e.options;void 0!==r&&r===o||(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),!1===e.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Jd=(e,t)=>e.depth-t.depth;class qd{constructor(){this.children=[],this.isDirty=!1}add(e){Ai(this.children,e),this.isDirty=!0}remove(e){Ti(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Jd),this.isDirty=!1,this.children.forEach(e)}}const Kd={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ef=["","X","Y","Z"];let tf=0;function nf(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function rf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=rc(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",pi,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&rf(r)}function of({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=t?.()){this.id=tf++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Sd.value&&(Kd.nodes=Kd.calculatedTargetDeltas=Kd.calculatedProjections=0),this.nodes.forEach(lf),this.nodes.forEach(wf),this.nodes.forEach(yf),this.nodes.forEach(cf),Sd.addProjectionMetrics&&Sd.addProjectionMetrics(Kd)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new qd)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Li),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;var n;this.isSVG=Fu(t)&&!(Fu(n=t)&&"svg"===n.tagName),this.instance=t;const{layoutId:r,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(o||r)&&(this.isLayoutDirty=!0),e){let n,r=0;const o=()=>this.root.updateBlockedByResize=!1;pi.read(()=>{r=window.innerWidth}),e(t,()=>{const e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=rs.now(),r=({timestamp:o})=>{const a=o-n;a>=t&&(mi(r),e(a-t))};return pi.setup(r,!0),()=>mi(r)}(o,250),Nd.hasAnimatedSinceResize&&(Nd.hasAnimatedSinceResize=!1,this.nodes.forEach(gf)))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&a&&(r||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||Mf,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!Hd(this.targetLayout,r),c=!t&&n;if(this.options.layoutRoot||this.resumeFrom||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const t={...ql(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,c,t.path)}else t||gf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),mi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(bf),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&rf(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,"string"!=typeof t.latestValues.x&&"string"!=typeof t.latestValues.y||(t.isLayoutDirty=!0),t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const e=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(ff),void this.nodes.forEach(df)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(pf);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(mf),this.nodes.forEach(hf),this.nodes.forEach(af),this.nodes.forEach(sf)):this.nodes.forEach(pf),this.clearAllSnapshots();const e=rs.now();hi.delta=Jo(0,1e3/60,e-hi.timestamp),hi.timestamp=e,hi.isProcessing=!0,gi.update.process(hi),gi.preRender.process(hi),gi.render.process(hi),hi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ki.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(uf),this.sharedNodes.forEach(vf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pi.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pi.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Cu(this.snapshot.measuredBox.x)||Cu(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Vd(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Js(this.latestValues)||a)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),Sf((r=n).x),Sf(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const t=e.measureViewportBox();if(!this.scroll?.wasRoot&&!this.path.some(jf)){const{scroll:e}=this.root;e&&(il(t.x,e.offset.x),il(t.y,e.offset.y))}return t}removeElementScroll(e){const t={x:{min:0,max:0},y:{min:0,max:0}};if(zd(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:o,options:a}=r;r!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&zd(t,e),il(t.x,o.offset.x),il(t.y,o.offset.y))}return t}applyTransform(e,t=!1,n){const r=n||{x:{min:0,max:0},y:{min:0,max:0}};zd(r,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(il(r.x,-n.scroll.offset.x),il(r.y,-n.scroll.offset.y)),Js(n.latestValues)&&cl(r,n.latestValues,n.layout?.layoutBox)}return Js(this.latestValues)&&cl(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};zd(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!Js(n.latestValues))continue;let r;n.instance&&(Xs(n.latestValues)&&n.updateSnapshot(),r=La(),zd(r,n.measurePageBox())),Yd(t,n.latestValues,n.snapshot?.layoutBox,r)}return Js(this.latestValues)&&Yd(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==hi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){const t=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=t.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:r,layoutId:o}=this.options;if(!this.layout||!r&&!o)return;this.resolvedRelativeTargetAt=hi.timestamp;const a=this.getClosestProjectingParent();var i,s,l,c;a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),i=this.target,s=this.relativeTarget,l=this.relativeParent.target,c=this.options.layoutAnchor||void 0,Lu(i.x,s.x,l.x,c?.x),Lu(i.y,s.y,l.y,c?.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):zd(this.target,this.layout.layoutBox),rl(this.target,this.targetDelta)):zd(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&a&&Boolean(a.resumingFrom)===Boolean(this.resumingFrom)&&!a.options.layoutScroll&&a.target&&1!==this.animationProgress?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Sd.value&&Kd.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!Xs(this.parent.latestValues)&&!qs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},zu(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),zd(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const e=this.getLead(),t=Boolean(this.resumingFrom)||this!==e;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===hi.timestamp&&(n=!1),n)return;const{layout:r,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!o)return;zd(this.layoutCorrected,this.layout.layoutBox);const a=this.treeScale.x,i=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let a,i;t.x=t.y=1;for(let s=0;s<o;s++){a=n[s],i=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&"contents"===o.props.style.display||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(il(e.x,-a.scroll.offset.x),il(e.y,-a.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,rl(e,i)),r&&Js(a.latestValues)&&cl(e,a.latestValues,a.layout?.layoutBox))}t.x<al&&t.x>ol&&(t.x=1),t.y<al&&t.y>ol&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,t),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:s}=e;s?(this.projectionDelta&&this.prevProjectionDelta?(Pd(this.prevProjectionDelta.x,this.projectionDelta.x),Pd(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Tu(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===i&&$d(this.projectionDelta.x,this.prevProjectionDelta.x)&&$d(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",s)),Sd.value&&Kd.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1,n){const r=this.snapshot,o=r?r.latestValues:{},a={...this.latestValues},i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},l=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,d=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(If));let f;this.animationProgress=0;const p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{const n=t/1e3,r=p?.(n);r?(i.x.translate=r.x,i.x.scale=Fs(e.x.scale,1,n),i.x.origin=e.x.origin,i.x.originPoint=e.x.originPoint,i.y.translate=r.y,i.y.scale=Fs(e.y.scale,1,n),i.y.origin=e.y.origin,i.y.originPoint=e.y.originPoint):(xf(i.x,e.x,n),xf(i.y,e.y,n)),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zu(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(e,t,n,r){Nf(e.x,t.x,n.x,r),Nf(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&function(e,t){return Gd(e.x,t.x)&&Gd(e.y,t.y)}(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||(f={x:{min:0,max:0},y:{min:0,max:0}}),zd(f,this.relativeTarget)),l&&(this.animationValues=a,function(e,t,n,r,o,a){o?(e.opacity=Fs(0,n.opacity??1,Ad(r)),e.opacityExit=Fs(t.opacity??1,0,Td(r))):a&&(e.opacity=Fs(t.opacity??1,n.opacity??1,r));for(let o=0;o<Dd;o++){const a=Rs[o];let i=Cd(t,a),s=Cd(n,a);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||kd(i)===kd(s)?(e[a]=Math.max(Fs(jd(i),jd(s),r),0),(da.test(s)||da.test(i))&&(e[a]+="%")):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Fs(t.rotate||0,n.rotate||0,r))}(a,o,this.latestValues,n,d,u)),r&&void 0!==r.rotate&&(this.animationValues||(this.animationValues=a),this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(mi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pi.update(()=>{Nd.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ss(0)),this.motionValue.jump(0,!1),this.currentAnimation=function(e,t,n){const r=Oa(e)?e:ss(e);return r.start(fu("",r,[0,1e3],n)),r.animation}(this.motionValue,0,{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Df(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Cu(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Cu(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}zd(t,n),cl(t,o),Tu(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Xd),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){const{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&nf("z",e,r,this.animationValues);for(let t=0;t<ef.length;t++)nf(`rotate${ef[t]}`,e,r,this.animationValues),nf(`skew${ef[t]}`,e,r,this.animationValues);e.render();for(const t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(e.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.visibility="",e.opacity="",e.pointerEvents=Dl(t?.pointerEvents)||"",void(e.transform=n?n(this.latestValues,""):"none");const r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target)return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Dl(t?.pointerEvents)||""),void(this.hasProjected&&!Js(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1));e.visibility="";const o=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=function(e,t,n){let r="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=n?.z||0;if((o||a||i)&&(r=`translate3d(${o}px, ${a}px, ${i}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,pathRotation:o,rotateX:a,rotateY:i,skewX:s,skewY:l}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotate(${o}deg) `),a&&(r+=`rotateX(${a}deg) `),i&&(r+=`rotateY(${i}deg) `),s&&(r+=`skewX(${s}deg) `),l&&(r+=`skewY(${l}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return 1===s&&1===l||(r+=`scale(${s}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,o);n&&(a=n(o,a)),e.transform=a;const{x:i,y:s}=this.projectionDelta;e.transformOrigin=`${100*i.origin}% ${100*s.origin}% 0`,r.animationValues?e.opacity=r===this?o.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:e.opacity=r===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0;for(const t in Zs){if(void 0===o[t])continue;const{correct:n,applyTo:i,isCSSVariable:s}=Zs[t],l="none"===a?o[t]:n(o[t],r);if(i){const t=i.length;for(let n=0;n<t;n++)e[i[n]]=l}else s?this.options.visualElement.renderState.vars[t]=l:e[t]=l}this.options.layoutId&&(e.pointerEvents=r===this?Dl(t?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(df),this.root.sharedNodes.clear()}}}function af(e){e.updateLayout()}function sf(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,a=t.source!==e.layout.source;if("size"===o)ku(e=>{const r=a?t.measuredBox[e]:t.layoutBox[e],o=Cu(r);r.min=n[e].min,r.max=r.min+o});else if("x"===o||"y"===o){const e="x"===o?"y":"x";Od(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Df(o,t.layoutBox,n)&&ku(r=>{const o=a?t.measuredBox[r]:t.layoutBox[r],i=Cu(n[r]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Tu(i,n,t.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?Tu(s,e.applyTransform(r,!0),t.measuredBox):Tu(s,n,t.layoutBox);const l=!Vd(i);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:a}=r;if(o&&a){const i=e.options.layoutAnchor||void 0,s={x:{min:0,max:0},y:{min:0,max:0}};zu(s,t.layoutBox,o.layoutBox,i);const l={x:{min:0,max:0},y:{min:0,max:0}};zu(l,n,a.layoutBox,i),Hd(s,l)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function lf(e){Sd.value&&Kd.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function cf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function uf(e){e.clearSnapshot()}function df(e){e.clearMeasurements()}function ff(e){e.isLayoutDirty=!0,e.updateLayout()}function pf(e){e.isLayoutDirty=!1}function mf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function hf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function gf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function wf(e){e.resolveTargetDelta()}function yf(e){e.calcProjection()}function bf(e){e.resetSkewAndRotation()}function vf(e){e.removeLeadSnapshot()}function xf(e,t,n){e.translate=Fs(t.translate,0,n),e.scale=Fs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Nf(e,t,n,r){e.min=Fs(t.min,n.min,r),e.max=Fs(t.max,n.max,r)}function If(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Mf={duration:.45,ease:[.4,0,.1,1]},Ef=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),_f=Ef("applewebkit/")&&!Ef("chrome/")?Math.round:ci;function Sf(e){e.min=_f(e.min),e.max=_f(e.max)}function Df(e,t,n){return"position"===e||"preserve-aspect"===e&&!function(e,t){return Math.abs(e-t)<=.2}(Qd(t),Qd(n))}function jf(e){return e!==e.root&&e.scroll?.wasRoot}const kf=of({attachResizeListener:(e,t)=>Uu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Cf={current:void 0},Af=of({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cf.current){const e=new kf({});e.mount(window),e.setOptions({layoutScroll:!0}),Cf.current=e}return Cf.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Tf={pan:{Feature:class extends $l{constructor(){super(...arguments),this.removePointerDownListener=ci}onPointerDown(e){this.session=new ad(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nd(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:xd(e),onStart:xd(t),onMove:xd(n),onEnd:(e,t)=>{delete this.session,r&&pi.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=td(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends $l{constructor(e){super(e),this.removeGroupControls=ci,this.removeListeners=ci,this.controls=new yd(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ci}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Af,MeasureLayout:_d}};function Lf(e,t){const n=Yu(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Of(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&pi.postRender(()=>o(t,ed(t)))}function zf(e){return Bu(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const Pf=(e,t)=>!!t&&(e===t||Pf(e,t.parentElement)),Rf=new WeakSet;function Uf(e){return t=>{"Enter"===t.key&&e(t)}}function Bf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Ff(e){return Ku(e)&&!ju()}const Yf=new WeakSet;function Zf(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const o=r["onTap"+("End"===n?"":n)];o&&pi.postRender(()=>o(t,ed(t)))}const Vf=new WeakMap,Gf=new WeakMap,Wf=e=>{const t=Vf.get(e.target);t&&t(e)},Hf=e=>{e.forEach(Wf)};const Qf={some:0,all:1},$f={inView:{Feature:class extends $l{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Qf[r]};this.stopObserver=function(e,t,n){const r=function({root:e,...t}){const n=e||document;Gf.has(n)||Gf.set(n,{});const r=Gf.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Hf,{root:e,...t})),r[o]}(t);return Vf.set(e,n),r.observe(e),()=>{Vf.delete(e),r.unobserve(e)}}(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends $l{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=function(e,t,n={}){const[r,o,a]=Lf(e,n),i=e=>{const r=e.currentTarget;if(!Ff(e))return;if(Yf.has(e))return;Rf.add(r),n.stopPropagation&&Yf.add(e);const a=t(r,e),i={...o,capture:!0},s=(e,t)=>{window.removeEventListener("pointerup",l,i),window.removeEventListener("pointercancel",c,i),Rf.has(r)&&Rf.delete(r),Ff(e)&&"function"==typeof a&&a(e,{success:t})},l=e=>{s(e,r===window||r===document||n.useGlobalTarget||Pf(r,e.target))},c=e=>{s(e,!1)};window.addEventListener("pointerup",l,i),window.addEventListener("pointercancel",c,i)};return r.forEach(e=>{var t;(n.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),zf(e)&&(e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Uf(()=>{if(Rf.has(n))return;Bf(n,"down");const e=Uf(()=>{Bf(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Bf(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,o)),t=e,Pu.has(t.tagName)||!0===t.isContentEditable||e.hasAttribute("tabindex")||(e.tabIndex=0))}),a}(e,(e,t)=>(Zf(this.node,t,"Start"),(e,{success:t})=>Zf(this.node,e,t?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends $l{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=oc(Uu(this.node.current,"focus",()=>this.onFocus()),Uu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends $l{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,a]=Lf(e,n);return r.forEach(e=>{let n,r=!1,a=!1;const i=t=>{n&&(n(t),n=void 0),e.removeEventListener("pointerleave",l)},s=e=>{r=!1,window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),a&&(a=!1,i(e))},l=e=>{"touch"!==e.pointerType&&(r?a=!0:i(e))};e.addEventListener("pointerenter",r=>{if("touch"===r.pointerType||ju())return;a=!1;const i=t(e,r);"function"==typeof i&&(n=i,e.addEventListener("pointerleave",l,o))},o),e.addEventListener("pointerdown",()=>{r=!0,window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",s,o)},o)}),a}(e,(e,t)=>(Of(this.node,t,"Start"),e=>Of(this.node,e,"End"))))}unmount(){}}}},Xf=Ql({...Su,...$f,...Tf,layout:{ProjectionNode:Af,MeasureLayout:_d}},ml),Jf=(0,p.createContext)({}),qf=Jf.Provider,Kf=()=>(0,p.useContext)(Jf),ep=(e,t,n)=>{if(!e||!t)return{open:()=>({}),closed:()=>({})};const r=e?.getBoundingClientRect(),o=t?.getBoundingClientRect(),a=n?r?.x-o?.x+r?.width/2:o?.width-(o?.right-r?.x)+r?.width/2,i=r?.y-o?.y+r?.height/2;return{open:(e=1e3)=>({clipPath:`circle(${2*e+200}px at ${a}px ${i}px)`,background:"rgb(255, 255, 255, 1)",transition:{type:"spring",stiffness:20,restDelta:2,background:{duration:0}}}),closed:{clipPath:`circle(${r?.width/2}px at ${a}px ${i}px)`,background:"rgb(255, 255, 255, 0)",transition:{delay:.5,type:"spring",stiffness:400,damping:40,background:{duration:0,delay:1e3}}}}},tp=e=>(0,C.jsx)(Xf.path,{className:"stroke-icon-primary",fill:"transparent",strokeWidth:"3",strokeLinecap:"round",...e}),np=({className:e})=>{const{toggleOpen:t,setTriggerRef:n,isOpen:r}=Kf();return(0,C.jsx)(Ro,{ref:n,className:Se("relative z-[1] rounded-full hover:shadow-sm focus:[box-shadow:none] pointer-events-auto bg-background-primary",e),variant:"ghost",size:"xs",onClick:t,"aria-label":"Toggle menu","aria-expanded":r,icon:(0,C.jsxs)(Xf.svg,{className:"shrink-0 stroke-icon-primary",width:"23",height:"23",variants:{open:{viewBox:"0 0 20 20"},closed:{viewBox:"0 0 23 18"}},children:[(0,C.jsx)(tp,{variants:{closed:{d:"M 2 2.5 L 20 2.5"},open:{d:"M 3 16.5 L 17 2.5"}}}),(0,C.jsx)(tp,{d:"M 2 9.423 L 20 9.423",variants:{closed:{opacity:1},open:{opacity:0}},transition:{duration:.1}}),(0,C.jsx)(tp,{variants:{closed:{d:"M 2 16.346 L 20 16.346"},open:{d:"M 3 2.5 L 17 16.346"}}})]})})},rp={open:{transition:{staggerChildren:.07,delayChildren:.2}},closed:{transition:{staggerChildren:.05,staggerDirection:-1}}},op=({tag:e="a",active:t,icon:n,iconPosition:r="left",className:o,children:a,...i})=>{let s=null,l=null;const c=n&&(0,p.isValidElement)(n)?(0,p.cloneElement)(n,{key:"left-icon",className:Se("size-5",t?"text-brand-800":"text-icon-secondary",n.props?.className??"")}):null;switch(r){case"left":s=c;break;case"right":l=c;break;default:s=null,l=null}return(0,C.jsx)(ip,{children:(0,C.jsxs)(e,{className:Se("w-full no-underline hover:no-underline text-text-primary text-lg font-medium flex items-center gap-2 px-2.5 py-1.5 rounded-md hover:bg-background-secondary hover:text-text-primary focus:outline-none focus:shadow-none transition ease-in-out duration-150",t?"text-text-primary bg-background-secondary":"text-text-secondary",o),...i,children:[!!s&&s,(0,C.jsx)("span",{className:"contents",children:a}),!!l&&l]})})},ap={open:{y:0,opacity:1,transition:{y:{stiffness:1e3,velocity:-100}}},closed:{y:50,opacity:0,transition:{y:{stiffness:1e3}}}},ip=({children:e})=>(0,C.jsx)(Xf.li,{className:"m-0 p-0 flex items-center justify-start w-full",variants:ap,whileHover:{scale:1.05},whileTap:{scale:.95},children:e}),sp=({children:e,className:t})=>{const{triggerRef:n,triggerOnRight:r,triggerOnLeft:o}=Kf(),[a,i]=(0,p.useState)(null);return n?(0,C.jsxs)(Xf.div,{ref:i,className:Se("absolute top-0 bottom-0 w-80 h-screen",r?"right-0":"left-0",t),children:[a&&(0,C.jsx)(Xf.div,{className:Se("bg-background-primary shadow-lg absolute top-0 bottom-0 w-80 border-y-0 border-l-0 border-r border-solid border-border-subtle",r?"right-0":"left-0"),variants:ep(n,a,o??!1)}),(0,C.jsx)(Xf.ul,{variants:rp,className:Se("relative mt-14 mb-0 w-full px-5 pb-5 pt-2 flex flex-col items-start justify-start gap-0.5",t),children:e})]}):null},lp=({className:e,children:t})=>{const[n,r]=function(...e){const t=(0,p.useRef)(0),[n,r]=(0,p.useState)(e[t.current]),o=(0,p.useCallback)(n=>{t.current="number"!=typeof n?((e,t,n)=>{const r=t-0;return((n-0)%r+r)%r+0})(0,e.length,t.current+1):n,r(e[t.current])},[e.length,...e]);return[n,o]}(!1,!0),[o,a]=(0,p.useState)(null),i=(0,p.useRef)(null),{height:s}=(e=>{const t=(0,p.useRef)({width:0,height:0});return(0,p.useEffect)(()=>{e.current&&(t.current.width=e.current.offsetWidth,t.current.height=e.current.offsetHeight)},[]),t.current})(i),{isRight:l=!1,isLeft:c=!0}=(e=>{if(!e)return{error:"Element not found."};const t=e.getBoundingClientRect(),n=window.innerWidth,r=n/2,o=t.right<r,a=t.left>r;return{isLeft:o,isRight:a,isCenter:!o&&!a,elementRect:{left:t.left,right:t.right,width:t.width},viewport:{width:n,center:r}}})(o);return(0,C.jsx)(qf,{value:{isOpen:n,toggleOpen:r,setTriggerRef:e=>{(0,p.startTransition)(()=>{a(e)})},triggerRef:o,triggerOnRight:l,triggerOnLeft:c},children:(0,C.jsx)("div",{className:Se("size-6 z-[1]",e),children:(0,C.jsx)(Xf.nav,{className:"h-full",initial:!1,animate:n?"open":"closed",custom:s,variants:{open:{pointerEvents:"auto"},closed:{pointerEvents:"none"}},ref:i,children:t})})})};lp.displayName="HamburgerMenu",np.displayName="HamburgerMenu.Toggle",sp.displayName="HamburgerMenu.Options",op.displayName="HamburgerMenu.Option",lp.Options=sp,lp.Option=op,lp.Toggle=np;const cp=(0,p.forwardRef)(({children:e=null,tag:t="label",size:n="sm",className:r="",variant:o="neutral",required:a=!1,...i},s)=>{if(!e)return null;let l="";return a&&(l="after:content-['*'] after:text-field-required after:ml-0.5"),(0,C.jsx)(t,{ref:s,className:Se("font-medium text-field-label flex items-center gap-0.5",{xs:"text-xs [&>*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[n],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[o],l,{neutral:"",help:"font-normal",error:"font-normal",disabled:""}?.[o],r),...i,children:e})});cp.displayName="Label";var up=n(6942),dp=n.n(up);const fp=n.p+"images/cartflows-symbol.4a28363b.png";var pp=function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(i,s)}l((r=r.apply(e,t||[])).next())})};const mp={rssFeedURL:"",selector:"",uniqueKey:"",loaderIcon:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">\n\t<circle cx="50" cy="50" fill="none" stroke="#9f9f9f" stroke-width="10" r="35" stroke-dasharray="164.93361431346415 56.97787143782138">\n\t\t<animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"></animateTransform>\n\t</circle>\n\t</svg>',viewAll:{link:"",label:"View All"},triggerButton:{label:"",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.61703 13.1998C8.04294 13.1503 7.46192 13.125 6.875 13.125H6.25C4.17893 13.125 2.5 11.4461 2.5 9.375C2.5 7.30393 4.17893 5.625 6.25 5.625H6.875C7.46192 5.625 8.04294 5.59972 8.61703 5.55018M8.61703 13.1998C8.82774 14.0012 9.1031 14.7764 9.43719 15.5195C9.64341 15.9782 9.48685 16.5273 9.05134 16.7787L8.50441 17.0945C8.04492 17.3598 7.45466 17.1921 7.23201 16.7106C6.70983 15.5811 6.30451 14.3866 6.03155 13.1425M8.61703 13.1998C8.29598 11.9787 8.125 10.6968 8.125 9.375C8.125 8.05316 8.29598 6.77125 8.61703 5.55018M8.61703 13.1998C11.25 13.427 13.737 14.1643 15.9789 15.3124M8.61703 5.55018C11.25 5.323 13.737 4.58569 15.9789 3.43757M15.9789 3.43757C15.8808 3.12162 15.7751 2.80903 15.662 2.5M15.9789 3.43757C16.4247 4.87356 16.7131 6.37885 16.8238 7.93326M15.9789 15.3124C15.8808 15.6284 15.7751 15.941 15.662 16.25M15.9789 15.3124C16.4247 13.8764 16.7131 12.3711 16.8238 10.8167M16.8238 7.93326C17.237 8.2772 17.5 8.79539 17.5 9.375C17.5 9.95461 17.237 10.4728 16.8238 10.8167M16.8238 7.93326C16.8578 8.40942 16.875 8.8902 16.875 9.375C16.875 9.8598 16.8578 10.3406 16.8238 10.8167" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',beforeBtn:"",afterBtn:"",className:"",onClick:()=>{}},notification:{setLastPostUnixTime:null,getLastPostUnixTime:null},flyout:{title:"What's New?",innerContent:{titleLink:!0,additionalClasses:[]},excerpt:{wordLimit:500,moreSymbol:"&hellip;",readMore:{label:"Read More",className:""}},className:"",closeOnEsc:!0,closeOnOverlayClick:!0,closeBtnIcon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 18L18 6M6 6L18 18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',formatDate:null,onOpen:()=>{},onClose:()=>{},onReady:()=>{}}};class hp{constructor(e){this.rssFeedURLs=[],this.lastPostUnixTime=0,this.multiLastPostUnixTime={},this.notificationsCount=0,this.multiNotificationCount={},this.hasNewFeeds=!1,this.multiHasNewFeeds={},this.validateArgs(e),this.parseDefaults(e),this.setElement(),this.getElement()?(this.setID(),this.setRSSFeedURLs(),gp.setInstanceID(this.getID()),this.RSS_Fetch_Instance=new yp(this),this.RSS_View_Instance=new bp(this),this.setNotificationsCount(),this.setTriggers()):console.warn("WNR: Cannot find element with",this.getArgs().selector)}validateArgs(e){["rssFeedURL","selector","uniqueKey"].forEach(t=>{if(!e[t])throw new Error(`${t} is a required argument. It cannot be empty or undefined.`);if("rssFeedURL"===t){const n=e[t];Array.isArray(n)&&n.forEach(e=>{if(!(null==e?void 0:e.key))throw new Error(`The parameter "key" is required for "${t}" parameter in multi-feed mode.`);if(e.key.includes(" "))throw new Error(`The parameter "key" cannot have spaces for "${t}" parameter in multi-feed mode. Ref Key: "${e.key}"`)})}})}parseDefaults(e){var t,n;this.args=Object.assign(Object.assign(Object.assign({},mp),e),{viewAll:Object.assign(Object.assign({},mp.viewAll),null==e?void 0:e.viewAll),triggerButton:Object.assign(Object.assign({},mp.triggerButton),null==e?void 0:e.triggerButton),flyout:Object.assign(Object.assign(Object.assign({},mp.flyout),null==e?void 0:e.flyout),{innerContent:Object.assign(Object.assign({},mp.flyout.innerContent),null===(t=null==e?void 0:e.flyout)||void 0===t?void 0:t.innerContent),excerpt:Object.assign(Object.assign({},mp.flyout.excerpt),null===(n=null==e?void 0:e.flyout)||void 0===n?void 0:n.excerpt)})})}getArgs(){return this.args}setElement(){this.element=document.querySelector(this.args.selector)}getElement(){return this.element}setID(){const e=[this.getArgs().selector,this.getArgs().uniqueKey],t=this.getArgs().rssFeedURL;Array.isArray(t)?t.forEach(t=>{e.push(t.key)}):e.push(t),this.ID=btoa(e.join("-")).slice(-12).replace(/=/g,"")+"-"+this.getArgs().uniqueKey}isMultiFeedRSS(){return"string"!=typeof this.getArgs().rssFeedURL}setRSSFeedURLs(){const e=this.getArgs().rssFeedURL;this.isMultiFeedRSS()?Array.isArray(e)&&e.forEach(e=>{this.rssFeedURLs.push(e)}):this.rssFeedURLs.push({key:null,label:"",url:e.toString()})}getRSSFeedURLs(){return this.rssFeedURLs}getID(){return this.ID}setNotificationsCount(){return pp(this,void 0,void 0,function*(){yield Promise.all(this.getRSSFeedURLs().map(e=>pp(this,[e],void 0,function*({key:e}){let t=0;t="function"==typeof this.getArgs().notification.getLastPostUnixTime?yield this.getArgs().notification.getLastPostUnixTime(e,this):gp.getLastPostUnixTime(e),this.isMultiFeedRSS()?this.multiLastPostUnixTime[e]=+t:this.lastPostUnixTime=+t}))),yield this.RSS_Fetch_Instance.fetchData().then(e=>{Object.keys(e).forEach(t=>{const n=e[t];if(!n.length)return;this.multiNotificationCount[t]=0;const r=+n[0].date,o=this.isMultiFeedRSS()?this.multiLastPostUnixTime[t]:this.lastPostUnixTime;r>o&&(n.forEach(e=>{e.date>o&&(this.isMultiFeedRSS()&&(this.multiNotificationCount[t]++,this.multiHasNewFeeds[t]=!0),this.notificationsCount++,this.hasNewFeeds=!0)}),this.RSS_View_Instance.setNotification(this.notificationsCount))})}).catch(console.error)})}getNotificationsCount(){return this.notificationsCount}setTriggers(){const e=document.getElementById(this.RSS_View_Instance.getTriggerButtonID()),t=document.getElementById(this.RSS_View_Instance.getFlyoutID()),n=t.querySelector(".whats-new-rss-flyout-inner-content"),r=document.getElementById(this.RSS_View_Instance.getFlyoutCloseBtnID()),o=document.getElementById(this.RSS_View_Instance.getFlyoutMultiFeedNavID()),a=e=>{this.RSS_Fetch_Instance.fetchData().then(r=>{n.innerHTML="";const o=r[e];if(!o.length)return;const a=+o[0].date,i=this.isMultiFeedRSS()?this.multiLastPostUnixTime[e]:this.lastPostUnixTime;o.forEach(t=>{const r=!!i&&t.date>i,o=this.getArgs().flyout.innerContent.titleLink?`<a href="${t.postLink}" target="_blank">\n\t\t\t\t\t\t\t\t<h2>${t.title}</h2>\n\t\t\t\t\t\t\t</a>`:`<h2>${t.title}</h2>`,a=`\n\t\t\t\t\t\t\t\t<div class="rss-content-header">\n\t\t\t\t\t\t\t\t\t<p>${this.RSS_View_Instance.formatDate(new Date(t.date))}</p>\n\t\t\t\t\t\t\t\t\t${o}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t${this.RSS_View_Instance.createExcerpt(t.description,t.postLink,this.getArgs().flyout.excerpt)}\n\t\t\t\t\t\t\t\t${this.RSS_View_Instance.listChildrenPosts(t.children)}\n\t\t\t\t\t\t\t`,s=this.getArgs().flyout.innerContent.additionalClasses;e&&s.push("`inner-content-item-feed-key-${key}`"),n.innerHTML+=this.RSS_View_Instance.innerContentWrapper(a,r,s.join(" "))}),this.getArgs().viewAll.link&&(n.innerHTML+=this.RSS_View_Instance.innerContentWrapper(`\n\t\t\t\t\t\t\t<a href="${this.getArgs().viewAll.link}" class="button view-all">${this.getArgs().viewAll.label}</a>\n\t\t\t\t\t\t\t`)),this.RSS_View_Instance.setIsLoading(!1),t.classList.add("ready"),this.getArgs().flyout.onReady(this),t.focus(),this.isMultiFeedRSS()||(this.lastPostUnixTime=a,this.hasNewFeeds&&("function"==typeof this.getArgs().notification.setLastPostUnixTime?this.getArgs().notification.setLastPostUnixTime(a,e):gp.setLastPostUnixTime(a,e)))}).catch(console.error)};e.addEventListener("click",e=>{e.preventDefault();const n=window.innerWidth-document.documentElement.clientWidth;if(this.getArgs().triggerButton.onClick(this),this.RSS_View_Instance.setIsLoading(!0),t.removeAttribute("style"),t.classList.remove("closed"),t.classList.add("open"),document.body.classList.add("whats-new-rss-is-active"),n){const e=document.getElementById("whats-new-rss-styles");(null==e?void 0:e.sheet)&&e.sheet.insertRule(`.whats-new-rss-is-active { background-color: yellow; padding-right: ${n}px; }`,e.sheet.cssRules.length)}if(this.getArgs().flyout.onOpen(this),!this.isMultiFeedRSS())return void a(null);const r=o.querySelectorAll("button");r.forEach(e=>{this.RSS_View_Instance.setMultiFeedTabNotificationCount(e.dataset.feedKey,this.multiNotificationCount[e.dataset.feedKey]),e.addEventListener("click",t=>{t.preventDefault();const n=e.dataset.feedKey;this.multiNotificationCount[n]=0,this.RSS_Fetch_Instance.fetchData().then(e=>{const t=e[n][0].date;this.multiLastPostUnixTime[n]=t,!0===this.multiHasNewFeeds[n]&&("function"==typeof this.getArgs().notification.setLastPostUnixTime?this.getArgs().notification.setLastPostUnixTime(t,n):gp.setLastPostUnixTime(t,n)),this.multiHasNewFeeds[n]=!1}).catch(console.error),r.forEach(e=>{e.classList.remove("selected");const t=e.dataset.feedKey,r=`.inner-content-item-feed-key-${t}`;document.querySelectorAll(r).forEach(e=>{n!==t?e.classList.add("hidden"):e.classList.remove("hidden")})}),e.classList.add("selected"),a(n)})}),r[0].click()});const i=()=>{t.classList.add("closed"),t.classList.remove("open"),t.classList.remove("ready"),document.body.classList.remove("whats-new-rss-is-active"),this.isMultiFeedRSS()?this.RSS_View_Instance.setNotification(Object.values(this.multiNotificationCount).filter(Boolean).length):(this.hasNewFeeds=!1,this.RSS_View_Instance.setNotification(!1)),n.innerHTML="",this.getArgs().flyout.onClose(this),e.focus()};this.getArgs().flyout.closeOnEsc&&document.addEventListener("keydown",function(e){"Escape"===e.key&&t.classList.contains("open")&&i()}),this.getArgs().flyout.closeOnOverlayClick&&t.querySelector(".whats-new-rss-flyout-overlay").addEventListener("click",i),r.addEventListener("click",i)}}class gp{static setInstanceID(e){this.instanceID||(this.instanceID=e)}static prefixer(e,t=""){if(!this.instanceID)throw new Error("Instance ID not set.");return t?`${this.keys[e]}-${this.instanceID}-${t}`:`${this.keys[e]}-${this.instanceID}`}static _setDataExpiry(e=""){const t=(new Date).getTime()+864e5;sessionStorage.setItem(this.prefixer("SESSION_DATA_EXPIRY",e),JSON.stringify(t))}static _isDataExpired(e=""){const t=this.prefixer("SESSION_DATA_EXPIRY",e),n=window.sessionStorage.getItem(t);if(!n)return!0;const r=JSON.parse(n);return(new Date).getTime()>r&&(window.sessionStorage.removeItem(t),!0)}static setSessionData(e,t=""){return this._setDataExpiry(t),window.sessionStorage.setItem(this.prefixer("SESSION",t),e)}static getSessionData(e=""){return this._isDataExpired(e)?"{}":window.sessionStorage.getItem(this.prefixer("SESSION",e))}static setLastPostUnixTime(e,t=""){return window.localStorage.setItem(this.prefixer("LAST_LATEST_POST",t),e.toString())}static getLastPostUnixTime(e=""){return+window.localStorage.getItem(this.prefixer("LAST_LATEST_POST",e))}}gp.keys={SESSION_DATA_EXPIRY:"whats-new-cache-expiry",LAST_LATEST_POST:"whats-new-last-unixtime",SESSION:"whats-new-cache"};class yp{constructor(e){this.data={},this.RSS=e,this.RSS.getRSSFeedURLs().forEach(e=>{const t=JSON.parse(gp.getSessionData(e.key));t&&t.length&&(this.data[e.key]=t)})}fetchData(){return pp(this,void 0,void 0,function*(){if(Object.keys(this.data).length)return this.data;const e=this.RSS.getRSSFeedURLs().map(e=>pp(this,void 0,void 0,function*(){this.data[e.key]=[];const t=yield fetch(e.url);let n=yield t.text();n=n.replace(/&raquo;/g,"&amp;raquo;"),(new DOMParser).parseFromString(n,"text/xml").querySelectorAll("item").forEach(t=>{var n;const r=t.querySelector("title").textContent,o=t.querySelector("link").textContent,a=t.querySelector("content\\:encoded, encoded"),i=a?a.textContent:"",s=t.querySelector("pubDate").innerHTML;this.data[e.key].push({title:r,date:s?+new Date(s):null,postLink:o,description:i.replace(/<a\b((?:(?!target=)[^>])*)>/g,'<a$1 target="_blank">').replace(/<p>\s*<\/p>/g,""),children:JSON.parse((null===(n=t.querySelector("children"))||void 0===n?void 0:n.innerHTML)||"{}")})}),gp.setSessionData(JSON.stringify(this.data[e.key]),e.key)}));return yield Promise.all(e),this.data})}}class bp{constructor(e){this.RSS=e,this.createTriggerButton(),this.createFlyOut()}getTriggerButtonID(){return`whats-new-rss-btn-${this.RSS.getID()}`}getFlyoutID(){return`whats-new-rss-flyout-${this.RSS.getID()}`}getFlyoutCloseBtnID(){return`whats-new-rss-flyout-close-${this.RSS.getID()}`}getFlyoutMultiFeedNavID(){return`whats-new-rss-flyout-multi-feed-nav-${this.RSS.getID()}`}setIsLoading(e=!1){const t=document.getElementById(this.getFlyoutID());e?t.classList.add("is-loading"):t.classList.remove("is-loading")}setNotification(e){const t=document.querySelector(`#${this.getTriggerButtonID()} .whats-new-rss-notification-badge`);e?(this.RSS.isMultiFeedRSS()?(t.innerHTML="",t.classList.add("is-multi-feed")):t.innerHTML=e>9?"9+":e.toString(),t.classList.remove("hide")):t.classList.add("hide")}createTriggerButton(){let e="";const t=this.RSS.getArgs().triggerButton.label;e=t?`\n\t\t\t${this.RSS.getArgs().triggerButton.beforeBtn}\n\t\t\t<a class="whats-new-rss-trigger-button has-label" id="${this.getTriggerButtonID()}">\n\t\t\t\t<div class="icon-badge">\n\t\t\t\t\t${this.RSS.getArgs().triggerButton.icon}\n\t\t\t\t\t<div class="whats-new-rss-notification-badge hide">0</div>\n\t\t\t\t</div>\n\t\t\t\t${t}\n\t\t\t</a>\n\t\t\t${this.RSS.getArgs().triggerButton.afterBtn}\n\t\t\t`:`\n\t\t\t${this.RSS.getArgs().triggerButton.beforeBtn}\n\t\t\t<a class="whats-new-rss-trigger-button" id="${this.getTriggerButtonID()}">\n\t\t\t\t${this.RSS.getArgs().triggerButton.icon}\n\t\t\t\t<div class="whats-new-rss-notification-badge hide">0</div>\n\t\t\t</a>\n\t\t\t${this.RSS.getArgs().triggerButton.afterBtn}\n\t\t\t`,this.RSS.getElement().innerHTML+=e}createFlyOut(){const e=["whats-new-rss-flyout","closed"];this.RSS.getArgs().flyout.className&&e.push(this.RSS.getArgs().flyout.className);let t=[];this.RSS.isMultiFeedRSS()&&(t.push(`<nav id="${this.getFlyoutMultiFeedNavID()}" class="whats-new-rss-multi-feed-nav">`),this.RSS.getRSSFeedURLs().forEach(e=>{t.push(`<button type="button" data-feed-key="${e.key}">\n\t\t\t\t\t\t${e.label}\n\t\t\t\t\t\t<div class="new-notification-count"></div>\n\t\t\t\t\t</button>\n\t\t\t\t\t`)}),t.push("</nav>"));const n=document.createElement("div");n.setAttribute("id",this.getFlyoutID()),n.setAttribute("class",e.join(" ")),n.setAttribute("role","dialog"),n.setAttribute("style","visibility:hidden"),n.innerHTML=`\n\t\t<div class="whats-new-rss-flyout-contents">\n\n\t\t\t<div class="whats-new-rss-flyout-inner-header">\n\n\t\t\t\t<div class="whats-new-rss-flyout-inner-header__title-icon-wrapper">\n\t\t\t\t\t<h3>${this.RSS.getArgs().flyout.title}</h3>\n\n\t\t\t\t\t<span class="whats-new-rss-flyout-inner-header__loading-icon">\n\t\t\t\t\t${this.RSS.getArgs().loaderIcon}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\n\t\t\t\t<button type="button" id="${this.getFlyoutCloseBtnID()}">${this.RSS.getArgs().flyout.closeBtnIcon}</button>\n\t\t\t</div>\n\n\t\t\t${t.join("")}\n\n\t\t\t<div class="whats-new-rss-flyout-inner-content">\n\t\t\t\t<div class="skeleton-container">\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t</div>\n\n\t\t<div class="whats-new-rss-flyout-overlay"></div>\n\t\t`,document.body.appendChild(n)}setMultiFeedTabNotificationCount(e,t=0){const n=document.querySelector(`#${this.getFlyoutMultiFeedNavID()} button[data-feed-key="${e}"]`);if(!n)return;const r=n.querySelector(".new-notification-count");if(t){const e=t>9?"9+":t;r.innerHTML=e.toString()}else r.innerHTML=""}innerContentWrapper(e,t=!1,n=""){const r=["whats-new-rss-flyout-inner-content-item"];return t&&r.push("rss-new-post"),n&&r.push(n),`\n\t\t<div class="${r.join(" ")}">\n\t\t\t${t?'<small class="new-post-badge">New ✨</small>':""}\n\t\t\t${e}\n\t\t</div>\n\t\t`}createExcerpt(e,t,n){const{wordLimit:r,moreSymbol:o,readMore:a}=n;if(!r)return e;const i=e.replace(/<[^>]*>/g,"").split(/\s+/);let s=i.slice(0,r).join(" ");return o&&(s+=o),r>i.length?e:t&&(null==a?void 0:a.label)?`<p>${s} <a href="${t}" target="_blank" class="${a.className}">${a.label}</a></p>`:`<p>${s}</p>`}listChildrenPosts(e){const t=Object.values(e);if(!t.length)return"";const n=document.createElement("details"),r=document.createElement("summary"),o=document.createElement("div");return t.forEach(e=>{const t=(new DOMParser).parseFromString(e.post_content,"text/html"),n=document.createElement("div");n.classList.add("sub-version-item"),n.innerHTML=`\n\t\t\t\t<div class="sub-version-header">\n\t\t\t\t\t<h4 class="sub-version-title">${e.post_title}</h4>\n\t\t\t\t\t<span class="sub-version-date">${this.formatDate(new Date(e.post_date))}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class="sub-version-content">${t.documentElement.textContent}</div>\n\t\t\t`,o.appendChild(n)}),r.innerHTML='<p class="text-see-more">See More</p><p class="text-see-less">See Less</p>',n.appendChild(r),n.appendChild(o),o.classList.add("sub-version-items-wrapper"),n.classList.add("whats-new-rss-sub-version-details"),n.outerHTML}formatDate(e){if("function"==typeof this.RSS.getArgs().flyout.formatDate)return this.RSS.getArgs().flyout.formatDate(e);const t=new Date,n=e.getTime(),r=t.getTime()-n,o=36e5,a=24*o,i=7*a,s=30*a;if(r<6e4)return"Just now";if(r<o){const e=Math.floor(r/6e4);return`${e} minute${e>1?"s":""} ago`}if(r<a){const e=Math.floor(r/o);return`${e} hour${e>1?"s":""} ago`}if(r<i){const e=Math.floor(r/a);return`${e} day${e>1?"s":""} ago`}if(r<s){const e=Math.floor(r/i);return`${e} week${e>1?"s":""} ago`}{const e=Math.floor(r/s);return`${e} month${e>1?"s":""} ago`}}}const vp=function(){const e=cartflows_admin?.whats_new_rss_feed;return function({selector:e,...t}){const n=(0,p.useRef)(null);(0,p.useEffect)(()=>{var r;return async function(){const e="whats-new-rss-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=await async function(){return'@import url(https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap);.whats-new-rss-is-active{overflow:hidden}.whats-new-rss-trigger-button{display:flex;align-items:center;position:relative;width:auto;padding:0!important;cursor:pointer}.whats-new-rss-trigger-button.has-label{align-items:end;gap:10px}.whats-new-rss-trigger-button.has-label .icon-badge{position:relative;line-height:1}.whats-new-rss-trigger-button.has-label .icon-badge .whats-new-rss-notification-badge{top:-12px;right:-10px}.whats-new-rss-trigger-button .whats-new-rss-notification-badge{position:absolute;top:-8px;right:-9px;width:18px;height:18px;font-size:10px;line-height:20px;text-align:center;border-radius:10px;color:#fff;background:#ff580e;display:flex;align-items:center;justify-content:center;transition:transform .2s ease-in-out}.whats-new-rss-trigger-button .whats-new-rss-notification-badge.is-multi-feed{top:-2px;right:-2px;font-size:0;width:10px;height:10px}.whats-new-rss-trigger-button .whats-new-rss-notification-badge.hide{display:none!important}.whats-new-rss-trigger-button:hover .whats-new-rss-notification-badge{transform:unset}.whats-new-rss-flyout{position:fixed;top:0;right:0;bottom:0;width:100%;z-index:99999;transition:visibility .3s ease-in-out;font-family:Figtree,sans-serif;height:100vh;font-size:15px;font-weight:400;line-height:20px;color:#374151;margin-bottom:5px}.whats-new-rss-flyout *,.whats-new-rss-flyout ::after,.whats-new-rss-flyout ::before{box-sizing:border-box}.whats-new-rss-flyout .lightbox-trigger,.whats-new-rss-flyout.hidden{display:none}.whats-new-rss-flyout.is-loading .whats-new-rss-flyout-inner-header__loading-icon{display:block;margin:auto}.whats-new-rss-flyout.is-loading .whats-new-rss-flyout-inner-header__loading-icon svg{display:block;background:0 0;width:25px;height:25px}.whats-new-rss-flyout p{font-size:14px;font-weight:400;line-height:20px;color:#374151;margin-bottom:15px}.whats-new-rss-flyout p a{color:#1170ff}.whats-new-rss-flyout .wp-block-uagb-buttons{background:#ff6c0a;padding:10px 18px;width:fit-content;color:#fff;border-radius:6px;box-shadow:0 1px 2px rgba(0,0,0,.05);margin-bottom:15px}.whats-new-rss-flyout .wp-block-uagb-buttons .uagb-button__link{color:#fff;font-size:1rem;font-weight:600;line-height:1.5rem}.whats-new-rss-flyout .ast-oembed-container{position:relative;padding-top:56.25%;height:0;overflow:hidden;max-width:100%;height:auto}.whats-new-rss-flyout .wp-has-aspect-ratio iframe{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.whats-new-rss-flyout .whats-new-rss-flyout-contents{position:fixed;display:flex;right:0;width:30%;height:100%;flex-direction:column;background-color:#fff;transition:transform .3s ease-in-out;z-index:9999}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header{display:flex;justify-content:space-between;align-items:center;padding:16px!important;border-bottom:1px solid #e5e7eb}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header [id^=whats-new-rss-flyout-close-]{width:24px;height:24px;display:flex;align-items:center;justify-content:center}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header button{border:none;background:0 0;font-size:30px;cursor:pointer;color:#111827;padding:0;margin:0;box-shadow:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header .whats-new-rss-flyout-inner-header__title-icon-wrapper{display:flex;gap:10px;padding:0 4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header .whats-new-rss-flyout-inner-header__title-icon-wrapper h3{margin:0;padding:0;color:#111827;font-weight:600;font-size:16px;line-height:24px;margin-bottom:0!important}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav{display:flex;padding:0 30px;border-bottom:1px solid #e5e7eb;gap:2em;overflow:auto;white-space:nowrap}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button{position:relative;background:0 0;color:inherit;padding:15px 0;border-bottom:2px solid transparent}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button:focus,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button:hover{border-color:inherit}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button.selected{border-color:#5d5d5d}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button .new-notification-count{position:absolute;top:0;right:-10px;width:20px;font-size:10px;line-height:20px;text-align:center;border-radius:10px;color:#fff;background:red}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content{flex:1;overflow-y:auto}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .skeleton-container{margin:30px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item{border-bottom:1px solid #d8dfe9;padding:20px;color:#374151;font-weight:400;font-size:14px;line-height:20px;display:flex;flex-direction:column}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1){margin:8px 0 8px 0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:first-child{margin-top:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1):is(ul){margin-top:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1):is(div):has(figure){margin-bottom:12px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item img{margin:0!important}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .wp-smiley{display:inline-block;margin:0;min-height:1em;margin-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>*{margin:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h2{font-size:22px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h3{font-size:20px;font-weight:600;line-height:1.5em;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h4{font-size:18px;font-weight:600;line-height:1.5em;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h5{font-size:16px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h6{font-size:13px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.skeleton-row{height:25vh;margin:40px 0;background:linear-gradient(90deg,#eee 25%,#ddd 50%,#eee 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.rss-new-post{position:relative}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.rss-new-post .new-post-badge{background:#ff6c0a;border-radius:4px;top:22px;right:24px;padding:0 4px;color:#fff;position:absolute}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header{display:flex;flex-direction:column;gap:4px;padding:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header p{color:#6b7280;margin:0;padding:0;font-weight:500;line-height:16px;font-size:12px;margin-bottom:0!important}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header h2{margin:0;color:#111827;font-weight:600;line-height:30px;font-size:20px;padding:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item p{padding:0;font-size:14px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item a{color:#1170ff;text-decoration:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure{margin:10px 0;margin-bottom:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure.wp-block-embed.is-type-video{position:relative;width:100%;height:0;padding-bottom:56.25%}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;max-width:100%}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item img{box-sizing:border-box;height:auto;max-width:100%;vertical-align:bottom;margin-bottom:15px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item video{vertical-align:middle;width:100%}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item strong{font-weight:600}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul{padding-inline-start:20px;margin-left:10px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol li,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul li{font-size:14px;font-weight:400;line-height:20px;color:#374151;margin:0 0 4px 0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol li:last-child,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul li:last-child{margin-bottom:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul{list-style-type:disc}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol{list-style-type:decimal}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details{line-height:20px;font-size:.9em;margin:10px 0;background:#f9fafb}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary{display:flex;justify-content:space-between;cursor:pointer;padding:20px 15px;height:1em;line-height:20px;font-weight:800}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary::after{content:"⌃";font-size:20px;transform:rotateX(180deg);font-weight:800}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary .text-see-more{display:block}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary .text-see-less{display:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary{border-bottom:1px solid #e2e8f0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary::after{transform:rotateX(45deg)}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary .text-see-more{display:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary .text-see-less{display:block}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item{position:relative;padding:1em;border-bottom:1px solid #e2e8f0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item .sub-version-header{display:flex;justify-content:space-between}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item .sub-version-content{margin-top:1em}.whats-new-rss-flyout .whats-new-rss-flyout-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.5);transition:all .3s ease-in-out}.whats-new-rss-flyout.closed{visibility:hidden}.whats-new-rss-flyout.closed .whats-new-rss-flyout-overlay{opacity:0;visibility:hidden}.whats-new-rss-flyout.closed .whats-new-rss-flyout-contents{transform:translateX(100%)}.whats-new-rss-flyout .whats-new-rss-flyout-inner-header__loading-icon{display:none}@keyframes shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}@media screen and (max-width:1024px){.whats-new-rss-flyout .whats-new-rss-flyout-contents{width:40%}}@media screen and (max-width:768px){.whats-new-rss-flyout .whats-new-rss-flyout-contents{width:85%}}'}(),document.head.appendChild(t)}}(),n.current||(n.current=(r={selector:e,...t},new hp(r))),()=>{n.current&&"function"==typeof n.current.destroy&&n.current.destroy()}},[e,...Object.values(t)]),n.current}({uniqueKey:"cartflows",rssFeedURL:1<e.length?e:e[0]?.url,selector:"#wcf-whats-new-content",triggerButton:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 m-1 text-text-primary"><path d="m3 11 18-5v12L3 13v-2z"/><path d="M11.6 16.8a3 3 0 1 1-5.8-1.6"/></svg>'},flyout:{title:(0,j.__)("What's New?","cartflows"),formatDate:e=>`${e.toLocaleDateString("en-US",{weekday:"long"})} ${e.toLocaleDateString("en-US",{month:"long"})} ${e.getDate()}, ${e.getFullYear()}`}}),(0,i.createElement)("div",{id:"wcf-whats-new-content",className:"[&>a]:p-0.5 [&>a]:pl-0"})},xp=To("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]),Np=To("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Ip=To("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);var Mp=n(1455),Ep=n.n(Mp);const _p=(e,t=!0)=>new Promise((n,r)=>{const o=new window.FormData;o.append("action","cartflows_activate_plugin"),o.append("init",e.init),o.append("security",cartflows_admin.activate_plugin_nonce),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(e=>{console.log("Helper.js",e),e.success?(n(e),t&&window.location.reload()):r(e)})});function Sp({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const Dp=p.forwardRef(Sp);function jp({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const kp=p.forwardRef(jp),Cp=function(){const e=cartflows_admin?.cf_pro_status,t=(0,j.__)("upgrading to PRO","cartflows"),n=!wcfCartflowsPro()&&"inactive"===e,[r,o]=(0,i.useState)(!1),a=getUpgradeToProUrl();let s="";return n?s=(0,j.__)("activating CartFlows Pro","cartflows"):wcfCartflowsPro()||(s=t),(0,i.createElement)("div",{className:"bg-primary-50 p-3 z-20 relative"},(0,i.createElement)("p",{className:"wcf-main-upgrade-pro-notice text-sm flex justify-center m-0"},(0,j.__)("You're on","cartflows")," ",(0,i.createElement)("span",{className:"font-semibold"},(0,j.__)("CartFlows Free.","cartflows")," "),(0,j.__)("Unlock upsells, order bumps & more revenue by","cartflows")," ",n?(0,i.createElement)("span",{className:"text-brand-600 hover:text-brand-800 font-semibold flex items-center gap-1 cursor-pointer",onClick:()=>{o(!0),_p({slug:"cartflows-pro",init:"cartflows-pro/cartflows-pro.php",name:"cartflows-pro"}).then(e=>{console.log(e),o(!0)}).catch(e=>{console.log(e),o(!1)})}},r&&(0,i.createElement)(Dp,{className:`w-4 h-4 stroke-2 ${r?"wcf-processing animate-spin":""} `}),r?(0,j.__)("Activating","cartflows"):s):(0,i.createElement)("a",{href:a,target:"_blank",className:"text-brand-600 hover:text-brand-800 font-semibold flex items-center gap-1",rel:"noreferrer"},s,(0,i.createElement)(kp,{className:"w-4 h-[18px] stroke-2 text-brand-500"}))))},Ap=({label:e="PRO"})=>(0,i.createElement)(Qo,{label:e,size:"xs",type:"pill",className:"!bg-brand-25 !text-brand-600 !border-brand-500/20",disableHover:!0});function Tp(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class Lp extends p.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(zf(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const e=t.offsetParent,n=zf(e)&&e.offsetWidth||0,r=zf(e)&&e.offsetHeight||0,o=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Op({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:a}){const i=(0,p.useId)(),s=(0,p.useRef)(null),l=(0,p.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:c}=(0,p.useContext)(wl),u=!1!==a?e.props?.ref??e?.ref:void 0,d=function(...e){return p.useCallback(function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Tp(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():Tp(e[t],null)}}}}(...e),e)}(s,u);return(0,p.useInsertionEffect)(()=>{const{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=l.current;if(t||!1===a||!s.current||!e||!u)return;const g="rtl"===h,w="left"===n?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,y="bottom"===r?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=i;const b=document.createElement("style");c&&(b.nonce=c);const v=o??document.head;return v.appendChild(b),b.sheet&&b.sheet.insertRule(`\n [data-motion-pop-id="${i}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${u}px !important;\n ${w}px !important;\n ${y}px !important;\n }\n `),()=>{s.current?.removeAttribute("data-motion-pop-id"),v.contains(b)&&v.removeChild(b)}},[t]),(0,C.jsx)(Lp,{isPresent:t,childRef:s,sizeRef:l,pop:a,children:!1===a?e:p.cloneElement(e,{ref:d})})}const zp=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:a,mode:i,anchorX:s,anchorY:l,root:c})=>{const u=kl(Pp),d=(0,p.useId)(),f=(0,p.useRef)(n),m=(0,p.useRef)(r);Zl(()=>{f.current=n,m.current=r});let h=!0,g=(0,p.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:o,onExitComplete:e=>{u.set(e,!0);for(const e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,p.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),p.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,C.jsx)(Op,{pop:"popLayout"===i,isPresent:n,anchorX:s,anchorY:l,root:c,children:e}),(0,C.jsx)(jl.Provider,{value:g,children:e})};function Pp(){return new Map}const Rp=e=>e.key||"";function Up(e){const t=[];return p.Children.forEach(e,e=>{(0,p.isValidElement)(e)&&t.push(e)}),t}const Bp=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:a="sync",propagate:i=!1,anchorX:s="left",anchorY:l="top",root:c})=>{const[u,d]=Id(i),f=(0,p.useMemo)(()=>Up(e),[e]),m=i&&!u?[]:f.map(Rp),h=(0,p.useRef)(!0),g=(0,p.useRef)(f),w=kl(()=>new Map),y=(0,p.useRef)(new Set),[b,v]=(0,p.useState)(f),[x,N]=(0,p.useState)(f);Zl(()=>{h.current=!1,g.current=f;for(let e=0;e<x.length;e++){const t=Rp(x[e]);m.includes(t)?(w.delete(t),y.current.delete(t)):!0!==w.get(t)&&w.set(t,!1)}},[x,m.length,m.join("-")]);const I=[];if(f!==b){let e=[...f];for(let t=0;t<x.length;t++){const n=x[t],r=Rp(n);m.includes(r)||(e.splice(t,0,n),I.push(n))}return"wait"===a&&I.length&&(e=I),N(Up(e)),v(f),null}const{forceRender:M}=(0,p.useContext)(hl);return(0,C.jsx)(C.Fragment,{children:x.map(e=>{const p=Rp(e),b=!(i&&!u)&&(f===x||m.includes(p));return(0,C.jsx)(zp,{isPresent:b,initial:!(h.current&&!n)&&void 0,custom:t,presenceAffectsLayout:o,mode:a,root:c,onExitComplete:b?void 0:()=>{if(y.current.has(p))return;if(!w.has(p))return;y.current.add(p),w.set(p,!0);let e=!0;w.forEach(t=>{t||(e=!1)}),e&&(M?.(),N(g.current),i&&d?.(),r&&r())},anchorX:s,anchorY:l,children:e},p)})})},Fp=To("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Yp=(0,p.createContext)({}),Zp=()=>(0,p.useContext)(Yp),Vp=({size:e="md",children:t,className:n})=>(0,C.jsx)(Yp.Provider,{value:{size:e},children:(0,C.jsx)("div",{className:Se("flex flex-col bg-background-primary p-2",n),children:t})});Vp.displayName="Menu";const Gp=({heading:e,arrow:t=!1,showArrowOnHover:n=!1,open:r=!0,onClick:o,children:a,className:i})=>{const[s,l]=(0,p.useState)(r),[c,u]=(0,p.useState)(!1),{size:d}=Zp(),f={sm:"text-xs",md:"text-sm"}[d??"md"],m={sm:"size-4",md:"size-5"}[d??"md"];return(0,C.jsxs)("div",{children:[!!e&&(0,C.jsxs)("button",{type:"button",onClick:()=>{l(!s),o&&o(!s)},onMouseEnter:()=>n&&u(!0),onMouseLeave:()=>n&&u(!1),className:Se("text-text-primary bg-transparent cursor-pointer flex justify-between items-center gap-1",f,e?"p-1":"p-0","border-none w-full",i),"aria-expanded":s,children:[(0,C.jsx)("span",{className:"text-text-tertiary",children:e}),t&&(0,C.jsx)(Xf.span,{className:"flex items-center text-border-strong",initial:"hidden",animate:n?s||c?"visible":"hidden":"visible",exit:"hidden",variants:{visible:{opacity:1},hidden:{opacity:0}},transition:{duration:.15},children:(0,C.jsx)(Xf.span,{className:"inline-flex p-1",variants:{open:{rotate:180},closed:{rotate:0}},animate:s?"open":"closed",transition:{duration:.15},children:(0,C.jsx)(Fp,{className:Se("shrink-0",m)})})})]}),(0,C.jsx)(Bp,{initial:!1,children:s&&(0,C.jsx)(Xf.ul,{role:"menu",variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow flex gap-0.5 flex-col m-0 bg-white rounded p-0",children:a})})]})};Gp.displayName="Menu.List";const Wp=({disabled:e=!1,active:t,onClick:n,children:r,className:o,...a})=>{const{size:i}=Zp(),s={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"}[i??"md"];return(0,C.jsx)("li",{role:"menuitem",tabIndex:e?-1:0,onClick:e?void 0:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&n?.()},className:Se("flex p-1 gap-1 items-center bg-transparent border-none rounded text-text-secondary cursor-pointer m-0",s,"hover:bg-background-secondary hover:text-text-primary",e?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",t?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"","transition-colors duration-300 ease-in-out",o),"aria-disabled":e,...a,children:r})};Wp.displayName="Menu.Item";const Hp=({variant:e="solid",className:t})=>{const n={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"}[e];return(0,C.jsx)("li",{className:"m-0 p-0 list-none",role:"separator","aria-hidden":"true",children:(0,C.jsx)("hr",{className:Se("w-full border-0 border-t border-border-subtle",n,t)})})};Hp.displayName="Menu.Separator",Vp.List=Gp,Vp.Item=Wp,Vp.Separator=Hp;const Qp=(0,p.createContext)({}),$p=()=>(0,p.useContext)(Qp),Xp=({placement:e="bottom",offset:t=10,boundary:n="clippingAncestors",children:r,className:o})=>{const[a,i]=(0,p.useState)(!1),{refs:s,floatingStyles:l,context:c}=uo({open:a,onOpenChange:i,placement:e,strategy:"fixed",middleware:[Bn(t),Yn({boundary:n}),Fn({boundary:n})],whileElementsMounted:Cn}),u=ao(c),d=co(c),f=Io(c,{role:"menu"}),{getReferenceProps:m,getFloatingProps:h}=ho([u,d,f]),{isMounted:g,styles:w}=_o(c,{duration:150,initial:{opacity:0,scale:.95},open:{opacity:1,scale:1},close:{opacity:0,scale:.95}}),y=()=>i(e=>!e);return(0,C.jsx)(Qp.Provider,{value:{refs:s,handleClose:()=>i(!1),isMounted:g,styles:w,floatingStyles:l,getFloatingProps:h,context:c},children:(0,C.jsxs)("div",{className:Se("relative inline-block",o),children:[p.Children.map(r,e=>p.isValidElement(e)&&"DropdownMenu.Trigger"===e?.type?.displayName?(0,p.cloneElement)(e,{ref:s.setReference,onClick:y,...m()}):null),p.Children.toArray(r).filter(e=>p.isValidElement(e)&&["DropdownMenu.Portal","DropdownMenu.ContentWrapper"].includes(e.type.displayName||"")).map(e=>e)]})})};Xp.displayName="DropdownMenu";const Jp=({children:e,className:t})=>{const{refs:n,floatingStyles:r,getFloatingProps:o,isMounted:a,styles:i,context:s}=$p();return a&&s?(0,C.jsx)(Kr,{context:s,modal:!1,children:(0,C.jsx)("div",{ref:n.setFloating,className:t,style:{...r,...i},...o(),children:p.Children.map(e,e=>"DropdownMenu.Content"===e?.type?.displayName?e:null)})}):null};Jp.displayName="DropdownMenu.ContentWrapper";const qp=({children:e,root:t,id:n})=>(0,C.jsx)(Gr,{id:n,root:t,children:e});qp.displayName="DropdownMenu.Portal";const Kp=p.forwardRef(({children:e,className:t,...n},r)=>(0,p.isValidElement)(e)?p.cloneElement(e,{className:Se(t,e.props.className),ref:r,...n}):(0,C.jsx)("button",{ref:r,type:"button",className:Se("cursor-pointer bg-transparent border-none p-0",t),...n,children:e}));Kp.displayName="DropdownMenu.Trigger";const em=({children:e,className:t,...n})=>(0,C.jsx)("div",{className:Se("border border-solid border-border-subtle rounded-md shadow-lg overflow-hidden",t),children:(0,C.jsx)(Vp,{...n,children:e})});em.displayName="DropdownMenu.Content";const tm=e=>(0,C.jsx)(Vp.List,{...e});tm.displayName="DropdownMenu.List";const nm=({children:e,as:t=Vp.Item,...n})=>{const{handleClose:r}=$p();return e?t===p.Fragment&&(0,p.isValidElement)(e)?(0,p.cloneElement)(e,{onClick:De(e.props?.onClick,r)}):(0,C.jsx)(t,{...n,className:Se("px-2",n.className),onClick:De(n.onClick,r),children:e}):null};nm.displayName="DropdownMenu.Item";const rm=e=>(0,C.jsx)(Vp.Separator,{...e});function om({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}rm.displayName="DropdownMenu.Separator",Xp.Trigger=Kp,Xp.Content=em,Xp.List=tm,Xp.Item=nm,Xp.Separator=rm,Xp.Portal=qp,Xp.ContentWrapper=Jp;const am=p.forwardRef(om);function im({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"}))}const sm=p.forwardRef(im);function lm({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 9v.906a2.25 2.25 0 0 1-1.183 1.981l-6.478 3.488M2.25 9v.906a2.25 2.25 0 0 0 1.183 1.981l6.478 3.488m8.839 2.51-4.66-2.51m0 0-1.023-.55a2.25 2.25 0 0 0-2.134 0l-1.022.55m0 0-4.661 2.51m16.5 1.615a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V8.844a2.25 2.25 0 0 1 1.183-1.981l7.5-4.039a2.25 2.25 0 0 1 2.134 0l7.5 4.039a2.25 2.25 0 0 1 1.183 1.98V19.5Z"}))}const cm=p.forwardRef(lm);function um({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const dm=p.forwardRef(um),fm=[{label:(0,j.__)("Funnels","cartflows"),type:"flows",icon:am},{label:(0,j.__)("Conversions","cartflows"),type:"conversion",icon:sm},{label:(0,j.__)("Opt-in","cartflows"),type:"optin",icon:cm}],pm=function({menu:e,isEditorApp:t,activePage:n,activePath:r}){const o=n===e.slug&&r===e.path,a=(0,d.useHistory)(),s=dp()("h-full text-sm font-medium no-underline px-1 content-center relative inline-flex items-center gap-1 focus:outline-none focus:[box-shadow:none] bg-transparent border-0 shadow-none outline-none cursor-pointer hover:text-brand-500 transition-colors duration-200",{'text-brand-500 before:content-[""] before:absolute before:h-px before:bg-brand-500 before:bottom-0 before:inset-x-0':o,"text-text-secondary":!o});return(0,i.createElement)(Xp,{placement:"bottom",offset:4,className:"h-full ss-007"},(0,i.createElement)(Xp.Trigger,null,(0,i.createElement)("button",{className:s},(0,i.createElement)("span",{className:"relative h-full inline-flex items-center gap-1"},e.name,(0,i.createElement)(dm,{className:"w-4 h-4","aria-hidden":"true"})))),(0,i.createElement)(Xp.ContentWrapper,null,(0,i.createElement)(Xp.Content,{size:"sm"},(0,i.createElement)(Xp.List,null,fm.map(n=>(0,i.createElement)(Xp.Item,{key:n.type,onClick:()=>((n=null)=>{const r=`admin.php?page=${e.slug}&path=${e.path}`;t?window.location.href=n?`${r}&type=${n}`:r:a.push({pathname:"admin.php",search:n?`?page=${e.slug}&path=${e.path}&type=${n}`:`?page=${e.slug}&path=${e.path}`})})(n.type),className:"hover:bg-brand-25 hover:text-brand-600"},(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(n.icon,{className:"w-4 h-4 stroke-[1.5]","aria-hidden":"true"}),n.label)))))))},mm=({title:e,children:t,onClick:n,icon:r})=>(0,i.createElement)(Oe.Item,{className:"p-1 gap-2"},(0,i.createElement)(Wo,{content:e,placement:"bottom",variant:"dark"},t||(0,i.createElement)(Ro,{size:"xs",variant:"ghost",className:"p-0 focus:[box-shadow:none] [box-shadow:none] text-text-primary",onClick:n,icon:r}))),hm=function(){const[{license_status:e,canvasMode:t}]=l(),n=cartflows_admin?.current_user_can_manage_cartflows,[r,o]=(0,i.useState)({isProcessing:!1,buttonText:""}),{isProcessing:a,buttonText:s}=r,c=[{name:(0,j.__)("Dashboard","cartflows"),slug:cartflows_admin.home_slug,path:"",url:"",visible:!0},{name:(0,j.__)("Funnels","cartflows"),slug:cartflows_admin.home_slug,path:"flows",url:"",visible:!0},{name:(0,j.__)("Store Checkout","cartflows"),slug:cartflows_admin.home_slug,path:"store-checkout",url:""!==cartflows_admin.global_checkout_id?"&action=wcf-edit-flow&flow_id="+cartflows_admin.global_checkout_id:"",visible:!0},{name:(0,j.__)("Analytics","cartflows"),slug:cartflows_admin.home_slug,path:"analytics",url:"",visible:n},{name:(0,j.__)("Settings","cartflows"),slug:cartflows_admin.home_slug,path:"settings",url:"",visible:n},{name:(0,j.__)("Learn","cartflows"),slug:cartflows_admin.home_slug,path:"learn",url:"",visible:!0},{name:(0,j.__)("Free vs Pro","cartflows"),slug:cartflows_admin.home_slug,path:"free-vs-pro",url:"",visible:!wcfCartflowsPro()}].filter(e=>e.visible),u=(0,d.useHistory)(),f=new URLSearchParams((0,d.useLocation)()?.search),p=f.get("page")?f.get("page"):cartflows_admin.home_slug;let m=f.get("path")?f.get("path"):"";"store-checkout-library"===m&&(m="store-checkout");const h=["wcf-edit-flow","wcf-edit-step"].includes(f.get("action"));let g="",w="";const y=cartflows_admin?.cf_pro_status;wcfCartflowsPro()||"inactive"!==y?wcfCartflowsPro()||(g=(0,j.__)("Upgrade to Pro","cartflows")):(g=(0,j.__)("Activate CartFlows Pro","cartflows"),w="activate");const b=(0,k.applyFilters)("cartflows.navbar.licenseBadge",null),v=(0,k.applyFilters)("cartflows.navbar.planBadge",null),x=wcfCartflowsPro()?(0,i.createElement)(Ap,{label:(cartflows_admin?.cf_pro_type||"pro").toUpperCase()}):(0,i.createElement)(Qo,{label:(0,j.__)("Free","cartflows"),className:"text-text-tertiary uppercase",size:"xs",variant:"neutral",type:"pill"}),N=function(e){if(e.preventDefault(),"activate"===w){const e="cartflows-pro",t="cartflows-pro/cartflows-pro.php",n="cartflows-pro";o({isProcessing:!0,buttonText:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
2 +(0,j.__)("Activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}),_p({slug:e,init:t,name:n}).then(()=>{o({isProcessing:!0,buttonText:(0,j.__)("Successfully Activated","cartflows")}),setTimeout(()=>{o({isProcessing:!1,buttonText:(0,j.__)("Activated","cartflows")})},3e3)}).catch(()=>{o({isProcessing:!1,buttonText:(0,j.__)("Activation Failed","cartflows")})})}w||u.push({pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=settings&tab=license`})},I=e=>`admin.php?page=${e.slug}${""!==e.path?"&path="+e.path:""}${e.url}`,M=e=>dp()("h-full text-sm font-medium no-underline px-1 content-center relative focus:outline-none focus:[box-shadow:none] hover:text-brand-500 transition-colors duration-200",{'text-brand-500 before:content-[""] before:absolute before:h-px before:bg-brand-500 before:bottom-0 before:inset-x-0':e,"text-text-secondary":!e});return(0,i.createElement)(i.Fragment,null,!wcfCartflowsPro()&&!t&&(0,i.createElement)(Cp,null),(0,i.createElement)("div",{className:"wcf-main--nav-menu sticky top-0 sm:top-8 z-20"},(0,i.createElement)(Oe,{className:"py-0 px-4 min-h-0 h-14 gap-4 shadow-sm bg-background-primary backdrop-blur-[5px]"},(0,i.createElement)(Oe.Left,{className:"gap-3"},(0,i.createElement)(Oe.Item,{className:"w-auto h-auto lg:hidden"},(0,i.createElement)(lp,null,(0,i.createElement)(lp.Toggle,{className:"size-6"}),(0,i.createElement)(lp.Options,null,c.map(e=>(0,i.createElement)(lp.Option,{key:e.name,active:p===e.slug&&m===e.path,href:I(e),iconPosition:"left",rel:"noopener noreferrer",tag:"a",target:"_self"},e.name)),!wcfCartflowsPro()&&(0,i.createElement)(lp.Option,{href:getUpgradeToProUrl(),iconPosition:"left",rel:"noopener noreferrer",tag:"a",target:"_blank",className:"text-link-primary gap-1"},(0,j.__)("Upgrade to Pro","cartflows")," ",(0,i.createElement)(xp,{className:"!size-5"}))))),(0,i.createElement)(Oe.Item,null,(0,i.createElement)("img",{className:"block h-8 w-auto",src:fp,alt:"CartFlows"}))),(0,i.createElement)(Oe.Middle,{align:"left",className:"h-full hidden lg:flex"},(0,i.createElement)(Oe.Item,null,(0,i.createElement)("nav",{className:"flex items-center gap-4 h-full"},c.map(e=>"analytics"===e.path?(0,i.createElement)(pm,{key:e.name,menu:e,isEditorApp:h,activePage:p,activePath:m}):(e=>{const t=p===e.slug&&m===e.path;return h?(0,i.createElement)("a",{key:e.name,href:I(e),className:M(t)},e.name):(0,i.createElement)(_,{key:e.name,to:{pathname:"admin.php",search:`?page=${e.slug}${""!==e.path?"&path="+e.path:""}${e.url}`},className:M(t)},e.name)})(e)))),!wcfCartflowsPro()&&(0,i.createElement)(Oe.Item,null,"inactive"===y?(0,i.createElement)(Ro,{icon:a?(0,i.createElement)(Np,{className:"w-4 h-4 animate-spin"}):null,iconPosition:"left",variant:"link",size:"sm",className:"h-full text-link-primary text-sm font-semibold no-underline hover:no-underline hover:text-link-primary-hover px-1 content-center [box-shadow:none] focus:[box-shadow:none] focus:outline-none",onClick:N},a?s:g):(0,i.createElement)(Ro,{icon:(0,i.createElement)(xp,{className:"!size-5"}),iconPosition:"right",variant:"link",size:"sm",className:"h-full text-link-primary text-sm font-semibold no-underline hover:no-underline hover:text-link-primary-hover px-1 content-center [box-shadow:none] focus:[box-shadow:none] focus:outline-none",onClick:()=>window.open(getUpgradeToProUrl(),"_blank","noreferrer")},g))),(0,i.createElement)(Oe.Right,null,b?(0,i.createElement)(Oe.Item,null,(0,i.createElement)(b,{licenseStatus:e,onOpenLicenseSettings:N})):wcfCartflowsPro()&&(0,i.createElement)(Oe.Item,null,(0,i.createElement)(Ro,{variant:"ghost",className:"p-0 hover:bg-transparent focus:[box-shadow:none] [box-shadow:none]",onClick:t=>{"Activated"!==e&&N(t)},icon:(0,i.createElement)(Qo,{label:"Activated"===e?(0,j.__)("Licensed","cartflows"):(0,j.__)("Unlicensed","cartflows"),size:"xs",variant:"Activated"===e?"green":"red"})})),(0,i.createElement)(Oe.Item,{className:"flex gap-3 items-center"},(0,i.createElement)(cp,{size:"xs",variant:"neutral",className:"text-text-tertiary"},`v${cartflows_admin?.cartflows_current_version}`),v?(0,i.createElement)(v,null):x),(0,i.createElement)(mm,{title:(0,j.__)("Documentation","cartflows"),icon:(0,i.createElement)(Ip,{className:"size-4"}),onClick:()=>window.open(getKbDocUrl("https://cartflows.com/docs/"),"_blank","noopener noreferrer")}),0<cartflows_admin?.whats_new_rss_feed?.length&&(0,i.createElement)(mm,{title:(0,j.__)("What's New","cartflows")},(0,i.createElement)("span",{className:"inline-flex"},(0,i.createElement)(vp,null)))))))},gm={flow_id:cartflows_admin?.flow_id?cartflows_admin?.flow_id:0,is_cf_pro:!!cartflows_admin?.is_pro&&cartflows_admin.is_pro,page_slug:cartflows_admin?.home_slug?cartflows_admin.home_slug:"cartflows",page_builder:cartflows_admin?.page_builder?cartflows_admin.page_builder:"other",global_checkout:parseInt(cartflows_admin.global_checkout),flows:[],flow_analytics:{},flow_settings:{},title:!1,flow_title:"",flow_slug:"",flow_link:"#",is_flow_instant_checkout:!1,emptySteps:!1,steps:[],options:null,current_step:null,flow_type:"flows",status:null,step_id:0,admin_url:"test_url",page_builder_name:cartflows_admin?.page_builder_name?cartflows_admin.page_builder_name:"",step_data:{},view_url:"#",edit_url:"#",edit_builder_url:"#",settings_data:{},step_title:!1,step_slug:"",design_settings:null,page_settings:null,billing_fields:null,shipping_fields:null,ob_id:null,current_ob:null,suretriggers_config:[]},wm=(e,t,n)=>{if(!t)return e;const r=(e.options?.["wcf-order-bumps"]||[]).map(e=>e.id===t?{...e,...n}:e),o=r.find(e=>e.id===t)||null;return{...e,options:{...e.options,"wcf-order-bumps":r},current_ob:o||e.current_ob}},ym=(e,t,n,r)=>{if("wcf-order-bumps"!==n||!Array.isArray(e)||!t)return e;const o=e.findIndex(e=>String(e?.id)===String(t));if(-1===o)return e;const a=e.slice();return a[o]={...a[o],order_bumps:r},a},bm=(e,t)=>{switch(t.type){case"SET_FLOW_DATA":t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.slug;const n={};return Array.isArray(t.data.steps)&&t.data.steps.forEach(e=>{const t=e?.ob_ab_stats;t&&"object"==typeof t&&Object.keys(t).forEach(e=>{n[e]={...n[e]||{},...t[e]}})}),{...e,title:t.data.title,flow_title:t.data.title,flow_slug:t.data.slug,flow_link:t.data.link,status:t.data.status,steps:t.data.steps,flow_settings:t.data.settings_data,emptySteps:t.data.steps.length<1,options:{...e.options,...t.data.options,ob_ab_stats:n},flow_analytics:t.data.flow_analytics,is_flow_instant_checkout:t?.data?.options["instant-layout-style"]||!1};case"SET_FLOW_ANALYTICS":return{...e,flow_analytics:t.flow_analytics.data};case"SET_OPTION":const r=e.options;return r[t.name]=t.value,{...e,options:r};case"SET_FLOW_TITLE":return e.options.post_title=t.title,{...e,title:t.title};case"SET_STEPS":return{...e,steps:t.steps};case"SET_GLOBAL_CHECKOUT":return{...e,global_checkout:t.global_checkout};case"SET_STORE_STEPS":const o=[],a=[];e.steps.map(function(e){return"checkout"===e.type&&o.push(e),"landing"===e.type&&a.push(e),""});let i=[];return i=i.concat(o,a),t.steps.map(function(e){return void 0!==e.type&&i.push(e),""}),i=[...new Map(i.map(e=>[e.id,e])).values()],{...e,steps:i};case"SET_STEP_DATA":return t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.step_post_name,{...e,flow_title:t.data.flow_title,view_url:t.data.view,edit_url:t.data.edit?t.data.edit.replace(/&amp;/g,"&"):"",edit_builder_url:t.data.page_builder_edit?t.data.page_builder_edit.replace(/&amp;/g,"&"):"",step_data:t.data,settings_data:t.data.settings_data,design_settings:t.data.design_settings,page_settings:t.data.page_settings,custom_fields:t.data.custom_fields,billing_fields:t.data.billing_fields,shipping_fields:t.data.shipping_fields,options:{...e.options,...t.data.options},step_title:t.data.title,step_slug:t.data.step_post_name,step_id:t.data.id};case"SET_STEP_TITLE":return e.options.post_title=t.title,{...e,step_title:t.title};case"SET_OB_TITLE":const s=e.options[t.name].findIndex(e=>e.id===t.ob_id);return e.options[t.name][s].title=t.title,{...e};case"SET_OB_STATUS":const l=e.options[t.name].findIndex(e=>e.id===t.ob_id);return e.options[t.name][l].status=t.newStatus,{...e};case"SET_STEP_VIEW_URL":return{...e,view_url:t.step_view_url};case"SET_FIELDS":return"billing"===t.field_type?{...e,billing_fields:t.fields}:{...e,shipping_fields:t.fields};case"SET_OB_OPTION":const c=e.current_ob;return c[t.name]=t.value,{...e,current_ob:c};case"UPDATE_OPTIONS":return{...e,options:t.options};case"ADD_CHECKOUT_PRODUCT":const u=e.options[t.field_name];return u&&(u.push(t.product_data),e.options[t.field_name]=u),{...e};case"ADD_OPTIN_PRODUCT":case"ADD_OFFER_PRODUCT":return e.options[t.field_name]=t.product_data,{...e};case"ADD_OB_PRODUCT":return wm(e,e.current_ob?.id,{product:t.product.product,product_image:t.product.product_image,desc_text:t.product.desc_text});case"REMOVE_OB_PRODUCT":return wm(e,e.current_ob?.id,{product:"",product_image:cartflows_admin.image_placeholder,desc_text:"Lorem Ipsum has been the industry standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book."});case"REMOVE_OFFER_PRODUCT":case"REMOVE_OPTIN_PRODUCT":return e.options[t.field_name]&&(e.options[t.field_name]=""),{...e};case"REMOVE_CHECKOUT_PRODUCT":const d=t.unique_id,f=e.options[t.field_name];return d&&f&&(e.options[t.field_name]=f.filter(function(e){return e.unique_id!==d})),{...e};case"UPDATE_CHECKOUT_PRODUCTS":return e.options[t.field_name]=t.products,{...e};case"UPDATE_ORDER_BUMP":return e.options[t.name]=t.order_bumps,{...e,steps:ym(e.steps,e.step_id,t.name,t.order_bumps)};case"REMOVE_ORDER_BUMP":const p=t.ob_id,m=e.options[t.name].filter(function(e){return e.id!==p});return e.options[t.name]=m,{...e,steps:ym(e.steps,e.step_id,t.name,m)};case"SET_CURRENT_OB":const h=e.options["wcf-order-bumps"].findIndex(e=>e.id===t.ob_id);return e.options["wcf-order-bumps"][h]=t.current_ob,{...e,ob_id:t.ob_id,current_ob:t.current_ob};case"ADD_NEW_OB_GROUP":const g=e.current_ob[t.name];return g&&(g.push(t.newGroup),e.current_ob[t.name]=g),{...e};case"ADD_NEW_GROUP":const w=e.options[t.name];return w&&(w.push(t.newGroup),e.options[t.name]=w),{...e};case"ADD_NEW_OB_RULE":const y=e.current_ob[t.name],b=t.group_id;if(y&&b){for(const e of y)if(b===e.group_id){e.rules.push(t.newRule);break}e.current_ob[t.name]=y}return{...e};case"ADD_NEW_RULE":const v=e.options[t.name],x=t.group_id;if(v&&x){for(const e of v)if(x===e.group_id){e.rules.push(t.newRule);break}e.options[t.name]=v}return{...e};case"REMOVE_OB_RULE":const N=e.current_ob[t.name];for(let e=0;e<N.length;e++)if(t.group_id===N[e].group_id){const n=N[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){N[e].rules.splice(r,1);break}0===N[e].rules.length&&N.splice(e,1)}return e.current_ob[t.name]=N,{...e};case"REMOVE_RULE":const I=e.options[t.name];for(let e=0;e<I.length;e++)if(t.group_id===I[e].group_id){const n=I[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){I[e].rules.splice(r,1);break}0===I[e].rules.length&&I.splice(e,1)}return e.options[t.name]=I,{...e};case"RESET_OB_RULE_VALUE":const M=e.current_ob[t.name];for(const e of M)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.current_ob[t.name]=M,{...e};case"RESET_RULE_VALUE":const E=e.options[t.name];for(const e of E)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="",e.operator="";break}break}return e.options[t.name]=E,{...e};case"SET_RULES_GROUPS":return e.options[t.fieldName]=t.groups,{...e};case"SET_OB_RULES_GROUPS":return e.current_ob[t.fieldName]=t.groups,{...e};case"SET_OB":return e.options[t.fieldName]=t.obs,{...e};case"SET_SURETRIGGERS_CONFIG":return t.config&&setSureTriggersConfig(t.config),{...e,suretriggers_config:t};default:return e}},vm=(0,i.createContext)();window.cartflows=window.cartflows||{},window.cartflows.editorStateContext=vm;const xm=({reducer:e,initialState:t,children:n})=>(window.cartflows.editorStateContext=vm,(0,i.createElement)(vm.Provider,{value:(0,i.useReducer)(e,t)},n)),Nm=()=>(0,i.useContext)(vm);var Im=n(5901),Mm=function(){return Mm=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},Mm.apply(this,arguments)};function Em(e,t){for(var n={},r={},o=e.split("~~"),a=!1,i=0;o.length>i;i++){for(var s=o[i].split("~"),l=0;l<s.length;l+=2){var c=s[l],u=s[l+1],d="&"+c+";";n[d]=u,a&&(n["&"+c]=u),r[u]=d}a=!0}return t?{entities:Mm(Mm({},n),t.entities),characters:Mm(Mm({},r),t.characters)}:{entities:n,characters:r}}var _m={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/&notin;|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/&centerdot;|&copysr;|&divideontimes;|&gtcc;|&gtcir;|&gtdot;|&gtlPar;|&gtquest;|&gtrapprox;|&gtrarr;|&gtrdot;|&gtreqless;|&gtreqqless;|&gtrless;|&gtrsim;|&ltcc;|&ltcir;|&ltdot;|&lthree;|&ltimes;|&ltlarr;|&ltquest;|&ltrPar;|&ltri;|&ltrie;|&ltrif;|&notin;|&notinE;|&notindot;|&notinva;|&notinvb;|&notinvc;|&notni;|&notniva;|&notnivb;|&notnivc;|&parallel;|&timesb;|&timesbar;|&timesd;|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},Sm={};Sm.xml=Em("lt~<~gt~>~quot~\"~apos~'~amp~&"),Sm.html4=Em("apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~‌~zwj~‍~lrm~‎~rlm~‏~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~­~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~\"~amp~&~lt~<~gt~>"),Sm.html5=Em('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~⁡~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~⁣~InvisibleTimes~⁢~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~​~NegativeThickSpace~​~NegativeThinSpace~​~NegativeVeryThinSpace~​~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~⁠~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~\t~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~  ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~​~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~⁡~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~⁣~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~⁢~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®',Sm.html4);var Dm={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},jm=String.fromCodePoint||function(e){return String.fromCharCode(Math.floor((e-65536)/1024)+55296,(e-65536)%1024+56320)},km=(String.prototype.codePointAt,function(){return km=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},km.apply(this,arguments)}),Cm=km(km({},Sm),{all:Sm.html5}),Am={scope:"body",level:"all"},Tm=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,Lm=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,Om={xml:{strict:Tm,attribute:Lm,body:_m.xml},html4:{strict:Tm,attribute:Lm,body:_m.html4},html5:{strict:Tm,attribute:Lm,body:_m.html5}},zm=km(km({},Om),{all:Om.html5}),Pm=String.fromCharCode,Rm=Pm(65533);function Um(e,t){var n=void 0===t?Am:t,r=n.level,o=void 0===r?"all":r,a=n.scope,i=void 0===a?"xml"===o?"strict":"body":a;if(!e)return"";var s=zm[o][i],l=Cm[o].entities,c="attribute"===i,u="strict"===i;return e.replace(s,function(e){return function(e,t,n,r){var o=e,a=e[e.length-1];if(n&&"="===a)o=e;else if(r&&";"!==a)o=e;else{var i=t[e];if(i)o=i;else if("&"===e[0]&&"#"===e[1]){var s=e[2],l="x"==s||"X"==s?parseInt(e.substr(3),16):parseInt(e.substr(2));o=l>=1114111?Rm:l>65535?jm(l):Pm(Dm[l]||l)}}return o}(e,l,c,u)})}function Bm(e,t){return"yes"===t&&["checkout","thankyou","upsell","downsell"].includes(e)}function Fm(){return(0,i.createElement)("div",null,(0,i.createElement)("span",{className:"wcf-tooltip-heading text-xs font-semibold mb-1 block"},(0,j.__)("Step Editing is Disabled","cartflows")),(0,i.createElement)("div",{className:"wcf-tooltip-desc text-xs font-normal normal-case"},(0,j.__)("You can't edit this step directly because Instant Layout is turned on in the funnel settings. To make design changes, go to the Design tab inside this step's settings.","cartflows")))}function Ym(e,t,n){return Um(e.length>t?e.substring(0,n)+"...":e)}const Zm=new function(){const e=this;this.compare=function(e,t,n){switch(n){case"==":return e==t;case"!=":return e!=t;case"!==":return e!==t;case"in":return-1!==t.indexOf(e);case"!in":return-1===t.indexOf(e);case"contains":return-1!==e.indexOf(t);case"!contains":return-1===e.indexOf(t);case"<":return e<t;case"<=":return e<=t;case">":return e>t;case">=":return e>=t;default:return e===t}},this.check=function(t,n){const r="or"===t.relation;let o=!r;return!Array.isArray(t?.fields)||(t.fields.map(function(t){let a;return a=t.fields?e.check(t,n):e.compare(n[t.name],t.value,t.operator),r?(a&&(o=!0),!a):a?"":o=!1}),o)},this.isActiveControl=function(t,n){const r=!!t?.conditions&&t?.conditions;return!(r&&!e.check(r,n))}};let Vm=1;const Gm=new class{#e;#t;constructor(){this.#e=[],this.#t=[]}subscribe(e){return this.#t.push(e),()=>{this.#t=this.#t.filter(t=>t!==e)}}publish(e){this.#t.forEach(t=>t(e))}add(e){this.#e.push(e),this.publish(e)}remove(e){return this.#e=this.#e.filter(t=>t.id!==e),e}create(e){const{id:t,message:n="",jsx:r,...o}=e;if(!n&&"function"!=typeof r)return;const a="number"==typeof t?t:Vm++;return this.#e.find(e=>e.id===a)&&(this.#e=this.#e.map(e=>e.id===a?(this.publish({...e,title:n,jsx:r,...o}),{...e,title:n,jsx:r,...o}):e)),this.add({id:a,title:n,jsx:r,...o}),a}update(e,t){const{render:n}=t;let r=t;switch(typeof n){case"function":r={jsx:n,...t};break;case"string":r={title:n,...t}}this.#e=this.#e.map(t=>t.id===e?(this.publish({...t,...r}),{...t,...r}):t)}dismiss(e){return e||this.#e.forEach(e=>this.#t.forEach(t=>t({id:e.id,dismiss:!0}))),this.#t.forEach(t=>t({id:e,dismiss:!0})),e}history(){return this.#e}default(e="",t={}){return this.create({message:e,type:"neutral",...t})}success(e="",t={}){return this.create({message:e,type:"success",...t})}error(e="",t={}){return this.create({message:e,type:"error",...t})}warning(e="",t={}){return this.create({message:e,type:"warning",...t})}info(e="",t={}){return this.create({message:e,type:"info",...t})}custom(e,t={}){return this.create({jsx:e,type:"custom",...t})}},Wm=Object.seal(Object.assign((e,t)=>Gm.default(e,t),{success:Gm.success.bind(Gm),error:Gm.error.bind(Gm),warning:Gm.warning.bind(Gm),info:Gm.info.bind(Gm),custom:Gm.custom.bind(Gm),dismiss:Gm.dismiss.bind(Gm),update:Gm.update.bind(Gm)},{getHistory:Gm.history.bind(Gm)})),Hm={sm:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"}},Qm={sm:{xs:"gap-2",sm:"gap-4",md:"gap-5",lg:"gap-6",xl:"gap-6","2xl":"gap-8"},md:{xs:"md:gap-2",sm:"md:gap-4",md:"md:gap-5",lg:"md:gap-6",xl:"md:gap-6","2xl":"md:gap-8"},lg:{xs:"lg:gap-2",sm:"lg:gap-4",md:"lg:gap-5",lg:"lg:gap-6",xl:"lg:gap-6","2xl":"lg:gap-8"}},$m={sm:{xs:"gap-x-2",sm:"gap-x-4",md:"gap-x-5",lg:"gap-x-6",xl:"gap-x-6","2xl":"gap-x-8"},md:{xs:"md:gap-x-2",sm:"md:gap-x-4",md:"md:gap-x-5",lg:"md:gap-x-6",xl:"md:gap-x-6","2xl":"md:gap-x-8"},lg:{xs:"lg:gap-x-2",sm:"lg:gap-x-4",md:"lg:gap-x-5",lg:"lg:gap-x-6",xl:"lg:gap-x-6","2xl":"lg:gap-x-8"}},Xm={sm:{xs:"gap-y-2",sm:"gap-y-4",md:"gap-y-5",lg:"gap-y-6",xl:"gap-y-6","2xl":"gap-y-8"},md:{xs:"md:gap-y-2",sm:"md:gap-y-4",md:"md:gap-y-5",lg:"md:gap-y-6",xl:"md:gap-y-6","2xl":"md:gap-y-8"},lg:{xs:"lg:gap-y-2",sm:"lg:gap-y-4",md:"lg:gap-y-5",lg:"lg:gap-y-6",xl:"lg:gap-y-6","2xl":"lg:gap-y-8"}},Jm={sm:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},qm={sm:{1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4",5:"col-start-5",6:"col-start-6",7:"col-start-7",8:"col-start-8",9:"col-start-9",10:"col-start-10",11:"col-start-11",12:"col-start-12"},md:{1:"md:col-start-1",2:"md:col-start-2",3:"md:col-start-3",4:"md:col-start-4",5:"md:col-start-5",6:"md:col-start-6",7:"md:col-start-7",8:"md:col-start-8",9:"md:col-start-9",10:"md:col-start-10",11:"md:col-start-11",12:"md:col-start-12"},lg:{1:"lg:col-start-1",2:"lg:col-start-2",3:"lg:col-start-3",4:"lg:col-start-4",5:"lg:col-start-5",6:"lg:col-start-6",7:"lg:col-start-7",8:"lg:col-start-8",9:"lg:col-start-9",10:"lg:col-start-10",11:"lg:col-start-11",12:"lg:col-start-12"}},Km={sm:{row:"grid-flow-row",column:"grid-flow-col","row-dense":"grid-flow-row-dense","column-dense":"grid-flow-col-dense"},md:{row:"md:grid-flow-row",column:"md:grid-flow-col","row-dense":"md:grid-flow-row-dense","column-dense":"md:grid-flow-col-dense"},lg:{row:"lg:grid-flow-row",column:"lg:grid-flow-col","row-dense":"lg:grid-flow-row-dense","column-dense":"lg:grid-flow-col-dense"}},eh={sm:{normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"},md:{normal:"md:justify-normal",start:"md:justify-start",end:"md:justify-end",center:"md:justify-center",between:"md:justify-between",around:"md:justify-around",evenly:"md:justify-evenly",stretch:"md:justify-stretch"},lg:{normal:"lg:justify-normal",start:"lg:justify-start",end:"lg:justify-end",center:"lg:justify-center",between:"lg:justify-between",around:"lg:justify-around",evenly:"lg:justify-evenly",stretch:"lg:justify-stretch"}},th={sm:{start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},md:{start:"md:items-start",end:"md:items-end",center:"md:items-center",baseline:"md:items-baseline",stretch:"md:items-stretch"},lg:{start:"lg:items-start",end:"lg:items-end",center:"lg:items-center",baseline:"lg:items-baseline",stretch:"lg:items-stretch"}},nh={sm:{start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"},md:{start:"md:self-start",end:"md:self-end",center:"md:self-center",baseline:"md:self-baseline",stretch:"md:self-stretch"},lg:{start:"lg:self-start",end:"lg:self-end",center:"lg:self-center",baseline:"lg:self-baseline",stretch:"lg:self-stretch"}},rh={sm:{auto:"justify-self-auto",start:"justify-self-start",end:"justify-self-end",center:"justify-self-center",baseline:"justify-self-baseline",stretch:"justify-self-stretch"},md:{auto:"md:justify-self-auto",start:"md:justify-self-start",end:"md:justify-self-end",center:"md:justify-self-center",baseline:"md:justify-self-baseline",stretch:"md:justify-self-stretch"},lg:{auto:"lg:justify-self-auto",start:"lg:justify-self-start",end:"lg:justify-self-end",center:"lg:justify-self-center",baseline:"lg:justify-self-baseline",stretch:"lg:justify-self-stretch"}},oh={sm:{row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},md:{row:"md:flex-row","row-reverse":"md:flex-row-reverse",column:"md:flex-col","column-reverse":"md:flex-col-reverse"},lg:{row:"lg:flex-row","row-reverse":"lg:flex-row-reverse",column:"lg:flex-col","column-reverse":"lg:flex-col-reverse"}},ah={sm:{wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse",nowrap:"flex-nowrap"},md:{wrap:"md:flex-wrap","wrap-reverse":"md:flex-wrap-reverse",nowrap:"md:flex-nowrap"},lg:{wrap:"lg:flex-wrap","wrap-reverse":"lg:flex-wrap-reverse",nowrap:"lg:flex-nowrap"}},ih={sm:{1:"w-full",2:"w-1/2",3:"w-1/3",4:"w-1/4",5:"w-1/5",6:"w-1/6",7:"w-1/7",8:"w-1/8",9:"w-1/9",10:"w-1/10",11:"w-1/11",12:"w-1/12"},md:{1:"md:w-full",2:"md:w-1/2",3:"md:w-1/3",4:"md:w-1/4",5:"md:w-1/5",6:"md:w-1/6",7:"md:w-1/7",8:"md:w-1/8",9:"md:w-1/9",10:"md:w-1/10",11:"md:w-1/11",12:"md:w-1/12"},lg:{1:"lg:w-full",2:"lg:w-1/2",3:"lg:w-1/3",4:"lg:w-1/4",5:"lg:w-1/5",6:"lg:w-1/6",7:"lg:w-1/7",8:"lg:w-1/8",9:"lg:w-1/9",10:"lg:w-1/10",11:"lg:w-1/11",12:"lg:w-1/12"}},sh={sm:{1:"order-1",2:"order-2",3:"order-3",4:"order-4",5:"order-5",6:"order-6",7:"order-7",8:"order-8",9:"order-9",10:"order-10",11:"order-11",12:"order-12",first:"order-first",last:"order-last",none:"order-none"},md:{1:"md:order-1",2:"md:order-2",3:"md:order-3",4:"md:order-4",5:"md:order-5",6:"md:order-6",7:"md:order-7",8:"md:order-8",9:"md:order-9",10:"md:order-10",11:"md:order-11",12:"md:order-12",first:"md:order-first",last:"md:order-last",none:"md:order-none"},lg:{1:"lg:order-1",2:"lg:order-2",3:"lg:order-3",4:"lg:order-4",5:"lg:order-5",6:"lg:order-6",7:"lg:order-7",8:"lg:order-8",9:"lg:order-9",10:"lg:order-10",11:"lg:order-11",12:"lg:order-12",first:"lg:order-first",last:"lg:order-last",none:"lg:order-none"}},lh={sm:{0:"grow-0",1:"grow"},md:{0:"md:grow-0",1:"md:grow"},lg:{0:"lg:grow-0",1:"lg:grow"}},ch={sm:{0:"shrink-0",1:"shrink"},md:{0:"md:shrink-0",1:"md:shrink"},lg:{0:"lg:shrink-0",1:"lg:shrink"}},uh=(e,t,n,r="sm")=>{const o=[];switch(typeof e){case"object":for(const[r,a]of Object.entries(e))t[r]&&o.push(t?.[r]?.[a]??t?.[r]?.[n?.[r]]??"");break;case"string":case"number":const a=r;o.push(t?.[a]?.[e]??t?.[a]?.[n?.[a]]??"");break;default:if(void 0===e)break;o.push(t?.[r]?.[n]??"")}return o.join(" ")},dh=({className:e,cols:t,gap:n,gapX:r,gapY:o,align:a,justify:i,gridFlow:s,colsSubGrid:l=!1,rowsSubGrid:c=!1,autoRows:u=!1,autoCols:d=!1,children:f,...p})=>{const m=uh(t,Hm,1),h=uh(n,Qm,"sm"),g=uh(r,$m,""),w=uh(o,Xm,""),y=uh(a,th,""),b=uh(i,eh,""),v=uh(s,Km,"");return(0,C.jsx)("div",{className:Se("grid",{"grid-cols-subgrid":l,"grid-rows-subgrid":c,"auto-cols-auto":d,"auto-rows-auto":u},m,h,g,w,y,b,v,e),...p,children:f})};dh.Item=({className:e,children:t,colSpan:n,colStart:r,alignSelf:o,justifySelf:a,...i})=>{const s=uh(n,Jm,0),l=uh(r,qm,0),c=uh(o,nh,""),u=uh(a,rh,"");return(0,C.jsx)("div",{className:Se(s,l,c,u,e),...i,children:t})};const fh=(0,p.createContext)({}),ph=({containerType:e="flex",gap:t="sm",gapX:n,gapY:r,direction:o,justify:a,align:i,wrap:s,cols:l,className:c,children:u,...d})=>{if("grid"===e)return(0,C.jsx)(fh.Provider,{value:{containerType:e},children:(0,C.jsx)(dh,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:u,align:i,justify:a,...d})});const f=uh(s,ah,""),p=uh(t,Qm,"sm"),m=uh(n,$m,""),h=uh(r,Xm,""),g=uh(o,oh,""),w=uh(a,eh,""),y=uh(i,th,""),b=Se("flex",f,p,m,h,g,w,y,c);return(0,C.jsx)(fh.Provider,{value:{containerType:e,cols:l},children:"flex"===e?(0,C.jsx)("div",{className:b,children:u}):(0,C.jsx)(dh,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:u,align:i,justify:a,...d})})},mh=({grow:e,shrink:t,order:n,alignSelf:r,justifySelf:o,className:a,children:i,...s})=>{const{containerType:l,cols:c}=(0,p.useContext)(fh);if("grid"===l)return(0,C.jsx)(dh.Item,{className:a,alignSelf:r,justifySelf:o,children:i,...s});const u=uh(r,nh,""),d=uh(o,rh,""),f=uh(e,lh,0),m=uh(t,ch,0),h=uh(n,sh,0),g=uh(c,ih,1);return(0,C.jsx)("div",{className:Se("box-border",f,m,h,u,d,g,a),children:i})};ph.Item=mh,ph.displayName="Container",mh.displayName="Container.Item";const hh={400:"font-normal",500:"font-medium",600:"font-semibold",700:"font-bold"},gh={36:"text-4xl",30:"text-3xl",24:"text-2xl",20:"text-xl",18:"text-lg",16:"text-base",14:"text-sm",12:"text-xs"},wh={44:"leading-11",38:"leading-9.5",32:"leading-8",30:"leading-7.5",28:"leading-7",24:"leading-6",20:"leading-5",16:"leading-4"},yh={2:"tracking-2"},bh={brand600:"text-brand-primary-600",link:"text-link-primary",primary:"text-text-primary",secondary:"text-text-secondary",tertiary:"text-text-tertiary",disabled:"text-text-disabled",help:"text-field-helper",label:"text-field-label",info:"text-support-info",success:"text-support-success",warning:"text-support-warning",error:"text-support-error",inverse:"text-text-on-color"},vh=(0,p.forwardRef)(function({as:e,children:t,weight:n,size:r,lineHeight:o,letterSpacing:a,color:i="primary",className:s,...l},c){return(0,C.jsx)(e||"p",{ref:c,className:Se("m-0 p-0",n?hh[n]:"",r?gh[r]:"",o?wh[o]:"",a?yh[a]:"",i?bh[i]:"",s),...l,children:t})});var xh=n(442);const Nh=xh.default||xh;function Ih({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))}const Mh=p.forwardRef(Ih);function Eh({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const _h=p.forwardRef(Eh);function Sh({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6a7.5 7.5 0 1 0 7.5 7.5h-7.5V6Z"}),p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5H21A7.5 7.5 0 0 0 13.5 3v7.5Z"}))}const Dh=p.forwardRef(Sh);function jh({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}const kh=p.forwardRef(jh);function Ch({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 18.75h-9m9 0a3 3 0 0 1 3 3h-15a3 3 0 0 1 3-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 0 1-.982-3.172M9.497 14.25a7.454 7.454 0 0 0 .981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 0 0 7.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 0 0 2.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 0 1 2.916.52 6.003 6.003 0 0 1-5.395 4.972m0 0a6.726 6.726 0 0 1-2.749 1.35m0 0a6.772 6.772 0 0 1-3.044 0"}))}const Ah=p.forwardRef(Ch);function Th({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25"}))}const Lh=p.forwardRef(Th);function Oh({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 11.25-3-3m0 0-3 3m3-3v7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const zh=p.forwardRef(Oh);function Ph({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"}))}const Rh=p.forwardRef(Ph),Uh={abtest:"abtest",clone:"duplicate"},Bh=function(e){const{id:t,control_id:n,onClickEvents:r,actions:o,type:a,setUpgradePopupFeature:s=()=>{}}=e,[{license_status:c}]=l();return(0,i.createElement)(Xp,{placement:"bottom-end",className:"wcf-step-row__actions-menu"},(0,i.createElement)(Xp.Trigger,null,(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"[&>svg]:size-5 text-text-secondary hover:text-text-primary","aria-label":(0,j.__)("More Options","cartflows"),icon:(0,i.createElement)(Rh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"})})),(0,i.createElement)(Xp.ContentWrapper,{className:"z-20"},(0,i.createElement)(Xp.Content,{size:"sm",className:"wcf-step-actions-menu__dropdown_menu"},(0,i.createElement)(Xp.List,null,o.map(e=>{var o;const l=e.text;let u=!1,d=!1;if((!wcfCartflowsPro()&&e?.pro||"abtest"===e.slug&&!wcfCartflowsTypePro())&&(u=!0),wcfCartflowsPro()&&e?.pro&&"Activated"!==c&&(d=!0),"automation"===e.slug&&"downsell"!==a&&"upsell"!==a&&"checkout"!==a)return null;const f=u||d,p=f?Uh[e.slug]:void 0,m=!!p;return(0,i.createElement)(Xp.Item,{key:e?.text,disabled:f&&!m,className:`wcf-step__action-btn hover:!bg-brand-25 hover:!text-brand-600 aria-disabled:!text-text-on-button-disabled aria-disabled:hover:!text-text-on-button-disabled aria-disabled:hover:!bg-transparent ${null!==(o=e.class)&&void 0!==o?o:""} ${m?"!text-text-on-button-disabled hover:!text-text-on-button-disabled hover:!bg-transparent":""}`,onClick:()=>{if(m)s(p);else if(!f)if("#"===e?.link&&r[e.slug]){const o={preventDefault:()=>{},target:{getAttribute:r=>"data-action"===r?e.ajaxcall:"data-id"===r?t:"data-control-id"===r?n:null},currentTarget:{getAttribute:r=>"data-action"===r?e.ajaxcall:"data-id"===r?t:"data-control-id"===r?n:null}};r[e.slug](o)}else e?.link&&"#"!==e?.link&&(window.location.href=e.link)}},(0,i.createElement)("span",{className:"flex items-center gap-2"},function(e){let t="";switch(e){case"clone":t=(0,i.createElement)(Mh,{className:"w-4 h-4 stroke-[1.5]"});break;case"delete":t=(0,i.createElement)(_h,{className:"w-4 h-4 stroke-[1.5]"});break;case"abtest":t=(0,i.createElement)(Dh,{className:"w-4 h-4 stroke-[1.5]"});break;case"archived":t=(0,i.createElement)(kh,{className:"w-4 h-4 stroke-[1.5]"});break;case"winner":t=(0,i.createElement)(Ah,{className:"w-4 h-4 stroke-[1.5]"});break;case"automation":t=(0,i.createElement)(Lh,{className:"w-4 h-4 stroke-[1.5]"});break;default:t=(0,i.createElement)(zh,{className:"w-4 h-4 stroke-[1.5]"})}return t}(e.slug),(0,i.createElement)("span",{className:"wcf-step-row__btn-text"},l," ",(u||d)&&(0,i.createElement)("span",{className:"text-brand-600"},(0,j.__)("(Pro)","cartflows")),e?.tag&&(0,i.createElement)("span",{className:"wcf-step-row__btn-text--tag text-brand-brand-600"}," ",e?.tag," "))))})))))},Fh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNzI3XzIzNzEpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPGNpcmNsZSBjeD0iMTciIGN5PSIxNiIgcj0iMyIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNMTQgMjkuNEMxNCAyNy4xNTk4IDE0IDI2LjAzOTcgMTQuNDM2IDI1LjE4NEMxNC44MTk1IDI0LjQzMTQgMTUuNDMxNCAyMy44MTk1IDE2LjE4NCAyMy40MzZDMTcuMDM5NyAyMyAxOC4xNTk4IDIzIDIwLjQgMjNIMTA3LjZDMTA5Ljg0IDIzIDExMC45NiAyMyAxMTEuODE2IDIzLjQzNkMxMTIuNTY5IDIzLjgxOTUgMTEzLjE4MSAyNC40MzE0IDExMy41NjQgMjUuMTg0QzExNCAyNi4wMzk3IDExNCAyNy4xNTk4IDExNCAyOS40VjU0LjZDMTE0IDU2Ljg0MDIgMTE0IDU3Ljk2MDMgMTEzLjU2NCA1OC44MTZDMTEzLjE4MSA1OS41Njg2IDExMi41NjkgNjAuMTgwNSAxMTEuODE2IDYwLjU2NEMxMTAuOTYgNjEgMTA5Ljg0IDYxIDEwNy42IDYxSDIwLjRDMTguMTU5OCA2MSAxNy4wMzk3IDYxIDE2LjE4NCA2MC41NjRDMTUuNDMxNCA2MC4xODA1IDE0LjgxOTUgNTkuNTY4NiAxNC40MzYgNTguODE2QzE0IDU3Ljk2MDMgMTQgNTYuODQwMiAxNCA1NC42VjI5LjRaIiBmaWxsPSIjRTVFN0VCIi8+CjxjaXJjbGUgY3g9IjkxIiBjeT0iNDIiIHI9IjE1IiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNOTAuMDI5MSAzMC45MzI3QzkwLjI3OTQgMjkuOTE4OSA5MS43MjA2IDI5LjkxODkgOTEuOTcwOSAzMC45MzI3TDkzLjgyNTEgMzguNDQzN0M5My45MTQxIDM4LjgwNDMgOTQuMTk1NyAzOS4wODU5IDk0LjU1NjMgMzkuMTc0OUwxMDIuMDY3IDQxLjAyOTFDMTAzLjA4MSA0MS4yNzk0IDEwMy4wODEgNDIuNzIwNiAxMDIuMDY3IDQyLjk3MDlMOTQuNTU2MyA0NC44MjUxQzk0LjE5NTcgNDQuOTE0MSA5My45MTQxIDQ1LjE5NTcgOTMuODI1MSA0NS41NTYzTDkxLjk3MDkgNTMuMDY3M0M5MS43MjA2IDU0LjA4MTEgOTAuMjc5NCA1NC4wODExIDkwLjAyOTEgNTMuMDY3M0w4OC4xNzQ5IDQ1LjU1NjNDODguMDg1OSA0NS4xOTU3IDg3LjgwNDMgNDQuOTE0MSA4Ny40NDM3IDQ0LjgyNTFMNzkuOTMyNyA0Mi45NzA5Qzc4LjkxODkgNDIuNzIwNiA3OC45MTg5IDQxLjI3OTQgNzkuOTMyNyA0MS4wMjkxTDg3LjQ0MzcgMzkuMTc0OUM4Ny44MDQzIDM5LjA4NTkgODguMDg1OSAzOC44MDQzIDg4LjE3NDkgMzguNDQzN0w5MC4wMjkxIDMwLjkzMjdaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgMzZDMjAgMzUuNDQ3NyAyMC40NDc3IDM1IDIxIDM1SDUzQzUzLjU1MjMgMzUgNTQgMzUuNDQ3NyA1NCAzNkM1NCAzNi41NTIzIDUzLjU1MjMgMzcgNTMgMzdIMjFDMjAuNDQ3NyAzNyAyMCAzNi41NTIzIDIwIDM2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIwIDQxQzIwIDQwLjQ0NzcgMjAuNDQ3NyA0MCAyMSA0MEg0NUM0NS41NTIzIDQwIDQ2IDQwLjQ0NzcgNDYgNDFDNDYgNDEuNTUyMyA0NS41NTIzIDQyIDQ1IDQySDIxQzIwLjQ0NzcgNDIgMjAgNDEuNTUyMyAyMCA0MVoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCA0OEMyMCA0Ni44OTU0IDIxLjA2NiA0NiAyMi4zODEgNDZIMzQuNjE5QzM1LjkzNCA0NiAzNyA0Ni44OTU0IDM3IDQ4QzM3IDQ5LjEwNDYgMzUuOTM0IDUwIDM0LjYxOSA1MEgyMi4zODFDMjEuMDY2IDUwIDIwIDQ5LjEwNDYgMjAgNDhaIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgMTZDOTcgMTQuODk1NCA5OC4wNjYgMTQgOTkuMzgxIDE0SDExMS42MTlDMTEyLjkzNCAxNCAxMTQgMTQuODk1NCAxMTQgMTZDMTE0IDE3LjEwNDYgMTEyLjkzNCAxOCAxMTEuNjE5IDE4SDk5LjM4MUM5OC4wNjYgMTggOTcgMTcuMTA0NiA5NyAxNloiIGZpbGw9IiM5Q0EzQUYiLz4KPHBhdGggZD0iTTIyIDc5LjRDMjIgNzcuMTU5OCAyMiA3Ni4wMzk3IDIyLjQzNiA3NS4xODRDMjIuODE5NSA3NC40MzE0IDIzLjQzMTQgNzMuODE5NSAyNC4xODQgNzMuNDM2QzI1LjAzOTcgNzMgMjYuMTU5OCA3MyAyOC40IDczSDU0LjZDNTYuODQwMiA3MyA1Ny45NjAzIDczIDU4LjgxNiA3My40MzZDNTkuNTY4NiA3My44MTk1IDYwLjE4MDUgNzQuNDMxNCA2MC41NjQgNzUuMTg0QzYxIDc2LjAzOTcgNjEgNzcuMTU5OCA2MSA3OS40Vjk3LjZDNjEgOTkuODQwMiA2MSAxMDAuOTYgNjAuNTY0IDEwMS44MTZDNjAuMTgwNSAxMDIuNTY5IDU5LjU2ODYgMTAzLjE4MSA1OC44MTYgMTAzLjU2NEM1Ny45NjAzIDEwNCA1Ni44NDAyIDEwNCA1NC42IDEwNEgyOC40QzI2LjE1OTggMTA0IDI1LjAzOTcgMTA0IDI0LjE4NCAxMDMuNTY0QzIzLjQzMTQgMTAzLjE4MSAyMi44MTk1IDEwMi41NjkgMjIuNDM2IDEwMS44MTZDMjIgMTAwLjk2IDIyIDk5Ljg0MDIgMjIgOTcuNlY3OS40WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDg4QzcwIDg3LjQ0NzcgNzAuNDQ3NyA4NyA3MSA4N0gxMDNDMTAzLjU1MiA4NyAxMDQgODcuNDQ3NyAxMDQgODhDMTA0IDg4LjU1MjMgMTAzLjU1MiA4OSAxMDMgODlINzFDNzAuNDQ3NyA4OSA3MCA4OC41NTIzIDcwIDg4WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDgzQzcwIDgyLjQ0NzcgNzAuNDQ3NyA4MiA3MSA4MkgxMDNDMTAzLjU1MiA4MiAxMDQgODIuNDQ3NyAxMDQgODNDMTA0IDgzLjU1MjMgMTAzLjU1MiA4NCAxMDMgODRINzFDNzAuNDQ3NyA4NCA3MCA4My41NTIzIDcwIDgzWiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDc3QzcwIDc2LjQ0NzcgNzAuNDQ3NyA3NiA3MSA3Nkg4N0M4Ny41NTIzIDc2IDg4IDc2LjQ0NzcgODggNzdDODggNzcuNTUyMyA4Ny41NTIzIDc4IDg3IDc4SDcxQzcwLjQ0NzcgNzggNzAgNzcuNTUyMyA3MCA3N1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03MCA5M0M3MCA5Mi40NDc3IDcwLjQ0NzcgOTIgNzEgOTJIOTVDOTUuNTUyMyA5MiA5NiA5Mi40NDc3IDk2IDkzQzk2IDkzLjU1MjMgOTUuNTUyMyA5NCA5NSA5NEg3MUM3MC40NDc3IDk0IDcwIDkzLjU1MjMgNzAgOTNaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMTAwQzcwIDk4Ljg5NTQgNzEuMDY2IDk4IDcyLjM4MSA5OEg4NC42MTlDODUuOTM0IDk4IDg3IDk4Ljg5NTQgODcgMTAwQzg3IDEwMS4xMDUgODUuOTM0IDEwMiA4NC42MTkgMTAySDcyLjM4MUM3MS4wNjYgMTAyIDcwIDEwMS4xMDUgNzAgMTAwWiIgZmlsbD0iIzlDQTNBRiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzcyN18yMzcxIiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIvPgo8ZmVPZmZzZXQgZHk9IjQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMTYgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",Yh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNzI3XzIzNzMpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPHBhdGggZD0iTTggMTcuNkM4IDE0LjIzOTcgOCAxMi41NTk1IDguNjUzOTYgMTEuMjc2MUM5LjIyOTIgMTAuMTQ3MSAxMC4xNDcxIDkuMjI5MiAxMS4yNzYxIDguNjUzOTZDMTIuNTU5NSA4IDE0LjIzOTcgOCAxNy42IDhIMTEwLjRDMTEzLjc2IDggMTE1LjQ0IDggMTE2LjcyNCA4LjY1Mzk2QzExNy44NTMgOS4yMjkyIDExOC43NzEgMTAuMTQ3MSAxMTkuMzQ2IDExLjI3NjFDMTIwIDEyLjU1OTUgMTIwIDE0LjIzOTcgMTIwIDE3LjZWNDBIOFYxNy42WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCAyNkMyMCAyNC44OTU0IDIxLjA2NiAyNCAyMi4zODEgMjRIMzQuNjE5QzM1LjkzNCAyNCAzNyAyNC44OTU0IDM3IDI2QzM3IDI3LjEwNDYgMzUuOTM0IDI4IDM0LjYxOSAyOEgyMi4zODFDMjEuMDY2IDI4IDIwIDI3LjEwNDYgMjAgMjZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgMzNDMjAgMzIuNDQ3NyAyMC40NDc3IDMyIDIxIDMySDUzQzUzLjU1MjMgMzIgNTQgMzIuNDQ3NyA1NCAzM0M1NCAzMy41NTIzIDUzLjU1MjMgMzQgNTMgMzRIMjFDMjAuNDQ3NyAzNCAyMCAzMy41NTIzIDIwIDMzWiIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9Ijk2IiBjeT0iMzEiIHI9IjMiIGZpbGw9IiNFNUU3RUIiLz4KPGNpcmNsZSBjeD0iODciIGN5PSIzMSIgcj0iMyIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSIxMDUiIGN5PSIzMSIgcj0iMyIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDE2LjAwMDJDNzAgMTUuNDQ4IDcwLjQ0NzcgMTUuMDAwMiA3MSAxNS4wMDAySDc5Qzc5LjU1MjMgMTUuMDAwMiA4MCAxNS40NDggODAgMTYuMDAwMkM4MCAxNi41NTI1IDc5LjU1MjMgMTcuMDAwMiA3OSAxNy4wMDAySDcxQzcwLjQ0NzcgMTcuMDAwMiA3MCAxNi41NTI1IDcwIDE2LjAwMDJaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODQgMTYuMDAwMkM4NCAxNS40NDggODQuNDQ3NyAxNS4wMDAyIDg1IDE1LjAwMDJIOTNDOTMuNTUyMyAxNS4wMDAyIDk0IDE1LjQ0OCA5NCAxNi4wMDAyQzk0IDE2LjU1MjUgOTMuNTUyMyAxNy4wMDAyIDkzIDE3LjAwMDJIODVDODQuNDQ3NyAxNy4wMDAyIDg0IDE2LjU1MjUgODQgMTYuMDAwMloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OCAxNkM5OCAxNS40NDc3IDk4LjQ0NzcgMTUgOTkgMTVIMTA3QzEwNy41NTIgMTUgMTA4IDE1LjQ0NzcgMTA4IDE2QzEwOCAxNi41NTIzIDEwNy41NTIgMTcgMTA3IDE3SDk5Qzk4LjQ0NzcgMTcgOTggMTYuNTUyMyA5OCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDU2QzIwIDU0Ljg5NTQgMjAuODk1NCA1NCAyMiA1NEg2M0M2NC4xMDQ2IDU0IDY1IDU0Ljg5NTQgNjUgNTZWNThDNjUgNTkuMTA0NiA2NC4xMDQ2IDYwIDYzIDYwSDIyQzIwLjg5NTQgNjAgMjAgNTkuMTA0NiAyMCA1OFY1NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDY2QzIwIDY0Ljg5NTQgMjAuODk1NCA2NCAyMiA2NEg2M0M2NC4xMDQ2IDY0IDY1IDY0Ljg5NTQgNjUgNjZWNjhDNjUgNjkuMTA0NiA2NC4xMDQ2IDcwIDYzIDcwSDIyQzIwLjg5NTQgNzAgMjAgNjkuMTA0NiAyMCA2OFY2NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDg2QzIwIDg0Ljg5NTQgMjAuODk1NCA4NCAyMiA4NEg2M0M2NC4xMDQ2IDg0IDY1IDg0Ljg5NTQgNjUgODZWOThDNjUgOTkuMTA0NiA2NC4xMDQ2IDEwMCA2MyAxMDBIMjJDMjAuODk1NCAxMDAgMjAgOTkuMTA0NiAyMCA5OFY4NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCA0OUMyMCA0OC40NDc3IDIwLjQ0NzcgNDggMjEgNDhIMzdDMzcuNTUyMyA0OCAzOCA0OC40NDc3IDM4IDQ5QzM4IDQ5LjU1MjMgMzcuNTUyMyA1MCAzNyA1MEgyMUMyMC40NDc3IDUwIDIwIDQ5LjU1MjMgMjAgNDlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgNzlDMjAgNzguNDQ3NyAyMC40NDc3IDc4IDIxIDc4SDM3QzM3LjU1MjMgNzggMzggNzguNDQ3NyAzOCA3OUMzOCA3OS41NTIzIDM3LjU1MjMgODAgMzcgODBIMjFDMjAuNDQ3NyA4MCAyMCA3OS41NTIzIDIwIDc5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNMjAgMTA2QzIwIDEwNC44OTUgMjAuODk1NCAxMDQgMjIgMTA0SDYzQzY0LjEwNDYgMTA0IDY1IDEwNC44OTUgNjUgMTA2VjEwOEM2NSAxMDkuMTA1IDY0LjEwNDYgMTEwIDYzIDExMEgyMkMyMC44OTU0IDExMCAyMCAxMDkuMTA1IDIwIDEwOFYxMDZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik03NCA5M0M3NCA5MS44OTU0IDc0Ljg5NTQgOTEgNzYgOTFIOTNDOTQuMTA0NiA5MSA5NSA5MS44OTU0IDk1IDkzVjk1Qzk1IDk2LjEwNDYgOTQuMTA0NiA5NyA5MyA5N0g3NkM3NC44OTU0IDk3IDc0IDk2LjEwNDYgNzQgOTVWOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik05NyA5M0M5NyA5MS44OTU0IDk3Ljg5NTQgOTEgOTkgOTFIMTA2QzEwNy4xMDUgOTEgMTA4IDkxLjg5NTQgMTA4IDkzVjk1QzEwOCA5Ni4xMDQ2IDEwNy4xMDUgOTcgMTA2IDk3SDk5Qzk3Ljg5NTQgOTcgOTcgOTYuMTA0NiA5NyA5NVY5M1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTc0IDU2Qzc0IDU0Ljg5NTQgNzQuODk1NCA1NCA3NiA1NEgxMDZDMTA3LjEwNSA1NCAxMDggNTQuODk1NCAxMDggNTZWODRDMTA4IDg1LjEwNDYgMTA3LjEwNSA4NiAxMDYgODZINzZDNzQuODk1NCA4NiA3NCA4NS4xMDQ2IDc0IDg0VjU2WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03NiA1M0gxMDZDMTA3LjY1NyA1MyAxMDkgNTQuMzQzMSAxMDkgNTZWODRDMTA5IDg1LjY1NjkgMTA3LjY1NyA4NyAxMDYgODdINzZDNzQuMzQzMSA4NyA3MyA4NS42NTY5IDczIDg0VjU2QzczIDU0LjM0MzEgNzQuMzQzMSA1MyA3NiA1M1pNNzYgNTRDNzQuODk1NCA1NCA3NCA1NC44OTU0IDc0IDU2Vjg0Qzc0IDg1LjEwNDYgNzQuODk1NCA4NiA3NiA4NkgxMDZDMTA3LjEwNSA4NiAxMDggODUuMTA0NiAxMDggODRWNTZDMTA4IDU0Ljg5NTQgMTA3LjEwNSA1NCAxMDYgNTRINzZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzcgODFDNzcgODAuNDQ3NyA3Ny40NDc3IDgwIDc4IDgwSDgzQzgzLjU1MjMgODAgODQgODAuNDQ3NyA4NCA4MUM4NCA4MS41NTIzIDgzLjU1MjMgODIgODMgODJINzhDNzcuNDQ3NyA4MiA3NyA4MS41NTIzIDc3IDgxWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTc3IDc2Qzc3IDc1LjQ0NzcgNzcuNDQ3NyA3NSA3OCA3NUg4N0M4Ny41NTIzIDc1IDg4IDc1LjQ0NzcgODggNzZDODggNzYuNTUyMyA4Ny41NTIzIDc3IDg3IDc3SDc4Qzc3LjQ0NzcgNzcgNzcgNzYuNTUyMyA3NyA3NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04NiA2NkM4NiA2NS40NDc3IDg2LjQ0NzcgNjUgODcgNjVIOTRDOTQuNTUyMyA2NSA5NSA2NS40NDc3IDk1IDY2Qzk1IDY2LjU1MjMgOTQuNTUyMyA2NyA5NCA2N0g4N0M4Ni40NDc3IDY3IDg2IDY2LjU1MjMgODYgNjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODYgNjlDODYgNjguNDQ3NyA4Ni40NDc3IDY4IDg3IDY4SDg4Qzg4LjU1MjMgNjggODkgNjguNDQ3NyA4OSA2OUM4OSA2OS41NTIzIDg4LjU1MjMgNzAgODggNzBIODdDODYuNDQ3NyA3MCA4NiA2OS41NTIzIDg2IDY5WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTc3IDU5Qzc3IDU4LjQ0NzcgNzcuNDQ3NyA1OCA3OCA1OEg4NUM4NS41NTIzIDU4IDg2IDU4LjQ0NzcgODYgNTlDODYgNTkuNTUyMyA4NS41NTIzIDYwIDg1IDYwSDc4Qzc3LjQ0NzcgNjAgNzcgNTkuNTUyMyA3NyA1OVoiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05NyA4MUM5NyA4MC40NDc3IDk3LjQ0NzcgODAgOTggODBIMTA0QzEwNC41NTIgODAgMTA1IDgwLjQ0NzcgMTA1IDgxQzEwNSA4MS41NTIzIDEwNC41NTIgODIgMTA0IDgySDk4Qzk3LjQ0NzcgODIgOTcgODEuNTUyMyA5NyA4MVoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OSA3NkM5OSA3NS40NDc3IDk5LjQ0NzcgNzUgMTAwIDc1SDEwNEMxMDQuNTUyIDc1IDEwNSA3NS40NDc3IDEwNSA3NkMxMDUgNzYuNTUyMyAxMDQuNTUyIDc3IDEwNCA3N0gxMDBDOTkuNDQ3NyA3NyA5OSA3Ni41NTIzIDk5IDc2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTk5IDY4Qzk5IDY3LjQ0NzcgOTkuNDQ3NyA2NyAxMDAgNjdIMTA0QzEwNC41NTIgNjcgMTA1IDY3LjQ0NzcgMTA1IDY4QzEwNSA2OC41NTIzIDEwNC41NTIgNjkgMTA0IDY5SDEwMEM5OS40NDc3IDY5IDk5IDY4LjU1MjMgOTkgNjhaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgNTlDOTcgNTguNDQ3NyA5Ny40NDc3IDU4IDk4IDU4SDEwNEMxMDQuNTUyIDU4IDEwNSA1OC40NDc3IDEwNSA1OUMxMDUgNTkuNTUyMyAxMDQuNTUyIDYwIDEwNCA2MEg5OEM5Ny40NDc3IDYwIDk3IDU5LjU1MjMgOTcgNTlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik03NyA2NkM3NyA2NC44OTU0IDc3Ljg5NTQgNjQgNzkgNjRIODJDODMuMTA0NiA2NCA4NCA2NC44OTU0IDg0IDY2VjY5Qzg0IDcwLjEwNDYgODMuMTA0NiA3MSA4MiA3MUg3OUM3Ny44OTU0IDcxIDc3IDcwLjEwNDYgNzcgNjlWNjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzMgNDlDNzMgNDguNDQ3NyA3My40NDc3IDQ4IDc0IDQ4SDkwQzkwLjU1MjMgNDggOTEgNDguNDQ3NyA5MSA0OUM5MSA0OS41NTIzIDkwLjU1MjMgNTAgOTAgNTBINzRDNzMuNDQ3NyA1MCA3MyA0OS41NTIzIDczIDQ5WiIgZmlsbD0iI0QxRDVEQiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzcyN18yMzczIiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIvPgo8ZmVPZmZzZXQgZHk9IjQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMTYgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",Zh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMTAzM18xMDEyNSkiPgo8cmVjdCB4PSI4IiB5PSI4IiB3aWR0aD0iMTEyIiBoZWlnaHQ9IjExMiIgcng9IjYiIGZpbGw9IiNGOUZBRkIiLz4KPC9nPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODQgMTZDODQgMTUuNDQ3NyA4NC40NDc3IDE1IDg1IDE1SDkzQzkzLjU1MjMgMTUgOTQgMTUuNDQ3NyA5NCAxNkM5NCAxNi41NTIzIDkzLjU1MjMgMTcgOTMgMTdIODVDODQuNDQ3NyAxNyA4NCAxNi41NTIzIDg0IDE2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDE2QzcwIDE1LjQ0NzcgNzAuNDQ3NyAxNSA3MSAxNUg3OUM3OS41NTIzIDE1IDgwIDE1LjQ0NzcgODAgMTZDODAgMTYuNTUyMyA3OS41NTIzIDE3IDc5IDE3SDcxQzcwLjQ0NzcgMTcgNzAgMTYuNTUyMyA3MCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OCAxNkM5OCAxNS40NDc3IDk4LjQ0NzcgMTUgOTkgMTVIMTA3QzEwNy41NTIgMTUgMTA4IDE1LjQ0NzcgMTA4IDE2QzEwOCAxNi41NTIzIDEwNy41NTIgMTcgMTA3IDE3SDk5Qzk4LjQ0NzcgMTcgOTggMTYuNTUyMyA5OCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTI3IDUxQzI3IDQ4Ljc5MDkgMjguNzkwOSA0NyAzMSA0N0g5N0M5OS4yMDkxIDQ3IDEwMSA0OC43OTA5IDEwMSA1MVY3OUMxMDEgODEuMjA5MSA5OS4yMDkxIDgzIDk3IDgzSDMxQzI4Ljc5MDkgODMgMjcgODEuMjA5MSAyNyA3OVY1MVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzEgNDZIOTdDOTkuNzYxNCA0NiAxMDIgNDguMjM4NiAxMDIgNTFWNzlDMTAyIDgxLjc2MTQgOTkuNzYxNCA4NCA5NyA4NEgzMUMyOC4yMzg2IDg0IDI2IDgxLjc2MTQgMjYgNzlWNTFDMjYgNDguMjM4NiAyOC4yMzg2IDQ2IDMxIDQ2Wk0zMSA0N0MyOC43OTA5IDQ3IDI3IDQ4Ljc5MDkgMjcgNTFWNzlDMjcgODEuMjA5MSAyOC43OTA5IDgzIDMxIDgzSDk3Qzk5LjIwOTEgODMgMTAxIDgxLjIwOTEgMTAxIDc5VjUxQzEwMSA0OC43OTA5IDk5LjIwOTEgNDcgOTcgNDdIMzFaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik0zMCA1My4yQzMwIDUyLjA3OTkgMzAgNTEuNTE5OCAzMC4yMTggNTEuMDkyQzMwLjQwOTcgNTAuNzE1NyAzMC43MTU3IDUwLjQwOTcgMzEuMDkyIDUwLjIxOEMzMS41MTk4IDUwIDMyLjA3OTkgNTAgMzMuMiA1MEg1Ni44QzU3LjkyMDEgNTAgNTguNDgwMiA1MCA1OC45MDggNTAuMjE4QzU5LjI4NDMgNTAuNDA5NyA1OS41OTAzIDUwLjcxNTcgNTkuNzgyIDUxLjA5MkM2MCA1MS41MTk4IDYwIDUyLjA3OTkgNjAgNTMuMlY3Ni44QzYwIDc3LjkyMDEgNjAgNzguNDgwMiA1OS43ODIgNzguOTA4QzU5LjU5MDMgNzkuMjg0MyA1OS4yODQzIDc5LjU5MDMgNTguOTA4IDc5Ljc4MkM1OC40ODAyIDgwIDU3LjkyMDEgODAgNTYuOCA4MEgzMy4yQzMyLjA3OTkgODAgMzEuNTE5OCA4MCAzMS4wOTIgNzkuNzgyQzMwLjcxNTcgNzkuNTkwMyAzMC40MDk3IDc5LjI4NDMgMzAuMjE4IDc4LjkwOEMzMCA3OC40ODAyIDMwIDc3LjkyMDEgMzAgNzYuOFY1My4yWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDYzQzYzIDYyLjQ0NzcgNjMuNDQ3NyA2MiA2NCA2Mkg4OEM4OC41NTIzIDYyIDg5IDYyLjQ0NzcgODkgNjNDODkgNjMuNTUyMyA4OC41NTIzIDY0IDg4IDY0SDY0QzYzLjQ0NzcgNjQgNjMgNjMuNTUyMyA2MyA2M1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA1OUM2MyA1OC40NDc3IDYzLjQ0NzcgNTggNjQgNThIOTRDOTQuNTUyMyA1OCA5NSA1OC40NDc3IDk1IDU5Qzk1IDU5LjU1MjMgOTQuNTUyMyA2MCA5NCA2MEg2NEM2My40NDc3IDYwIDYzIDU5LjU1MjMgNjMgNTlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNTRDNjMgNTMuNDQ3NyA2My40NDc3IDUzIDY0IDUzSDc2Qzc2LjU1MjMgNTMgNzcgNTMuNDQ3NyA3NyA1NEM3NyA1NC41NTIzIDc2LjU1MjMgNTUgNzYgNTVINjRDNjMuNDQ3NyA1NSA2MyA1NC41NTIzIDYzIDU0WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTgzIDc1QzgzIDc0LjQ0NzcgODMuMzUxOCA3NCA4My43ODU3IDc0SDkzLjIxNDNDOTMuNjQ4MiA3NCA5NCA3NC40NDc3IDk0IDc1Qzk0IDc1LjU1MjMgOTMuNjQ4MiA3NiA5My4yMTQzIDc2SDgzLjc4NTdDODMuMzUxOCA3NiA4MyA3NS41NTIzIDgzIDc1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDY4QzYzIDY3LjQ0NzcgNjMuNDQ3NyA2NyA2NCA2N0g2NkM2Ni41NTIzIDY3IDY3IDY3LjQ0NzcgNjcgNjhDNjcgNjguNTUyMyA2Ni41NTIzIDY5IDY2IDY5SDY0QzYzLjQ0NzcgNjkgNjMgNjguNTUyMyA2MyA2OFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02OSA2OEM2OSA2Ny40NDc3IDY5LjQ0NzcgNjcgNzAgNjdINzNDNzMuNTUyMyA2NyA3NCA2Ny40NDc3IDc0IDY4Qzc0IDY4LjU1MjMgNzMuNTUyMyA2OSA3MyA2OUg3MEM2OS40NDc3IDY5IDY5IDY4LjU1MjMgNjkgNjhaIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNzVDNjMgNzMuODk1NCA2NC4wNjYgNzMgNjUuMzgxIDczSDc3LjYxOUM3OC45MzQgNzMgODAgNzMuODk1NCA4MCA3NUM4MCA3Ni4xMDQ2IDc4LjkzNCA3NyA3Ny42MTkgNzdINjUuMzgxQzY0LjA2NiA3NyA2MyA3Ni4xMDQ2IDYzIDc1WiIgZmlsbD0iIzlDQTNBRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4IDM3QzQ4IDM2LjQ0NzcgNDguNDQ3NyAzNiA0OSAzNkg3OUM3OS41NTIzIDM2IDgwIDM2LjQ0NzcgODAgMzdDODAgMzcuNTUyMyA3OS41NTIzIDM4IDc5IDM4SDQ5QzQ4LjQ0NzcgMzggNDggMzcuNTUyMyA0OCAzN1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01NyAzMkM1NyAzMS40NDc3IDU3LjQ0NzcgMzEgNTggMzFINzBDNzAuNTUyMyAzMSA3MSAzMS40NDc3IDcxIDMyQzcxIDMyLjU1MjMgNzAuNTUyMyAzMyA3MCAzM0g1OEM1Ny40NDc3IDMzIDU3IDMyLjU1MjMgNTcgMzJaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik00NC4wMjYxIDU0LjE4MjdDNDQuMjY2MSA1My4xNTE4IDQ1LjczMzkgNTMuMTUxOCA0NS45NzM5IDU0LjE4MjdMNDcuNDQ4NiA2MC41MTZDNDcuNTYxNCA2MS4wMDAxIDQ4LjAxMjYgNjEuMzI4IDQ4LjUwNzkgNjEuMjg1Nkw1NC45ODY5IDYwLjczMUM1Ni4wNDE1IDYwLjY0MDcgNTYuNDk1MSA2Mi4wMzY3IDU1LjU4ODggNjIuNTgzNkw1MC4wMjEyIDY1Ljk0MzJDNDkuNTk1NiA2Ni4yIDQ5LjQyMzMgNjYuNzMwNCA0OS42MTY2IDY3LjE4ODRMNTIuMTQ2MiA3My4xNzg5QzUyLjU1NzkgNzQuMTU0IDUxLjM3MDUgNzUuMDE2OCA1MC41NzAzIDc0LjMyMzhMNDUuNjU0NiA3MC4wNjY5QzQ1LjI3ODkgNjkuNzQxNSA0NC43MjExIDY5Ljc0MTUgNDQuMzQ1NCA3MC4wNjY5TDM5LjQyOTcgNzQuMzIzOEMzOC42Mjk1IDc1LjAxNjggMzcuNDQyMSA3NC4xNTQgMzcuODUzOCA3My4xNzg5TDQwLjM4MzQgNjcuMTg4NEM0MC41NzY3IDY2LjczMDQgNDAuNDA0NCA2Ni4yIDM5Ljk3ODggNjUuOTQzMkwzNC40MTEyIDYyLjU4MzZDMzMuNTA0OSA2Mi4wMzY3IDMzLjk1ODQgNjAuNjQwNyAzNS4wMTMxIDYwLjczMUw0MS40OTIxIDYxLjI4NTZDNDEuOTg3NCA2MS4zMjggNDIuNDM4NiA2MS4wMDAxIDQyLjU1MTQgNjAuNTE2TDQ0LjAyNjEgNTQuMTgyN1oiIGZpbGw9IiNEMUQ1REIiLz4KPGRlZnM+CjxmaWx0ZXIgaWQ9ImZpbHRlcjBfZF8xMDMzXzEwMTI1IiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd18xMDMzXzEwMTI1Ii8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzEwMzNfMTAxMjUiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTAzM18xMDEyNSIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",Vh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMzI1Ml8xMjc0MDIpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPGNpcmNsZSBjeD0iMTciIGN5PSIxNiIgcj0iMyIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg0IDE2Qzg0IDE1LjQ0NzcgODQuNDQ3NyAxNSA4NSAxNUg5M0M5My41NTIzIDE1IDk0IDE1LjQ0NzcgOTQgMTZDOTQgMTYuNTUyMyA5My41NTIzIDE3IDkzIDE3SDg1Qzg0LjQ0NzcgMTcgODQgMTYuNTUyMyA4NCAxNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03MCAxNkM3MCAxNS40NDc3IDcwLjQ0NzcgMTUgNzEgMTVINzlDNzkuNTUyMyAxNSA4MCAxNS40NDc3IDgwIDE2QzgwIDE2LjU1MjMgNzkuNTUyMyAxNyA3OSAxN0g3MUM3MC40NDc3IDE3IDcwIDE2LjU1MjMgNzAgMTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTggMTZDOTggMTUuNDQ3NyA5OC40NDc3IDE1IDk5IDE1SDEwN0MxMDcuNTUyIDE1IDEwOCAxNS40NDc3IDEwOCAxNkMxMDggMTYuNTUyMyAxMDcuNTUyIDE3IDEwNyAxN0g5OUM5OC40NDc3IDE3IDk4IDE2LjU1MjMgOTggMTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik0yNyA1MUMyNyA0OC43OTA5IDI4Ljc5MDkgNDcgMzEgNDdIOTdDOTkuMjA5MSA0NyAxMDEgNDguNzkwOSAxMDEgNTFWNzlDMTAxIDgxLjIwOTEgOTkuMjA5MSA4MyA5NyA4M0gzMUMyOC43OTA5IDgzIDI3IDgxLjIwOTEgMjcgNzlWNTFaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMxIDQ2SDk3Qzk5Ljc2MTQgNDYgMTAyIDQ4LjIzODYgMTAyIDUxVjc5QzEwMiA4MS43NjE0IDk5Ljc2MTQgODQgOTcgODRIMzFDMjguMjM4NiA4NCAyNiA4MS43NjE0IDI2IDc5VjUxQzI2IDQ4LjIzODYgMjguMjM4NiA0NiAzMSA0NlpNMzEgNDdDMjguNzkwOSA0NyAyNyA0OC43OTA5IDI3IDUxVjc5QzI3IDgxLjIwOTEgMjguNzkwOSA4MyAzMSA4M0g5N0M5OS4yMDkxIDgzIDEwMSA4MS4yMDkxIDEwMSA3OVY1MUMxMDEgNDguNzkwOSA5OS4yMDkxIDQ3IDk3IDQ3SDMxWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBkPSJNMzAgNTMuMkMzMCA1Mi4wNzk5IDMwIDUxLjUxOTggMzAuMjE4IDUxLjA5MkMzMC40MDk3IDUwLjcxNTcgMzAuNzE1NyA1MC40MDk3IDMxLjA5MiA1MC4yMThDMzEuNTE5OCA1MCAzMi4wNzk5IDUwIDMzLjIgNTBINTYuOEM1Ny45MjAxIDUwIDU4LjQ4MDIgNTAgNTguOTA4IDUwLjIxOEM1OS4yODQzIDUwLjQwOTcgNTkuNTkwMyA1MC43MTU3IDU5Ljc4MiA1MS4wOTJDNjAgNTEuNTE5OCA2MCA1Mi4wNzk5IDYwIDUzLjJWNzYuOEM2MCA3Ny45MjAxIDYwIDc4LjQ4MDIgNTkuNzgyIDc4LjkwOEM1OS41OTAzIDc5LjI4NDMgNTkuMjg0MyA3OS41OTAzIDU4LjkwOCA3OS43ODJDNTguNDgwMiA4MCA1Ny45MjAxIDgwIDU2LjggODBIMzMuMkMzMi4wNzk5IDgwIDMxLjUxOTggODAgMzEuMDkyIDc5Ljc4MkMzMC43MTU3IDc5LjU5MDMgMzAuNDA5NyA3OS4yODQzIDMwLjIxOCA3OC45MDhDMzAgNzguNDgwMiAzMCA3Ny45MjAxIDMwIDc2LjhWNTMuMloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA2M0M2MyA2Mi40NDc3IDYzLjQ0NzcgNjIgNjQgNjJIODhDODguNTUyMyA2MiA4OSA2Mi40NDc3IDg5IDYzQzg5IDYzLjU1MjMgODguNTUyMyA2NCA4OCA2NEg2NEM2My40NDc3IDY0IDYzIDYzLjU1MjMgNjMgNjNaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNTlDNjMgNTguNDQ3NyA2My40NDc3IDU4IDY0IDU4SDk0Qzk0LjU1MjMgNTggOTUgNTguNDQ3NyA5NSA1OUM5NSA1OS41NTIzIDk0LjU1MjMgNjAgOTQgNjBINjRDNjMuNDQ3NyA2MCA2MyA1OS41NTIzIDYzIDU5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDU0QzYzIDUzLjQ0NzcgNjMuNDQ3NyA1MyA2NCA1M0g3NkM3Ni41NTIzIDUzIDc3IDUzLjQ0NzcgNzcgNTRDNzcgNTQuNTUyMyA3Ni41NTIzIDU1IDc2IDU1SDY0QzYzLjQ0NzcgNTUgNjMgNTQuNTUyMyA2MyA1NFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA2OEM2MyA2Ny40NDc3IDYzLjQ0NzcgNjcgNjQgNjdINjZDNjYuNTUyMyA2NyA2NyA2Ny40NDc3IDY3IDY4QzY3IDY4LjU1MjMgNjYuNTUyMyA2OSA2NiA2OUg2NEM2My40NDc3IDY5IDYzIDY4LjU1MjMgNjMgNjhaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjkgNjhDNjkgNjcuNDQ3NyA2OS40NDc3IDY3IDcwIDY3SDczQzczLjU1MjMgNjcgNzQgNjcuNDQ3NyA3NCA2OEM3NCA2OC41NTIzIDczLjU1MjMgNjkgNzMgNjlINzBDNjkuNDQ3NyA2OSA2OSA2OC41NTIzIDY5IDY4WiIgZmlsbD0iIzlDQTNBRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDc1QzYzIDczLjg5NTQgNjQuMDY2IDczIDY1LjM4MSA3M0g4MS42MTlDODIuOTM0IDczIDg0IDczLjg5NTQgODQgNzVDODQgNzYuMTA0NiA4Mi45MzQgNzcgODEuNjE5IDc3SDY1LjM4MUM2NC4wNjYgNzcgNjMgNzYuMTA0NiA2MyA3NVoiIGZpbGw9IiM5Q0EzQUYiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00OCAzN0M0OCAzNi40NDc3IDQ4LjQ0NzcgMzYgNDkgMzZINzlDNzkuNTUyMyAzNiA4MCAzNi40NDc3IDgwIDM3QzgwIDM3LjU1MjMgNzkuNTUyMyAzOCA3OSAzOEg0OUM0OC40NDc3IDM4IDQ4IDM3LjU1MjMgNDggMzdaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNTcgMzJDNTcgMzEuNDQ3NyA1Ny40NDc3IDMxIDU4IDMxSDcwQzcwLjU1MjMgMzEgNzEgMzEuNDQ3NyA3MSAzMkM3MSAzMi41NTIzIDcwLjU1MjMgMzMgNzAgMzNINThDNTcuNDQ3NyAzMyA1NyAzMi41NTIzIDU3IDMyWiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNDMuMDY4OCA1Ny4xNzI3QzQzLjYwMDEgNTUuMTk5MyA0Ni4zOTk5IDU1LjE5OTMgNDYuOTMxMiA1Ny4xNzI3TDQ3Ljg4MjYgNjAuNzA2MUM0OC4wNjc5IDYxLjM5NDQgNDguNjA1NiA2MS45MzIxIDQ5LjI5MzkgNjIuMTE3NEw1Mi44MjczIDYzLjA2ODhDNTQuODAwNyA2My42MDAxIDU0LjgwMDcgNjYuMzk5OSA1Mi44MjczIDY2LjkzMTJMNDkuMjkzOSA2Ny44ODI2QzQ4LjYwNTYgNjguMDY3OSA0OC4wNjc5IDY4LjYwNTYgNDcuODgyNiA2OS4yOTM5TDQ2LjkzMTIgNzIuODI3M0M0Ni4zOTk5IDc0LjgwMDcgNDMuNjAwMSA3NC44MDA3IDQzLjA2ODggNzIuODI3M0w0Mi4xMTc0IDY5LjI5MzlDNDEuOTMyMSA2OC42MDU2IDQxLjM5NDQgNjguMDY3OSA0MC43MDYxIDY3Ljg4MjZMMzcuMTcyNyA2Ni45MzEyQzM1LjE5OTMgNjYuMzk5OSAzNS4xOTkzIDYzLjYwMDEgMzcuMTcyNyA2My4wNjg4TDQwLjcwNjEgNjIuMTE3NEM0MS4zOTQ0IDYxLjkzMjEgNDEuOTMyMSA2MS4zOTQ0IDQyLjExNzQgNjAuNzA2MUw0My4wNjg4IDU3LjE3MjdaIiBmaWxsPSIjRDFENURCIi8+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMzI1Ml8xMjc0MDIiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIi8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=",Gh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMjEzNl8xMjUzNjgpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPHBhdGggZD0iTTggMTcuNkM4IDE0LjIzOTcgOCAxMi41NTk1IDguNjUzOTYgMTEuMjc2MUM5LjIyOTIgMTAuMTQ3MSAxMC4xNDcxIDkuMjI5MiAxMS4yNzYxIDguNjUzOTZDMTIuNTU5NSA4IDE0LjIzOTcgOCAxNy42IDhINDZWNzAuNEM0NiA3My43NjAzIDQ2IDc1LjQ0MDUgNDUuMzQ2IDc2LjcyMzlDNDQuNzcwOCA3Ny44NTI5IDQzLjg1MjkgNzguNzcwOCA0Mi43MjM5IDc5LjM0NkM0MS40NDA1IDgwIDM5Ljc2MDMgODAgMzYuNCA4MEg4VjE3LjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik03MCAzNkM3MCAzNC44OTU0IDcwLjg5NTQgMzQgNzIgMzRIMTA4QzEwOS4xMDUgMzQgMTEwIDM0Ljg5NTQgMTEwIDM2VjM4QzExMCAzOS4xMDQ2IDEwOS4xMDUgNDAgMTA4IDQwSDcyQzcwLjg5NTQgNDAgNzAgMzkuMTA0NiA3MCAzOFYzNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTcwIDQ1QzcwIDQzLjg5NTQgNzAuODk1NCA0MyA3MiA0M0gxMDhDMTA5LjEwNSA0MyAxMTAgNDMuODk1NCAxMTAgNDVWNDdDMTEwIDQ4LjEwNDYgMTA5LjEwNSA0OSAxMDggNDlINzJDNzAuODk1NCA0OSA3MCA0OC4xMDQ2IDcwIDQ3VjQ1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNzAgNTRDNzAgNTIuODk1NCA3MC44OTU0IDUyIDcyIDUySDg1Qzg2LjEwNDYgNTIgODcgNTIuODk1NCA4NyA1NFY1NkM4NyA1Ny4xMDQ2IDg2LjEwNDYgNTggODUgNThINzJDNzAuODk1NCA1OCA3MCA1Ny4xMDQ2IDcwIDU2VjU0WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNOTAgNTRDOTAgNTIuODk1NCA5MC44OTU0IDUyIDkyIDUySDEwNUMxMDYuMTA1IDUyIDEwNyA1Mi44OTU0IDEwNyA1NFY1NkMxMDcgNTcuMTA0NiAxMDYuMTA1IDU4IDEwNSA1OEg5MkM5MC44OTU0IDU4IDkwIDU3LjEwNDYgOTAgNTZWNTRaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMjlDNzAgMjguNDQ3NyA3MC40NDc3IDI4IDcxIDI4SDg3Qzg3LjU1MjMgMjggODggMjguNDQ3NyA4OCAyOUM4OCAyOS41NTIzIDg3LjU1MjMgMzAgODcgMzBINzFDNzAuNDQ3NyAzMCA3MCAyOS41NTIzIDcwIDI5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNzAgNjRDNzAgNjIuODk1NCA3MC44OTU0IDYyIDcyIDYySDk2Qzk3LjEwNDYgNjIgOTggNjIuODk1NCA5OCA2NFY2NkM5OCA2Ny4xMDQ2IDk3LjEwNDYgNjggOTYgNjhINzJDNzAuODk1NCA2OCA3MCA2Ny4xMDQ2IDcwIDY2VjY0WiIgZmlsbD0iIzlDQTNBRiIvPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgMTZDOTcgMTQuODk1NCA5OC4wNjYgMTQgOTkuMzgxIDE0SDExMS42MTlDMTEyLjkzNCAxNCAxMTQgMTQuODk1NCAxMTQgMTZDMTE0IDE3LjEwNDYgMTEyLjkzNCAxOCAxMTEuNjE5IDE4SDk5LjM4MUM5OC4wNjYgMTggOTcgMTcuMTA0NiA5NyAxNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTMwIDMyLjRDMzAgMzAuMTU5OCAzMCAyOS4wMzk3IDMwLjQzNiAyOC4xODRDMzAuODE5NSAyNy40MzE0IDMxLjQzMTQgMjYuODE5NSAzMi4xODQgMjYuNDM2QzMzLjAzOTcgMjYgMzQuMTU5OCAyNiAzNi40IDI2SDU1LjZDNTcuODQwMiAyNiA1OC45NjAzIDI2IDU5LjgxNiAyNi40MzZDNjAuNTY4NiAyNi44MTk1IDYxLjE4MDUgMjcuNDMxNCA2MS41NjQgMjguMTg0QzYyIDI5LjAzOTcgNjIgMzAuMTU5OCA2MiAzMi40VjY3LjZDNjIgNjkuODQwMiA2MiA3MC45NjAzIDYxLjU2NCA3MS44MTZDNjEuMTgwNSA3Mi41Njg2IDYwLjU2ODYgNzMuMTgwNSA1OS44MTYgNzMuNTY0QzU4Ljk2MDMgNzQgNTcuODQwMiA3NCA1NS42IDc0SDM2LjRDMzQuMTU5OCA3NCAzMy4wMzk3IDc0IDMyLjE4NCA3My41NjRDMzEuNDMxNCA3My4xODA1IDMwLjgxOTUgNzIuNTY4NiAzMC40MzYgNzEuODE2QzMwIDcwLjk2MDMgMzAgNjkuODQwMiAzMCA2Ny42VjMyLjRaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik0yOCAzMC40QzI4IDI4LjE1OTggMjggMjcuMDM5NyAyOC40MzYgMjYuMTg0QzI4LjgxOTUgMjUuNDMxNCAyOS40MzE0IDI0LjgxOTUgMzAuMTg0IDI0LjQzNkMzMS4wMzk3IDI0IDMyLjE1OTggMjQgMzQuNCAyNEg1My42QzU1Ljg0MDIgMjQgNTYuOTYwMyAyNCA1Ny44MTYgMjQuNDM2QzU4LjU2ODYgMjQuODE5NSA1OS4xODA1IDI1LjQzMTQgNTkuNTY0IDI2LjE4NEM2MCAyNy4wMzk3IDYwIDI4LjE1OTggNjAgMzAuNFY2NS42QzYwIDY3Ljg0MDIgNjAgNjguOTYwMyA1OS41NjQgNjkuODE2QzU5LjE4MDUgNzAuNTY4NiA1OC41Njg2IDcxLjE4MDUgNTcuODE2IDcxLjU2NEM1Ni45NjAzIDcyIDU1Ljg0MDIgNzIgNTMuNiA3MkgzNC40QzMyLjE1OTggNzIgMzEuMDM5NyA3MiAzMC4xODQgNzEuNTY0QzI5LjQzMTQgNzEuMTgwNSAyOC44MTk1IDcwLjU2ODYgMjguNDM2IDY5LjgxNkMyOCA2OC45NjAzIDI4IDY3Ljg0MDIgMjggNjUuNlYzMC40WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zMyA1N0MzMyA1Ni40NDc3IDMzLjI4OTcgNTYgMzMuNjQ3MSA1Nkg1NC4zNTI5QzU0LjcxMDMgNTYgNTUgNTYuNDQ3NyA1NSA1N0M1NSA1Ny41NTIzIDU0LjcxMDMgNTggNTQuMzUyOSA1OEgzMy42NDcxQzMzLjI4OTcgNTggMzMgNTcuNTUyMyAzMyA1N1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNiA2MkMzNiA2MS40NDc3IDM2LjI5MjcgNjEgMzYuNjUzOCA2MUg1Mi4zNDYyQzUyLjcwNzMgNjEgNTMgNjEuNDQ3NyA1MyA2MkM1MyA2Mi41NTIzIDUyLjcwNzMgNjMgNTIuMzQ2MiA2M0gzNi42NTM4QzM2LjI5MjcgNjMgMzYgNjIuNTUyMyAzNiA2MloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTQzLjA2NTMgMzQuNDU4NUM0My4zOTIxIDMzLjU5OSA0NC42MDc5IDMzLjU5OSA0NC45MzQ3IDM0LjQ1ODVMNDcuNjgzOCA0MS42ODg5QzQ3LjcyMTggNDEuNzg5IDQ3Ljc3NTcgNDEuODgyMyA0Ny44NDM0IDQxLjk2NTNMNTIuNzMwNiA0Ny45NjEzQzUzLjMxMTUgNDguNjc0IDUyLjcwMzYgNDkuNzI3IDUxLjc5NTkgNDkuNTgwM0w0NC4xNTk2IDQ4LjM0NThDNDQuMDUzOSA0OC4zMjg3IDQzLjk0NjEgNDguMzI4NyA0My44NDA0IDQ4LjM0NThMMzYuMjA0MSA0OS41ODAzQzM1LjI5NjQgNDkuNzI3IDM0LjY4ODUgNDguNjc0IDM1LjI2OTQgNDcuOTYxM0w0MC4xNTY2IDQxLjk2NTNDNDAuMjI0MyA0MS44ODIzIDQwLjI3ODIgNDEuNzg5IDQwLjMxNjIgNDEuNjg4OUw0My4wNjUzIDM0LjQ1ODVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgOTZDNzAgOTUuNDQ3NyA3MC40NDc3IDk1IDcxIDk1SDk5Qzk5LjU1MjMgOTUgMTAwIDk1LjQ0NzcgMTAwIDk2QzEwMCA5Ni41NTIzIDk5LjU1MjMgOTcgOTkgOTdINzFDNzAuNDQ3NyA5NyA3MCA5Ni41NTIzIDcwIDk2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDEwMEM3MCA5OS40NDc3IDcwLjQ0NzcgOTkgNzEgOTlIOTJDOTIuNTUyMyA5OSA5MyA5OS40NDc3IDkzIDEwMEM5MyAxMDAuNTUyIDkyLjU1MjMgMTAxIDkyIDEwMUg3MUM3MC40NDc3IDEwMSA3MCAxMDAuNTUyIDcwIDEwMFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03NiAxMDVDNzYgMTA0LjQ0OCA3Ni40NDc3IDEwNCA3NyAxMDRIODRDODQuNTUyMyAxMDQgODUgMTA0LjQ0OCA4NSAxMDVDODUgMTA1LjU1MiA4NC41NTIzIDEwNiA4NCAxMDZINzdDNzYuNDQ3NyAxMDYgNzYgMTA1LjU1MiA3NiAxMDVaIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9IjcyIiBjeT0iMTA1IiByPSIyIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjggOTZDMjggOTUuNDQ3NyAyOC40NDc3IDk1IDI5IDk1SDU3QzU3LjU1MjMgOTUgNTggOTUuNDQ3NyA1OCA5NkM1OCA5Ni41NTIzIDU3LjU1MjMgOTcgNTcgOTdIMjlDMjguNDQ3NyA5NyAyOCA5Ni41NTIzIDI4IDk2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTI4IDEwMEMyOCA5OS40NDc3IDI4LjQ0NzcgOTkgMjkgOTlINTBDNTAuNTUyMyA5OSA1MSA5OS40NDc3IDUxIDEwMEM1MSAxMDAuNTUyIDUwLjU1MjMgMTAxIDUwIDEwMUgyOUMyOC40NDc3IDEwMSAyOCAxMDAuNTUyIDI4IDEwMFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNCAxMDVDMzQgMTA0LjQ0OCAzNC40NDc3IDEwNCAzNSAxMDRINDJDNDIuNTUyMyAxMDQgNDMgMTA0LjQ0OCA0MyAxMDVDNDMgMTA1LjU1MiA0Mi41NTIzIDEwNiA0MiAxMDZIMzVDMzQuNDQ3NyAxMDYgMzQgMTA1LjU1MiAzNCAxMDVaIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9IjMwIiBjeT0iMTA1IiByPSIyIiBmaWxsPSIjRDFENURCIi8+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMjEzNl8xMjUzNjgiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4Ii8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4Ii8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4IiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=",Wh="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMTAzM18xMDE2MikiPgo8cmVjdCB4PSI4IiB5PSI4IiB3aWR0aD0iMTEyIiBoZWlnaHQ9IjExMiIgcng9IjYiIGZpbGw9IiNGOUZBRkIiLz4KPC9nPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTggMTZDOTggMTUuNDQ3NyA5OC40NDc3IDE1IDk5IDE1SDEwN0MxMDcuNTUyIDE1IDEwOCAxNS40NDc3IDEwOCAxNkMxMDggMTYuNTUyMyAxMDcuNTUyIDE3IDEwNyAxN0g5OUM5OC40NDc3IDE3IDk4IDE2LjU1MjMgOTggMTZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMTZDNzAgMTUuNDQ3NyA3MC40NDc3IDE1IDcxIDE1SDc5Qzc5LjU1MjMgMTUgODAgMTUuNDQ3NyA4MCAxNkM4MCAxNi41NTIzIDc5LjU1MjMgMTcgNzkgMTdINzFDNzAuNDQ3NyAxNyA3MCAxNi41NTIzIDcwIDE2WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg0IDE2Qzg0IDE1LjQ0NzcgODQuNDQ3NyAxNSA4NSAxNUg5M0M5My41NTIzIDE1IDk0IDE1LjQ0NzcgOTQgMTZDOTQgMTYuNTUyMyA5My41NTIzIDE3IDkzIDE3SDg1Qzg0LjQ0NzcgMTcgODQgMTYuNTUyMyA4NCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHJlY3QgeD0iMzcuNSIgeT0iNDMuNSIgd2lkdGg9IjUyIiBoZWlnaHQ9IjU2IiByeD0iMi41IiBmaWxsPSJ3aGl0ZSIgc3Ryb2tlPSIjRjNGNEY2Ii8+CjxwYXRoIGQ9Ik00MSA1NkM0MSA1NC44OTU0IDQxLjg5NTQgNTQgNDMgNTRINTJDNTMuMTA0NiA1NCA1NCA1NC44OTU0IDU0IDU2QzU0IDU3LjEwNDYgNTMuMTA0NiA1OCA1MiA1OEg0M0M0MS44OTU0IDU4IDQxIDU3LjEwNDYgNDEgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik01NyA1NkM1NyA1NC44OTU0IDU3Ljg5NTQgNTQgNTkgNTRINjhDNjkuMTA0NiA1NCA3MCA1NC44OTU0IDcwIDU2QzcwIDU3LjEwNDYgNjkuMTA0NiA1OCA2OCA1OEg1OUM1Ny44OTU0IDU4IDU3IDU3LjEwNDYgNTcgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik03MyA1NkM3MyA1NC44OTU0IDczLjg5NTQgNTQgNzUgNTRIODRDODUuMTA0NiA1NCA4NiA1NC44OTU0IDg2IDU2Qzg2IDU3LjEwNDYgODUuMTA0NiA1OCA4NCA1OEg3NUM3My44OTU0IDU4IDczIDU3LjEwNDYgNzMgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA3MkM0MSA3MC44OTU0IDQxLjg5NTQgNzAgNDMgNzBINTZDNTcuMTA0NiA3MCA1OCA3MC44OTU0IDU4IDcyQzU4IDczLjEwNDYgNTcuMTA0NiA3NCA1NiA3NEg0M0M0MS44OTU0IDc0IDQxIDczLjEwNDYgNDEgNzJaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA3MkM2MiA3MC44OTU0IDYyLjg5NTQgNzAgNjQgNzBIODNDODQuMTA0NiA3MCA4NSA3MC44OTU0IDg1IDcyQzg1IDczLjEwNDYgODQuMTA0NiA3NCA4MyA3NEg2NEM2Mi44OTU0IDc0IDYyIDczLjEwNDYgNjIgNzJaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA3OUM0MSA3Ny44OTU0IDQxLjg5NTQgNzcgNDMgNzdINTZDNTcuMTA0NiA3NyA1OCA3Ny44OTU0IDU4IDc5QzU4IDgwLjEwNDYgNTcuMTA0NiA4MSA1NiA4MUg0M0M0MS44OTU0IDgxIDQxIDgwLjEwNDYgNDEgNzlaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA3OUM2MiA3Ny44OTU0IDYyLjg5NTQgNzcgNjQgNzdINzdDNzguMTA0NiA3NyA3OSA3Ny44OTU0IDc5IDc5Qzc5IDgwLjEwNDYgNzguMTA0NiA4MSA3NyA4MUg2NEM2Mi44OTU0IDgxIDYyIDgwLjEwNDYgNjIgNzlaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA4NkM0MSA4NC44OTU0IDQxLjg5NTQgODQgNDMgODRINTZDNTcuMTA0NiA4NCA1OCA4NC44OTU0IDU4IDg2QzU4IDg3LjEwNDYgNTcuMTA0NiA4OCA1NiA4OEg0M0M0MS44OTU0IDg4IDQxIDg3LjEwNDYgNDEgODZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA4NkM2MiA4NC44OTU0IDYyLjg5NTQgODQgNjQgODRINzhDNzkuMTA0NiA4NCA4MCA4NC44OTU0IDgwIDg2QzgwIDg3LjEwNDYgNzkuMTA0NiA4OCA3OCA4OEg2NEM2Mi44OTU0IDg4IDYyIDg3LjEwNDYgNjIgODZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA5M0M0MSA5MS44OTU0IDQxLjg5NTQgOTEgNDMgOTFINTZDNTcuMTA0NiA5MSA1OCA5MS44OTU0IDU4IDkzQzU4IDk0LjEwNDYgNTcuMTA0NiA5NSA1NiA5NUg0M0M0MS44OTU0IDk1IDQxIDk0LjEwNDYgNDEgOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA5M0M2MiA5MS44OTU0IDYyLjg5NTQgOTEgNjQgOTFIODFDODIuMTA0NiA5MSA4MyA5MS44OTU0IDgzIDkzQzgzIDk0LjEwNDYgODIuMTA0NiA5NSA4MSA5NUg2NEM2Mi44OTU0IDk1IDYyIDk0LjEwNDYgNjIgOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDEgNDkuNUM0MSA0OC42NzE2IDQxLjY3MTYgNDggNDIuNSA0OEg2Mi41QzYzLjMyODQgNDggNjQgNDguNjcxNiA2NCA0OS41QzY0IDUwLjMyODQgNjMuMzI4NCA1MSA2Mi41IDUxSDQyLjVDNDEuNjcxNiA1MSA0MSA1MC4zMjg0IDQxIDQ5LjVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDEgNjUuNUM0MSA2NC42NzE2IDQxLjY3MTYgNjQgNDIuNSA2NEg2Mi41QzYzLjMyODQgNjQgNjQgNjQuNjcxNiA2NCA2NS41QzY0IDY2LjMyODQgNjMuMzI4NCA2NyA2Mi41IDY3SDQyLjVDNDEuNjcxNiA2NyA0MSA2Ni4zMjg0IDQxIDY1LjVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDQgMzVDNDQgMzQuNDQ3NyA0NC40NDc3IDM0IDQ1IDM0SDgzQzgzLjU1MjMgMzQgODQgMzQuNDQ3NyA4NCAzNUM4NCAzNS41NTIzIDgzLjU1MjMgMzYgODMgMzZINDVDNDQuNDQ3NyAzNiA0NCAzNS41NTIzIDQ0IDM1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUzIDMwLjVDNTMgMjkuNjcxNiA1My42NzE2IDI5IDU0LjUgMjlINzIuNUM3My4zMjg0IDI5IDc0IDI5LjY3MTYgNzQgMzAuNUM3NCAzMS4zMjg0IDczLjMyODQgMzIgNzIuNSAzMkg1NC41QzUzLjY3MTYgMzIgNTMgMzEuMzI4NCA1MyAzMC41WiIgZmlsbD0iI0QxRDVEQiIvPgo8Y2lyY2xlIGN4PSI2My41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSI1NS41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSI3MS41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzEwMzNfMTAxNjIiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzEwMzNfMTAxNjIiLz4KPGZlT2Zmc2V0IGR5PSI0Ii8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjMiLz4KPGZlQ29tcG9zaXRlIGluMj0iaGFyZEFscGhhIiBvcGVyYXRvcj0ib3V0Ii8+CjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwLjE2IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTAzM18xMDE2MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd18xMDMzXzEwMTYyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=",Hh=(0,p.createContext)({}),Qh=()=>(0,p.useContext)(Hh),$h={open:{opacity:1},exit:{opacity:0}},Xh={duration:.2},Jh=({open:e,setOpen:t,children:n,trigger:r=null,className:o,exitOnClickOutside:a=!1,exitOnEsc:i=!0,design:s="simple",scrollLock:l=!0})=>{const c=void 0!==e&&void 0!==t,[u,d]=(0,p.useState)(!1),f=(0,p.useRef)(null),m=(0,p.useRef)(null),h=(0,p.useId)(),g=`${h}-title`,w=`${h}-description`,y=(0,p.useRef)(!1),b=(0,p.useRef)(!1),v=(0,p.useMemo)(()=>c?e:u,[e,u]),x=(0,p.useMemo)(()=>c?t:d,[d,t]),{refs:N,context:I}=uo({open:v,onOpenChange:x}),M=ao(I),E=co(I,{enabled:a||i,escapeKey:i,outsidePress:e=>!!a&&!e?.target?.closest("ul.fui-toast-container")}),_=Io(I,{role:"dialog"}),{getFloatingProps:S}=ho([M,E,_]),D=()=>{v||x(!0)},j=(0,p.useCallback)(()=>(0,p.isValidElement)(r)?(0,p.cloneElement)(r,{onClick:De(D,r?.props?.onClick),ref:N.setReference,"aria-haspopup":"dialog","aria-expanded":v}):"function"==typeof r?r({onClick:D,"aria-haspopup":"dialog","aria-expanded":v}):null,[r,D,N.setReference,v]);return(0,C.jsxs)(C.Fragment,{children:[j(),(0,C.jsx)(Hh.Provider,{value:{open:v,setOpen:x,handleClose:()=>{v&&x(!1)},design:s,context:I,getFloatingProps:S,refs:N,dialogContainerRef:m,dialogRef:f,scrollLock:l,className:o,titleId:g,descriptionId:w,hasTitleRef:y,hasDescriptionRef:b},children:n})]})};Jh.displayName="Dialog";const qh=({children:e,className:t,ariaLabel:n})=>{const{open:r,handleClose:o,context:a,getFloatingProps:i,dialogRef:s,scrollLock:l,dialogContainerRef:c,className:u,refs:d,titleId:f,descriptionId:p,hasTitleRef:m,hasDescriptionRef:h}=Qh();return(0,C.jsx)(Bp,{children:r&&(0,C.jsx)(no,{ref:c,lockScroll:l,className:Se("z-999999",u),"aria-modal":"true",children:(0,C.jsx)(Kr,{context:a,...d?.reference&&{returnFocus:d.reference},children:(0,C.jsx)(Xf.div,{className:"fixed inset-0 overflow-y-auto",initial:"exit",animate:"open",exit:"exit",variants:$h,role:"dialog","aria-modal":"true","aria-label":m?.current?void 0:n,"aria-labelledby":m?.current?f:void 0,"aria-describedby":h?.current?p:void 0,transition:Xh,children:(0,C.jsx)("div",{className:"flex items-center justify-center min-h-full",children:(0,C.jsx)("div",{ref:e=>{e&&(s.current=e,a&&a.refs.setFloating(e))},...i?.(),className:Se("flex flex-col gap-5 w-120 h-fit bg-background-primary border border-solid border-border-subtle rounded-xl shadow-soft-shadow-2xl my-5 overflow-hidden",t),children:"function"==typeof e?e({close:o}):e})})})})})})};qh.displayName="Dialog.Panel";const Kh=({children:e,...t})=>(0,C.jsx)(Gr,{...t,children:e});Kh.displayName="Dialog.Portal";const eg=({className:e,...t})=>{const{open:n,dialogContainerRef:r}=Qh();return r?.current?(0,C.jsx)(C.Fragment,{children:(0,dn.createPortal)((0,C.jsx)(Bp,{children:n&&(0,C.jsx)(Xf.div,{className:Se("fixed inset-0 -z-10 bg-background-inverse/90",e),...t,initial:"exit",animate:"open",exit:"exit",variants:$h,transition:Xh})}),r.current)}):null};eg.displayName="Dialog.Backdrop";const tg=({children:e,className:t,...n})=>(0,C.jsx)("div",{className:Se("space-y-2 px-5 pt-5 pb-1",t),...n,children:e});tg.displayName="Dialog.Header";const ng=({children:e,as:t="h3",className:n,...r})=>{const{titleId:o,hasTitleRef:a}=Qh();return(0,p.useEffect)(()=>(a&&(a.current=!0),()=>{a&&(a.current=!1)}),[a]),(0,C.jsx)(t,{id:o,className:Se("text-base font-semibold text-text-primary m-0 p-0",n),...r,children:e})};ng.displayName="Dialog.Title";const rg=({children:e,as:t="p",className:n,...r})=>{const{descriptionId:o,hasDescriptionRef:a}=Qh();return(0,p.useEffect)(()=>(a&&(a.current=!0),()=>{a&&(a.current=!1)}),[a]),(0,C.jsx)(t,{id:o,className:Se("text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",n),...r,children:e})};rg.displayName="Dialog.Description";const og=({className:e,...t})=>(0,C.jsx)("button",{className:Se("bg-transparent inline-flex justify-center items-center border-0 p-1 m-0 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-border-strong outline-none shadow-none",e),"aria-label":"Close dialog",...t,children:(0,C.jsx)(Ho,{className:"size-4 text-text-primary shrink-0"})}),ag=({children:e,as:t=p.Fragment,...n})=>{const{handleClose:r}=Qh();return e?t===p.Fragment?"function"==typeof e?e({close:r}):(0,p.cloneElement)(e,{onClick:r}):(0,C.jsx)(t,{...n,onClick:r,"aria-label":"Close dialog",children:e}):(0,C.jsx)(og,{onClick:r,...n})};ag.displayName="Dialog.CloseButton";const ig=({children:e,className:t,...n})=>(0,C.jsx)("div",{className:Se("px-5",t),...n,children:e});ig.displayName="Dialog.Body";const sg=({children:e,className:t})=>{const{design:n,handleClose:r}=Qh();return(0,C.jsx)("div",{className:Se("p-4 flex justify-end gap-3",{"bg-background-secondary":"footer-divided"===n},t),children:e?"function"==typeof e?e({close:r}):e:null})};sg.displayName="Dialog.Footer",Jh.Panel=qh,Jh.Portal=Kh,Jh.Title=ng,Jh.Description=rg,Jh.CloseButton=ag,Jh.Header=tg,Jh.Body=ig,Jh.Footer=sg,Jh.Backdrop=eg;const lg=e=>(0,i.createElement)("span",{className:`inline-block h-18 w-18 animate-spin rounded-full border-2 border-solid border-brand-500 border-r-transparent align-[-0.125em] mr-1 ${e.className?e.className:""}`});function cg(e){if(e)return(0,i.createElement)(Jh,{open:e.isOpen,setOpen:t=>{t||e.onClose()},exitOnClickOutside:!1,exitOnEsc:!1,className:"wcf-confirm-popup"},(0,i.createElement)(Jh.Portal,null,(0,i.createElement)(Jh.Panel,{className:"wcf-confirm-popup-wrapper !p-3 !gap-4"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)("div",{className:"flex gap-2.5 p-2"},(0,i.createElement)(zo,{className:"w-6 h-6 text-support-warning shrink-0 mt-0.5","aria-hidden":"true"}),(0,i.createElement)("div",{className:"flex flex-col gap-1.5 flex-1 min-w-0"},(0,i.createElement)("div",{className:"flex items-center justify-between"},(0,i.createElement)(Jh.Title,{className:"!text-lg"},e.title),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)("p",{className:"text-sm text-text-secondary m-0"},e.description))),(0,i.createElement)(Jh.Footer,{className:"!p-2 flex gap-3 justify-end"},(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:e.onClose},e.cancelBtnText),(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:e.onConfirm,disabled:e.isLoading},e.isLoading?(0,i.createElement)(lg,{className:"border-white border-r-transparent"}):e.actionBtnText)))))}const ug=(0,i.createContext)();function dg(){return(0,i.useContext)(ug)}function fg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const pg=p.forwardRef(fg);function mg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const hg=p.forwardRef(mg);function gg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const wg=p.forwardRef(gg);function yg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const bg=p.forwardRef(yg);function vg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const xg=p.forwardRef(vg);function Ng({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Ig=p.forwardRef(Ng),Mg=To("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);var Eg=n(4601),_g=n(9296);const Sg=function(e){var t;const{is_cf_pro:n,global_checkout:r,flow_id:o,control_id:a,step_id:s,title:l,type:c,actions:u,menu_actions:d,ab_test_ui:f,offer_no_next_step:p,offer_yes_next_step:m,setUpgradePopupFeature:h=()=>{},step_disabled:g}=e,w=s;let{has_product_assigned:y,is_variation:b}=e;const[{flow_type:v,flow_analytics:x,is_flow_instant_checkout:N}]=Nm(),[I,M]=(0,i.useState)(!1),E=(0,i.useRef)(),S=x?x.all_steps:"",D=b?e.control_id:s,C=S?S.find(e=>e.id===D):[],A=dg(),T=(0,_g.W6)(),L=(0,k.applyFilters)("cartflows.flowEditor.abActions",null),O=L?L({stepId:w,flowId:o,confirm:A,setLoader:M,toast:Wm}):{},z=e=>{e.preventDefault(),wcfCartflowsPro()&&Wm.error((0,j.__)("Please update CartFlows Pro to the latest version to use A/B testing.","cartflows"))};"landing"!==c&&"thankyou"!==c||(y=!0);const P=(e,t)=>(0,i.createElement)("div",{className:"flex justify-center"},(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:t,placement:"top"},(0,i.createElement)(Qo,{label:e,size:"sm",type:"pill",variant:"neutral",icon:(0,i.createElement)(Mg,{"aria-hidden":"true"}),className:"cursor-pointer"}))),R=Bm(c,N);return(0,i.createElement)("div",{className:`wcf-step-wrap--container py-4 px-4 flex items-center gap-2 ${f?"border-0 border-b border-solid border-border-subtle":""} ${g?"invalid-step step-disabled touch-none !bg-background-secondary !text-text-disabled !border-0 rounded-lg":""}`},!f&&(0,i.createElement)("div",{className:"wcf-steps--sortable-toggle flex cursor-move text-text-secondary"},(0,i.createElement)(Rh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,i.createElement)(Rh,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,i.createElement)(ph,{gap:"lg",direction:{sm:"column",md:"row"},align:{md:"center"},className:dp()("wcf-step w-full justify-between",f?"ml-8":"",I?"step-overlay":"",y||w===r?"":"wcf-step__no-product")},(0,i.createElement)(ph.Item,{className:"wcf-step--content flex items-center gap-4 w-full sm:w-[50%] min-w-0"},(0,i.createElement)("img",{src:function(){let e="";switch(c){case"landing":e=Fh;break;case"checkout":e=Yh;break;case"optin":e=Gh;break;case"thankyou":e=Wh;break;case"upsell":e=Zh;break;case"downsell":e=Vh}return e}(),alt:c,className:"sm:block lg:block hidden rounded-lg sm:w-[72px] sm:h-[72px] w-[62px] h-[62px]"}),(0,i.createElement)("div",{className:"wcf-steps--title-wrap flex flex-col gap-1"},(0,i.createElement)("div",{className:"wcf-step__col-tags sm:flex items-center gap-2 grid grid-cols-2"},(0,i.createElement)(vh,{as:"span",size:14,weight:400,color:"secondary",className:"capitalize"},"thankyou"===c?(0,j.__)("Thank You","cartflows"):c),("upsell"!==c&&"downsell"!==c||wcfCartflowsTypePlusPro())&&g?(0,i.createElement)(Qo,{label:(0,j.__)("Disabled","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,i.createElement)(pg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}):null,function(){let t="";if(f)if(a===s)t=(0,i.createElement)(Qo,{label:(0,j.__)("Control","cartflows"),size:"xs",type:"pill",variant:"blue"});else{const{var_badge_count:n}=e;t=(0,i.createElement)(Qo,{label:(0,j.sprintf)(/* translators: %d is replaced with the count */ /* translators: %d is replaced with the count */
3 +(0,j.__)("Variation-%d","cartflows"),n),size:"xs",type:"pill",variant:"inverse"})}return t}(),!y&&"storeCheckout"!==v&&(0,i.createElement)(Qo,{label:(0,j.__)("No Product Assigned","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,i.createElement)(pg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),!y&&"storeCheckout"===v&&"checkout"!==c&&(0,i.createElement)(Qo,{label:(0,j.__)("No Product Assigned","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,i.createElement)(pg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),y&&"storeCheckout"===v&&"checkout"===c&&(0,i.createElement)(Qo,{label:(0,j.__)("Store Checkout - Remove selected checkout product","cartflows"),size:"xs",type:"rounded",variant:"red",className:"wcf-global-checkout-error-badge",icon:(0,i.createElement)(pg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),function(){let e="";return!wcfCartflowsTypePlusPro()||"upsell"!==c&&"downsell"!==c?wcfCartflowsTypePlusPro()||"upsell"!==c&&"downsell"!==c||(e=(0,i.createElement)(Ap,null)):e=m&&p?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:Ym(m,35,25),placement:"top"},(0,i.createElement)(Qo,{label:(0,j.__)("Offer Accepted","cartflows"),size:"xs",type:"rounded",variant:"green",icon:(0,i.createElement)(hg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:Ym(p,35,25),placement:"top"},(0,i.createElement)(Qo,{label:(0,j.__)("Offer Rejected","cartflows"),size:"xs",type:"rounded",variant:"yellow",icon:(0,i.createElement)(wg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}))):(0,i.createElement)(Qo,{label:(0,j.__)("Invalid Position","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,i.createElement)(pg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),e}()),(0,i.createElement)("div",{className:"wcf-step__title"},(0,i.createElement)("a",{className:`\n\t\t\t\t\t\t\t\t\tfont-medium text-base sm:text-lg text-text-primary hover:text-brand-brand-600 no-underline\n\t\t\t\t\t\t\t\t\t${R?"disabled pointer-events-none":""}\n\t\t\t\t\t\t\t\t`,href:null!==(t=u[1]?.link)&&void 0!==t?t:"#","aria-disabled":R,tabIndex:R?-1:0},Ym(l,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))),(0,i.createElement)(ph.Item,{className:"wcf-step--stats-content w-full sm:w-[30%]"},(0,i.createElement)("div",{className:"wcf-step--stats-content__info flex text-center justify-around items-center gap-4"},(0,i.createElement)("div",{className:"wcf-step--stats-content__stat"},x?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(vh,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,j.__)("Views","cartflows")),(0,i.createElement)(vh,{as:"div",size:16,weight:600,color:"primary"},function(){let e=0;return x&&C&&(e=b?C["visits-ab"][s].total_visits:C.visits.total_visits),e}())):P((0,j.__)("Views","cartflows"),(0,j.__)("Upgrade to CartFlows Pro to track views.","cartflows"))),(0,i.createElement)("div",{className:"wcf-step--stats-content__stat"},x?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(vh,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,j.__)("Conversions","cartflows")),(0,i.createElement)(vh,{as:"div",size:16,weight:600,color:"primary"},"thankyou"!==c?function(){let e=0;return x&&C&&(e=b?C["visits-ab"][s].conversions:C.visits.conversions),e}():"-")):P((0,j.__)("Conversions","cartflows"),(0,j.__)("Upgrade to CartFlows Pro to track conversions.","cartflows"))),(0,i.createElement)("div",{className:"wcf-step--stats-content__stat"},x?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(vh,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,j.__)("Revenue","cartflows")),(0,i.createElement)(vh,{as:"div",size:16,weight:600,color:"primary"},"thankyou"!==c&&"landing"!==c?function(){let e=0;return x&&C&&(e=b?C["visits-ab"][s].revenue:C.visits.revenue),0!==e?Nh(e):e}():"-")):P((0,j.__)("Revenue","cartflows"),(0,j.__)("Upgrade to CartFlows Pro to track revenue.","cartflows"))))),(0,i.createElement)(ph.Item,{className:"wcf-step--actions-col w-full sm:w-[15%]"},(0,i.createElement)("div",{className:"wcf-step--actions",ref:E},(0,i.createElement)("div",{className:"wcf-step--action-btns"},(0,i.createElement)("div",{className:"wcf-step--action__basic-btns flex items-center sm:justify-evenly justify-between"},u.map(e=>{var t;if("view"!==e.slug&&"edit"!==e.slug)return null;const n=R&&"edit"===e.slug,r=n?Fm():(0,j.sprintf)(
4 4 // translators: %s: step slug
5 5 // translators: %s: step slug
6 -(0,C.__)("%s Step","cartflows"),e?.slug),o="view"===e.slug?(0,i.createElement)(Zh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}):(0,i.createElement)(Gh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"});return(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,i.createElement)("span",{className:"capitalize"},r),placement:"top",key:e?.link},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",tag:"a",href:!n&&"edit"===e.slug||"view"===e.slug?e?.link:"#!",target:"view"===e?.slug?"_blank":void 0,rel:"noreferrer",className:`wcf-step__action-btn ${null!==(t=e.class)&&void 0!==t?t:""} ${n?"disabled !text-text-disabled":"text-text-secondary"}`},o))}),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Open Settings","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",tag:S,to:{pathname:"admin.php",search:"storeCheckout"===x?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${o}&step_id=${l}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${o}&step_id=${l}`},className:"wcf-step__action-btn text-text-secondary hover:text-brand-brand-600"},(0,i.createElement)($h,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}))),(0,i.createElement)(lh,{id:y,control_id:a,onClickEvents:{clone:async function(e){if(e.preventDefault(),!wcfCartflowsPro())return null;if(await A({title:(0,C.__)("Duplicate Step","cartflows"),description:(0,C.__)("Do you want to duplicate this step? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Duplicate","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){M(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.clone_step_nonce;const r=new window.FormData;"cartflows_clone_ab_test_step"===t&&(n=cartflows_admin.wcf_clone_ab_test_step_nonce,r.append("control_id",a)),r.append("action",t),r.append("security",n),r.append("step_id",y),r.append("post_id",o),window.wcfAction="cloneStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{hm.success((0,C.__)("Step cloned successfully!","cartflows")),window.location.reload(),M(!1)}))}},delete:async function(e){if(e.preventDefault(),await A({title:(0,C.__)("Delete Step","cartflows"),description:(0,C.__)("Do you want to delete this step? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Delete","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){M(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.delete_step_nonce;const r=new window.FormData;"cartflows_delete_ab_test_step"===t&&(n=cartflows_admin.wcf_delete_ab_test_step_nonce,r.append("control_id",a)),r.append("action",t),r.append("security",n),r.append("step_id",y),r.append("post_id",o),window.wcfAction="deleteStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{hm.success((0,C.__)("Step deleted successfully!","cartflows")),window.location.reload(),M(!1)}))}},abtest:function(e){if(e.preventDefault(),!wcfCartflowsTypePro())return null;M(!0);const t=new window.FormData;t.append("action","cartflows_create_ab_test_variation"),t.append("security",cartflows_admin.wcf_create_ab_test_variation_nonce),t.append("step_id",y),t.append("flow_id",o),window.wcfAction="abtestStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{hm.success((0,C.__)("A/B test variation created!","cartflows")),window.location.reload(),M(!1)}))},winner:async function(e){if(e.preventDefault(),await A({title:(0,C.__)("Declare Winner","cartflows"),description:(0,C.__)("Do you want to declare this step as winner? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Declare Winner","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){M(!0);const e=new window.FormData;e.append("action","cartflows_declare_ab_test_winner"),e.append("security",cartflows_admin.wcf_declare_ab_test_winner_nonce),e.append("step_id",y),e.append("flow_id",o),window.wcfAction="winnerStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{hm.success((0,C.__)("Winner declared successfully!","cartflows")),window.location.reload(),M(!1)}).catch(e=>{console.error("Declare A/B test winner failed:",e),hm.error((0,C.__)("Failed to declare winner. Please try again.","cartflows")),M(!1)}))}},archived:async function(e){if(e.preventDefault(),await A({title:(0,C.__)("Archive Step","cartflows"),description:(0,C.__)("Do you want to archive this step? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Archive","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){M(!0);const e=new window.FormData;e.append("action","cartflows_archive_ab_test_step"),e.append("security",cartflows_admin.wcf_archive_ab_test_step_nonce),e.append("step_id",y),e.append("post_id",o),window.wcfAction="archiveStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{hm.success((0,C.__)("Step archived successfully!","cartflows")),window.location.reload(),M(!1)}))}},automation:()=>{T.push({pathname:"admin.php",search:"storeCheckout"===x?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${o}&automation=${l}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${o}&automation=${l}`})}},is_cf_pro:n,actions:f,type:u,setShowAbtestUpgradePopup:g})))))))};let Kh=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};const eg=To("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),tg=(0,s.forwardRef)(({id:e,type:t="text",defaultValue:n="",value:r,size:o="sm",className:a="",disabled:i=!1,onChange:l=()=>{},error:c=!1,onError:u=()=>{},prefix:d=null,suffix:f=null,label:p="",...m},h)=>{const g=(0,s.useRef)(null),w=(0,s.useMemo)(()=>e||`input-${t}-${Kh()}`,[e]),y=(0,s.useMemo)(()=>typeof r<"u",[r]),[b,v]=(0,s.useState)(n),[x,N]=(0,s.useState)(null),E=(0,s.useCallback)(()=>y?r:b,[y,r,b]),_=e=>{if(i)return;let n;"file"===t?(n=e.target.files,n&&n.length>0?N(n[0].name):N(null)):n=e.target.value,!y&&"file"!==t&&v(n),"function"==typeof l&&l(n)},M=()=>{N(null),g.current&&(g.current.value=""),l(null)},I="bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full outline outline-1 outline-border-subtle border-none transition-[color,box-shadow,outline] duration-200",S={xs:"px-2 py-1 rounded",sm:"p-3 py-2 rounded",md:"p-3.5 py-2.5 rounded-md",lg:"p-4 py-3 rounded-lg"},k={xs:"text-xs font-medium",sm:"text-sm font-medium",md:"text-sm font-medium",lg:"text-base font-medium"},D={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-base"},C={sm:d?"pl-8":"",md:d?"pl-9":"",lg:d?"pl-10":""},A={sm:f?"pr-8":"",md:f?"pr-9":"",lg:f?"pr-10":""},T=i?"hover:outline-border-disabled":"hover:outline-border-strong",L="focus:outline-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",O=c?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",z=c?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",P=i?"outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",R=i?"outline-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",U="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",B=i?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",F={xs:"[&>svg]:size-4",sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6"},Q=(0,s.useMemo)(()=>p?(0,j.jsx)(Of,{className:Se(k[o]),htmlFor:w,...m?.required&&{required:!0},children:p}):null,[p,o,w]),V=x?"file:border-0 file:bg-transparent pr-10":"text-text-tertiary file:border-0 file:bg-transparent pr-10";return"file"===t?(0,j.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[Q,(0,j.jsxs)("div",{className:Se("w-full relative flex focus-within:z-10",a),children:[(0,j.jsx)("input",{ref:Zo(g,h),id:w,type:"file",className:Se(I,R,S[o],D[o],L,T,z,V),disabled:i,onChange:_,onInvalid:u,...m}),(0,j.jsx)("div",{className:Se(B,"right-0 pr-3",F[o]),children:(0,j.jsx)(eg,{})})]})]}):(0,j.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[Q,(0,j.jsxs)("div",{className:Se("w-full relative flex focus-within:z-10",a),children:[d?(0,j.jsx)("div",{className:Se(U,"left-0 pl-3",D[o]),children:d}):null,(0,j.jsx)("input",{ref:Zo(g,h),id:w,type:t,className:Se(I,P,S[o],D[o],C[o],A[o],L,T,O),disabled:i,onChange:_,onInvalid:u,value:E(),...m}),"file"===t?x?(0,j.jsx)("div",{className:Se(B,"right-0 pr-3 cursor-pointer z-20 pointer-events-auto",F[o]),onClick:M,role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&M()},children:(0,j.jsx)(Tf,{})}):(0,j.jsx)("div",{className:Se(B,"right-0 pr-3",F[o]),children:(0,j.jsx)(eg,{})}):f?(0,j.jsx)("div",{className:Se(U,"right-0 pr-3",D[o]),children:f}):null]})]})});tg.displayName="Input";const ng=function(e){const{abVariations:t}=e,n={};t.map(e=>(n[e.id]=parseInt(e.traffic),""));const[r,o]=(0,s.useState)(n),a=function(e,n){e=parseInt(e),n=parseInt(n);let a=r[e]-n;const i={};t.map(t=>{const o=parseInt(t.id);if(e===o)i[o]=n;else{let e=r[o]+a;e<0?(a=e,e=0):e>100?(a=e-100,e=100):a=0,i[o]=e}return""}),o(i)};return(0,i.createElement)(i.Fragment,null,t&&t.map(e=>{const t=e.id,n=e.title;return(0,i.createElement)("div",{className:"wcf-traffic-field pb-5","data-id":e.id,key:e.id},(0,i.createElement)(Of,{className:"wcf-step-name w-40 mr-4",tag:"span",size:"sm",title:n},um(n,20,15)),(0,i.createElement)("div",{className:"wcf-traffic-slider-wrap flex items-center gap-3 flex-1","data-variation-id":e.id},(0,i.createElement)("div",{className:`wcf-traffic-range wcf-traffic-range-${e.id} flex-1`},(0,i.createElement)("input",{type:"range",value:r[t],onChange:e=>{a(t,e.target.value)}})),(0,i.createElement)("div",{className:`wcf-traffic-value wcf-traffic-value-${e.id} shrink-0`},(0,i.createElement)(tg,{type:"number",name:`wcf_ab_settings[traffic][${e.id}][value]`,value:String(r[t]),size:"sm",suffix:"%",className:"w-20",onChange:e=>{a(t,e)}}))))}))},rg=function(e){const{flow_id:t,step_id:n,abvariations:r,closeCallback:o}=e,[a,l]=(0,s.useState)(!1),[u,d]=(0,s.useState)((0,C.__)("Save Settings","cartflows")),f=c().useRef(null);return(0,i.createElement)(bh,{open:!0,setOpen:e=>{e||o()},design:"footer-divided",exitOnClickOutside:!0,exitOnEsc:!0},(0,i.createElement)(bh.Portal,null,(0,i.createElement)(bh.Panel,{className:"max-w-xl gap-0"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Header,{className:"flex items-center justify-between px-6 pt-5 pb-0"},(0,i.createElement)(bh.Title,null,(0,C.__)("Split Test Testing","cartflows")),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,{className:"px-6 py-4"},(0,i.createElement)("form",{ref:f,id:"wcf-ab-settings-form",onSubmit:function(e){e.preventDefault(),l(!0),d((0,C.__)("Saving..","cartflows"));const r=new window.FormData(e.target),o={};r.forEach(function(e,t){o[t]=e});const a=JSON.stringify(o);r.append("formdata",a),r.append("action","cartflows_save_ab_test_setting"),r.append("security",cartflows_admin.save_ab_test_setting_nonce),r.append("step_id",n),r.append("flow_id",t),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{hm.success((0,C.__)("Split test settings saved!","cartflows")),d((0,C.__)("Reloading..","cartflows")),window.location.reload()}).catch(()=>{l(!1),d((0,C.__)("Save Settings","cartflows")),hm.error((0,C.__)("Failed to save split test settings.","cartflows"))})}},(0,i.createElement)("div",{className:"text-sm font-medium text-field-label mb-3"},(0,C.__)("Traffic","cartflows")),(0,i.createElement)("div",{className:"rounded-md border border-border-subtle bg-background-primary text-sm font-medium text-text-primary"},(0,i.createElement)(ng,{abVariations:r})))),(0,i.createElement)(bh.Footer,{className:"px-6 py-4"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",onClick:o},(0,C.__)("Cancel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"sm",type:"submit",form:"wcf-ab-settings-form",loading:a,disabled:a},u)))))},og=function(e){const{flow_id:t,control_id:n,step_id:r,abvariations:o,ab_test_start:a,compact:l=!1}=e,[c,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(a?(0,C.__)("Stop Split Test","cartflows"):(0,C.__)("Start Split Test","cartflows")),[p,m]=(0,s.useState)(a?"wcf-stop-split-test text-brand-500 hover:text-brand-700 cursor-pointer":"wcf-start-split-test text-support-success hover:text-support-success"),[h,g]=(0,s.useState)(!1);return(0,i.createElement)("div",{className:"wcf-ab-test-head w-full p-4 bg-background-primary flex justify-between items-center border-b border-border-subtle rounded-t-lg box-border"},(0,i.createElement)("div",{className:"wcf-step-left-content flex items-center gap-3"},(0,i.createElement)("div",{className:"wcf-steps--sortable-toggle flex cursor-move text-text-tertiary"},(0,i.createElement)(sh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,i.createElement)(sh,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,i.createElement)("span",{className:"wcf-ab-test-title "+(l?"font-semibold text-sm":"font-bold text-base")},(0,C.__)("Split Test","cartflows"))),(0,i.createElement)("div",{className:"wcf-steps-action-buttons flex gap-3 items-center"},(0,i.createElement)("a",{href:"#",className:`wcf-action-button font-semibold ${l?"text-sm ":""}no-underline ${p}`,title:d,"data-id":n,onClick:function(e){if(e.preventDefault(),h)return void console.log("One process of A/B split test is ongoing.");a?(m("wcf-start-split-test"),f((0,C.__)("Stopping…","cartflows"))):(m("wcf-stop-split-test"),f((0,C.__)("Starting…","cartflows"))),g(!0);const n=new window.FormData;n.append("action","cartflows_start_ab_test"),n.append("security",cartflows_admin.wcf_start_ab_test_nonce),n.append("step_id",r),n.append("flow_id",t),qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{g(!1),hm.success(a?(0,C.__)("Split test stopped!","cartflows"):(0,C.__)("Split test started!","cartflows")),f((0,C.__)("Reloading…","cartflows")),window.location.reload()})}},(0,i.createElement)("span",null,d)),(0,i.createElement)("a",{href:"#",className:"wcf-settings-split-test wcf-action-button text-text-tertiary hover:text-brand-500",title:`${(0,C.__)("Split Test Settings","cartflows")}`,onClick:function(e){e.preventDefault(),u(!c)}},(0,i.createElement)($h,{className:"w-5 h-5 stroke-1 "+(h?"animate-spin text-brand-500":""),"aria-hidden":"true"}))),c&&(0,i.createElement)(rg,{abvariations:o,flow_id:t,step_id:r,control_id:n,closeCallback:function(){u(!1)}}))};function ag({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 15 6-6m0 0-6-6m6 6H9a6 6 0 0 0 0 12h3"}))}const ig=s.forwardRef(ag);function sg({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const lg=s.forwardRef(sg),cg=function(e){const{step_id:t,flow_id:n,control_id:r,title:o,deleted:a,hide:l,date:c,actions:u,type:d}=e,[f,p]=(0,s.useState)(!1),m=Oh(),h=async function(e){if(e.preventDefault(),await m({title:(0,C.__)("Restore Archived Variation","cartflows"),description:(0,C.__)("Do you want to restore this archived variation? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Restore","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){p(!0);const e=new window.FormData;e.append("action","cartflows_restore_archive_ab_test_variation"),e.append("security",cartflows_admin.wcf_restore_archive_ab_test_variation_nonce),e.append("step_id",t),e.append("flow_id",n),e.append("control_id",r),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{window.location.reload(),p(!1)})}},g=async function(e){if(e.preventDefault(),await m({title:(0,C.__)("Trash Archived Variation","cartflows"),description:(0,C.sprintf)(/* translators: %1$s is replaced with the HTML tag */ /* translators: %1$s is replaced with the HTML tag */
7 -(0,C.__)("This action will trash this archived variation and its analytics data permanently. %1$s Do you want to delete this archived variation?","cartflows"),"\n"),actionBtnText:(0,C.__)("Trash","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){p(!0);const e=new window.FormData;e.append("action","cartflows_delete_archive_ab_test_variation"),e.append("security",cartflows_admin.wcf_delete_archive_ab_test_variation_nonce),e.append("step_id",t),e.append("flow_id",n),e.append("control_id",r),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{window.location.reload(),p(!1)})}},w=async function(e){if(e.preventDefault(),await m({title:(0,C.__)("Hide Archived Variation","cartflows"),description:(0,C.sprintf)(/* translators: %1$s is replaced with the HTML tag */ /* translators: %1$s is replaced with the HTML tag */
8 -(0,C.__)("This action will hide this archived variation from the list of steps, but its analytics will be visible. %1$s Do you want to hide this archived variation?","cartflows"),"\n"),actionBtnText:(0,C.__)("Hide","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){p(!0);const e=new window.FormData;e.append("action","cartflows_hide_archive_ab_test_variation"),e.append("security",cartflows_admin.hide_archive_ab_test_variation_nonce),e.append("step_id",t),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{window.location.reload(),p(!1)})}},y=async function(e){if(e.preventDefault(),await m({title:(0,C.__)("Trash Archived Variation","cartflows"),description:(0,C.sprintf)(/* translators: %1$s is replaced with the HTML tag */ /* translators: %1$s is replaced with the HTML tag */
9 -(0,C.__)("This action will delete this archived variation and its analytics data permanently. %1$s Do you want to delete this archived variation?","cartflows"),"\n"),actionBtnText:(0,C.__)("Delete","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){p(!0);const e=new window.FormData;e.append("action","cartflows_permanent_delete_archive_ab_test_variation"),e.append("security",cartflows_admin.permanent_delete_archive_ab_test_variation_nonce),e.append("step_id",t),e.append("flow_id",n),e.append("control_id",r),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{window.location.reload(),p(!1)})}};return"1"===l?null:(0,i.createElement)("div",{className:"wcf-archived-step flex items-center gap-2 py-4","data-id":t},(0,i.createElement)("div",{className:"wcf-archive-step--sortable-toggle flex text-text-disabled disabled pointer-events-none"},(0,i.createElement)(sh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,i.createElement)(sh,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,i.createElement)("div",{className:"wcf-step flex justify-between items-center w-full "+(f?"step-overlay":"")},(0,i.createElement)("div",{className:"wcf-archive-step--content flex items-center gap-4 w-[55%]"},(0,i.createElement)("img",{src:function(){let e="";switch(d){case"landing":e=ch;break;case"checkout":e=uh;break;case"optin":e=ph;break;case"thankyou":e=mh;break;case"upsell":e=dh;break;case"downsell":e=fh}return e}(),alt:d,className:"rounded-lg w-[72px] h-[72px]"}),(0,i.createElement)("div",{className:"wcf-archive-step--title-wrap flex flex-col gap-1"},(0,i.createElement)("div",{className:"wcf-archive-step--col-tags flex items-center gap-2"},(0,i.createElement)("span",{className:"text-base font-normal text-text-tertiary capitalize mr-2"},"thankyou"===d?(0,C.__)("Thank You","cartflows"):d),function(){let e="",t="";return a?(e=(0,C.__)("Deleted On: ","cartflows"),t="bg-support-error"):(e=(0,C.__)("Archived On: ","cartflows"),t="bg-background-inverse"),(0,i.createElement)("span",{className:`wcf-step-badge text-text-on-color text-xs px-2.5 py-1 rounded-full ${t}`},e+c)}()),(0,i.createElement)("div",{className:"wcf-archive-step--title"},(0,i.createElement)("span",{className:"font-semibold text-lg text-text-primary cursor-default"},um(o,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))),(0,i.createElement)("div",{className:"wcf-archive-step--col"},(0,i.createElement)("div",{className:"wcf-archive-step--actions"},(0,i.createElement)("div",{className:"wcf-archive-step--action__btns-wrapper"},(0,i.createElement)("div",{className:"wcf-archive-step--basic-action__btns flex items-center gap-3"},u.map(e=>{let t,n;switch(e.slug){case"restore":t=h,n=(0,i.createElement)(ig,{className:"w-18 h-18 stroke-2"});break;case"delete":t=g,n=(0,i.createElement)($m,{className:"w-18 h-18 stroke-2"});break;case"hide":t=w,n=(0,i.createElement)(lg,{className:"w-18 h-18 stroke-2"});break;case"deleteArch":t=y,n=(0,i.createElement)($m,{className:"w-18 h-18 stroke-2"})}return(0,i.createElement)(i.Fragment,null,e?.before_text&&(0,i.createElement)("span",{className:"wcf-step__action-before-text"},e?.before_text),(0,i.createElement)("a",{href:e?.link,className:`wcf-step__action-btn text-text-tertiary hover:text-brand-500 p-1 flex gap-2 ${e?.class}`,title:e?.text,onClick:t},n,e?.text))})))))))};function ug({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const dg=s.forwardRef(ug),fg=function(e){const{flow_id:t,control_id:n,archived_variations:r,type:o}=e,[a,l]=(0,s.useState)(!1);return(0,i.createElement)("div",{className:"wcf-archived-wrapper p-4 bg-background-primary w-full rounded-b-lg"},(0,i.createElement)("span",{id:"wcf-archived-button",onClick:function(){l(!a)},className:`text-text-primary text-sm flex items-center gap-1 cursor-pointer p-1 ${a?"is-active":""} `},(0,C.__)("Archived Steps","cartflows"),a?(0,i.createElement)(Lp,{className:"w-4 h-4 stroke-1 mt-0.5","aria-hidden":"true"}):(0,i.createElement)(dg,{className:"w-4 h-4 stroke-1 mt-0.5","aria-hidden":"true"})),a&&(0,i.createElement)("div",{className:"wcf-archived-steps divide-y divide-border-subtle"},r.map(e=>{const r={step_id:e.id,flow_id:t,control_id:n,title:e.title,note:e.note,deleted:e.deleted,hide:e.hide,date:e.date,type:o,actions:Object.values(e.actions)};return(0,i.createElement)(cg,(0,y.A)({},r,{key:e.id}))})))};function pg({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"}))}const mg=s.forwardRef(pg);function hg({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const gg=s.forwardRef(hg);function wg({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const yg=s.forwardRef(wg);function bg({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const vg=s.forwardRef(bg),xg=function(){return(0,i.createElement)("div",{className:"wcf-order-bump-product-tab p-6 is-placeholder"},(0,i.createElement)("div",{role:"status",className:"space-y-8 animate-pulse md:space-y-0 md:space-x-8 md:flex md:items-center"},(0,i.createElement)("div",{className:"flex items-center justify-center w-full h-48 bg-background-secondary rounded sm:w-96"},(0,i.createElement)("svg",{className:"w-12 h-12 text-text-disabled",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 640 512"},(0,i.createElement)("path",{d:"M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"}))),(0,i.createElement)("div",{className:"w-full"},(0,i.createElement)("div",{className:"wcf-accordion-loader mb-3.5"},(0,i.createElement)("span",{className:"block h-4 w-28 bg-background-secondary rounded-md mb-4"}),(0,i.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md mb-4 w-10/12"}),(0,i.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md mb-4 w-8/12"}),(0,i.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md w-1/2 mb-4"})))),(0,i.createElement)("div",{className:"flex gap-4 mt-6"},(0,i.createElement)("span",{className:"w-20 h-4 bg-background-secondary rounded-md"}),(0,i.createElement)("span",{className:"w-20 h-4 bg-background-secondary rounded-md"}),(0,i.createElement)("span",{className:"w-20 h-4 bg-background-secondary rounded-md"}),(0,i.createElement)("span",{className:"w-20 h-4 bg-background-secondary rounded-md"})),(0,i.createElement)("div",{className:"w-full"},(0,i.createElement)("div",{className:"mt-6 mb-3.5"},(0,i.createElement)("span",{className:"block h-4 w-28 bg-background-secondary rounded-md mb-4"}),(0,i.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md mb-4 w-10/12"}),(0,i.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md mb-4 w-8/12"}),(0,i.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md w-1/2 mb-4"}))))},Ng=function(){return(0,i.createElement)("div",{className:"wcf-order-bump-design-tab is-placeholder"},(0,i.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",null))))),(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",null,(0,i.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,i.createElement)("div",{className:"wcf-selection-field"},(0,i.createElement)("label",null)))))),(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",null,(0,i.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,i.createElement)("div",{className:"wcf-selection-field"},(0,i.createElement)("label",null)))))))),(0,i.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,i.createElement)("span",null))),(0,i.createElement)("div",{className:"wcf-order-bump-design-tab__preview"},(0,i.createElement)("div",{className:"wcf-order-bump-design-tab__preview--title"},(0,i.createElement)("label",null)),(0,i.createElement)("div",{className:"wcf-bump-order-wrap wcf-bump-order-style-1 wcf-after-order"},(0,i.createElement)("div",{className:"wcf-bump-order-content"},(0,i.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,i.createElement)("span",null)),(0,i.createElement)("div",{className:"wcf-content-container"},(0,i.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,i.createElement)("div",{className:"wcf-bump-order-offer"},(0,i.createElement)("span",{className:"wcf-bump-order-bump-highlight"})),(0,i.createElement)("div",{className:"wcf-bump-order-desc"})))))))},Eg=function(){return(0,i.createElement)("div",{className:"wcf-order-bump-setting-tab is-placeholder"},(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",null))))),(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",{className:"wcf-field-one"})))),(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",{className:"wcf-field-two"})))),(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",null))))),(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",{className:"wcf-field-one"})))),(0,i.createElement)("tr",null,(0,i.createElement)("th",{scope:"row"},(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",{className:"wcf-field-two"})))))),(0,i.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,i.createElement)("span",null)))},_g=function(e){const{fontSize:t,width:n,style:r}=e;return(0,i.createElement)("div",{className:"wcf-skeleton bg-background-secondary block leading-5 wcf-skeleton--text wcf-skeleton--wave",style:{fontSize:t,width:n,...r}})},Mg=function(e){const{height:t,style:n}=e;return(0,i.createElement)("div",{className:"wcf-skeleton-base wcf-skeleton--spacer h-6",style:{height:t,...n}})},Ig=function(e){const{width:t,height:n,style:r}=e;return(0,i.createElement)("div",{className:"wcf-skeleton block leading-5 wcf-skeleton--rect bg-background-secondary rounded-md animate-pulse",style:{width:t,height:n,...r}})},Sg=function(){return(0,i.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,i.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,i.createElement)(_g,{width:"65%"})),(0,i.createElement)("div",{className:"wcf-order-bumps-rules--group"},Array(3).fill().map((e,t)=>(0,i.createElement)("div",{className:"wcf-order-bumps-rule",key:e},(0,i.createElement)("div",{className:"wcf-order-bumps-rule--select-box"},(0,i.createElement)(Ig,{height:"35px",width:"30%"}),(0,i.createElement)(Ig,{height:"35px",width:"30%"}),(0,i.createElement)(Ig,{height:"35px",width:"30%"})),2!==t&&(0,i.createElement)("div",{className:"wcf-order-bumps-rule__and"},(0,i.createElement)(Ig,{height:"25px",width:"5%"}))))),(0,i.createElement)("div",{className:"wcf-order-bumps-rules--or"},(0,i.createElement)(Ig,{height:"35px",width:"5%"}),(0,i.createElement)(Ig,{height:"45px",width:"12%"})),(0,i.createElement)("div",{className:"wcf-order-bumps-rules-save-settings"},(0,i.createElement)(Ig,{height:"45px",width:"12%"})))},kg=new function(){const e=this;this.compare=function(e,t,n){switch(n){case"==":return e==t;case"!=":return e!=t;case"!==":return e!==t;case"in":return-1!==t.indexOf(e);case"!in":return-1===t.indexOf(e);case"contains":return-1!==e.indexOf(t);case"!contains":return-1===e.indexOf(t);case"<":return e<t;case"<=":return e<=t;case">":return e>t;case">=":return e>=t;default:return e===t}},this.check=function(t,n){const r="or"===t.relation;let o=!r;return t.fields.map(function(t){let a;return a=t.fields?e.check(t,n):e.compare(n[t.name],t.value,t.operator),r?(a&&(o=!0),!a):a?"":o=!1}),o},this.isActiveControl=function(t,n){const r=!!t?.conditions&&t?.conditions;return!(r&&!e.check(r,n))}},Dg=To("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Cg=(0,s.forwardRef)(({id:e,label:t,defaultChecked:n=!1,checked:r,onChange:o,indeterminate:a,disabled:i,size:l="md",className:c,...u},d)=>{const f=(0,s.useMemo)(()=>e||`checkbox-${Kh()}`,[e]),p=(0,s.useMemo)(()=>typeof r<"u",[r]),[m,h]=(0,s.useState)(n||!1),g="primary",w={sm:{checkbox:"size-4 rounded gap-1",icon:"size-3",text:"text-sm",description:"text-sm",gap:"gap-0.5"},md:{checkbox:"size-5 rounded gap-1",icon:"size-4",text:"text-base",description:"text-sm",gap:"gap-1"}},y={primary:{checkbox:"border-border-strong hover:border-border-interactive checked:border-border-interactive bg-white checked:bg-toggle-on checked:hover:bg-toggle-on-hover checked:hover:border-toggle-on-hover focus:ring-2 focus:ring-offset-2 focus:ring-focus",icon:"text-white"}},b=(0,s.useCallback)(()=>p?r:m,[p,r,m]),v=(0,s.useCallback)(()=>(0,s.isValidElement)(t)?t:t?.heading||t?.description?(0,j.jsxs)("div",{className:w[l].gap,children:[t?.heading&&(0,j.jsx)(Of,{className:Se("text-text-primary font-medium leading-4 m-0",w[l].text,w[l].gap,i&&"text-text-disabled"),htmlFor:f,children:t?.heading}),t?.description&&(0,j.jsx)(Of,{tag:"p",className:Se("font-normal leading-5 m-0",w[l].description,i&&"text-text-disabled"),variant:"help",children:t?.description})]}):null,[t,l,i]);return(0,j.jsxs)("div",{className:Se("inline-flex items-center justify-center gap-2",!!t&&"items-start",i&&"cursor-not-allowed"),children:[(0,j.jsxs)("label",{className:Se("relative flex items-center justify-center rounded-full p-0.5",!i&&"cursor-pointer"),htmlFor:f,children:[(0,j.jsx)("input",{ref:d,id:f,type:"checkbox",className:Se("peer relative cursor-pointer appearance-none transition-all m-0 before:content-[''] checked:before:content-[''] checked:before:hidden before:hidden !border-1.5 border-solid",y[g].checkbox,w[l].checkbox,i&&"cursor-not-allowed disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled",c),checked:b(),onChange:e=>{if(i)return;const t=e.target.checked;p||h(t),"function"==typeof o&&o(t)},disabled:i,...u}),(0,j.jsx)("span",{className:Se("pointer-events-none inline-flex items-center absolute top-2/4 not-rtl:left-2/4 rtl:right-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",y[g].icon,i&&"cursor-not-allowed peer-disabled:text-border-disabled"),children:a?(0,j.jsx)(Dg,{className:Se(w[l]?.icon)}):(0,j.jsx)(Oo,{className:Se(w[l]?.icon)})})]}),!!t&&v()]})});Cg.displayName="Checkbox";const jg=function(e){const{name:t,id:n,label:r,value:o,desc:a,backComp:l=!1,tooltip:c,onClick:u,notice:d,child_class:f="",isDisabled:p=!1,isPro:m=!1}=e,[h,g]=(0,s.useState)(o);(0,s.useEffect)(()=>{g(o)},[o]);const w=l?"enable":"yes",y=l?"disable":"no";return(0,i.createElement)("div",{className:"wcf-field wcf-checkbox-field text-left"},(0,i.createElement)("div",{className:"wcf-field__data flex items-center gap-2.5"},(0,i.createElement)("div",{className:`wcf-field__data--content ${f}`},(0,i.createElement)("input",{type:"hidden",name:t,value:h}),(0,i.createElement)(Cg,{id:n||t,checked:w===h,onChange:function(e){let r;if(e){if(d&&!function(){switch(d.type){case"alert":return alert(d.message),!0;case"confirm":return!!confirm(d.message);case"prompt":return prompt(d.message)===d.check.toUpperCase();default:return!1}}())return;g(w),r=w}else g(y),r=y;const o={target:{checked:e,id:n||t}},a=new CustomEvent("wcf:checkbox:change",{bubbles:!0,detail:{e:o,name:t,value:r}});document.dispatchEvent(a),u&&u(o)},disabled:p,className:e.class||e.className})),r&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left w-full md:w-80 lg:w-80"},(0,i.createElement)("label",{htmlFor:n||t,className:"mr-3"},r,c&&(0,i.createElement)(dM,{text:c}),!wcfCartflowsPro()&&m&&(0,i.createElement)("span",{className:"ml-2 inline-flex align-middle"},(0,i.createElement)(Pp,null))))),a&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Zm(a)))},Ag={primary:{checkbox:"border-border-strong hover:border-border-interactive checked:border-border-interactive bg-white checked:bg-toggle-on checked:hover:bg-toggle-on-hover checked:hover:border-toggle-on-hover focus:ring-2 focus:ring-offset-2 focus:ring-focus",icon:"text-white"}},Tg={sm:"text-sm leading-5",md:"text-base leading-6"},Lg={sm:{checkbox:"size-4",icon:"size-1.5",info:"size-4"},md:{checkbox:"size-5",icon:"size-2",info:"size-5"}},Og={xs:"py-1 px-1 text-sm gap-0.5 [&>svg]:size-4",sm:"py-1 px-1.5 text-base gap-1 [&>svg]:size-4",md:"py-2 px-2.5 text-base gap-1 [&>svg]:size-5",lg:"py-2.5 px-3 text-base gap-1 [&>svg]:size-6"},zg=({label:e,switchId:t,disabled:n=!1,children:r,size:o})=>{const a={xs:"text-xs leading-4 font-medium",sm:"text-sm leading-5 font-medium",md:"text-base leading-6 font-medium"},i={xs:"text-xs leading-4 font-normal",sm:"text-sm leading-5 font-normal",md:"text-sm leading-5 font-normal"},l={xs:"space-y-0.5",sm:"space-y-0.5",md:"space-y-1"};if((0,s.isValidElement)(e))return(0,j.jsxs)("div",{className:Se("inline-flex items-center gap-3","items-start"),children:[r,e]});const c=!e?.heading&&!e?.description,u=e?.heading&&e?.description?"items-start":"items-center";return c?r:(0,j.jsxs)("div",{className:Se("inline-flex",u,"gap-3"),children:[r,(()=>{const{heading:r="",description:s=""}=e||{};return(0,j.jsxs)("div",{className:Se("space-y-0.5",l[o]),children:[r&&(0,j.jsx)(Of,{htmlFor:t,className:Se("m-0",a[o]),...n&&{variant:"disabled"},children:r}),s&&(0,j.jsx)(Of,{tag:"p",variant:"help",className:Se("text-sm font-normal leading-5 m-0",i[o]),...n&&{variant:"disabled"},children:s})]})})()]})},Pg=(0,s.forwardRef)(({id:e,onChange:t,value:n,defaultValue:r=!1,size:o="sm",disabled:a=!1,label:i={heading:"",description:""},name:l,className:c,...u},d)=>{const f="lg"===o?"md":o,p=(0,s.useMemo)(()=>typeof n<"u",[n]),m=(0,s.useMemo)(()=>e||`switch-${Kh()}`,[]),[h,g]=(0,s.useState)(r),w="primary",y=(0,s.useCallback)(()=>p?n:h,[p,n,h]),b={primary:{input:"bg-toggle-off checked:bg-toggle-on focus:ring focus:ring-toggle-on focus:ring-offset-2 border border-solid border-toggle-off-border checked:border-toggle-on-border shadow-toggleContainer focus:outline-none checked:focus:border-toggle-on-border focus:border-toggle-off-border",toggleDial:"bg-toggle-dial-background shadow-toggleDial"}},v={md:{container:"w-11 h-6",toggleDial:"size-4 peer-checked:translate-x-5"},sm:{container:"w-10 h-5",toggleDial:"size-3 peer-checked:translate-x-5"},xs:{container:"w-8 h-4",toggleDial:"size-2.5 peer-checked:translate-x-3.75"}};return(0,j.jsx)(zg,{label:i,switchId:m,disabled:a,size:f,children:(0,j.jsxs)("div",{className:Se("relative group/switch inline-block cursor-pointer rounded-full shrink-0",v[f].container,c),children:[(0,j.jsx)("input",{ref:d,id:m,type:"checkbox",className:Se("peer appearance-none absolute rounded-full cursor-pointer transition-colors duration-300 h-full w-full before:content-[''] checked:before:content-[''] m-0 checked:[background-image:none]",b[w].input,a&&"bg-toggle-off-disabled disabled:border-transparent disabled:cursor-not-allowed checked:disabled:bg-toggle-on-disabled disabled:shadow-toggle-disabled",!a&&{primary:{input:"group-hover/switch:bg-toggle-off-hover checked:group-hover/switch:bg-toggle-on-hover checked:group-hover/switch:border-toggle-on-border"}}[w].input),checked:y(),onChange:e=>{if(a)return;const n=e.target.checked;p||g(n),"function"==typeof t&&t(n)},disabled:a,name:l,...u}),(0,j.jsx)("label",{htmlFor:m,className:Se("peer/toggle-dial bg-white border rounded-full absolute cursor-pointer shadow-md before:content[''] before:transition-opacity before:opacity-0 hover:before:opacity-10 before:hidden border-none transition-all duration-300 top-2/4 not-rtl:left-1 rtl:right-1 -translate-y-2/4 before:w-10 before:h-10 before:rounded-full before:absolute before:top-2/4 not-rtl:before:left-2/4 rtl:before:right-2/4 before:-translate-y-2/4 before:-translate-x-2/4",v[f].toggleDial,b[w].toggleDial,a&&"peer-disabled:cursor-not-allowed",!a&&{md:"group-hover/switch:size-5 group-focus-within/switch:size-5 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5",sm:"group-hover/switch:size-4 group-focus-within/switch:size-4 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5",xs:"group-hover/switch:size-3.25 group-focus-within/switch:size-3.25 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5"}[f])})]})})});Pg.displayName="Switch";const Rg=(0,s.createContext)({}),Ug=()=>(0,s.useContext)(Rg),Bg=({children:e,name:t,style:n="simple",size:r="md",value:o,defaultValue:a,by:i="id",as:l="div",onChange:c,className:u,disableGroup:d=!1,vertical:f=!1,columns:p=4,multiSelection:m=!1,gapClassName:h="gap-2"})=>{const g=(0,s.useMemo)(()=>typeof o<"u",[o]),w=(0,s.useMemo)(()=>t||`radio-button-group-${Kh()}`,[t]);let y;y=g?o:m?a??[]:a;const[b,v]=(0,s.useState)(y),x=(0,s.useCallback)(e=>{if(m)v(t=>{let n;return n=Array.isArray(t)&&"string"==typeof e&&t.includes(e)?t.filter(t=>t!==e):[...Array.isArray(t)?t:[],..."string"==typeof e?[e]:[]],"function"==typeof c&&c(n),n});else{if(g||v(e),"function"!=typeof c)return;c(e)}},[c]);u=Se("grid grid-cols-4",Ce[p],h,"tile"===n&&"gap-0",f&&"grid-cols-1",u);const N=Se("tile"===n?"border border-border-subtle border-solid rounded-md shadow-sm":"gap-6",u),E=()=>(0,j.jsx)(Rg.Provider,{value:{name:w,value:g?o:b,by:i,onChange:x,isControlled:g,disableAll:d,style:n,columns:p,multiSelection:m,size:r},children:s.Children.map(e,e=>(0,s.isValidElement)(e)?e:null)});return(0,j.jsx)(j.Fragment,{children:"tile"===n?(0,j.jsx)("div",{className:N,children:E()}):(0,j.jsx)(l,{...l===s.Fragment?{}:{className:u},children:E()})})};Bg.displayName="RadioButton.Group";const Fg=(0,s.forwardRef)(({id:e,label:t,value:n,children:r,disabled:o,icon:a=null,inlineIcon:i=!1,hideSelection:l=!1,reversePosition:c=!1,borderOn:u=!1,borderOnActive:d=!0,badgeItem:f=null,useSwitch:p=!1,info:m,minWidth:h=!0,...g},w)=>{const{buttonWrapperClasses:y,...b}=g,v=Ug(),{name:x,value:N,by:E,onChange:_,disableAll:M,checked:I,multiSelection:S,size:k="md"}=v,D="primary",C=(0,s.useMemo)(()=>e||`radio-button-${Kh()}`,[e]),A=(0,s.useMemo)(()=>M||o,[M,o]),T=(0,s.useMemo)(()=>S?Array.isArray(N)&&N.includes(n):typeof I<"u"?I:typeof N==typeof n&&("string"==typeof N?N===n:Array.isArray(N)?N.includes(n):N[E]===n[E]),[N,n,I]),L=(0,s.useCallback)(()=>(0,s.isValidElement)(t)?t:t?.heading?(0,j.jsxs)("div",{className:Se(!i&&{"space-y-3":"sm"===k,"space-y-4":"md"===k},c&&(p?"ml-10":"ml-4"),i&&"flex gap-2",i&&!t.description&&"items-center"),children:[a&&(0,j.jsx)(j.Fragment,{children:a}),(0,j.jsxs)("div",{className:Se(!a||!p||a&&f?{"space-y-0.5":"sm"===k,"space-y-1":"md"===k}:"space-y-0.5"),children:[(0,j.jsx)("p",{className:Se("text-text-primary font-medium m-0",Tg[k],o&&"text-text-disabled cursor-not-allowed"),children:t.heading}),t.description&&(0,j.jsx)("p",{className:"text-text-tertiary text-sm font-normal leading-5 m-0",children:t.description})]})]}):null,[t]);if("tile"===v.style)return(0,j.jsx)(Qg,{id:e,label:t,value:n,disabled:o,size:k,children:r});const O=()=>{A||(S?p&&_(n,!T):_(n))};return(0,j.jsxs)("label",{className:Se("inline-flex items-center relative cursor-pointer transition-all duration-300",!!t&&"items-start justify-between",h&&"min-w-[180px]",u&&"outline outline-field-border outline-1 rounded-md shadow-sm hover:outline-border-interactive",d&&u&&T&&"outline-border-interactive",{"pl-3.5 pr-2.5 py-2.5":"sm"===k&&!(a&&p),"p-3":"sm"===k&&(a&&p||a&&f),"pl-4 pr-3 py-3":"md"===k&&!(a&&p),"p-4":"md"===k&&(a&&p||a&&f)},"pr-12",A&&"cursor-not-allowed opacity-40",y),htmlFor:C,onClick:O,children:[!!t&&(0,j.jsx)("label",{className:Se("cursor-pointer",A&&"cursor-not-allowed"),htmlFor:C,children:L()}),!!m&&(0,j.jsx)("div",{className:"absolute mr-0.5 bottom-1.5 right-3",children:(0,j.jsx)(Wo,{title:m?.heading,content:m?.description,children:(0,j.jsx)(Lo,{className:Se("text-text-primary",Lg[k]?.info)})})}),(0,j.jsxs)("label",{className:Se("absolute mr-0.5 right-3 flex items-center cursor-pointer rounded-full gap-2",c&&"left-0",A&&"cursor-not-allowed",i&&"mr-3"),onClick:O,children:[!!f&&f,!l&&(p?(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(Pg,{defaultValue:!1,size:k,onChange:()=>{S?_(n,!T):_(n)},checked:T,...b,"aria-label":t?.heading??"Switch"})}):(0,j.jsxs)("span",{className:"relative p-0.5",children:[(0,j.jsx)("input",{ref:w,id:C,type:S?"checkbox":"radio",className:Se("peer flex relative cursor-pointer appearance-none transition-all m-0 before:content-[''] checked:before:content-[''] checked:before:hidden before:hidden !border-1.5 border-solid",!S&&"rounded-full",Ag[D].checkbox,Lg[k].checkbox,A&&"disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled cursor-not-allowed"),name:x,value:n,onChange:e=>_(e.target.value),checked:T,disabled:A,...b}),(0,j.jsx)("span",{className:Se("inline-flex items-center absolute top-2/4 not-rtl:left-2/4 rtl:right-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",Ag[D].icon,A&&"peer-disabled:text-border-disabled cursor-not-allowed"),children:S?(0,j.jsx)(Oo,{className:"sm"===k?"size-3":"size-4"}):(0,j.jsx)("div",{className:Se("rounded-full bg-current",Lg[k]?.icon)})})]}))]})]})});Fg.displayName="RadioButton.Button";const Qg=({id:e,children:t,value:n,disabled:r,size:o="md",...a})=>{const i=Ug(),{name:l,value:c,by:u,onChange:d,disableAll:f,checked:p}=i||{},m=(0,s.useMemo)(()=>e||`radio-button-${Kh()}`,[e]),h=(0,s.useMemo)(()=>f||r,[f,r]),g=(0,s.useMemo)(()=>typeof p<"u"?p:typeof c==typeof n&&("string"==typeof c?c===n:Array.isArray(c)?c.includes(n):!(!c||!u)&&c[u]===n[u]),[c,n,p,u]),w=Se("bg-background-primary text-primary cursor-pointer flex items-center justify-center","hover:bg-button-tertiary-hover","focus:outline-none",h?"text-text-disabled cursor-not-allowed":"",Og[o],"border-0 border-r border-border-subtle border-solid");return(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("button",{type:"button",id:m,"aria-label":"Radio Button",className:Se(w,"first:rounded-tl first:rounded-bl first:border-0 first:border-r first:border-border-subtle last:rounded-tr last:rounded-br last:border-0",g&&"bg-button-disabled"),onClick:()=>{d&&d(n)},disabled:h,...a,children:[(0,j.jsx)("input",{type:"hidden",value:n,name:l,checked:g,onChange:e=>d?.(e.target.value)}),t]})})},Vg=Object.assign(Fg,{Group:Bg,Button:Fg}),Yg=function(e){const{name:t,label:n,value:r,options:o,desc:a,child_class:l="",child_className:c="",onClick:u=""}=e,[d,f]=(0,s.useState)(r);return(0,s.useEffect)(()=>{f(r)},[r]),(0,i.createElement)("div",{className:"wcf-field wcf-radio-field"},(0,i.createElement)("div",{className:"wcf-field__data block"},n&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-left w-full md:w-80 lg:w-80 mb-2"},(0,i.createElement)("label",{className:"text-text-primary text-base font-medium"},n)),(0,i.createElement)("div",{className:"wcf-field__data--content"},o&&(0,i.createElement)(Vg.Group,{name:t,value:d,onChange:function(t){f(t);const n=new CustomEvent("wcf:radio:change",{bubbles:!0,detail:{e:{target:{value:t}},name:e.name,value:t}});document.dispatchEvent(n),u&&u(t)},vertical:!0,gapClassName:"gap-0"},o.map(e=>(0,i.createElement)(Vg.Button,(0,y.A)({key:e.value,value:e.value,minWidth:!1,buttonWrapperClasses:`wcf-radio-field__option py-1.5 [&_label]:text-left ${e.desc?"[&_p:last-child]:!text-text-secondary":""} ${c||l}`},(e.label||e.desc)&&{label:{heading:e.label||"",...e.desc&&{description:e.desc}}})))))),a&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Zm(a)))},Zg=To("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Wg=To("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Gg={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2.5 py-2 rounded text-xs font-medium leading-4 min-h-[2rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-sm",searchbarIcon:"size-4",label:"text-sm font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-3.5 py-2.5 rounded-md text-sm font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-4 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-base font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-base font-medium"}},Hg="group-disabled:text-field-color-disabled",$g={sm:"w-[calc(100%+0.75rem)] translate-x-[-0.375rem]",md:"w-[calc(100%+1rem)] translate-x-[-0.5rem]",lg:"w-[calc(100%+1rem)] translate-x-[-0.5rem]"},Xg={sm:"py-1.5 px-2 text-xs font-normal",md:"p-2 text-sm font-normal",lg:"p-2 text-base font-normal"},qg=e=>null===e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?e.toString():Array.isArray(e)?e.map(qg).join(" ").trim():(0,s.isValidElement)(e)?e.props&&e.props.children?qg(e.props.children):"":"object"==typeof e&&"textContent"in e?e.textContent?.toString().toLowerCase()||"":"object"==typeof e&&"children"in e?qg(e.children):"",Jg=To("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Kg=({variant:e="primary",size:t="md",icon:n=null,className:r=""})=>{const o={primary:"text-brand-primary-600",secondary:"text-background-primary"}[e],a={sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6",xl:"[&>svg]:size-8"}[t];return(0,j.jsx)("span",{className:Se("flex",a,o,r),children:n||(0,j.jsx)(Jg,{className:"animate-spin shrink-0"})})},ew=(0,s.createContext)({}),tw=()=>(0,s.useContext)(ew),nw=(0,s.forwardRef)(({children:e,icon:t=null,placeholder:n="Select an option",optionIcon:r=null,render:o,label:a,className:i,...l},c)=>{const{sizeValue:u,getReferenceProps:d,getValues:f,selectId:p,refs:m,isOpen:h,multiple:g,combobox:w,setSelected:y,onChange:b,isControlled:v,disabled:x,by:N}=tw(),E={sm:"xs",md:"sm",lg:"md"}[u],_=(0,s.useCallback)(()=>{if(t)return t;const e="text-field-placeholder group-disabled:text-icon-disabled";return w?(0,j.jsx)(Zg,{className:e}):(0,j.jsx)(cp,{className:e})},[t]),M=(0,s.useCallback)(()=>{const t=f();if(!t)return null;if(g)return t.map((e,t)=>(0,j.jsx)(Lf,{className:"cursor-default",icon:r,type:"rounded",size:E,onMouseDown:I(e),label:"function"==typeof o?o(e):e.toString(),closable:!0,disabled:x},t));let n="string"==typeof t?t:"";if("function"==typeof o&&(n=o(t)),"function"==typeof e&&"function"!=typeof o){const r={value:t,...g?{onClose:I(t)}:{}};n=e(r)}return((0,s.isValidElement)(e)||"string"==typeof e)&&"function"!=typeof o&&(n=e),(0,j.jsx)("span",{className:Se("truncate",Gg[u].displaySelected,Hg),children:n})},[f,x]),I=e=>t=>{t?.preventDefault(),t?.stopPropagation();const n=[...f()??[]],r=n.findIndex(t=>null!==t&&null!==e&&"object"==typeof t?t[N]===e[N]:t===e);-1!==r&&(n.splice(r,1),v||y(n),"function"==typeof b&&b(n))};return(0,j.jsxs)("div",{className:"w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[!!a&&(0,j.jsx)("label",{className:Se(Gg[u]?.label,"text-field-label"),htmlFor:p,children:a}),(0,j.jsxs)("button",{id:p,ref:Zo(m.setReference,c),className:Se("flex items-center justify-between w-full box-border transition-[outline,background-color,color,box-shadow] duration-200 bg-white","outline outline-1 outline-field-border border-none cursor-pointer",!h&&"focus:ring-2 focus:ring-offset-2 focus:outline-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:outline-border-strong",Gg[u].selectButton,g&&Gg[u].multiSelect,"group disabled:outline-field-border-disabled [&:hover:has(:disabled)]:outline-field-border-disabled disabled:cursor-default",i),tabIndex:0,disabled:x,...l,...d(),children:[(0,j.jsxs)("div",{className:Se("flex-1 grid items-center justify-start gap-1.5 overflow-hidden",f()&&"flex flex-wrap"),children:[M(),(g?!f()?.length:!f())&&(0,j.jsx)("div",{className:Se("[grid-area:1/1/2/3] text-field-input px-1",Gg[u].displaySelected,Hg),children:n})]}),(0,j.jsx)("div",{className:Se("flex items-center [&>svg]:shrink-0",Gg[u].icon),children:_()})]})]})});function rw({label:e,children:t,className:n,...r}){const{index:o,totalGroups:a}=r,{sizeValue:i}=tw();return(0,j.jsxs)(s.Fragment,{children:[(0,j.jsxs)("div",{className:"flex flex-col",role:"group","aria-label":e,children:[(0,j.jsx)("div",{className:Se("p-2 font-normal text-text-tertiary",{sm:"text-xs",md:"text-xs",lg:"text-sm"}[i],n),id:`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:e}),(0,j.jsx)("div",{className:"flex flex-col",role:"presentation","aria-labelledby":`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:t})]}),o<a&&!!(t&&s.Children.count(t)>0)&&(0,j.jsx)("hr",{className:Se("h-px my-2 w-full border-border-subtle border-b border-t-0 border-solid",$g[i])})]})}function ow({children:e,className:t}){const{isOpen:n,context:r,refs:o,combobox:a,floatingStyles:i,getFloatingProps:l,sizeValue:c,setSearchKeyword:u,setActiveIndex:d,setSelectedIndex:f,value:p,selected:m,getValues:h,searchKeyword:g,listContentRef:w,by:y,searchPlaceholder:b,activeIndex:v,searchFn:x,debounceDelay:N}=tw(),E=(0,s.useMemo)(()=>{const t=h();let n=-1;if(t){let r=s.Children.toArray(e);r.length>0&&(0,s.isValidElement)(r[0])&&r[0].type===rw&&(r=s.Children.toArray(e).map(e=>(0,s.isValidElement)(e)?s.Children.toArray(e.props.children):[]).flat()),n=r.findIndex(e=>{if(!(0,s.isValidElement)(e))return!1;const n=e.props.value;return"object"==typeof n&&"object"==typeof t?n[y]===t[y]:n===t})}return n},[p,m,e,y]);(0,s.useLayoutEffect)(()=>{n||(d(E),f(E))},[E,n]),(0,s.useLayoutEffect)(()=>{n&&(a&&[-1,null].includes(v)||d(-1))},[g,n]);const _=(0,s.useMemo)(()=>{let t=0,n=0;s.Children.forEach(e,e=>{if((0,s.isValidElement)(e)&&e.type===rw){let n=!1;if(g&&!x){const t=g.toLowerCase(),r=(e.props.label?.toLowerCase()||"").includes(t),o=s.Children.toArray(e.props.children).some(e=>!!(0,s.isValidElement)(e)&&(qg(e.props.children)?.toLowerCase()).includes(t));n=r||o}else n=!0;n&&t++}}),n=Math.max(0,t-1);let r=0,o=0;return s.Children.map(e,e=>{if(!(0,s.isValidElement)(e))return null;if(e.type===rw){let t=!1;if(g&&!x){const n=g.toLowerCase();t=(e.props.label?.toLowerCase()||"").includes(n)}const a=s.Children.map(e.props.children,e=>{if(!(0,s.isValidElement)(e))return null;if(t){const t={...e.props,index:r++};return(0,s.cloneElement)(e,t)}if(g&&!x){const t=qg(e.props.children)?.toLowerCase(),n=g.toLowerCase();if(!t?.includes(n))return null}const n={...e.props,index:r++};return(0,s.cloneElement)(e,n)});if(!a?.some(e=>null!==e))return null;const i={...e.props,children:a,index:o,totalGroups:n};return o++,(0,s.cloneElement)(e,i)}if(g&&!x){const t=qg(e.props?.children)?.toLowerCase(),n=g.toLowerCase();if(!t?.includes(n))return null}return(0,s.cloneElement)(e,{...e.props,index:r++})})},[g,p,m,e,x]),M=s.Children.count(_);(0,s.useEffect)(()=>{w.current=[];let t=s.Children.toArray(e);t&&(0,s.isValidElement)(t[0])&&t[0].type===rw&&(t=s.Children.toArray(t).map(e=>(0,s.isValidElement)(e)?e.props.children:null).filter(Boolean)),s.Children.forEach(t,e=>{if(!(0,s.isValidElement)(e))return;const t=qg(e.props?.children)?.toLowerCase();if(g&&!x){const e=g.toLowerCase();if(!t?.includes(e))return}w.current.push(t)})},[g,x]);const[I,S]=(0,s.useState)(!1),k=(0,s.useCallback)(async()=>{if(x&&"function"==typeof x&&!I){S(!0);try{await x(g)}catch(e){console.error(e)}finally{S(!1)}}},[g]),D=((e,t=500)=>{const n=(0,s.useRef)(null);return(0,s.useCallback)((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>e(...r),t)},[e,t])})(k,N);return(0,s.useEffect)(()=>{"function"==typeof x&&D()},[D]),(0,j.jsx)(j.Fragment,{children:n&&(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(Kr,{context:r,modal:!1,visuallyHiddenDismiss:!0,children:(0,j.jsxs)("div",{ref:o.setFloating,className:Se("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg outline outline-1 outline-border-subtle",a&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",Gg[c].dropdown,!a&&"h-auto",a?"overflow-hidden":"overflow-y-auto overflow-x-hidden",t),style:{...i,zIndex:1},...l(),children:[a&&(0,j.jsxs)("div",{className:Se(Gg[c].searchbarWrapper),children:[I?(0,j.jsx)(Kg,{className:Gg[c].searchbarIcon}):(0,j.jsx)(Wg,{className:Se("text-icon-secondary shrink-0",Gg[c].searchbarIcon)}),(0,j.jsx)("input",{className:Se("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",Gg[c].searchbar),type:"search",name:"keyword",placeholder:b,onChange:e=>u(e.target.value),value:g,autoComplete:"off"})]}),(0,j.jsxs)("div",{className:Se("overflow-y-auto overflow-x-hidden",!a&&"w-full h-full",Gg[c].dropdownItemsWrapper),children:[!!M&&_,!M&&(0,j.jsx)("div",{className:Se("p-2 text-center font-medium text-field-placeholder",Xg[c]),children:"No items found"})]})]})})})})}function aw({children:e,root:t,id:n}){return(0,j.jsx)(Zr,{id:n,root:t,children:e})}function iw({value:e,selected:t,children:n,className:r,...o}){const{sizeValue:a,getItemProps:i,onKeyDownItem:l,onClickItem:c,activeIndex:u,selectedIndex:d,updateListRef:f,getValues:p,by:m,multiple:h}=tw(),{index:g}=o,w=(0,s.useRef)(g),y=(0,s.useMemo)(()=>{if(!h)return!1;const t=p();return!!t&&t.some(t=>null!==t&&null!==e&&"object"==typeof t?t[m]===e[m]:t===e)},[e,p]),b=(0,s.useMemo)(()=>"boolean"==typeof t?t:h?y:g===d,[y,d,t]);return(0,j.jsxs)("div",{className:Se("w-full flex items-center justify-between text-text-primary hover:bg-button-tertiary-hover rounded-md transition-all duration-150 cursor-pointer focus:outline-none focus-within:outline-none outline-none",Xg[a],g===u&&"bg-button-tertiary-hover",r),ref:e=>{f(g,e)},role:"option",tabIndex:g===u?0:-1,"aria-selected":b&&g===u,...i({onClick(){c(w.current,e)},onKeyDown(t){l(t,w.current,e)}}),children:[(0,j.jsx)("span",{className:"w-full truncate",children:n}),b&&(0,j.jsx)(Oo,{className:Se("text-icon-on-color-disabled",{sm:"size-4",md:"size-4",lg:"size-5"}[a])})]})}const sw=({id:e,size:t="md",value:n,defaultValue:r,onChange:o,by:a="id",children:i,multiple:l=!1,combobox:c=!1,disabled:u=!1,searchPlaceholder:d="Search...",searchFn:f,debounceDelay:p=500})=>{const m=(0,s.useMemo)(()=>e||`select-${Kh()}`,[e]),h=(0,s.useMemo)(()=>typeof n<"u",[n]),[g,w]=(0,s.useState)(r),[y,b]=(0,s.useState)(""),v=(0,s.useCallback)(()=>h?n:g,[h,n,g]),[x,N]=(0,s.useState)(!1),[E,_]=(0,s.useState)(null),[M,I]=(0,s.useState)(null),S={sm:c?256:172,md:c?256:216,lg:c?256:216},{refs:k,floatingStyles:D,context:C}=uo({strategy:"fixed",placement:"bottom-start",open:x,onOpenChange:N,whileElementsMounted:jn,middleware:[Bn(5),Qn({padding:10}),Vn({apply({rects:e,elements:n,availableHeight:r}){Object.assign(n.floating.style,{maxHeight:`min(${r}px, ${S[t]}px)`,maxWidth:`${e.reference.width}px`})},padding:10})]}),A=(0,s.useRef)([]),T=(0,s.useRef)([]),L=(0,s.useRef)(!1),O=ao(C,{event:"mousedown"}),z=co(C),P=Eo(C,{role:"listbox"}),R=xo(C,{listRef:A,activeIndex:E,selectedIndex:M,onNavigate:_,loop:!0}),U=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:a,activeIndex:i,onMatch:l,onTypingChange:c,enabled:u=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:p=[],selectedIndex:m=null}=t,h=s.useRef(),g=s.useRef(""),w=s.useRef(null!=(n=null!=m?m:i)?n:-1),y=s.useRef(null),b=Gn(l),v=Gn(c),x=xr(d),N=xr(p);ir(()=>{r&&(clearTimeout(h.current),y.current=null,g.current="")},[r]),ir(()=>{var e;r&&""===g.current&&(w.current=null!=(e=null!=m?m:i)?e:-1)},[r,m,i]);const E=Gn(e=>{e?o.current.typing||(o.current.typing=e,v(e)):o.current.typing&&(o.current.typing=e,v(e))}),_=Gn(e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return r?e.indexOf(r):-1}const n=a.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?E(!1):" "===e.key&&Et(e)),null==n||N.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Et(e),E(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&g.current===e.key&&(g.current="",w.current=y.current),g.current+=e.key,clearTimeout(h.current),h.current=setTimeout(()=>{g.current="",w.current=y.current,E(!1)},f);const o=w.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",E(!1))}),M=s.useMemo(()=>({onKeyDown:_}),[_]),I=s.useMemo(()=>({onKeyDown:_,onKeyUp(e){" "===e.key&&E(!1)}}),[_,E]);return s.useMemo(()=>u?{reference:M,floating:I}:{},[u,M,I])}(C,{listRef:T,activeIndex:E,selectedIndex:M,onMatch:x?_:I,onTypingChange(e){L.current=e}}),{getReferenceProps:B,getFloatingProps:F,getItemProps:Q}=ho([z,P,R,O,...c?[]:[U]]),V=(e,t)=>{if(l)return((e,t)=>{const n=[...v()??[]];-1===n.findIndex(e=>null!==e&&null!==t&&"object"==typeof e?e[a]===t[a]:e===t)&&(n.push(t),h||w(n),I(e),k.reference.current.focus(),N(!1),b(""),"function"==typeof o&&o(n))})(e,t);I(e),h||w(t),k.reference.current.focus(),N(!1),b(""),"function"==typeof o&&o(t)},Y=(0,s.useCallback)((e,t)=>{A.current[e]=t},[]);return(0,j.jsx)(ew.Provider,{value:{selectedIndex:M,setSelectedIndex:I,activeIndex:E,setActiveIndex:_,selected:g,setSelected:w,handleSelect:V,combobox:c,sizeValue:t,multiple:l,onChange:o,isTypingRef:L,getItemProps:Q,onClickItem:(e,t)=>{V(e,t)},onKeyDownItem:(e,t,n)=>{"Enter"===e.key&&(e.preventDefault(),V(t,n))," "===e.key&&!L.current&&(e.preventDefault(),V(t,n))},getValues:v,selectId:m,getReferenceProps:B,isOpen:x,value:n,updateListRef:Y,refs:k,listContentRef:T,by:a,getFloatingProps:F,floatingStyles:D,context:C,searchKeyword:y,setSearchKeyword:b,disabled:u,isControlled:h,searchPlaceholder:d,searchFn:f,debounceDelay:p},children:i})};sw.displayName="Select";const lw=Object.assign(sw,{Portal:aw,Button:nw,Options:ow,Option:iw,OptionGroup:rw});aw.displayName="Select.Portal",nw.displayName="Select.Button",ow.displayName="Select.Options",iw.displayName="Select.Option",rw.displayName="Select.OptionGroup";const cw=function(e){const{name:t,id:n,label:r,desc:o,tooltip:a,options:l,onSelect:c,prodata:u,after:d,sectionClass:f="",wrapperClass:p="",contentClass:m="",labelClass:h="",descClass:g="",displayAlign:w="horizontal",isDisabled:y=!1}=e,[b,v]=(0,s.useState)(e.value),x=(0,s.useRef)(null),N=f||"text-left",E=h||"text-sm font-medium text-text-primary mb-2",_=g||"text-sm font-normal text-text-tertiary mt-2";let M=p||"flex items-center gap-2.5",I=m||"";return"horizontal_inline"===w?(M="flex items-center justify-between gap-2.5",I="w-[300px]"):"horizontal"!==w&&(M="block w-full text-left"),(0,s.useEffect)(()=>{v(e.value),x.current&&(x.current.value=e.value)},[e.value]),(0,i.createElement)("div",{className:`wcf-field wcf-select-option ${N}`},(0,i.createElement)("div",{className:`wcf-field__data ${M}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${E}`},(0,i.createElement)("label",null,r,a&&(0,i.createElement)(dM,{text:a}))),(0,i.createElement)("div",{className:`wcf-field__data--content ${I}`},(0,i.createElement)("input",{type:"hidden",ref:x,id:n,name:t,defaultValue:b,className:e.class?e.class:""}),(0,i.createElement)(lw,{value:b,onChange:function(n){if(u&&n in u)return;v(n),x.current&&(x.current.value=n);const r={target:{value:n,name:t}},o=new CustomEvent("wcf:select:change",{bubbles:!0,detail:{e:r,name:e.name,value:n}});document.dispatchEvent(o),e?.callback&&e.callback(r,e.name,n),c&&c(r)},disabled:y},(0,i.createElement)(lw.Button,{type:"button",className:e.class?e.class:"",render:function(e){if(!e)return null;for(const t of l||[])if(t.isopt){for(const n of t.options||[])if(String(n.value)===String(e))return n.label}else if(String(t.value)===String(e))return u&&e in u?u[e]:t.label;return e}}),(0,i.createElement)(lw.Options,null,l&&l.map(e=>{if(e.isopt)return(0,i.createElement)(lw.OptionGroup,{label:e.title,key:e.title},e.options.map(e=>(0,i.createElement)(lw.Option,{value:e.value,key:e.value},e.label)));let t=e.label,n=!1;return u&&e.value in u&&(t=u[e.value],n=!0),(0,i.createElement)(lw.Option,{value:e.value,key:e.value,className:n?"opacity-50 pointer-events-none":""},t)})))),d&&(0,i.createElement)("div",{className:`wcf-field__data--content__after ${_}`},d)),o&&(0,i.createElement)("div",{className:`wcf-field__desc ${_}`},Zm(o)))},uw=function(e){const{name:t,id:n,label:r,value:o,placeholder:a,tooltip:l,desc:c,readonly:u,icon:d,textFieldType:f="text",onChangeCB:p,sectionClass:m=!1,wrapperClass:h=!1,contentClass:g,labelClass:w="",descClass:y="text-sm font-normal text-text-tertiary mt-2",displayAlign:b="horizontal",attr:v}=e,[x,N]=(0,s.useState)(o),E=(0,s.useRef)(null),_=m||"text-left",M=`${e.class?e.class:""} ${u?"bg-background-secondary":""} w-full`;let I=h||"flex items-center justify-between gap-2.5",S=w||"text-sm font-medium text-text-primary text-left";const k=null!=g?g:r&&"horizontal"===b?"w-1/2":"w-full";return"horizontal"!==b&&(I="block w-full text-left",S+=" mb-2"),(0,s.useEffect)(()=>{N(o),E.current&&(E.current.value=null!=o?o:"")},[o]),(0,i.createElement)("div",{className:`wcf-field wcf-text-field ${_} `},(0,i.createElement)("div",{className:`wcf-field__data ${I}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${S}`},(0,i.createElement)("label",{className:"whitespace-nowrap"},r,l&&(0,i.createElement)(dM,{text:l}))),(0,i.createElement)("div",{className:`wcf-field__data--content ${k}`},(0,i.createElement)("input",{type:"hidden",ref:E,className:e.class?e.class:"",defaultValue:null!=x?x:""}),(0,i.createElement)(tg,{ref:v?.ref,type:f,value:sm(x),id:n,name:t,onChange:function(e){N(e),E.current&&(E.current.value=e);const n=new CustomEvent("wcf:text:change",{bubbles:!0,detail:{e:{target:{value:e,name:t}},name:t,value:e}});document.dispatchEvent(n),p&&p(e)},placeholder:a,readOnly:u,size:"md",className:M}))),d&&(0,i.createElement)("div",{className:"wcf-text-field__icon"},(0,i.createElement)("span",{className:d})),c&&(0,i.createElement)("div",{className:`wcf-field__desc ${y}`},Zm(c)))},dw=(0,s.forwardRef)(({id:e,defaultValue:t="",value:n,size:r="sm",className:o="",disabled:a=!1,onChange:i=()=>{},error:l=!1,onError:c=()=>{},...u},d)=>{const f=(0,s.useMemo)(()=>e||`input-textarea-${Kh()}`,[e]),p=(0,s.useMemo)(()=>typeof n<"u",[n]),[m,h]=(0,s.useState)(t),g=(0,s.useCallback)(()=>p?n:m,[p,n,m]),w=a?"hover:border-border-disabled":"hover:border-border-strong",y=l?"focus:border-focus-error-border focus:ring-field-color-error border-focus-error-border":"";return(0,j.jsx)("textarea",{ref:d,id:f,className:Se("py-2 rounded border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary focus:outline-none transition ease-in-out duration-200",a?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",{sm:"px-3 rounded text-xs",md:"px-3 rounded-md text-sm",lg:"px-4 rounded-lg text-base"}[r],"focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",w,y,o),disabled:a,onChange:e=>{if(a)return;const t=e.target.value;p||h(t),"function"==typeof i&&i(t)},onInvalid:c,value:g(),...u})});dw.displayName="TextArea";const fw=function(e){const{name:t,value:n,label:r,desc:o,id:a,placeholder:l,tooltip:c,rows:u,cols:d,sectionClass:f=!1,wrapperClass:p=!1,labelClass:m="",descClass:h="text-sm font-normal text-text-tertiary mt-2",displayAlign:g="horizontal"}=e,w=f||"text-left",y=`${e.class?e.class:""} !w-full !max-w-full input-field !px-3 !py-2.5 !text-sm font-normal`;let b=p||"flex flex-col gap-2.5",v=m||"text-sm font-medium text-text-primary text-left mb-2";"horizontal"!==g&&(b="block w-full text-left",v+=" mb-2");const[x,N]=(0,s.useState)(n);return(0,s.useEffect)(()=>{N(n)},[n]),(0,i.createElement)("div",{className:`wcf-field wcf-textarea-field ${w} `},(0,i.createElement)("div",{className:`wcf-field__data ${b}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${v}`},(0,i.createElement)("label",null,r,c&&(0,i.createElement)(dM,{text:c}))),(0,i.createElement)("div",{className:"wcf-field__data--content w-full"},(0,i.createElement)(dw,{id:a,name:t,value:sm(x),onChange:function(e){N(e);const n=new CustomEvent("wcf:textarea:change",{bubbles:!0,detail:{e:{target:{value:e,name:t}},name:t,value:e}});document.dispatchEvent(n)},placeholder:l,rows:u||"10",cols:d||"60",className:y}))),o&&(0,i.createElement)("div",{className:`wcf-field__desc ${h}`},Zm(o)))},pw=function(e){const{name:t,value:n,label:r,id:o,tooltip:a,displayAlign:l="horizontal",language:c="javascript",sectionClass:u=!1,wrapperClass:d=!1,labelClass:f=""}=e,p=function(e){if(!e)return e;const t=document.createElement("textarea");return t.innerHTML=e,t.value}(n),m=(0,s.useRef)(null),h=(0,s.useRef)(null),g=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!m.current||!window.wp?.codeEditor||h.current)return;const e=wp.codeEditor.defaultSettings?JSON.parse(JSON.stringify(wp.codeEditor.defaultSettings)):{};let n;e.codemirror={...e.codemirror,mode:"css"===c?"css":"javascript",lineNumbers:!0,indentUnit:4,tabSize:4};try{n=wp.codeEditor.initialize(m.current,e),h.current=n.codemirror}catch(e){return}h.current.on("change",e=>{const n=e.getValue(),r=new CustomEvent("wcf:code:change",{bubbles:!0,detail:{name:t,value:n}});document.dispatchEvent(r)});const r=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&h.current&&h.current.refresh()})},{threshold:.1});return g.current&&r.observe(g.current),()=>{h.current&&(h.current.toTextArea(),h.current=null),r.disconnect()}},[]);const w=u||"text-left",y=f||"text-sm font-medium text-text-primary text-left mb-2";let b=d||"flex items-center gap-2.5";return"horizontal"!==l&&(b="block w-full text-left"),(0,i.createElement)("div",{ref:g,className:`wcf-field wcf-code-field ${w}`},(0,i.createElement)("div",{className:`wcf-field__data ${b}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${y}`},(0,i.createElement)("label",{htmlFor:o},r,a&&(0,i.createElement)(dM,{text:a}))),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("textarea",{ref:m,id:o,name:t,defaultValue:p}))))};function mw({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const hw=s.forwardRef(mw);function gw({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const ww=s.forwardRef(gw),yw=(0,s.forwardRef)((e,t)=>{const[{settingsProcess:n},r]=f();"saved"===n&&setTimeout(()=>{document.getElementsByClassName("wcf-button--save-global-settings")[0].blur(),r({status:"RESET"})},2e3);const o=e.icon?e.icon:"",a=e.iconClass?e.iconClass:"",s=e.className||e.class||"",l="processing"===n?"wcf-disabled":"";return(0,i.createElement)("div",{className:"wcf-field wcf-submit wcf-submit-field"},(0,i.createElement)(Ro,{ref:t,type:"submit",variant:"primary",className:`wcf-button--save-global-settings ${s} ${l}`,onClick:function(e){const t=e.target.closest("form");!t||t.checkValidity()?r({status:"PROCESSING"}):t.reportValidity()},loading:"processing"===n,icon:function(){if("processing"===n)return(0,i.createElement)(Ah,{className:a});switch(o){case"plus":return(0,i.createElement)(yg,{className:`w-4 h-4 stroke-2 ${a}`});case"loader":return(0,i.createElement)(Pf,{className:`w-4 h-4 stroke-2 ${a}`});case"close":return(0,i.createElement)(ww,{className:`w-4 h-4 stroke-2 ${a}`});case"check":return(0,i.createElement)(hw,{className:`w-4 h-4 stroke-2 ${a}`});default:return null}}()},"saved"===n&&(0,i.createElement)("span",{className:"wcf-success-notice"},(0,i.createElement)(hw,{className:"w-4 h-4 stroke-2 inline-block mr-1"}),(0,i.createElement)("span",{className:"wcf-success-message"},(0,C.__)("Settings Saved","cartflows"))),"processing"===n&&(0,C.__)("Saving…","cartflows"),!n&&(0,C.__)("Save Settings","cartflows")))}),bw=yw;function vw(e){return vw="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},vw(e)}function xw(e){var t=function(e){if("object"!=vw(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vw(t)?t:t+""}function Nw(e,t,n){return(t=xw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ew(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 _w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ew(Object(n),!0).forEach(function(t){Nw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ew(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mw(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,xw(r.key),r)}}var Iw=n(3662);function Sw(e){return Sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sw(e)}function kw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(kw=function(){return!!e})()}function Dw(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 Cw(e,t){if(e){if("string"==typeof e)return Dw(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)?Dw(e,t):void 0}}function jw(e){return function(e){if(Array.isArray(e))return Dw(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Cw(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 Aw=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}(),Tw=Math.abs,Lw=String.fromCharCode,Ow=Object.assign;function zw(e){return e.trim()}function Pw(e,t,n){return e.replace(t,n)}function Rw(e,t){return e.indexOf(t)}function Uw(e,t){return 0|e.charCodeAt(t)}function Bw(e,t,n){return e.slice(t,n)}function Fw(e){return e.length}function Qw(e){return e.length}function Vw(e,t){return t.push(e),e}var Yw=1,Zw=1,Ww=0,Gw=0,Hw=0,$w="";function Xw(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:Yw,column:Zw,length:i,return:""}}function qw(e,t){return Ow(Xw("",null,null,"",null,null,0),e,{length:-e.length},t)}function Jw(){return Hw=Gw>0?Uw($w,--Gw):0,Zw--,10===Hw&&(Zw=1,Yw--),Hw}function Kw(){return Hw=Gw<Ww?Uw($w,Gw++):0,Zw++,10===Hw&&(Zw=1,Yw++),Hw}function ey(){return Uw($w,Gw)}function ty(){return Gw}function ny(e,t){return Bw($w,e,t)}function ry(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 oy(e){return Yw=Zw=1,Ww=Fw($w=e),Gw=0,[]}function ay(e){return $w="",e}function iy(e){return zw(ny(Gw-1,cy(91===e?e+2:40===e?e+1:e)))}function sy(e){for(;(Hw=ey())&&Hw<33;)Kw();return ry(e)>2||ry(Hw)>3?"":" "}function ly(e,t){for(;--t&&Kw()&&!(Hw<48||Hw>102||Hw>57&&Hw<65||Hw>70&&Hw<97););return ny(e,ty()+(t<6&&32==ey()&&32==Kw()))}function cy(e){for(;Kw();)switch(Hw){case e:return Gw;case 34:case 39:34!==e&&39!==e&&cy(Hw);break;case 40:41===e&&cy(e);break;case 92:Kw()}return Gw}function uy(e,t){for(;Kw()&&e+Hw!==57&&(e+Hw!==84||47!==ey()););return"/*"+ny(t,Gw-1)+"*"+Lw(47===e?e:Kw())}function dy(e){for(;!ry(ey());)Kw();return ny(e,Gw)}var fy="-ms-",py="-moz-",my="-webkit-",hy="comm",gy="rule",wy="decl",yy="@keyframes";function by(e,t){for(var n="",r=Qw(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function vy(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case wy:return e.return=e.return||e.value;case hy:return"";case yy:return e.return=e.value+"{"+by(e.children,r)+"}";case gy:e.value=e.props.join(",")}return Fw(n=by(e.children,r))?e.return=e.value+"{"+n+"}":""}function xy(e){return ay(Ny("",null,null,null,[""],e=oy(e),0,[0],e))}function Ny(e,t,n,r,o,a,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,m=0,h=1,g=1,w=1,y=0,b="",v=o,x=a,N=r,E=b;g;)switch(m=y,y=Kw()){case 40:if(108!=m&&58==Uw(E,d-1)){-1!=Rw(E+=Pw(iy(y),"&","&\f"),"&\f")&&(w=-1);break}case 34:case 39:case 91:E+=iy(y);break;case 9:case 10:case 13:case 32:E+=sy(m);break;case 92:E+=ly(ty()-1,7);continue;case 47:switch(ey()){case 42:case 47:Vw(_y(uy(Kw(),ty()),t,n),l);break;default:E+="/"}break;case 123*h:s[c++]=Fw(E)*w;case 125*h:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==w&&(E=Pw(E,/\f/g,"")),p>0&&Fw(E)-d&&Vw(p>32?My(E+";",r,n,d-1):My(Pw(E," ","")+";",r,n,d-2),l);break;case 59:E+=";";default:if(Vw(N=Ey(E,t,n,c,u,o,s,b,v=[],x=[],d),a),123===y)if(0===u)Ny(E,t,N,N,v,a,d,s,x);else switch(99===f&&110===Uw(E,3)?100:f){case 100:case 108:case 109:case 115:Ny(e,N,N,r&&Vw(Ey(e,N,N,0,0,o,s,b,o,v=[],d),x),o,x,d,s,r?v:x);break;default:Ny(E,N,N,N,[""],x,0,s,x)}}c=u=p=0,h=w=1,b=E="",d=i;break;case 58:d=1+Fw(E),p=m;default:if(h<1)if(123==y)--h;else if(125==y&&0==h++&&125==Jw())continue;switch(E+=Lw(y),y*h){case 38:w=u>0?1:(E+="\f",-1);break;case 44:s[c++]=(Fw(E)-1)*w,w=1;break;case 64:45===ey()&&(E+=iy(Kw())),f=ey(),u=d=Fw(b=E+=dy(ty())),y++;break;case 45:45===m&&2==Fw(E)&&(h=0)}}return a}function Ey(e,t,n,r,o,a,i,s,l,c,u){for(var d=o-1,f=0===o?a:[""],p=Qw(f),m=0,h=0,g=0;m<r;++m)for(var w=0,y=Bw(e,d+1,d=Tw(h=i[m])),b=e;w<p;++w)(b=zw(h>0?f[w]+" "+y:Pw(y,/&\f/g,f[w])))&&(l[g++]=b);return Xw(e,t,n,0===o?gy:s,l,c,u)}function _y(e,t,n){return Xw(e,t,n,hy,Lw(Hw),Bw(e,2,-2),0)}function My(e,t,n,r){return Xw(e,t,n,wy,Bw(e,0,r),Bw(e,r+1,-1),r)}var Iy=function(e,t,n){for(var r=0,o=0;r=o,o=ey(),38===r&&12===o&&(t[n]=1),!ry(o);)Kw();return ny(e,Gw)},Sy=new WeakMap,ky=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)||Sy.get(n))&&!r){Sy.set(e,!0);for(var o=[],a=function(e,t){return ay(function(e,t){var n=-1,r=44;do{switch(ry(r)){case 0:38===r&&12===ey()&&(t[n]=1),e[n]+=Iy(Gw-1,t,n);break;case 2:e[n]+=iy(r);break;case 4:if(44===r){e[++n]=58===ey()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Lw(r)}}while(r=Kw());return e}(oy(e),t))}(t,o),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=o[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},Dy=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Cy(e,t){switch(function(e,t){return 45^Uw(e,0)?(((t<<2^Uw(e,0))<<2^Uw(e,1))<<2^Uw(e,2))<<2^Uw(e,3):0}(e,t)){case 5103:return my+"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 my+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return my+e+py+e+fy+e+e;case 6828:case 4268:return my+e+fy+e+e;case 6165:return my+e+fy+"flex-"+e+e;case 5187:return my+e+Pw(e,/(\w+).+(:[^]+)/,my+"box-$1$2"+fy+"flex-$1$2")+e;case 5443:return my+e+fy+"flex-item-"+Pw(e,/flex-|-self/,"")+e;case 4675:return my+e+fy+"flex-line-pack"+Pw(e,/align-content|flex-|-self/,"")+e;case 5548:return my+e+fy+Pw(e,"shrink","negative")+e;case 5292:return my+e+fy+Pw(e,"basis","preferred-size")+e;case 6060:return my+"box-"+Pw(e,"-grow","")+my+e+fy+Pw(e,"grow","positive")+e;case 4554:return my+Pw(e,/([^-])(transform)/g,"$1"+my+"$2")+e;case 6187:return Pw(Pw(Pw(e,/(zoom-|grab)/,my+"$1"),/(image-set)/,my+"$1"),e,"")+e;case 5495:case 3959:return Pw(e,/(image-set\([^]*)/,my+"$1$`$1");case 4968:return Pw(Pw(e,/(.+:)(flex-)?(.*)/,my+"box-pack:$3"+fy+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+my+e+e;case 4095:case 3583:case 4068:case 2532:return Pw(e,/(.+)-inline(.+)/,my+"$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(Fw(e)-1-t>6)switch(Uw(e,t+1)){case 109:if(45!==Uw(e,t+4))break;case 102:return Pw(e,/(.+:)(.+)-([^]+)/,"$1"+my+"$2-$3$1"+py+(108==Uw(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Rw(e,"stretch")?Cy(Pw(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Uw(e,t+1))break;case 6444:switch(Uw(e,Fw(e)-3-(~Rw(e,"!important")&&10))){case 107:return Pw(e,":",":"+my)+e;case 101:return Pw(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+my+(45===Uw(e,14)?"inline-":"")+"box$3$1"+my+"$2$3$1"+fy+"$2box$3")+e}break;case 5936:switch(Uw(e,t+11)){case 114:return my+e+fy+Pw(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return my+e+fy+Pw(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return my+e+fy+Pw(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return my+e+fy+e+e}return e}var jy=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case wy:e.return=Cy(e.value,e.length);break;case yy:return by([qw(e,{value:Pw(e.value,"@","@"+my)})],r);case gy: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 by([qw(e,{props:[Pw(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return by([qw(e,{props:[Pw(t,/:(plac\w+)/,":"+my+"input-$1")]}),qw(e,{props:[Pw(t,/:(plac\w+)/,":-moz-$1")]}),qw(e,{props:[Pw(t,/:(plac\w+)/,fy+"input-$1")]})],r)}return""})}}],Ay=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,a=e.stylisPlugins||jy,i={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u,d,f=[vy,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],p=(c=[ky,Dy].concat(a,f),u=Qw(c),function(e,t,n,r){for(var o="",a=0;a<u;a++)o+=c[a](e,t,n,r)||"";return o});o=function(e,t,n,r){l=n,by(xy(e?e+"{"+t.styles+"}":t.styles),p),r&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new Aw({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:o};return m.sheet.hydrate(s),m},Ty=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Ly={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 Oy(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var zy=/[A-Z]|^ms/g,Py=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ry=function(e){return 45===e.charCodeAt(1)},Uy=function(e){return null!=e&&"boolean"!=typeof e},By=Oy(function(e){return Ry(e)?e:e.replace(zy,"-$&").toLowerCase()}),Fy=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Py,function(e,t,n){return Vy={name:t,styles:n,next:Vy},t})}return 1===Ly[e]||Ry(e)||"number"!=typeof t||0===t?t:t+"px"};function Qy(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 Vy={name:o.name,styles:o.styles,next:Vy},o.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)Vy={name:i.name,styles:i.styles,next:Vy},i=i.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Qy(e,t,n[o])+";";else for(var a in n){var i=n[a];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?r+=a+"{"+t[s]+"}":Uy(s)&&(r+=By(a)+":"+Fy(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Qy(e,t,i);switch(a){case"animation":case"animationName":r+=By(a)+":"+l+";";break;default:r+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Uy(i[c])&&(r+=By(a)+":"+Fy(a,i[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=Vy,l=n(e);return Vy=s,Qy(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Vy,Yy=/label:\s*([^\s;{]+)\s*(;|$)/g;function Zy(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="";Vy=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,o+=Qy(n,t,a)):o+=a[0];for(var i=1;i<e.length;i++)o+=Qy(n,t,e[i]),r&&(o+=a[i]);Yy.lastIndex=0;for(var s,l="";null!==(s=Yy.exec(o));)l+="-"+s[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)+l;return{name:c,styles:o,next:Vy}}var Wy,Gy,Hy=!!s.useInsertionEffect&&s.useInsertionEffect,$y=Hy||function(e){return e()},Xy=(Hy||s.useLayoutEffect,s.createContext("undefined"!=typeof HTMLElement?Ay({key:"css"}):null)),qy=(Xy.Provider,function(e){return(0,s.forwardRef)(function(t,n){var r=(0,s.useContext)(Xy);return e(t,r,n)})}),Jy=s.createContext({}),Ky={}.hasOwnProperty,eb="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",tb=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Ty(t,n,r),$y(function(){return function(e,t,n){Ty(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},nb=qy(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var o=e[eb],a=[r],i="";"string"==typeof e.className?i=function(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}(t.registered,a,e.className):null!=e.className&&(i=e.className+" ");var l=Zy(a,void 0,s.useContext(Jy));i+=t.key+"-"+l.name;var c={};for(var u in e)Ky.call(e,u)&&"css"!==u&&u!==eb&&(c[u]=e[u]);return c.className=i,n&&(c.ref=n),s.createElement(s.Fragment,null,s.createElement(tb,{cache:t,serialized:l,isStringTag:"string"==typeof o}),s.createElement(o,c))}),rb=nb,ob=(n(4146),function(e,t){var n=arguments;if(null==t||!Ky.call(t,"css"))return s.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=rb,o[1]=function(e,t){var n={};for(var r in t)Ky.call(t,r)&&(n[r]=t[r]);return n[eb]=e,n}(e,t);for(var a=2;a<r;a++)o[a]=n[a];return s.createElement.apply(null,o)});function ab(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Zy(t)}function ib(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,a,i,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||Cw(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 sb(e,t){if(null==e)return{};var n,r,o=(0,b.A)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}Wy=ob||(ob={}),Gy||(Gy=Wy.JSX||(Wy.JSX={}));var lb=s.useLayoutEffect,cb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ub=function(){};function db(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function fb(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 a=[].concat(r);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&a.push("".concat(db(e,i)));return a.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var pb=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===vw(e)&&null!==e?[e]:[];var t},mb=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,_w({},sb(e,cb))},hb=function(e,t,n){var r=e.cx,o=e.getStyles,a=e.getClassNames,i=e.className;return{css:o(t,e),className:r(null!=n?n:{},a(t,e),i)}};function gb(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function wb(e){return gb(e)?window.pageYOffset:e.scrollTop}function yb(e,t){gb(e)?window.scrollTo(0,t):e.scrollTop=t}function bb(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ub,o=wb(e),a=t-o,i=0;!function t(){var s=function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}(i+=10,o,a,n);yb(e,s),i<n?window.requestAnimationFrame(t):r(e)}()}function vb(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?yb(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&yb(e,Math.max(t.offsetTop-o,0))}function xb(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var Nb=!1,Eb={get passive(){return Nb=!0}},_b="undefined"!=typeof window?window:{};_b.addEventListener&&_b.removeEventListener&&(_b.addEventListener("p",ub,Eb),_b.removeEventListener("p",ub,!1));var Mb=Nb;function Ib(e){return null!=e}function Sb(e,t,n){return e?t:n}var kb=["children","innerProps"],Db=["children","innerProps"];var Cb,jb=function(e){return"auto"===e?"bottom":e},Ab=(0,s.createContext)(null),Tb=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,a=e.menuPosition,i=e.menuShouldScrollIntoView,l=e.theme,c=((0,s.useContext)(Ab)||{}).setPortalPlacement,u=(0,s.useRef)(null),d=ib((0,s.useState)(r),2),f=d[0],p=d[1],m=ib((0,s.useState)(null),2),h=m[0],g=m[1],w=l.spacing.controlHeight;return lb(function(){var e=u.current;if(e){var t="fixed"===a,s=function(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,a=e.shouldScroll,i=e.isFixedPosition,s=e.controlHeight,l=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=l.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,m=f.height,h=f.top,g=n.offsetParent.getBoundingClientRect().top,w=i||gb(u=l)?window.innerHeight:u.clientHeight,y=wb(l),b=parseInt(getComputedStyle(n).marginBottom,10),v=parseInt(getComputedStyle(n).marginTop,10),x=g-v,N=w-h,E=x+y,_=d-y-h,M=p-w+y+b,I=y+h-v,S=160;switch(o){case"auto":case"bottom":if(N>=m)return{placement:"bottom",maxHeight:t};if(_>=m&&!i)return a&&bb(l,M,S),{placement:"bottom",maxHeight:t};if(!i&&_>=r||i&&N>=r)return a&&bb(l,M,S),{placement:"bottom",maxHeight:i?N-b:_-b};if("auto"===o||i){var k=t,D=i?x:E;return D>=r&&(k=Math.min(D-b-s,t)),{placement:"top",maxHeight:k}}if("bottom"===o)return a&&yb(l,M),{placement:"bottom",maxHeight:t};break;case"top":if(x>=m)return{placement:"top",maxHeight:t};if(E>=m&&!i)return a&&bb(l,I,S),{placement:"top",maxHeight:t};if(!i&&E>=r||i&&x>=r){var C=t;return(!i&&E>=r||i&&x>=r)&&(C=i?x-v:E-v),a&&bb(l,I,S),{placement:"top",maxHeight:C}}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:i&&!t,isFixedPosition:t,controlHeight:w});p(s.maxHeight),g(s.placement),null==c||c(s.placement)}},[r,o,a,i,n,c,w]),t({ref:u,placerProps:_w(_w({},e),{},{placement:h||jb(o),maxHeight:f})})},Lb=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return _w({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},Ob=Lb,zb=Lb,Pb=["size"],Rb=["innerProps","isRtl","size"],Ub={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Bb=function(e){var t=e.size,n=sb(e,Pb);return ob("svg",(0,y.A)({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Ub},n))},Fb=function(e){return ob(Bb,(0,y.A)({size:20},e),ob("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"}))},Qb=function(e){return ob(Bb,(0,y.A)({size:20},e),ob("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"}))},Vb=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,a=r.colors;return _w({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?a.neutral60:a.neutral20,padding:2*o,":hover":{color:n?a.neutral80:a.neutral40}})},Yb=Vb,Zb=Vb,Wb=function(){var e=ab.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_"}}}(Cb||(Cb=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"]))),Gb=function(e){var t=e.delay,n=e.offset;return ob("span",{css:ab({animation:"".concat(Wb," 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"},"","")})},Hb=["data"],$b=["innerRef","isDisabled","isHidden","inputClassName"],Xb={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},qb={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":_w({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Xb)},Jb=function(e){return _w({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Xb)},Kb=function(e){var t=e.children,n=e.innerProps;return ob("div",n,t)},ev={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return ob("div",(0,y.A)({},hb(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ob(Fb,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,a=e.innerProps,i=e.menuIsOpen;return ob("div",(0,y.A)({ref:o},hb(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":i}),a,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return ob("div",(0,y.A)({},hb(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ob(Qb,null))},DownChevron:Qb,CrossIcon:Fb,Group:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,a=e.Heading,i=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return ob("div",(0,y.A)({},hb(e,"group",{group:!0}),s),ob(a,(0,y.A)({},i,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),l),ob("div",null,t))},GroupHeading:function(e){var t=mb(e);t.data;var n=sb(t,Hb);return ob("div",(0,y.A)({},hb(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return ob("div",(0,y.A)({},hb(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ob("span",(0,y.A)({},t,hb(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=mb(e),o=r.innerRef,a=r.isDisabled,i=r.isHidden,s=r.inputClassName,l=sb(r,$b);return ob("div",(0,y.A)({},hb(e,"input",{"input-container":!0}),{"data-value":n||""}),ob("input",(0,y.A)({className:t({input:!0},s),ref:o,style:Jb(i),disabled:a},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=void 0===r?4:r,a=sb(e,Rb);return ob("div",(0,y.A)({},hb(_w(_w({},a),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ob(Gb,{delay:0,offset:n}),ob(Gb,{delay:160,offset:!0}),ob(Gb,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return ob("div",(0,y.A)({},hb(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 ob("div",(0,y.A)({},hb(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,a=e.menuPlacement,i=e.menuPosition,l=(0,s.useRef)(null),c=(0,s.useRef)(null),u=ib((0,s.useState)(jb(a)),2),d=u[0],f=u[1],p=(0,s.useMemo)(function(){return{setPortalPlacement:f}},[]),m=ib((0,s.useState)(null),2),h=m[0],g=m[1],w=(0,s.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"===i?0:window.pageYOffset,n=e[d]+t;n===(null==h?void 0:h.offset)&&e.left===(null==h?void 0:h.rect.left)&&e.width===(null==h?void 0:h.rect.width)||g({offset:n,rect:e})}},[r,i,d,null==h?void 0:h.offset,null==h?void 0:h.rect.left,null==h?void 0:h.rect.width]);lb(function(){w()},[w]);var b=(0,s.useCallback)(function(){"function"==typeof c.current&&(c.current(),c.current=null),r&&l.current&&(c.current=jn(r,l.current,w,{elementResize:"ResizeObserver"in window}))},[r,w]);lb(function(){b()},[b]);var v=(0,s.useCallback)(function(e){l.current=e,b()},[b]);if(!t&&"fixed"!==i||!h)return null;var x=ob("div",(0,y.A)({ref:v},hb(_w(_w({},e),{},{offset:h.offset,position:i,rect:h.rect}),"menuPortal",{"menu-portal":!0}),o),n);return ob(Ab.Provider,{value:p},t?(0,un.createPortal)(x,t):x)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,o=sb(e,Db);return ob("div",(0,y.A)({},hb(_w(_w({},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=sb(e,kb);return ob("div",(0,y.A)({},hb(_w(_w({},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,a=e.isDisabled,i=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return ob(l,{data:r,innerProps:_w(_w({},hb(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:s},ob(c,{data:r,innerProps:_w({},hb(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),ob(u,{data:r,innerProps:_w(_w({},hb(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},i),selectProps:s}))},MultiValueContainer:Kb,MultiValueLabel:Kb,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return ob("div",(0,y.A)({role:"button"},n),t||ob(Fb,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,a=e.innerRef,i=e.innerProps;return ob("div",(0,y.A)({},hb(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":n},i),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return ob("div",(0,y.A)({},hb(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return ob("div",(0,y.A)({},hb(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return ob("div",(0,y.A)({},hb(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 ob("div",(0,y.A)({},hb(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},tv=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function nv(e,t){return e===t||!(!tv(e)||!tv(t))}function rv(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!nv(e[n],t[n]))return!1;return!0}for(var ov={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"},av=function(e){return ob("span",(0,y.A)({css:ov},e))},iv={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,a=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 a?"".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,a=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,a?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,a=void 0===o?"":o,i=e.selectValue,s=e.isDisabled,l=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&&i)return"value ".concat(a," focused, ").concat(u(i,n),".");if("menu"===t&&c){var d=s?" disabled":"",f="".concat(l?" selected":"").concat(d);return"".concat(a).concat(f,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},sv=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,a=e.isFocused,i=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,p=l.inputValue,m=l.isMulti,h=l.isOptionDisabled,g=l.isSearchable,w=l.menuIsOpen,y=l.options,b=l.screenReaderStatus,v=l.tabSelectsValue,x=l.isLoading,N=l["aria-label"],E=l["aria-live"],_=(0,s.useMemo)(function(){return _w(_w({},iv),d||{})},[d]),M=(0,s.useMemo)(function(){var e,n="";if(t&&_.onChange){var r=t.option,o=t.options,a=t.removedValue,s=t.removedValues,l=t.value,c=a||r||(e=l,Array.isArray(e)?null:e),u=c?f(c):"",d=o||s||void 0,p=d?d.map(f):[],m=_w({isDisabled:c&&h(c,i),label:u,labels:p},t);n=_.onChange(m)}return n},[t,_,h,i,f]),I=(0,s.useMemo)(function(){var e="",t=n||r,a=!!(n&&i&&i.includes(n));if(t&&_.onFocus){var s={focused:t,label:f(t),isDisabled:h(t,i),isSelected:a,options:o,context:t===n?"menu":"value",selectValue:i,isAppleDevice:u};e=_.onFocus(s)}return e},[n,r,f,h,_,o,i,u]),S=(0,s.useMemo)(function(){var e="";if(w&&y.length&&!x&&_.onFilter){var t=b({count:o.length});e=_.onFilter({inputValue:p,resultsMessage:t})}return e},[o,p,w,_,y,b,x]),k="initial-input-focus"===(null==t?void 0:t.action),D=(0,s.useMemo)(function(){var e="";if(_.guidance){var t=r?"value":w?"menu":"input";e=_.guidance({"aria-label":N,context:t,isDisabled:n&&h(n,i),isMulti:m,isSearchable:g,tabSelectsValue:v,isInitialFocus:k})}return e},[N,n,r,m,h,g,w,_,i,v,k]),C=ob(s.Fragment,null,ob("span",{id:"aria-selection"},M),ob("span",{id:"aria-focused"},I),ob("span",{id:"aria-results"},S),ob("span",{id:"aria-guidance"},D));return ob(s.Fragment,null,ob(av,{id:c},k&&C),ob(av,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!k&&C))},lv=[{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źẑżžẓẕƶȥɀⱬꝣ"}],cv=new RegExp("["+lv.map(function(e){return e.letters}).join("")+"]","g"),uv={},dv=0;dv<lv.length;dv++)for(var fv=lv[dv],pv=0;pv<fv.letters.length;pv++)uv[fv.letters[pv]]=fv.base;var mv=function(e){return e.replace(cv,function(e){return uv[e]})},hv=function(e,t){void 0===t&&(t=rv);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 a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return r.clear=function(){n=null},r}(mv),gv=function(e){return e.replace(/^\s+|\s+$/g,"")},wv=function(e){return"".concat(e.label," ").concat(e.value)},yv=["innerRef"];function bv(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=ib(e,1)[0];return!n.includes(t)});return o.reduce(function(e,t){var n=ib(t,2),r=n[0],o=n[1];return e[r]=o,e},{})}(sb(e,yv),"onExited","in","enter","exit","appear");return ob("input",(0,y.A)({ref:t},n,{css:ab({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 vv=["boxSizing","height","overflow","paddingRight","position"],xv={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Nv(e){e.cancelable&&e.preventDefault()}function Ev(e){e.stopPropagation()}function _v(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Mv(){return"ontouchstart"in window||navigator.maxTouchPoints}var Iv=!("undefined"==typeof window||!window.document||!window.document.createElement),Sv=0,kv={capture:!1,passive:!1},Dv=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Cv={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function jv(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,a=e.onTopLeave,i=(0,s.useRef)(!1),l=(0,s.useRef)(!1),c=(0,s.useRef)(0),u=(0,s.useRef)(null),d=(0,s.useCallback)(function(e,t){if(null!==u.current){var s=u.current,c=s.scrollTop,d=s.scrollHeight,f=s.clientHeight,p=u.current,m=t>0,h=d-f-c,g=!1;h>t&&i.current&&(r&&r(e),i.current=!1),m&&l.current&&(a&&a(e),l.current=!1),m&&t>h?(n&&!i.current&&n(e),p.scrollTop=d,g=!0,i.current=!0):!m&&-t>c&&(o&&!l.current&&o(e),p.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,r,o,a]),f=(0,s.useCallback)(function(e){d(e,e.deltaY)},[d]),p=(0,s.useCallback)(function(e){c.current=e.changedTouches[0].clientY},[]),m=(0,s.useCallback)(function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)},[d]),h=(0,s.useCallback)(function(e){if(e){var t=!!Mb&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",m,t)}},[m,p,f]),g=(0,s.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",m,!1))},[m,p,f]);return(0,s.useEffect)(function(){if(t){var e=u.current;return h(e),function(){g(e)}}},[t,h,g]),function(e){u.current=e}}({isEnabled:void 0===r||r,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),a=function(e){var t=e.isEnabled,n=e.accountForScrollbars,r=void 0===n||n,o=(0,s.useRef)({}),a=(0,s.useRef)(null),i=(0,s.useCallback)(function(e){if(Iv){var t=document.body,n=t&&t.style;if(r&&vv.forEach(function(e){var t=n&&n[e];o.current[e]=t}),r&&Sv<1){var a=parseInt(o.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,s=window.innerWidth-i+a||0;Object.keys(xv).forEach(function(e){var t=xv[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(s,"px"))}t&&Mv()&&(t.addEventListener("touchmove",Nv,kv),e&&(e.addEventListener("touchstart",_v,kv),e.addEventListener("touchmove",Ev,kv))),Sv+=1}},[r]),l=(0,s.useCallback)(function(e){if(Iv){var t=document.body,n=t&&t.style;Sv=Math.max(Sv-1,0),r&&Sv<1&&vv.forEach(function(e){var t=o.current[e];n&&(n[e]=t)}),t&&Mv()&&(t.removeEventListener("touchmove",Nv,kv),e&&(e.removeEventListener("touchstart",_v,kv),e.removeEventListener("touchmove",Ev,kv)))}},[r]);return(0,s.useEffect)(function(){if(t){var e=a.current;return i(e),function(){l(e)}}},[t,i,l]),function(e){a.current=e}}({isEnabled:n});return ob(s.Fragment,null,n&&ob("div",{onClick:Dv,css:Cv}),t(function(e){o(e),a(e)}))}var Av={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Tv=function(e){var t=e.name,n=e.onFocus;return ob("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Av,value:"",onChange:function(){}})};function Lv(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 Ov(){return Lv(/^Mac/i)}var zv={clearIndicator:Zb,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,a=o.colors,i=o.borderRadius;return _w({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?a.neutral5:a.neutral0,borderColor:n?a.neutral10:r?a.primary:a.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},dropdownIndicator:Yb,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 _w({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,a=r.colors;return _w({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?a.neutral10:a.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,a=o.spacing,i=o.colors;return _w(_w({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},qb),t?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:i.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,o=e.theme,a=o.colors,i=o.spacing.baseUnit;return _w({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?a.neutral60:a.neutral20,padding:2*i})},loadingMessage:zb,menu:function(e,t){var n,r=e.placement,o=e.theme,a=o.borderRadius,i=o.spacing,s=o.colors;return _w((Nw(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),Nw(n,"position","absolute"),Nw(n,"width","100%"),Nw(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return _w({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,a=n.colors;return _w({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,a=e.cropWithEllipsis;return _w({overflow:"hidden",textOverflow:a||void 0===a?"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,a=n.colors,i=e.isFocused;return _w({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:i?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},noOptionsMessage:Ob,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,a=e.theme,i=a.spacing,s=a.colors;return _w({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?s.primary:r?s.primary25:"transparent",color:n?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return _w({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,a=r.colors;return _w({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,a=e.selectProps.controlShouldRenderValue;return _w({alignItems:"center",display:r&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},Pv={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}},Rv={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:xb(),captureMenuScroll:!xb(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=_w({ignoreCase:!0,ignoreAccents:!0,stringify:wv,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,a=n.stringify,i=n.trim,s=n.matchFrom,l=i?gv(t):t,c=i?gv(a(e)):a(e);return r&&(l=l.toLowerCase(),c=c.toLowerCase()),o&&(l=hv(l),c=mv(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},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 Uv(e,t,n,r){return{type:"option",data:t,isDisabled:Gv(e,t,n),isSelected:Hv(e,t,n),label:Zv(e,t),value:Wv(e,t),index:r}}function Bv(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(n,r){return Uv(e,n,t,r)}).filter(function(t){return Vv(e,t)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var a=Uv(e,n,t,r);return Vv(e,a)?a:void 0}).filter(Ib)}function Fv(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,jw(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function Qv(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,jw(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 Vv(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,a=t.isSelected,i=t.label,s=t.value;return(!Xv(e)||!a)&&$v(e,{label:i,value:s,data:o},r)}var Yv=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},Zv=function(e,t){return e.getOptionLabel(t)},Wv=function(e,t){return e.getOptionValue(t)};function Gv(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Hv(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=Wv(e,t);return n.some(function(t){return Wv(e,t)===r})}function $v(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Xv=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},qv=1,Jv=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&&(0,Iw.A)(e,t)}(n,e);var t=function(e){var t=kw();return function(){var n,r=Sw(e);if(t){var o=Sw(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==vw(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,n)}}(n);function n(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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,a=n.name;t.name=a,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,a=o.closeMenuOnSelect,i=o.isMulti,s=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:s}),a&&(r.setState({inputIsHiddenAfterUpdate:!i}),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,a=t.name,i=r.state.selectValue,s=o&&r.isOptionSelected(e,i),l=r.isOptionDisabled(e,i);if(s){var c=r.getOptionValue(e);r.setValue(i.filter(function(e){return r.getOptionValue(e)!==c}),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:a});o?r.setValue([].concat(jw(i),[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),a=n.filter(function(e){return r.getOptionValue(e)!==o}),i=Sb(t,a,a[0]||null);r.onChange(i,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(Sb(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),a=Sb(e,o,o[0]||null);n&&r.onChange(a,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return Yv(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return Qv(Bv(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 fb.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return Zv(r.props,e)},r.getOptionValue=function(e){return Wv(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,o=zv[e](t,n);o.boxSizing="border-box";var a=r.props.styles[e];return a?a(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,_w(_w({},ev),e.components);var e},r.buildCategorizedOptions=function(){return Bv(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Fv(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:_w({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&&gb(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),a=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=o>5||a>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 Xv(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,a=t.escapeClearsValue,i=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=r.state,m=p.focusedOption,h=p.focusedValue,g=p.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;r.focusValue("previous");break;case"ArrowRight":if(!n||i)return;r.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)r.removeValue(h);else{if(!o)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!c||!d||!m||f&&r.isOptionSelected(m,g))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":c?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:i}),r.onMenuClose()):s&&a&&r.clearValue();break;case" ":if(i)return;if(!c){r.openMenu("first");break}if(!m)return;r.selectOption(m);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||++qv),r.state.selectValue=pb(e.value),e.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),i=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[i],r.state.focusedOptionId=Yv(o,a[i])}return r}return function(e,t,n){t&&Mw(e.prototype,t),n&&Mw(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(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&&vb(this.menuListRef,this.focusedOptionRef),(Ov()||Lv(/^iPhone/i)||Lv(/^iPad/i)||Ov()&&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&&(vb(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,a=this.buildFocusableOptions(),i="first"===e?0:a.length-1;if(!this.props.isMulti){var s=a.indexOf(r[0]);s>-1&&(i=s)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:a[i],focusedOptionId:this.getFocusedOptionId(a[i])},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 a=n.length-1,i=-1;if(n.length){switch(e){case"previous":i=0===o?0:-1===o?a:o-1;break;case"next":o>-1&&o<a&&(i=o+1)}this.setState({inputIsHidden:-1!==i,focusedValue:n[i]})}}}},{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,a=r.indexOf(n);n||(a=-1),"up"===e?o=a>0?a-1:r.length-1:"down"===e?o=(a+1)%r.length:"pageup"===e?(o=a-t)<0&&(o=0):"pagedown"===e?(o=a+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(Pv):_w(_w({},Pv),this.props.theme):Pv}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,o=this.getValue,a=this.selectOption,i=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:o,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:a,selectProps:s,setValue:i,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 Gv(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Hv(this.props,e,t)}},{key:"filterOption",value:function(e,t){return $v(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,a=e.tabIndex,i=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,f=d.inputIsHidden,p=d.ariaSelection,m=this.commonProps,h=r||this.getElementId("input"),g=_w(_w(_w({"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":c,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?s.createElement(u,(0,y.A)({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:f,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:i,type:"text",value:o},g)):s.createElement(bv,(0,y.A)({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ub,onFocus:this.onInputFocus,disabled:t,tabIndex:a,inputMode:"none",form:i,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,a=t.MultiValueRemove,i=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,f=u.isDisabled,p=u.isMulti,m=u.inputValue,h=u.placeholder,g=this.state,w=g.selectValue,b=g.focusedValue,v=g.isFocused;if(!this.hasValue()||!d)return m?null:s.createElement(l,(0,y.A)({},c,{key:"placeholder",isDisabled:f,isFocused:v,innerProps:{id:this.getElementId("placeholder")}}),h);if(p)return w.map(function(t,i){var l=t===b,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return s.createElement(n,(0,y.A)({},c,{components:{Container:r,Label:o,Remove:a},isFocused:l,isDisabled:f,key:u,index:i,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(m)return null;var x=w[0];return s.createElement(i,(0,y.A)({},c,{data:x,isDisabled:f}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var i={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return s.createElement(e,(0,y.A)({},t,{innerProps:i,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,a=this.state.isFocused;return e&&o?s.createElement(e,(0,y.A)({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:a})):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,a=this.state.isFocused;return s.createElement(n,(0,y.A)({},r,{isDisabled:o,isFocused:a}))}},{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 s.createElement(e,(0,y.A)({},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,a=t.MenuList,i=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,f=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,h=p.inputValue,g=p.isLoading,w=p.loadingMessage,b=p.minMenuHeight,v=p.maxMenuHeight,x=p.menuIsOpen,N=p.menuPlacement,E=p.menuPosition,_=p.menuPortalTarget,M=p.menuShouldBlockScroll,I=p.menuShouldScrollIntoView,S=p.noOptionsMessage,k=p.onMenuScrollToTop,D=p.onMenuScrollToBottom;if(!x)return null;var C,j=function(t,n){var r=t.type,o=t.data,a=t.isDisabled,i=t.isSelected,l=t.label,c=t.value,p=f===o,m=a?void 0:function(){return e.onOptionHover(o)},h=a?void 0:function(){return e.selectOption(o)},g="".concat(e.getElementId("option"),"-").concat(n),w={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:"option","aria-selected":e.state.isAppleDevice?void 0:i};return s.createElement(u,(0,y.A)({},d,{innerProps:w,data:o,isDisabled:a,isSelected:i,key:g,label:l,type:r,value:c,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())C=this.getCategorizedOptions().map(function(t){if("group"===t.type){var o=t.data,a=t.options,i=t.index,l="".concat(e.getElementId("group"),"-").concat(i),c="".concat(l,"-heading");return s.createElement(n,(0,y.A)({},d,{key:l,data:o,options:a,Heading:r,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return j(e,"".concat(i,"-").concat(e.index))}))}if("option"===t.type)return j(t,"".concat(t.index))});else if(g){var A=w({inputValue:h});if(null===A)return null;C=s.createElement(l,d,A)}else{var T=S({inputValue:h});if(null===T)return null;C=s.createElement(c,d,T)}var L={minMenuHeight:b,maxMenuHeight:v,menuPlacement:N,menuPosition:E,menuShouldScrollIntoView:I},O=s.createElement(Tb,(0,y.A)({},d,L),function(t){var n=t.ref,r=t.placerProps,i=r.placement,l=r.maxHeight;return s.createElement(o,(0,y.A)({},d,L,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:i}),s.createElement(jv,{captureEnabled:m,onTopArrive:k,onBottomArrive:D,lockEnabled:M},function(t){return s.createElement(a,(0,y.A)({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:f}),C)}))});return _||"fixed"===E?s.createElement(i,(0,y.A)({},d,{appendTo:_,controlElement:this.controlRef,menuPlacement:N,menuPosition:E}),O):O}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,a=t.name,i=t.required,l=this.state.selectValue;if(i&&!this.hasValue()&&!r)return s.createElement(Tv,{name:a,onFocus:this.onValueInputFocus});if(a&&!r){if(o){if(n){var c=l.map(function(t){return e.getOptionValue(t)}).join(n);return s.createElement("input",{name:a,type:"hidden",value:c})}var u=l.length>0?l.map(function(t,n){return s.createElement("input",{key:"i-".concat(n),name:a,type:"hidden",value:e.getOptionValue(t)})}):s.createElement("input",{name:a,type:"hidden",value:""});return s.createElement("div",null,u)}var d=l[0]?this.getOptionValue(l[0]):"";return s.createElement("input",{name:a,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,a=t.isFocused,i=t.selectValue,l=this.getFocusableOptions();return s.createElement(sv,(0,y.A)({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:o,isFocused:a,selectValue:i,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,a=this.props,i=a.className,l=a.id,c=a.isDisabled,u=a.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return s.createElement(r,(0,y.A)({},f,{className:i,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),s.createElement(t,(0,y.A)({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),s.createElement(o,(0,y.A)({},f,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),s.createElement(n,(0,y.A)({},f,{isDisabled:c}),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,a=t.ariaSelection,i=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,f=e.inputValue,p=e.isMulti,m=pb(u),h={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||f!==n.inputValue)){var g=d?function(e,t){return Fv(Bv(e,t))}(e,m):[],w=d?Qv(Bv(e,m),"".concat(l,"-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,m):null,b=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);h={selectValue:m,focusedOption:b,focusedOptionId:Yv(w,b),focusableOptionsWithIds:w,focusedValue:y,clearFocusValueOnUpdate:!1}}var v=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},x=a,N=i&&s;return i&&!N&&(x={value:Sb(p,m,m[0]||null),options:m,action:"initial-input-focus"},N=!s),"initial-input-focus"===(null==a?void 0:a.action)&&(x=null),_w(_w(_w({},h),v),{},{prevProps:e,ariaSelection:x,prevWasFocused:N})}}]),n}(s.Component);Jv.defaultProps=Rv;var Kv=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"],ex=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"],tx=(0,s.forwardRef)(function(e,t){var n=function(e){var t=e.defaultOptions,n=void 0!==t&&t,r=e.cacheOptions,o=void 0!==r&&r,a=e.loadOptions;e.options;var i=e.isLoading,l=void 0!==i&&i,c=e.onInputChange,u=e.filterOption,d=void 0===u?null:u,f=sb(e,ex),p=f.inputValue,m=(0,s.useRef)(void 0),h=(0,s.useRef)(!1),g=ib((0,s.useState)(Array.isArray(n)?n:void 0),2),w=g[0],y=g[1],b=ib((0,s.useState)(void 0!==p?p:""),2),v=b[0],x=b[1],N=ib((0,s.useState)(!0===n),2),E=N[0],_=N[1],M=ib((0,s.useState)(void 0),2),I=M[0],S=M[1],k=ib((0,s.useState)([]),2),D=k[0],C=k[1],j=ib((0,s.useState)(!1),2),A=j[0],T=j[1],L=ib((0,s.useState)({}),2),O=L[0],z=L[1],P=ib((0,s.useState)(void 0),2),R=P[0],U=P[1],B=ib((0,s.useState)(void 0),2),F=B[0],Q=B[1];o!==F&&(z({}),Q(o)),n!==R&&(y(Array.isArray(n)?n:void 0),U(n)),(0,s.useEffect)(function(){return h.current=!0,function(){h.current=!1}},[]);var V=(0,s.useCallback)(function(e,t){if(!a)return t();var n=a(e,t);n&&"function"==typeof n.then&&n.then(t,function(){return t()})},[a]);(0,s.useEffect)(function(){!0===n&&V(v,function(e){h.current&&(y(e||[]),_(!!m.current))})},[]);var Y=(0,s.useCallback)(function(e,t){var n=function(e,t,n){if(n){var r=n(e,t);if("string"==typeof r)return r}return e}(e,t,c);if(!n)return m.current=void 0,x(""),S(""),C([]),_(!1),void T(!1);if(o&&O[n])x(n),S(n),C(O[n]),_(!1),T(!1);else{var r=m.current={};x(n),_(!0),T(!I),V(n,function(e){h&&r===m.current&&(m.current=void 0,_(!1),S(n),C(e||[]),T(!1),z(e?_w(_w({},O),{},Nw({},n,e)):O))})}},[o,V,I,O,c]),Z=A?[]:v&&I?D:w||[];return _w(_w({},f),{},{options:Z,isLoading:E||l,onInputChange:Y,filterOption:d})}(e),r=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,r=e.defaultMenuIsOpen,o=void 0!==r&&r,a=e.defaultValue,i=void 0===a?null:a,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,f=e.onMenuClose,p=e.onMenuOpen,m=e.value,h=sb(e,Kv),g=ib((0,s.useState)(void 0!==l?l:n),2),w=g[0],y=g[1],b=ib((0,s.useState)(void 0!==c?c:o),2),v=b[0],x=b[1],N=ib((0,s.useState)(void 0!==m?m:i),2),E=N[0],_=N[1],M=(0,s.useCallback)(function(e,t){"function"==typeof u&&u(e,t),_(e)},[u]),I=(0,s.useCallback)(function(e,t){var n;"function"==typeof d&&(n=d(e,t)),y(void 0!==n?n:e)},[d]),S=(0,s.useCallback)(function(){"function"==typeof p&&p(),x(!0)},[p]),k=(0,s.useCallback)(function(){"function"==typeof f&&f(),x(!1)},[f]),D=void 0!==l?l:w,C=void 0!==c?c:v,j=void 0!==m?m:E;return _w(_w({},h),{},{inputValue:D,menuIsOpen:C,onChange:M,onInputChange:I,onMenuClose:k,onMenuOpen:S,value:j})}(n);return s.createElement(Jv,(0,y.A)({ref:t},r))}),nx=tx;const rx=e=>e.isSelected?"#F3F4F6":e.isFocused?"#F9FAFB":"transparent",ox=function(e){const{label:t,name:n,desc:r,value:o,tooltip:a,placeholder:l,onChangeCB:c,options:u,isMulti:d=!1,isSearchable:f=!0,attr:p}=e,[m,h]=(0,s.useState)(o);(0,s.useEffect)(()=>{h(o)},[o]);const g={control:e=>({...e,borderColor:"#E5E7EB",boxShadow:"","&:hover":{borderColor:"none"}}),option:(e,t)=>({...e,backgroundColor:rx(t),color:"#111827",cursor:"pointer","&:active":{backgroundColor:"#F3F4F6"}})};return(0,i.createElement)("div",{className:"wcf-select2-field"},(0,i.createElement)("div",{className:"wcf-selection-field"},t&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary mb-2"},(0,i.createElement)("label",null,t,a&&(0,i.createElement)(dM,{text:a}))),(0,i.createElement)(nx,(0,y.A)({className:"wcf-select2-input",classNamePrefix:"wcf",name:n,isClearable:!0,value:m,getOptionLabel:e=>e.label,getOptionValue:e=>e.value,loadOptions:e=>new Promise(t=>{setTimeout(()=>{t((e=>u.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())))(e))},1e3)}),onChange:t=>{h(t);const n=new CustomEvent("wcf:select2:change",{bubbles:!0,detail:{e:{},name:e.name,value:t}});document.dispatchEvent(n),c&&c(t)},placeholder:l,defaultOptions:u,cacheOptions:!0,isMulti:d,delimiter:d?",":void 0,styles:g,isSearchable:f},p))),r&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},Zm(r)))};function ax({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const ix=s.forwardRef(ax);function sx({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 14.25 6-6m4.5-3.493V21.75l-3.75-1.5-3.75 1.5-3.75-1.5-3.75 1.5V4.757c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0c1.1.128 1.907 1.077 1.907 2.185ZM9.75 9h.008v.008H9.75V9Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm4.125 4.5h.008v.008h-.008V13.5Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const lx=s.forwardRef(sx);function cx({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v12m-3-2.818.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const ux=s.forwardRef(cx),dx=function(e){const[{options:t},n]=Yp(),{index:r,field_name:o,product_data:a,productOptdata:l}=e,c=""===a.discount_type?"disable":"enable",[u,d]=(0,s.useState)(c),[f,p]=(0,s.useState)(a.discount_type),[m,h]=(0,s.useState)(a.discount_value||""),[g,w]=(0,s.useState)(!1),[y,b]=(0,s.useState)(l.product_name||""),[v,x]=(0,s.useState)(l.product_subtext||""),[N,E]=(0,s.useState)(l.highlight_text||""),[_,M]=(0,s.useState)("yes"===l.enable_highlight),I=t["wcf-checkout-products"],S=t["wcf-product-options"],k=t["wcf-enable-product-options"],D=r===I.length-1;(0,s.useEffect)(()=>{p(a.discount_type),h(a.discount_value||"")},[a.discount_type,a.discount_value]),(0,s.useEffect)(()=>{b(l.product_name||""),x(l.product_subtext||""),E(l.highlight_text||""),M("yes"===l.enable_highlight)},[l.product_name,l.product_subtext,l.highlight_text,l.enable_highlight]);const j=[{value:"",label:(0,C.__)("Original","cartflows"),icon:(0,i.createElement)(ix,{className:"w-4 h-4"})},{value:"discount_percent",label:(0,C.__)("Percentage","cartflows"),icon:(0,i.createElement)(lx,{className:"w-4 h-4"})},{value:"discount_price",label:(0,C.__)("Price","cartflows"),icon:(0,i.createElement)(ux,{className:"w-4 h-4"})}],A=j.find(e=>e.value===f)||j[0];return function(){const e=a.discount_type,t=parseFloat(a.discount_value),n=parseFloat(a.regular_price);let r=0;"discount_percent"===e?t>0&&(r=n-n*t/100):"discount_price"===e&&t>0&&(r=n-t),a.sell_price=r.toFixed(2)}(),(0,i.createElement)("div",{key:a.unique_id},(0,i.createElement)("div",{className:`wcf-product-selection--selected-product flex items-center p-3 gap-3 ${function(){let e="";return"yes"===l.add_to_cart?e+=g?"relative z-10 border-[0.5px] border-b-0 border-solid border-brand-300 bg-brand-25 ":"relative z-10 border-[0.5px] border-solid border-brand-300 bg-brand-25 ":e+=g?"border-[0.5px] border-b-0 border-solid border-border-subtle bg-background-secondary ":"border-[0.5px] border-solid border-border-subtle bg-background-secondary ",e+=D&&!g?" rounded-b-md":"",e}()}`},(0,i.createElement)("div",{className:"wcf-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-1/2"},(0,i.createElement)("div",{className:"flex gap-3 items-center"},(0,i.createElement)("div",{className:"wcf-product-selection--sortable-toggle flex cursor-move text-text-tertiary"},(0,i.createElement)(sh,{className:"w-6 h-6 stroke-1","aria-hidden":"true"}),(0,i.createElement)(sh,{className:"w-6 h-6 stroke-1 -ml-4","aria-hidden":"true"})),(0,i.createElement)("div",{className:"wcf-product-selection--product-image w-20 h-20"},(0,i.createElement)("img",{src:a&&a.img_url?a.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:Zm(a.name)})),(0,i.createElement)("div",{className:"wcf-product-selection--product-title_text cursor-default"},(0,i.createElement)("div",{className:"wcf-product-repeater-field__title whitespace-normal text-left","data-product_id":a.product},Zm(a.name)),(0,i.createElement)("div",{className:"wcf-product-repeater-field__reg-price mt-1"},(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"wcf-product--reg-price "+("enable"===c&&0<a.discount_value?"line-through text-text-tertiary":""),title:(0,C.__)("Regular Price of the product","cartflows")},cartflows_admin.woo_currency+a.regular_price),"enable"===c&&0<a.discount_value&&(0,i.createElement)("span",{className:"wcf-product--sale-price",title:(0,C.__)("Price after discount.","cartflows")},cartflows_admin.woo_currency+a.sell_price)))))),(0,i.createElement)("div",{className:"wcf-product-selection--set-default whitespace-nowrap text-sm text-text-secondary w-[10%] flex justify-center items-center"},function(e){let o="";return wcfCartflowsPro()&&"yes"===k?"force-all"===S?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Pg,{size:"sm",value:!0,disabled:!0,name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`}),(0,i.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:"yes"})):"single-selection"===S?(("yes"===e.add_to_cart||e.chosen)&&(o=e.unique_id),(0,i.createElement)(Vg.Group,{name:"wcf_default_add_to_cart[]",value:o,onChange:()=>{t["wcf-checkout-products"][r].add_to_cart="yes",t["wcf-product-options-data"]={[e.unique_id]:{add_to_cart:"yes"}}},style:"simple",size:"sm",columns:1},(0,i.createElement)(Vg.Button,{value:e.unique_id,hideSelection:!1,minWidth:!1,buttonWrapperClasses:"p-0 flex items-center justify-center"}))):"multiple-selection"===S?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Pg,{size:"sm",value:"yes"===e.add_to_cart,onChange:r=>{n({type:"SET_OPTION",name:"wcf-product-options-data",value:{...t["wcf-product-options-data"],[e.unique_id]:{...t["wcf-product-options-data"]?.[e.unique_id],add_to_cart:r?"yes":"no"}}})}}),(0,i.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:e.add_to_cart})):void 0:(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Pg,{size:"sm",value:!0,disabled:!0,name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`}),(0,i.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:"yes"}))}(l)),(0,i.createElement)("div",{className:"wcf-product-selection--product-qty whitespace-nowrap text-sm text-text-secondary w-[10%]"},(0,i.createElement)("div",{className:"w-16 shrink-0"},(0,i.createElement)(tg,{type:"number",size:"md",name:`wcf-checkout-products[${r}][quantity]`,value:a.quantity,min:1,onChange:e=>{const t=[...I];t[r]={...t[r],quantity:parseInt(e,10)||1},n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:o,products:t})}}))),(0,i.createElement)("div",{className:"wcf-product-selection--product-discount flex items-center gap-2 whitespace-nowrap text-sm text-text-secondary w-2/3"},(0,i.createElement)("input",{type:"hidden",name:`wcf-checkout-products[${r}][discount_type]`,value:f}),(0,i.createElement)("div",{className:"w-16 shrink-0"},(0,i.createElement)(tg,{type:"number",size:"md",name:`wcf-checkout-products[${r}][discount_value]`,value:"disable"===u?"":m,disabled:"disable"===u,placeholder:"disable"===u?"":"0",min:1,step:"any",onChange:e=>h(e)})),(0,i.createElement)(bp,{placement:"bottom-start"},(0,i.createElement)(bp.Trigger,null,(0,i.createElement)("button",{type:"button",className:"appearance-none bg-background-primary border border-solid border-border-subtle shadow-sm rounded-md h-10 w-[130px] px-2 py-2 flex items-center justify-between gap-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-brand-600 focus:ring-offset-2"},(0,i.createElement)("span",{className:"flex items-center gap-1"},(0,i.createElement)("span",{className:"size-4 shrink-0 flex items-center"},A.icon),(0,i.createElement)("span",{className:"text-sm font-normal text-text-primary"},A.label)),(0,i.createElement)(cp,{className:"size-3.5 shrink-0 text-icon-secondary"}))),(0,i.createElement)(bp.ContentWrapper,{className:"z-10"},(0,i.createElement)(bp.Content,null,(0,i.createElement)(bp.List,null,j.map(e=>(0,i.createElement)(bp.Item,{key:e.value,active:f===e.value,onClick:()=>{p(e.value),function(e,t,n){d(""===n?"disable":"enable")}(0,0,e.value)}},(0,i.createElement)("span",{className:"flex items-center gap-2 text-sm"},e.icon,e.label)))))))),(0,i.createElement)("div",{className:"wcf-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[10%] justify-center"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)($h,{className:"w-4 h-4"}),onClick:()=>w(!g),className:`${"yes"===k?"visible":"invisible"} ${g?"bg-brand-50 text-brand-500":""}`,type:"button"}),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)($m,{className:"w-4 h-4"}),onClick:function(){const e=a.unique_id;e&&n({type:"REMOVE_CHECKOUT_PRODUCT",field_name:o,unique_id:e})},"data-index":r,type:"button",className:"text-icon-secondary hover:text-support-error"})),(0,i.createElement)("input",{name:`wcf-checkout-products[${r}][product]`,type:"hidden",className:"wcf-checkout-product-id",value:a.product}),(0,i.createElement)("input",{name:`wcf-checkout-products[${r}][unique_id]`,type:"hidden",className:"wcf-checkout-product-unique",value:a.unique_id})),g&&(0,i.createElement)("div",{className:"wcf-product-field-item-settings flex flex-col gap-5 p-6 bg-background-primary "+(g&&"yes"===l.add_to_cart?"border-[0.5px] border-t-0 border-solid border-brand-300":"border-[0.5px] border-t-0 border-solid border-border-subtle"),id:"product-option-index-"+r,"data-id":a.product_id},(0,i.createElement)("div",{className:"flex flex-col gap-1.5"},(0,i.createElement)(tg,{name:`wcf-product-options-data[${l.unique_id}][product_name]`,label:(0,C.__)("Product Name","cartflows"),value:y,size:"md",onChange:e=>b(e)}),(0,i.createElement)(Of,{variant:"help",size:"sm",tag:"p"},(0,i.createElement)(vg,null),(0,C.__)("Use {{product_name}} and {{quantity}} to dynamically fetch respective product details.","cartflows"))),(0,i.createElement)("div",{className:"flex flex-col gap-1.5"},(0,i.createElement)(tg,{name:`wcf-product-options-data[${l.unique_id}][product_subtext]`,label:(0,C.__)("Subtext","cartflows"),value:v,size:"md",onChange:e=>x(e)}),(0,i.createElement)(Of,{variant:"help",size:"sm",tag:"p"},(0,i.createElement)(vg,null),(0,C.__)("Use {{quantity}}, {{discount_value}}, {{discount_percent}} to dynamically fetch respective product details.","cartflows"))),(0,i.createElement)("div",{className:"flex"},(0,i.createElement)(Cg,{id:`wcf-product-options-data-enable-highlight-${l.unique_id}`,checked:_,label:{heading:(0,C.__)("Enable Highlight","cartflows")},size:"sm",onChange:e=>M(e)})),(0,i.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${l.unique_id}][enable_highlight]`,value:_?"yes":"no"}),(0,i.createElement)("div",{className:_?"":"hidden"},(0,i.createElement)(tg,{name:`wcf-product-options-data[${l.unique_id}][highlight_text]`,label:(0,C.__)("Highlight Text","cartflows"),value:N,size:"md",onChange:e=>E(e)})),(0,i.createElement)("input",{name:`wcf-product-options-data[${l.unique_id}][unique_id]`,type:"hidden",className:"wcf-product-options-unique-id",value:l.unique_id})))},fx=function(){return(0,i.createElement)("a",{className:"wcf-create-new-product text-sm font-medium text-brand-500 hover:text-brand-600 inline-flex items-center gap-1.5 cursor-pointer mt-5 w-full focus:outline-none focus:ring-0 focus:text-brand-500 no-underline",rel:"noreferrer",target:"_blank",href:cartflows_admin.create_product_src},(0,i.createElement)(yg,{className:"w-4 h-4 stroke-2","aria-hidden":"true"}),(0,C.__)("Create New Product","cartflows"))},px=function(e){const[{options:t},n]=Yp(),{name:r,value:o}=e,a=t[r],[l,c]=(0,s.useState)(),[u,d]=(0,s.useState)(""),[f,p]=(0,s.useState)(!1),m=(0,C.__)("Add","cartflows"),[h,g]=(0,s.useState)({isInProcessing:!1,buttonText:m}),{isInProcessing:w,buttonText:y}=h,b=t["wcf-product-options"],v=t["wcf-product-options-data"];(0,s.useEffect)(()=>(n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:r,products:o}),()=>{}),[]);let x=0;const N=wcfCartflowsPro()?function(){const e={};v&&Object.keys(v).map(t=>{const n=v[t];return e[t]={...n},""});const t=[],n={enable_highlight:"no",highlight_text:"",product_name:"",product_subtext:"",add_to_cart:"yes"};return x=0,a.map(function(r){if(r?.unique_id){let o={...n};const a=r.unique_id;e[a]&&(o={...e[a]}),o.product_id=r?.product,o.product_name=o.product_name?o.product_name:r?.name,o.product_title=r?.name,o.unique_id=r.unique_id,"single-selection"!==b&&(o.add_to_cart=o.add_to_cart?o.add_to_cart:"yes"),"single-selection"===b&&(o.add_to_cart&&"no"!==o.add_to_cart&&x++,e[a]||(o.add_to_cart="no")),t.push(o)}return"single-selection"===b&&0===x&&(t[0].add_to_cart="yes"),""}),t}():[];return(0,i.createElement)("div",{className:"wcf-checkout-product-selection-field"},a&&0===a.length&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("input",{name:"wcf-checkout-products",type:"hidden",value:""}),(0,i.createElement)("div",{className:"flex flex-col items-center justify-center py-8 px-4 border border-dashed border-border-subtle rounded-lg bg-background-secondary"},(0,i.createElement)(Vm,{size:"sm",className:"text-text-tertiary text-center"},(0,C.__)("No products added yet. Search and add products below.","cartflows")))),a&&a.length>0&&(0,i.createElement)("div",{className:"border border-solid border-border-subtle rounded-lg"},(0,i.createElement)("div",{className:"wcf-product-selection--header bg-background-secondary border-b border-border-subtle flex items-center gap-3 p-3"},(0,i.createElement)(Vm,{size:"xs",weight:"medium",className:"text-text-secondary w-2/5"},(0,C.__)("Product","cartflows")),(0,i.createElement)(Vm,{size:"xs",weight:"medium",className:"text-text-secondary w-[10%] text-center"},(0,C.__)("Default","cartflows")),(0,i.createElement)(Vm,{size:"xs",weight:"medium",className:"text-text-secondary w-[10%] text-center"},(0,C.__)("Qty","cartflows")),(0,i.createElement)(Vm,{size:"xs",weight:"medium",className:"text-text-secondary w-2/3"},(0,C.__)("Discount","cartflows")),(0,i.createElement)("div",{className:"w-[10%]"})),(0,i.createElement)(Zp.ReactSortable,{list:a,setList:e=>n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:r,products:e}),direction:"vertical",filter:".wcf-field, .wcf-product-selection-actions",preventOnFilter:!1,className:"wcf-checkout-product-selection-field__content"},a.map((e,t)=>("yes"===e.add_to_cart&&x++,(0,i.createElement)(dx,{key:e.unique_id,index:t,field_name:r,product_data:e,productOptdata:N.length>0?N[t]:[]}))))),(0,i.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new flex items-end gap-3 mt-8"},(0,i.createElement)("div",{className:"flex-1"},(0,i.createElement)(sM,{name:"",desc:"",class:f?"border border-brand-600":"",field:"product",value:u,allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",excluded_product_ids:cartflows_admin?.restrict_duplicate_checkout_products?(a||[]).map(e=>Number(e.product)):[],placeholder:(0,C.__)("Search for a Product","cartflows"),onChangeCB:c})),(0,i.createElement)(Ro,{type:"button",variant:"outline",size:"md",icon:(0,i.createElement)(yg,{className:"w-4 h-4"}),iconPosition:"left",loading:w,disabled:w,onClick:function(e){const o=l?.value;o?(e.target.blur(),g({isInProcessing:!0,buttonText:(0,C.__)("Adding…","cartflows")}),qf()({path:`/cartflows/v1/admin/product-data/${o}`}).then(e=>{const a={product:o,quantity:"1",discount_type:"",discount_value:"",unique_id:Math.random().toString(36).substring(2,10),name:l?.label,img_url:e?.img_url,regular_price:e?.regular_price};if(n({type:"ADD_CHECKOUT_PRODUCT",field_name:r,product_data:a}),d(null),wcfCartflowsPro()){const e=t["wcf-product-options-data"];e[a.unique_id]={enable_highlight:"no",highlight_text:"",product_name:"",product_subtext:""},n({type:"SET_OPTION",name:"wcf-product-options-data",value:e})}g({isInProcessing:!1,buttonText:m})}),c(null)):(p(!0),e.target.blur(),setTimeout(()=>{p(!1)},3e3))},className:"shrink-0"},y)),f&&(0,i.createElement)(Vm,{size:"sm",className:"text-support-error mt-1"},(0,C.__)("Please search and select at-least one product to add.","cartflows")),(0,i.createElement)(fx,null))},mx=window.wp.components,hx=function(e){const{name:t,label:n,value:r,isActive:o=!0,tooltip:a,sectionClass:l="",wrapperClass:c="",labelClass:u="",displayAlign:d="horizontal",withBg:f=!1,showOverlay:p=!1}=e,[m,h]=(0,s.useState)(!1),[g,w]=(0,s.useState)(r),[y,b]=(0,s.useState)(!1),v=(0,s.useRef)(null);(0,s.useEffect)(()=>{w(r)},[r]);const x=`wcf-colorpicker-${String(t).replace(/[\[\]]/g,"-")}`,N=l||"text-left",E="horizontal"!==d?"block w-full text-left":c||"flex justify-between items-center gap-2.5",_="horizontal"!==d?`${u||"text-sm font-medium text-text-primary"} mb-2`:`${u||"text-sm font-medium text-text-primary"}`,M=e=>{e.stopPropagation(),document.dispatchEvent(new CustomEvent("closeAllColorPickers",{detail:{name:t}})),h(!m)},I=t=>{const n=t||"";w(n);const r=new CustomEvent("wcf:color:change",{bubbles:!0,detail:{e:"color",name:e.name,value:n}});document.dispatchEvent(r)};return(0,s.useEffect)(()=>{const e=e=>{!v.current||v.current.contains(e.target)||e.target.closest(".wcf-colorpicker-swatch-wrap")||e.target.closest(".wcf-colorpicker-reset")||h(!1)},n=e=>{e.detail.name!==t?h(!1):h(!m)};return document.addEventListener("closeAllColorPickers",n),document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("closeAllColorPickers",n)}},[t]),(0,s.useEffect)(()=>{if(!m)return;const e=e=>{"Escape"===e.key&&h(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[m]),(0,i.createElement)("div",{className:`wcf-field wcf-color-field ${N} ${o?"":"wcf-hide"}`},(0,i.createElement)("div",{className:`wcf-field__data ${E}`},n&&(0,i.createElement)("div",{className:`wcf-field__data--label ${_}`},(0,i.createElement)("label",null,n),a&&(0,i.createElement)(dM,{text:a})),(0,i.createElement)("div",{className:"wcf-field__data--content "+(f?"bg-background-primary px-2 py-2 !text-sm font-normal !rounded-md text-text-tertiary border border-solid !border-border-subtle w-fit":"")},(0,i.createElement)("div",{className:"wcf-colorpicker-selector flex items-center gap-2 sm:justify-end"},(0,i.createElement)("div",{className:"wcf-colorpicker-swatch-wrap inline-flex items-center bg-background-primary border border-solid border-border-subtle rounded-sm cursor-pointer text-text-tertiary focus-visible:ring-1 focus-visible:ring-border-interactive focus-visible:outline-none overflow-hidden",onClick:M,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),M(e))},role:"button",tabIndex:"0","aria-haspopup":"true","aria-expanded":m,"aria-controls":x,id:`${x}-trigger`},(0,i.createElement)("span",{className:"wcf-colorpicker-swatch inline-flex items-center justify-center border-0 border-r border-solid border-border-subtle",style:{width:"36px",height:"30px",background:g||"#fafafa",boxShadow:g?"inset 0 0 0 3px #fff":"none"},"aria-hidden":"true"},!g&&(0,i.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxjaXJjbGUgY3g9IjEwIiBjeT0iMTAiIHI9IjEwIiBmaWxsPSJ1cmwoI2EpIi8+PGNpcmNsZSBjeD0iMTAiIGN5PSIxMCIgcj0iOS41IiBzdHJva2U9IiMxRDI5MzkiIHN0cm9rZS1vcGFjaXR5PSIuMTYiLz48ZGVmcz48cGF0dGVybiBpZD0iYSIgcGF0dGVybkNvbnRlbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjx1c2UgeGxpbms6aHJlZj0iI2IiIHRyYW5zZm9ybT0ibWF0cml4KC4wMDk0OCAwIDAgLjAwOTQ4IC0uNjM3IC0uNjQ0KSIvPjwvcGF0dGVybj48aW1hZ2UgaWQ9ImIiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiB4bGluazpocmVmPSJkYXRhOmltYWdlL3BuZztiYXNlNjQsaVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQVFBQUFBRUFDQVlBQUFCY2NxaG1BQUFBQVhOU1IwSUFyczRjNlFBQUNzVkpSRUZVZUY3dDNiRnRKbHNPUk9GL25yTXhLTUpOUTFrSU1nVkZJRStwcmZPd09WUVpSRTEvNHdzWHpTRVBEMiszcUQ4Zlh6L3ZyK0xmUC8vODU3UDQ4ZGUvLy83dnY4M1BPMS84bS94NWV2NzlBUUFBYWdvSWdMY0JEQUFNaElFVkJGd0hJQUFBQUFBQVFCNkJkUUkrZlFiMC9NOGVBUmtBQTJBQWVmOTdyVGRBQUFBQUFBQ0FQQUxyQktUQXoxYmdwLy8vTXdBR3dBRHkvbWNFWUFEYjc0R2YzZ0dmL3Z3TWdBRXdBQWFRUjRBQk1JQThlMTQrQlQ5dVFBemcrRC9nNlFycStXOHZZUUVBQUl3QWhjS3NHekFBQUFBQUFFQWVnWFVDVXRCYkJSWC8yL2ovK2Z6K2ZjdkwzeVdPQkw1TllQSHY0ZzhBRnBwWTZGSjB3SFVBQVFBQUFBQUE1QkZZSjZBN0ROOHg1Tm0vUHdJekFBYkFBQW9DckRkQUFBQUFBQUNBUEFMckJEUUNHQUh5N0RjQytKYmJoMFErSkNvSWN0MkFqQUJHQUNOQVVjRHJCZ3dBQUFBQUFKQkhZSjJBMXdybWZIY1FlZlgxZHhBTWdBRXdnS0lDMXhzZ0FBQUFBQUJBSG9GMUFsSndDcDVuZjYvZzEvbkhBQmdBQXlnSXNONEFBUUFBQU9ESkFQRG53YnZmcDc1V09PY2JZUXArdmF3RTh5V2ZML21LQ2xvSE1BQUFBQUFBUUI2QmRRS3VYK0tJdnhFZ3I5NlhFUUFBM0lFMEJiUU9ZQ09BRWNBSVVCQUFBTHhHOHhxdEtDQUdkbXRnRElBQk1JQUNZQXlBQVRDQW9vQVlBQVBRZ1lvQ1d1OUFBQUFBQUFBQWNRUUFzSHNONmc3QUhRQUF4L2g1dmRZQkJBQUFBQUFBa0VkZ25ZQm0wTnNaVlB4djQ4OEFHQUFEeVB1ZkVZQUJkSmN3T3VCdEIzeDYvQzBFOFIyRDd4Z0tBMWdIQ0FBQUFBQUFRQjZCZFFJYVlZd3dlZlpiQ3VwdkE3cEVkSWxZRU9TNkFSa0JqQUJHZ0tLQTF3MFlBQUFBQUFBZ2o4QTZBYThWelBudUlQTHE2KzhnR0FBRFlBQkZCYTQzUUFBQUFBQUFnRHdDNndTazRCUTh6LzVld2Evemp3RXdBQVpRRUdDOUFRSUFBQUFBQU9RUldDZmd0WUk1M3dpU1YxOC9nakFBQnNBQWlncGNiNEFBQUFBQUFBQjVCTllKU01FcGVKNzl2WUpmNTUrTlFINlp4eS96RkFTNEx1RDJmQUFBQUFBQWdEd0NMWUdNRUZaaTVkbTN2NWI3T3Y4WkFBTmdBQVdCMWhzZ0FBQUFBQUJBSG9GMUFsNHJtUE9OUUhuMTlTTVFBMkFBREtDb3dQVUdDQUFBQUFBQWtFZGduWUFVbklMbjJkOHIrSFgrTVFBR3dBQUtBcXczUUFBQUFBQUFnRHdDNndTOFZqRG5HMEh5NnV0SEVBYkFBQmhBVVlIckRSQUFBQUFBQUNDUHdEb0JLVGdGejdPL1YvRHIvR01BRElBQkZBUlliNEEyQXRrSVpDTlFBWURyRHQ2ZUR3QUFBQUFBa0VlZ0pkQzZRbmwrZHdoNTlkemZJVEFBQnNBQWlncGVid0FBQUFBQUFBQjVCTllKYUFTeEZUalAvcjlnSy9EbjkrL2Jrd01BQUFEdzVQdzNBaGdCakFBRkFkWU5HQUFBQUFBQUlJL0FPZ0dOQUVhQVBQdmRBYndBd0h2d3BvQUErQmJBUmdBamdCR2dJTmg2QXdRQUFBQUFBTWdqc0U1QUNucXJvT0ovRzM4R3dBQVlRTjcvNXUvQUFBQUFBT0RKQVBqNCtua3ZudjlGNFc0VlR2ekZ2NmxmRzRGc0JMSVJxS2lnZFFBREFBQUFBQURrRVZnbm9MY1lQbVRLcy85K29VZGJmd3lBQVRDQWdnQnRBVjQzSUFBQUFBQUFnRHdDNndTOEpyRHpqU0I1OWZVakNBTmdBQXlncU1EMUJnZ0FBQUFBQUpCSFlKMkFGSnlDNTluZksvaDEvakVBQnNBQUNnS3NOMEFBQUFBQUFJQThBdXNFdkZZdzV4dEI4dXJyUnhBR3dBQVlRRkdCNncwUUFBQUFBQUFnajhBNkFTazRCYyt6djFmdzYveXpFTVJDRUF0QkNnSmNGM0I3UGdBQUFBQUFRQjZCbGtCR0NCdHQ4dXpiLzhNYzEvblBBQmdBQXlnSXRONEFBUUFBQUFBQThnaXNFL0Jhd1p4dkJNcXJyeCtCR0FBRFlBQkZCYTQzUUFBQUFBQUFnRHdDNndTazRCUTh6LzVld2Evemp3RXdBQVpRRUdDOUFRSUFBQUFBQU9RUldDZmd0WUk1M3dpU1YxOC9nakFBQnNBQWlncGNiNEFBQUFBQUFBQjVCTllKU01FcGVKNzl2WUpmNXg4RFlBQU1vQ0RBZWdPMEVjaEdJQnVCQ2dCY2QvRDJmQUFBQUFBQWdEd0NMWUhXRmNyenUwUElxK2YrRG9FQk1BQUdVRlR3ZWdNQUFBQUFBQURJSTdCT1FDT0lyY0I1OXY4Rlc0RS92bjdlbnh3QUFBQ0FKK2UvRWNBSVlBUW9DTEJ1d0FBQUFBQUFBSGtFMWdsb0JEQUM1Tm52RHVBRkFONkROd1VFd0xjQU5nSVlBWXdBQmNIV0d5QUFBQUFBQUVBZWdYVUNVdEJiQlJYLzIvZ3pBQWJBQVBMK04zOEhCZ0FBQUFCUEJzRG45KzliOGZ3dkNuZXJjT0l2L2szOTJnaGtJNUNOUUVVRnJRTVlBQUFBQUFBZ2o4QTZBYjNGOENGVG52MzNDejNhK21NQURJQUJGQVJvQy9DNkFRRUFBQUFBQU9RUldDZmdOWUdkYndUSnE2OGZRUmdBQTJBQVJRV3VOMEFBQUFBQUFJQThBdXNFcE9BVVBNLytYc0d2ODQ4Qk1BQUdVQkJndlFFQ0FBQUFBQURrRVZnbjRMV0NPZDhJa2xkZlA0SXdBQWJBQUlvS1hHK0FBQUFBQUFBQWVRVFdDVWpCS1hpZS9iMkNYK2VmaFNBV2dsZ0lVaERndW9EYjh3RUFBQUFBQVBJSXRBUXlRdGhvazJmZi9oL211TTUvQnNBQUdFQkJvUFVHQ0FBQUFBQUFrRWRnbllEWEN1WjhJMUJlZmYwSXhBQVlBQU1vS25DOUFRSUFBQUFBQU9RUldDY2dCYWZnZWZiM0NuNmRmd3lBQVRDQWdnRHJEUkFBQUFBQUFDQ1B3RG9CcnhYTStVYVF2UHI2RVlRQk1BQUdVRlRnZWdNRUFBQUFBQURJSTdCT1FBcE93ZlBzN3hYOE92OFlBQU5nQUFVQjFodWdqVUEyQXRrSVZBRGd1b08zNXdNQUFBQUFBT1FSYUFtMHJsQ2UzeDFDWGozM2R3Z01nQUV3Z0tLQzF4c0FBQUFBQUFCQUhvRjFBaHBCYkFYT3MvOHYyQXI4K2YzNzl1UUFBQUFBUERuL2pRQkdBQ05BUVlCMUF3WUFBQUFBQU1nanNFNUFJNEFSSU05K2R3QXZBUEFldkNrZ0FMNEZzQkhBQ0dBRUtBaTIzZ0FCQUFBQUFBRHlDS3dUa0lMZUtxajQzOGFmQVRBQUJwRDN2L2s3TUFBQUFBQjRNZ0Erdm43ZWkrZC9VYmhiaFJOLzhXL3ExMFlnRzRGc0JDb3FhQjNBQUFBQUFBQUFlUVRXQ2VndGhnK1o4dXkvWCtqUjFoOERZQUFNb0NCQVc0RFhEUWdBQUFBQUFDQ1B3RG9Ccnduc2ZDTklYbjM5Q01JQUdBQURLQ3B3dlFFQ0FBQUFBQURrRVZnbklBV240SG4yOXdwK25YOE1nQUV3Z0lJQTZ3MFFBQUFBQUFBZ2o4QTZBYThWelBsR2tMejYraEdFQVRBQUJsQlU0SG9EQkFBQUFBQUF5Q093VGtBS1RzSHo3TzhWL0RyL0xBU3hFTVJDa0lJQTF3WGNuZzhBQUFBQUFKQkhvQ1dRRWNKR216ejc5djh3eDNYK013QUd3QUFLQXEwM1FBQUFBQUFBZ0R3QzZ3UzhWakRuRzRIeTZ1dEhJQWJBQUJoQVVZSHJEUkFBQUFBQUFDQ1B3RG9CS1RnRno3Ty9WL0RyL0dNQURJQUJGQVJZYjRBQUFBQUFBQUI1Qk5ZSmVLMWd6amVDNU5YWGp5QU1nQUV3Z0tJQzF4c2dBQUFBQUFCQUhvRjFBbEp3Q3A1bmY2L2cxL25IQUJnQUF5Z0lzTjRBYlFTeUVjaEdvQUlBMXgyOFBSOEFBQUFBQUNDUFFFdWdkWVh5L080UTh1cTV2ME5nQUF5QUFSUVZ2TjRBQUFBQUFBQUE4Z2lzRTlBSVlpdHdudjEvd1ZiZ2o2K2Y5eWNIQUFBQTRNbjVid1F3QWhnQkNnS3NHekFBQUFBQUFFQWVnWFVDR2dHTUFIbjJ1d040QVlEMzRFMEJBZkF0Z0kwQVJnQWpRRUd3OVFZSUFBQUFBQUNRUjJDZGdCVDBWa0hGL3piK0RJQUJNSUM4LzgzZmdRRUFBQURBa3dIdytmMzdWanovaThMZEtwejRpMzlUdnpZQzJRaGtJMUJSUWVzQUJnQUFBQUFBeUNPd1RrQnZNWHpJbEdmLy9VS1B0djRZQUFOZ0FBVUIyZ0s4YmtBQUFBQUFBQUI1Qk5ZSmVFMWc1eHRCOHVyclJ4QUd3QUFZUUZHQjZ3MFFBQUFBQUFBZ2o4QTZBU2s0QmMrenYxZnc2L3hqQUF5QUFSUUVXRytBQUFBQUFBQUFlUVRXQ1hpdFlNNDNndVRWMTQ4Z0RJQUJNSUNpQXRjYklBQUFBQUFBUUI2QmRRSlNjQXFlWjMrdjROZjU5MysraWozaGFMdmRwUUFBQUFCSlJVNUVya0pnZ2c9PSIvPjwvZGVmcz48L3N2Zz4=",alt:"",className:"!w-5 !h-5 opacity-40"})),(0,i.createElement)("span",{className:"wcf-colorpicker-label text-xs font-normal text-text-secondary px-[7px] py-[5px] whitespace-nowrap"},(0,C.__)("Select Color","cartflows")),(0,i.createElement)("input",{type:"hidden",name:t,value:g})),(0,i.createElement)(dM,{text:(0,C.__)("Reset","cartflows"),classes:"!ml-0",icon:(0,i.createElement)("button",{type:"button",onClick:()=>{g&&(b(!0),setTimeout(()=>b(!1),500),I(""))},disabled:!g,"aria-label":(0,C.__)("Reset color","cartflows"),className:"wcf-colorpicker-reset bg-transparent border-0 p-1.5 cursor-pointer text-text-tertiary hover:text-text-secondary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:text-text-tertiary focus-visible:ring-1 focus-visible:ring-border-interactive focus-visible:outline-none rounded-sm"},(0,i.createElement)(Pf,{className:`w-4 h-4 stroke-2 transform ${y?"rotate-180":""} transition-transform duration-500`,"aria-hidden":"true"}))})),(0,i.createElement)("div",{className:"wcf-color-picker relative",ref:v},m?(0,i.createElement)("div",{className:"wcf-color-picker-popover absolute z-10 right-0 top-3",id:x},p&&(0,i.createElement)("div",{className:"wcf-color-picker-cover fixed inset-0",onClick:()=>{h(!1)}}),(0,i.createElement)("div",{className:"bg-background-primary shadow-lg relative rounded-md overflow-hidden"},(0,i.createElement)(mx.ColorPicker,{color:g,onChange:I,enableAlpha:!1}))):null))))},gx=e=>e.isSelected?"#F3F4F6":e.isFocused?"#F9FAFB":"transparent",wx=function(e){const{name:t,label:n,value:r,desc:o,tooltip:a,font_weight_name:l="",font_weight_value:c="",sectionClass:u=!1,wrapperClass:d=!1,labelClass:f="",displayAlign:p="horizontal"}=e,m=u||"text-left";let h=d||"flex items-center gap-2.5",g=f||"text-sm font-medium text-text-primary";"horizontal"!==p&&(h="block w-full text-left",g+=" mb-2");const w=cartflows_admin.cf_font_family,y=r||"Default",[b,v]=(0,s.useState)({value:r,label:r&&r.match(/'([^']+)'/)?r.match(/'([^']+)'/)[1]:y}),[x,N]=(0,s.useState)(c),E=function(e){let t=e.value;const n=[];if(void 0===t||""===t)return n.push({value:"",label:"Default"}),n;const r=t.match("'(.*)'"),o={};r&&r[1]&&(t=r[1]);const a={};return cartflows_admin.google_fonts[t]?(cartflows_admin.google_fonts[t].variants.map(e=>(e.includes("italic")||(a[e]=cartflows_admin.font_weights[e]),"")),Object.keys(a).map(e=>{const t=a[e];return n.push({value:e,label:t}),""}),o[t.replace(" ","+")]=a):cartflows_admin.system_fonts[t]&&(cartflows_admin.system_fonts[t].variants.map(e=>(e.includes("italic")||(a[e]=cartflows_admin.font_weights[e]),"")),Object.keys(a).map(e=>{const t=a[e];return n.push({val:e,label:t}),""})),n};let _=E(b);const M={control:(e,t)=>({...e,borderColor:"#E5E7EB",boxShadow:t.isFocused?"none":"",borderRadius:"6px","&:hover":{borderColor:"none"}}),option:(e,t)=>({...e,backgroundColor:gx(t),color:"#111827",cursor:"pointer","&:active":{backgroundColor:"#F3F4F6"}})};return(0,i.createElement)("div",{className:`wcf-field wcf-font-family-field ${m} `},(0,i.createElement)("div",{className:`wcf-field__data ${h}`},n&&(0,i.createElement)("div",{className:`wcf-field__data--label ${g}`},(0,i.createElement)("label",null,n,a&&(0,i.createElement)(dM,{text:a}))),(0,i.createElement)("div",{className:"wcf-selection-field"},(0,i.createElement)(nx,{name:t,className:"wcf-select2-input",classNamePrefix:"wcf",cacheOptions:!0,defaultOptions:w,value:b,loadOptions:e=>new Promise(t=>{setTimeout(()=>{t((e=>{const t=w[1].options,n=w[2].options,r=w[0];return t.concat(n,r).filter(t=>t.label.toLowerCase().includes(e.toLowerCase()))})(e))},1e3)}),onChange:t=>{v(t);const n=E(t);_=n;const r=new CustomEvent("wcf:font:change",{bubbles:!0,detail:{name:e.name,value:t.value}});document.dispatchEvent(r)},styles:M}))),o&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Zm(o)),""!==l&&(0,i.createElement)("div",{className:"wcf-font-weight-field mt-5"},(0,i.createElement)(cw,{name:l,className:"wcf-select-input",value:x,onChange:function(e){N(e)},options:_,label:"Font Weight",displayAlign:p})))};function yx({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const bx=s.forwardRef(yx),{__}=wp.i18n,vx=function(e){const{name:t,tooltip:n,value:r,label:o,objName:a,objValue:l,singleButton:c=!1,sectionClass:u="",wrapperClass:d="",labelClass:f,desc:p,descClass:m,displayAlign:h="horizontal"}=e,[g,w]=(0,s.useState)(r),[y,b]=(0,s.useState)(l),[v,x]=(0,s.useState)(!r),N=(0,s.useRef)(null),E=u||"text-left",_=m||"text-sm font-normal text-text-tertiary mt-2";let M=d||"flex items-center gap-2.5",I=f||"text-sm font-medium text-text-primary mb-2";"horizontal"!==h&&(M="block w-full text-left",I+=" mb-2");const S=e=>{e.preventDefault(),N.current||(N.current=wp.media({multiple:!1}),N.current.on("select",function(){const n=N.current.state().get("selection").first().toJSON(),r=n.sizes?.medium?.url||n.url;w(r),b(n),x(!r),k(e,t,r),k(e,a,n)})),N.current.open()},k=(e,t,n)=>{e.preventDefault();const r=new CustomEvent("wcf:image-selector:change",{bubbles:!0,detail:{e,img_obj:t,url:n}});document.dispatchEvent(r)};return(0,i.createElement)("div",{className:`wcf-field wcf-image-selector-field ${E}`},(0,i.createElement)("div",{className:`wcf-field__data ${M}`},o&&(0,i.createElement)("div",{className:`wcf-field__data--label ${I}`},(0,i.createElement)("label",null,o,n&&(0,i.createElement)(dM,{text:n}))),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("div",{className:"wcf-image-selector-field__input p-0"},g&&!v&&(0,i.createElement)("div",{className:"text-center border-solid border-border-muted mb-3 leading-4"},(0,i.createElement)("img",{src:g,className:"saved-image",name:t,width:"150",alt:__("Image Preview","cartflows")})),(0,i.createElement)("input",{type:"hidden",id:t,className:"wcf-image",name:t,value:g}),(0,i.createElement)("input",{type:"hidden",className:"wcf-image-obj",name:a,value:JSON.stringify(y)}),!c&&v&&(0,i.createElement)("div",{className:"mt-2 flex flex-col items-center justify-center gap-3 rounded border border-dashed border-border-subtle hover:border-primary-500 px-6 py-6 cursor-pointer",onClick:S},(0,i.createElement)(bx,{className:"h-5 w-5 text-text-tertiary","aria-hidden":"true"}),(0,i.createElement)(zm,{direction:"column",align:"center",gap:"xs",className:"text-center"},(0,i.createElement)(Vm,{as:"p",size:14,weight:500,color:"primary",className:"m-0"},__("Drag and drop or browse files","cartflows")),(0,i.createElement)(Vm,{as:"p",size:12,color:"secondary",className:"m-0"},__("PNG, JPG, GIF up to 10MB","cartflows")))),(0,i.createElement)(zm,{gap:"sm",className:"wcf-image-selector-field-buttons m-0 p-0"},c&&(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"wcf-select-image",onClick:S},__(g?"Change Image":"Select Image","cartflows")),g&&(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"wcf-remove-image",onClick:e=>{e.preventDefault(),w(""),x(!0),b(""),k(e,t,""),k(e,a,"")}},__("Remove Image","cartflows")))))),p&&(0,i.createElement)(zm,{align:"center",gap:"xs",className:`wcf-field__desc ${_}`},(0,i.createElement)(vg,{className:"w-3 h-3 text-text-secondary shrink-0"}),Zm(p)))},xx=function(e){const{name:t,id:n,label:r,desc:o,value:a,tooltip:l,placeholder:c,min:u,max:d,width:f,afterfield:p,readonly:m,wrapperClass:h=!1,labelClass:g,sectionClass:w,descClass:y,displayAlign:b="horizontal",step:v="1"}=e,[x,N]=(0,s.useState)(a),E=(0,s.useRef)(null),_=w||"text-left",M=g||"text-sm font-medium text-text-primary mb-2",I=y||"text-sm font-normal text-text-tertiary mt-2";let S=h||"flex items-center gap-2.5";return"horizontal"!==b&&(S="block w-full text-left"),(0,s.useEffect)(()=>{N(a),E.current&&(E.current.value=null!=a?a:"")},[a]),(0,i.createElement)("div",{className:`wcf-field wcf-number-field ${_}`},(0,i.createElement)("div",{className:`wcf-field__data ${S}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${M}`},(0,i.createElement)("label",null,r,l&&(0,i.createElement)(dM,{text:l}))),(0,i.createElement)("div",{className:"wcf-field__data--content flex items-center"},(0,i.createElement)("input",{type:"hidden",ref:E,className:e.class?e.class:"",defaultValue:null!=x?x:""}),(0,i.createElement)(tg,{type:"number",name:t,value:x,id:n,onChange:function(e){let n=e;if("any"===v&&n?.includes(".")){const[e,t]=n.split(".");t.length>2&&(n=`${e}.${t.substring(0,2)}`)}const r=document.getElementsByName(t);r[0]&&r[0].setAttribute("value",n),E.current&&(E.current.value=n),N(n);const o=new CustomEvent("wcf:number:change",{bubbles:!0,detail:{e:{target:{value:n,name:t}},name:t,value:n}});document.dispatchEvent(o)},placeholder:c,min:u,max:d,readOnly:m,disabled:m,inputMode:"numeric",step:v,style:{width:f},size:"md",className:`${e.class?e.class:"!w-full"}`}),p&&(0,i.createElement)("span",{className:"wcf-field__data--after-field ml-1 font-medium"},p))),o&&(0,i.createElement)("div",{className:`wcf-field__desc ${I}`},Zm(o)))},Nx=To("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Ex=To("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Mx=(0,s.createContext)(void 0);function Ix(){const e=(0,s.useContext)(Mx);if(void 0===e)throw new Error("useDayPicker() must be used within a custom component.");return e}const Sx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function kx(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Dx={date:kx({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:kx({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:kx({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Cx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function jx(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const Ax={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:jx({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:jx({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:jx({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:jx({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:jx({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function Tx(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}(s,e=>e.test(i)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(s,e=>e.test(i));let c;return c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:t.slice(i.length)}}}const Lx={ordinalNumber:(Ox={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(Ox.matchPattern);if(!n)return null;const r=n[0],o=e.match(Ox.parsePattern);if(!o)return null;let a=Ox.valueCallback?Ox.valueCallback(o[0]):o[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(r.length)}}),era:Tx({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Tx({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Tx({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Tx({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Tx({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var Ox;const zx={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=Sx[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:Dx,formatRelative:(e,t,n,r)=>Cx[e],localize:Ax,match:Lx,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Px={};function Rx(){return Px}Math.pow(10,8);const Ux=6048e5,Bx=Symbol.for("constructDateFrom");function Fx(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&Bx in e?e[Bx](t):e instanceof Date?new e.constructor(t):new Date(t)}function Qx(e,t){return Fx(t||e,e)}function Vx(e){const t=Qx(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Yx(e,...t){const n=Fx.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}function Zx(e,t){const n=Qx(e,t?.in);return n.setHours(0,0,0,0),n}function Wx(e,t,n){const[r,o]=Yx(n?.in,e,t),a=Zx(r),i=Zx(o),s=+a-Vx(a),l=+i-Vx(i);return Math.round((s-l)/864e5)}function Gx(e,t){const n=Qx(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Hx(e,t){const n=Rx(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Qx(e,t?.in),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function $x(e,t){return Hx(e,{...t,weekStartsOn:1})}function Xx(e,t){const n=Qx(e,t?.in),r=n.getFullYear(),o=Fx(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=$x(o),i=Fx(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const s=$x(i);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function qx(e,t){const n=Qx(e,t?.in),r=+$x(n)-+function(e,t){const n=Xx(e,t),r=Fx(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),$x(r)}(n);return Math.round(r/Ux)+1}function Jx(e,t){const n=Qx(e,t?.in),r=n.getFullYear(),o=Rx(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=Fx(t?.in||e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const s=Hx(i,t),l=Fx(t?.in||e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const c=Hx(l,t);return+n>=+s?r+1:+n>=+c?r:r-1}function Kx(e,t){const n=Qx(e,t?.in),r=+Hx(n,t)-+function(e,t){const n=Rx(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Jx(e,t),a=Fx(t?.in||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Hx(a,t)}(n,t);return Math.round(r/Ux)+1}function eN(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const tN={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return eN("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):eN(n+1,2)},d:(e,t)=>eN(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>eN(e.getHours()%12||12,t.length),H:(e,t)=>eN(e.getHours(),t.length),m:(e,t)=>eN(e.getMinutes(),t.length),s:(e,t)=>eN(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return eN(Math.trunc(r*Math.pow(10,n-3)),t.length)}},nN={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return tN.y(e,t)},Y:function(e,t,n,r){const o=Jx(e,r),a=o>0?o:1-o;return"YY"===t?eN(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):eN(a,t.length)},R:function(e,t){return eN(Xx(e),t.length)},u:function(e,t){return eN(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return eN(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return eN(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return tN.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return eN(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Kx(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):eN(o,t.length)},I:function(e,t,n){const r=qx(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):eN(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):tN.d(e,t)},D:function(e,t,n){const r=function(e,t){const n=Qx(e,t?.in);return Wx(n,Gx(n))+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):eN(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return eN(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return eN(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return eN(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return tN.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):tN.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):eN(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):eN(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):tN.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):tN.s(e,t)},S:function(e,t){return tN.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return oN(r);case"XXXX":case"XX":return aN(r);default:return aN(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return oN(r);case"xxxx":case"xx":return aN(r);default:return aN(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rN(r,":");default:return"GMT"+aN(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rN(r,":");default:return"GMT"+aN(r,":")}},t:function(e,t,n){return eN(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return eN(+e,t.length)}};function rN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+t+eN(a,2)}function oN(e,t){return e%60==0?(e>0?"-":"+")+eN(Math.abs(e)/60,2):aN(e,t)}function aN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+eN(Math.trunc(r/60),2)+t+eN(r%60,2)}const iN=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},sN=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},lN={p:sN,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return iN(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",iN(r,t)).replace("{{time}}",sN(o,t))}},cN=/^D+$/,uN=/^Y+$/,dN=["D","DD","YY","YYYY"];function fN(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}const pN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hN=/^'([^]*?)'?$/,gN=/''/g,wN=/[a-zA-Z]/;function yN(e,t,n){const r=Rx(),o=n?.locale??r.locale??zx,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Qx(e,n?.in);if(!function(e){return!(!fN(e)&&"number"!=typeof e||isNaN(+Qx(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(mN).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,lN[t])(e,o.formatLong):e}).join("").match(pN).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:bN(e)};if(nN[t])return{isToken:!0,value:e};if(t.match(wN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(r=>{if(!r.isToken)return r.value;const a=r.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return uN.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return cN.test(e)}(a))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),dN.includes(e))throw new RangeError(r)}(a,t,String(e)),(0,nN[a[0]])(s,a,o.localize,c)}).join("")}function bN(e){const t=e.match(hN);return t?t[1].replace(gN,"'"):e}const vN={...zx,labels:{labelDayButton:(e,t,n,r)=>{let o;o=r&&"function"==typeof r.format?r.format.bind(r):(e,t)=>yN(e,t,{locale:zx,...n});let a=o(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return r=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>yN(e,n,{locale:zx,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;o=r&&"function"==typeof r.format?r.format.bind(r):(e,t)=>yN(e,t,{locale:zx,...n});let a=o(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return r=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>yN(e,n,{locale:zx,...t}),r(e,"cccc")}}};Symbol.for("constructDateFrom");const xN={},NN={};function EN(e,t){try{const n=(xN[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in NN?NN[n]:MN(n,n.split(":"))}catch{if(e in NN)return NN[e];const t=e?.match(_N);return t?MN(e,t.slice(1)):NaN}}const _N=/([+-]\d\d):?(\d\d)?/;function MN(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return NN[e]=60*n+r>0?60*n+r+o:60*n-r-o}class IN extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(EN(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),DN(this),kN(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new IN(...t,e):new IN(Date.now(),e)}withTimeZone(e){return new IN(+this,e)}getTimezoneOffset(){const e=-EN(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),kN(this),+this}[Symbol.for("constructDateFrom")](e){return new IN(+new Date(e),this.timeZone)}}const SN=/^(get|set)(?!UTC)/;function kN(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-EN(e.timeZone,e)))}function DN(e){const t=EN(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),a=o- -new Date(+r).getTimezoneOffset(),i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const s=o-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const l=new Date(+e);l.setUTCSeconds(0);const c=o>0?l.getSeconds():(l.getSeconds()-60)%60,u=Math.round(-60*EN(e.timeZone,e))%60;(u||c)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+c));const d=EN(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f-s;if(f!==n&&p){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+p);const t=EN(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!SN.test(e))return;const t=e.replace(SN,"$1UTC");IN.prototype[t]&&(e.startsWith("get")?IN.prototype[e]=function(){return this.internal[t]()}:(IN.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),function(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),DN(e)}(this),+this},IN.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),kN(this),+this}))});class CN extends IN{static tz(e,...t){return t.length?new CN(...t,e):new CN(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new CN(+this,e)}[Symbol.for("constructDateFrom")](e){return new CN(+new Date(e),this.timeZone)}}function jN(e,t,n){const r=Qx(e,n?.in);return isNaN(t)?Fx(n?.in||e,NaN):t?(r.setDate(r.getDate()+t),r):r}function AN(e,t,n){const r=Qx(e,n?.in);if(isNaN(t))return Fx(n?.in||e,NaN);if(!t)return r;const o=r.getDate(),a=Fx(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),o>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}function TN(e,t,n){const[r,o]=Yx(n?.in,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}function LN(e,t){const[n,r]=Yx(e,t.start,t.end);return{start:n,end:r}}function ON(e,t){const n=Rx(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Qx(e,t?.in),a=o.getDay(),i=6+(a<r?-7:0)-(a-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}function zN(e,t){const n=Qx(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function PN(e,t){return+Qx(e)>+Qx(t)}function RN(e,t){return+Qx(e)<+Qx(t)}function UN(e,t,n){const r=Qx(e,n?.in),o=r.getFullYear(),a=r.getDate(),i=Fx(n?.in||e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=Qx(e,t?.in),r=n.getFullYear(),o=n.getMonth(),a=Fx(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}(i);return r.setMonth(t,Math.min(a,s)),r}function BN(e,t){const n=Qx(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function FN(e,t){const n=t.startOfMonth(e),r=n.getDay();return 1===r?n:0===r?t.addDays(n,-6):t.addDays(n,-1*(r-1))}class QN{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?CN.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new CN(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):jN(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):AN(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return jN(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return AN(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):Wx(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):TN(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e,t){const{start:n,end:r}=LN(t?.in,e);let o=+n>+r;const a=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,o=!o);const l=[];for(;+i<=a;)l.push(Fx(n,i)),i.setMonth(i.getMonth()+s);return o?l.reverse():l}(e),this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):function(e,t){const{start:n,end:r}=LN(t?.in,e);let o=+n>+r;const a=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,o=!o);const l=[];for(;+i<=a;)l.push(Fx(n,i)),i.setFullYear(i.getFullYear()+s);return o?l.reverse():l}(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;const r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):function(e,t){const n=FN(e,t),r=function(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,1-r),a=t.addDays(o,34);return t.getMonth(e)===t.getMonth(a)?5:4}(e,t);return t.addDays(n,7*r-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return ON(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):zN(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):ON(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=Qx(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t,n)=>{const r=this.overrides?.format?this.overrides.format(e,t,this.options):yN(e,t,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):qx(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return Qx(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return Qx(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):Kx(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):PN(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):RN(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):fN(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t,n){const[r,o]=Yx(n?.in,e,t);return+Zx(r)===+Zx(o)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t,n){const[r,o]=Yx(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t,n){const[r,o]=Yx(n?.in,e,t);return r.getFullYear()===o.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Fx.bind(null,e));const t=Qx(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),Fx(r,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=Fx.bind(null,e));const t=Qx(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),Fx(r,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):UN(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const r=Qx(e,n?.in);return isNaN(+r)?Fx(n?.in||e,NaN):(r.setFullYear(t),r)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):FN(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Zx(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):$x(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):BN(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):Hx(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):Gx(e),this.options={locale:vN,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&QN.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:r}=this.options,o=t?.code;if(o&&QN.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:n,numberingSystem:r}).format(e)}catch{}const a="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(e,a)}}QN.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const VN=new QN;var YN,ZN,WN,GN;function HN(e,t,n=!1,r=VN){let{from:o,to:a}=e;const{differenceInCalendarDays:i,isSameDay:s}=r;return o&&a?(i(a,o)<0&&([o,a]=[a,o]),i(t,o)>=(n?1:0)&&i(a,t)>=(n?1:0)):!n&&a?s(a,t):!(n||!o)&&s(o,t)}function $N(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function XN(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function qN(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function JN(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function KN(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function eE(e,t){return Array.isArray(e)&&e.every(t.isDate)}function tE(e,t,n=VN){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:i}=n;return r.some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return o(e,t);if(eE(t,n))return t.some(t=>o(e,t));if(XN(t))return HN(t,e,!1,n);if(KN(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if($N(t)){const n=a(t.before,e)>0,r=a(t.after,e)<0;return i(t.before,t.after)?r&&n:n||r}return qN(t)?a(e,t.after)>0:JN(t)?a(t.before,e)>0:"function"==typeof t&&t(e)})}function nE(e){return s.createElement("button",{...e})}function rE(e){return s.createElement("span",{...e})}function oE(e){const{size:t=24,orientation:n="left",className:r}=e;return s.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},"up"===n&&s.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===n&&s.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===n&&s.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===n&&s.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function aE(e){const{day:t,modifiers:n,...r}=e;return s.createElement("td",{...r})}function iE(e){const{day:t,modifiers:n,...r}=e,o=s.useRef(null);return s.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),s.createElement("button",{ref:o,...r})}function sE(e){const{options:t,className:n,components:r,classNames:o,...a}=e,i=[o[YN.Dropdown],n].join(" "),l=t?.find(({value:e})=>e===a.value);return s.createElement("span",{"data-disabled":a.disabled,className:o[YN.DropdownRoot]},s.createElement(r.Select,{className:i,...a},t?.map(({value:e,label:t,disabled:n})=>s.createElement(r.Option,{key:e,value:e,disabled:n},t))),s.createElement("span",{className:o[YN.CaptionLabel],"aria-hidden":!0},l?.label,s.createElement(r.Chevron,{orientation:"down",size:18,className:o[YN.Chevron]})))}function lE(e){return s.createElement("div",{...e})}function cE(e){return s.createElement("div",{...e})}function uE(e){const{calendarMonth:t,displayIndex:n,...r}=e;return s.createElement("div",{...r},e.children)}function dE(e){const{calendarMonth:t,displayIndex:n,...r}=e;return s.createElement("div",{...r})}function fE(e){return s.createElement("table",{...e})}function pE(e){return s.createElement("div",{...e})}function mE(e){const{components:t}=Ix();return s.createElement(t.Dropdown,{...e})}function hE(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...a}=e,{components:i,classNames:l,labels:{labelPrevious:c,labelNext:u}}=Ix(),d=(0,s.useCallback)(e=>{o&&n?.(e)},[o,n]),f=(0,s.useCallback)(e=>{r&&t?.(e)},[r,t]);return s.createElement("nav",{...a},s.createElement(i.PreviousMonthButton,{type:"button",className:l[YN.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":c(r),onClick:f},s.createElement(i.Chevron,{disabled:!r||void 0,className:l[YN.Chevron],orientation:"left"})),s.createElement(i.NextMonthButton,{type:"button",className:l[YN.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":!o||void 0,"aria-label":u(o),onClick:d},s.createElement(i.Chevron,{disabled:!o||void 0,orientation:"right",className:l[YN.Chevron]})))}function gE(e){const{components:t}=Ix();return s.createElement(t.Button,{...e})}function wE(e){return s.createElement("option",{...e})}function yE(e){const{components:t}=Ix();return s.createElement(t.Button,{...e})}function bE(e){const{rootRef:t,...n}=e;return s.createElement("div",{...n,ref:t})}function vE(e){return s.createElement("select",{...e})}function xE(e){const{week:t,...n}=e;return s.createElement("tr",{...n})}function NE(e){return s.createElement("th",{...e})}function EE(e){return s.createElement("thead",{"aria-hidden":!0},s.createElement("tr",{...e}))}function _E(e){const{week:t,...n}=e;return s.createElement("th",{...n})}function ME(e){return s.createElement("th",{...e})}function IE(e){return s.createElement("tbody",{...e})}function SE(e){const{components:t}=Ix();return s.createElement(t.Dropdown,{...e})}function kE(){const e={};for(const t in YN)e[YN[t]]=`rdp-${YN[t]}`;for(const t in ZN)e[ZN[t]]=`rdp-${ZN[t]}`;for(const t in WN)e[WN[t]]=`rdp-${WN[t]}`;for(const t in GN)e[GN[t]]=`rdp-${GN[t]}`;return e}function DE(e,t,n){return(n??new QN(t)).formatMonthYear(e)}!function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(YN||(YN={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(ZN||(ZN={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(WN||(WN={})),function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"}(GN||(GN={}));const CE=DE;function jE(e,t,n){return(n??new QN(t)).format(e,"d")}function AE(e,t=VN){return t.format(e,"LLLL")}function TE(e,t,n){return(n??new QN(t)).format(e,"cccccc")}function LE(e,t=VN){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function OE(){return""}function zE(e,t=VN){return t.format(e,"yyyy")}const PE=zE;function RE(e,t,n,r){let o=(r??new QN(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const UE=RE;function BE(e,t,n){return(n??new QN(t)).formatMonthYear(e)}const FE=BE;function QE(e,t,n,r){let o=(r??new QN(n)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o}function VE(e){return"Choose the Month"}function YE(){return""}function ZE(e,t){return"Go to the Next Month"}function WE(e){return"Go to the Previous Month"}function GE(e,t,n){return(n??new QN(t)).format(e,"cccc")}function HE(e,t){return`Week ${e}`}function $E(e){return"Week Number"}function XE(e){return"Choose the Year"}const qE=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function JE(e,t){const n=t.locale?.labels??{};return{...a,...e??{},labelDayButton:qE(RE,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:qE(VE,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:qE(ZE,e?.labelNext,n.labelNext),labelPrevious:qE(WE,e?.labelPrevious,n.labelPrevious),labelWeekNumber:qE(HE,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:qE(XE,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:qE(BE,e?.labelGrid,n.labelGrid),labelGridcell:qE(QE,e?.labelGridcell,n.labelGridcell),labelNav:qE(YE,e?.labelNav,n.labelNav),labelWeekNumberHeader:qE($E,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:qE(GE,e?.labelWeekday,n.labelWeekday)}}function KE(e,t,n,r,o){const{startOfMonth:a,startOfYear:i,endOfYear:s,eachMonthOfInterval:l,getMonth:c}=o;return l({start:i(e),end:s(e)}).map(e=>{const i=r.formatMonthDropdown(e,o);return{value:c(e),label:i,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function e_(e,t,n,r,o=!1){if(!e)return;if(!t)return;const{startOfYear:a,endOfYear:i,eachYearOfInterval:s,getYear:l}=r,c=s({start:a(e),end:i(t)});return o&&c.reverse(),c.map(e=>{const t=n.formatYearDropdown(e,r);return{value:l(e),label:t,disabled:!1}})}const t_=e=>e instanceof HTMLElement?e:null,n_=e=>[...e.querySelectorAll("[data-animated-month]")??[]],r_=e=>t_(e.querySelector("[data-animated-caption]")),o_=e=>t_(e.querySelector("[data-animated-weeks]"));function a_(e,t,n,r){const{month:o,defaultMonth:a,today:i=r.today(),numberOfMonths:s=1}=e;let l=o||a||i;const{differenceInCalendarMonths:c,addMonths:u,startOfMonth:d}=r;return n&&c(n,l)<s-1&&(l=u(n,-1*(s-1))),t&&c(l,t)<0&&(l=t),d(l)}class i_{constructor(e,t,n=VN){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,"yyyy-MM-dd"),this.displayMonthId=n.format(t,"yyyy-MM"),this.dateMonthId=n.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class s_{constructor(e,t){this.days=t,this.weekNumber=e}}class l_{constructor(e,t){this.date=e,this.weeks=t}}function c_(e,t){const[n,r]=(0,s.useState)(e);return[void 0===t?n:t,r]}var u_;function d_(e){return!e[ZN.disabled]&&!e[ZN.hidden]&&!e[ZN.outside]}function f_(e,t,n,r,o,a,i,s=0){if(s>365)return;const l=function(e,t,n,r,o,a,i){const{ISOWeek:s,broadcastCalendar:l}=a,{addDays:c,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:w,startOfBroadcastWeek:y,startOfISOWeek:b,startOfWeek:v}=i,x={day:c,week:d,month:u,year:f,startOfWeek:e=>l?y(e,i):s?b(e):v(e),endOfWeek:e=>l?p(e):s?m(e):h(e)};let N=x[e](n,"after"===t?1:-1);return"before"===t&&r?N=g([r,N]):"after"===t&&o&&(N=w([o,N])),N}(e,t,n.date,r,o,a,i),c=Boolean(a.disabled&&tE(l,a.disabled,i)),u=Boolean(a.hidden&&tE(l,a.hidden,i)),d=new i_(l,l,i);return c||u?f_(e,t,d,r,o,a,i,s+1):d}function p_(e,t,n,r,o){const{autoFocus:a}=e,[i,l]=(0,s.useState)(),c=function(e,t,n,r){let o,a=-1;for(const i of e){const e=t(i);d_(e)&&(e[ZN.focused]&&a<u_.FocusedModifier?(o=i,a=u_.FocusedModifier):r?.isEqualTo(i)&&a<u_.LastFocused?(o=i,a=u_.LastFocused):n(i.date)&&a<u_.Selected?(o=i,a=u_.Selected):e[ZN.today]&&a<u_.Today&&(o=i,a=u_.Today))}return o||(o=e.find(e=>d_(t(e)))),o}(t.days,n,r||(()=>!1),i),[u,d]=(0,s.useState)(a?c:void 0);return{isFocusTarget:e=>Boolean(c?.isEqualTo(e)),setFocused:d,focused:u,blur:()=>{l(u),d(void 0)},moveFocus:(n,r)=>{if(!u)return;const a=f_(n,r,u,t.navStart,t.navEnd,e,o);if(a){if(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(a)))return;t.goToDay(a),d(a)}}}}function m_(e,t,n=VN){return HN(e,t.from,!1,n)||HN(e,t.to,!1,n)||HN(t,e.from,!1,n)||HN(t,e.to,!1,n)}function h_(e,t){const{disabled:n,excludeDisabled:r,resetOnSelect:o,selected:a,required:i,onSelect:s}=e,[l,c]=c_(a,s?a:void 0),u=s?a:l;return{selected:u,select:(a,l,d)=>{const{min:f,max:p}=e;let m;if(a){const e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=!o||!r&&u?.from?function(e,t,n=0,r=0,o=!1,a=VN){const{from:i,to:s}=t||{},{isSameDay:l,isAfter:c,isBefore:u}=a;let d;if(i||s){if(i&&!s)d=l(i,e)?0===n?{from:i,to:e}:o?{from:i,to:void 0}:void 0:u(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&s)if(l(i,e)&&l(s,e))d=o?{from:i,to:s}:void 0;else if(l(i,e))d={from:i,to:n>0?void 0:e};else if(l(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,i))d={from:e,to:s};else if(c(e,i))d={from:i,to:e};else{if(!c(e,s))throw new Error("Invalid range");d={from:i,to:e}}}else d={from:e,to:n>0?void 0:e};if(d?.from&&d?.to){const t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}(a,u,f,p,i,t):!i&&s?void 0:{from:a,to:void 0}}return r&&n&&m?.from&&m.to&&function(e,t,n=VN){const r=Array.isArray(t)?t:[t],o=r.filter(e=>"function"!=typeof e),a=o.some(t=>"boolean"==typeof t?t:n.isDate(t)?HN(e,t,!1,n):eE(t,n)?t.some(t=>HN(e,t,!1,n)):XN(t)?!(!t.from||!t.to)&&m_(e,{from:t.from,to:t.to},n):KN(t)?function(e,t,n=VN){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let e=0;e<=i;e++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}(e,t.dayOfWeek,n):$N(t)?n.isAfter(t.before,t.after)?m_(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):tE(e.from,t,n)||tE(e.to,t,n):!(!qN(t)&&!JN(t))&&(tE(e.from,t,n)||tE(e.to,t,n)));if(a)return!0;const i=r.filter(e=>"function"==typeof e);if(i.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||c(m),s?.(m,a,l,d),m},isSelected:e=>u&&HN(u,e,!1,t)}}function g_(e,t){return e instanceof CN&&e.timeZone===t?e:new CN(e,t)}function w_(e,t,n){if(!n)return g_(e,t);const r=g_(e,t),o=new CN(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(o.getTime())}function y_(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?w_(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?w_(e,t,n):e):XN(e)?{...e,from:e.from?g_(e.from,t):e.from,to:e.to?g_(e.to,t):e.to}:$N(e)?{before:w_(e.before,t,n),after:w_(e.after,t,n)}:qN(e)?{after:w_(e.after,t,n)}:JN(e)?{before:w_(e.before,t,n)}:e}function b_(e,t,n){return e?Array.isArray(e)?e.map(e=>y_(e,t,n)):y_(e,t,n):e}function v_(e){let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=g_(t.today,n)),t.month&&(t.month=g_(t.month,n)),t.defaultMonth&&(t.defaultMonth=g_(t.defaultMonth,n)),t.startMonth&&(t.startMonth=g_(t.startMonth,n)),t.endMonth&&(t.endMonth=g_(t.endMonth,n)),"single"===t.mode&&t.selected?t.selected=g_(t.selected,n):"multiple"===t.mode&&t.selected?t.selected=t.selected?.map(e=>g_(e,n)):"range"===t.mode&&t.selected&&(t.selected={from:t.selected.from?g_(t.selected.from,n):t.selected.from,to:t.selected.to?g_(t.selected.to,n):t.selected.to}),void 0!==t.disabled&&(t.disabled=b_(t.disabled,n)),void 0!==t.hidden&&(t.hidden=b_(t.hidden,n)),t.modifiers)){const e={};Object.keys(t.modifiers).forEach(r=>{e[r]=b_(t.modifiers?.[r],n)}),t.modifiers=e}const{components:a,formatters:i,labels:l,dateLib:c,locale:u,classNames:d}=(0,s.useMemo)(()=>{const e={...vN,...t.locale},n=t.broadcastCalendar?1:t.weekStartsOn,a=t.noonSafe&&t.timeZone?function(e,t={}){const{weekStartsOn:n,locale:r}=t,o=n??r?.options?.weekStartsOn??0,a=t=>{const n="number"==typeof t||"string"==typeof t?new Date(t):t;return new CN(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},i=e=>{const t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(CN.tz(e)),newDate:(t,n,r)=>new CN(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{const n=a(e),r=t?.weekStartsOn??o,i=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-i),n},startOfISOWeek:e=>{const t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{const t=a(e);return t.setDate(1),t},startOfYear:e=>{const t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{const n=a(e),r=(((t?.weekStartsOn??o)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{const t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{const t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{const t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{const n=a(t.start),r=a(t.end),o=[],i=new CN(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=12*r.getFullYear()+r.getMonth();for(;12*i.getFullYear()+i.getMonth()<=s;)o.push(new CN(i,e)),i.setMonth(i.getMonth()+1,1);return o},addDays:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+7*t),n},addMonths:(e,t)=>{const n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{const n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{const n=a(t.start),r=a(t.end),o=[],i=new CN(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=r.getFullYear();)o.push(new CN(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return o},getWeek:(e,t)=>Kx(i(e),{weekStartsOn:t?.weekStartsOn??o,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>qx(i(e)),differenceInCalendarDays:(e,t)=>Wx(i(e),i(t)),differenceInCalendarMonths:(e,t)=>TN(i(e),i(t))}}(t.timeZone,{weekStartsOn:n,locale:e}):void 0,i=t.dateLib&&a?{...a,...t.dateLib}:t.dateLib??a,s=new QN({locale:e,weekStartsOn:n,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},i);return{dateLib:s,components:(c=t.components,{...r,...c}),formatters:(l=t.formatters,l?.formatMonthCaption&&!l.formatCaption&&(l.formatCaption=l.formatMonthCaption),l?.formatYearCaption&&!l.formatYearDropdown&&(l.formatYearDropdown=l.formatYearCaption),{...o,...l}),labels:JE(t.labels,s.options),locale:e,classNames:{...kE(),...t.classNames}};var l,c},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:c.today()});const{captionLayout:f,mode:p,navLayout:m,numberOfMonths:h=1,onDayBlur:g,onDayClick:w,onDayFocus:y,onDayKeyDown:b,onDayMouseEnter:v,onDayMouseLeave:x,onNextClick:N,onPrevClick:E,showWeekNumber:_,styles:M}=t,{formatCaption:I,formatDay:S,formatMonthDropdown:k,formatWeekNumber:D,formatWeekNumberHeader:C,formatWeekdayName:j,formatYearDropdown:A}=i,T=function(e,t){const[n,r]=function(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:i,endOfMonth:s,addYears:l,endOfYear:c,newDate:u,today:d}=t,{fromYear:f,toYear:p,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&p&&(r=u(p,11,31));const g="dropdown"===e.captionLayout||"dropdown-years"===e.captionLayout;return n?n=i(n):f?n=u(f,0,1):!n&&g&&(n=o(l(e.today??d(),-100))),r?r=s(r):p?r=u(p,11,31):!r&&g&&(r=c(e.today??d())),[n?a(n):n,r?a(r):r]}(e,t),{startOfMonth:o,endOfMonth:a}=t,i=a_(e,n,r,t),[l,c]=c_(i,e.month?i:void 0);(0,s.useEffect)(()=>{const o=a_(e,n,r,t);c(o)},[e.timeZone]);const{months:u,weeks:d,days:f,previousMonth:p,nextMonth:m}=(0,s.useMemo)(()=>{const o=function(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let n=0;n<o;n++){const o=r.addMonths(e,n);if(t&&o>t)break;a.push(o)}return a}(l,r,{numberOfMonths:e.numberOfMonths},t),i=function(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:w,startOfISOWeek:y,startOfWeek:b}=r,v=l?w(o,r):i?y(o):b(o),x=l?f(a):i?p(m(a)):h(m(a)),N=t&&(l?f(t):i?p(t):h(t)),E=u(N&&g(x,N)?N:x,v),_=d(a,o)+1,M=[];for(let e=0;e<=E;e++){const t=c(v,e);M.push(t)}const I=(l?35:42)*_;if(s&&M.length<I){const e=I-M.length;for(let t=0;t<e;t++){const e=c(M[M.length-1],1);M.push(e)}}return M}(o,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),s=function(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:s,endOfWeek:l,getISOWeek:c,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{const h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?i(s(m)):l(s(m)),w=t.filter(e=>e>=h&&e<=g),y=n.broadcastCalendar?35:42;if(n.fixedWeeks&&w.length<y){const e=t.filter(e=>{const t=y-w.length;return e>g&&e<=o(g,t)});w.push(...e)}const b=w.reduce((e,t)=>{const o=n.ISOWeek?c(t):u(t),a=e.find(e=>e.weekNumber===o),i=new i_(t,m,r);return a?a.days.push(i):e.push(new s_(o,[i])),e},[]),v=new l_(m,b);return e.push(v),e},[]);return n.reverseMonths?m.reverse():m}(o,i,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),c=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(s),u=function(e){const t=[];return e.reduce((e,n)=>{const r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}(s),d=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=r,c=o?a??1:1,u=i(e);return t&&l(u,t)<=0?void 0:s(u,-c)}(l,n,e,t),f=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=r,c=o?a:1,u=i(e);return t&&l(t,e)<a?void 0:s(u,c)}(l,r,e,t);return{months:s,weeks:c,days:u,previousMonth:d,nextMonth:f}},[t,l.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:h,onMonthChange:g}=e,w=e=>{if(h)return;let t=o(e);n&&t<o(n)&&(t=o(n)),r&&t>o(r)&&(t=o(r)),c(t),g?.(t)},y={months:u,weeks:d,days:f,navStart:n,navEnd:r,previousMonth:p,nextMonth:m,goToMonth:w,goToDay:e=>{(e=>d.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||w(e.date)}};return y}(t,c),{days:L,months:O,navStart:z,navEnd:P,previousMonth:R,nextMonth:U,goToMonth:B}=T,F=function(e,t,n,r,o){const{disabled:a,hidden:i,modifiers:s,showOutsideDays:l,broadcastCalendar:c,today:u=o.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=o,w=n&&p(n),y=r&&h(r),b={[ZN.focused]:[],[ZN.outside]:[],[ZN.disabled]:[],[ZN.hidden]:[],[ZN.today]:[]},v={};for(const t of e){const{date:e,displayMonth:n}=t,r=Boolean(n&&!f(e,n)),p=Boolean(w&&m(e,w)),h=Boolean(y&&g(e,y)),x=Boolean(a&&tE(e,a,o)),N=Boolean(i&&tE(e,i,o))||p||h||!c&&!l&&r||c&&!1===l&&r,E=d(e,u);r&&b.outside.push(t),x&&b.disabled.push(t),N&&b.hidden.push(t),E&&b.today.push(t),s&&Object.keys(s).forEach(n=>{const r=s?.[n];r&&tE(e,r,o)&&(v[n]?v[n].push(t):v[n]=[t])})}return e=>{const t={[ZN.focused]:!1,[ZN.disabled]:!1,[ZN.hidden]:!1,[ZN.outside]:!1,[ZN.today]:!1},n={};for(const n in b){const r=b[n];t[n]=r.some(t=>t===e)}for(const t in v)n[t]=v[t].some(t=>t===e);return{...t,...n}}}(L,t,z,P,c),{isSelected:Q,select:V,selected:Y}=function(e,t){const n=function(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=c_(n,o?n:void 0),s=o?n:a,{isSameDay:l}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&l(e,s)&&(a=void 0),o||i(a),o?.(a,e,t,n),a},isSelected:e=>!!s&&l(s,e)}}(e,t),r=function(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=c_(n,o?n:void 0),s=o?n:a,{isSameDay:l}=t,c=e=>s?.some(t=>l(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(c(e)){if(s?.length===u)return;if(r&&1===s?.length)return;a=s?.filter(t=>!l(t,e))}else a=s?.length===d?[e]:[...a,e];return o||i(a),o?.(a,e,t,n),a},isSelected:c}}(e,t),o=h_(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}(t,c)??{},{blur:Z,focused:W,isFocusTarget:G,moveFocus:H,setFocused:$}=p_(t,T,F,Q??(()=>!1),c),{labelDayButton:X,labelGridcell:q,labelGrid:J,labelMonthDropdown:K,labelNav:ee,labelPrevious:te,labelNext:ne,labelWeekday:re,labelWeekNumber:oe,labelWeekNumberHeader:ae,labelYearDropdown:ie}=l,se=(0,s.useMemo)(()=>function(e,t,n,r){const o=r??e.today(),a=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),i=[];for(let t=0;t<7;t++){const n=e.addDays(a,t);i.push(n)}return i}(c,t.ISOWeek,t.broadcastCalendar,t.today),[c,t.ISOWeek,t.broadcastCalendar,t.today]),le=void 0!==p||void 0!==w,ce=(0,s.useCallback)(()=>{R&&(B(R),E?.(R))},[R,B,E]),ue=(0,s.useCallback)(()=>{U&&(B(U),N?.(U))},[B,U,N]),de=(0,s.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),$(e),t.disabled||(V?.(e.date,t,n),w?.(e.date,t,n))},[V,w,$]),fe=(0,s.useCallback)((e,t)=>n=>{$(e),y?.(e.date,t,n)},[y,$]),pe=(0,s.useCallback)((e,t)=>n=>{Z(),g?.(e.date,t,n)},[Z,g]),me=(0,s.useCallback)((e,n)=>r=>{const o={ArrowLeft:[r.shiftKey?"month":"day","rtl"===t.dir?"after":"before"],ArrowRight:[r.shiftKey?"month":"day","rtl"===t.dir?"before":"after"],ArrowDown:[r.shiftKey?"year":"week","after"],ArrowUp:[r.shiftKey?"year":"week","before"],PageUp:[r.shiftKey?"year":"month","before"],PageDown:[r.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(o[r.key]){r.preventDefault(),r.stopPropagation();const[e,t]=o[r.key];H(e,t)}b?.(e.date,n,r)},[H,b,t.dir]),he=(0,s.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),ge=(0,s.useCallback)((e,t)=>n=>{x?.(e.date,t,n)},[x]),we=(0,s.useCallback)(e=>t=>{const n=Number(t.target.value),r=c.setMonth(c.startOfMonth(e),n);B(r)},[c,B]),ye=(0,s.useCallback)(e=>t=>{const n=Number(t.target.value),r=c.setYear(c.startOfMonth(e),n);B(r)},[c,B]),{className:be,style:ve}=(0,s.useMemo)(()=>({className:[d[YN.Root],t.className].filter(Boolean).join(" "),style:{...M?.[YN.Root],...t.style}}),[d,t.className,t.style,M]),xe=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith("data-")&&(t[e]=n)}),t}(t),Ne=(0,s.useRef)(null);!function(e,t,{classNames:n,months:r,focused:o,dateLib:a}){const i=(0,s.useRef)(null),l=(0,s.useRef)(r),c=(0,s.useRef)(!1);(0,s.useLayoutEffect)(()=>{const s=l.current;if(l.current=r,!(t&&e.current&&e.current instanceof HTMLElement&&0!==r.length&&0!==s.length&&r.length===s.length))return;const u=a.isSameMonth(r[0].date,s[0].date),d=a.isAfter(r[0].date,s[0].date),f=d?n[GN.caption_after_enter]:n[GN.caption_before_enter],p=d?n[GN.weeks_after_enter]:n[GN.weeks_before_enter],m=i.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(n_(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=t_(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=r_(e);n&&n.classList.remove(f);const r=o_(e);r&&r.classList.remove(p)}),i.current=h):i.current=null,c.current||u||o)return;const g=m instanceof HTMLElement?n_(m):[],w=n_(e.current);if(w?.every(e=>e instanceof HTMLElement)&&g&&g.every(e=>e instanceof HTMLElement)){c.current=!0;const t=[];e.current.style.isolation="isolate";const r=(y=e.current,t_(y.querySelector("[data-animated-nav]")));r&&(r.style.zIndex="1"),w.forEach((o,a)=>{const i=g[a];if(!i)return;o.style.position="relative",o.style.overflow="hidden";const s=r_(o);s&&s.classList.add(f);const l=o_(o);l&&l.classList.add(p);const u=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),r&&(r.style.zIndex=""),s&&s.classList.remove(f),l&&l.classList.remove(p),o.style.position="",o.style.overflow="",o.contains(i)&&o.removeChild(i)};t.push(u),i.style.pointerEvents="none",i.style.position="absolute",i.style.overflow="hidden",i.setAttribute("aria-hidden","true");const m=(e=>t_(e.querySelector("[data-animated-weekdays]")))(i);m&&(m.style.opacity="0");const h=r_(i);h&&(h.classList.add(d?n[GN.caption_before_exit]:n[GN.caption_after_exit]),h.addEventListener("animationend",u));const w=o_(i);w&&w.classList.add(d?n[GN.weeks_before_exit]:n[GN.weeks_after_exit]),o.insertBefore(i,o.firstChild)})}var y})}(Ne,Boolean(t.animate),{classNames:d,months:O,focused:W,dateLib:c});const Ee={dayPickerProps:t,selected:Y,select:V,isSelected:Q,months:O,nextMonth:U,previousMonth:R,goToMonth:B,getModifiers:F,components:a,classNames:d,styles:M,labels:l,formatters:i};return s.createElement(Mx.Provider,{value:Ee},s.createElement(a.Root,{rootRef:t.animate?Ne:void 0,className:be,style:ve,dir:t.dir,id:t.id,lang:t.lang??u.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...xe},s.createElement(a.Months,{className:d[YN.Months],style:M?.[YN.Months]},!t.hideNavigation&&!m&&s.createElement(a.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[YN.Nav],style:M?.[YN.Nav],"aria-label":ee(),onPreviousClick:ce,onNextClick:ue,previousMonth:R,nextMonth:U}),O.map((e,n)=>s.createElement(a.Month,{"data-animated-month":t.animate?"true":void 0,className:d[YN.Month],style:M?.[YN.Month],key:n,displayIndex:n,calendarMonth:e},"around"===m&&!t.hideNavigation&&0===n&&s.createElement(a.PreviousMonthButton,{type:"button",className:d[YN.PreviousMonthButton],tabIndex:R?void 0:-1,"aria-disabled":!R||void 0,"aria-label":te(R),onClick:ce,"data-animated-button":t.animate?"true":void 0},s.createElement(a.Chevron,{disabled:!R||void 0,className:d[YN.Chevron],orientation:"rtl"===t.dir?"right":"left"})),s.createElement(a.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:d[YN.MonthCaption],style:M?.[YN.MonthCaption],calendarMonth:e,displayIndex:n},f?.startsWith("dropdown")?s.createElement(a.DropdownNav,{className:d[YN.Dropdowns],style:M?.[YN.Dropdowns]},(()=>{const n="dropdown"===f||"dropdown-months"===f?s.createElement(a.MonthsDropdown,{key:"month",className:d[YN.MonthsDropdown],"aria-label":K(),classNames:d,components:a,disabled:Boolean(t.disableNavigation),onChange:we(e.date),options:KE(e.date,z,P,i,c),style:M?.[YN.Dropdown],value:c.getMonth(e.date)}):s.createElement("span",{key:"month"},k(e.date,c)),r="dropdown"===f||"dropdown-years"===f?s.createElement(a.YearsDropdown,{key:"year",className:d[YN.YearsDropdown],"aria-label":ie(c.options),classNames:d,components:a,disabled:Boolean(t.disableNavigation),onChange:ye(e.date),options:e_(z,P,i,c,Boolean(t.reverseYears)),style:M?.[YN.Dropdown],value:c.getYear(e.date)}):s.createElement("span",{key:"year"},A(e.date,c));return"year-first"===c.getMonthYearOrder()?[r,n]:[n,r]})(),s.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},I(e.date,c.options,c))):s.createElement(a.CaptionLabel,{className:d[YN.CaptionLabel],role:"status","aria-live":"polite"},I(e.date,c.options,c))),"around"===m&&!t.hideNavigation&&n===h-1&&s.createElement(a.NextMonthButton,{type:"button",className:d[YN.NextMonthButton],tabIndex:U?void 0:-1,"aria-disabled":!U||void 0,"aria-label":ne(U),onClick:ue,"data-animated-button":t.animate?"true":void 0},s.createElement(a.Chevron,{disabled:!U||void 0,className:d[YN.Chevron],orientation:"rtl"===t.dir?"left":"right"})),n===h-1&&"after"===m&&!t.hideNavigation&&s.createElement(a.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[YN.Nav],style:M?.[YN.Nav],"aria-label":ee(),onPreviousClick:ce,onNextClick:ue,previousMonth:R,nextMonth:U}),s.createElement(a.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===p||"range"===p,"aria-label":J(e.date,c.options,c)||void 0,className:d[YN.MonthGrid],style:M?.[YN.MonthGrid]},!t.hideWeekdays&&s.createElement(a.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:d[YN.Weekdays],style:M?.[YN.Weekdays]},_&&s.createElement(a.WeekNumberHeader,{"aria-label":ae(c.options),className:d[YN.WeekNumberHeader],style:M?.[YN.WeekNumberHeader],scope:"col"},C()),se.map(e=>s.createElement(a.Weekday,{"aria-label":re(e,c.options,c),className:d[YN.Weekday],key:String(e),style:M?.[YN.Weekday],scope:"col"},j(e,c.options,c)))),s.createElement(a.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[YN.Weeks],style:M?.[YN.Weeks]},e.weeks.map(e=>s.createElement(a.Week,{className:d[YN.Week],key:e.weekNumber,style:M?.[YN.Week],week:e},_&&s.createElement(a.WeekNumber,{week:e,style:M?.[YN.WeekNumber],"aria-label":oe(e.weekNumber,{locale:u}),className:d[YN.WeekNumber],scope:"row",role:"rowheader"},D(e.weekNumber,c)),e.days.map(e=>{const{date:n}=e,r=F(e);if(r[ZN.focused]=!r.hidden&&Boolean(W?.isEqualTo(e)),r[WN.selected]=Q?.(n)||r.selected,XN(Y)){const{from:e,to:t}=Y;r[WN.range_start]=Boolean(e&&t&&c.isSameDay(n,e)),r[WN.range_end]=Boolean(e&&t&&c.isSameDay(n,t)),r[WN.range_middle]=HN(Y,n,!0,c)}const o=function(e,t={},n={}){let r={...t?.[YN.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{r={...r,...n?.[e]}}),r}(r,M,t.modifiersStyles),i=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[r])=>(n[r]?e.push(n[r]):t[ZN[r]]?e.push(t[ZN[r]]):t[WN[r]]&&e.push(t[WN[r]]),e),[t[YN.Day]])}(r,d,t.modifiersClassNames),l=le||r.hidden?void 0:q(n,r,c.options,c);return s.createElement(a.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:r,className:i.join(" "),style:o,role:"gridcell","aria-selected":r.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":r.selected||void 0,"data-disabled":r.disabled||void 0,"data-hidden":r.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":r.focused||void 0,"data-today":r.today||void 0},!r.hidden&&le?s.createElement(a.DayButton,{className:d[YN.DayButton],style:M?.[YN.DayButton],type:"button",day:e,modifiers:r,disabled:!r.focused&&r.disabled||void 0,"aria-disabled":r.focused&&r.disabled||void 0,tabIndex:G(e)?0:-1,"aria-label":X(n,r,c.options,c),onClick:de(e,r),onBlur:pe(e,r),onFocus:fe(e,r),onKeyDown:me(e,r),onMouseEnter:he(e,r),onMouseLeave:ge(e,r)},S(n,c.options,c)):!r.hidden&&S(e.date,c.options,c))})))))))),t.footer&&s.createElement(a.Footer,{className:d[YN.Footer],style:M?.[YN.Footer],role:"status","aria-live":"polite"},t.footer)))}function x_(e,t){return+Qx(e)===+Qx(t)}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(u_||(u_={}));const N_=()=>(0,j.jsx)("span",{className:"bg-icon-interactive h-1 w-1 absolute rounded-full inline-block bottom-0 left-1/2 right-1/2"}),E_=e=>yN(e,"E").slice(0,1),M_=(e,t=24)=>Array.from({length:t},(t,n)=>e+n),I_=e=>"multiple"===e?[]:"range"===e?{from:void 0,to:void 0}:void 0,S_=({width:e,className:t,classNames:n,selectedDates:r,setSelectedDates:o,showOutsideDays:a=!0,mode:i="single",variant:l="normal",alignment:c="horizontal",numberOfMonths:u,disabled:d,...f})=>{const p=s.isValidElement(f.footer)||"function"==typeof f.footer,[m,h]=(0,s.useState)(!1),[g,w]=(0,s.useState)(!1),[y,b]=(0,s.useState)((new Date).getFullYear()),[v,x]=(0,s.useState)(y-y%24);void 0===r&&(r="multiple"===i?[]:"range"===i?{from:void 0,to:void 0}:void 0);const N=({weekdays:e})=>(0,j.jsx)("div",{className:"flex justify-between",children:e.map((e,t)=>(0,j.jsx)("button",{className:"h-10 w-10 px-1.5 py-2 text-center text-text-secondary text-sm font-normal content-center bg-transparent border-none shrink-0",children:e},t))}),E=e=>(0,j.jsx)("div",{className:"flex flex-col bsf-force-ui-month-weeks",children:e.children[1].props.children.map((e,t)=>(0,j.jsx)("div",{className:"flex flex-row justify-between",children:e},t))}),_=Se("relative bg-background-primary shadow-datepicker-wrapper",e,"vertical"===c?"flex flex-col":"flex flex-row gap-3","normal"===l?"rounded-tr-md rounded-tl-md border border-solid border-border-subtle":"","presets"===l?"rounded-tr-md border border-solid border-border-subtle":"","dualdate"===l?"rounded-tr-md rounded-tl-md border border-solid border-border-subtle":"",p?"rounded-b-none":"rounded-bl-md rounded-br-md");return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(v_,{mode:i,selected:r,onSelect:(e,t)=>{if("range"===i){const n=r;if(!n?.from&&!n?.to||n?.from&&n?.to)return n.from&&x_(t,n?.from)||n.to&&x_(t,n?.to)?void o({from:void 0,to:void 0}):void o({from:t,to:void 0});if(n?.from&&!n?.to)return t<n.from?void o({from:t,to:n.from}):void o({from:n.from,to:t});o(e)}else"multiple"===i?r.some(e=>yN(e,"yyyy-MM-dd")===yN(t,"yyyy-MM-dd"))?o(r.filter(e=>yN(e,"yyyy-MM-dd")!==yN(t,"yyyy-MM-dd"))):o([...r,t]):"single"===i&&o(e)},hideNavigation:!0,captionLayout:"label",className:Se(t),formatters:{formatWeekdayName:E_},classNames:{months:_,month:"flex flex-col p-2 gap-1 text-center w-full",caption:"relative flex justify-center items-center",table:"w-full border-separate border-spacing-0",head_row:"flex mb-1",head_cell:"text-muted-foreground rounded-md w-10 font-normal text-sm",row:"flex w-full mt-2",cell:"h-10 w-10 text-center text-sm p-0 relative",...n},numberOfMonths:u,showOutsideDays:!0,components:{MonthCaption:function(e){const{goToMonth:t,nextMonth:n,previousMonth:r}=Ix(),o=yN(e.calendarMonth.date,"yyyy"),a=yN(e.calendarMonth.date,"MMMM"),i=new Date(e.calendarMonth.date);i.setDate(i.getDate()-i.getDay());const s=Array.from({length:7},(e,t)=>{const n=new Date(i);return n.setDate(i.getDate()+t),E_(n)});let l;return l=g?`${v} - ${v+23}`:m?o:`${a} ${o}`,(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"flex justify-between",children:[(0,j.jsx)(Ro,{variant:"ghost",onClick:()=>{if(g)x(v-24);else if(m){const n=new Date(y-1,e.calendarMonth.date.getMonth());b(n.getFullYear()),t(n)}else t(r)},className:"bg-background-primary border-none cursor-pointer","aria-label":"Previous Button",icon:(0,j.jsx)(Nx,{className:"h-4 w-4 text-button-tertiary-color"})}),(0,j.jsx)(Ro,{variant:"ghost",onClick:()=>{u>1||(m?(w(!0),h(!1)):g?w(!1):h(!m))},children:l}),(0,j.jsx)(Ro,{variant:"ghost",onClick:()=>{if(g)x(v+24);else if(m){const n=new Date(y+1,e.calendarMonth.date.getMonth());b(n.getFullYear()),t(n)}else t(n)},className:"bg-background-primary border-none cursor-pointer","aria-label":"Next Button",icon:(0,j.jsx)(Ex,{className:"h-4 w-4 text-button-tertiary-color"})})]}),g&&(0,j.jsx)("div",{className:"grid grid-cols-4 w-full",children:M_(v).map(n=>(0,j.jsxs)(Ro,{variant:"ghost",onClick:()=>(n=>{b(n),w(!1),h(!0),t(new Date(n,e.calendarMonth.date.getMonth()))})(n),className:Se("h-10 w-full text-center font-normal relative",n===y&&n!==(new Date).getFullYear()&&"bg-background-brand text-text-on-color hover:bg-background-brand hover:text-black",n===(new Date).getFullYear()&&"font-semibold"),children:[n,n===(new Date).getFullYear()&&N_()]},n))}),m&&!g&&(0,j.jsx)("div",{className:"grid grid-cols-4 gap-2 my-12",children:Array.from({length:12},(n,r)=>(0,j.jsxs)(Ro,{variant:"ghost",onClick:()=>{h(!1),t(new Date(y,r))},className:Se("px-1.5 py-2 h-10 w-[4.375rem] text-center font-normal relative",r===e.calendarMonth.date.getMonth()&&r!==(new Date).getMonth()&&y===e.calendarMonth.date.getFullYear()&&e.calendarMonth.date.getFullYear()!==(new Date).getFullYear()&&"bg-background-brand text-text-on-color hover:bg-background-brand hover:text-black",r===(new Date).getMonth()&&(new Date).getFullYear()===y&&"font-semibold"),children:[yN(new Date(0,r),"MMM"),(new Date).getMonth()===r&&(new Date).getFullYear()===y&&N_()]},r))}),!m&&!g&&(0,j.jsx)(N,{weekdays:s})]})},DayButton:({day:e,modifiers:t,...n})=>{const{selected:o,today:i,disabled:s,outside:l,range_middle:c,range_start:u,range_end:d}=t,f=u||d||c,p=new Date,m=r?.to,h=yN(e.displayMonth,"yyyy-MM")===yN(p,"yyyy-MM"),g=m&&yN(m,"yyyy-MM")===yN(e.date,"yyyy-MM"),w=function(e,t,n){return AN(e,-t,n)}(p,1),y=yN(e.date,"yyyy-MM")===yN(w,"yyyy-MM"),b=h||g||f,v=!a&&l,x=Se("h-10 w-10 flex items-center justify-center transition text-text-secondary relative text-sm","border-none rounded",!o&&!f||l?"bg-transparent hover:bg-button-tertiary-hover":"bg-background-brand text-text-on-color",c&&b&&!l?"bg-brand-background-50 text-text-secondary rounded-none":"",s?"opacity-50 cursor-not-allowed text-text-disabled":"cursor-pointer",l&&!f||!b&&l||l&&!y||l?"bg-transparent opacity-50 text-text-disabled cursor-auto":"");return(0,j.jsxs)("button",{className:Se(x,i&&"font-semibold",v&&"opacity-0",u&&"fui-range-start",d&&"fui-range-end",c&&"fui-range-middle",{"[&:is([data-hover=true])]:bg-brand-background-50 [&:is([data-hover=true])]:rounded-none":!f&&!o}),disabled:s||l,onClick:e=>{"function"==typeof n.onClick&&n.onClick(e)},onMouseEnter:e=>{"function"==typeof n.onMouseEnter&&n.onMouseEnter(e),e.currentTarget.setAttribute("data-hover","true")},onMouseLeave:e=>{"function"==typeof n.onMouseLeave&&n.onMouseLeave(e),e.currentTarget.setAttribute("data-hover","false")},"aria-label":yN(e.date,"EEEE, MMMM do, yyyy"),"data-selected":o,"data-day":yN(e.date,"yyyy-MM-dd"),children:[n.children,i&&b&&(0,j.jsx)("span",{className:"absolute h-1 w-1 bg-background-brand rounded-full bottom-1"})]})},Day:e=>{const t=Object.entries(e).reduce((e,[t,n])=>(t.startsWith("data-")&&(e[t]=n),e),{});return(0,j.jsx)("div",{...t,className:Se(e.className,"inline-flex"),children:e.children})},Weekdays:()=>(0,j.jsx)(j.Fragment,{}),Week:e=>(0,j.jsx)("div",{className:Se("bsf-force-ui-month-week flex flex-row",e.className),children:e.children}),Months:e=>(0,j.jsx)(j.Fragment,{children:(0,j.jsx)("div",{className:Se("bsf-force-ui-date-picker-month",_),children:e?.children?.map((e,t)=>e?(0,j.jsx)(s.Fragment,{children:e.map((e,t)=>(0,j.jsxs)(s.Fragment,{children:[t>0&&(0,j.jsx)("div",{className:"border border-solid border-border-subtle border-l-0"}),e]},t))},t):null)})}),MonthGrid:e=>m||g?(0,j.jsx)(j.Fragment,{}):(0,j.jsx)(E,{...e})},..."range"===i?{required:!1}:{},...f,onDayMouseEnter:(e,t,n)=>{if("range"!==i)return;const o=r;if(o?.from&&o?.to||!o?.from&&!o?.to)return void Array.from(document.querySelectorAll("[data-hover]")).forEach(e=>{e.setAttribute("data-hover","false")});const a=n.target,s=new Date(a.dataset.day),c=RN(s,o.from),u=PN(s,o.to);let d;switch(l){case"dualdate":case"presets":d=a.closest(".bsf-force-ui-date-picker-month");break;default:d=a.closest(".bsf-force-ui-month-weeks")}const f=Array.from(d.querySelectorAll("button"));u&&f.sort((e,t)=>PN(new Date(e.dataset.day),new Date(t.dataset.day))?-1:1),c&&f.sort((e,t)=>RN(new Date(e.dataset.day),new Date(t.dataset.day))?1:-1);const p=f.indexOf(a),m=f.findIndex(e=>"true"===e.getAttribute("data-selected")),h=[],g=Math.min(p,m),w=Math.max(p,m);for(let e=g;e<=w;e++)f[e]?.disabled||h.push(f[e]);f.forEach(e=>{e.setAttribute("data-hover",h.includes(e)?"true":"false")})},disabled:d})})};function k_(e){return Zx(Date.now(),e)}function D_(e){return Fx(e,Date.now())}function C_(e){const t=D_(e?.in),n=t.getFullYear(),r=t.getMonth(),o=t.getDate(),a=D_(e?.in);return a.setFullYear(n,r,o-1),a.setHours(0,0,0,0),a}function j_(e,t,n){return jN(e,-t,n)}const A_=({selectionType:e="single",variant:t="normal",presets:n=[],onCancel:r,onApply:o,onDateSelect:a,applyButtonText:i="Apply",cancelButtonText:l="Cancel",showOutsideDays:c=!0,isFooter:u=!0,selected:d,disabled:f,...p})=>{const[m,h]=(0,s.useState)(()=>{if(!d)return I_(e);const t="multiple"===e&&Array.isArray(d),n="single"===e&&d instanceof Date;return t||"range"===e&&"from"in d&&"to"in d||n?d:I_(e)}),g=e=>{h(e),a&&a(e)},w=[{label:"Today",range:{from:k_(),to:k_()}},{label:"Yesterday",range:{from:C_(),to:C_()}},{label:"This Week",range:{from:Hx(new Date,{weekStartsOn:1}),to:ON(new Date,{weekStartsOn:1})}},{label:"Last 7 Days",range:{from:Zx(j_(new Date,6)),to:Zx(new Date)}},{label:"This Month",range:{from:BN(new Date),to:zN(new Date)}},{label:"Last 30 Days",range:{from:Zx(j_(new Date,29)),to:Zx(new Date)}}],y=n.length>0?n:w,b=()=>{h("multiple"===e?[]:{from:void 0,to:void 0}),r&&r()},v=()=>{o&&o(m)};return"normal"===t?(0,j.jsx)(S_,{...p,mode:e,variant:t,width:"w-[18.5rem]",selectedDates:m,showOutsideDays:c,setSelectedDates:g,footer:u&&(0,j.jsxs)("div",{className:"flex bg-background-primary justify-end p-2 gap-3 border border-solid border-border-subtle border-t-0 rounded-md rounded-tl-none rounded-tr-none",children:[(0,j.jsx)(Ro,{variant:"outline",onClick:b,children:l}),(0,j.jsx)(Ro,{onClick:v,children:i})]}),disabled:f}):"dualdate"===t?(0,j.jsx)(S_,{mode:e,numberOfMonths:2,alignment:"horizontal",selectedDates:m,setSelectedDates:g,showOutsideDays:c,variant:t,width:"w-auto",footer:(0,j.jsxs)("div",{className:"flex bg-background-primary justify-end p-2 gap-3 border border-solid border-border-subtle border-t-0 rounded-md rounded-tl-none rounded-tr-none",children:[(0,j.jsx)(Ro,{variant:"outline",onClick:b,children:l}),(0,j.jsx)(Ro,{onClick:v,children:i})]}),disabled:f,...p}):"presets"===t?(0,j.jsxs)("div",{className:"flex flex-row shadow-datepicker-wrapper",children:[(0,j.jsx)("div",{className:"flex flex-col gap-1 p-3 items-start border border-solid border-border-subtle border-r-0 rounded-tl-md rounded-bl-md bg-background-primary",children:y.map((e,t)=>{const n=m&&"from"in m&&"to"in m&&m.from?.getTime()===e.range.from.getTime()&&m.to?.getTime()===e.range.to.getTime();return(0,j.jsx)(Ro,{onClick:()=>(e=>{h(e)})(e.range),variant:"ghost",className:Se("text-left font-medium text-sm text-nowrap w-full",n&&"bg-brand-background-50"),children:e.label},t)})}),(0,j.jsx)(S_,{...p,mode:e,selectedDates:m,setSelectedDates:g,variant:t,showOutsideDays:c,width:"w-auto",numberOfMonths:2,footer:(0,j.jsxs)("div",{className:"flex justify-end p-2 gap-3 border-l border-r border-t-0 border-b border-solid border-border-subtle bg-background-primary rounded-br-md",children:[(0,j.jsx)(Ro,{variant:"outline",onClick:b,children:l}),(0,j.jsx)(Ro,{onClick:v,children:i})]}),disabled:f})]}):void 0};function T_({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))}const L_=s.forwardRef(T_),O_=e=>{if(!e)return null;if(e instanceof Date)return e;if("string"==typeof e&&/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}return new Date(e)},z_=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"mmm dd, yyyy",P_=()=>{const e=new Date,t=new Date(e),n=new Date(e);n.setDate(n.getDate()-1);const r=new Date(e),o=r.getDay(),a=0===o?6:o-1;r.setDate(e.getDate()-a);const i=new Date(r);i.setDate(r.getDate()+6);const s=new Date(r);s.setDate(s.getDate()-7);const l=new Date(s);l.setDate(s.getDate()+6);const c=new Date(e.getFullYear(),e.getMonth(),1),u=new Date(e),d=new Date(e.getFullYear(),e.getMonth()-1,1),f=new Date(e.getFullYear(),e.getMonth(),0);return[{label:(0,C.__)("Today","cartflows"),range:{from:t,to:t}},{label:(0,C.__)("Yesterday","cartflows"),range:{from:n,to:n}},{label:(0,C.__)("This Week","cartflows"),range:{from:r,to:i}},{label:(0,C.__)("Last Week","cartflows"),range:{from:s,to:l}},{label:(0,C.__)("This Month","cartflows"),range:{from:c,to:u}},{label:(0,C.__)("Last Month","cartflows"),range:{from:d,to:f}}]},R_=function(e){const{label:t,value:n,tooltip:r,desc:o,onChangeCB:a,sectionClass:l="",wrapperClass:c="",fieldParentWrapperClass:u="w-full",placeholder:d=(0,C.__)("Select Date Range","cartflows")}=e,[f,p]=(0,s.useState)(!1),m=(0,s.useRef)(null),h=(0,s.useRef)(null),[g,w]=(0,s.useState)({from:O_(n?.startDate),to:O_(n?.endDate)});return(0,s.useEffect)(()=>{w({from:O_(n?.startDate),to:O_(n?.endDate)})},[n?.startDate,n?.endDate]),(0,s.useEffect)(()=>{const e=e=>{h.current&&!h.current.contains(e.target)&&m.current&&!m.current.contains(e.target)&&p(!1)};return f&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[f]),(0,i.createElement)("div",{className:`wcf-field wcf-date-field ${l}`},(0,i.createElement)("div",{className:`wcf-field__data flex items-center gap-2.5 ${c}`},t&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium"},(0,i.createElement)("label",null,t,r&&(0,i.createElement)(dM,{text:r}))),(0,i.createElement)("div",{className:`wcf-field__data--content relative ${u}`},(0,i.createElement)(Ro,{ref:m,icon:(0,i.createElement)(L_,{className:"h-4 w-4 text-text-secondary","aria-hidden":"true"}),iconPosition:"right",size:"sm",tag:"button",type:"button",variant:"outline",className:"whitespace-nowrap text-text-secondary font-normal",onClick:()=>p(e=>!e)},g?.from&&g?.to?`${z_(g.from)} - ${z_(g.to)}`:d),f&&(0,i.createElement)("div",{ref:h,className:"absolute z-[9999] rounded-lg shadow-lg top-full right-0 mt-1 overflow-x-auto"},(0,i.createElement)(A_,{key:"range",applyButtonText:(0,C.__)("Apply","cartflows"),cancelButtonText:(0,C.__)("Cancel","cartflows"),onApply:e=>{w(e),p(!1),a&&a({startDate:e.from,endDate:e.to})},onCancel:()=>{p(!1)},presets:P_(),selected:g,selectionType:"range",showOutsideDays:!0,variant:"presets"})))),o&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},Zm(o)))},U_=To("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),B_=To("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),F_=function(e){var t,n;const{content:r,custom_class:o="",icon:a=""}=e,s=function(e){switch(e){case"info":return{icon:Lo,color:"text-text-secondary"};case"error":return{icon:U_,color:"text-support-error"};case"success":return{icon:B_,color:"text-support-success"};case"warning":return{icon:zo,color:"text-support-warning"};default:return null}}(a),l=null!==(t=s?.icon)&&void 0!==t?t:null,c=null!==(n=s?.color)&&void 0!==n?n:"";return(0,i.createElement)("div",{className:`wcf-field wcf-doc-field ${o}`},r&&(0,i.createElement)("div",{className:"wcf-field__doc-content flex items-center gap-1 text-sm font-normal text-text-primary mt-2 text-left"},l&&(0,i.createElement)(l,{size:16,className:c}),Zm(r)))},Q_=function(e){const{label:t,desc:n,sectionClass:r,descClass:o,labelClass:a=""}=e,s=r&&""!==r?r:"text-left",l=""!==a?a:"block text-base font-medium text-text-primary mb-5",c=""!==o?o:"text-sm font-normal text-text-secondary mt-2";return(0,i.createElement)("div",{className:`wcf-field wcf-section-heading-field ${s}`},t&&(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",{className:l},t)),n&&(0,i.createElement)("div",{className:`wcf-field__desc ${c}`},Zm(n)))},V_=function(e){const{notice:t="",feature:n="this",plan_required:r="pro"}=e;return""!==t?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-pro-notice"},(0,i.createElement)("p",{className:"wcf-pro-update-notice"},Zm(t)))):wcfCartflowsTypePlusPro()||"pro"===r?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-pro-notice"},(0,i.createElement)("p",{className:"wcf-pro-update-notice"},Zm((0,C.sprintf)(
6 +(0,j.__)("%s Step","cartflows"),e?.slug),o="view"===e.slug?(0,i.createElement)(bg,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}):(0,i.createElement)(xg,{className:"w-5 h-5 stroke-1","aria-hidden":"true"});return(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,i.createElement)("span",{className:"capitalize"},r),placement:"top",key:e?.link},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",tag:"a",href:!n&&"edit"===e.slug||"view"===e.slug?e?.link:"#!",target:"view"===e?.slug?"_blank":void 0,rel:"noreferrer",className:`wcf-step__action-btn [&>svg]:size-5 ${null!==(t=e.class)&&void 0!==t?t:""} ${n?"disabled !text-text-disabled":"text-text-secondary"}`,icon:o}))}),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Open Settings","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",tag:_,to:{pathname:"admin.php",search:"storeCheckout"===v?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${o}&step_id=${s}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${o}&step_id=${s}`},className:"wcf-step__action-btn [&>svg]:size-5 text-text-secondary hover:text-brand-brand-600",icon:(0,i.createElement)(Ig,{className:"w-5 h-5 stroke-1","aria-hidden":"true"})})),(0,i.createElement)(Bh,{id:w,control_id:a,onClickEvents:{clone:async function(e){if(e.preventDefault(),!wcfCartflowsPro())return null;if(await A({title:(0,j.__)("Duplicate Step","cartflows"),description:(0,j.__)("Do you want to duplicate this step? Are you sure?","cartflows"),actionBtnText:(0,j.__)("Duplicate","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")})){M(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.clone_step_nonce;const r=new window.FormData;"cartflows_clone_ab_test_step"===t&&(n=cartflows_admin.wcf_clone_ab_test_step_nonce,r.append("control_id",a)),r.append("action",t),r.append("security",n),r.append("step_id",w),r.append("post_id",o),window.wcfAction="cloneStep",(0,Eg.$h)(Ep()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{Wm.success((0,j.__)("Step cloned successfully!","cartflows")),window.location.reload(),M(!1)}))}},delete:async function(e){if(e.preventDefault(),await A({title:(0,j.__)("Delete Step","cartflows"),description:(0,j.__)("Do you want to delete this step? Are you sure?","cartflows"),actionBtnText:(0,j.__)("Delete","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")})){M(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.delete_step_nonce;const r=new window.FormData;"cartflows_delete_ab_test_step"===t&&(n=cartflows_admin.wcf_delete_ab_test_step_nonce,r.append("control_id",a)),r.append("action",t),r.append("security",n),r.append("step_id",w),r.append("post_id",o),window.wcfAction="deleteStep",(0,Eg.$h)(Ep()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{Wm.success((0,j.__)("Step deleted successfully!","cartflows")),window.location.reload(),M(!1)}))}},abtest:O.abtest||z,winner:O.winner||z,archived:O.archived||z,automation:()=>{T.push({pathname:"admin.php",search:"storeCheckout"===v?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${o}&automation=${s}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${o}&automation=${s}`})}},is_cf_pro:n,actions:d,type:c,setUpgradePopupFeature:h})))))))},Dg=To("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),jg=To("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),kg=window.wp.compose,Cg=window.wp.data,Ag=(0,kg.compose)((0,Cg.withDispatch)(e=>{const{updateCFProStatus:t}=e("wcf/importer");return{updateCFProStatus(e){t(e)}}}))(({title:e,updateCFProStatus:t,size:n="md"})=>{const r=e||(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
7 +(0,j.__)("Activate %s","cartflows"),cartflows_admin.cf_pro_type_inactive),[o,a]=(0,i.useState)({isProcessing:!1,buttonText:r}),{isProcessing:s,buttonText:l}=o;return(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(Ro,{variant:"primary",size:n,loading:s,disabled:s,onClick:e=>{e.preventDefault(),a({isProcessing:!0,buttonText:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
8 +(0,j.__)("Activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}),_p({slug:"cartflows-pro",init:"cartflows-pro/cartflows-pro.php",name:"cartflows-pro"}).then(()=>{a({isProcessing:!1,buttonText:(0,j.__)("Successfully Activated!","cartflows")}),setTimeout(()=>{t("active")},3e3)}).catch(()=>{a({isProcessing:!1,buttonText:(0,j.__)("Failed! Activation!","cartflows")})})}},l)))}),Tg=({buttonLink:e,title:t,buttonStyle:n="primary",size:r="md"})=>{const o=t||(0,j.__)("Upgrade to CartFlows Pro","cartflows"),a=e?.buttonLink||getUpgradeToProUrl();return(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(Ro,{tag:"a",href:a,target:"_blank",rel:"noreferrer",variant:n,size:r,className:"no-underline inline-flex items-center justify-center"},o)))};function Lg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const Og=p.forwardRef(Lg),zg=({title:e})=>{const t=e||"Activate Cartflows Pro License";return(0,i.createElement)(Ro,{tag:"a",href:cartflows_admin?.license_popup_url,rel:"noreferrer",variant:"primary",size:"md",icon:(0,i.createElement)(Og,null),iconPosition:"right",className:"no-underline"},t)},Pg=({buttonLink:e,ctaText:t}={})=>{const[{license_status:n}]=l(),r=t||(0,j.__)("Upgrade to CartFlows Pro","cartflows"),o=new URLSearchParams((0,d.useLocation)().search).get("tab"),a=cartflows_admin.cf_pro_status;return wcfCartflowsTypePro()||"inactive"!==a||"pro"!==wcfInactivepluginType()?wcfCartflowsTypePlusPro()?"Activated"!==n?"analytics"===o?(0,i.createElement)(Tg,{buttonLink:e,title:r}):(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(zg,{title:(0,j.__)("Activate the License","cartflows")}))):null:wcfInactiveProPlus()?(0,i.createElement)(Ag,null):(0,i.createElement)(Tg,{buttonLink:e,title:r}):(0,i.createElement)(Ag,null)},Rg=({title:e,description:t,buttonLink:n,onButtonClick:r,buttonText:o,className:a=""})=>(0,i.createElement)("div",{className:a},(0,i.createElement)(ph,{direction:"row",align:"stretch",gap:"xs",className:"bg-brand-25 border border-solid border-brand-200 rounded-lg p-3 shadow-sm"},(0,i.createElement)(ph,{direction:"row",align:"center",gap:"xs",className:"flex-1"},(0,i.createElement)(ph,{direction:"column",gap:"xs",className:"flex-1"},(0,i.createElement)(vh,{size:14,weight:600,color:"primary",lineHeight:20},e),(0,i.createElement)(vh,{size:14,weight:400,color:"secondary",lineHeight:20},t)),(0,i.createElement)(ph,{align:"center",gap:"xs",className:"shrink-0"},r?(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:r,className:"inline-flex items-center justify-center"},o||(0,j.__)("Upgrade to CartFlows Pro","cartflows")):(0,i.createElement)(Pg,{buttonLink:n}))))),Ug=To("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Bg=To("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),Fg=({feature:e,open:t,setOpen:n})=>{const r={"order-bump":{title:(0,j.__)("Order Bumps","cartflows"),image:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTYwIDE5MCIgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHJlY3Qgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHJ4PSIxMiIgZmlsbD0iI0ZFRjBFOSIvPgogIDxyZWN0IHg9IjExMiIgeT0iMzYiIHdpZHRoPSIxNTAiIGhlaWdodD0iMTE4IiByeD0iOCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjQ1KSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjEuOCIgb3BhY2l0eT0iMC41NSIvPgogIDxyZWN0IHg9IjExMiIgeT0iMzYiIHdpZHRoPSIxNTAiIGhlaWdodD0iMjAiIHJ4PSI4IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjEyIi8+CiAgPHJlY3QgeD0iMTEyIiB5PSI0OCIgd2lkdGg9IjE1MCIgaGVpZ2h0PSI4IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjEyIi8+CiAgPHJlY3QgeD0iMTI0IiB5PSI3MiIgd2lkdGg9IjkyIiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE0Ii8+CiAgPHJlY3QgeD0iMTI0IiB5PSI4NiIgd2lkdGg9IjExMiIgaGVpZ2h0PSI2IiByeD0iMyIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xNCIvPgogIDxyZWN0IHg9IjEyNCIgeT0iMTAwIiB3aWR0aD0iNzIiIGhlaWdodD0iNiIgcng9IjMiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMTQiLz4KICA8bGluZSB4MT0iMTI0IiB5MT0iMTE4IiB4Mj0iMjUwIiB5Mj0iMTE4IiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBvcGFjaXR5PSIwLjE4Ii8+CiAgPHJlY3QgeD0iMTI0IiB5PSIxMjgiIHdpZHRoPSI1OCIgaGVpZ2h0PSI4IiByeD0iNCIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xNiIvPgogIDxyZWN0IHg9IjIwNiIgeT0iMTI2IiB3aWR0aD0iNDQiIGhlaWdodD0iMTIiIHJ4PSI2IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjIiLz4KICA8Y2lyY2xlIGN4PSIyODEiIGN5PSI5NSIgcj0iMTQiIGZpbGw9IiNGMTYzMzQiLz4KICA8cGF0aCBkPSJNMjgxLDg4IEwyODEsMTAyIE0yNzQsOTUgTDI4OCw5NSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyLjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgogIDxyZWN0IHg9IjMwMCIgeT0iNTAiIHdpZHRoPSIxNTIiIGhlaWdodD0iOTAiIHJ4PSI4IiBmaWxsPSIjRkVGMEU5IiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMi4yIi8+CiAgPHJlY3QgeD0iMzE0IiB5PSI2NiIgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiByeD0iNCIgZmlsbD0iI0YxNjMzNCIvPgogIDxwYXRoIGQ9Ik0zMTgsNzUgTDMyMiw3OSBMMzI4LDcwIiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgogIDxyZWN0IHg9IjM0MiIgeT0iNjgiIHdpZHRoPSI4NCIgaGVpZ2h0PSI2IiByeD0iMyIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4zMiIvPgogIDxyZWN0IHg9IjM0MiIgeT0iODAiIHdpZHRoPSI2MCIgaGVpZ2h0PSI2IiByeD0iMyIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4yMiIvPgogIDxyZWN0IHg9IjMxNCIgeT0iOTgiIHdpZHRoPSIyNiIgaGVpZ2h0PSIyNiIgcng9IjUiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMTYiLz4KICA8cmVjdCB4PSIzNTIiIHk9IjEwNCIgd2lkdGg9IjUyIiBoZWlnaHQ9IjE0IiByeD0iNyIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4yOCIvPgo8L3N2Zz4K",description:(0,j.__)("Offer a perfectly matched add-on right on your checkout page. Customers add it to their order in a single click, before they pay.","cartflows"),valueProps:[(0,j.__)("Increase your average order value on every checkout","cartflows"),(0,j.__)("One-click add-ons — no extra pages and no coding","cartflows"),(0,j.__)("Show a relevant offer that complements the main product","cartflows")]},upsell:{title:(0,j.__)("One-Click Upsells","cartflows"),icon:Bg,description:(0,j.__)("Present a one-time offer right after customers pay. They accept in a single click — no need to re-enter their payment details.","cartflows"),valueProps:[(0,j.__)("Add revenue from customers who already bought","cartflows"),(0,j.__)("Frictionless one-click accept — no re-entering card details","cartflows"),(0,j.__)("Create upsell and downsell offers for any funnel","cartflows")]},abtest:{title:(0,j.__)("A/B Testing","cartflows"),image:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTYwIDE5MCIgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHJlY3Qgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHJ4PSIxMiIgZmlsbD0iI0ZFRjBFOSIvPgogIDxjaXJjbGUgY3g9IjI4MCIgY3k9IjEzIiByPSI0IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjU1Ii8+CiAgPGxpbmUgeDE9IjI4MCIgeTE9IjEzIiB4Mj0iMjgwIiB5Mj0iNDAiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIG9wYWNpdHk9IjAuNSIvPgogIDxsaW5lIHgxPSIyODAiIHkxPSI0MCIgeDI9IjE4MiIgeTI9IjUxIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMS44IiBzdHJva2UtbGluZWNhcD0icm91bmQiIG9wYWNpdHk9IjAuNDUiLz4KICA8bGluZSB4MT0iMjgwIiB5MT0iNDAiIHgyPSIzNzgiIHkyPSI1MSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjEuOCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBvcGFjaXR5PSIwLjQ1Ii8+CiAgPGNpcmNsZSBjeD0iMTgyIiBjeT0iNTEiIHI9IjExIiBmaWxsPSIjRkVGMEU5IiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMS44IiBvcGFjaXR5PSIwLjYiLz4KICA8dGV4dCB4PSIxODIiIHk9IjU1LjUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZvbnQtc2l6ZT0iMTEiIGZvbnQtd2VpZ2h0PSI3MDAiIGZpbGw9IiNGMTYzMzQiIGZvbnQtZmFtaWx5PSInSGVsdmV0aWNhIE5ldWUnLEFyaWFsLHNhbnMtc2VyaWYiIG9wYWNpdHk9IjAuNiI+QTwvdGV4dD4KICA8Y2lyY2xlIGN4PSIzNzgiIGN5PSI1MSIgcj0iMTEiIGZpbGw9IiNGRUYwRTkiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxLjgiLz4KICA8dGV4dCB4PSIzNzgiIHk9IjU1LjUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZvbnQtc2l6ZT0iMTEiIGZvbnQtd2VpZ2h0PSI3MDAiIGZpbGw9IiNGMTYzMzQiIGZvbnQtZmFtaWx5PSInSGVsdmV0aWNhIE5ldWUnLEFyaWFsLHNhbnMtc2VyaWYiPkI8L3RleHQ+CiAgPHJlY3QgeD0iMTMyIiB5PSI2NiIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMTQiIHJ4PSI3IiBmaWxsPSJyZ2JhKDI1NSwyNTUsMjU1LDAuNCkiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxLjgiIG9wYWNpdHk9IjAuNSIvPgogIDxyZWN0IHg9IjEzMiIgeT0iNjYiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTgiIHJ4PSI3IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjEyIi8+CiAgPHJlY3QgeD0iMTMyIiB5PSI3NiIgd2lkdGg9IjEwMCIgaGVpZ2h0PSI4IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjEyIi8+CiAgPHJlY3QgeD0iMTQwIiB5PSI5OCIgd2lkdGg9IjY2IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE0Ii8+CiAgPHJlY3QgeD0iMTQwIiB5PSIxMTAiIHdpZHRoPSI3NiIgaGVpZ2h0PSI2IiByeD0iMyIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xNCIvPgogIDxyZWN0IHg9IjE0MCIgeT0iMTIyIiB3aWR0aD0iNTAiIGhlaWdodD0iNiIgcng9IjMiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMTQiLz4KICA8cmVjdCB4PSIxNDciIHk9IjE2MiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjEyIiByeD0iNiIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xNiIvPgogIDxyZWN0IHg9IjMyOCIgeT0iNjYiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTE0IiByeD0iNyIgZmlsbD0iI0ZFRjBFOSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjIuMiIvPgogIDxyZWN0IHg9IjMyOCIgeT0iNjYiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTgiIHJ4PSI3IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjIiLz4KICA8cmVjdCB4PSIzMjgiIHk9Ijc2IiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjgiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMiIvPgogIDxyZWN0IHg9IjMzNiIgeT0iOTgiIHdpZHRoPSI1MCIgaGVpZ2h0PSI2IiByeD0iMyIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4yNSIvPgogIDxyZWN0IHg9IjMzNiIgeT0iMTEwIiB3aWR0aD0iNzYiIGhlaWdodD0iNiIgcng9IjMiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMjUiLz4KICA8cmVjdCB4PSIzMzYiIHk9IjEyMiIgd2lkdGg9IjY2IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjI1Ii8+CiAgPHJlY3QgeD0iMzQzIiB5PSIxNjIiIHdpZHRoPSI2OCIgaGVpZ2h0PSIxMiIgcng9IjYiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMzIiLz4KICA8Y2lyY2xlIGN4PSI0MjgiIGN5PSI2NiIgcj0iMTMiIGZpbGw9IiNGMTYzMzQiLz4KICA8cGF0aCBkPSJNNDIzLDY2IEw0MjYsNzAgTDQzMyw2MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyLjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K",description:(0,j.__)("Test product pricing, page layouts, messaging, and design against each other. CartFlows splits the traffic so you can keep the higher-converting version.","cartflows"),valueProps:[(0,j.__)("Test headlines, layouts, offers, and buttons — no code","cartflows"),(0,j.__)("Split traffic automatically and compare performance","cartflows"),(0,j.__)("Keep the winning variation and grow what works","cartflows")]},duplicate:{title:(0,j.__)("Duplicate Step","cartflows"),image:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTYwIDE5MCIgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHJlY3Qgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHJ4PSIxMiIgZmlsbD0iI0ZFRjBFOSIvPgogIDxyZWN0IHg9IjIwOCIgeT0iMjIiIHdpZHRoPSIxMDIiIGhlaWdodD0iMTM4IiByeD0iOCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjQ1KSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjEuOCIgb3BhY2l0eT0iMC41NSIvPgogIDxyZWN0IHg9IjIwOCIgeT0iMjIiIHdpZHRoPSIxMDIiIGhlaWdodD0iMjAiIHJ4PSI4IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjEzIi8+CiAgPHJlY3QgeD0iMjA4IiB5PSIzNCIgd2lkdGg9IjEwMiIgaGVpZ2h0PSI4IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjEzIi8+CiAgPHJlY3QgeD0iMjE2IiB5PSI1OCIgd2lkdGg9IjY4IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE1Ii8+CiAgPHJlY3QgeD0iMjE2IiB5PSI3MCIgd2lkdGg9Ijc4IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE1Ii8+CiAgPHJlY3QgeD0iMjE2IiB5PSI4MiIgd2lkdGg9IjUyIiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE1Ii8+CiAgPHJlY3QgeD0iMjIyIiB5PSIxMzgiIHdpZHRoPSI3MiIgaGVpZ2h0PSIxMyIgcng9IjYuNSIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xOCIvPgogIDxyZWN0IHg9IjI1MSIgeT0iNDAiIHdpZHRoPSIxMDIiIGhlaWdodD0iMTM4IiByeD0iOCIgZmlsbD0iI0ZFRjBFOSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjIuMiIvPgogIDxyZWN0IHg9IjI1MSIgeT0iNDAiIHdpZHRoPSIxMDIiIGhlaWdodD0iMjAiIHJ4PSI4IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE4Ii8+CiAgPHJlY3QgeD0iMjUxIiB5PSI1MiIgd2lkdGg9IjEwMiIgaGVpZ2h0PSI4IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE4Ii8+CiAgPHJlY3QgeD0iMjU5IiB5PSI3NiIgd2lkdGg9IjY4IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjIyIi8+CiAgPHJlY3QgeD0iMjU5IiB5PSI4OCIgd2lkdGg9Ijc4IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjIyIi8+CiAgPHJlY3QgeD0iMjU5IiB5PSIxMDAiIHdpZHRoPSI1MiIgaGVpZ2h0PSI2IiByeD0iMyIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4yMiIvPgogIDxyZWN0IHg9IjI2NSIgeT0iMTU2IiB3aWR0aD0iNzIiIGhlaWdodD0iMTMiIHJ4PSI2LjUiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMjgiLz4KICA8Y2lyY2xlIGN4PSIyNTEiIGN5PSI0MCIgcj0iMTQiIGZpbGw9IiNGRUYwRTkiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxLjgiLz4KICA8cmVjdCB4PSIyNDYiIHk9IjM0IiB3aWR0aD0iOCIgaGVpZ2h0PSI4IiByeD0iMS41IiBmaWxsPSJub25lIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMS41Ii8+CiAgPHJlY3QgeD0iMjQ5IiB5PSIzNyIgd2lkdGg9IjgiIGhlaWdodD0iOCIgcng9IjEuNSIgZmlsbD0iI0ZFRjBFOSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjEuNSIvPgo8L3N2Zz4K",description:(0,j.__)("Clone any funnel step in a single click — keep its settings, layout, and content, then tweak only what you need.","cartflows"),valueProps:[(0,j.__)("Duplicate any step without rebuilding it from scratch","cartflows"),(0,j.__)("Reuse your best-performing layouts across funnels","cartflows"),(0,j.__)("Save time setting up new steps and variations","cartflows")]},"instant-checkout":{title:(0,j.__)("Instant Checkout","cartflows"),image:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTYwIDE5MCIgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHJlY3Qgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHJ4PSIxMiIgZmlsbD0iI0ZFRjBFOSIvPgogIDxyZWN0IHg9IjkyIiB5PSIzMCIgd2lkdGg9IjE3MCIgaGVpZ2h0PSIxMzAiIHJ4PSI4IiBmaWxsPSJyZ2JhKDI1NSwyNTUsMjU1LDAuNDUpIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMS44IiBvcGFjaXR5PSIwLjU1Ii8+CiAgPHJlY3QgeD0iMTA0IiB5PSI0MiIgd2lkdGg9IjYwIiBoZWlnaHQ9IjYwIiByeD0iNiIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xNCIvPgogIDxyZWN0IHg9IjE3NCIgeT0iNDYiIHdpZHRoPSI3MiIgaGVpZ2h0PSI3IiByeD0iMy41IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjIyIi8+CiAgPHJlY3QgeD0iMTc0IiB5PSI2MCIgd2lkdGg9IjQ0IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE0Ii8+CiAgPHJlY3QgeD0iMTc0IiB5PSI4MCIgd2lkdGg9IjM4IiBoZWlnaHQ9IjgiIHJ4PSI0IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjI4Ii8+CiAgPGxpbmUgeDE9IjEwNCIgeTE9IjExNCIgeDI9IjI1MCIgeTI9IjExNCIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjEiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgb3BhY2l0eT0iMC4xOCIvPgogIDxyZWN0IHg9IjEwNCIgeT0iMTI2IiB3aWR0aD0iNjQiIGhlaWdodD0iMjAiIHJ4PSI1IiBmaWxsPSJub25lIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMS40IiBvcGFjaXR5PSIwLjQiLz4KICA8cmVjdCB4PSIxMTYiIHk9IjEzMyIgd2lkdGg9IjQwIiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjIyIi8+CiAgPHJlY3QgeD0iMTc2IiB5PSIxMjYiIHdpZHRoPSI3NCIgaGVpZ2h0PSIyMCIgcng9IjUiIGZpbGw9IiNGMTYzMzQiLz4KICA8cGF0aCBkPSJNMTk5LDEyOS41IEwxOTMsMTM3IEwxOTgsMTM3IEwxOTYsMTQyLjUgTDIwMiwxMzUgTDE5NywxMzUgWiIgZmlsbD0id2hpdGUiLz4KICA8cmVjdCB4PSIyMDYiIHk9IjEzMyIgd2lkdGg9IjM0IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSJ3aGl0ZSIgb3BhY2l0eT0iMC45Ii8+CiAgPHBhdGggZD0iTTI1OCwxMzYgQzI4MiwxMzYgMjgyLDk1IDMwMCw5NSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWRhc2hhcnJheT0iNCA1IiBvcGFjaXR5PSIwLjciLz4KICA8cGF0aCBkPSJNMjkzLDg5IEwzMDEsOTUgTDI5MywxMDEiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIG9wYWNpdHk9IjAuNyIvPgogIDxyZWN0IHg9IjMwNiIgeT0iMjIiIHdpZHRoPSIxNjIiIGhlaWdodD0iMTQ2IiByeD0iMTAiIGZpbGw9IiNGRUYwRTkiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIyLjIiLz4KICA8Y2lyY2xlIGN4PSIzMjQiIGN5PSI0MCIgcj0iNiIgZmlsbD0iI0YxNjMzNCIvPgogIDxwYXRoIGQ9Ik0zMjEuNSw0MCBMMzIzLjMsNDEuOCBMMzI2LjUsMzguMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgogIDxsaW5lIHgxPSIzMzIiIHkxPSI0MCIgeDI9IjM1MCIgeTI9IjQwIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMS40IiBvcGFjaXR5PSIwLjQiLz4KICA8Y2lyY2xlIGN4PSIzNTgiIGN5PSI0MCIgcj0iNiIgZmlsbD0iI0YxNjMzNCIvPgogIDxwYXRoIGQ9Ik0zNTUuNSw0MCBMMzU3LjMsNDEuOCBMMzYwLjUsMzguMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgogIDxsaW5lIHgxPSIzNjYiIHkxPSI0MCIgeDI9IjM4NCIgeTI9IjQwIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMS40IiBvcGFjaXR5PSIwLjQiLz4KICA8Y2lyY2xlIGN4PSIzOTIiIGN5PSI0MCIgcj0iNiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjEuNiIvPgogIDxwYXRoIGQ9Ik00NTIsMzUgTDQ1OCw0MSBNNDU4LDM1IEw0NTIsNDEiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxLjYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgb3BhY2l0eT0iMC41NSIvPgogIDxyZWN0IHg9IjMyMCIgeT0iNTgiIHdpZHRoPSIxMzQiIGhlaWdodD0iMTYiIHJ4PSI0IiBmaWxsPSJyZ2JhKDI1NSwyNTUsMjU1LDAuNykiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxIiBvcGFjaXR5PSIwLjYiLz4KICA8cmVjdCB4PSIzMjAiIHk9IjgyIiB3aWR0aD0iMTM0IiBoZWlnaHQ9IjE2IiByeD0iNCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjcpIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMSIgb3BhY2l0eT0iMC42Ii8+CiAgPHJlY3QgeD0iMzIwIiB5PSIxMDYiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgcng9IjQiIGZpbGw9IiNGMTYzMzQiLz4KICA8cGF0aCBkPSJNMzI0LDExNCBMMzI3LDExNyBMMzMyLDExMCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgogIDxyZWN0IHg9IjM0NCIgeT0iMTA4IiB3aWR0aD0iNzAiIGhlaWdodD0iNSIgcng9IjIuNSIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4zIi8+CiAgPHJlY3QgeD0iMzQ0IiB5PSIxMTciIHdpZHRoPSI0NiIgaGVpZ2h0PSI1IiByeD0iMi41IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjIiLz4KICA8cmVjdCB4PSIzMjAiIHk9IjEzNiIgd2lkdGg9IjEzNCIgaGVpZ2h0PSIyMCIgcng9IjYiIGZpbGw9IiNGMTYzMzQiLz4KICA8cmVjdCB4PSIzNTgiIHk9IjE0MyIgd2lkdGg9IjU4IiBoZWlnaHQ9IjYiIHJ4PSIzIiBmaWxsPSJ3aGl0ZSIgb3BhY2l0eT0iMC45Ii8+Cjwvc3ZnPgo=",description:(0,j.__)("Add a Buy Now button to your product pages that opens your funnel checkout in a popup, so shoppers pay without ever leaving the page.","cartflows"),valueProps:[(0,j.__)("One-click Buy Now right beside Add to Cart","cartflows"),(0,j.__)("Checkout in a popup, with your order bumps and offers","cartflows"),(0,j.__)("Choose a layout and match it to your brand","cartflows")]},analytics:{title:(0,j.__)("Funnel Analytics","cartflows"),image:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTYwIDE5MCIgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHJlY3Qgd2lkdGg9IjU2MCIgaGVpZ2h0PSIxOTAiIHJ4PSIxMiIgZmlsbD0iI0ZFRjBFOSIvPgogIDxyZWN0IHg9IjQwIiB5PSIxNCIgd2lkdGg9IjE0NCIgaGVpZ2h0PSI1MCIgcng9IjYiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC42MikiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxIiBvcGFjaXR5PSIwLjUiLz4KICA8cmVjdCB4PSI1MCIgeT0iMjIiIHdpZHRoPSIzOCIgaGVpZ2h0PSI1IiByeD0iMi41IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjIyIi8+CiAgPHJlY3QgeD0iNTAiIHk9IjMzIiB3aWR0aD0iNjIiIGhlaWdodD0iMTIiIHJ4PSI0IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjI4Ii8+CiAgPHBhdGggZD0iTTE1NSwzOCBMMTYwLDMwIEwxNjUsMzgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxLjgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgb3BhY2l0eT0iMC41NSIvPgogIDxyZWN0IHg9IjIwOCIgeT0iMTQiIHdpZHRoPSIxNDQiIGhlaWdodD0iNTAiIHJ4PSI2IiBmaWxsPSJyZ2JhKDI1NSwyNTUsMjU1LDAuNjIpIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMSIgb3BhY2l0eT0iMC41Ii8+CiAgPHJlY3QgeD0iMjE4IiB5PSIyMiIgd2lkdGg9IjUyIiBoZWlnaHQ9IjUiIHJ4PSIyLjUiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMjIiLz4KICA8cmVjdCB4PSIyMTgiIHk9IjMzIiB3aWR0aD0iNDYiIGhlaWdodD0iMTIiIHJ4PSI0IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjI4Ii8+CiAgPHBhdGggZD0iTTMyMywzOCBMMzI4LDMwIEwzMzMsMzgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxLjgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgb3BhY2l0eT0iMC41NSIvPgogIDxyZWN0IHg9IjM3NiIgeT0iMTQiIHdpZHRoPSIxNDQiIGhlaWdodD0iNTAiIHJ4PSI2IiBmaWxsPSJyZ2JhKDI1NSwyNTUsMjU1LDAuNjIpIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMSIgb3BhY2l0eT0iMC41Ii8+CiAgPHJlY3QgeD0iMzg2IiB5PSIyMiIgd2lkdGg9IjQ0IiBoZWlnaHQ9IjUiIHJ4PSIyLjUiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMjIiLz4KICA8cmVjdCB4PSIzODYiIHk9IjMzIiB3aWR0aD0iNzAiIGhlaWdodD0iMTIiIHJ4PSI0IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjI4Ii8+CiAgPHBhdGggZD0iTTQ5MSwzOCBMNDk2LDMwIEw1MDEsMzgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxLjgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgb3BhY2l0eT0iMC41NSIvPgogIDxsaW5lIHgxPSI1MiIgeTE9Ijc4IiB4Mj0iNTIiIHkyPSIxNjQiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIG9wYWNpdHk9IjAuMjIiLz4KICA8bGluZSB4MT0iNTIiIHkxPSIxNjQiIHgyPSI1MTYiIHkyPSIxNjQiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIG9wYWNpdHk9IjAuMjIiLz4KICA8cmVjdCB4PSIzOCIgeT0iNzciIHdpZHRoPSIxMSIgaGVpZ2h0PSI0IiByeD0iMiIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xOCIvPgogIDxyZWN0IHg9IjM4IiB5PSIxMDYiIHdpZHRoPSIxMSIgaGVpZ2h0PSI0IiByeD0iMiIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xOCIvPgogIDxyZWN0IHg9IjM4IiB5PSIxMzUiIHdpZHRoPSIxMSIgaGVpZ2h0PSI0IiByeD0iMiIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xOCIvPgogIDxsaW5lIHgxPSI1MiIgeTE9IjEwNyIgeDI9IjUxNiIgeTI9IjEwNyIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjAuOCIgc3Ryb2tlLWRhc2hhcnJheT0iNCw0IiBvcGFjaXR5PSIwLjE0Ii8+CiAgPGxpbmUgeDE9IjUyIiB5MT0iMTM2IiB4Mj0iNTE2IiB5Mj0iMTM2IiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMC44IiBzdHJva2UtZGFzaGFycmF5PSI0LDQiIG9wYWNpdHk9IjAuMTQiLz4KICA8cGF0aCBkPSJNOTYsMTEyIEMxMjgsMTA4IDE1Niw5NSAxOTIsOTUgQzIyNiw5NSAyNDgsMTIwIDI4MiwxMjIgQzMxNiwxMjQgMzQwLDEwNCAzNzIsMTAyIEM0MDQsMTAwIDQzMCwxMzIgNDYyLDEzNSBMNDYyLDE2NCBMOTYsMTY0IFoiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMSIvPgogIDxwYXRoIGQ9Ik05NiwxMTIgQzEyOCwxMDggMTU2LDk1IDE5Miw5NSBDMjI2LDk1IDI0OCwxMjAgMjgyLDEyMiBDMzE2LDEyNCAzNDAsMTA0IDM3MiwxMDIgQzQwNCwxMDAgNDMwLDEzMiA0NjIsMTM1IiBmaWxsPSJub25lIiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIG9wYWNpdHk9IjAuNjUiLz4KICA8Y2lyY2xlIGN4PSI5NiIgIGN5PSIxMTIiIHI9IjQiIGZpbGw9IiNGRUYwRTkiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIyIiBvcGFjaXR5PSIwLjY1Ii8+CiAgPGNpcmNsZSBjeD0iMTkyIiBjeT0iOTUiICByPSI1IiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjciLz4KICA8Y2lyY2xlIGN4PSIyODIiIGN5PSIxMjIiIHI9IjQiIGZpbGw9IiNGRUYwRTkiIHN0cm9rZT0iI0YxNjMzNCIgc3Ryb2tlLXdpZHRoPSIyIiBvcGFjaXR5PSIwLjY1Ii8+CiAgPGNpcmNsZSBjeD0iMzcyIiBjeT0iMTAyIiByPSI0IiBmaWxsPSIjRkVGMEU5IiBzdHJva2U9IiNGMTYzMzQiIHN0cm9rZS13aWR0aD0iMiIgb3BhY2l0eT0iMC42NSIvPgogIDxjaXJjbGUgY3g9IjQ2MiIgY3k9IjEzNSIgcj0iNCIgZmlsbD0iI0ZFRjBFOSIgc3Ryb2tlPSIjRjE2MzM0IiBzdHJva2Utd2lkdGg9IjIiIG9wYWNpdHk9IjAuNjUiLz4KICA8cmVjdCB4PSI4MCIgIHk9IjE2OCIgd2lkdGg9IjI4IiBoZWlnaHQ9IjQiIHJ4PSIyIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE4Ii8+CiAgPHJlY3QgeD0iMTc2IiB5PSIxNjgiIHdpZHRoPSIyOCIgaGVpZ2h0PSI0IiByeD0iMiIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xOCIvPgogIDxyZWN0IHg9IjI2NiIgeT0iMTY4IiB3aWR0aD0iMjgiIGhlaWdodD0iNCIgcng9IjIiIGZpbGw9IiNGMTYzMzQiIG9wYWNpdHk9IjAuMTgiLz4KICA8cmVjdCB4PSIzNTYiIHk9IjE2OCIgd2lkdGg9IjI4IiBoZWlnaHQ9IjQiIHJ4PSIyIiBmaWxsPSIjRjE2MzM0IiBvcGFjaXR5PSIwLjE4Ii8+CiAgPHJlY3QgeD0iNDQ2IiB5PSIxNjgiIHdpZHRoPSIyOCIgaGVpZ2h0PSI0IiByeD0iMiIgZmlsbD0iI0YxNjMzNCIgb3BhY2l0eT0iMC4xOCIvPgo8L3N2Zz4K",description:(0,j.__)("See exactly what is driving your funnel revenue — views, conversions, average order value, and revenue per visit for every funnel and step.","cartflows"),valueProps:[(0,j.__)("Track views, conversions, and revenue per step","cartflows"),(0,j.__)("Spot where buyers drop off and fix it","cartflows"),(0,j.__)("Make decisions with real data, not guesses","cartflows")]}}[e];if(!r)return null;const{title:o,description:a,valueProps:s=[],image:l,icon:c}=r;return(0,i.createElement)(Jh,{open:t,setOpen:n,exitOnClickOutside:!0},(0,i.createElement)(Jh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(Jh.Title,null,o,(0,i.createElement)("span",{className:"ml-2 inline-flex align-middle"},(0,i.createElement)(Ap,null))),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)(Jh.Body,{className:"space-y-4"},l?(0,i.createElement)("img",{src:l,alt:o,className:"block w-full rounded-lg box-border"}):c&&(0,i.createElement)("div",{className:"flex items-center justify-center bg-brand-25 rounded-lg py-8"},(0,i.createElement)(c,{className:"w-12 h-12 text-brand-500",strokeWidth:1.5})),(0,i.createElement)(vh,{size:14,color:"secondary"},a),s.length>0&&(0,i.createElement)("ul",{className:"list-none p-0 m-0 space-y-2"},s.map((e,t)=>(0,i.createElement)("li",{key:t,className:"flex items-start gap-2"},(0,i.createElement)(Ug,{className:"w-4 h-4 text-brand-500 shrink-0 mt-0.5",strokeWidth:2}),(0,i.createElement)(vh,{size:14,color:"secondary"},e))))),(0,i.createElement)(Jh.Footer,{className:"bg-brand-25 flex flex-col items-stretch gap-2"},(0,i.createElement)(Ro,{tag:"a",href:getUpgradeToProUrl(),target:"_blank",rel:"noreferrer",variant:"primary",className:"w-full box-border no-underline text-center text-sm"},(0,j.__)("Upgrade to Pro","cartflows")),(0,i.createElement)(vh,{size:12,color:"tertiary",className:"text-center"},(0,j.__)("14-day money-back guarantee","cartflows")))))},Yg=(e="pro")=>{const[{license_status:t}]=l();return!("plus-pro"===e?wcfCartflowsTypePlusPro():wcfCartflowsPro())||"Activated"!==t},Zg=function({stepId:e,flowId:t,flowType:n,initialBumps:r=[]}){const[o,a]=(0,i.useState)(!0),[s,c]=(0,i.useState)(r.length),[u,f]=(0,i.useState)(!1),p=Yg("plus-pro"),[{license_status:m}]=l(),h=(0,d.useHistory)(),g=(0,k.applyFilters)("cartflows.flowEditor.orderBumps",null),w=(0,i.useCallback)(e=>{c(e)},[]),y=(0,i.useCallback)(r=>{const o=`?page=cartflows&path=${"storeCheckout"===n?"store-checkout":"flows"}&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps&ob_id=${r}`;h?.push&&h.push({pathname:"admin.php",search:o})},[n,t,e,h]);if(p||!g){const e="function"==typeof wcfCartflowsPro&&wcfCartflowsPro()&&"Activated"!==m;return(0,i.createElement)("div",{className:"wcf-order-bump-section px-4 py-4 border-t border-solid border-border-subtle border-0"},(0,i.createElement)("div",{className:"flex items-center gap-1.5"},(0,i.createElement)(Dg,{className:"w-4 h-4 text-text-primary stroke-1"}),(0,i.createElement)(vh,{as:"span",size:14,weight:400,color:"primary"},(0,j.__)("Order Bumps","cartflows"))),(0,i.createElement)("div",{className:"mt-2.5"},(0,i.createElement)(Rg,{title:(0,j.__)("Add Extra Revenue to Every Checkout Effortlessly","cartflows"),description:(0,j.__)("Increase the value of every order by offering relevant add-ons customers can buy at checkout in a single click.","cartflows"),onButtonClick:e?void 0:()=>f(!0)})),(0,i.createElement)(Fg,{feature:"order-bump",open:u,setOpen:f}))}return(0,i.createElement)("div",{className:"wcf-order-bump-section px-4 py-4 border-t border-solid border-border-subtle border-0"},(0,i.createElement)("div",{className:"flex items-center justify-between"},(0,i.createElement)("div",{className:"flex items-center gap-1.5"},(0,i.createElement)(Dg,{className:"w-4 h-4 text-text-primary stroke-1"}),(0,i.createElement)(vh,{as:"span",size:14,weight:400,color:"primary"},(0,j.__)("Order Bumps","cartflows")," ",(0,i.createElement)("span",{className:"text-text-primary font-normal"},"(",s,")"))),(0,i.createElement)(Ro,{variant:"link",size:"xs",icon:o?(0,i.createElement)(jg,{className:"w-3.5 h-3.5 stroke-2"}):(0,i.createElement)(Fp,{className:"w-3.5 h-3.5 stroke-2"}),iconPosition:"right",onClick:()=>a(!o)},o?(0,j.__)("Hide","cartflows"):(0,j.__)("Show","cartflows"))),o&&(0,i.createElement)("div",{className:"mt-2.5"},(0,i.createElement)(g,{stepId:e,flowId:t,flowType:n,initialBumps:r,onCountChange:w,onEditNavigate:y})))},Vg=function(e){const[{is_cf_pro:t,global_checkout:n,flow_id:r,flow_type:o}]=Nm(),{id:a,title:s,type:l,actions:c,menu_actions:u,offer_yes_next_step:d,offer_no_next_step:f,invalid:p=!1,step_disabled:m=!1,setUpgradePopupFeature:h=()=>{},order_bumps:g=[]}=e,y=!!p,b=a;"storeCheckout"===o&&(["checkout"].includes(l)&&(delete u.clone,y||delete u.delete),y&&(delete u.clone,delete u.abtest));let v=!1,x=!1,N=[],I=[],M=0;wcfCartflowsTypePro()&&(v=!!e["ab-test-ui"]&&e["ab-test-ui"],x=!!e["ab-test-start"]&&e["ab-test-start"],N=e["ab-test-variations"]?e["ab-test-variations"]:[],I=e["ab-test-archived-variations"]?e["ab-test-archived-variations"]:[],M=N.length,M<2&&(v=!1));let E="";"storeCheckout"===o&&y&&(E+=" invalid-step wcf-store-checkout pointer-events-none touch-none"),v&&(E+=" wcf-ab-test"),wcfCartflowsTypePlusPro()||"upsell"!==l&&"downsell"!==l||(E+=" invalid-step pro-inactive pointer-events-none touch-none !bg-background-secondary !text-text-disabled !border-0"),m&&!v&&(E+=" invalid-step step-disabled touch-none !bg-background-secondary !text-text-disabled !border-0");const _={is_cf_pro:t,global_checkout:n,flow_id:r,ab_test_ui:v,control_id:b,step_id:a,type:l,title:s,actions:Object.values(c),menu_actions:Object.values(u),has_product_assigned:e.is_product_assigned,offer_yes_next_step:d,offer_no_next_step:f,ab_test_archived_variations:I,invalidStep:y,setUpgradePopupFeature:h,step_disabled:m},S=(0,k.applyFilters)("cartflows.flowEditor.abTestHead",null),D=(0,k.applyFilters)("cartflows.flowEditor.abTestArchivedSteps",null);return(0,i.createElement)("div",{className:"wcf-step-wrap box-border bg-background-primary border border-solid border-border-subtle shadow-sm rounded-lg overflow-hidden"+E,id:a},v&&S&&(0,i.createElement)(S,{flow_id:r,control_id:b,step_id:a,abvariations:N,ab_test_start:x}),function(){let e="";if(_.step_id=a,v&&M>1){let t=0;e=N.map(e=>(b!==e.id&&++t,_.is_variation=!0,_.control_id=b,_.step_id=e.id,_.title=e.title,_.actions=Object.values(e.actions),_.menu_actions=Object.values(e.menu_actions),_.has_product_assigned=e.is_product_assigned,_.var_badge_count=t,_.offer_yes_next_step=e.offer_yes_next_step,_.offer_no_next_step=e.offer_no_next_step,_.offer_yes_step_id=e.offer_yes_step_id,_.offer_no_step_id=e.offer_no_step_id,_.step_disabled=e.step_disabled,(0,i.createElement)(Sg,(0,w.A)({},_,{key:e.id}))))}else e=(0,i.createElement)(Sg,_);return e}(),function(){if(D&&I.length>0){const e={flow_id:r,control_id:b,type:l,archived_variations:I,ab_test_ui:v};return(0,i.createElement)(D,e)}}(),"checkout"===l&&(0,i.createElement)(Zg,{stepId:a,flowId:r,flowType:o,initialBumps:Array.isArray(g)?g:[]}))},Gg=({variant:e="rectangular",className:t,...n})=>{const r={circular:"rounded-full bg-gray-200 ",rectangular:"rounded-md bg-gray-200"}[e],o={circular:"size-10",rectangular:"w-96 h-3"}[e];return(0,C.jsx)("div",{role:"status","aria-label":"Loading",className:Se(r,"animate-pulse",o,t),...n})},Wg=function(){return(0,i.createElement)("div",{className:"w-full"},Array(3).fill().map((e,t)=>(0,i.createElement)("div",{key:t,className:"wcf-step-wrap bg-background-primary border border-border-subtle shadow-sm rounded-lg mb-4 p-4 flex items-center gap-4"},(0,i.createElement)("div",{className:"flex"},(0,i.createElement)(Gg,{className:"w-3 h-10 rounded"})),(0,i.createElement)(Gg,{className:"w-[72px] h-[72px] rounded-lg flex-shrink-0"}),(0,i.createElement)("div",{className:"flex flex-col gap-2 w-[40%]"},(0,i.createElement)(Gg,{className:"h-3 w-24 rounded-md"}),(0,i.createElement)(Gg,{className:"h-4 w-48 rounded-md"})),(0,i.createElement)("div",{className:"flex items-center justify-around w-[35%] gap-4"},[1,2,3].map(e=>(0,i.createElement)("div",{key:e,className:"flex flex-col gap-2 items-center"},(0,i.createElement)(Gg,{className:"h-3 w-16 rounded-md"}),(0,i.createElement)(Gg,{className:"h-4 w-8 rounded-md"})))),(0,i.createElement)("div",{className:"flex items-center gap-2 ml-auto"},[1,2,3,4].map(e=>(0,i.createElement)(Gg,{key:e,variant:"circular",className:"size-8"}))))))};function Hg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"}))}const Qg=p.forwardRef(Hg);function $g({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 0 0-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 0 0-16.536-1.84M7.5 14.25 5.106 5.272M6 20.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm12.75 0a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"}))}const Xg=p.forwardRef($g);function Jg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const qg=p.forwardRef(Jg);function Kg({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const ew=p.forwardRef(Kg);function tw({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"}))}const nw=p.forwardRef(tw);function rw({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42"}))}const ow=p.forwardRef(rw),aw=function(e){const{fontSize:t,width:n,style:r}=e;return(0,i.createElement)("div",{className:"wcf-skeleton bg-background-secondary block leading-5 wcf-skeleton--text wcf-skeleton--wave",style:{fontSize:t,width:n,...r}})},iw=function(e){const{height:t,style:n}=e;return(0,i.createElement)("div",{className:"wcf-skeleton-base wcf-skeleton--spacer h-6",style:{height:t,...n}})},sw=function(e){const{width:t,height:n,style:r}=e;return(0,i.createElement)("div",{className:"wcf-skeleton block leading-5 wcf-skeleton--rect bg-background-secondary rounded-md animate-pulse",style:{width:t,height:n,...r}})},lw=function(){return(0,i.createElement)("div",{className:"wcf-design-page is-placeholder"},(0,i.createElement)("div",{className:"wcf-design-page__content"},(0,i.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},(0,i.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,i.createElement)("div",{className:"wcf-design-page__customize"},(0,i.createElement)("div",{className:"wcf-design-page__button"}),(0,i.createElement)("div",{className:"wcf-design-page__button"})),(0,i.createElement)("div",{className:"wcf-design-page__text"},(0,i.createElement)("div",{className:"title wcf-placeholder__width--60"})),(0,i.createElement)("div",{className:"wcf-design-page__WPeditor"},(0,i.createElement)("div",{className:"title wcf-placeholder__width--80"}))),(0,i.createElement)("div",{className:"wcf-design-page__settings"},(0,i.createElement)("div",{className:"title"}),(0,i.createElement)("div",{className:"wcf-field wcf-checkbox-field"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("div",{className:"wcf-settings"},(0,i.createElement)("form",null,(0,i.createElement)("div",{className:"wcf-vertical-nav"},(0,i.createElement)("div",{className:"wcf-vertical-nav__menu"},Array(5).fill().map(e=>(0,i.createElement)("div",{className:"wcf-settings-nav__tab",key:e},(0,i.createElement)(sw,{height:"45px"})))),(0,i.createElement)("div",{className:"wcf-vertical-nav__content"},(0,i.createElement)(aw,{fontSize:"35px",width:"225px"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"65%"}),(0,i.createElement)(iw,null),(0,i.createElement)(aw,{fontSize:"35px",width:"300px"}),(0,i.createElement)(aw,{width:"60%"}),(0,i.createElement)(aw,{width:"60%"}),(0,i.createElement)(aw,{width:"45%"}),(0,i.createElement)(iw,null),(0,i.createElement)(aw,{fontSize:"35px",width:"300px"}),(0,i.createElement)(aw,{width:"60%"}),(0,i.createElement)(aw,{width:"60%"}),(0,i.createElement)(aw,{width:"45%"})))))))};let cw=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};const uw=To("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),dw=(0,p.forwardRef)(({id:e,label:t,defaultChecked:n=!1,checked:r,onChange:o,indeterminate:a,disabled:i,size:s="md",className:l,...c},u)=>{const d=(0,p.useMemo)(()=>e||`checkbox-${cw()}`,[e]),f=(0,p.useMemo)(()=>`${d}-description`,[d]),m=(0,p.useMemo)(()=>typeof r<"u",[r]),[h,g]=(0,p.useState)(n||!1),w="primary",y={sm:{checkbox:"size-4 rounded gap-1",icon:"size-3",text:"text-sm",description:"text-sm",gap:"gap-0.5"},md:{checkbox:"size-5 rounded gap-1",icon:"size-4",text:"text-base",description:"text-sm",gap:"gap-1"}},b={primary:{checkbox:"border-border-strong hover:border-border-interactive checked:border-border-interactive bg-white checked:bg-toggle-on checked:hover:bg-toggle-on-hover checked:hover:border-toggle-on-hover focus:ring-2 focus:ring-offset-2 focus:ring-focus",icon:"text-white"}},v=(0,p.useCallback)(()=>m?r:h,[m,r,h]),x=(0,p.useCallback)(()=>(0,p.isValidElement)(t)?t:t?.heading||t?.description?(0,C.jsxs)("div",{className:y[s].gap,children:[t?.heading&&(0,C.jsx)(cp,{className:Se("text-text-primary font-medium leading-4 m-0",y[s].text,y[s].gap,i&&"text-text-disabled"),htmlFor:d,children:t?.heading}),t?.description&&(0,C.jsx)(cp,{tag:"p",id:f,className:Se("font-normal leading-5 m-0",y[s].description,i&&"text-text-disabled"),variant:"help",children:t?.description})]}):null,[t,s,i]);return(0,C.jsxs)("div",{className:Se("inline-flex items-center justify-center gap-2",!!t&&"items-start",i&&"cursor-not-allowed"),children:[(0,C.jsxs)("span",{className:Se("relative flex items-center justify-center rounded-full p-0.5",!i&&"cursor-pointer"),children:[(0,C.jsx)("input",{ref:u,id:d,type:"checkbox",...a&&{"aria-checked":"mixed"},...t?.description&&{"aria-describedby":f},className:Se("peer relative cursor-pointer appearance-none transition-all m-0 before:content-[''] checked:before:content-[''] checked:before:hidden before:hidden !border-1.5 border-solid focus:outline-none",b[w].checkbox,y[s].checkbox,i&&"cursor-not-allowed disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled",l),checked:v(),onChange:e=>{if(i)return;const t=e.target.checked;m||g(t),"function"==typeof o&&o(t)},disabled:i,...c}),(0,C.jsx)("span",{"aria-hidden":"true",className:Se("pointer-events-none inline-flex items-center absolute top-2/4 not-rtl:left-2/4 rtl:right-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",b[w].icon,i&&"cursor-not-allowed peer-disabled:text-border-disabled"),children:a?(0,C.jsx)(uw,{className:Se(y[s]?.icon)}):(0,C.jsx)(Oo,{className:Se(y[s]?.icon)})})]}),!!t&&x()]})});dw.displayName="Checkbox";const fw=function(e){const{name:t,id:n,label:r,value:o,desc:a,backComp:s=!1,tooltip:l,onClick:c,notice:u,child_class:d="",isDisabled:f=!1,isPro:p=!1}=e,[m,h]=(0,i.useState)(o);(0,i.useEffect)(()=>{h(o)},[o]);const g=s?"enable":"yes",w=s?"disable":"no";return(0,i.createElement)("div",{className:"wcf-field wcf-checkbox-field text-left"},(0,i.createElement)("div",{className:"wcf-field__data flex items-center gap-2.5"},(0,i.createElement)("div",{className:`wcf-field__data--content ${d}`},(0,i.createElement)("input",{type:"hidden",name:t,value:m}),(0,i.createElement)(dw,{id:n||t,checked:g===m,onChange:function(e){let r;if(e){if(u&&!function(){switch(u.type){case"alert":return alert(u.message),!0;case"confirm":return!!confirm(u.message);case"prompt":return prompt(u.message)===u.check.toUpperCase();default:return!1}}())return;h(g),r=g}else h(w),r=w;const o={target:{checked:e,id:n||t}},a=new CustomEvent("wcf:checkbox:change",{bubbles:!0,detail:{e:o,name:t,value:r}});document.dispatchEvent(a),c&&c(o)},disabled:f,className:e.class||e.className})),r&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left w-full md:w-80 lg:w-80"},(0,i.createElement)("label",{htmlFor:n||t,className:"mr-3"},r,l&&(0,i.createElement)(n_,{text:l}),!wcfCartflowsPro()&&p&&(0,i.createElement)("span",{className:"ml-2 inline-flex align-middle"},(0,i.createElement)(Ap,null))))),a&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Nh(a)))},pw={primary:{checkbox:"border-border-strong hover:border-border-interactive checked:border-border-interactive bg-white checked:bg-toggle-on checked:hover:bg-toggle-on-hover checked:hover:border-toggle-on-hover focus:ring-2 focus:ring-offset-2 focus:ring-focus",icon:"text-white"}},mw={sm:"text-sm leading-5",md:"text-base leading-6"},hw={sm:{checkbox:"size-4",icon:"size-1.5",info:"size-4"},md:{checkbox:"size-5",icon:"size-2",info:"size-5"}},gw={xs:"py-1 px-1 text-sm gap-0.5 [&>svg]:size-4",sm:"py-1 px-1.5 text-base gap-1 [&>svg]:size-4",md:"py-2 px-2.5 text-base gap-1 [&>svg]:size-5",lg:"py-2.5 px-3 text-base gap-1 [&>svg]:size-6"},ww=({label:e,switchId:t,disabled:n=!1,children:r,size:o})=>{const a={xs:"text-xs leading-4 font-medium",sm:"text-sm leading-5 font-medium",md:"text-base leading-6 font-medium"},i={xs:"text-xs leading-4 font-normal",sm:"text-sm leading-5 font-normal",md:"text-sm leading-5 font-normal"},s={xs:"space-y-0.5",sm:"space-y-0.5",md:"space-y-1"};if((0,p.isValidElement)(e))return(0,C.jsxs)("div",{className:Se("inline-flex items-center gap-3","items-start"),children:[r,e]});const l=!e?.heading&&!e?.description,c=e?.heading&&e?.description?"items-start":"items-center";return l?r:(0,C.jsxs)("div",{className:Se("inline-flex",c,"gap-3"),children:[r,(()=>{const{heading:r="",description:l=""}=e||{};return(0,C.jsxs)("div",{className:Se("space-y-0.5",s[o]),children:[r&&(0,C.jsx)(cp,{htmlFor:t,className:Se("m-0",a[o]),...n&&{variant:"disabled"},children:r}),l&&(0,C.jsx)(cp,{tag:"p",variant:"help",className:Se("text-sm font-normal leading-5 m-0",i[o]),...n&&{variant:"disabled"},children:l})]})})()]})},yw=(0,p.forwardRef)(({id:e,onChange:t,value:n,defaultValue:r=!1,size:o="sm",disabled:a=!1,label:i={heading:"",description:""},name:s,className:l,...c},u)=>{const d="lg"===o?"md":o,f=(0,p.useMemo)(()=>typeof n<"u",[n]),m=(0,p.useMemo)(()=>e||`switch-${cw()}`,[]),[h,g]=(0,p.useState)(r),w="primary",y=(0,p.useCallback)(()=>f?n:h,[f,n,h]),b={primary:{input:"bg-toggle-off checked:bg-toggle-on focus:ring focus:ring-toggle-on focus:ring-offset-2 border border-solid border-toggle-off-border checked:border-toggle-on-border shadow-toggleContainer focus:outline-none checked:focus:border-toggle-on-border focus:border-toggle-off-border",toggleDial:"bg-toggle-dial-background shadow-toggleDial"}},v={md:{container:"w-11 h-6",toggleDial:"size-4 peer-checked:translate-x-5"},sm:{container:"w-10 h-5",toggleDial:"size-3 peer-checked:translate-x-5"},xs:{container:"w-8 h-4",toggleDial:"size-2.5 peer-checked:translate-x-3.75"}};return(0,C.jsx)(ww,{label:i,switchId:m,disabled:a,size:d,children:(0,C.jsxs)("div",{className:Se("relative group/switch inline-block cursor-pointer rounded-full shrink-0",v[d].container,l),children:[(0,C.jsx)("input",{ref:u,id:m,type:"checkbox",role:"switch",className:Se("peer appearance-none absolute rounded-full cursor-pointer transition-colors duration-300 h-full w-full before:content-[''] checked:before:content-[''] m-0 checked:[background-image:none]",b[w].input,a&&"bg-toggle-off-disabled disabled:border-transparent disabled:cursor-not-allowed checked:disabled:bg-toggle-on-disabled disabled:shadow-toggle-disabled",!a&&{primary:{input:"group-hover/switch:bg-toggle-off-hover checked:group-hover/switch:bg-toggle-on-hover checked:group-hover/switch:border-toggle-on-border"}}[w].input),checked:y(),onChange:e=>{if(a)return;const n=e.target.checked;f||g(n),"function"==typeof t&&t(n)},disabled:a,name:s,...c}),(0,C.jsx)("span",{"aria-hidden":"true",className:Se("peer/toggle-dial pointer-events-none bg-white border rounded-full absolute cursor-pointer shadow-md before:content[''] before:transition-opacity before:opacity-0 hover:before:opacity-10 before:hidden border-none transition-all duration-300 top-2/4 not-rtl:left-1 rtl:right-1 -translate-y-2/4 before:w-10 before:h-10 before:rounded-full before:absolute before:top-2/4 not-rtl:before:left-2/4 rtl:before:right-2/4 before:-translate-y-2/4 before:-translate-x-2/4",v[d].toggleDial,b[w].toggleDial,a&&"peer-disabled:cursor-not-allowed",!a&&{md:"group-hover/switch:size-5 group-focus-within/switch:size-5 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5",sm:"group-hover/switch:size-4 group-focus-within/switch:size-4 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5",xs:"group-hover/switch:size-3.25 group-focus-within/switch:size-3.25 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5"}[d])})]})})});yw.displayName="Switch";const bw=(0,p.createContext)({}),vw=()=>(0,p.useContext)(bw),xw=({children:e,name:t,style:n="simple",size:r="md",value:o,defaultValue:a,by:i="id",as:s="div",onChange:l,className:c,disableGroup:u=!1,vertical:d=!1,columns:f=4,multiSelection:m=!1,gapClassName:h="gap-2"})=>{const g=(0,p.useMemo)(()=>typeof o<"u",[o]),w=(0,p.useMemo)(()=>t||`radio-button-group-${cw()}`,[t]);let y;y=g?o:m?a??[]:a;const[b,v]=(0,p.useState)(y),x=(0,p.useCallback)(e=>{if(m)v(t=>{let n;return n=Array.isArray(t)&&"string"==typeof e&&t.includes(e)?t.filter(t=>t!==e):[...Array.isArray(t)?t:[],..."string"==typeof e?[e]:[]],"function"==typeof l&&l(n),n});else{if(g||v(e),"function"!=typeof l)return;l(e)}},[l]);c=Se("grid grid-cols-4",ke[f],h,"tile"===n&&"gap-0",d&&"grid-cols-1",c);const N=Se("tile"===n?"border border-border-subtle border-solid rounded-md shadow-sm":"gap-6",c),I=()=>(0,C.jsx)(bw.Provider,{value:{name:w,value:g?o:b,by:i,onChange:x,isControlled:g,disableAll:u,style:n,columns:f,multiSelection:m,size:r},children:p.Children.map(e,e=>(0,p.isValidElement)(e)?e:null)});return(0,C.jsx)(C.Fragment,{children:"tile"===n?(0,C.jsx)("div",{className:N,children:I()}):(0,C.jsx)(s,{...s===p.Fragment?{}:{className:c},children:I()})})};xw.displayName="RadioButton.Group";const Nw=(0,p.forwardRef)(({id:e,label:t,value:n,children:r,disabled:o,icon:a=null,inlineIcon:i=!1,hideSelection:s=!1,reversePosition:l=!1,borderOn:c=!1,borderOnActive:u=!0,badgeItem:d=null,useSwitch:f=!1,info:m,minWidth:h=!0,...g},w)=>{const{buttonWrapperClasses:y,...b}=g,v=vw(),{name:x,value:N,by:I,onChange:M,disableAll:E,checked:_,multiSelection:S,size:D="md"}=v,j="primary",k=(0,p.useMemo)(()=>e||`radio-button-${cw()}`,[e]),A=(0,p.useMemo)(()=>E||o,[E,o]),T=(0,p.useMemo)(()=>S?Array.isArray(N)&&N.includes(n):typeof _<"u"?_:typeof N==typeof n&&("string"==typeof N?N===n:Array.isArray(N)?N.includes(n):N[I]===n[I]),[N,n,_]),L=(0,p.useCallback)(()=>(0,p.isValidElement)(t)?t:t?.heading?(0,C.jsxs)("div",{className:Se(!i&&{"space-y-3":"sm"===D,"space-y-4":"md"===D},l&&!c&&(f?"ml-10":"ml-4"),i&&"flex gap-2",i&&!t.description&&"items-center"),children:[a&&(0,C.jsx)(C.Fragment,{children:a}),(0,C.jsxs)("div",{className:Se(!a||!f||a&&d?{"space-y-0.5":"sm"===D,"space-y-1":"md"===D}:"space-y-0.5"),children:[(0,C.jsx)("p",{className:Se("text-text-primary font-medium m-0 [overflow-wrap:anywhere]",mw[D],o&&"text-text-disabled cursor-not-allowed"),children:t.heading}),t.description&&(0,C.jsx)("p",{className:"text-text-tertiary text-sm font-normal leading-5 m-0 [overflow-wrap:anywhere]",children:t.description})]})]}):null,[t,l,c,f]);if("tile"===v.style)return(0,C.jsx)(Iw,{id:e,label:t,value:n,disabled:o,size:D,children:r});const O=()=>{A||(S?f&&M(n,!T):M(n))};let z="pr-12";l&&c&&(z=f?"pl-16":"pl-12");let P="right-3 mr-0.5";return l&&(P=c?"left-3 ml-0.5":"left-0"),(0,C.jsxs)("label",{className:Se("inline-flex items-center relative cursor-pointer transition-all duration-300",!!t&&"items-start justify-between",h&&"min-w-[180px]",c&&"outline outline-field-border outline-1 rounded-md shadow-sm hover:outline-border-interactive",u&&c&&T&&"outline-border-interactive",{"pl-3.5 pr-2.5 py-2.5":"sm"===D&&!(a&&f),"p-3":"sm"===D&&(a&&f||a&&d),"pl-4 pr-3 py-3":"md"===D&&!(a&&f),"p-4":"md"===D&&(a&&f||a&&d)},z,A&&"cursor-not-allowed opacity-40",y),htmlFor:k,onClick:O,children:[!!t&&(0,C.jsx)("label",{className:Se("cursor-pointer",A&&"cursor-not-allowed"),htmlFor:k,children:L()}),!!m&&(0,C.jsx)("div",{className:"absolute mr-0.5 bottom-1.5 right-3",children:(0,C.jsx)(Wo,{title:m?.heading,content:m?.description,children:(0,C.jsx)(Lo,{className:Se("text-text-primary",hw[D]?.info)})})}),(0,C.jsxs)("label",{className:Se("absolute flex items-center cursor-pointer rounded-full gap-2",P,A&&"cursor-not-allowed",i&&(l&&c?"ml-3":"mr-3")),onClick:O,children:[!!d&&d,!s&&(f?(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(yw,{defaultValue:!1,size:D,onChange:()=>{S?M(n,!T):M(n)},checked:T,...b,"aria-label":t?.heading??"Switch"})}):(0,C.jsxs)("span",{className:"relative p-0.5",children:[(0,C.jsx)("input",{ref:w,id:k,type:S?"checkbox":"radio",className:Se("peer flex relative cursor-pointer appearance-none transition-all m-0 before:content-[''] checked:before:content-[''] checked:before:hidden before:hidden !border-1.5 border-solid focus-within:outline-none",!S&&"rounded-full",pw[j].checkbox,hw[D].checkbox,A&&"disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled cursor-not-allowed"),name:x,value:n,onChange:e=>M(e.target.value),checked:T,disabled:A,...b}),(0,C.jsx)("span",{className:Se("inline-flex items-center absolute top-2/4 not-rtl:left-2/4 rtl:right-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",pw[j].icon,A&&"peer-disabled:text-border-disabled cursor-not-allowed"),children:S?(0,C.jsx)(Oo,{className:"sm"===D?"size-3":"size-4"}):(0,C.jsx)("div",{className:Se("rounded-full bg-current",hw[D]?.icon)})})]}))]})]})});Nw.displayName="RadioButton.Button";const Iw=({id:e,children:t,value:n,disabled:r,size:o="md",...a})=>{const i=vw(),{name:s,value:l,by:c,onChange:u,disableAll:d,checked:f}=i||{},m=(0,p.useMemo)(()=>e||`radio-button-${cw()}`,[e]),h=(0,p.useMemo)(()=>d||r,[d,r]),g=(0,p.useMemo)(()=>typeof f<"u"?f:typeof l==typeof n&&("string"==typeof l?l===n:Array.isArray(l)?l.includes(n):!(!l||!c)&&l[c]===n[c]),[l,n,f,c]),w=Se("bg-background-primary text-primary cursor-pointer flex items-center justify-center","hover:bg-button-tertiary-hover","focus:outline-none",h?"text-text-disabled cursor-not-allowed":"",gw[o],"border-0 border-r border-border-subtle border-solid");return(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)("button",{type:"button",id:m,"aria-label":"Radio Button",className:Se(w,"first:rounded-tl first:rounded-bl first:border-0 first:border-r first:border-border-subtle last:rounded-tr last:rounded-br last:border-0",g&&"bg-button-disabled"),onClick:()=>{u&&u(n)},disabled:h,...a,children:[(0,C.jsx)("input",{type:"hidden",value:n,name:s,checked:g,onChange:e=>u?.(e.target.value)}),t]})})},Mw=Object.assign(Nw,{Group:xw,Button:Nw}),Ew=function(e){const{name:t,label:n,value:r,options:o,desc:a,child_class:s="",child_className:l="",onClick:c=""}=e,[u,d]=(0,i.useState)(r);return(0,i.useEffect)(()=>{d(r)},[r]),(0,i.createElement)("div",{className:"wcf-field wcf-radio-field"},(0,i.createElement)("div",{className:"wcf-field__data block"},n&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-left w-full md:w-80 lg:w-80 mb-2"},(0,i.createElement)("label",{className:"text-text-primary text-base font-medium"},n)),(0,i.createElement)("div",{className:"wcf-field__data--content"},o&&(0,i.createElement)(Mw.Group,{name:t,value:u,onChange:function(t){d(t);const n=new CustomEvent("wcf:radio:change",{bubbles:!0,detail:{e:{target:{value:t}},name:e.name,value:t}});document.dispatchEvent(n),c&&c(t)},vertical:!0,gapClassName:"gap-0"},o.map(e=>(0,i.createElement)(Mw.Button,(0,w.A)({key:e.value,value:e.value,minWidth:!1,buttonWrapperClasses:`wcf-radio-field__option py-1.5 [&_label]:text-left ${e.desc?"[&_p:last-child]:!text-text-secondary":""} ${l||s}`},(e.label||e.desc)&&{label:{heading:e.label||"",...e.desc&&{description:e.desc}}})))))),a&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Nh(a)))},_w=To("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Sw=To("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Dw={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2.5 py-2 rounded text-xs font-medium leading-4 min-h-[2rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-sm",searchbarIcon:"size-4",label:"text-sm font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-3.5 py-2.5 rounded-md text-sm font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-4 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-base font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-base font-medium"}},jw="group disabled:outline-field-border-disabled [&:hover:has(:disabled)]:outline-field-border-disabled disabled:cursor-default",kw="group-disabled:text-field-color-disabled",Cw={sm:"w-[calc(100%+0.75rem)] translate-x-[-0.375rem]",md:"w-[calc(100%+1rem)] translate-x-[-0.5rem]",lg:"w-[calc(100%+1rem)] translate-x-[-0.5rem]"},Aw={sm:"py-1.5 px-2 text-xs font-normal",md:"p-2 text-sm font-normal",lg:"p-2 text-base font-normal"},Tw=e=>Array.isArray(e)?e:null===e||typeof e>"u"||""===e?[]:[e],Lw=e=>null===e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?e.toString():Array.isArray(e)?e.map(Lw).join(" ").trim():(0,p.isValidElement)(e)?e.props&&e.props.children?Lw(e.props.children):"":"object"==typeof e&&"textContent"in e?e.textContent?.toString().toLowerCase()||"":"object"==typeof e&&"children"in e?Lw(e.children):"",Ow=To("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),zw=({variant:e="primary",size:t="md",icon:n=null,className:r=""})=>{const o={primary:"text-brand-primary-600",secondary:"text-background-primary"}[e],a={sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6",xl:"[&>svg]:size-8"}[t];return(0,C.jsx)("span",{role:"status","aria-label":"Loading",className:Se("flex",a,o,r),children:n||(0,C.jsx)(Ow,{className:"animate-spin shrink-0","aria-hidden":"true"})})},Pw=(0,p.createContext)({}),Rw=()=>(0,p.useContext)(Pw),Uw=(0,p.forwardRef)(({children:e,icon:t=null,placeholder:n="Select an option",optionIcon:r=null,render:o,label:a,className:i,...s},l)=>{const{sizeValue:c,getReferenceProps:u,getValues:d,selectId:f,refs:m,isOpen:h,multiple:g,combobox:w,inlineSearch:y,setSelected:b,onChange:v,isControlled:x,disabled:N,by:I,searchKeyword:M,setSearchKeyword:E,searchPlaceholder:_,context:S,activeIndex:D,optionValuesRef:j,handleSelect:k}=Rw(),A={sm:"xs",md:"sm",lg:"md"}[c],T=(0,p.useRef)(null),[L,O]=(0,p.useState)(!1);(0,p.useEffect)(()=>{h||O(!1)},[h]);const z=(0,p.useMemo)(()=>{if(!y||g)return"";const e=d();if(!e)return"";if("function"==typeof o){const t=o(e);if("string"==typeof t)return t}if("string"==typeof e||"number"==typeof e)return String(e);const t=e.name;return"string"==typeof t?t:""},[y,g,d,o]),P=(0,p.useCallback)(()=>{if(t)return t;const e="text-field-placeholder group-disabled:text-icon-disabled";return w?(0,C.jsx)(_w,{className:e}):(0,C.jsx)(Fp,{className:e})},[t]),R=(0,p.useCallback)(()=>{const t=d();if(!t)return null;if(g)return Tw(t).map(e=>(0,C.jsx)(Qo,{className:"cursor-default",icon:r,type:"rounded",size:A,onMouseDown:U(e),label:"function"==typeof o?o(e):e.toString(),closable:!0,disabled:N},String(null!==e&&"object"==typeof e?e[I]:e)));const n=Array.isArray(t)&&t.length?t[0]:t;let a="string"==typeof n?n:"";return"function"==typeof o&&(a=o(n)),"function"==typeof e&&"function"!=typeof o&&(a=e({value:n})),((0,p.isValidElement)(e)||"string"==typeof e)&&"function"!=typeof o&&(a=e),(0,C.jsx)("span",{className:Se("truncate",Dw[c].displaySelected,kw),children:a})},[d,N,g,o,e,I]),U=e=>t=>{t?.preventDefault(),t?.stopPropagation();const n=[...Tw(d())],r=n.findIndex(t=>null!==t&&null!==e&&"object"==typeof t?t[I]===e[I]:t===e);-1!==r&&(n.splice(r,1),x||b(n),"function"==typeof v&&v(n))};if(y){let e="";!g&&d()?e=h&&L?M:z:h&&(e=M);const t=g?!Tw(d()).length:!d()&&!M;return(0,C.jsxs)("div",{className:"w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[!!a&&(0,C.jsx)("label",{className:Se(Dw[c]?.label,"text-field-label"),htmlFor:f,children:a}),(0,C.jsxs)("div",{ref:m.setPositionReference,className:Se("flex flex-wrap items-center justify-between w-full box-border transition-[outline,background-color,color,box-shadow] duration-200 bg-white cursor-text","outline outline-1 outline-field-border border-none","focus-within:ring-2 focus-within:ring-offset-2 focus-within:outline-focus-border focus-within:ring-focus","[&:hover:not(:focus-within):not(:has(:disabled))]:outline-border-strong",Dw[c].selectButton,g&&Dw[c].multiSelect,jw,i),onMouseDown:e=>{e.target!==T.current&&(e.preventDefault(),T.current?.focus())},children:[(0,C.jsxs)("div",{className:"flex-1 flex flex-wrap items-center gap-1.5 overflow-hidden",children:[g&&R(),(0,C.jsx)("input",{ref:Go(m.setReference,T),id:f,type:"text",autoComplete:"off","aria-autocomplete":"list",disabled:N,placeholder:t?_:"",value:e,className:Se("flex-1 min-w-[4rem] bg-transparent border-0 outline-none focus:ring-0 p-0","placeholder:text-field-placeholder",Dw[c].displaySelected,kw),...u({onFocus:()=>{h||S.onOpenChange(!0)},onClick:()=>{h||S.onOpenChange(!0)},onChange:e=>{O(!0),E(e.target.value),h||S.onOpenChange(!0)},onKeyDown:t=>{if("Enter"===t.key&&null!==D&&D>=0){t.preventDefault();const e=j.current[D];return void(void 0!==e&&k(D,e))}if("Backspace"===t.key&&!e&&g){t.preventDefault();const e=Tw(d());e.length&&U(e[e.length-1])()}}})})]}),(0,C.jsx)("div",{className:Se("flex items-center [&>svg]:shrink-0",Dw[c].icon),children:P()})]})]})}return(0,C.jsxs)("div",{className:"w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[!!a&&(0,C.jsx)("label",{className:Se(Dw[c]?.label,"text-field-label"),htmlFor:f,children:a}),(0,C.jsxs)("button",{id:f,ref:Go(m.setReference,l),className:Se("flex items-center justify-between w-full box-border transition-[outline,background-color,color,box-shadow] duration-200 bg-white","outline outline-1 outline-field-border border-none cursor-pointer",!h&&"focus:ring-2 focus:ring-offset-2 focus:outline-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:outline-border-strong",Dw[c].selectButton,g&&Dw[c].multiSelect,jw,i),tabIndex:0,disabled:N,...s,...u(),children:[(0,C.jsxs)("div",{className:Se("flex-1 grid items-center justify-start gap-1.5 overflow-hidden",d()&&"flex flex-wrap"),children:[R(),(g?!Tw(d()).length:!d())&&(0,C.jsx)("div",{className:Se("[grid-area:1/1/2/3] text-field-input px-1",Dw[c].displaySelected,kw),children:n})]}),(0,C.jsx)("div",{className:Se("flex items-center [&>svg]:shrink-0",Dw[c].icon),children:P()})]})]})});function Bw({label:e,children:t,className:n,...r}){const{index:o,totalGroups:a}=r,{sizeValue:i}=Rw();return(0,C.jsxs)(p.Fragment,{children:[(0,C.jsxs)("div",{className:"flex flex-col",role:"group","aria-label":e,children:[(0,C.jsx)("div",{className:Se("p-2 font-normal text-text-tertiary",{sm:"text-xs",md:"text-xs",lg:"text-sm"}[i],n),id:`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:e}),(0,C.jsx)("div",{className:"flex flex-col",role:"presentation","aria-labelledby":`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:t})]}),o<a&&!!(t&&p.Children.count(t)>0)&&(0,C.jsx)("hr",{className:Se("h-px my-2 w-full border-border-subtle border-b border-t-0 border-solid",Cw[i])})]})}function Fw({children:e,className:t}){const{isOpen:n,context:r,refs:o,combobox:a,inlineSearch:i,floatingStyles:s,getFloatingProps:l,sizeValue:c,setSearchKeyword:u,setActiveIndex:d,setSelectedIndex:f,value:m,selected:h,getValues:g,searchKeyword:w,listContentRef:y,by:b,searchPlaceholder:v,activeIndex:x,searchFn:N,debounceDelay:I,selectId:M,optionValuesRef:E}=Rw(),_=(0,p.useMemo)(()=>{const t=g();let n=-1;if(t){let r=p.Children.toArray(e);r.length>0&&(0,p.isValidElement)(r[0])&&r[0].type===Bw&&(r=p.Children.toArray(e).map(e=>(0,p.isValidElement)(e)?p.Children.toArray(e.props.children):[]).flat()),n=r.findIndex(e=>{if(!(0,p.isValidElement)(e))return!1;const n=e.props.value;return"object"==typeof n&&"object"==typeof t?n[b]===t[b]:n===t})}return n},[m,h,e,b]);(0,p.useLayoutEffect)(()=>{n||(d(_),f(_))},[_,n]),(0,p.useLayoutEffect)(()=>{n&&(a&&[-1,null].includes(x)||d(-1))},[w,n]);const S=(0,p.useMemo)(()=>{let t=0,n=0;p.Children.forEach(e,e=>{if((0,p.isValidElement)(e)&&e.type===Bw){let n=!1;if(w&&!N){const t=w.toLowerCase(),r=(e.props.label?.toLowerCase()||"").includes(t),o=p.Children.toArray(e.props.children).some(e=>!!(0,p.isValidElement)(e)&&(Lw(e.props.children)?.toLowerCase()).includes(t));n=r||o}else n=!0;n&&t++}}),n=Math.max(0,t-1);let r=0,o=0;return E.current=[],p.Children.map(e,e=>{if(!(0,p.isValidElement)(e))return null;if(e.type===Bw){let t=!1;if(w&&!N){const n=w.toLowerCase();t=(e.props.label?.toLowerCase()||"").includes(n)}const a=p.Children.map(e.props.children,e=>{if(!(0,p.isValidElement)(e))return null;if(t){const t=r++;E.current[t]=e.props.value;const n={...e.props,index:t,id:`${M}-option-${t}`};return(0,p.cloneElement)(e,n)}if(w&&!N){const t=Lw(e.props.children)?.toLowerCase(),n=w.toLowerCase();if(!t?.includes(n))return null}const n=r++;E.current[n]=e.props.value;const o={...e.props,index:n,id:`${M}-option-${n}`};return(0,p.cloneElement)(e,o)});if(!a?.some(e=>null!==e))return null;const i={...e.props,children:a,index:o,totalGroups:n};return o++,(0,p.cloneElement)(e,i)}if(w&&!N){const t=Lw(e.props?.children)?.toLowerCase(),n=w.toLowerCase();if(!t?.includes(n))return null}const t=r++;return E.current[t]=e.props.value,(0,p.cloneElement)(e,{...e.props,index:t,id:`${M}-option-${t}`})})},[w,m,h,e,N,M,E]),D=p.Children.count(S);(0,p.useEffect)(()=>{y.current=[];let t=p.Children.toArray(e);t&&(0,p.isValidElement)(t[0])&&t[0].type===Bw&&(t=p.Children.toArray(t).map(e=>(0,p.isValidElement)(e)?e.props.children:null).filter(Boolean)),p.Children.forEach(t,e=>{if(!(0,p.isValidElement)(e))return;const t=Lw(e.props?.children)?.toLowerCase();if(w&&!N){const e=w.toLowerCase();if(!t?.includes(e))return}y.current.push(t)})},[w,N]);const[j,k]=(0,p.useState)(!1),A=(0,p.useCallback)(async()=>{if(N&&"function"==typeof N&&!j){k(!0);try{await N(w)}catch(e){console.error(e)}finally{k(!1)}}},[w]),T=((e,t=500)=>{const n=(0,p.useRef)(null);return(0,p.useCallback)((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>e(...r),t)},[e,t])})(A,I);(0,p.useEffect)(()=>{"function"==typeof N&&T()},[T]);const L=(0,C.jsxs)("div",{ref:o.setFloating,className:Se("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg outline outline-1 outline-border-subtle",a&&!i&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",Dw[c].dropdown,!(a&&!i)&&"h-auto",a&&!i?"overflow-hidden":"overflow-y-auto overflow-x-hidden",t),style:{...s,zIndex:1},...l(),children:[a&&!i&&(0,C.jsxs)("div",{className:Se(Dw[c].searchbarWrapper),children:[j?(0,C.jsx)(zw,{className:Dw[c].searchbarIcon}):(0,C.jsx)(Sw,{className:Se("text-icon-secondary shrink-0",Dw[c].searchbarIcon)}),(0,C.jsx)("input",{className:Se("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",Dw[c].searchbar),type:"search",name:"keyword","aria-label":"Search options",placeholder:v,onChange:e=>u(e.target.value),value:w,autoComplete:"off"})]}),(0,C.jsxs)("div",{className:Se("overflow-y-auto overflow-x-hidden",!(a&&!i)&&"w-full h-full",Dw[c].dropdownItemsWrapper),children:[!!D&&S,!D&&(0,C.jsx)("div",{className:Se("p-2 text-center font-medium text-field-placeholder",Aw[c]),children:"No items found"})]})]});return(0,C.jsx)(C.Fragment,{children:n&&(0,C.jsx)(C.Fragment,{children:i?L:(0,C.jsx)(Kr,{context:r,modal:!1,visuallyHiddenDismiss:!0,children:L})})})}function Yw({children:e,root:t,id:n}){return(0,C.jsx)(Gr,{id:n,root:t,children:e})}function Zw({value:e,selected:t,children:n,className:r,...o}){const{sizeValue:a,getItemProps:i,onKeyDownItem:s,onClickItem:l,activeIndex:c,selectedIndex:u,updateListRef:d,getValues:f,by:m,multiple:h,inlineSearch:g}=Rw(),{index:w,id:y}=o,b=(0,p.useRef)(w),v=(0,p.useMemo)(()=>{if(!h)return!1;const t=f();return!!t&&Tw(t).some(t=>null!==t&&null!==e&&"object"==typeof t?t[m]===e[m]:t===e)},[e,f,h,m]),x=(0,p.useMemo)(()=>"boolean"==typeof t?t:h?v:w===u,[v,u,t,h,w]);let N;return g||(N=w===c?0:-1),(0,C.jsxs)("div",{id:y,className:Se("w-full flex items-center justify-between text-text-primary hover:bg-button-tertiary-hover rounded-md transition-all duration-150 cursor-pointer focus:outline-none focus-within:outline-none outline-none",Aw[a],w===c&&"bg-button-tertiary-hover",r),ref:e=>{d(w,e)},role:"option",tabIndex:N,"aria-selected":x&&w===c,...i({onClick(){l(b.current,e)},onKeyDown(t){s(t,b.current,e)}}),children:[(0,C.jsx)("span",{className:"w-full truncate",children:n}),x&&(0,C.jsx)(Oo,{className:Se("text-icon-on-color-disabled",{sm:"size-4",md:"size-4",lg:"size-5"}[a])})]})}const Vw=({id:e,size:t="md",value:n,defaultValue:r,onChange:o,by:a="id",children:i,multiple:s=!1,combobox:l=!1,inlineSearch:c=!1,disabled:u=!1,searchPlaceholder:d="Search...",searchFn:f,debounceDelay:m=500})=>{const h=(0,p.useMemo)(()=>e||`select-${cw()}`,[e]),g=(0,p.useMemo)(()=>typeof n<"u",[n]),[w,y]=(0,p.useState)(r),[b,v]=(0,p.useState)(""),x=(0,p.useCallback)(()=>g?n:w,[g,n,w]),[N,I]=(0,p.useState)(!1),[M,E]=(0,p.useState)(null),[_,S]=(0,p.useState)(null),D={sm:l&&!c?256:172,md:l&&!c?256:216,lg:l&&!c?256:216},{refs:j,floatingStyles:k,context:A}=uo({strategy:"fixed",placement:"bottom-start",open:N,onOpenChange:I,whileElementsMounted:Cn,middleware:[Bn(5),Yn({padding:10}),Zn({apply({rects:e,elements:n,availableHeight:r}){Object.assign(n.floating.style,{maxHeight:`min(${r}px, ${D[t]}px)`,maxWidth:`${e.reference.width}px`})},padding:10})]}),T=(0,p.useRef)([]),L=(0,p.useRef)([]),O=(0,p.useRef)(!1),z=(0,p.useRef)([]);(0,p.useEffect)(()=>{N||v("")},[N]);const P=ao(A,{event:"mousedown",enabled:!c}),R=co(A),U=Io(A,{role:"listbox"}),B=xo(A,{listRef:T,activeIndex:M,selectedIndex:_,onNavigate:E,loop:!0,virtual:c}),F=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:a,activeIndex:i,onMatch:s,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:f=[],selectedIndex:m=null}=t,h=p.useRef(),g=p.useRef(""),w=p.useRef(null!=(n=null!=m?m:i)?n:-1),y=p.useRef(null),b=Hn(s),v=Hn(l),x=xr(u),N=xr(f);ir(()=>{r&&(clearTimeout(h.current),y.current=null,g.current="")},[r]),ir(()=>{var e;r&&""===g.current&&(w.current=null!=(e=null!=m?m:i)?e:-1)},[r,m,i]);const I=Hn(e=>{e?o.current.typing||(o.current.typing=e,v(e)):o.current.typing&&(o.current.typing=e,v(e))}),M=Hn(e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return r?e.indexOf(r):-1}const n=a.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?I(!1):" "===e.key&&Mt(e)),null==n||N.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Mt(e),I(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&g.current===e.key&&(g.current="",w.current=y.current),g.current+=e.key,clearTimeout(h.current),h.current=setTimeout(()=>{g.current="",w.current=y.current,I(!1)},d);const o=w.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",I(!1))}),E=p.useMemo(()=>({onKeyDown:M}),[M]),_=p.useMemo(()=>({onKeyDown:M,onKeyUp(e){" "===e.key&&I(!1)}}),[M,I]);return p.useMemo(()=>c?{reference:E,floating:_}:{},[c,E,_])}(A,{listRef:L,activeIndex:M,selectedIndex:_,onMatch:N?E:S,onTypingChange(e){O.current=e}}),{getReferenceProps:Y,getFloatingProps:Z,getItemProps:V}=ho([R,U,B,P,...l||c?[]:[F]]),G=(e,t)=>{if(s)return((e,t)=>{const n=[...Tw(x())],r=n.findIndex(e=>null!==e&&null!==t&&"object"==typeof e?e[a]===t[a]:e===t);-1!==r?(n.splice(r,1),_===e&&S(null)):(n.push(t),S(e)),g||y(n),c&&(j.domReference.current??j.reference.current)?.focus(),v(""),"function"==typeof o&&o(n)})(e,t);S(e),g||y(t),(j.domReference.current??j.reference.current)?.focus(),I(!1),v(""),"function"==typeof o&&o(t)},W=(0,p.useCallback)((e,t)=>{T.current[e]=t},[]);return(0,C.jsx)(Pw.Provider,{value:{selectedIndex:_,setSelectedIndex:S,activeIndex:M,setActiveIndex:E,selected:w,setSelected:y,handleSelect:G,combobox:l,inlineSearch:c,optionValuesRef:z,sizeValue:t,multiple:s,onChange:o,isTypingRef:O,getItemProps:V,onClickItem:(e,t)=>{G(e,t)},onKeyDownItem:(e,t,n)=>{"Enter"===e.key&&(e.preventDefault(),G(t,n))," "===e.key&&!O.current&&(e.preventDefault(),G(t,n))},getValues:x,selectId:h,getReferenceProps:Y,isOpen:N,value:n,updateListRef:W,refs:j,listContentRef:L,by:a,getFloatingProps:Z,floatingStyles:k,context:A,searchKeyword:b,setSearchKeyword:v,disabled:u,isControlled:g,searchPlaceholder:d,searchFn:f,debounceDelay:m},children:i})};Vw.displayName="Select";const Gw=Object.assign(Vw,{Portal:Yw,Button:Uw,Options:Fw,Option:Zw,OptionGroup:Bw});Yw.displayName="Select.Portal",Uw.displayName="Select.Button",Fw.displayName="Select.Options",Zw.displayName="Select.Option",Bw.displayName="Select.OptionGroup";const Ww=function(e){const{name:t,id:n,label:r,desc:o,tooltip:a,options:s,onSelect:l,prodata:c,after:u,sectionClass:d="",wrapperClass:f="",contentClass:p="",labelClass:m="",descClass:h="",displayAlign:g="horizontal",isDisabled:w=!1,size:y="md"}=e,[b,v]=(0,i.useState)(e.value),x=(0,i.useRef)(null),N=d||"text-left",I=m||"text-sm font-medium text-text-primary mb-2",M=h||"text-sm font-normal text-text-tertiary mt-2";let E=f||"flex items-center gap-2.5",_=p||"";return"horizontal_inline"===g?(E="flex items-center justify-between gap-2.5",_="w-[300px]"):"horizontal"!==g&&(E="block w-full text-left"),(0,i.useEffect)(()=>{v(e.value),x.current&&(x.current.value=e.value)},[e.value]),(0,i.createElement)("div",{className:`wcf-field wcf-select-option ${N}`},(0,i.createElement)("div",{className:`wcf-field__data ${E}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${I}`},(0,i.createElement)("label",{htmlFor:n||t},r,a&&(0,i.createElement)(n_,{text:a}))),(0,i.createElement)("div",{className:`wcf-field__data--content ${_}`},(0,i.createElement)("input",{type:"hidden",ref:x,id:n||t,name:t,defaultValue:b,className:e.class?e.class:""}),(0,i.createElement)(Gw,{value:b,onChange:function(n){if(c&&n in c)return;v(n),x.current&&(x.current.value=n);const r={target:{value:n,name:t}},o=new CustomEvent("wcf:select:change",{bubbles:!0,detail:{e:r,name:e.name,value:n}});document.dispatchEvent(o),e?.callback&&e.callback(r,e.name,n),l&&l(r)},disabled:w,size:y},(0,i.createElement)(Gw.Button,{type:"button",className:e.class?e.class:"",render:function(e){if(!e)return null;for(const t of s||[])if(t.isopt){for(const n of t.options||[])if(String(n.value)===String(e))return n.label}else if(String(t.value)===String(e))return c&&e in c?c[e]:t.label;return e}}),(0,i.createElement)(Gw.Options,null,s&&s.map(e=>{if(e.isopt)return(0,i.createElement)(Gw.OptionGroup,{label:e.title,key:e.title},e.options.map(e=>(0,i.createElement)(Gw.Option,{value:e.value,key:e.value},e.label)));let t=e.label,n=!1;return c&&e.value in c&&(t=c[e.value],n=!0),(0,i.createElement)(Gw.Option,{value:e.value,key:e.value,className:n?"opacity-50 pointer-events-none":""},t)})))),u&&(0,i.createElement)("div",{className:`wcf-field__data--content__after ${M}`},u)),o&&(0,i.createElement)("div",{className:`wcf-field__desc ${M}`},Nh(o)))},Hw=To("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),Qw=(0,p.forwardRef)(({id:e,type:t="text",defaultValue:n="",value:r,size:o="sm",className:a="",disabled:i=!1,onChange:s=()=>{},error:l=!1,onError:c=()=>{},prefix:u=null,suffix:d=null,label:f="",...m},h)=>{const g=(0,p.useRef)(null),w=(0,p.useMemo)(()=>e||`input-${t}-${cw()}`,[e]),y=(0,p.useMemo)(()=>typeof r<"u",[r]),[b,v]=(0,p.useState)(n),[x,N]=(0,p.useState)(null),I=(0,p.useCallback)(()=>y?r:b,[y,r,b]),M=e=>{if(i)return;let n;"file"===t?(n=e.target.files,n&&n.length>0?N(n[0].name):N(null)):n=e.target.value,!y&&"file"!==t&&v(n),"function"==typeof s&&s(n)},E=()=>{N(null),g.current&&(g.current.value=""),s(null)},_="bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full outline outline-1 outline-border-subtle border-none transition-[color,box-shadow,outline] duration-200",S={xs:"px-2 py-1 rounded",sm:"p-3 py-2 rounded",md:"p-3.5 py-2.5 rounded-md",lg:"p-4 py-3 rounded-lg"},D={xs:"text-xs font-medium",sm:"text-sm font-medium",md:"text-sm font-medium",lg:"text-base font-medium"},j={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-base"},k={sm:u?"pl-8":"",md:u?"pl-9":"",lg:u?"pl-10":""},A={sm:d?"pr-8":"",md:d?"pr-9":"",lg:d?"pr-10":""},T=i?"hover:outline-border-disabled":"hover:outline-border-strong",L="focus:outline-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",O=l?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",z=l?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",P=i?"outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",R=i?"outline-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",U="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",B=i?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",F={xs:"[&>svg]:size-4",sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6"},Y=(0,p.useMemo)(()=>f?(0,C.jsx)(cp,{className:Se(D[o]),htmlFor:w,...m?.required&&{required:!0},children:f}):null,[f,o,w]),Z=x?"file:border-0 file:bg-transparent pr-10":"text-text-tertiary file:border-0 file:bg-transparent pr-10";return"file"===t?(0,C.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[Y,(0,C.jsxs)("div",{className:Se("w-full relative flex focus-within:z-10",a),children:[(0,C.jsx)("input",{ref:Go(g,h),id:w,type:"file",className:Se(_,R,S[o],j[o],L,T,z,Z),disabled:i,onChange:M,onInvalid:c,...l&&{"aria-invalid":!0},...m}),(0,C.jsx)("div",{className:Se(B,"right-0 pr-3",F[o]),"aria-hidden":"true",children:(0,C.jsx)(Hw,{})})]})]}):(0,C.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[Y,(0,C.jsxs)("div",{className:Se("w-full relative flex focus-within:z-10",a),children:[u?(0,C.jsx)("div",{className:Se(U,"left-0 pl-3",j[o]),children:u}):null,(0,C.jsx)("input",{ref:Go(g,h),id:w,type:t,className:Se(_,P,S[o],j[o],k[o],A[o],L,T,O),disabled:i,onChange:M,onInvalid:c,value:I(),...l&&{"aria-invalid":!0},...m}),"file"===t?x?(0,C.jsx)("div",{className:Se(B,"right-0 pr-3 cursor-pointer z-20 pointer-events-auto",F[o]),onClick:E,role:"button",tabIndex:0,"aria-label":"Remove file",onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&E()},children:(0,C.jsx)(Ho,{"aria-hidden":"true"})}):(0,C.jsx)("div",{className:Se(B,"right-0 pr-3",F[o]),"aria-hidden":"true",children:(0,C.jsx)(Hw,{})}):d?(0,C.jsx)("div",{className:Se(U,"right-0 pr-3",j[o]),children:d}):null]})]})});Qw.displayName="Input";const $w=function(e){const{name:t,id:n,label:r,value:o,placeholder:a,tooltip:s,desc:l,readonly:c,icon:u,textFieldType:d="text",onChangeCB:f,sectionClass:p=!1,wrapperClass:m=!1,contentClass:h,labelClass:g="",descClass:w="text-sm font-normal text-text-tertiary mt-2",displayAlign:y="horizontal",size:b="md",attr:v}=e,[x,N]=(0,i.useState)(o),I=(0,i.useRef)(null),M=p||"text-left",E=`${e.class?e.class:""} ${c?"bg-background-secondary":""} w-full`;let _=m||"flex items-center justify-between gap-2.5",S=g||"text-sm font-medium text-text-primary text-left";const D=null!=h?h:r&&"horizontal"===y?"w-1/2":"w-full";return"horizontal"!==y&&(_="block w-full text-left",S+=" mb-2"),(0,i.useEffect)(()=>{N(o),I.current&&(I.current.value=null!=o?o:"")},[o]),(0,i.createElement)("div",{className:`wcf-field wcf-text-field ${M} `},(0,i.createElement)("div",{className:`wcf-field__data ${_}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${S}`},(0,i.createElement)("label",{className:"whitespace-nowrap",htmlFor:n||t},r,s&&(0,i.createElement)(n_,{text:s}))),(0,i.createElement)("div",{className:`wcf-field__data--content ${D}`},(0,i.createElement)("input",{type:"hidden",ref:I,className:e.class?e.class:"",defaultValue:null!=x?x:""}),(0,i.createElement)(Qw,{ref:v?.ref,type:d,value:Um(x),id:n||t,name:t,onChange:function(e){N(e),I.current&&(I.current.value=e);const n=new CustomEvent("wcf:text:change",{bubbles:!0,detail:{e:{target:{value:e,name:t}},name:t,value:e}});document.dispatchEvent(n),f&&f(e)},placeholder:a,readOnly:c,size:b,className:E}))),u&&(0,i.createElement)("div",{className:"wcf-text-field__icon"},(0,i.createElement)("span",{className:u})),l&&(0,i.createElement)("div",{className:`wcf-field__desc ${w}`},Nh(l)))},Xw=e=>"number"==typeof e?`${e}px`:e,Jw=(0,p.forwardRef)(({id:e,defaultValue:t="",value:n,size:r="sm",className:o="",disabled:a=!1,onChange:i=()=>{},error:s=!1,onError:l=()=>{},autoResize:c=!1,minHeight:u,maxHeight:d=160,style:f,...m},h)=>{const g=(0,p.useRef)(null),w=(0,p.useMemo)(()=>e||`input-textarea-${cw()}`,[e]),y=(0,p.useMemo)(()=>typeof n<"u",[n]),[b,v]=(0,p.useState)(t),x=(0,p.useCallback)(()=>y?n:b,[y,n,b]);(0,p.useLayoutEffect)(()=>{if(!c)return;const e=g.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},[c,x(),u,d]);const N=a?"hover:border-border-disabled":"hover:border-border-strong",I=s?"focus:border-focus-error-border focus:ring-field-color-error border-focus-error-border":"",M=a?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",E={...f??{},minHeight:Xw(u),maxHeight:Xw(d),...c&&{resize:"none",overflow:null!==d?"auto":"hidden"}};return(0,C.jsx)("textarea",{ref:Go(g,h),id:w,className:Se("py-2 rounded border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary focus:outline-none focus-visible:outline-none transition ease-in-out duration-200",M,{sm:"px-3 rounded text-xs",md:"px-3 rounded-md text-sm",lg:"px-4 rounded-lg text-base"}[r],"focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",N,I,o),disabled:a,onChange:e=>{if(a)return;const t=e.target.value;y||v(t),"function"==typeof i&&i(t)},onInvalid:l,value:x(),style:E,...s&&{"aria-invalid":!0},...m})});Jw.displayName="TextArea";const qw=function(e){const{name:t,value:n,label:r,desc:o,id:a,placeholder:s,tooltip:l,rows:c,cols:u,sectionClass:d=!1,wrapperClass:f=!1,labelClass:p="",descClass:m="text-sm font-normal text-text-tertiary mt-2",displayAlign:h="horizontal",size:g="md"}=e,w=d||"text-left",y=`${e.class?e.class:""} !w-full !max-w-full input-field !px-3 !py-2.5 !text-sm font-normal`;let b=f||"flex flex-col gap-2.5",v=p||"text-sm font-medium text-text-primary text-left mb-2";"horizontal"!==h&&(b="block w-full text-left",v+=" mb-2");const[x,N]=(0,i.useState)(n);return(0,i.useEffect)(()=>{N(n)},[n]),(0,i.createElement)("div",{className:`wcf-field wcf-textarea-field ${w} `},(0,i.createElement)("div",{className:`wcf-field__data ${b}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${v}`},(0,i.createElement)("label",{htmlFor:a||t},r,l&&(0,i.createElement)(n_,{text:l}))),(0,i.createElement)("div",{className:"wcf-field__data--content w-full"},(0,i.createElement)(Jw,{id:a||t,size:g,name:t,value:Um(x),onChange:function(e){N(e);const n=new CustomEvent("wcf:textarea:change",{bubbles:!0,detail:{e:{target:{value:e,name:t}},name:t,value:e}});document.dispatchEvent(n)},placeholder:s,rows:c||"10",cols:u||"60",className:y}))),o&&(0,i.createElement)("div",{className:`wcf-field__desc ${m}`},Nh(o)))},Kw=function(e){const{name:t,value:n,label:r,id:o,tooltip:a,displayAlign:s="horizontal",language:l="javascript",sectionClass:c=!1,wrapperClass:u=!1,labelClass:d=""}=e,f=function(e){if(!e)return e;const t=document.createElement("textarea");return t.innerHTML=e,t.value}(n),p=(0,i.useRef)(null),m=(0,i.useRef)(null),h=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!p.current||!window.wp?.codeEditor||m.current)return;const e=wp.codeEditor.defaultSettings?JSON.parse(JSON.stringify(wp.codeEditor.defaultSettings)):{};let n;e.codemirror={...e.codemirror,mode:"css"===l?"css":"javascript",lineNumbers:!0,indentUnit:4,tabSize:4};try{n=wp.codeEditor.initialize(p.current,e),m.current=n.codemirror}catch(e){return}m.current.on("change",e=>{const n=e.getValue(),r=new CustomEvent("wcf:code:change",{bubbles:!0,detail:{name:t,value:n}});document.dispatchEvent(r)});const r=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&m.current&&m.current.refresh()})},{threshold:.1});return h.current&&r.observe(h.current),()=>{m.current&&(m.current.toTextArea(),m.current=null),r.disconnect()}},[]);const g=c||"text-left",w=d||"text-sm font-medium text-text-primary text-left mb-2";let y=u||"flex items-center gap-2.5";return"horizontal"!==s&&(y="block w-full text-left"),(0,i.createElement)("div",{ref:h,className:`wcf-field wcf-code-field ${g}`},(0,i.createElement)("div",{className:`wcf-field__data ${y}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${w}`},(0,i.createElement)("label",{htmlFor:o},r,a&&(0,i.createElement)(n_,{text:a}))),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("textarea",{ref:p,id:o,name:t,defaultValue:f}))))},ey=To("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),ty=(0,i.forwardRef)((e,t)=>{const[{settingsProcess:n},r]=l();"saved"===n&&setTimeout(()=>{document.getElementsByClassName("wcf-button--save-global-settings")[0].blur(),r({status:"RESET"})},2e3);const o=e.icon?e.icon:"",a=e.iconClass?e.iconClass:"",s=e.className||e.class||"",c="processing"===n?"wcf-disabled":"";return(0,i.createElement)("div",{className:"wcf-field wcf-submit wcf-submit-field"},(0,i.createElement)(Ro,{ref:t,type:"submit",variant:"primary",className:`wcf-button--save-global-settings ${s} ${c}`,onClick:function(e){const t=e.target.closest("form");!t||t.checkValidity()?r({status:"PROCESSING"}):t.reportValidity()},loading:"processing"===n,icon:function(){if("processing"===n)return(0,i.createElement)(zw,{size:"sm",variant:"secondary",className:a});if("saved"===n)return(0,i.createElement)(Oo,{className:`w-4 h-4 stroke-2 ${a}`});switch(o){case"plus":return(0,i.createElement)(ey,{className:`w-4 h-4 stroke-2 ${a}`});case"loader":return(0,i.createElement)(Np,{className:`w-4 h-4 stroke-2 ${a}`});case"close":return(0,i.createElement)(Ho,{className:`w-4 h-4 stroke-2 ${a}`});case"check":return(0,i.createElement)(Oo,{className:`w-4 h-4 stroke-2 ${a}`});default:return null}}()},"saved"===n&&(0,j.__)("Settings Saved","cartflows"),"processing"===n&&(0,j.__)("Saving…","cartflows"),!n&&(0,j.__)("Save Settings","cartflows")))}),ny=ty;function ry(e){return ry="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},ry(e)}function oy(e){var t=function(e){if("object"!=ry(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ry(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ry(t)?t:t+""}function ay(e,t,n){return(t=oy(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 sy(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){ay(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}function ly(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,oy(r.key),r)}}var cy=n(3662);function uy(e){return uy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uy(e)}function dy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(dy=function(){return!!e})()}function fy(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 py(e,t){if(e){if("string"==typeof e)return fy(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)?fy(e,t):void 0}}function my(e){return function(e){if(Array.isArray(e))return fy(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||py(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 hy=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}(),gy=Math.abs,wy=String.fromCharCode,yy=Object.assign;function by(e){return e.trim()}function vy(e,t,n){return e.replace(t,n)}function xy(e,t){return e.indexOf(t)}function Ny(e,t){return 0|e.charCodeAt(t)}function Iy(e,t,n){return e.slice(t,n)}function My(e){return e.length}function Ey(e){return e.length}function _y(e,t){return t.push(e),e}var Sy=1,Dy=1,jy=0,ky=0,Cy=0,Ay="";function Ty(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:Sy,column:Dy,length:i,return:""}}function Ly(e,t){return yy(Ty("",null,null,"",null,null,0),e,{length:-e.length},t)}function Oy(){return Cy=ky>0?Ny(Ay,--ky):0,Dy--,10===Cy&&(Dy=1,Sy--),Cy}function zy(){return Cy=ky<jy?Ny(Ay,ky++):0,Dy++,10===Cy&&(Dy=1,Sy++),Cy}function Py(){return Ny(Ay,ky)}function Ry(){return ky}function Uy(e,t){return Iy(Ay,e,t)}function By(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 Fy(e){return Sy=Dy=1,jy=My(Ay=e),ky=0,[]}function Yy(e){return Ay="",e}function Zy(e){return by(Uy(ky-1,Wy(91===e?e+2:40===e?e+1:e)))}function Vy(e){for(;(Cy=Py())&&Cy<33;)zy();return By(e)>2||By(Cy)>3?"":" "}function Gy(e,t){for(;--t&&zy()&&!(Cy<48||Cy>102||Cy>57&&Cy<65||Cy>70&&Cy<97););return Uy(e,Ry()+(t<6&&32==Py()&&32==zy()))}function Wy(e){for(;zy();)switch(Cy){case e:return ky;case 34:case 39:34!==e&&39!==e&&Wy(Cy);break;case 40:41===e&&Wy(e);break;case 92:zy()}return ky}function Hy(e,t){for(;zy()&&e+Cy!==57&&(e+Cy!==84||47!==Py()););return"/*"+Uy(t,ky-1)+"*"+wy(47===e?e:zy())}function Qy(e){for(;!By(Py());)zy();return Uy(e,ky)}var $y="-ms-",Xy="-moz-",Jy="-webkit-",qy="comm",Ky="rule",eb="decl",tb="@keyframes";function nb(e,t){for(var n="",r=Ey(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function rb(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case eb:return e.return=e.return||e.value;case qy:return"";case tb:return e.return=e.value+"{"+nb(e.children,r)+"}";case Ky:e.value=e.props.join(",")}return My(n=nb(e.children,r))?e.return=e.value+"{"+n+"}":""}function ob(e){return Yy(ab("",null,null,null,[""],e=Fy(e),0,[0],e))}function ab(e,t,n,r,o,a,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,m=0,h=1,g=1,w=1,y=0,b="",v=o,x=a,N=r,I=b;g;)switch(m=y,y=zy()){case 40:if(108!=m&&58==Ny(I,d-1)){-1!=xy(I+=vy(Zy(y),"&","&\f"),"&\f")&&(w=-1);break}case 34:case 39:case 91:I+=Zy(y);break;case 9:case 10:case 13:case 32:I+=Vy(m);break;case 92:I+=Gy(Ry()-1,7);continue;case 47:switch(Py()){case 42:case 47:_y(sb(Hy(zy(),Ry()),t,n),l);break;default:I+="/"}break;case 123*h:s[c++]=My(I)*w;case 125*h:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==w&&(I=vy(I,/\f/g,"")),p>0&&My(I)-d&&_y(p>32?lb(I+";",r,n,d-1):lb(vy(I," ","")+";",r,n,d-2),l);break;case 59:I+=";";default:if(_y(N=ib(I,t,n,c,u,o,s,b,v=[],x=[],d),a),123===y)if(0===u)ab(I,t,N,N,v,a,d,s,x);else switch(99===f&&110===Ny(I,3)?100:f){case 100:case 108:case 109:case 115:ab(e,N,N,r&&_y(ib(e,N,N,0,0,o,s,b,o,v=[],d),x),o,x,d,s,r?v:x);break;default:ab(I,N,N,N,[""],x,0,s,x)}}c=u=p=0,h=w=1,b=I="",d=i;break;case 58:d=1+My(I),p=m;default:if(h<1)if(123==y)--h;else if(125==y&&0==h++&&125==Oy())continue;switch(I+=wy(y),y*h){case 38:w=u>0?1:(I+="\f",-1);break;case 44:s[c++]=(My(I)-1)*w,w=1;break;case 64:45===Py()&&(I+=Zy(zy())),f=Py(),u=d=My(b=I+=Qy(Ry())),y++;break;case 45:45===m&&2==My(I)&&(h=0)}}return a}function ib(e,t,n,r,o,a,i,s,l,c,u){for(var d=o-1,f=0===o?a:[""],p=Ey(f),m=0,h=0,g=0;m<r;++m)for(var w=0,y=Iy(e,d+1,d=gy(h=i[m])),b=e;w<p;++w)(b=by(h>0?f[w]+" "+y:vy(y,/&\f/g,f[w])))&&(l[g++]=b);return Ty(e,t,n,0===o?Ky:s,l,c,u)}function sb(e,t,n){return Ty(e,t,n,qy,wy(Cy),Iy(e,2,-2),0)}function lb(e,t,n,r){return Ty(e,t,n,eb,Iy(e,0,r),Iy(e,r+1,-1),r)}var cb=function(e,t,n){for(var r=0,o=0;r=o,o=Py(),38===r&&12===o&&(t[n]=1),!By(o);)zy();return Uy(e,ky)},ub=new WeakMap,db=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)||ub.get(n))&&!r){ub.set(e,!0);for(var o=[],a=function(e,t){return Yy(function(e,t){var n=-1,r=44;do{switch(By(r)){case 0:38===r&&12===Py()&&(t[n]=1),e[n]+=cb(ky-1,t,n);break;case 2:e[n]+=Zy(r);break;case 4:if(44===r){e[++n]=58===Py()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=wy(r)}}while(r=zy());return e}(Fy(e),t))}(t,o),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=o[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},fb=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function pb(e,t){switch(function(e,t){return 45^Ny(e,0)?(((t<<2^Ny(e,0))<<2^Ny(e,1))<<2^Ny(e,2))<<2^Ny(e,3):0}(e,t)){case 5103:return Jy+"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 Jy+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Jy+e+Xy+e+$y+e+e;case 6828:case 4268:return Jy+e+$y+e+e;case 6165:return Jy+e+$y+"flex-"+e+e;case 5187:return Jy+e+vy(e,/(\w+).+(:[^]+)/,Jy+"box-$1$2"+$y+"flex-$1$2")+e;case 5443:return Jy+e+$y+"flex-item-"+vy(e,/flex-|-self/,"")+e;case 4675:return Jy+e+$y+"flex-line-pack"+vy(e,/align-content|flex-|-self/,"")+e;case 5548:return Jy+e+$y+vy(e,"shrink","negative")+e;case 5292:return Jy+e+$y+vy(e,"basis","preferred-size")+e;case 6060:return Jy+"box-"+vy(e,"-grow","")+Jy+e+$y+vy(e,"grow","positive")+e;case 4554:return Jy+vy(e,/([^-])(transform)/g,"$1"+Jy+"$2")+e;case 6187:return vy(vy(vy(e,/(zoom-|grab)/,Jy+"$1"),/(image-set)/,Jy+"$1"),e,"")+e;case 5495:case 3959:return vy(e,/(image-set\([^]*)/,Jy+"$1$`$1");case 4968:return vy(vy(e,/(.+:)(flex-)?(.*)/,Jy+"box-pack:$3"+$y+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Jy+e+e;case 4095:case 3583:case 4068:case 2532:return vy(e,/(.+)-inline(.+)/,Jy+"$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(My(e)-1-t>6)switch(Ny(e,t+1)){case 109:if(45!==Ny(e,t+4))break;case 102:return vy(e,/(.+:)(.+)-([^]+)/,"$1"+Jy+"$2-$3$1"+Xy+(108==Ny(e,t+3)?"$3":"$2-$3"))+e;case 115:return~xy(e,"stretch")?pb(vy(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Ny(e,t+1))break;case 6444:switch(Ny(e,My(e)-3-(~xy(e,"!important")&&10))){case 107:return vy(e,":",":"+Jy)+e;case 101:return vy(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Jy+(45===Ny(e,14)?"inline-":"")+"box$3$1"+Jy+"$2$3$1"+$y+"$2box$3")+e}break;case 5936:switch(Ny(e,t+11)){case 114:return Jy+e+$y+vy(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Jy+e+$y+vy(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Jy+e+$y+vy(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Jy+e+$y+e+e}return e}var mb=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case eb:e.return=pb(e.value,e.length);break;case tb:return nb([Ly(e,{value:vy(e.value,"@","@"+Jy)})],r);case Ky: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 nb([Ly(e,{props:[vy(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return nb([Ly(e,{props:[vy(t,/:(plac\w+)/,":"+Jy+"input-$1")]}),Ly(e,{props:[vy(t,/:(plac\w+)/,":-moz-$1")]}),Ly(e,{props:[vy(t,/:(plac\w+)/,$y+"input-$1")]})],r)}return""})}}],hb=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,a=e.stylisPlugins||mb,i={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u,d,f=[rb,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],p=(c=[db,fb].concat(a,f),u=Ey(c),function(e,t,n,r){for(var o="",a=0;a<u;a++)o+=c[a](e,t,n,r)||"";return o});o=function(e,t,n,r){l=n,nb(ob(e?e+"{"+t.styles+"}":t.styles),p),r&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new hy({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:o};return m.sheet.hydrate(s),m},gb=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},wb={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 yb(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var bb=/[A-Z]|^ms/g,vb=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xb=function(e){return 45===e.charCodeAt(1)},Nb=function(e){return null!=e&&"boolean"!=typeof e},Ib=yb(function(e){return xb(e)?e:e.replace(bb,"-$&").toLowerCase()}),Mb=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(vb,function(e,t,n){return _b={name:t,styles:n,next:_b},t})}return 1===wb[e]||xb(e)||"number"!=typeof t||0===t?t:t+"px"};function Eb(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 _b={name:o.name,styles:o.styles,next:_b},o.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)_b={name:i.name,styles:i.styles,next:_b},i=i.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Eb(e,t,n[o])+";";else for(var a in n){var i=n[a];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?r+=a+"{"+t[s]+"}":Nb(s)&&(r+=Ib(a)+":"+Mb(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Eb(e,t,i);switch(a){case"animation":case"animationName":r+=Ib(a)+":"+l+";";break;default:r+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Nb(i[c])&&(r+=Ib(a)+":"+Mb(a,i[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=_b,l=n(e);return _b=s,Eb(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var _b,Sb=/label:\s*([^\s;{]+)\s*(;|$)/g;function Db(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="";_b=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,o+=Eb(n,t,a)):o+=a[0];for(var i=1;i<e.length;i++)o+=Eb(n,t,e[i]),r&&(o+=a[i]);Sb.lastIndex=0;for(var s,l="";null!==(s=Sb.exec(o));)l+="-"+s[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)+l;return{name:c,styles:o,next:_b}}var jb,kb,Cb=!!p.useInsertionEffect&&p.useInsertionEffect,Ab=Cb||function(e){return e()},Tb=(Cb||p.useLayoutEffect,p.createContext("undefined"!=typeof HTMLElement?hb({key:"css"}):null)),Lb=(Tb.Provider,function(e){return(0,p.forwardRef)(function(t,n){var r=(0,p.useContext)(Tb);return e(t,r,n)})}),Ob=p.createContext({}),zb={}.hasOwnProperty,Pb="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Rb=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return gb(t,n,r),Ab(function(){return function(e,t,n){gb(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},Ub=Lb(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var o=e[Pb],a=[r],i="";"string"==typeof e.className?i=function(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}(t.registered,a,e.className):null!=e.className&&(i=e.className+" ");var s=Db(a,void 0,p.useContext(Ob));i+=t.key+"-"+s.name;var l={};for(var c in e)zb.call(e,c)&&"css"!==c&&c!==Pb&&(l[c]=e[c]);return l.className=i,n&&(l.ref=n),p.createElement(p.Fragment,null,p.createElement(Rb,{cache:t,serialized:s,isStringTag:"string"==typeof o}),p.createElement(o,l))}),Bb=Ub,Fb=(n(4146),function(e,t){var n=arguments;if(null==t||!zb.call(t,"css"))return p.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=Bb,o[1]=function(e,t){var n={};for(var r in t)zb.call(t,r)&&(n[r]=t[r]);return n[Pb]=e,n}(e,t);for(var a=2;a<r;a++)o[a]=n[a];return p.createElement.apply(null,o)});function Yb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Db(t)}function Zb(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,a,i,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||py(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 Vb(e,t){if(null==e)return{};var n,r,o=(0,y.A)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}jb=Fb||(Fb={}),kb||(kb=jb.JSX||(jb.JSX={}));var Gb=p.useLayoutEffect,Wb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Hb=function(){};function Qb(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function $b(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 a=[].concat(r);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&a.push("".concat(Qb(e,i)));return a.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var Xb=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===ry(e)&&null!==e?[e]:[];var t},Jb=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,sy({},Vb(e,Wb))},qb=function(e,t,n){var r=e.cx,o=e.getStyles,a=e.getClassNames,i=e.className;return{css:o(t,e),className:r(null!=n?n:{},a(t,e),i)}};function Kb(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ev(e){return Kb(e)?window.pageYOffset:e.scrollTop}function tv(e,t){Kb(e)?window.scrollTo(0,t):e.scrollTop=t}function nv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hb,o=ev(e),a=t-o,i=0;!function t(){var s=function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}(i+=10,o,a,n);tv(e,s),i<n?window.requestAnimationFrame(t):r(e)}()}function rv(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?tv(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&tv(e,Math.max(t.offsetTop-o,0))}function ov(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var av=!1,iv={get passive(){return av=!0}},sv="undefined"!=typeof window?window:{};sv.addEventListener&&sv.removeEventListener&&(sv.addEventListener("p",Hb,iv),sv.removeEventListener("p",Hb,!1));var lv=av;function cv(e){return null!=e}function uv(e,t,n){return e?t:n}var dv=["children","innerProps"],fv=["children","innerProps"];var pv,mv=function(e){return"auto"===e?"bottom":e},hv=(0,p.createContext)(null),gv=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,a=e.menuPosition,i=e.menuShouldScrollIntoView,s=e.theme,l=((0,p.useContext)(hv)||{}).setPortalPlacement,c=(0,p.useRef)(null),u=Zb((0,p.useState)(r),2),d=u[0],f=u[1],m=Zb((0,p.useState)(null),2),h=m[0],g=m[1],w=s.spacing.controlHeight;return Gb(function(){var e=c.current;if(e){var t="fixed"===a,s=function(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,a=e.shouldScroll,i=e.isFixedPosition,s=e.controlHeight,l=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=l.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,m=f.height,h=f.top,g=n.offsetParent.getBoundingClientRect().top,w=i||Kb(u=l)?window.innerHeight:u.clientHeight,y=ev(l),b=parseInt(getComputedStyle(n).marginBottom,10),v=parseInt(getComputedStyle(n).marginTop,10),x=g-v,N=w-h,I=x+y,M=d-y-h,E=p-w+y+b,_=y+h-v,S=160;switch(o){case"auto":case"bottom":if(N>=m)return{placement:"bottom",maxHeight:t};if(M>=m&&!i)return a&&nv(l,E,S),{placement:"bottom",maxHeight:t};if(!i&&M>=r||i&&N>=r)return a&&nv(l,E,S),{placement:"bottom",maxHeight:i?N-b:M-b};if("auto"===o||i){var D=t,j=i?x:I;return j>=r&&(D=Math.min(j-b-s,t)),{placement:"top",maxHeight:D}}if("bottom"===o)return a&&tv(l,E),{placement:"bottom",maxHeight:t};break;case"top":if(x>=m)return{placement:"top",maxHeight:t};if(I>=m&&!i)return a&&nv(l,_,S),{placement:"top",maxHeight:t};if(!i&&I>=r||i&&x>=r){var k=t;return(!i&&I>=r||i&&x>=r)&&(k=i?x-v:I-v),a&&nv(l,_,S),{placement:"top",maxHeight:k}}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:i&&!t,isFixedPosition:t,controlHeight:w});f(s.maxHeight),g(s.placement),null==l||l(s.placement)}},[r,o,a,i,n,l,w]),t({ref:c,placerProps:sy(sy({},e),{},{placement:h||mv(o),maxHeight:d})})},wv=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return sy({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},yv=wv,bv=wv,vv=["size"],xv=["innerProps","isRtl","size"],Nv={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Iv=function(e){var t=e.size,n=Vb(e,vv);return Fb("svg",(0,w.A)({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Nv},n))},Mv=function(e){return Fb(Iv,(0,w.A)({size:20},e),Fb("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"}))},Ev=function(e){return Fb(Iv,(0,w.A)({size:20},e),Fb("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"}))},_v=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,a=r.colors;return sy({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?a.neutral60:a.neutral20,padding:2*o,":hover":{color:n?a.neutral80:a.neutral40}})},Sv=_v,Dv=_v,jv=function(){var e=Yb.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_"}}}(pv||(pv=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"]))),kv=function(e){var t=e.delay,n=e.offset;return Fb("span",{css:Yb({animation:"".concat(jv," 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"},"","")})},Cv=["data"],Av=["innerRef","isDisabled","isHidden","inputClassName"],Tv={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Lv={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":sy({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Tv)},Ov=function(e){return sy({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Tv)},zv=function(e){var t=e.children,n=e.innerProps;return Fb("div",n,t)},Pv={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Fb("div",(0,w.A)({},qb(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Fb(Mv,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,a=e.innerProps,i=e.menuIsOpen;return Fb("div",(0,w.A)({ref:o},qb(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":i}),a,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Fb("div",(0,w.A)({},qb(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Fb(Ev,null))},DownChevron:Ev,CrossIcon:Mv,Group:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,a=e.Heading,i=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return Fb("div",(0,w.A)({},qb(e,"group",{group:!0}),s),Fb(a,(0,w.A)({},i,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),l),Fb("div",null,t))},GroupHeading:function(e){var t=Jb(e);t.data;var n=Vb(t,Cv);return Fb("div",(0,w.A)({},qb(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Fb("div",(0,w.A)({},qb(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Fb("span",(0,w.A)({},t,qb(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=Jb(e),o=r.innerRef,a=r.isDisabled,i=r.isHidden,s=r.inputClassName,l=Vb(r,Av);return Fb("div",(0,w.A)({},qb(e,"input",{"input-container":!0}),{"data-value":n||""}),Fb("input",(0,w.A)({className:t({input:!0},s),ref:o,style:Ov(i),disabled:a},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=void 0===r?4:r,a=Vb(e,xv);return Fb("div",(0,w.A)({},qb(sy(sy({},a),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Fb(kv,{delay:0,offset:n}),Fb(kv,{delay:160,offset:!0}),Fb(kv,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return Fb("div",(0,w.A)({},qb(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 Fb("div",(0,w.A)({},qb(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,a=e.menuPlacement,i=e.menuPosition,s=(0,p.useRef)(null),l=(0,p.useRef)(null),c=Zb((0,p.useState)(mv(a)),2),u=c[0],d=c[1],f=(0,p.useMemo)(function(){return{setPortalPlacement:d}},[]),m=Zb((0,p.useState)(null),2),h=m[0],g=m[1],y=(0,p.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"===i?0:window.pageYOffset,n=e[u]+t;n===(null==h?void 0:h.offset)&&e.left===(null==h?void 0:h.rect.left)&&e.width===(null==h?void 0:h.rect.width)||g({offset:n,rect:e})}},[r,i,u,null==h?void 0:h.offset,null==h?void 0:h.rect.left,null==h?void 0:h.rect.width]);Gb(function(){y()},[y]);var b=(0,p.useCallback)(function(){"function"==typeof l.current&&(l.current(),l.current=null),r&&s.current&&(l.current=Cn(r,s.current,y,{elementResize:"ResizeObserver"in window}))},[r,y]);Gb(function(){b()},[b]);var v=(0,p.useCallback)(function(e){s.current=e,b()},[b]);if(!t&&"fixed"!==i||!h)return null;var x=Fb("div",(0,w.A)({ref:v},qb(sy(sy({},e),{},{offset:h.offset,position:i,rect:h.rect}),"menuPortal",{"menu-portal":!0}),o),n);return Fb(hv.Provider,{value:f},t?(0,dn.createPortal)(x,t):x)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,o=Vb(e,fv);return Fb("div",(0,w.A)({},qb(sy(sy({},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=Vb(e,dv);return Fb("div",(0,w.A)({},qb(sy(sy({},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,a=e.isDisabled,i=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return Fb(l,{data:r,innerProps:sy(sy({},qb(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:s},Fb(c,{data:r,innerProps:sy({},qb(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Fb(u,{data:r,innerProps:sy(sy({},qb(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},i),selectProps:s}))},MultiValueContainer:zv,MultiValueLabel:zv,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Fb("div",(0,w.A)({role:"button"},n),t||Fb(Mv,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,a=e.innerRef,i=e.innerProps;return Fb("div",(0,w.A)({},qb(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":n},i),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Fb("div",(0,w.A)({},qb(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return Fb("div",(0,w.A)({},qb(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return Fb("div",(0,w.A)({},qb(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 Fb("div",(0,w.A)({},qb(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},Rv=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Uv(e,t){return e===t||!(!Rv(e)||!Rv(t))}function Bv(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Uv(e[n],t[n]))return!1;return!0}for(var Fv={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"},Yv=function(e){return Fb("span",(0,w.A)({css:Fv},e))},Zv={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,a=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 a?"".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,a=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,a?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,a=void 0===o?"":o,i=e.selectValue,s=e.isDisabled,l=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&&i)return"value ".concat(a," focused, ").concat(u(i,n),".");if("menu"===t&&c){var d=s?" disabled":"",f="".concat(l?" selected":"").concat(d);return"".concat(a).concat(f,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Vv=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,a=e.isFocused,i=e.selectValue,s=e.selectProps,l=e.id,c=e.isAppleDevice,u=s.ariaLiveMessages,d=s.getOptionLabel,f=s.inputValue,m=s.isMulti,h=s.isOptionDisabled,g=s.isSearchable,w=s.menuIsOpen,y=s.options,b=s.screenReaderStatus,v=s.tabSelectsValue,x=s.isLoading,N=s["aria-label"],I=s["aria-live"],M=(0,p.useMemo)(function(){return sy(sy({},Zv),u||{})},[u]),E=(0,p.useMemo)(function(){var e,n="";if(t&&M.onChange){var r=t.option,o=t.options,a=t.removedValue,s=t.removedValues,l=t.value,c=a||r||(e=l,Array.isArray(e)?null:e),u=c?d(c):"",f=o||s||void 0,p=f?f.map(d):[],m=sy({isDisabled:c&&h(c,i),label:u,labels:p},t);n=M.onChange(m)}return n},[t,M,h,i,d]),_=(0,p.useMemo)(function(){var e="",t=n||r,a=!!(n&&i&&i.includes(n));if(t&&M.onFocus){var s={focused:t,label:d(t),isDisabled:h(t,i),isSelected:a,options:o,context:t===n?"menu":"value",selectValue:i,isAppleDevice:c};e=M.onFocus(s)}return e},[n,r,d,h,M,o,i,c]),S=(0,p.useMemo)(function(){var e="";if(w&&y.length&&!x&&M.onFilter){var t=b({count:o.length});e=M.onFilter({inputValue:f,resultsMessage:t})}return e},[o,f,w,M,y,b,x]),D="initial-input-focus"===(null==t?void 0:t.action),j=(0,p.useMemo)(function(){var e="";if(M.guidance){var t=r?"value":w?"menu":"input";e=M.guidance({"aria-label":N,context:t,isDisabled:n&&h(n,i),isMulti:m,isSearchable:g,tabSelectsValue:v,isInitialFocus:D})}return e},[N,n,r,m,h,g,w,M,i,v,D]),k=Fb(p.Fragment,null,Fb("span",{id:"aria-selection"},E),Fb("span",{id:"aria-focused"},_),Fb("span",{id:"aria-results"},S),Fb("span",{id:"aria-guidance"},j));return Fb(p.Fragment,null,Fb(Yv,{id:l},D&&k),Fb(Yv,{"aria-live":I,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!D&&k))},Gv=[{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źẑżžẓẕƶȥɀⱬꝣ"}],Wv=new RegExp("["+Gv.map(function(e){return e.letters}).join("")+"]","g"),Hv={},Qv=0;Qv<Gv.length;Qv++)for(var $v=Gv[Qv],Xv=0;Xv<$v.letters.length;Xv++)Hv[$v.letters[Xv]]=$v.base;var Jv=function(e){return e.replace(Wv,function(e){return Hv[e]})},qv=function(e,t){void 0===t&&(t=Bv);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 a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return r.clear=function(){n=null},r}(Jv),Kv=function(e){return e.replace(/^\s+|\s+$/g,"")},ex=function(e){return"".concat(e.label," ").concat(e.value)},tx=["innerRef"];function nx(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=Zb(e,1)[0];return!n.includes(t)});return o.reduce(function(e,t){var n=Zb(t,2),r=n[0],o=n[1];return e[r]=o,e},{})}(Vb(e,tx),"onExited","in","enter","exit","appear");return Fb("input",(0,w.A)({ref:t},n,{css:Yb({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 rx=["boxSizing","height","overflow","paddingRight","position"],ox={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function ax(e){e.cancelable&&e.preventDefault()}function ix(e){e.stopPropagation()}function sx(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function lx(){return"ontouchstart"in window||navigator.maxTouchPoints}var cx=!("undefined"==typeof window||!window.document||!window.document.createElement),ux=0,dx={capture:!1,passive:!1},fx=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},px={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function mx(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,a=e.onTopLeave,i=(0,p.useRef)(!1),s=(0,p.useRef)(!1),l=(0,p.useRef)(0),c=(0,p.useRef)(null),u=(0,p.useCallback)(function(e,t){if(null!==c.current){var l=c.current,u=l.scrollTop,d=l.scrollHeight,f=l.clientHeight,p=c.current,m=t>0,h=d-f-u,g=!1;h>t&&i.current&&(r&&r(e),i.current=!1),m&&s.current&&(a&&a(e),s.current=!1),m&&t>h?(n&&!i.current&&n(e),p.scrollTop=d,g=!0,i.current=!0):!m&&-t>u&&(o&&!s.current&&o(e),p.scrollTop=0,g=!0,s.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,r,o,a]),d=(0,p.useCallback)(function(e){u(e,e.deltaY)},[u]),f=(0,p.useCallback)(function(e){l.current=e.changedTouches[0].clientY},[]),m=(0,p.useCallback)(function(e){var t=l.current-e.changedTouches[0].clientY;u(e,t)},[u]),h=(0,p.useCallback)(function(e){if(e){var t=!!lv&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",m,t)}},[m,f,d]),g=(0,p.useCallback)(function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",m,!1))},[m,f,d]);return(0,p.useEffect)(function(){if(t){var e=c.current;return h(e),function(){g(e)}}},[t,h,g]),function(e){c.current=e}}({isEnabled:void 0===r||r,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),a=function(e){var t=e.isEnabled,n=e.accountForScrollbars,r=void 0===n||n,o=(0,p.useRef)({}),a=(0,p.useRef)(null),i=(0,p.useCallback)(function(e){if(cx){var t=document.body,n=t&&t.style;if(r&&rx.forEach(function(e){var t=n&&n[e];o.current[e]=t}),r&&ux<1){var a=parseInt(o.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,s=window.innerWidth-i+a||0;Object.keys(ox).forEach(function(e){var t=ox[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(s,"px"))}t&&lx()&&(t.addEventListener("touchmove",ax,dx),e&&(e.addEventListener("touchstart",sx,dx),e.addEventListener("touchmove",ix,dx))),ux+=1}},[r]),s=(0,p.useCallback)(function(e){if(cx){var t=document.body,n=t&&t.style;ux=Math.max(ux-1,0),r&&ux<1&&rx.forEach(function(e){var t=o.current[e];n&&(n[e]=t)}),t&&lx()&&(t.removeEventListener("touchmove",ax,dx),e&&(e.removeEventListener("touchstart",sx,dx),e.removeEventListener("touchmove",ix,dx)))}},[r]);return(0,p.useEffect)(function(){if(t){var e=a.current;return i(e),function(){s(e)}}},[t,i,s]),function(e){a.current=e}}({isEnabled:n});return Fb(p.Fragment,null,n&&Fb("div",{onClick:fx,css:px}),t(function(e){o(e),a(e)}))}var hx={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},gx=function(e){var t=e.name,n=e.onFocus;return Fb("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:hx,value:"",onChange:function(){}})};function wx(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 yx(){return wx(/^Mac/i)}var bx={clearIndicator:Dv,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,a=o.colors,i=o.borderRadius;return sy({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?a.neutral5:a.neutral0,borderColor:n?a.neutral10:r?a.primary:a.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},dropdownIndicator:Sv,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 sy({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,a=r.colors;return sy({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?a.neutral10:a.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,a=o.spacing,i=o.colors;return sy(sy({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},Lv),t?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:i.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,o=e.theme,a=o.colors,i=o.spacing.baseUnit;return sy({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?a.neutral60:a.neutral20,padding:2*i})},loadingMessage:bv,menu:function(e,t){var n,r=e.placement,o=e.theme,a=o.borderRadius,i=o.spacing,s=o.colors;return sy((ay(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),ay(n,"position","absolute"),ay(n,"width","100%"),ay(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return sy({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,a=n.colors;return sy({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,a=e.cropWithEllipsis;return sy({overflow:"hidden",textOverflow:a||void 0===a?"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,a=n.colors,i=e.isFocused;return sy({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:i?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},noOptionsMessage:yv,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,a=e.theme,i=a.spacing,s=a.colors;return sy({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?s.primary:r?s.primary25:"transparent",color:n?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return sy({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,a=r.colors;return sy({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,a=e.selectProps.controlShouldRenderValue;return sy({alignItems:"center",display:r&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},vx={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}},xx={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ov(),captureMenuScroll:!ov(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=sy({ignoreCase:!0,ignoreAccents:!0,stringify:ex,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,a=n.stringify,i=n.trim,s=n.matchFrom,l=i?Kv(t):t,c=i?Kv(a(e)):a(e);return r&&(l=l.toLowerCase(),c=c.toLowerCase()),o&&(l=qv(l),c=Jv(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},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 Nx(e,t,n,r){return{type:"option",data:t,isDisabled:Cx(e,t,n),isSelected:Ax(e,t,n),label:jx(e,t),value:kx(e,t),index:r}}function Ix(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(n,r){return Nx(e,n,t,r)}).filter(function(t){return Sx(e,t)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var a=Nx(e,n,t,r);return Sx(e,a)?a:void 0}).filter(cv)}function Mx(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,my(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function Ex(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,my(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 Sx(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,a=t.isSelected,i=t.label,s=t.value;return(!Lx(e)||!a)&&Tx(e,{label:i,value:s,data:o},r)}var Dx=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},jx=function(e,t){return e.getOptionLabel(t)},kx=function(e,t){return e.getOptionValue(t)};function Cx(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Ax(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=kx(e,t);return n.some(function(t){return kx(e,t)===r})}function Tx(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Lx=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Ox=1,zx=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&&(0,cy.A)(e,t)}(n,e);var t=function(e){var t=dy();return function(){var n,r=uy(e);if(t){var o=uy(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==ry(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,n)}}(n);function n(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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,a=n.name;t.name=a,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,a=o.closeMenuOnSelect,i=o.isMulti,s=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:s}),a&&(r.setState({inputIsHiddenAfterUpdate:!i}),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,a=t.name,i=r.state.selectValue,s=o&&r.isOptionSelected(e,i),l=r.isOptionDisabled(e,i);if(s){var c=r.getOptionValue(e);r.setValue(i.filter(function(e){return r.getOptionValue(e)!==c}),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:a});o?r.setValue([].concat(my(i),[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),a=n.filter(function(e){return r.getOptionValue(e)!==o}),i=uv(t,a,a[0]||null);r.onChange(i,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(uv(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),a=uv(e,o,o[0]||null);n&&r.onChange(a,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return Dx(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return Ex(Ix(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 $b.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return jx(r.props,e)},r.getOptionValue=function(e){return kx(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,o=bx[e](t,n);o.boxSizing="border-box";var a=r.props.styles[e];return a?a(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,sy(sy({},Pv),e.components);var e},r.buildCategorizedOptions=function(){return Ix(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Mx(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:sy({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&&Kb(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),a=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=o>5||a>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 Lx(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,a=t.escapeClearsValue,i=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=r.state,m=p.focusedOption,h=p.focusedValue,g=p.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;r.focusValue("previous");break;case"ArrowRight":if(!n||i)return;r.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)r.removeValue(h);else{if(!o)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!c||!d||!m||f&&r.isOptionSelected(m,g))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":c?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:i}),r.onMenuClose()):s&&a&&r.clearValue();break;case" ":if(i)return;if(!c){r.openMenu("first");break}if(!m)return;r.selectOption(m);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||++Ox),r.state.selectValue=Xb(e.value),e.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),i=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[i],r.state.focusedOptionId=Dx(o,a[i])}return r}return function(e,t,n){t&&ly(e.prototype,t),n&&ly(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(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&&rv(this.menuListRef,this.focusedOptionRef),(yx()||wx(/^iPhone/i)||wx(/^iPad/i)||yx()&&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&&(rv(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,a=this.buildFocusableOptions(),i="first"===e?0:a.length-1;if(!this.props.isMulti){var s=a.indexOf(r[0]);s>-1&&(i=s)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:a[i],focusedOptionId:this.getFocusedOptionId(a[i])},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 a=n.length-1,i=-1;if(n.length){switch(e){case"previous":i=0===o?0:-1===o?a:o-1;break;case"next":o>-1&&o<a&&(i=o+1)}this.setState({inputIsHidden:-1!==i,focusedValue:n[i]})}}}},{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,a=r.indexOf(n);n||(a=-1),"up"===e?o=a>0?a-1:r.length-1:"down"===e?o=(a+1)%r.length:"pageup"===e?(o=a-t)<0&&(o=0):"pagedown"===e?(o=a+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(vx):sy(sy({},vx),this.props.theme):vx}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,o=this.getValue,a=this.selectOption,i=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:o,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:a,selectProps:s,setValue:i,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 Cx(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Ax(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Tx(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,a=e.tabIndex,i=e.form,s=e.menuIsOpen,l=e.required,c=this.getComponents().Input,u=this.state,d=u.inputIsHidden,f=u.ariaSelection,m=this.commonProps,h=r||this.getElementId("input"),g=sy(sy(sy({"aria-autocomplete":"list","aria-expanded":s,"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":l,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},s&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?p.createElement(c,(0,w.A)({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:i,type:"text",value:o},g)):p.createElement(nx,(0,w.A)({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Hb,onFocus:this.onInputFocus,disabled:t,tabIndex:a,inputMode:"none",form:i,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,a=t.MultiValueRemove,i=t.SingleValue,s=t.Placeholder,l=this.commonProps,c=this.props,u=c.controlShouldRenderValue,d=c.isDisabled,f=c.isMulti,m=c.inputValue,h=c.placeholder,g=this.state,y=g.selectValue,b=g.focusedValue,v=g.isFocused;if(!this.hasValue()||!u)return m?null:p.createElement(s,(0,w.A)({},l,{key:"placeholder",isDisabled:d,isFocused:v,innerProps:{id:this.getElementId("placeholder")}}),h);if(f)return y.map(function(t,i){var s=t===b,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return p.createElement(n,(0,w.A)({},l,{components:{Container:r,Label:o,Remove:a},isFocused:s,isDisabled:d,key:c,index:i,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(m)return null;var x=y[0];return p.createElement(i,(0,w.A)({},l,{data:x,isDisabled:d}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var i={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return p.createElement(e,(0,w.A)({},t,{innerProps:i,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,a=this.state.isFocused;return e&&o?p.createElement(e,(0,w.A)({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:a})):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,a=this.state.isFocused;return p.createElement(n,(0,w.A)({},r,{isDisabled:o,isFocused:a}))}},{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 p.createElement(e,(0,w.A)({},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,a=t.MenuList,i=t.MenuPortal,s=t.LoadingMessage,l=t.NoOptionsMessage,c=t.Option,u=this.commonProps,d=this.state.focusedOption,f=this.props,m=f.captureMenuScroll,h=f.inputValue,g=f.isLoading,y=f.loadingMessage,b=f.minMenuHeight,v=f.maxMenuHeight,x=f.menuIsOpen,N=f.menuPlacement,I=f.menuPosition,M=f.menuPortalTarget,E=f.menuShouldBlockScroll,_=f.menuShouldScrollIntoView,S=f.noOptionsMessage,D=f.onMenuScrollToTop,j=f.onMenuScrollToBottom;if(!x)return null;var k,C=function(t,n){var r=t.type,o=t.data,a=t.isDisabled,i=t.isSelected,s=t.label,l=t.value,f=d===o,m=a?void 0:function(){return e.onOptionHover(o)},h=a?void 0:function(){return e.selectOption(o)},g="".concat(e.getElementId("option"),"-").concat(n),y={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:"option","aria-selected":e.state.isAppleDevice?void 0:i};return p.createElement(c,(0,w.A)({},u,{innerProps:y,data:o,isDisabled:a,isSelected:i,key:g,label:s,type:r,value:l,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())k=this.getCategorizedOptions().map(function(t){if("group"===t.type){var o=t.data,a=t.options,i=t.index,s="".concat(e.getElementId("group"),"-").concat(i),l="".concat(s,"-heading");return p.createElement(n,(0,w.A)({},u,{key:s,data:o,options:a,Heading:r,headingProps:{id:l,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return C(e,"".concat(i,"-").concat(e.index))}))}if("option"===t.type)return C(t,"".concat(t.index))});else if(g){var A=y({inputValue:h});if(null===A)return null;k=p.createElement(s,u,A)}else{var T=S({inputValue:h});if(null===T)return null;k=p.createElement(l,u,T)}var L={minMenuHeight:b,maxMenuHeight:v,menuPlacement:N,menuPosition:I,menuShouldScrollIntoView:_},O=p.createElement(gv,(0,w.A)({},u,L),function(t){var n=t.ref,r=t.placerProps,i=r.placement,s=r.maxHeight;return p.createElement(o,(0,w.A)({},u,L,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:i}),p.createElement(mx,{captureEnabled:m,onTopArrive:D,onBottomArrive:j,lockEnabled:E},function(t){return p.createElement(a,(0,w.A)({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":u.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:s,focusedOption:d}),k)}))});return M||"fixed"===I?p.createElement(i,(0,w.A)({},u,{appendTo:M,controlElement:this.controlRef,menuPlacement:N,menuPosition:I}),O):O}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,a=t.name,i=t.required,s=this.state.selectValue;if(i&&!this.hasValue()&&!r)return p.createElement(gx,{name:a,onFocus:this.onValueInputFocus});if(a&&!r){if(o){if(n){var l=s.map(function(t){return e.getOptionValue(t)}).join(n);return p.createElement("input",{name:a,type:"hidden",value:l})}var c=s.length>0?s.map(function(t,n){return p.createElement("input",{key:"i-".concat(n),name:a,type:"hidden",value:e.getOptionValue(t)})}):p.createElement("input",{name:a,type:"hidden",value:""});return p.createElement("div",null,c)}var u=s[0]?this.getOptionValue(s[0]):"";return p.createElement("input",{name:a,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,a=t.isFocused,i=t.selectValue,s=this.getFocusableOptions();return p.createElement(Vv,(0,w.A)({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:o,isFocused:a,selectValue:i,focusableOptions:s,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,o=e.ValueContainer,a=this.props,i=a.className,s=a.id,l=a.isDisabled,c=a.menuIsOpen,u=this.state.isFocused,d=this.commonProps=this.getCommonProps();return p.createElement(r,(0,w.A)({},d,{className:i,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:u}),this.renderLiveRegion(),p.createElement(t,(0,w.A)({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:u,menuIsOpen:c}),p.createElement(o,(0,w.A)({},d,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),p.createElement(n,(0,w.A)({},d,{isDisabled:l}),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,a=t.ariaSelection,i=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,f=e.inputValue,p=e.isMulti,m=Xb(u),h={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||f!==n.inputValue)){var g=d?function(e,t){return Mx(Ix(e,t))}(e,m):[],w=d?Ex(Ix(e,m),"".concat(l,"-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,m):null,b=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);h={selectValue:m,focusedOption:b,focusedOptionId:Dx(w,b),focusableOptionsWithIds:w,focusedValue:y,clearFocusValueOnUpdate:!1}}var v=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},x=a,N=i&&s;return i&&!N&&(x={value:uv(p,m,m[0]||null),options:m,action:"initial-input-focus"},N=!s),"initial-input-focus"===(null==a?void 0:a.action)&&(x=null),sy(sy(sy({},h),v),{},{prevProps:e,ariaSelection:x,prevWasFocused:N})}}]),n}(p.Component);zx.defaultProps=xx;var Px=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"],Rx=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"],Ux=(0,p.forwardRef)(function(e,t){var n=function(e){var t=e.defaultOptions,n=void 0!==t&&t,r=e.cacheOptions,o=void 0!==r&&r,a=e.loadOptions;e.options;var i=e.isLoading,s=void 0!==i&&i,l=e.onInputChange,c=e.filterOption,u=void 0===c?null:c,d=Vb(e,Rx),f=d.inputValue,m=(0,p.useRef)(void 0),h=(0,p.useRef)(!1),g=Zb((0,p.useState)(Array.isArray(n)?n:void 0),2),w=g[0],y=g[1],b=Zb((0,p.useState)(void 0!==f?f:""),2),v=b[0],x=b[1],N=Zb((0,p.useState)(!0===n),2),I=N[0],M=N[1],E=Zb((0,p.useState)(void 0),2),_=E[0],S=E[1],D=Zb((0,p.useState)([]),2),j=D[0],k=D[1],C=Zb((0,p.useState)(!1),2),A=C[0],T=C[1],L=Zb((0,p.useState)({}),2),O=L[0],z=L[1],P=Zb((0,p.useState)(void 0),2),R=P[0],U=P[1],B=Zb((0,p.useState)(void 0),2),F=B[0],Y=B[1];o!==F&&(z({}),Y(o)),n!==R&&(y(Array.isArray(n)?n:void 0),U(n)),(0,p.useEffect)(function(){return h.current=!0,function(){h.current=!1}},[]);var Z=(0,p.useCallback)(function(e,t){if(!a)return t();var n=a(e,t);n&&"function"==typeof n.then&&n.then(t,function(){return t()})},[a]);(0,p.useEffect)(function(){!0===n&&Z(v,function(e){h.current&&(y(e||[]),M(!!m.current))})},[]);var V=(0,p.useCallback)(function(e,t){var n=function(e,t,n){if(n){var r=n(e,t);if("string"==typeof r)return r}return e}(e,t,l);if(!n)return m.current=void 0,x(""),S(""),k([]),M(!1),void T(!1);if(o&&O[n])x(n),S(n),k(O[n]),M(!1),T(!1);else{var r=m.current={};x(n),M(!0),T(!_),Z(n,function(e){h&&r===m.current&&(m.current=void 0,M(!1),S(n),k(e||[]),T(!1),z(e?sy(sy({},O),{},ay({},n,e)):O))})}},[o,Z,_,O,l]),G=A?[]:v&&_?j:w||[];return sy(sy({},d),{},{options:G,isLoading:I||s,onInputChange:V,filterOption:u})}(e),r=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,r=e.defaultMenuIsOpen,o=void 0!==r&&r,a=e.defaultValue,i=void 0===a?null:a,s=e.inputValue,l=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,m=e.value,h=Vb(e,Px),g=Zb((0,p.useState)(void 0!==s?s:n),2),w=g[0],y=g[1],b=Zb((0,p.useState)(void 0!==l?l:o),2),v=b[0],x=b[1],N=Zb((0,p.useState)(void 0!==m?m:i),2),I=N[0],M=N[1],E=(0,p.useCallback)(function(e,t){"function"==typeof c&&c(e,t),M(e)},[c]),_=(0,p.useCallback)(function(e,t){var n;"function"==typeof u&&(n=u(e,t)),y(void 0!==n?n:e)},[u]),S=(0,p.useCallback)(function(){"function"==typeof f&&f(),x(!0)},[f]),D=(0,p.useCallback)(function(){"function"==typeof d&&d(),x(!1)},[d]),j=void 0!==s?s:w,k=void 0!==l?l:v,C=void 0!==m?m:I;return sy(sy({},h),{},{inputValue:j,menuIsOpen:k,onChange:E,onInputChange:_,onMenuClose:D,onMenuOpen:S,value:C})}(n);return p.createElement(zx,(0,w.A)({ref:t},r))}),Bx=Ux;const Fx=e=>e.isSelected?"#F3F4F6":e.isFocused?"#F9FAFB":"transparent",Yx=function(e){const{label:t,name:n,desc:r,value:o,tooltip:a,placeholder:s,onChangeCB:l,options:c,isMulti:u=!1,isSearchable:d=!0,attr:f}=e,[p,m]=(0,i.useState)(o);(0,i.useEffect)(()=>{m(o)},[o]);const h={control:e=>({...e,borderColor:"#E5E7EB",boxShadow:"","&:hover":{borderColor:"none"}}),option:(e,t)=>({...e,backgroundColor:Fx(t),color:"#111827",cursor:"pointer","&:active":{backgroundColor:"#F3F4F6"}})};return(0,i.createElement)("div",{className:"wcf-select2-field"},(0,i.createElement)("div",{className:"wcf-selection-field"},t&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary mb-2"},(0,i.createElement)("label",null,t,a&&(0,i.createElement)(n_,{text:a}))),(0,i.createElement)(Bx,(0,w.A)({className:"wcf-select2-input",classNamePrefix:"wcf",name:n,isClearable:!0,value:p,getOptionLabel:e=>e.label,getOptionValue:e=>e.value,loadOptions:e=>new Promise(t=>{setTimeout(()=>{t((e=>c.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())))(e))},1e3)}),onChange:t=>{m(t);const n=new CustomEvent("wcf:select2:change",{bubbles:!0,detail:{e:{},name:e.name,value:t}});document.dispatchEvent(n),l&&l(t)},placeholder:s,defaultOptions:c,cacheOptions:!0,isMulti:u,delimiter:u&&!n?.endsWith("[]")?",":void 0,styles:h,isSearchable:d},f))),r&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},Nh(r)))};function Zx({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const Vx=p.forwardRef(Zx);function Gx({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 14.25 6-6m4.5-3.493V21.75l-3.75-1.5-3.75 1.5-3.75-1.5-3.75 1.5V4.757c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0c1.1.128 1.907 1.077 1.907 2.185ZM9.75 9h.008v.008H9.75V9Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm4.125 4.5h.008v.008h-.008V13.5Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const Wx=p.forwardRef(Gx);function Hx({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v12m-3-2.818.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Qx=p.forwardRef(Hx);function $x({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const Xx=p.forwardRef($x),Jx=function(e){const[{options:t},n]=Nm(),{index:r,field_name:o,product_data:a,productOptdata:s}=e,l=""===a.discount_type?"disable":"enable",[c,u]=(0,i.useState)(l),[d,f]=(0,i.useState)(a.discount_type),[p,m]=(0,i.useState)(a.discount_value||""),[h,g]=(0,i.useState)(!1),[w,y]=(0,i.useState)(s.product_name||""),[b,v]=(0,i.useState)(s.product_subtext||""),[x,N]=(0,i.useState)(s.highlight_text||""),[I,M]=(0,i.useState)("yes"===s.enable_highlight),E=t["wcf-checkout-products"],_=t["wcf-product-options"],S=t["wcf-enable-product-options"],D=r===E.length-1;(0,i.useEffect)(()=>{f(a.discount_type),m(a.discount_value||"")},[a.discount_type,a.discount_value]),(0,i.useEffect)(()=>{y(s.product_name||""),v(s.product_subtext||""),N(s.highlight_text||""),M("yes"===s.enable_highlight)},[s.product_name,s.product_subtext,s.highlight_text,s.enable_highlight]);const k=[{value:"",label:(0,j.__)("Original","cartflows"),icon:(0,i.createElement)(Vx,{className:"w-4 h-4"})},{value:"discount_percent",label:(0,j.__)("Percentage","cartflows"),icon:(0,i.createElement)(Wx,{className:"w-4 h-4"})},{value:"discount_price",label:(0,j.__)("Price","cartflows"),icon:(0,i.createElement)(Qx,{className:"w-4 h-4"})}],C=k.find(e=>e.value===d)||k[0];return function(){const e=a.discount_type,t=parseFloat(a.discount_value),n=parseFloat(a.regular_price);let r=0;"discount_percent"===e?t>0&&(r=n-n*t/100):"discount_price"===e&&t>0&&(r=n-t),a.sell_price=r.toFixed(2)}(),(0,i.createElement)("div",{key:a.unique_id},(0,i.createElement)("div",{className:`wcf-product-selection--selected-product flex items-center p-3 gap-3 ${function(){let e="";return"yes"===s.add_to_cart?e+=h?"relative border-[0.5px] border-b-0 border-solid border-brand-300 bg-brand-25 ":"relative border-[0.5px] border-solid border-brand-300 bg-brand-25 ":e+=h?"border-[0.5px] border-b-0 border-solid border-border-subtle bg-background-secondary ":"border-[0.5px] border-solid border-border-subtle bg-background-secondary ",e+=D&&!h?" rounded-b-md":"",e}()}`},(0,i.createElement)("div",{className:"wcf-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-1/2"},(0,i.createElement)("div",{className:"flex gap-3 items-center"},(0,i.createElement)("div",{className:"wcf-product-selection--sortable-toggle flex cursor-move text-text-tertiary"},(0,i.createElement)(Rh,{className:"w-6 h-6 stroke-1","aria-hidden":"true"}),(0,i.createElement)(Rh,{className:"w-6 h-6 stroke-1 -ml-4","aria-hidden":"true"})),(0,i.createElement)("div",{className:"wcf-product-selection--product-image w-20 h-20"},(0,i.createElement)("img",{src:a&&a.img_url?a.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:Nh(a.name)})),(0,i.createElement)("div",{className:"wcf-product-selection--product-title_text cursor-default"},(0,i.createElement)("div",{className:"wcf-product-repeater-field__title whitespace-normal text-left","data-product_id":a.product},Nh(a.name)),(0,i.createElement)("div",{className:"wcf-product-repeater-field__reg-price mt-1"},(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"wcf-product--reg-price "+("enable"===l&&0<a.discount_value?"line-through text-text-tertiary":""),title:(0,j.__)("Regular Price of the product","cartflows")},cartflows_admin.woo_currency+a.regular_price),"enable"===l&&0<a.discount_value&&(0,i.createElement)("span",{className:"wcf-product--sale-price",title:(0,j.__)("Price after discount.","cartflows")},cartflows_admin.woo_currency+a.sell_price)))))),(0,i.createElement)("div",{className:"wcf-product-selection--set-default whitespace-nowrap text-sm text-text-secondary w-[10%] flex justify-center items-center"},function(e){let o="";return wcfCartflowsPro()&&"yes"===S?"force-all"===_?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(yw,{size:"sm",value:!0,disabled:!0,name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`}),(0,i.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:"yes"})):"single-selection"===_?(("yes"===e.add_to_cart||e.chosen)&&(o=e.unique_id),(0,i.createElement)(Mw.Group,{name:"wcf_default_add_to_cart[]",value:o,onChange:()=>{t["wcf-checkout-products"][r].add_to_cart="yes",t["wcf-product-options-data"]={[e.unique_id]:{add_to_cart:"yes"}}},style:"simple",size:"sm",columns:1},(0,i.createElement)(Mw.Button,{value:e.unique_id,hideSelection:!1,minWidth:!1,buttonWrapperClasses:"p-0 flex items-center justify-center"}))):"multiple-selection"===_?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(yw,{size:"sm",value:"yes"===e.add_to_cart,onChange:r=>{n({type:"SET_OPTION",name:"wcf-product-options-data",value:{...t["wcf-product-options-data"],[e.unique_id]:{...t["wcf-product-options-data"]?.[e.unique_id],add_to_cart:r?"yes":"no"}}})}}),(0,i.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:e.add_to_cart})):void 0:(0,i.createElement)(i.Fragment,null,(0,i.createElement)(yw,{size:"sm",value:!0,disabled:!0,name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`}),(0,i.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:"yes"}))}(s)),(0,i.createElement)("div",{className:"wcf-product-selection--product-qty whitespace-nowrap text-sm text-text-secondary w-[10%]"},(0,i.createElement)("div",{className:"w-16 shrink-0"},(0,i.createElement)(Qw,{type:"number",size:"md",name:`wcf-checkout-products[${r}][quantity]`,value:a.quantity,min:1,onChange:e=>{const t=[...E];t[r]={...t[r],quantity:parseInt(e,10)||1},n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:o,products:t})}}))),(0,i.createElement)("div",{className:"wcf-product-selection--product-discount flex items-center gap-2 whitespace-nowrap text-sm text-text-secondary w-2/3"},(0,i.createElement)("input",{type:"hidden",name:`wcf-checkout-products[${r}][discount_type]`,value:d}),(0,i.createElement)("div",{className:"w-16 shrink-0"},(0,i.createElement)(Qw,{type:"number",size:"md",name:`wcf-checkout-products[${r}][discount_value]`,value:"disable"===c?"":p,disabled:"disable"===c,placeholder:"disable"===c?"":"0",min:1,step:"any",onChange:e=>m(e)})),(0,i.createElement)(Xp,{placement:"bottom-start"},(0,i.createElement)(Xp.Trigger,null,(0,i.createElement)("button",{type:"button",className:"appearance-none bg-background-primary border border-solid border-border-subtle shadow-sm rounded-md h-10 w-[130px] px-2 py-2 flex items-center justify-between gap-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-brand-600 focus:ring-offset-2"},(0,i.createElement)("span",{className:"flex items-center gap-1"},(0,i.createElement)("span",{className:"size-4 shrink-0 flex items-center"},C.icon),(0,i.createElement)("span",{className:"text-sm font-normal text-text-primary"},C.label)),(0,i.createElement)(Fp,{className:"size-3.5 shrink-0 text-icon-secondary"}))),(0,i.createElement)(Xp.ContentWrapper,{className:"z-50"},(0,i.createElement)(Xp.Content,null,(0,i.createElement)(Xp.List,null,k.map(e=>(0,i.createElement)(Xp.Item,{key:e.value,active:d===e.value,onClick:()=>{f(e.value),function(e,t,n){u(""===n?"disable":"enable")}(0,0,e.value)}},(0,i.createElement)("span",{className:"flex items-center gap-2 text-sm"},e.icon,e.label)))))))),(0,i.createElement)("div",{className:"wcf-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[10%] justify-center"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)(Ig,{className:"w-4 h-4"}),onClick:()=>g(!h),className:`${"yes"===S?"visible":"invisible"} ${h?"bg-brand-50 text-brand-500":""}`,type:"button"}),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)(_h,{className:"w-4 h-4"}),onClick:function(){const e=a.unique_id;e&&n({type:"REMOVE_CHECKOUT_PRODUCT",field_name:o,unique_id:e})},"data-index":r,type:"button",className:"text-icon-secondary hover:text-support-error"})),(0,i.createElement)("input",{name:`wcf-checkout-products[${r}][product]`,type:"hidden",className:"wcf-checkout-product-id",value:a.product}),(0,i.createElement)("input",{name:`wcf-checkout-products[${r}][unique_id]`,type:"hidden",className:"wcf-checkout-product-unique",value:a.unique_id})),h&&(0,i.createElement)("div",{className:"wcf-product-field-item-settings flex flex-col gap-5 p-6 bg-background-primary "+(h&&"yes"===s.add_to_cart?"border-[0.5px] border-t-0 border-solid border-brand-300":"border-[0.5px] border-t-0 border-solid border-border-subtle"),id:"product-option-index-"+r,"data-id":a.product_id},(0,i.createElement)("div",{className:"flex flex-col gap-1.5"},(0,i.createElement)(Qw,{name:`wcf-product-options-data[${s.unique_id}][product_name]`,label:(0,j.__)("Product Name","cartflows"),value:w,size:"md",onChange:e=>y(e)}),(0,i.createElement)(cp,{variant:"help",size:"sm",tag:"p"},(0,i.createElement)(Xx,null),(0,j.__)("Use {{product_name}} and {{quantity}} to dynamically fetch respective product details.","cartflows"))),(0,i.createElement)("div",{className:"flex flex-col gap-1.5"},(0,i.createElement)(Qw,{name:`wcf-product-options-data[${s.unique_id}][product_subtext]`,label:(0,j.__)("Subtext","cartflows"),value:b,size:"md",onChange:e=>v(e)}),(0,i.createElement)(cp,{variant:"help",size:"sm",tag:"p"},(0,i.createElement)(Xx,null),(0,j.__)("Use {{quantity}}, {{discount_value}}, {{discount_percent}} to dynamically fetch respective product details.","cartflows"))),(0,i.createElement)("div",{className:"flex"},(0,i.createElement)(dw,{id:`wcf-product-options-data-enable-highlight-${s.unique_id}`,checked:I,label:{heading:(0,j.__)("Enable Highlight","cartflows")},size:"sm",onChange:e=>M(e)})),(0,i.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${s.unique_id}][enable_highlight]`,value:I?"yes":"no"}),(0,i.createElement)("div",{className:I?"":"hidden"},(0,i.createElement)(Qw,{name:`wcf-product-options-data[${s.unique_id}][highlight_text]`,label:(0,j.__)("Highlight Text","cartflows"),value:x,size:"md",onChange:e=>N(e)})),(0,i.createElement)("input",{name:`wcf-product-options-data[${s.unique_id}][unique_id]`,type:"hidden",className:"wcf-product-options-unique-id",value:s.unique_id})))};function qx({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const Kx=p.forwardRef(qx),eN=function(){return(0,i.createElement)("a",{className:"wcf-create-new-product text-sm font-medium text-brand-500 hover:text-brand-600 inline-flex items-center gap-1.5 cursor-pointer mt-5 w-full focus:outline-none focus:ring-0 focus:text-brand-500 no-underline",rel:"noreferrer",target:"_blank",href:cartflows_admin.create_product_src},(0,i.createElement)(Kx,{className:"w-4 h-4 stroke-2","aria-hidden":"true"}),(0,j.__)("Create New Product","cartflows"))},tN=function(e){const[{options:t},n]=Nm(),{name:r,value:o}=e,a=t[r],[s,l]=(0,i.useState)(),[c,u]=(0,i.useState)(""),[d,f]=(0,i.useState)(!1),p=(0,j.__)("Add","cartflows"),[m,h]=(0,i.useState)({isInProcessing:!1,buttonText:p}),{isInProcessing:g,buttonText:w}=m,y=t["wcf-product-options"],b=t["wcf-product-options-data"];(0,i.useEffect)(()=>(n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:r,products:o}),()=>{}),[]);let v=0;const x=wcfCartflowsPro()?function(){const e={};b&&Object.keys(b).map(t=>{const n=b[t];return e[t]={...n},""});const t=[],n={enable_highlight:"no",highlight_text:"",product_name:"",product_subtext:"",add_to_cart:"yes"};return v=0,a.map(function(r){if(r?.unique_id){let o={...n};const a=r.unique_id;e[a]&&(o={...e[a]}),o.product_id=r?.product,o.product_name=o.product_name?o.product_name:r?.name,o.product_title=r?.name,o.unique_id=r.unique_id,"single-selection"!==y&&(o.add_to_cart=o.add_to_cart?o.add_to_cart:"yes"),"single-selection"===y&&(o.add_to_cart&&"no"!==o.add_to_cart&&v++,e[a]||(o.add_to_cart="no")),t.push(o)}return"single-selection"===y&&0===v&&(t[0].add_to_cart="yes"),""}),t}():[];return(0,i.createElement)("div",{className:"wcf-checkout-product-selection-field"},a&&0===a.length&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("input",{name:"wcf-checkout-products",type:"hidden",value:""}),(0,i.createElement)("div",{className:"flex flex-col items-center justify-center py-8 px-4 border border-dashed border-border-subtle rounded-lg bg-background-secondary"},(0,i.createElement)(vh,{size:"sm",className:"text-text-tertiary text-center"},(0,j.__)("No products added yet. Search and add products below.","cartflows")))),a&&a.length>0&&(0,i.createElement)("div",{className:"border border-solid border-border-subtle rounded-lg"},(0,i.createElement)("div",{className:"wcf-product-selection--header bg-background-secondary border-b border-border-subtle flex items-center gap-3 p-3"},(0,i.createElement)(vh,{size:"xs",weight:"medium",className:"text-text-secondary w-2/5"},(0,j.__)("Product","cartflows")),(0,i.createElement)(vh,{size:"xs",weight:"medium",className:"text-text-secondary w-[10%] text-center"},(0,j.__)("Default","cartflows")),(0,i.createElement)(vh,{size:"xs",weight:"medium",className:"text-text-secondary w-[10%] text-center"},(0,j.__)("Qty","cartflows")),(0,i.createElement)(vh,{size:"xs",weight:"medium",className:"text-text-secondary w-2/3"},(0,j.__)("Discount","cartflows")),(0,i.createElement)("div",{className:"w-[10%]"})),(0,i.createElement)(Im.ReactSortable,{list:a,setList:e=>n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:r,products:e}),direction:"vertical",filter:".wcf-field, .wcf-product-selection-actions",preventOnFilter:!1,className:"wcf-checkout-product-selection-field__content"},a.map((e,t)=>("yes"===e.add_to_cart&&v++,(0,i.createElement)(Jx,{key:e.unique_id,index:t,field_name:r,product_data:e,productOptdata:x.length>0?x[t]:[]}))))),(0,i.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new flex items-end gap-3 mt-8"},(0,i.createElement)("div",{className:"flex-1"},(0,i.createElement)(KE,{name:"",desc:"",class:d?"border border-brand-600":"",field:"product",value:c,allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",excluded_product_ids:cartflows_admin?.restrict_duplicate_checkout_products?(a||[]).map(e=>Number(e.product)):[],placeholder:(0,j.__)("Search for a Product","cartflows"),onChangeCB:l})),(0,i.createElement)(Ro,{type:"button",variant:"outline",size:"md",icon:(0,i.createElement)(Kx,{className:"w-4 h-4"}),iconPosition:"left",loading:g,disabled:g,onClick:function(e){const o=s?.value;o?(e.target.blur(),h({isInProcessing:!0,buttonText:(0,j.__)("Adding…","cartflows")}),Ep()({path:`/cartflows/v1/admin/product-data/${o}`}).then(e=>{const a={product:o,quantity:"1",discount_type:"",discount_value:"",unique_id:Math.random().toString(36).substring(2,10),name:s?.label,img_url:e?.img_url,regular_price:e?.regular_price};if(n({type:"ADD_CHECKOUT_PRODUCT",field_name:r,product_data:a}),u(null),wcfCartflowsPro()){const e=t["wcf-product-options-data"];e[a.unique_id]={enable_highlight:"no",highlight_text:"",product_name:"",product_subtext:""},n({type:"SET_OPTION",name:"wcf-product-options-data",value:e})}h({isInProcessing:!1,buttonText:p})}),l(null)):(f(!0),e.target.blur(),setTimeout(()=>{f(!1)},3e3))},className:"shrink-0"},w)),d&&(0,i.createElement)(vh,{size:"sm",className:"text-support-error mt-1"},(0,j.__)("Please search and select at-least one product to add.","cartflows")),(0,i.createElement)(eN,null))},nN=window.wp.components,rN=To("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),oN=function(e){const{name:t,label:n,value:r,isActive:o=!0,tooltip:a,sectionClass:s="",wrapperClass:l="",labelClass:c="",displayAlign:u="horizontal",showOverlay:d=!1,size:f="md",default:p=""}=e,[m,h]=(0,i.useState)(!1),[g,w]=(0,i.useState)(r),[y,b]=(0,i.useState)(!1),v=(0,i.useRef)(null);(0,i.useEffect)(()=>{w(r)},[r]);const x=`wcf-colorpicker-${String(t).replace(/[\[\]]/g,"-")}`,N=s||"text-left",I="horizontal"!==u?"block w-full text-left":l||"flex justify-between items-center gap-2.5",M="horizontal"!==u?`${c||"text-sm font-medium text-text-primary"} mb-2`:`${c||"text-sm font-medium text-text-primary"}`,E=e=>{e.stopPropagation(),document.dispatchEvent(new CustomEvent("closeAllColorPickers",{detail:{name:t}})),h(!m)},_=!!p&&String(g).toLowerCase()===p.toLowerCase(),S=t=>{const n=t||"";w(n);const r=new CustomEvent("wcf:color:change",{bubbles:!0,detail:{e:"color",name:e.name,value:n}});document.dispatchEvent(r)};return(0,i.useEffect)(()=>{const e=e=>{!v.current||v.current.contains(e.target)||e.target.closest(".wcf-colorpicker-swatch-wrap")||e.target.closest(".wcf-colorpicker-reset")||h(!1)},n=e=>{e.detail.name!==t?h(!1):h(!m)};return document.addEventListener("closeAllColorPickers",n),document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("closeAllColorPickers",n)}},[t]),(0,i.useEffect)(()=>{if(!m)return;const e=e=>{"Escape"===e.key&&h(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[m]),(0,i.createElement)("div",{className:`wcf-field wcf-color-field ${N} ${o?"":"wcf-hide"}`},(0,i.createElement)("div",{className:`wcf-field__data ${I}`},n&&(0,i.createElement)("div",{className:`wcf-field__data--label ${M}`},(0,i.createElement)("label",{id:`${x}-label`},n),a&&(0,i.createElement)(n_,{text:a})),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("div",{className:"wcf-colorpicker-selector flex items-center sm:justify-end"},(0,i.createElement)("div",{className:`wcf-colorpicker-swatch-wrap box-border flex items-center gap-2.5 ${"sm"===f?"h-8 rounded pl-1.5 pr-2.5":"h-10 rounded-md pl-2 pr-3"} bg-background-primary border border-solid border-border-subtle hover:border-gray-300 cursor-pointer focus-visible:ring-1 focus-visible:ring-border-interactive focus-visible:outline-none ${"horizontal"!==u?"w-full":"w-44"}`,onClick:E,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),E(e))},role:"button",tabIndex:"0","aria-haspopup":"true","aria-expanded":m,"aria-controls":x,"aria-labelledby":n?`${x}-label`:void 0,id:`${x}-trigger`},(0,i.createElement)("span",{className:`wcf-colorpicker-swatch ${"sm"===f?"w-5 h-5":"w-6 h-6"} rounded flex-shrink-0 border-[0.5px] border-solid border-black/10`,style:g?{background:g}:{background:"conic-gradient(#E7E9EC 0 25%, #FFFFFF 0 50%, #E7E9EC 0 75%, #FFFFFF 0) 0 0 / 12px 12px"},"aria-hidden":"true"}),(0,i.createElement)("span",{className:"wcf-colorpicker-label flex-1 text-sm whitespace-nowrap overflow-hidden text-ellipsis "+(g?"font-medium text-text-primary":"text-text-tertiary")},g?g.toUpperCase():(0,j.__)("Select color","cartflows")),g&&!_&&(0,i.createElement)(n_,{text:(0,j.__)("Reset","cartflows"),classes:"!ml-0",icon:(0,i.createElement)("button",{type:"button",onClick:e=>{e.stopPropagation(),g&&!_&&(b(!0),setTimeout(()=>b(!1),500),S(p))},"aria-label":(0,j.__)("Reset color","cartflows"),className:"wcf-colorpicker-reset flex bg-transparent border-0 p-0 cursor-pointer text-text-tertiary hover:text-text-primary focus-visible:ring-1 focus-visible:ring-border-interactive focus-visible:outline-none rounded-sm"},(0,i.createElement)(rN,{className:`w-3.5 h-3.5 transform ${y?"-rotate-180":""} transition-transform duration-500`,"aria-hidden":"true"}))}),(0,i.createElement)("input",{type:"hidden",name:t,value:g}))),(0,i.createElement)("div",{className:"wcf-color-picker relative",ref:v},m?(0,i.createElement)("div",{className:"wcf-color-picker-popover absolute z-10 right-0 top-3",id:x},d&&(0,i.createElement)("div",{className:"wcf-color-picker-cover fixed inset-0",onClick:()=>{h(!1)}}),(0,i.createElement)("div",{className:"bg-background-primary shadow-lg relative rounded-md overflow-hidden"},(0,i.createElement)(nN.ColorPicker,{color:g,onChange:S,enableAlpha:!1}))):null))))},aN=e=>e.isSelected?"#F3F4F6":e.isFocused?"#F9FAFB":"transparent",iN=function(e){const{name:t,label:n,value:r,desc:o,tooltip:a,font_weight_name:s="",font_weight_value:l="",sectionClass:c=!1,wrapperClass:u=!1,labelClass:d="",displayAlign:f="horizontal"}=e,p=c||"text-left";let m=u||"flex items-center gap-2.5",h=d||"text-sm font-medium text-text-primary";"horizontal"!==f&&(m="block w-full text-left",h+=" mb-2");const g=cartflows_admin.cf_font_family,w=r||"Default",[y,b]=(0,i.useState)({value:r,label:r&&r.match(/'([^']+)'/)?r.match(/'([^']+)'/)[1]:w}),[v,x]=(0,i.useState)(l),N=function(e){let t=e.value;const n=[];if(void 0===t||""===t)return n.push({value:"",label:"Default"}),n;const r=t.match("'(.*)'"),o={};r&&r[1]&&(t=r[1]);const a={};return cartflows_admin.google_fonts[t]?(cartflows_admin.google_fonts[t].variants.map(e=>(e.includes("italic")||(a[e]=cartflows_admin.font_weights[e]),"")),Object.keys(a).map(e=>{const t=a[e];return n.push({value:e,label:t}),""}),o[t.replace(" ","+")]=a):cartflows_admin.system_fonts[t]&&(cartflows_admin.system_fonts[t].variants.map(e=>(e.includes("italic")||(a[e]=cartflows_admin.font_weights[e]),"")),Object.keys(a).map(e=>{const t=a[e];return n.push({val:e,label:t}),""})),n};let I=N(y);const M={control:(e,t)=>({...e,borderColor:"#E5E7EB",boxShadow:t.isFocused?"none":"",borderRadius:"6px","&:hover":{borderColor:"none"}}),option:(e,t)=>({...e,backgroundColor:aN(t),color:"#111827",cursor:"pointer","&:active":{backgroundColor:"#F3F4F6"}})};return(0,i.createElement)("div",{className:`wcf-field wcf-font-family-field ${p} `},(0,i.createElement)("div",{className:`wcf-field__data ${m}`},n&&(0,i.createElement)("div",{className:`wcf-field__data--label ${h}`},(0,i.createElement)("label",null,n,a&&(0,i.createElement)(n_,{text:a}))),(0,i.createElement)("div",{className:"wcf-selection-field"},(0,i.createElement)(Bx,{name:t,className:"wcf-select2-input",classNamePrefix:"wcf",cacheOptions:!0,defaultOptions:g,value:y,loadOptions:e=>new Promise(t=>{setTimeout(()=>{t((e=>{const t=g[1].options,n=g[2].options,r=g[0];return t.concat(n,r).filter(t=>t.label.toLowerCase().includes(e.toLowerCase()))})(e))},1e3)}),onChange:t=>{b(t);const n=N(t);I=n;const r=new CustomEvent("wcf:font:change",{bubbles:!0,detail:{name:e.name,value:t.value}});document.dispatchEvent(r)},styles:M}))),o&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Nh(o)),""!==s&&(0,i.createElement)("div",{className:"wcf-font-weight-field mt-5"},(0,i.createElement)(Ww,{name:s,className:"wcf-select-input",value:v,onChange:function(e){x(e)},options:I,label:"Font Weight",displayAlign:f})))};function sN({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const lN=p.forwardRef(sN),{__:cN}=wp.i18n,uN=function(e){const{name:t,tooltip:n,value:r,label:o,objName:a,objValue:s,singleButton:l=!1,sectionClass:c="",wrapperClass:u="",labelClass:d,desc:f,descClass:p,displayAlign:m="horizontal"}=e,[h,g]=(0,i.useState)(r),[w,y]=(0,i.useState)(s),[b,v]=(0,i.useState)(!r),x=(0,i.useRef)(null),N=c||"text-left",I=p||"text-sm font-normal text-text-tertiary mt-2";let M=u||"flex items-center gap-2.5",E=d||"text-sm font-medium text-text-primary mb-2";"horizontal"!==m&&(M="block w-full text-left",E+=" mb-2");const _=e=>{e.preventDefault(),x.current||(x.current=wp.media({multiple:!1}),x.current.on("select",function(){const n=x.current.state().get("selection").first().toJSON(),r=n.sizes?.medium?.url||n.url;g(r),y(n),v(!r),S(e,t,r),S(e,a,n)})),x.current.open()},S=(e,t,n)=>{e.preventDefault();const r=new CustomEvent("wcf:image-selector:change",{bubbles:!0,detail:{e,img_obj:t,url:n}});document.dispatchEvent(r)};return(0,i.createElement)("div",{className:`wcf-field wcf-image-selector-field ${N}`},(0,i.createElement)("div",{className:`wcf-field__data ${M}`},o&&(0,i.createElement)("div",{className:`wcf-field__data--label ${E}`},(0,i.createElement)("label",{htmlFor:t},o,n&&(0,i.createElement)(n_,{text:n}))),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("div",{className:"wcf-image-selector-field__input p-0"},h&&!b&&(0,i.createElement)("div",{className:"text-center border-solid border-border-muted mb-3 leading-4"},(0,i.createElement)("img",{src:h,className:"saved-image",name:t,width:"150",alt:cN("Image Preview","cartflows")})),(0,i.createElement)("input",{type:"hidden",id:t,className:"wcf-image",name:t,value:h}),(0,i.createElement)("input",{type:"hidden",className:"wcf-image-obj",name:a,value:JSON.stringify(w)}),!l&&b&&(0,i.createElement)("div",{className:"mt-2 flex flex-col items-center justify-center gap-3 rounded border border-dashed border-border-subtle hover:border-primary-500 px-6 py-6 cursor-pointer",onClick:_},(0,i.createElement)(lN,{className:"h-5 w-5 text-text-tertiary","aria-hidden":"true"}),(0,i.createElement)(ph,{direction:"column",align:"center",gap:"xs",className:"text-center"},(0,i.createElement)(vh,{as:"p",size:14,weight:500,color:"primary",className:"m-0"},cN("Drag and drop or browse files","cartflows")),(0,i.createElement)(vh,{as:"p",size:12,color:"secondary",className:"m-0"},cN("PNG, JPG, GIF up to 10MB","cartflows")))),(0,i.createElement)(ph,{gap:"sm",className:"wcf-image-selector-field-buttons m-0 p-0"},l&&(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"wcf-select-image",onClick:_},cN(h?"Change Image":"Select Image","cartflows")),h&&(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"wcf-remove-image",onClick:e=>{e.preventDefault(),g(""),v(!0),y(""),S(e,t,""),S(e,a,"")}},cN("Remove Image","cartflows")))))),f&&(0,i.createElement)(ph,{align:"center",gap:"xs",className:`wcf-field__desc ${I}`},(0,i.createElement)(Xx,{className:"w-3 h-3 text-text-secondary shrink-0"}),Nh(f)))},dN=function(e){const{name:t,id:n,label:r,desc:o,value:a,tooltip:s,placeholder:l,min:c,max:u,width:d,afterfield:f,readonly:p,wrapperClass:m=!1,labelClass:h,sectionClass:g,descClass:w,displayAlign:y="horizontal",step:b="1",size:v="md"}=e,[x,N]=(0,i.useState)(a),I=(0,i.useRef)(null),M=g||"text-left",E=w||"text-sm font-normal text-text-tertiary mt-2",_="horizontal"===y,S=h||"text-sm font-medium text-text-primary text-left"+(_?"":" mb-2");let D=m||"flex items-center justify-between gap-2.5";const j=_&&r?"flex items-center justify-end gap-1.5":"flex items-center w-full";_||(D="block w-full text-left");const k=_&&r&&!d?"!w-44":"!w-full";return(0,i.useEffect)(()=>{N(a),I.current&&(I.current.value=null!=a?a:"")},[a]),(0,i.createElement)("div",{className:`wcf-field wcf-number-field ${M}`},(0,i.createElement)("div",{className:`wcf-field__data ${D}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${S}`},(0,i.createElement)("label",{htmlFor:n||t},r,s&&(0,i.createElement)(n_,{text:s}))),(0,i.createElement)("div",{className:`wcf-field__data--content ${j}`},(0,i.createElement)("input",{type:"hidden",ref:I,className:e.class?e.class:"",defaultValue:null!=x?x:""}),(0,i.createElement)(Qw,{type:"number",name:t,value:x,id:n||t,onChange:function(e){let n=e;if("any"===b&&n?.includes(".")){const[e,t]=n.split(".");t.length>2&&(n=`${e}.${t.substring(0,2)}`)}const r=document.getElementsByName(t);r[0]&&r[0].setAttribute("value",n),I.current&&(I.current.value=n),N(n);const o=new CustomEvent("wcf:number:change",{bubbles:!0,detail:{e:{target:{value:n,name:t}},name:t,value:n}});document.dispatchEvent(o)},placeholder:l,min:c,max:u,readOnly:p,disabled:p,inputMode:"numeric",step:b,style:{width:d},size:v,className:`${e.class?e.class:k}`}),f&&(0,i.createElement)("span",{className:"wcf-field__data--after-field ml-1 font-medium"},f))),o&&(0,i.createElement)("div",{className:`wcf-field__desc ${E}`},Nh(o)))},fN=To("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),pN=To("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),mN=(0,p.createContext)(void 0);function hN(){const e=(0,p.useContext)(mN);if(void 0===e)throw new Error("useDayPicker() must be used within a custom component.");return e}const gN={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function wN(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const yN={date:wN({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:wN({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:wN({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},bN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function vN(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const xN={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:vN({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:vN({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:vN({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:vN({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:vN({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function NN(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}(s,e=>e.test(i)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(s,e=>e.test(i));let c;return c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:t.slice(i.length)}}}const IN={ordinalNumber:(MN={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(MN.matchPattern);if(!n)return null;const r=n[0],o=e.match(MN.parsePattern);if(!o)return null;let a=MN.valueCallback?MN.valueCallback(o[0]):o[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(r.length)}}),era:NN({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:NN({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:NN({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:NN({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:NN({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var MN;const EN={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=gN[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:yN,formatRelative:(e,t,n,r)=>bN[e],localize:xN,match:IN,options:{weekStartsOn:0,firstWeekContainsDate:1}};let _N={};function SN(){return _N}Math.pow(10,8);const DN=6048e5,jN=Symbol.for("constructDateFrom");function kN(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&jN in e?e[jN](t):e instanceof Date?new e.constructor(t):new Date(t)}function CN(e,t){return kN(t||e,e)}function AN(e){const t=CN(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function TN(e,...t){const n=kN.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}function LN(e,t){const n=CN(e,t?.in);return n.setHours(0,0,0,0),n}function ON(e,t,n){const[r,o]=TN(n?.in,e,t),a=LN(r),i=LN(o),s=+a-AN(a),l=+i-AN(i);return Math.round((s-l)/864e5)}function zN(e,t){const n=CN(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function PN(e,t){const n=SN(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=CN(e,t?.in),a=o.getDay(),i=(a<r?7:0)+a-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function RN(e,t){return PN(e,{...t,weekStartsOn:1})}function UN(e,t){const n=CN(e,t?.in),r=n.getFullYear(),o=kN(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=RN(o),i=kN(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const s=RN(i);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function BN(e,t){const n=CN(e,t?.in),r=+RN(n)-+function(e,t){const n=UN(e,t),r=kN(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),RN(r)}(n);return Math.round(r/DN)+1}function FN(e,t){const n=CN(e,t?.in),r=n.getFullYear(),o=SN(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=kN(t?.in||e,0);i.setFullYear(r+1,0,a),i.setHours(0,0,0,0);const s=PN(i,t),l=kN(t?.in||e,0);l.setFullYear(r,0,a),l.setHours(0,0,0,0);const c=PN(l,t);return+n>=+s?r+1:+n>=+c?r:r-1}function YN(e,t){const n=CN(e,t?.in),r=+PN(n,t)-+function(e,t){const n=SN(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=FN(e,t),a=kN(t?.in||e,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),PN(a,t)}(n,t);return Math.round(r/DN)+1}function ZN(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const VN={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ZN("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):ZN(n+1,2)},d:(e,t)=>ZN(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>ZN(e.getHours()%12||12,t.length),H:(e,t)=>ZN(e.getHours(),t.length),m:(e,t)=>ZN(e.getMinutes(),t.length),s:(e,t)=>ZN(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return ZN(Math.trunc(r*Math.pow(10,n-3)),t.length)}},GN={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return VN.y(e,t)},Y:function(e,t,n,r){const o=FN(e,r),a=o>0?o:1-o;return"YY"===t?ZN(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):ZN(a,t.length)},R:function(e,t){return ZN(UN(e),t.length)},u:function(e,t){return ZN(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ZN(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ZN(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return VN.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ZN(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=YN(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):ZN(o,t.length)},I:function(e,t,n){const r=BN(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):ZN(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):VN.d(e,t)},D:function(e,t,n){const r=function(e,t){const n=CN(e,t?.in);return ON(n,zN(n))+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):ZN(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return ZN(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return ZN(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return ZN(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return VN.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):VN.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):ZN(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):ZN(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):VN.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):VN.s(e,t)},S:function(e,t){return VN.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return HN(r);case"XXXX":case"XX":return QN(r);default:return QN(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return HN(r);case"xxxx":case"xx":return QN(r);default:return QN(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+WN(r,":");default:return"GMT"+QN(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+WN(r,":");default:return"GMT"+QN(r,":")}},t:function(e,t,n){return ZN(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return ZN(+e,t.length)}};function WN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+t+ZN(a,2)}function HN(e,t){return e%60==0?(e>0?"-":"+")+ZN(Math.abs(e)/60,2):QN(e,t)}function QN(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+ZN(Math.trunc(r/60),2)+t+ZN(r%60,2)}const $N=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},XN=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},JN={p:XN,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return $N(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",$N(r,t)).replace("{{time}}",XN(o,t))}},qN=/^D+$/,KN=/^Y+$/,eI=["D","DD","YY","YYYY"];function tI(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}const nI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,oI=/^'([^]*?)'?$/,aI=/''/g,iI=/[a-zA-Z]/;function sI(e,t,n){const r=SN(),o=n?.locale??r.locale??EN,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=CN(e,n?.in);if(!function(e){return!(!tI(e)&&"number"!=typeof e||isNaN(+CN(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(rI).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,JN[t])(e,o.formatLong):e}).join("").match(nI).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:lI(e)};if(GN[t])return{isToken:!0,value:e};if(t.match(iI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(r=>{if(!r.isToken)return r.value;const a=r.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return KN.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return qN.test(e)}(a))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),eI.includes(e))throw new RangeError(r)}(a,t,String(e)),(0,GN[a[0]])(s,a,o.localize,c)}).join("")}function lI(e){const t=e.match(oI);return t?t[1].replace(aI,"'"):e}const cI={...EN,labels:{labelDayButton:(e,t,n,r)=>{let o;o=r&&"function"==typeof r.format?r.format.bind(r):(e,t)=>sI(e,t,{locale:EN,...n});let a=o(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return r=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>sI(e,n,{locale:EN,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let o;o=r&&"function"==typeof r.format?r.format.bind(r):(e,t)=>sI(e,t,{locale:EN,...n});let a=o(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return r=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>sI(e,n,{locale:EN,...t}),r(e,"cccc")}}};Symbol.for("constructDateFrom");const uI={},dI={};function fI(e,t){try{const n=(uI[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in dI?dI[n]:mI(n,n.split(":"))}catch{if(e in dI)return dI[e];const t=e?.match(pI);return t?mI(e,t.slice(1)):NaN}}const pI=/([+-]\d\d):?(\d\d)?/;function mI(e,t){const n=+(t[0]||0),r=+(t[1]||0),o=+(t[2]||0)/60;return dI[e]=60*n+r>0?60*n+r+o:60*n-r-o}class hI extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(fI(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),yI(this),wI(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new hI(...t,e):new hI(Date.now(),e)}withTimeZone(e){return new hI(+this,e)}getTimezoneOffset(){const e=-fI(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),wI(this),+this}[Symbol.for("constructDateFrom")](e){return new hI(+new Date(e),this.timeZone)}}const gI=/^(get|set)(?!UTC)/;function wI(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-fI(e.timeZone,e)))}function yI(e){const t=fI(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const o=-new Date(+e).getTimezoneOffset(),a=o- -new Date(+r).getTimezoneOffset(),i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const s=o-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const l=new Date(+e);l.setUTCSeconds(0);const c=o>0?l.getSeconds():(l.getSeconds()-60)%60,u=Math.round(-60*fI(e.timeZone,e))%60;(u||c)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+c));const d=fI(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f-s;if(f!==n&&p){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+p);const t=fI(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!gI.test(e))return;const t=e.replace(gI,"$1UTC");hI.prototype[t]&&(e.startsWith("get")?hI.prototype[e]=function(){return this.internal[t]()}:(hI.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),function(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),yI(e)}(this),+this},hI.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),wI(this),+this}))});class bI extends hI{static tz(e,...t){return t.length?new bI(...t,e):new bI(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new bI(+this,e)}[Symbol.for("constructDateFrom")](e){return new bI(+new Date(e),this.timeZone)}}function vI(e,t,n){const r=CN(e,n?.in);return isNaN(t)?kN(n?.in||e,NaN):t?(r.setDate(r.getDate()+t),r):r}function xI(e,t,n){const r=CN(e,n?.in);if(isNaN(t))return kN(n?.in||e,NaN);if(!t)return r;const o=r.getDate(),a=kN(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),o>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}function NI(e,t,n){const[r,o]=TN(n?.in,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}function II(e,t){const[n,r]=TN(e,t.start,t.end);return{start:n,end:r}}function MI(e,t){const n=SN(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=CN(e,t?.in),a=o.getDay(),i=6+(a<r?-7:0)-(a-r);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}function EI(e,t){const n=CN(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function _I(e,t){return+CN(e)>+CN(t)}function SI(e,t){return+CN(e)<+CN(t)}function DI(e,t,n){const[r,o]=TN(n?.in,e,t);return+LN(r)===+LN(o)}function jI(e,t,n){const r=CN(e,n?.in),o=r.getFullYear(),a=r.getDate(),i=kN(n?.in||e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=CN(e,t?.in),r=n.getFullYear(),o=n.getMonth(),a=kN(n,0);return a.setFullYear(r,o+1,0),a.setHours(0,0,0,0),a.getDate()}(i);return r.setMonth(t,Math.min(a,s)),r}function kI(e,t){const n=CN(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function CI(e,t){const n=t.startOfMonth(e),r=n.getDay();return 1===r?n:0===r?t.addDays(n,-6):t.addDays(n,-1*(r-1))}class AI{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?bI.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new bI(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):vI(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):xI(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return vI(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return xI(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):ON(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):NI(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e,t){const{start:n,end:r}=II(t?.in,e);let o=+n>+r;const a=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,o=!o);const l=[];for(;+i<=a;)l.push(kN(n,i)),i.setMonth(i.getMonth()+s);return o?l.reverse():l}(e),this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):function(e,t){const{start:n,end:r}=II(t?.in,e);let o=+n>+r;const a=o?+n:+r,i=o?r:n;i.setHours(0,0,0,0),i.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,o=!o);const l=[];for(;+i<=a;)l.push(kN(n,i)),i.setFullYear(i.getFullYear()+s);return o?l.reverse():l}(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;const r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):function(e,t){const n=CI(e,t),r=function(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,o=t.addDays(e,1-r),a=t.addDays(o,34);return t.getMonth(e)===t.getMonth(a)?5:4}(e,t);return t.addDays(n,7*r-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return MI(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):EI(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):MI(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=CN(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t,n)=>{const r=this.overrides?.format?this.overrides.format(e,t,this.options):sI(e,t,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):BN(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return CN(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return CN(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):YN(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):_I(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):SI(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):tI(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):DI(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t,n){const[r,o]=TN(n?.in,e,t);return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t,n){const[r,o]=TN(n?.in,e,t);return r.getFullYear()===o.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=kN.bind(null,e));const t=CN(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),kN(r,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=kN.bind(null,e));const t=CN(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),kN(r,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):jI(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const r=CN(e,n?.in);return isNaN(+r)?kN(n?.in||e,NaN):(r.setFullYear(t),r)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):CI(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):LN(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):RN(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):kI(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):PN(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):zN(e),this.options={locale:cI,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&AI.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:r}=this.options,o=t?.code;if(o&&AI.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:n,numberingSystem:r}).format(e)}catch{}const a="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(e,a)}}AI.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const TI=new AI;var LI,OI,zI,PI;function RI(e,t,n=!1,r=TI){let{from:o,to:a}=e;const{differenceInCalendarDays:i,isSameDay:s}=r;return o&&a?(i(a,o)<0&&([o,a]=[a,o]),i(t,o)>=(n?1:0)&&i(a,t)>=(n?1:0)):!n&&a?s(a,t):!(n||!o)&&s(o,t)}function UI(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function BI(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function FI(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function YI(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function ZI(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function VI(e,t){return Array.isArray(e)&&e.every(t.isDate)}function GI(e,t,n=TI){const r=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:a,isAfter:i}=n;return r.some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return o(e,t);if(VI(t,n))return t.some(t=>o(e,t));if(BI(t))return RI(t,e,!1,n);if(ZI(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(UI(t)){const n=a(t.before,e)>0,r=a(t.after,e)<0;return i(t.before,t.after)?r&&n:n||r}return FI(t)?a(e,t.after)>0:YI(t)?a(t.before,e)>0:"function"==typeof t&&t(e)})}function WI(e){return p.createElement("button",{...e})}function HI(e){return p.createElement("span",{...e})}function QI(e){const{size:t=24,orientation:n="left",className:r}=e;return p.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},"up"===n&&p.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===n&&p.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===n&&p.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===n&&p.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function $I(e){const{day:t,modifiers:n,...r}=e;return p.createElement("td",{...r})}function XI(e){const{day:t,modifiers:n,...r}=e,o=p.useRef(null);return p.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),p.createElement("button",{ref:o,...r})}function JI(e){const{options:t,className:n,components:r,classNames:o,...a}=e,i=[o[LI.Dropdown],n].join(" "),s=t?.find(({value:e})=>e===a.value);return p.createElement("span",{"data-disabled":a.disabled,className:o[LI.DropdownRoot]},p.createElement(r.Select,{className:i,...a},t?.map(({value:e,label:t,disabled:n})=>p.createElement(r.Option,{key:e,value:e,disabled:n},t))),p.createElement("span",{className:o[LI.CaptionLabel],"aria-hidden":!0},s?.label,p.createElement(r.Chevron,{orientation:"down",size:18,className:o[LI.Chevron]})))}function qI(e){return p.createElement("div",{...e})}function KI(e){return p.createElement("div",{...e})}function eM(e){const{calendarMonth:t,displayIndex:n,...r}=e;return p.createElement("div",{...r},e.children)}function tM(e){const{calendarMonth:t,displayIndex:n,...r}=e;return p.createElement("div",{...r})}function nM(e){return p.createElement("table",{...e})}function rM(e){return p.createElement("div",{...e})}function oM(e){const{components:t}=hN();return p.createElement(t.Dropdown,{...e})}function aM(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:o,...a}=e,{components:i,classNames:s,labels:{labelPrevious:l,labelNext:c}}=hN(),u=(0,p.useCallback)(e=>{o&&n?.(e)},[o,n]),d=(0,p.useCallback)(e=>{r&&t?.(e)},[r,t]);return p.createElement("nav",{...a},p.createElement(i.PreviousMonthButton,{type:"button",className:s[LI.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":l(r),onClick:d},p.createElement(i.Chevron,{disabled:!r||void 0,className:s[LI.Chevron],orientation:"left"})),p.createElement(i.NextMonthButton,{type:"button",className:s[LI.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":!o||void 0,"aria-label":c(o),onClick:u},p.createElement(i.Chevron,{disabled:!o||void 0,orientation:"right",className:s[LI.Chevron]})))}function iM(e){const{components:t}=hN();return p.createElement(t.Button,{...e})}function sM(e){return p.createElement("option",{...e})}function lM(e){const{components:t}=hN();return p.createElement(t.Button,{...e})}function cM(e){const{rootRef:t,...n}=e;return p.createElement("div",{...n,ref:t})}function uM(e){return p.createElement("select",{...e})}function dM(e){const{week:t,...n}=e;return p.createElement("tr",{...n})}function fM(e){return p.createElement("th",{...e})}function pM(e){return p.createElement("thead",{"aria-hidden":!0},p.createElement("tr",{...e}))}function mM(e){const{week:t,...n}=e;return p.createElement("th",{...n})}function hM(e){return p.createElement("th",{...e})}function gM(e){return p.createElement("tbody",{...e})}function wM(e){const{components:t}=hN();return p.createElement(t.Dropdown,{...e})}function yM(){const e={};for(const t in LI)e[LI[t]]=`rdp-${LI[t]}`;for(const t in OI)e[OI[t]]=`rdp-${OI[t]}`;for(const t in zI)e[zI[t]]=`rdp-${zI[t]}`;for(const t in PI)e[PI[t]]=`rdp-${PI[t]}`;return e}function bM(e,t,n){return(n??new AI(t)).formatMonthYear(e)}!function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(LI||(LI={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(OI||(OI={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(zI||(zI={})),function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"}(PI||(PI={}));const vM=bM;function xM(e,t,n){return(n??new AI(t)).format(e,"d")}function NM(e,t=TI){return t.format(e,"LLLL")}function IM(e,t,n){return(n??new AI(t)).format(e,"cccccc")}function MM(e,t=TI){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function EM(){return""}function _M(e,t=TI){return t.format(e,"yyyy")}const SM=_M;function DM(e,t,n,r){let o=(r??new AI(n)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const jM=DM;function kM(e,t,n){return(n??new AI(t)).formatMonthYear(e)}const CM=kM;function AM(e,t,n,r){let o=(r??new AI(n)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o}function TM(e){return"Choose the Month"}function LM(){return""}function OM(e,t){return"Go to the Next Month"}function zM(e){return"Go to the Previous Month"}function PM(e,t,n){return(n??new AI(t)).format(e,"cccc")}function RM(e,t){return`Week ${e}`}function UM(e){return"Week Number"}function BM(e){return"Choose the Year"}const FM=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function YM(e,t){const n=t.locale?.labels??{};return{...a,...e??{},labelDayButton:FM(DM,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:FM(TM,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:FM(OM,e?.labelNext,n.labelNext),labelPrevious:FM(zM,e?.labelPrevious,n.labelPrevious),labelWeekNumber:FM(RM,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:FM(BM,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:FM(kM,e?.labelGrid,n.labelGrid),labelGridcell:FM(AM,e?.labelGridcell,n.labelGridcell),labelNav:FM(LM,e?.labelNav,n.labelNav),labelWeekNumberHeader:FM(UM,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:FM(PM,e?.labelWeekday,n.labelWeekday)}}function ZM(e,t,n,r,o){const{startOfMonth:a,startOfYear:i,endOfYear:s,eachMonthOfInterval:l,getMonth:c}=o;return l({start:i(e),end:s(e)}).map(e=>{const i=r.formatMonthDropdown(e,o);return{value:c(e),label:i,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function VM(e,t,n,r,o=!1){if(!e)return;if(!t)return;const{startOfYear:a,endOfYear:i,eachYearOfInterval:s,getYear:l}=r,c=s({start:a(e),end:i(t)});return o&&c.reverse(),c.map(e=>{const t=n.formatYearDropdown(e,r);return{value:l(e),label:t,disabled:!1}})}const GM=e=>e instanceof HTMLElement?e:null,WM=e=>[...e.querySelectorAll("[data-animated-month]")??[]],HM=e=>GM(e.querySelector("[data-animated-caption]")),QM=e=>GM(e.querySelector("[data-animated-weeks]"));function $M(e,t,n,r){const{month:o,defaultMonth:a,today:i=r.today(),numberOfMonths:s=1}=e;let l=o||a||i;const{differenceInCalendarMonths:c,addMonths:u,startOfMonth:d}=r;return n&&c(n,l)<s-1&&(l=u(n,-1*(s-1))),t&&c(l,t)<0&&(l=t),d(l)}class XM{constructor(e,t,n=TI){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,"yyyy-MM-dd"),this.displayMonthId=n.format(t,"yyyy-MM"),this.dateMonthId=n.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class JM{constructor(e,t){this.days=t,this.weekNumber=e}}class qM{constructor(e,t){this.date=e,this.weeks=t}}function KM(e,t){const[n,r]=(0,p.useState)(e);return[void 0===t?n:t,r]}var eE;function tE(e){return!e[OI.disabled]&&!e[OI.hidden]&&!e[OI.outside]}function nE(e,t,n,r,o,a,i,s=0){if(s>365)return;const l=function(e,t,n,r,o,a,i){const{ISOWeek:s,broadcastCalendar:l}=a,{addDays:c,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:w,startOfBroadcastWeek:y,startOfISOWeek:b,startOfWeek:v}=i,x={day:c,week:d,month:u,year:f,startOfWeek:e=>l?y(e,i):s?b(e):v(e),endOfWeek:e=>l?p(e):s?m(e):h(e)};let N=x[e](n,"after"===t?1:-1);return"before"===t&&r?N=g([r,N]):"after"===t&&o&&(N=w([o,N])),N}(e,t,n.date,r,o,a,i),c=Boolean(a.disabled&&GI(l,a.disabled,i)),u=Boolean(a.hidden&&GI(l,a.hidden,i)),d=new XM(l,l,i);return c||u?nE(e,t,d,r,o,a,i,s+1):d}function rE(e,t,n,r,o){const{autoFocus:a}=e,[i,s]=(0,p.useState)(),l=function(e,t,n,r){let o,a=-1;for(const i of e){const e=t(i);tE(e)&&(e[OI.focused]&&a<eE.FocusedModifier?(o=i,a=eE.FocusedModifier):r?.isEqualTo(i)&&a<eE.LastFocused?(o=i,a=eE.LastFocused):n(i.date)&&a<eE.Selected?(o=i,a=eE.Selected):e[OI.today]&&a<eE.Today&&(o=i,a=eE.Today))}return o||(o=e.find(e=>tE(t(e)))),o}(t.days,n,r||(()=>!1),i),[c,u]=(0,p.useState)(a?l:void 0);return{isFocusTarget:e=>Boolean(l?.isEqualTo(e)),setFocused:u,focused:c,blur:()=>{s(c),u(void 0)},moveFocus:(n,r)=>{if(!c)return;const a=nE(n,r,c,t.navStart,t.navEnd,e,o);if(a){if(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(a)))return;t.goToDay(a),u(a)}}}}function oE(e,t,n=TI){return RI(e,t.from,!1,n)||RI(e,t.to,!1,n)||RI(t,e.from,!1,n)||RI(t,e.to,!1,n)}function aE(e,t){const{disabled:n,excludeDisabled:r,resetOnSelect:o,selected:a,required:i,onSelect:s}=e,[l,c]=KM(a,s?a:void 0),u=s?a:l;return{selected:u,select:(a,l,d)=>{const{min:f,max:p}=e;let m;if(a){const e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=!o||!r&&u?.from?function(e,t,n=0,r=0,o=!1,a=TI){const{from:i,to:s}=t||{},{isSameDay:l,isAfter:c,isBefore:u}=a;let d;if(i||s){if(i&&!s)d=l(i,e)?0===n?{from:i,to:e}:o?{from:i,to:void 0}:void 0:u(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&s)if(l(i,e)&&l(s,e))d=o?{from:i,to:s}:void 0;else if(l(i,e))d={from:i,to:n>0?void 0:e};else if(l(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,i))d={from:e,to:s};else if(c(e,i))d={from:i,to:e};else{if(!c(e,s))throw new Error("Invalid range");d={from:i,to:e}}}else d={from:e,to:n>0?void 0:e};if(d?.from&&d?.to){const t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}(a,u,f,p,i,t):!i&&s?void 0:{from:a,to:void 0}}return r&&n&&m?.from&&m.to&&function(e,t,n=TI){const r=Array.isArray(t)?t:[t],o=r.filter(e=>"function"!=typeof e),a=o.some(t=>"boolean"==typeof t?t:n.isDate(t)?RI(e,t,!1,n):VI(t,n)?t.some(t=>RI(e,t,!1,n)):BI(t)?!(!t.from||!t.to)&&oE(e,{from:t.from,to:t.to},n):ZI(t)?function(e,t,n=TI){const r=Array.isArray(t)?t:[t];let o=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let e=0;e<=i;e++){if(r.includes(o.getDay()))return!0;o=n.addDays(o,1)}return!1}(e,t.dayOfWeek,n):UI(t)?n.isAfter(t.before,t.after)?oE(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):GI(e.from,t,n)||GI(e.to,t,n):!(!FI(t)&&!YI(t))&&(GI(e.from,t,n)||GI(e.to,t,n)));if(a)return!0;const i=r.filter(e=>"function"==typeof e);if(i.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||c(m),s?.(m,a,l,d),m},isSelected:e=>u&&RI(u,e,!1,t)}}function iE(e,t){return e instanceof bI&&e.timeZone===t?e:new bI(e,t)}function sE(e,t,n){if(!n)return iE(e,t);const r=iE(e,t),o=new bI(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(o.getTime())}function lE(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?sE(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?sE(e,t,n):e):BI(e)?{...e,from:e.from?iE(e.from,t):e.from,to:e.to?iE(e.to,t):e.to}:UI(e)?{before:sE(e.before,t,n),after:sE(e.after,t,n)}:FI(e)?{after:sE(e.after,t,n)}:YI(e)?{before:sE(e.before,t,n)}:e}function cE(e,t,n){return e?Array.isArray(e)?e.map(e=>lE(e,t,n)):lE(e,t,n):e}function uE(e){let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=iE(t.today,n)),t.month&&(t.month=iE(t.month,n)),t.defaultMonth&&(t.defaultMonth=iE(t.defaultMonth,n)),t.startMonth&&(t.startMonth=iE(t.startMonth,n)),t.endMonth&&(t.endMonth=iE(t.endMonth,n)),"single"===t.mode&&t.selected?t.selected=iE(t.selected,n):"multiple"===t.mode&&t.selected?t.selected=t.selected?.map(e=>iE(e,n)):"range"===t.mode&&t.selected&&(t.selected={from:t.selected.from?iE(t.selected.from,n):t.selected.from,to:t.selected.to?iE(t.selected.to,n):t.selected.to}),void 0!==t.disabled&&(t.disabled=cE(t.disabled,n)),void 0!==t.hidden&&(t.hidden=cE(t.hidden,n)),t.modifiers)){const e={};Object.keys(t.modifiers).forEach(r=>{e[r]=cE(t.modifiers?.[r],n)}),t.modifiers=e}const{components:a,formatters:i,labels:s,dateLib:l,locale:c,classNames:u}=(0,p.useMemo)(()=>{const e={...cI,...t.locale},n=t.broadcastCalendar?1:t.weekStartsOn,a=t.noonSafe&&t.timeZone?function(e,t={}){const{weekStartsOn:n,locale:r}=t,o=n??r?.options?.weekStartsOn??0,a=t=>{const n="number"==typeof t||"string"==typeof t?new Date(t):t;return new bI(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},i=e=>{const t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(bI.tz(e)),newDate:(t,n,r)=>new bI(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{const n=a(e),r=t?.weekStartsOn??o,i=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-i),n},startOfISOWeek:e=>{const t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{const t=a(e);return t.setDate(1),t},startOfYear:e=>{const t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{const n=a(e),r=(((t?.weekStartsOn??o)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{const t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{const t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{const t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{const n=a(t.start),r=a(t.end),o=[],i=new bI(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=12*r.getFullYear()+r.getMonth();for(;12*i.getFullYear()+i.getMonth()<=s;)o.push(new bI(i,e)),i.setMonth(i.getMonth()+1,1);return o},addDays:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+7*t),n},addMonths:(e,t)=>{const n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{const n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{const n=a(t.start),r=a(t.end),o=[],i=new bI(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=r.getFullYear();)o.push(new bI(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return o},getWeek:(e,t)=>YN(i(e),{weekStartsOn:t?.weekStartsOn??o,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>BN(i(e)),differenceInCalendarDays:(e,t)=>ON(i(e),i(t)),differenceInCalendarMonths:(e,t)=>NI(i(e),i(t))}}(t.timeZone,{weekStartsOn:n,locale:e}):void 0,i=t.dateLib&&a?{...a,...t.dateLib}:t.dateLib??a,s=new AI({locale:e,weekStartsOn:n,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},i);return{dateLib:s,components:(c=t.components,{...r,...c}),formatters:(l=t.formatters,l?.formatMonthCaption&&!l.formatCaption&&(l.formatCaption=l.formatMonthCaption),l?.formatYearCaption&&!l.formatYearDropdown&&(l.formatYearDropdown=l.formatYearCaption),{...o,...l}),labels:YM(t.labels,s.options),locale:e,classNames:{...yM(),...t.classNames}};var l,c},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:l.today()});const{captionLayout:d,mode:f,navLayout:m,numberOfMonths:h=1,onDayBlur:g,onDayClick:w,onDayFocus:y,onDayKeyDown:b,onDayMouseEnter:v,onDayMouseLeave:x,onNextClick:N,onPrevClick:I,showWeekNumber:M,styles:E}=t,{formatCaption:_,formatDay:S,formatMonthDropdown:D,formatWeekNumber:j,formatWeekNumberHeader:k,formatWeekdayName:C,formatYearDropdown:A}=i,T=function(e,t){const[n,r]=function(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:o,startOfDay:a,startOfMonth:i,endOfMonth:s,addYears:l,endOfYear:c,newDate:u,today:d}=t,{fromYear:f,toYear:p,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&p&&(r=u(p,11,31));const g="dropdown"===e.captionLayout||"dropdown-years"===e.captionLayout;return n?n=i(n):f?n=u(f,0,1):!n&&g&&(n=o(l(e.today??d(),-100))),r?r=s(r):p?r=u(p,11,31):!r&&g&&(r=c(e.today??d())),[n?a(n):n,r?a(r):r]}(e,t),{startOfMonth:o,endOfMonth:a}=t,i=$M(e,n,r,t),[s,l]=KM(i,e.month?i:void 0);(0,p.useEffect)(()=>{const o=$M(e,n,r,t);l(o)},[e.timeZone]);const{months:c,weeks:u,days:d,previousMonth:f,nextMonth:m}=(0,p.useMemo)(()=>{const o=function(e,t,n,r){const{numberOfMonths:o=1}=n,a=[];for(let n=0;n<o;n++){const o=r.addMonths(e,n);if(t&&o>t)break;a.push(o)}return a}(s,r,{numberOfMonths:e.numberOfMonths},t),i=function(e,t,n,r){const o=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:w,startOfISOWeek:y,startOfWeek:b}=r,v=l?w(o,r):i?y(o):b(o),x=l?f(a):i?p(m(a)):h(m(a)),N=t&&(l?f(t):i?p(t):h(t)),I=u(N&&g(x,N)?N:x,v),M=d(a,o)+1,E=[];for(let e=0;e<=I;e++){const t=c(v,e);E.push(t)}const _=(l?35:42)*M;if(s&&E.length<_){const e=_-E.length;for(let t=0;t<e;t++){const e=c(E[E.length-1],1);E.push(e)}}return E}(o,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),l=function(e,t,n,r){const{addDays:o,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:s,endOfWeek:l,getISOWeek:c,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{const h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?i(s(m)):l(s(m)),w=t.filter(e=>e>=h&&e<=g),y=n.broadcastCalendar?35:42;if(n.fixedWeeks&&w.length<y){const e=t.filter(e=>{const t=y-w.length;return e>g&&e<=o(g,t)});w.push(...e)}const b=w.reduce((e,t)=>{const o=n.ISOWeek?c(t):u(t),a=e.find(e=>e.weekNumber===o),i=new XM(t,m,r);return a?a.days.push(i):e.push(new JM(o,[i])),e},[]),v=new qM(m,b);return e.push(v),e},[]);return n.reverseMonths?m.reverse():m}(o,i,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),c=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(l),u=function(e){const t=[];return e.reduce((e,n)=>{const r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}(l),d=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=r,c=o?a??1:1,u=i(e);return t&&l(u,t)<=0?void 0:s(u,-c)}(s,n,e,t),f=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=r,c=o?a:1,u=i(e);return t&&l(t,e)<a?void 0:s(u,c)}(s,r,e,t);return{months:l,weeks:c,days:u,previousMonth:d,nextMonth:f}},[t,s.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:h,onMonthChange:g}=e,w=e=>{if(h)return;let t=o(e);n&&t<o(n)&&(t=o(n)),r&&t>o(r)&&(t=o(r)),l(t),g?.(t)},y={months:c,weeks:u,days:d,navStart:n,navEnd:r,previousMonth:f,nextMonth:m,goToMonth:w,goToDay:e=>{(e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||w(e.date)}};return y}(t,l),{days:L,months:O,navStart:z,navEnd:P,previousMonth:R,nextMonth:U,goToMonth:B}=T,F=function(e,t,n,r,o){const{disabled:a,hidden:i,modifiers:s,showOutsideDays:l,broadcastCalendar:c,today:u=o.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=o,w=n&&p(n),y=r&&h(r),b={[OI.focused]:[],[OI.outside]:[],[OI.disabled]:[],[OI.hidden]:[],[OI.today]:[]},v={};for(const t of e){const{date:e,displayMonth:n}=t,r=Boolean(n&&!f(e,n)),p=Boolean(w&&m(e,w)),h=Boolean(y&&g(e,y)),x=Boolean(a&&GI(e,a,o)),N=Boolean(i&&GI(e,i,o))||p||h||!c&&!l&&r||c&&!1===l&&r,I=d(e,u);r&&b.outside.push(t),x&&b.disabled.push(t),N&&b.hidden.push(t),I&&b.today.push(t),s&&Object.keys(s).forEach(n=>{const r=s?.[n];r&&GI(e,r,o)&&(v[n]?v[n].push(t):v[n]=[t])})}return e=>{const t={[OI.focused]:!1,[OI.disabled]:!1,[OI.hidden]:!1,[OI.outside]:!1,[OI.today]:!1},n={};for(const n in b){const r=b[n];t[n]=r.some(t=>t===e)}for(const t in v)n[t]=v[t].some(t=>t===e);return{...t,...n}}}(L,t,z,P,l),{isSelected:Y,select:Z,selected:V}=function(e,t){const n=function(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=KM(n,o?n:void 0),s=o?n:a,{isSameDay:l}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&l(e,s)&&(a=void 0),o||i(a),o?.(a,e,t,n),a},isSelected:e=>!!s&&l(s,e)}}(e,t),r=function(e,t){const{selected:n,required:r,onSelect:o}=e,[a,i]=KM(n,o?n:void 0),s=o?n:a,{isSameDay:l}=t,c=e=>s?.some(t=>l(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(c(e)){if(s?.length===u)return;if(r&&1===s?.length)return;a=s?.filter(t=>!l(t,e))}else a=s?.length===d?[e]:[...a,e];return o||i(a),o?.(a,e,t,n),a},isSelected:c}}(e,t),o=aE(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return o;default:return}}(t,l)??{},{blur:G,focused:W,isFocusTarget:H,moveFocus:Q,setFocused:$}=rE(t,T,F,Y??(()=>!1),l),{labelDayButton:X,labelGridcell:J,labelGrid:q,labelMonthDropdown:K,labelNav:ee,labelPrevious:te,labelNext:ne,labelWeekday:re,labelWeekNumber:oe,labelWeekNumberHeader:ae,labelYearDropdown:ie}=s,se=(0,p.useMemo)(()=>function(e,t,n,r){const o=r??e.today(),a=n?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),i=[];for(let t=0;t<7;t++){const n=e.addDays(a,t);i.push(n)}return i}(l,t.ISOWeek,t.broadcastCalendar,t.today),[l,t.ISOWeek,t.broadcastCalendar,t.today]),le=void 0!==f||void 0!==w,ce=(0,p.useCallback)(()=>{R&&(B(R),I?.(R))},[R,B,I]),ue=(0,p.useCallback)(()=>{U&&(B(U),N?.(U))},[B,U,N]),de=(0,p.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),$(e),t.disabled||(Z?.(e.date,t,n),w?.(e.date,t,n))},[Z,w,$]),fe=(0,p.useCallback)((e,t)=>n=>{$(e),y?.(e.date,t,n)},[y,$]),pe=(0,p.useCallback)((e,t)=>n=>{G(),g?.(e.date,t,n)},[G,g]),me=(0,p.useCallback)((e,n)=>r=>{const o={ArrowLeft:[r.shiftKey?"month":"day","rtl"===t.dir?"after":"before"],ArrowRight:[r.shiftKey?"month":"day","rtl"===t.dir?"before":"after"],ArrowDown:[r.shiftKey?"year":"week","after"],ArrowUp:[r.shiftKey?"year":"week","before"],PageUp:[r.shiftKey?"year":"month","before"],PageDown:[r.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(o[r.key]){r.preventDefault(),r.stopPropagation();const[e,t]=o[r.key];Q(e,t)}b?.(e.date,n,r)},[Q,b,t.dir]),he=(0,p.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),ge=(0,p.useCallback)((e,t)=>n=>{x?.(e.date,t,n)},[x]),we=(0,p.useCallback)(e=>t=>{const n=Number(t.target.value),r=l.setMonth(l.startOfMonth(e),n);B(r)},[l,B]),ye=(0,p.useCallback)(e=>t=>{const n=Number(t.target.value),r=l.setYear(l.startOfMonth(e),n);B(r)},[l,B]),{className:be,style:ve}=(0,p.useMemo)(()=>({className:[u[LI.Root],t.className].filter(Boolean).join(" "),style:{...E?.[LI.Root],...t.style}}),[u,t.className,t.style,E]),xe=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith("data-")&&(t[e]=n)}),t}(t),Ne=(0,p.useRef)(null);!function(e,t,{classNames:n,months:r,focused:o,dateLib:a}){const i=(0,p.useRef)(null),s=(0,p.useRef)(r),l=(0,p.useRef)(!1);(0,p.useLayoutEffect)(()=>{const c=s.current;if(s.current=r,!(t&&e.current&&e.current instanceof HTMLElement&&0!==r.length&&0!==c.length&&r.length===c.length))return;const u=a.isSameMonth(r[0].date,c[0].date),d=a.isAfter(r[0].date,c[0].date),f=d?n[PI.caption_after_enter]:n[PI.caption_before_enter],p=d?n[PI.weeks_after_enter]:n[PI.weeks_before_enter],m=i.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(WM(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=GM(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=HM(e);n&&n.classList.remove(f);const r=QM(e);r&&r.classList.remove(p)}),i.current=h):i.current=null,l.current||u||o)return;const g=m instanceof HTMLElement?WM(m):[],w=WM(e.current);if(w?.every(e=>e instanceof HTMLElement)&&g&&g.every(e=>e instanceof HTMLElement)){l.current=!0;const t=[];e.current.style.isolation="isolate";const r=(y=e.current,GM(y.querySelector("[data-animated-nav]")));r&&(r.style.zIndex="1"),w.forEach((o,a)=>{const i=g[a];if(!i)return;o.style.position="relative",o.style.overflow="hidden";const s=HM(o);s&&s.classList.add(f);const c=QM(o);c&&c.classList.add(p);const u=()=>{l.current=!1,e.current&&(e.current.style.isolation=""),r&&(r.style.zIndex=""),s&&s.classList.remove(f),c&&c.classList.remove(p),o.style.position="",o.style.overflow="",o.contains(i)&&o.removeChild(i)};t.push(u),i.style.pointerEvents="none",i.style.position="absolute",i.style.overflow="hidden",i.setAttribute("aria-hidden","true");const m=(e=>GM(e.querySelector("[data-animated-weekdays]")))(i);m&&(m.style.opacity="0");const h=HM(i);h&&(h.classList.add(d?n[PI.caption_before_exit]:n[PI.caption_after_exit]),h.addEventListener("animationend",u));const w=QM(i);w&&w.classList.add(d?n[PI.weeks_before_exit]:n[PI.weeks_after_exit]),o.insertBefore(i,o.firstChild)})}var y})}(Ne,Boolean(t.animate),{classNames:u,months:O,focused:W,dateLib:l});const Ie={dayPickerProps:t,selected:V,select:Z,isSelected:Y,months:O,nextMonth:U,previousMonth:R,goToMonth:B,getModifiers:F,components:a,classNames:u,styles:E,labels:s,formatters:i};return p.createElement(mN.Provider,{value:Ie},p.createElement(a.Root,{rootRef:t.animate?Ne:void 0,className:be,style:ve,dir:t.dir,id:t.id,lang:t.lang??c.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...xe},p.createElement(a.Months,{className:u[LI.Months],style:E?.[LI.Months]},!t.hideNavigation&&!m&&p.createElement(a.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[LI.Nav],style:E?.[LI.Nav],"aria-label":ee(),onPreviousClick:ce,onNextClick:ue,previousMonth:R,nextMonth:U}),O.map((e,n)=>p.createElement(a.Month,{"data-animated-month":t.animate?"true":void 0,className:u[LI.Month],style:E?.[LI.Month],key:n,displayIndex:n,calendarMonth:e},"around"===m&&!t.hideNavigation&&0===n&&p.createElement(a.PreviousMonthButton,{type:"button",className:u[LI.PreviousMonthButton],tabIndex:R?void 0:-1,"aria-disabled":!R||void 0,"aria-label":te(R),onClick:ce,"data-animated-button":t.animate?"true":void 0},p.createElement(a.Chevron,{disabled:!R||void 0,className:u[LI.Chevron],orientation:"rtl"===t.dir?"right":"left"})),p.createElement(a.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:u[LI.MonthCaption],style:E?.[LI.MonthCaption],calendarMonth:e,displayIndex:n},d?.startsWith("dropdown")?p.createElement(a.DropdownNav,{className:u[LI.Dropdowns],style:E?.[LI.Dropdowns]},(()=>{const n="dropdown"===d||"dropdown-months"===d?p.createElement(a.MonthsDropdown,{key:"month",className:u[LI.MonthsDropdown],"aria-label":K(),classNames:u,components:a,disabled:Boolean(t.disableNavigation),onChange:we(e.date),options:ZM(e.date,z,P,i,l),style:E?.[LI.Dropdown],value:l.getMonth(e.date)}):p.createElement("span",{key:"month"},D(e.date,l)),r="dropdown"===d||"dropdown-years"===d?p.createElement(a.YearsDropdown,{key:"year",className:u[LI.YearsDropdown],"aria-label":ie(l.options),classNames:u,components:a,disabled:Boolean(t.disableNavigation),onChange:ye(e.date),options:VM(z,P,i,l,Boolean(t.reverseYears)),style:E?.[LI.Dropdown],value:l.getYear(e.date)}):p.createElement("span",{key:"year"},A(e.date,l));return"year-first"===l.getMonthYearOrder()?[r,n]:[n,r]})(),p.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},_(e.date,l.options,l))):p.createElement(a.CaptionLabel,{className:u[LI.CaptionLabel],role:"status","aria-live":"polite"},_(e.date,l.options,l))),"around"===m&&!t.hideNavigation&&n===h-1&&p.createElement(a.NextMonthButton,{type:"button",className:u[LI.NextMonthButton],tabIndex:U?void 0:-1,"aria-disabled":!U||void 0,"aria-label":ne(U),onClick:ue,"data-animated-button":t.animate?"true":void 0},p.createElement(a.Chevron,{disabled:!U||void 0,className:u[LI.Chevron],orientation:"rtl"===t.dir?"left":"right"})),n===h-1&&"after"===m&&!t.hideNavigation&&p.createElement(a.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[LI.Nav],style:E?.[LI.Nav],"aria-label":ee(),onPreviousClick:ce,onNextClick:ue,previousMonth:R,nextMonth:U}),p.createElement(a.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===f||"range"===f,"aria-label":q(e.date,l.options,l)||void 0,className:u[LI.MonthGrid],style:E?.[LI.MonthGrid]},!t.hideWeekdays&&p.createElement(a.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:u[LI.Weekdays],style:E?.[LI.Weekdays]},M&&p.createElement(a.WeekNumberHeader,{"aria-label":ae(l.options),className:u[LI.WeekNumberHeader],style:E?.[LI.WeekNumberHeader],scope:"col"},k()),se.map(e=>p.createElement(a.Weekday,{"aria-label":re(e,l.options,l),className:u[LI.Weekday],key:String(e),style:E?.[LI.Weekday],scope:"col"},C(e,l.options,l)))),p.createElement(a.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:u[LI.Weeks],style:E?.[LI.Weeks]},e.weeks.map(e=>p.createElement(a.Week,{className:u[LI.Week],key:e.weekNumber,style:E?.[LI.Week],week:e},M&&p.createElement(a.WeekNumber,{week:e,style:E?.[LI.WeekNumber],"aria-label":oe(e.weekNumber,{locale:c}),className:u[LI.WeekNumber],scope:"row",role:"rowheader"},j(e.weekNumber,l)),e.days.map(e=>{const{date:n}=e,r=F(e);if(r[OI.focused]=!r.hidden&&Boolean(W?.isEqualTo(e)),r[zI.selected]=Y?.(n)||r.selected,BI(V)){const{from:e,to:t}=V;r[zI.range_start]=Boolean(e&&t&&l.isSameDay(n,e)),r[zI.range_end]=Boolean(e&&t&&l.isSameDay(n,t)),r[zI.range_middle]=RI(V,n,!0,l)}const o=function(e,t={},n={}){let r={...t?.[LI.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{r={...r,...n?.[e]}}),r}(r,E,t.modifiersStyles),i=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[r])=>(n[r]?e.push(n[r]):t[OI[r]]?e.push(t[OI[r]]):t[zI[r]]&&e.push(t[zI[r]]),e),[t[LI.Day]])}(r,u,t.modifiersClassNames),s=le||r.hidden?void 0:J(n,r,l.options,l);return p.createElement(a.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:r,className:i.join(" "),style:o,role:"gridcell","aria-selected":r.selected||void 0,"aria-label":s,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":r.selected||void 0,"data-disabled":r.disabled||void 0,"data-hidden":r.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":r.focused||void 0,"data-today":r.today||void 0},!r.hidden&&le?p.createElement(a.DayButton,{className:u[LI.DayButton],style:E?.[LI.DayButton],type:"button",day:e,modifiers:r,disabled:!r.focused&&r.disabled||void 0,"aria-disabled":r.focused&&r.disabled||void 0,tabIndex:H(e)?0:-1,"aria-label":X(n,r,l.options,l),onClick:de(e,r),onBlur:pe(e,r),onFocus:fe(e,r),onKeyDown:me(e,r),onMouseEnter:he(e,r),onMouseLeave:ge(e,r)},S(n,l.options,l)):!r.hidden&&S(e.date,l.options,l))})))))))),t.footer&&p.createElement(a.Footer,{className:u[LI.Footer],style:E?.[LI.Footer],role:"status","aria-live":"polite"},t.footer)))}function dE(e,t,n){const r=CN(e,n?.in);return r.setMinutes(t),r}function fE(e,t,n){const r=CN(e,n?.in);return r.setHours(t),r}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(eE||(eE={}));const pE=()=>(0,C.jsx)("span",{className:"bg-icon-interactive h-1 w-1 absolute rounded-full inline-block bottom-0 left-1/2 right-1/2"}),mE=e=>sI(e,"E").slice(0,1),hE=(e,t=24)=>Array.from({length:t},(t,n)=>e+n),gE=(e,t)=>t?dE(fE(e,function(e,t){return CN(e,t?.in).getHours()}(t)),function(e,t){return CN(e,t?.in).getMinutes()}(t)):e,wE=e=>"multiple"===e?[]:"range"===e?{from:void 0,to:void 0}:void 0,yE=({width:e,className:t,classNames:n,selectedDates:r,setSelectedDates:o,showOutsideDays:a=!0,mode:i="single",variant:s="normal",alignment:l="horizontal",numberOfMonths:c,enableTimeSelection:u=!1,disabled:d,...f})=>{const m=p.isValidElement(f.footer)||"function"==typeof f.footer,h=u&&"multiple"!==i,[g,w]=(0,p.useState)(!1),[y,b]=(0,p.useState)(!1),[v,x]=(0,p.useState)((new Date).getFullYear()),[N,I]=(0,p.useState)(v-v%24);void 0===r&&(r="multiple"===i?[]:"range"===i?{from:void 0,to:void 0}:void 0);const M=({weekdays:e})=>(0,C.jsx)("div",{className:"flex justify-between",children:e.map((e,t)=>(0,C.jsx)("button",{className:"h-10 w-10 px-1.5 py-2 text-center text-text-secondary text-sm font-normal content-center bg-transparent border-none shrink-0",children:e},t))}),E=e=>(0,C.jsx)("div",{className:"flex flex-col bsf-force-ui-month-weeks",children:e.children[1].props.children.map((e,t)=>(0,C.jsx)("div",{className:"flex flex-row justify-between",children:e},t))}),_=(e,t,n)=>(0,C.jsxs)("div",{className:"flex flex-col items-start gap-1 flex-1",children:[(0,C.jsx)("span",{className:"text-xs font-medium text-text-secondary",children:n}),(0,C.jsx)("input",{type:"time",className:Se("w-full px-2 py-1 rounded text-sm font-normal text-text-primary bg-field-secondary-background outline outline-1 outline-border-subtle border-none transition-[color,box-shadow,outline] duration-200","focus:outline-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",!t&&"outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled"),value:t?sI(t,"HH:mm"):"",disabled:!t,onChange:t=>((e,t)=>{const{value:n}=e.target;if(!n)return;if("single"===t){if(!(r instanceof Date))return;const[e,t]=n.split(":").map(Number);return void o(dE(fE(r,e),t))}const a=r;if(!a?.[t])return;const[i,s]=n.split(":").map(Number),l=dE(fE(a[t],i),s),c={...a,[t]:l},u="from"===t?"to":"from";c.from&&c.to&&_I(c.from,c.to)&&(c[u]=gE(c[u],l)),o(c)})(t,e),"aria-label":n})]}),S=h?(0,C.jsx)("div",{className:Se("flex items-end gap-3 p-2 bg-background-primary border-solid border-border-subtle","presets"===s?"border-l border-r border-t-0 border-b":"border border-t-0",!m&&("presets"===s?"rounded-br-md":"rounded-bl-md rounded-br-md")),children:"single"===i?_("single",r,"Time"):(0,C.jsxs)(C.Fragment,{children:[_("from",r?.from,"Start time"),_("to",r?.to,"End time")]})}):null,D=Se("relative bg-background-primary shadow-datepicker-wrapper",e,"vertical"===l?"flex flex-col":"flex flex-row gap-3","normal"===s?"rounded-tr-md rounded-tl-md border border-solid border-border-subtle":"","presets"===s?"rounded-tr-md border border-solid border-border-subtle":"","dualdate"===s?"rounded-tr-md rounded-tl-md border border-solid border-border-subtle":"",m||h?"rounded-b-none":"rounded-bl-md rounded-br-md");return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(uE,{mode:i,selected:r,onSelect:(e,t)=>{if("range"===i){const n=r,a=e=>{return!!e&&(u?DI(t,e):(n=e,+CN(t)===+CN(n)));var n},i=(e,t)=>u?gE(e,t):e;if(!n?.from&&!n?.to||n?.from&&n?.to)return a(n?.from)||a(n?.to)?void o({from:void 0,to:void 0}):void o({from:i(t,n?.from),to:void 0});if(n?.from&&!n?.to){if(u?SI(t,LN(n.from)):t<n.from)return void o({from:i(t,n.from),to:n.from});let e=i(t,n.to);return u&&SI(e,n.from)&&(e=gE(e,n.from)),void o({from:n.from,to:e})}o(e)}else if("multiple"===i)r.some(e=>sI(e,"yyyy-MM-dd")===sI(t,"yyyy-MM-dd"))?o(r.filter(e=>sI(e,"yyyy-MM-dd")!==sI(t,"yyyy-MM-dd"))):o([...r,t]);else if("single"===i){if(u&&e instanceof Date&&r instanceof Date)return void o(gE(e,r));o(e)}},hideNavigation:!0,captionLayout:"label",className:Se(t),formatters:{formatWeekdayName:mE},classNames:{months:D,month:"flex flex-col p-2 gap-1 text-center w-full",caption:"relative flex justify-center items-center",table:"w-full border-separate border-spacing-0",head_row:"flex mb-1",head_cell:"text-muted-foreground rounded-md w-10 font-normal text-sm",row:"flex w-full mt-2",cell:"h-10 w-10 text-center text-sm p-0 relative",...n},numberOfMonths:c,showOutsideDays:!0,components:{MonthCaption:function(e){const{goToMonth:t,nextMonth:n,previousMonth:r}=hN(),o=sI(e.calendarMonth.date,"yyyy"),a=sI(e.calendarMonth.date,"MMMM"),i=new Date(e.calendarMonth.date);i.setDate(i.getDate()-i.getDay());const s=Array.from({length:7},(e,t)=>{const n=new Date(i);return n.setDate(i.getDate()+t),mE(n)});let l;return l=y?`${N} - ${N+23}`:g?o:`${a} ${o}`,(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{className:"flex justify-between",children:[(0,C.jsx)(Ro,{variant:"ghost",onClick:()=>{if(y)I(N-24);else if(g){const n=new Date(v-1,e.calendarMonth.date.getMonth());x(n.getFullYear()),t(n)}else t(r)},className:"bg-background-primary border-none cursor-pointer","aria-label":"Previous Button",icon:(0,C.jsx)(fN,{className:"h-4 w-4 text-button-tertiary-color"})}),(0,C.jsx)(Ro,{variant:"ghost",onClick:()=>{c>1||(g?(b(!0),w(!1)):y?b(!1):w(!g))},children:l}),(0,C.jsx)(Ro,{variant:"ghost",onClick:()=>{if(y)I(N+24);else if(g){const n=new Date(v+1,e.calendarMonth.date.getMonth());x(n.getFullYear()),t(n)}else t(n)},className:"bg-background-primary border-none cursor-pointer","aria-label":"Next Button",icon:(0,C.jsx)(pN,{className:"h-4 w-4 text-button-tertiary-color"})})]}),y&&(0,C.jsx)("div",{className:"grid grid-cols-4 w-full",children:hE(N).map(n=>(0,C.jsxs)(Ro,{variant:"ghost",onClick:()=>(n=>{x(n),b(!1),w(!0),t(new Date(n,e.calendarMonth.date.getMonth()))})(n),className:Se("h-10 w-full text-center font-normal relative",n===v&&n!==(new Date).getFullYear()&&"bg-background-brand text-text-on-color hover:bg-background-brand hover:text-black",n===(new Date).getFullYear()&&"font-semibold"),children:[n,n===(new Date).getFullYear()&&pE()]},n))}),g&&!y&&(0,C.jsx)("div",{className:"grid grid-cols-4 gap-2 my-12",children:Array.from({length:12},(n,r)=>(0,C.jsxs)(Ro,{variant:"ghost",onClick:()=>{w(!1),t(new Date(v,r))},className:Se("px-1.5 py-2 h-10 w-[4.375rem] text-center font-normal relative",r===e.calendarMonth.date.getMonth()&&r!==(new Date).getMonth()&&v===e.calendarMonth.date.getFullYear()&&e.calendarMonth.date.getFullYear()!==(new Date).getFullYear()&&"bg-background-brand text-text-on-color hover:bg-background-brand hover:text-black",r===(new Date).getMonth()&&(new Date).getFullYear()===v&&"font-semibold"),children:[sI(new Date(0,r),"MMM"),(new Date).getMonth()===r&&(new Date).getFullYear()===v&&pE()]},r))}),!g&&!y&&(0,C.jsx)(M,{weekdays:s})]})},DayButton:({day:e,modifiers:t,...n})=>{const{selected:o,today:i,disabled:s,outside:l,range_middle:c,range_start:u,range_end:d}=t,f=u||d||c,p=new Date,m=r?.to,h=sI(e.displayMonth,"yyyy-MM")===sI(p,"yyyy-MM"),g=m&&sI(m,"yyyy-MM")===sI(e.date,"yyyy-MM"),w=function(e,t,n){return xI(e,-t,n)}(p,1),y=sI(e.date,"yyyy-MM")===sI(w,"yyyy-MM"),b=h||g||f,v=!a&&l,x=Se("h-10 w-10 flex items-center justify-center transition text-text-secondary relative text-sm","border-none rounded",!o&&!f||l?"bg-transparent hover:bg-button-tertiary-hover":"bg-background-brand text-text-on-color",c&&b&&!l?"bg-brand-background-50 text-text-secondary rounded-none":"",s?"opacity-50 cursor-not-allowed text-text-disabled":"cursor-pointer",l&&!f||!b&&l||l&&!y||l?"bg-transparent opacity-50 text-text-disabled cursor-auto":"");return(0,C.jsxs)("button",{className:Se(x,i&&"font-semibold",v&&"opacity-0",u&&"fui-range-start",d&&"fui-range-end",c&&"fui-range-middle",{"[&:is([data-hover=true])]:bg-brand-background-50 [&:is([data-hover=true])]:rounded-none":!f&&!o}),disabled:s||l,onClick:e=>{"function"==typeof n.onClick&&n.onClick(e)},onMouseEnter:e=>{"function"==typeof n.onMouseEnter&&n.onMouseEnter(e),e.currentTarget.setAttribute("data-hover","true")},onMouseLeave:e=>{"function"==typeof n.onMouseLeave&&n.onMouseLeave(e),e.currentTarget.setAttribute("data-hover","false")},"aria-label":sI(e.date,"EEEE, MMMM do, yyyy"),"data-selected":o,"data-day":sI(e.date,"yyyy-MM-dd"),children:[n.children,i&&b&&(0,C.jsx)("span",{className:"absolute h-1 w-1 bg-background-brand rounded-full bottom-1"})]})},Day:e=>{const t=Object.entries(e).reduce((e,[t,n])=>(t.startsWith("data-")&&(e[t]=n),e),{});return(0,C.jsx)("div",{...t,className:Se(e.className,"inline-flex"),children:e.children})},Weekdays:()=>(0,C.jsx)(C.Fragment,{}),Week:e=>(0,C.jsx)("div",{className:Se("bsf-force-ui-month-week flex flex-row",e.className),children:e.children}),Months:e=>(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("div",{className:Se("bsf-force-ui-date-picker-month",D),children:e?.children?.map((e,t)=>e?(0,C.jsx)(p.Fragment,{children:e.map((e,t)=>(0,C.jsxs)(p.Fragment,{children:[t>0&&(0,C.jsx)("div",{className:"border border-solid border-border-subtle border-l-0"}),e]},t))},t):null)})}),MonthGrid:e=>g||y?(0,C.jsx)(C.Fragment,{}):(0,C.jsx)(E,{...e})},..."range"===i?{required:!1}:{},...f,footer:h?(0,C.jsxs)(C.Fragment,{children:[S,f.footer]}):f.footer,onDayMouseEnter:(e,t,n)=>{if("range"!==i)return;const o=r;if(o?.from&&o?.to||!o?.from&&!o?.to)return void Array.from(document.querySelectorAll("[data-hover]")).forEach(e=>{e.setAttribute("data-hover","false")});const a=n.target,l=new Date(a.dataset.day),c=SI(l,o.from),u=_I(l,o.to);let d;switch(s){case"dualdate":case"presets":d=a.closest(".bsf-force-ui-date-picker-month");break;default:d=a.closest(".bsf-force-ui-month-weeks")}const f=Array.from(d.querySelectorAll("button"));u&&f.sort((e,t)=>_I(new Date(e.dataset.day),new Date(t.dataset.day))?-1:1),c&&f.sort((e,t)=>SI(new Date(e.dataset.day),new Date(t.dataset.day))?1:-1);const p=f.indexOf(a),m=f.findIndex(e=>"true"===e.getAttribute("data-selected")),h=[],g=Math.min(p,m),w=Math.max(p,m);for(let e=g;e<=w;e++)f[e]?.disabled||h.push(f[e]);f.forEach(e=>{e.setAttribute("data-hover",h.includes(e)?"true":"false")})},disabled:d})})};function bE(e){return LN(Date.now(),e)}function vE(e){return kN(e,Date.now())}function xE(e){const t=vE(e?.in),n=t.getFullYear(),r=t.getMonth(),o=t.getDate(),a=vE(e?.in);return a.setFullYear(n,r,o-1),a.setHours(0,0,0,0),a}function NE(e,t,n){return vI(e,-t,n)}const IE=({selectionType:e="single",variant:t="normal",presets:n=[],onCancel:r,onApply:o,onDateSelect:a,applyButtonText:i="Apply",cancelButtonText:s="Cancel",showOutsideDays:l=!0,isFooter:c=!0,enableTimeSelection:u=!1,selected:d,disabled:f,...m})=>{const[h,g]=(0,p.useState)(()=>{if(!d)return wE(e);const t="multiple"===e&&Array.isArray(d),n="single"===e&&d instanceof Date;return t||"range"===e&&"from"in d&&"to"in d||n?d:wE(e)}),w=e=>{g(e),a&&a(e)},y=[{label:"Today",range:{from:bE(),to:bE()}},{label:"Yesterday",range:{from:xE(),to:xE()}},{label:"This Week",range:{from:PN(new Date,{weekStartsOn:1}),to:MI(new Date,{weekStartsOn:1})}},{label:"Last 7 Days",range:{from:LN(NE(new Date,6)),to:LN(new Date)}},{label:"This Month",range:{from:kI(new Date),to:EI(new Date)}},{label:"Last 30 Days",range:{from:LN(NE(new Date,29)),to:LN(new Date)}}],b=n.length>0?n:y,v=()=>{g("multiple"===e?[]:{from:void 0,to:void 0}),r&&r()},x=()=>{o&&o(h)};return"normal"===t?(0,C.jsx)(yE,{...m,mode:e,variant:t,width:"w-[18.5rem]",enableTimeSelection:u,selectedDates:h,showOutsideDays:l,setSelectedDates:w,footer:c&&(0,C.jsxs)("div",{className:"flex bg-background-primary justify-end p-2 gap-3 border border-solid border-border-subtle border-t-0 rounded-md rounded-tl-none rounded-tr-none",children:[(0,C.jsx)(Ro,{variant:"outline",onClick:v,children:s}),(0,C.jsx)(Ro,{onClick:x,children:i})]}),disabled:f}):"dualdate"===t?(0,C.jsx)(yE,{mode:e,numberOfMonths:2,alignment:"horizontal",enableTimeSelection:u,selectedDates:h,setSelectedDates:w,showOutsideDays:l,variant:t,width:"w-auto",footer:(0,C.jsxs)("div",{className:"flex bg-background-primary justify-end p-2 gap-3 border border-solid border-border-subtle border-t-0 rounded-md rounded-tl-none rounded-tr-none",children:[(0,C.jsx)(Ro,{variant:"outline",onClick:v,children:s}),(0,C.jsx)(Ro,{onClick:x,children:i})]}),disabled:f,...m}):"presets"===t?(0,C.jsxs)("div",{className:"flex flex-row shadow-datepicker-wrapper",children:[(0,C.jsx)("div",{className:"flex flex-col gap-1 p-3 items-start border border-solid border-border-subtle border-r-0 rounded-tl-md rounded-bl-md bg-background-primary",children:b.map((e,t)=>{const n=h&&"from"in h&&"to"in h&&h.from?.getTime()===e.range.from.getTime()&&h.to?.getTime()===e.range.to.getTime();return(0,C.jsx)(Ro,{onClick:()=>(e=>{g(e)})(e.range),variant:"ghost",className:Se("text-left font-medium text-sm text-nowrap w-full",n&&"bg-brand-background-50"),children:e.label},t)})}),(0,C.jsx)(yE,{...m,mode:e,enableTimeSelection:u,selectedDates:h,setSelectedDates:w,variant:t,showOutsideDays:l,width:"w-auto",numberOfMonths:2,footer:(0,C.jsxs)("div",{className:"flex justify-end p-2 gap-3 border-l border-r border-t-0 border-b border-solid border-border-subtle bg-background-primary rounded-br-md",children:[(0,C.jsx)(Ro,{variant:"outline",onClick:v,children:s}),(0,C.jsx)(Ro,{onClick:x,children:i})]}),disabled:f})]}):void 0},ME=To("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),EE=e=>{if(!e)return null;if(e instanceof Date)return e;if("string"==typeof e&&/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}return new Date(e)},_E=e=>e?e.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}):"mmm dd, yyyy",SE=()=>{const e=new Date,t=new Date(e),n=new Date(e);n.setDate(n.getDate()-1);const r=new Date(e),o=r.getDay(),a=0===o?6:o-1;r.setDate(e.getDate()-a);const i=new Date(r);i.setDate(r.getDate()+6);const s=new Date(r);s.setDate(s.getDate()-7);const l=new Date(s);l.setDate(s.getDate()+6);const c=new Date(e.getFullYear(),e.getMonth(),1),u=new Date(e),d=new Date(e.getFullYear(),e.getMonth()-1,1),f=new Date(e.getFullYear(),e.getMonth(),0);return[{label:(0,j.__)("Today","cartflows"),range:{from:t,to:t}},{label:(0,j.__)("Yesterday","cartflows"),range:{from:n,to:n}},{label:(0,j.__)("This Week","cartflows"),range:{from:r,to:i}},{label:(0,j.__)("Last Week","cartflows"),range:{from:s,to:l}},{label:(0,j.__)("This Month","cartflows"),range:{from:c,to:u}},{label:(0,j.__)("Last Month","cartflows"),range:{from:d,to:f}}]},DE=function(e){const{label:t,value:n,tooltip:r,desc:o,onChangeCB:a,sectionClass:s="",wrapperClass:l="",fieldParentWrapperClass:c="w-full",placeholder:u=(0,j.__)("Select Date Range","cartflows")}=e,[d,f]=(0,i.useState)(!1),p=(0,i.useRef)(null),m=(0,i.useRef)(null),[h,g]=(0,i.useState)({from:EE(n?.startDate),to:EE(n?.endDate)});return(0,i.useEffect)(()=>{g({from:EE(n?.startDate),to:EE(n?.endDate)})},[n?.startDate,n?.endDate]),(0,i.useEffect)(()=>{const e=e=>{m.current&&!m.current.contains(e.target)&&p.current&&!p.current.contains(e.target)&&f(!1)},t=e=>{"Escape"===e.key&&(f(!1),p.current?.focus())};return d&&(document.addEventListener("mousedown",e),document.addEventListener("keydown",t),m.current?.querySelector('button, [tabindex="0"]')?.focus()),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[d]),(0,i.createElement)("div",{className:`wcf-field wcf-date-field ${s}`},(0,i.createElement)("div",{className:`wcf-field__data flex items-center gap-2.5 ${l}`},t&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium"},(0,i.createElement)("label",null,t,r&&(0,i.createElement)(n_,{text:r}))),(0,i.createElement)("div",{className:`wcf-field__data--content relative ${c}`},(0,i.createElement)(Ro,{ref:p,icon:(0,i.createElement)(ME,{className:"h-4 w-4 text-text-secondary","aria-hidden":"true"}),iconPosition:"right",size:"sm",tag:"button",type:"button",variant:"outline",className:"justify-between whitespace-nowrap text-text-secondary font-normal min-w-[194px]","aria-haspopup":"dialog","aria-expanded":d,onClick:()=>f(e=>!e)},h?.from&&h?.to?`${_E(h.from)} - ${_E(h.to)}`:u),d&&(0,i.createElement)("div",{ref:m,role:"dialog","aria-label":(0,j.__)("Select date range","cartflows"),className:"absolute z-[9999] rounded-lg shadow-lg top-full right-0 mt-1 overflow-x-auto"},(0,i.createElement)(IE,{key:"range",applyButtonText:(0,j.__)("Apply","cartflows"),cancelButtonText:(0,j.__)("Cancel","cartflows"),disabled:{after:new Date},onApply:e=>{g(e),f(!1),a&&a({startDate:e.from,endDate:e.to})},onCancel:()=>{f(!1)},presets:SE(),selected:h,selectionType:"range",showOutsideDays:!0,variant:"presets"})))),o&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},Nh(o)))},jE=e=>{if(!e||"string"!=typeof e)return null;const t=e.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[ T](\d{1,2}):(\d{2}))?$/);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),t[4]?Number(t[4]):0,t[5]?Number(t[5]):0):null},kE=e=>String(e).padStart(2,"0"),CE=function(e){const{name:t,id:n,label:r,value:o,placeholder:a,tooltip:s,desc:l,displayAlign:c="vertical"}=e,[u,d]=(0,i.useState)(o||""),[f,p]=(0,i.useState)(!1),m=(0,i.useRef)(null),h=(0,i.useRef)(null);(0,i.useEffect)(()=>{d(o||"")},[o]),(0,i.useEffect)(()=>{if(!f)return;const e=e=>{m.current&&!m.current.contains(e.target)&&h.current&&!h.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);const g="horizontal"===c?"flex items-center justify-between gap-2.5":"block w-full text-left",w="text-sm font-medium text-text-primary text-left"+("horizontal"===c?"":" mb-2");return(0,i.createElement)("div",{className:"wcf-field wcf-datetime-field text-left"},(0,i.createElement)("div",{className:`wcf-field__data ${g}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${w}`},(0,i.createElement)("label",{className:"whitespace-nowrap"},r,s&&(0,i.createElement)(n_,{text:s}))),(0,i.createElement)("div",{className:"wcf-field__data--content relative "+(r&&"horizontal"===c?"w-1/2":"w-full")},(0,i.createElement)("input",{type:"hidden",name:t,className:e.class?e.class:"",value:u,readOnly:!0}),(0,i.createElement)(Ro,{ref:h,id:n,icon:(0,i.createElement)(ME,{className:"h-4 w-4 text-text-secondary","aria-hidden":"true"}),iconPosition:"right",size:"md",tag:"button",type:"button",variant:"outline",className:"w-full justify-between text-text-primary font-normal",onClick:()=>p(e=>!e)},u?(e=>e instanceof Date&&!isNaN(e)?e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"")(jE(u)):a||(0,j.__)("Select date & time","cartflows")),f&&(0,i.createElement)("div",{ref:m,className:"absolute z-[9999] rounded-lg shadow-lg top-full left-0 mt-1 overflow-x-auto"},(0,i.createElement)(IE,{key:"single-datetime",selectionType:"single",enableTimeSelection:!0,variant:"normal",applyButtonText:(0,j.__)("Apply","cartflows"),cancelButtonText:(0,j.__)("Cancel","cartflows"),onApply:e=>{(e=>{d(e);const n=new CustomEvent("wcf:datetime:change",{bubbles:!0,detail:{e:{target:{value:e,name:t}},name:t,value:e}});document.dispatchEvent(n)})((e=>e instanceof Date&&!isNaN(e)?`${e.getFullYear()}-${kE(e.getMonth()+1)}-${kE(e.getDate())} ${kE(e.getHours())}:${kE(e.getMinutes())}`:"")(e instanceof Date?e:null)),p(!1)},onCancel:()=>p(!1),selected:jE(u),showOutsideDays:!0})))),l&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Nh(l)))},AE=To("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),TE=To("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),LE=function(e){var t,n;const{content:r,custom_class:o="",icon:a=""}=e,s=function(e){switch(e){case"info":return{icon:Lo,color:"text-text-secondary"};case"error":return{icon:AE,color:"text-support-error"};case"success":return{icon:TE,color:"text-support-success"};case"warning":return{icon:zo,color:"text-support-warning"};default:return null}}(a),l=null!==(t=s?.icon)&&void 0!==t?t:null,c=null!==(n=s?.color)&&void 0!==n?n:"";return(0,i.createElement)("div",{className:`wcf-field wcf-doc-field ${o}`},r&&(0,i.createElement)("div",{className:"wcf-field__doc-content flex items-center gap-1 text-sm font-normal text-text-primary mt-2 text-left"},l&&(0,i.createElement)(l,{size:16,className:c}),Nh(r)))},OE=function(e){const{label:t,desc:n,sectionClass:r,descClass:o,labelClass:a=""}=e,s=r&&""!==r?r:"text-left",l=""!==a?a:"block text-base font-medium text-text-primary mb-5",c=""!==o?o:"text-sm font-normal text-text-secondary mt-2";return(0,i.createElement)("div",{className:`wcf-field wcf-section-heading-field ${s}`},t&&(0,i.createElement)("div",{className:"wcf-field__data--label"},(0,i.createElement)("label",{className:l},t)),n&&(0,i.createElement)("div",{className:`wcf-field__desc ${c}`},Nh(n)))},zE=function(e){const{notice:t="",feature:n="this",plan_required:r="pro"}=e;return""!==t?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-pro-notice"},(0,i.createElement)("p",{className:"wcf-pro-update-notice"},Nh(t)))):wcfCartflowsTypePlusPro()||"pro"===r?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-pro-notice"},(0,i.createElement)("p",{className:"wcf-pro-update-notice"},Nh((0,j.sprintf)(
10 9 // translators: %1$s: anchor tag start, %2$s: anchor tag end, %3$s: feature name.
11 10 // translators: %1$s: anchor tag start, %2$s: anchor tag end, %3$s: feature name.
12 -(0,C.__)("Please upgrade to the %1$s CartFlows Pro %2$s to use %3$s feature.","cartflows"),'<a href="https://cartflows.com?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=feature" target="_blank">',"</a>",n)))))):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-pro-notice"},(0,i.createElement)("p",{className:"wcf-pro-update-notice"},Zm((0,C.sprintf)(
11 +(0,j.__)("Please upgrade to the %1$s CartFlows Pro %2$s to use %3$s feature.","cartflows"),`<a href="${getUtmUrl("https://cartflows.com",{utm_campaign:"feature"})}" target="_blank">`,"</a>",n)))))):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-pro-notice"},(0,i.createElement)("p",{className:"wcf-pro-update-notice"},Nh((0,j.sprintf)(
13 12 // translators: %1$s: anchor tag start, %2$s: anchor tag end, %3$s: feature name.
14 13 // translators: %1$s: anchor tag start, %2$s: anchor tag end, %3$s: feature name.
15 -(0,C.__)("Please upgrade to the %1$s CartFlows Higher Plan %2$s to use %3$s feature.","cartflows"),'<a href="https://cartflows.com?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=feature" target="_blank">',"</a>",n))))))},Y_=window.lodash,Z_={sm:"text-xs [&>svg]:size-4 rounded",md:"text-sm [&>svg]:size-5 rounded-md",lg:"text-base [&>svg]:size-6 rounded-md"},W_={input:{sm:"py-1.5 px-2 rounded",md:"p-2.5 rounded-md",lg:"p-3 rounded-md"},content:{sm:"p-1.5",md:"p-1.5",lg:"p-2"},title:{sm:"p-2 text-xs",md:"p-2 text-sm",lg:"p-2 text-sm"},item:{sm:"text-sm text-text-secondary rounded",md:"text-base text-text-secondary rounded-md",lg:"text-base text-text-secondary rounded-md"},icon:{sm:"p-1 text-sm [&>svg]:size-4 text-icon-secondary",md:"p-2 text-base [&>svg]:size-5 text-icon-secondary",lg:"p-2 text-base [&>svg]:size-5 text-icon-secondary"},dialog:{sm:"mt-1 rounded-md",md:"mt-1.5 rounded-lg",lg:"mt-1.5 rounded-lg"},slashIcon:{sm:"px-2 py-0.5",md:"px-3 py-1",lg:"px-3.5 py-1"}},G_={primary:"bg-field-primary-background outline outline-1 outline-field-border hover:outline-border-strong focus-within:outline-focus-border focus-within:hover:outline-focus-border",secondary:"bg-field-secondary-background outline outline-1 outline-field-border hover:outline-border-strong focus-within:outline-focus-border focus-within:hover:outline-focus-border",ghost:"bg-field-secondary-background outline outline-1 outline-transparent focus-within:outline-focus-border"},H_={ghost:"cursor-not-allowed text-text-disabled placeholder:text-text-disabled",primary:"outline-border-disabled hover:outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled placeholder:text-text-disabled",secondary:"outline-border-disabled hover:outline-border-disabled cursor-not-allowed text-text-disabled placeholder:text-text-disabled"},$_=(0,s.createContext)({}),X_=()=>(0,s.useContext)($_),q_=(0,s.forwardRef)(({className:e,size:t="sm",open:n=!1,setOpen:r,onOpenChange:o,loading:a=!1,clearAfterSelect:i=!0,closeAfterSelect:l=!0,variant:c="primary",filter:u=!0,...d},f)=>{const[p,m]=(0,s.useState)(""),[h,g]=(0,s.useState)(a??!1),[w,y]=(0,s.useState)(null),b=s.useRef([]),v=(0,s.useMemo)(()=>"function"==typeof r?r:o,[r,o]),{refs:x,floatingStyles:N,context:E}=uo({open:n,onOpenChange:v,placement:"bottom-start",whileElementsMounted:jn,middleware:[Bn(2),Qn({padding:10}),Vn({apply({rects:e,elements:t,availableHeight:n}){t.floating.style.maxHeight=`${n}px`,t.floating.style.width=`${e.reference.width}px`,t.floating.style.fontFamily=window.getComputedStyle(t.reference).fontFamily}})]}),_=xo(E,{listRef:b,activeIndex:w,onNavigate:y,loop:!0,openOnArrowKeyDown:!1}),M=co(E),{getReferenceProps:I,getFloatingProps:S,getItemProps:k}=ho([M,_]);return(0,s.useEffect)(()=>{const e=je(),t=t=>{const n="Mac OS"===e?t.metaKey:t.ctrlKey;if("/"===t.key&&n&&(t.preventDefault(),x.reference&&x.reference.current)){const e=x.reference.current instanceof HTMLElement?x.reference.current.querySelector("input"):null;e&&e.focus()}};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[x.reference]),(0,s.useEffect)(()=>{n||y(null)},[n]),(0,j.jsx)($_.Provider,{value:{size:t,open:n,onOpenChange:v,refs:x,floatingStyles:N,context:E,getReferenceProps:I,getFloatingProps:S,getItemProps:k,activeIndex:w,setActiveIndex:y,listRef:b,searchTerm:p,setSearchTerm:m,isLoading:h,setIsLoading:g,clearAfterSelect:i,closeAfterSelect:l,variant:c,filter:u},children:(0,j.jsx)("div",{className:Se("searchbox-wrapper box-border relative w-full",e),...d,ref:f})})});q_.displayName="SearchBox";const J_=(0,s.forwardRef)(({className:e,type:t="text",placeholder:n="Search...",disabled:r=!1,onChange:o=()=>{},...a},i)=>{const{size:s,refs:l,getReferenceProps:c,searchTerm:u,setSearchTerm:d,open:f,setActiveIndex:p,listRef:m,onOpenChange:h,variant:g}=X_(),w="lg"===s?"sm":"xs";return(0,j.jsxs)("div",{ref:l.setReference,className:Se("w-full group relative flex justify-center items-center gap-1.5 focus-within:z-10 transition-all ease-in-out duration-200",G_[g],W_.input[s],r?H_[g]:"focus-within:ring-2 focus-within:ring-focus focus-within:ring-offset-2 focus-within:border-focus-border focus-within:hover:border-focus-border",e),...c(),children:[(0,j.jsx)("span",{className:Se(Z_[s],r?"text-icon-disabled":"text-icon-secondary group-hover:text-icon-primary group-focus-within:text-icon-primary","flex justify-center items-center"),children:(0,j.jsx)(Wg,{})}),(0,j.jsx)("input",{type:t,ref:i,className:Se(Z_[s],"flex-grow font-medium bg-transparent border-none outline-none border-transparent focus:ring-0 p-0 min-h-fit",r&&"text-field-placeholder focus-within:text-field-input group-hover:text-field-input placeholder:text-field-placeholder"),disabled:r,value:u,onChange:e=>{const t=e.target.value;d(t),o(t),"function"==typeof h&&(t.trim()?h(!0):h(!1))},onFocus:()=>{r||"function"!=typeof h||u?.trim()&&h(!0)},onKeyDown:e=>{if(!r){if("ArrowDown"===e.key||"ArrowUp"===e.key)return void(f&&(e.preventDefault(),"ArrowDown"===e.key?p(e=>null===e?0:e):"ArrowUp"===e.key&&p(e=>{const t=m?.current?.length||0;return null===e&&t>0?t-1:e})));"Escape"===e.key&&h(!1)}},placeholder:n,...(0,Y_.omit)(a,["size","open","onOpenChange","loading"])}),(0,j.jsx)(Lf,{label:"Mac OS"===je()?"⌘/":"Ctrl /",size:w,type:"rounded",variant:"neutral",className:"bg-background-primary"})]})});J_.displayName="SearchBox.Input";const K_=({className:e,children:t,...n})=>{const{size:r,open:o,refs:a,floatingStyles:i,getFloatingProps:s,context:l}=X_();return o?(0,j.jsx)(Kr,{context:l,initialFocus:-1,returnFocus:!0,children:(0,j.jsx)("div",{ref:a.setFloating,style:{...i},className:Se("bg-background-primary rounded-md border border-solid border-border-subtle shadow-soft-shadow-lg overflow-y-auto text-wrap focus:outline-none",W_.dialog[r],e),...s(),...n,children:t})}):null};K_.displayName="SearchBox.Content";const eM=({children:e,id:t,root:n})=>(0,j.jsx)(Zr,{id:t,root:n,children:e});eM.displayName="SearchBox.Portal";const tM=({children:e,className:t})=>{const{searchTerm:n,isLoading:r,listRef:o,filter:a=!0}=X_();if(!a)return(0,j.jsx)(cr,{elementsRef:o,children:(0,j.jsx)("div",{className:t,children:e})});const i=s.Children.toArray(e).map(e=>{if(s.isValidElement(e)&&e.type===rM){const t=s.Children.toArray(e.props.children).filter(e=>s.isValidElement(e)&&"string"==typeof e.props.children&&e.props.children.toLowerCase().includes(n.toLowerCase()));return t.length>0?(0,s.cloneElement)(e,{children:t}):null}return e}).filter(Boolean);return r?(0,j.jsx)(aM,{}):(0,j.jsx)(cr,{elementsRef:o,children:(0,j.jsx)("div",{className:t,children:i.some(e=>s.isValidElement(e)&&e.type!==iM)?i:(0,j.jsx)(nM,{})})})};tM.displayName="SearchBox.List";const nM=({children:e="No results found.",className:t})=>{const{size:n}=X_();return(0,j.jsx)("div",{className:Se("flex justify-center items-center",W_.item[n],"text-text-tertiary p-4",t),children:e})};nM.displayName="SearchBox.Empty";const rM=({heading:e,children:t})=>{const{size:n}=X_();return(0,j.jsxs)("div",{className:Se(W_.content[n],W_.item[n]),children:[e&&(0,j.jsx)("div",{className:Se(W_.title[n],"text-text-tertiary"),children:e}),t]})};rM.displayName="SearchBox.Group";const oM=(0,s.forwardRef)(({className:e,icon:t,children:n,onClick:r,...o},a)=>{const{size:i,setSearchTerm:l,clearAfterSelect:c,getItemProps:u,activeIndex:d,onOpenChange:f,closeAfterSelect:p}=X_(),{ref:m,index:h}=function(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:a,labelsRef:i}=s.useContext(lr),[l,c]=s.useState(null),u=s.useRef(null),d=s.useCallback(e=>{if(u.current=e,null!==l&&(a.current[l]=e,i)){var n;const r=void 0!==t;i.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}},[l,a,i,t]);return ir(()=>{const e=u.current;if(e)return n(e),()=>{r(e)}},[n,r]),ir(()=>{const e=u.current?o.get(u.current):null;null!=e&&c(e)},[o]),s.useMemo(()=>({ref:d,index:null==l?-1:l}),[l,d])}(),g=d===h;return(0,j.jsxs)("button",{type:"button",ref:e=>{"function"==typeof a?a(e):a&&(a.current=e),m(e)},className:Se("flex w-full items-center justify-start gap-1 p-1 cursor-pointer border-none bg-transparent text-left focus:outline-none",g&&"bg-background-secondary",!g&&"hover:bg-background-secondary focus:bg-background-secondary",W_.item[i],e),...u?.({role:"option","aria-selected":g,onClick:()=>{"function"==typeof r&&r(),c&&l(""),p&&f(!1)},...o}),children:[t&&(0,j.jsx)("span",{className:Se(W_.icon[i],"flex items-center justify-center"),children:t}),(0,j.jsx)("span",{className:Se("flex-grow py-0.5 px-1 font-normal",W_.item[i]),children:n})]})});oM.displayName="SearchBox.Item";const aM=({loadingIcon:e=(0,j.jsx)(Kg,{})})=>{const{size:t}=X_(),n=s.isValidElement(e)?(0,s.cloneElement)(e,{size:t}):e;return(0,j.jsx)("div",{className:Se("flex justify-center p-4",Z_[t],W_.item[t]),children:n})};aM.displayName="SearchBox.Loading";const iM=(0,s.forwardRef)(({className:e,...t},n)=>(0,j.jsx)("hr",{ref:n,className:Se("border-0 border-t border-border-subtle border-solid m-0",e),...t}));iM.displayName="SearchBox.Separator",q_.Input=J_,q_.Loading=aM,q_.Separator=iM,q_.Content=K_,q_.List=tM,q_.Empty=nM,q_.Group=rM,q_.Item=oM,q_.Portal=eM;const sM=function(e){const{label:t,name:n,desc:r,value:o,allowed_products:a=[],include_products:l=[],excluded_products:c=[],excluded_product_ids:u=[],tooltip:d,placeholder:f,onChangeCB:p,nameComp:m,attr:h,isMulti:g=!1,showLabelOnly:w=!1,sectionClass:b="",wrapperClass:v="",labelClass:x="",descClass:N=""}=e,[E,_]=(0,s.useState)(o),[M,I]=(0,s.useState)([]),[S,k]=(0,s.useState)(!1),[D,j]=(0,s.useState)(!1),[A,T]=(0,s.useState)(!1),L=(0,s.useRef)(null),O=(0,s.useRef)("");(0,s.useEffect)(()=>{_(o)},[o]);const z=e=>e?.label?w||!e.value?e.label:`${e.label} (#${e.value})`:"";return(0,i.createElement)("div",{className:`wcf-select2-field wcf-product-field ${b}`},(0,i.createElement)("div",{className:`wcf-selection-field ${v}`},t&&(0,i.createElement)("label",{className:`block text-sm font-medium text-left mb-2 ${x}`},t,d&&(0,i.createElement)(dM,{text:d})),g?(E||[]).map(e=>(0,i.createElement)("input",{key:e.value,type:"hidden",name:`${n}[]`,value:e.value})):(0,i.createElement)("input",{type:"hidden",name:m?n:`${n}[]`,value:E?.value||""}),g&&(E||[]).length>0&&(0,i.createElement)("div",{className:"mb-2 flex flex-wrap gap-1.5"},(E||[]).map(t=>(0,i.createElement)(Lf,{key:t.value,label:z(t),size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>(t=>{const n=(E||[]).filter(e=>e.value!==t.value);_(n);const r=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),p&&p(n)})(t)}))),!g&&E?.label&&(0,i.createElement)("div",{className:"mb-2 flex"},(0,i.createElement)(Lf,{label:z(E),size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>{_(null);const t=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:null}});document.dispatchEvent(t),p&&p(null)}})),(0,i.createElement)(q_,(0,y.A)({open:S,setOpen:e=>{e&&O.current.length<3||k(e)},filter:!1,size:"md",variant:"secondary",clearAfterSelect:!0,closeAfterSelect:!0},h),(0,i.createElement)(q_.Input,{ref:L,placeholder:f||(0,C.__)("Search for a Product","cartflows"),onChange:async e=>{if(O.current=e,e.length>=3){j(!0);const t=new window.FormData;t.append("allowed_products",a),t.append("include_products",l),t.append("exclude_products",c),t.append("action","cartflows_json_search_products"),t.append("security",cartflows_admin.json_search_products_nonce),t.append("term",e);const n=await qf()({url:cartflows_admin.ajax_url,method:"POST",body:t})||[],r=Array.isArray(u)&&u.length>0?n.filter(e=>!u.includes(Number(e.value))):n;I(r),T(n.length>0&&0===r.length),j(!1)}else I([]),T(!1),j(!1)},className:"[&>span:last-of-type]:hidden !w-auto"}),(0,i.createElement)(q_.Portal,null,(0,i.createElement)(q_.Content,null,(0,i.createElement)(q_.List,null,D&&(0,i.createElement)(q_.Loading,null),!D&&M.length>0&&(0,i.createElement)(q_.Group,null,M.map(t=>(0,i.createElement)(q_.Item,{key:t.value,onClick:()=>(t=>{const n=g?[...E||[],t]:t;_(n);const r=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),p&&p(n)})(t)},(0,i.createElement)("div",{className:"wcf-select-option--row flex w-full items-center justify-between cursor-pointer"},(0,i.createElement)("div",{className:"wcf-select-option--row-option flex items-center gap-3"},(0,i.createElement)("span",null,t?.label||""," ",t.value?"(#"+t?.value+")":""),t?.stock_status&&(0,i.createElement)("span",{className:`wcf-badge ${t.in_stock?"wcf-badge--success":"wcf-badge--error"} text-xs leading-[0.5rem] capitalize !py-1.5 !px-2 cursor-pointer`},t?.stock_status||"")),t.price_range&&(0,i.createElement)("div",null,(0,i.createElement)("span",{className:"text-xs leading-3 font-normal cursor-pointer"},t?.price_range)))))),!D&&0===M.length&&S&&(0,i.createElement)(q_.Empty,null,A?(0,C.__)("All matching products are already added.","cartflows"):(0,C.__)("No products found.","cartflows"))))))),r&&(0,i.createElement)("div",{className:`wcf-field-desc text-sm font-normal text-text-tertiary mt-3 ${N}`},Zm(r)))},lM=function(e){const{label:t,name:n,desc:r,value:o,tooltip:a,placeholder:l,onChangeCB:c,nameComp:u,isMulti:d=!1,sectionClass:f="",wrapperClass:p="",descClass:m="",fieldClass:h="",attr:g}=e,w=e=>!d&&Array.isArray(e)?e[0]||null:e,[b,v]=(0,s.useState)(()=>w(o)),[x,N]=(0,s.useState)([]),[E,_]=(0,s.useState)(!1),[M,I]=(0,s.useState)(!1),S=(0,s.useRef)(null),k=(0,s.useRef)("");return(0,s.useEffect)(()=>{v(w(o))},[o]),(0,i.createElement)("div",{className:`wcf-select2-field wcf-coupon-field ${f}`},(0,i.createElement)("div",{className:`wcf-coupon-field-wrapper ${p}`},t&&(0,i.createElement)("label",{className:`block text-sm font-medium text-left mb-2 ${h}`},t,a&&(0,i.createElement)(dM,{text:a})),d?(b||[]).map(e=>(0,i.createElement)("input",{key:e.value,type:"hidden",name:`${n}[]`,value:e.value})):(0,i.createElement)("input",{type:"hidden",name:u?n:`${n}[]`,value:b?.value||""}),d&&(b||[]).length>0&&(0,i.createElement)("div",{className:"mb-2 flex flex-wrap gap-1.5"},(b||[]).map(t=>(0,i.createElement)(Lf,{key:t.value,label:t.label,size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>(t=>{const n=(b||[]).filter(e=>e.value!==t.value);v(n);const r=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),c&&c(n)})(t)}))),!d&&b?.label&&(0,i.createElement)("div",{className:"mb-2 flex"},(0,i.createElement)(Lf,{label:b.label,size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>{v(null);const t=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:null}});document.dispatchEvent(t),c&&c(null)}})),(0,i.createElement)(q_,(0,y.A)({open:E,setOpen:e=>{e&&k.current.length<3||_(e)},filter:!1,size:"md",variant:"secondary",clearAfterSelect:!0,closeAfterSelect:!0},g),(0,i.createElement)(q_.Input,{ref:S,placeholder:l||(0,C.__)("Search for a coupon","cartflows"),onChange:async e=>{if(k.current=e,e.length>=3){I(!0);const t=new window.FormData;t.append("action","cartflows_json_search_coupons"),t.append("security",cartflows_admin.json_search_coupons_nonce),t.append("term",e);const n=await qf()({url:cartflows_admin.ajax_url,method:"POST",body:t});N(n||[]),I(!1)}else N([]),I(!1)},className:"[&>span:last-of-type]:hidden [&>span:last-of-type]:absolute !w-auto"}),(0,i.createElement)(q_.Portal,null,(0,i.createElement)(q_.Content,null,(0,i.createElement)(q_.List,null,M&&(0,i.createElement)(q_.Loading,null),!M&&x.length>0&&(0,i.createElement)(q_.Group,null,x.map(t=>(0,i.createElement)(q_.Item,{key:t.value,onClick:()=>(t=>{const n=d?[...b||[],t]:t;v(n);const r=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),c&&c(n)})(t)},(0,i.createElement)("span",null,t?.label||"")))),!M&&0===x.length&&E&&(0,i.createElement)(q_.Empty,null,(0,C.__)("No coupons found.","cartflows"))))))),r&&(0,i.createElement)("div",{className:`wcf-field-desc flex items-start gap-1 text-sm font-normal text-text-tertiary mt-3 text-left ${m}`},(0,i.createElement)(vg,{className:"w-4 h-4 shrink-0 mt-px"}),(0,i.createElement)("span",null,Zm(r))))};function cM({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const uM=s.forwardRef(cM),dM=function(e){const{text:t,position:n="default",classes:r="text-text-tertiary",icon:o="",portalId:a="wcf-settings-app",triggers:s=["hover","focus"],arrow:l=!0,interactive:c=!1}=e,u="default"===n?"bottom":n;return(0,i.createElement)(Wo,{content:"string"==typeof t?Zm(t):t,placement:u,arrow:l,interactive:c,tooltipPortalId:a,triggers:s,className:"z-[999999]"},(0,i.createElement)("div",{className:Uf()(r,"wcf-tooltip-icon cursor-pointer ml-1")},""===o?(0,i.createElement)(uM,{className:"w-3.5 h-3.5 stroke-2"}):o))},fM=function(e){const{subClass:t="",label:n,desc:r}=e;return(0,i.createElement)("div",{className:"wcf-field wcf-sub-heading-field"},n&&(0,i.createElement)("div",{className:`wcf-field__data--label ${t}`},(0,i.createElement)("label",null,n)),r&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},Zm(r)))},pM=function(e){const{name:t,id:n,label:r,value:o,placeholder:a,tooltip:l,desc:c,type:u,min:d,max:f,readonly:p,icon:m,onChangeCB:h,iconOnClick:g,afterClickIcon:w,attr:b}=e,[v,x]=(0,s.useState)(o),[N,E]=(0,s.useState)(u||"password"),[_,M]=(0,s.useState)(m||"");return(0,s.useEffect)(()=>{x(o),E(u),M(m)},[o]),(0,i.createElement)("div",{className:"wcf-field wcf-password-field text-left"},(0,i.createElement)("div",{className:"wcf-field__data flex items-center justify-between gap-2.5"},r&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left"},(0,i.createElement)("label",{className:"whitespace-nowrap"},r,l&&(0,i.createElement)(dM,{text:l}))),(0,i.createElement)("div",{className:"wcf-field__data--content w-1/2"},(0,i.createElement)(tg,(0,y.A)({type:N,name:t,value:v,id:n,onChange:function(n){x(n);const r=new CustomEvent("wcf:password:change",{bubbles:!0,detail:{e:{target:{value:n,name:t}},name:e.name,value:n}});document.dispatchEvent(r),h&&h(n)},placeholder:a,min:d,max:f,readOnly:p,size:"md",className:`${e.class?e.class:""} w-full`,suffix:_?(0,i.createElement)("span",{className:`${_} pointer-events-auto cursor-pointer`,onClick:function(){g&&"show_field_value"===g&&("text"===N?(E("password"),M(m)):(E("text"),M(w)))},role:"button",tabIndex:0}):null},b)))),c&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Zm(c)))},mM=function(){return(0,i.createElement)("div",{className:"wcf-field wcf-separator-field border-x-0 border-t-0 border-b border-solid border-border-subtle"})},hM=function(e){const t=e.data;let n=e.value;const r=e.displayAs?e.displayAs:"tr";let o="";switch(""===n&&(n=t.value),t.type){case"text":o=(0,i.createElement)(uw,{id:t.name,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,class:t?.class,name:t.name,value:t.value?t.value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,desc:t.desc,tooltip:t.tooltip,displayAlign:t.display_align});break;case"number":o=(0,i.createElement)(xx,{type:t.type,id:t.name,class:t?.class,name:t.name,value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,min:t.min,max:t.max,desc:t.desc,tooltip:t.tooltip,afterfield:t.afterfield,width:t.width,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align});break;case"checkbox":o=(0,i.createElement)(jg,{id:t.name,name:t.name,className:t?.class,value:n,label:t.label,desc:t.desc,notice:t.notice,backComp:t.backComp,tooltip:t.tooltip,child_className:t.child_class,isDisabled:t.isDisabled,displayAlign:t.display_align,isPro:t.is_pro});break;case"toggle":o=(0,i.createElement)(yM,{id:t.name,name:t.name,className:t.class,value:n,label:t.label,desc:t.desc,notice:t.notice,backComp:t.backComp,tooltip:t.tooltip,child_className:t.child_class,displayAlign:t.display_align,fullWidth:t.is_fullwidth,isDisabled:t?.is_disabled});break;case"radio":o=(0,i.createElement)(Yg,{id:t.name,name:t.name,value:void 0===n?"":n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,child_className:t.child_class});break;case"textarea":o=(0,i.createElement)(fw,{id:t.name,name:t.name,className:t?.class,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,rows:t.rows,cols:t.cols,displayAlign:t.display_align});break;case"code":o=(0,i.createElement)(pw,{id:t.name,name:t.name,value:n,label:t.label,tooltip:t.tooltip,displayAlign:t.display_align,language:t.language});break;case"select":o=(0,i.createElement)(cw,{id:t.name,name:t.name,class:t.class,value:n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,prodata:t?.pro_options,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,contentClass:t?.contentClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align,isDisabled:t.isDisabled});break;case"select_card":o=(0,i.createElement)(bM,{id:t.name,name:t.name,value:n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,prodata:t?.pro_options,layout:t?.layout,showRadio:t?.display_radio});break;case"select2":o=(0,i.createElement)(ox,{id:t.name,name:t.name,value:n,label:t.label,placeholder:t.placeholder,desc:t.desc,tooltip:t.tooltip,options:t.options,isMulti:t.isMulti,displayAlign:t.display_align,isSearchable:t?.enable_search});break;case"product":o=(0,i.createElement)("div",null,(0,i.createElement)(sM,{name:t.name,label:t.label,desc:t.desc,field:t.fieldtype,allowed_products:t.allowed_product_types?t.allowed_product_types:"",include_products:t.include_product_types?t.include_product_types:"",excluded_products:t.excluded_product_types?t.excluded_product_types:"",placeholder:t.placeholder,tooltip:t.tooltip,value:n,nameComp:t.nameComp,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass}));break;case"coupon":o=(0,i.createElement)("div",null,(0,i.createElement)(lM,{name:t.name,label:t.label,desc:t.desc,field:t.fieldtype,placeholder:t.placeholder,tooltip:t.tooltip,value:n,nameComp:t.nameComp}));break;case"product-repeater":o=(0,i.createElement)(px,{id:t.name,name:t.name,value:n,label:t.label,products:t.products});break;case"font-family":o=(0,i.createElement)(wx,{id:t.name,name:t.name,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,font_weight_name:t.font_weight_name,font_weight_value:t.font_weight_value,displayAlign:t.display_align});break;case"separator":o=(0,i.createElement)(mM,null);break;case"sub-heading":o=(0,i.createElement)(fM,{subclassName:t.subClass,label:t.label,desc:t.desc});break;case"color-picker":o=(0,i.createElement)(hx,{id:t.name,name:t.name,label:t.label,value:n,desc:t.desc,tooltip:t.tooltip,displayAlign:t.display_align,withBg:t.withBg});break;case"password":o=(0,i.createElement)(pM,{type:t.type,id:t.name,name:t.name,value:t.value?t.value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,desc:t.desc,tooltip:t.tooltip,class:t.class,icon:t.icon,iconOnClick:t.iconclick,afterClickIcon:t.afterIcon});break;case"image-selector":const r=t?.objName?t?.objName:"product_img_obj",a=e?.options&&e?.options[r]?e?.options[r]:t?.value;o=(0,i.createElement)(vx,{id:t.name,name:t.name,label:t.label,value:n,desc:t.desc,tooltip:t.tooltip,isNameArray:t.isNameArray,objName:r,objValue:a,singleButton:t?.singleButton,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align});break;case"doc":o=(0,i.createElement)(F_,{content:t?.content,icon:t?.icon||""});break;case"pro-notice":o=(0,i.createElement)("p",{className:"wcf-pro-update-notice"},(0,C.sprintf)(/* translators: %s is replaced with feature name */ /* translators: %s is replaced with feature name */
16 -(0,C.__)("Please upgrade to the CartFlows Higher Plan to use the %s feature.","cartflows"),t.feature));break;case"heading":o=(0,i.createElement)(Q_,{label:t.label,desc:t.desc,sectionClass:t?.sectionClass,labelClass:t?.labelClass,descClass:t?.descClass});break;case"checkout-link-generator":o=(0,i.createElement)(MM,{stepId:t.step_id});break;case"wp-editor":o=(0,i.createElement)(gM,{name:t.name,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,rows:t.rows,cols:t.cols,id:t.id,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align})}return"tr"===r?(0,i.createElement)("tr",{className:`wcf-field-row-${e.field} ${e.class?e.class:""} ${e.isActive?"":"wcf-hide"}`,key:t.name},(0,i.createElement)("th",{scope:"row",className:"py-2"},(0,i.createElement)(i.Fragment,null,o))):(0,i.createElement)("div",{key:t.name,className:`wcf-${e.tabName}-tab--row wcf-field-row-${e.field} mb-4 last:mb-0 ${e.class?e.class:""} ${e.isActive?"":"hidden"}`},o)},gM=function(e){const{name:t,value:n,label:r,desc:o,id:a,tooltip:l,rows:c,cols:u,sectionClass:d=!1,wrapperClass:f=!1,labelClass:p,descClass:m,displayAlign:h="horizontal"}=e,[g,w]=(0,s.useState)(n),y=d||"text-left",b=m||"text-sm font-normal text-text-tertiary mt-2";let v=f||"flex items-center gap-2.5",x=p||"text-sm font-medium text-text-primary text-left mb-2";function N(t,n){w(n);const r=new CustomEvent("wcf:wpeditor:change",{bubbles:!0,detail:{e:t,name:e.name,value:n}});document.dispatchEvent(r)}return"horizontal"!==h&&(v="block w-full text-left",x+=" mb-2"),(0,s.useEffect)(()=>{let e=!0;return e&&(wp.editor.initialize(a,{tinymce:!0,quicktags:!0,mediaButtons:!1}),jQuery(document).on("tinymce-editor-setup",function(e,n){n.settings.toolbar1="bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,cartflows_ob",n.on("change",function(){N(e,n.getContent())}),n.on("keyup",function(){N(e,n.getContent())}),n.settings.forced_root_block=!1,"desc_text"===t&&n.addButton("cartflows_ob",{type:"menubutton",text:"",icon:"cartflows-logo cartflows-logo-icon",menu:[{text:"Product Name",value:"{{product_name}}",onclick(){n.insertContent(this.value())}},{text:"Product Desc",value:"{{product_desc}}",onclick(){n.insertContent(this.value())}},{text:"Product Price",value:"{{product_price}}",onclick(){n.insertContent(this.value())}},{text:"Product Quantity",value:"{{quantity}}",onclick(){n.insertContent(this.value())}}].sort(function(e,t){return e.text.localeCompare(t.text)})})})),()=>{e=!1,tinymce.activeEditor.destroy()}},[]),(0,i.createElement)("div",{className:`wcf-field wcf-wp-editor-field ${y}`},(0,i.createElement)("div",{className:`wcf-field__data ${v}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${x}`},(0,i.createElement)("label",null,r,l&&(0,i.createElement)(dM,{text:l}))),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("textarea",{className:e.class,name:t,value:g,id:a,rows:c||"10",cols:u||"60",onChange:function(t){w(t.target.value);const n=new CustomEvent("wcf:wpeditor:change",{bubbles:!0,detail:{e:t,name:e.name,value:t.target.value}});document.dispatchEvent(n)}}))),o&&(0,i.createElement)("div",{className:`wcf-field__desc ${b}`},Zm(o)))},wM=function(e){const{name:t,value:n,fields:r}=e,[o,a]=c().useState(n);function s(e){a(e.target.value)}return(0,i.createElement)(i.Fragment,null,r.map((e,n)=>(0,i.createElement)(uw,{key:n,name:t+`[${e.name}]`,label:e.label,placeholder:e.placeholder,value:sm(o[e.name]),onChange:s,tooltip:e.tooltip})))},yM=function({onChange:e,...t}){const{name:n,id:r,label:o,value:a,desc:l,backComp:c=!1,onClick:u,notice:d,isDisabled:f=!1,tooltip:p,sectionClass:m="",wrapperClass:h="",labelClass:g="",descClass:w="",displayAlign:y="horizontal",fullWidth:b=!0}=t,[v,x]=(0,s.useState)(a),[N,E]=(0,s.useState)(!1),[_,M]=(0,s.useState)(""),I=m||"text-left",S=g||"text-sm font-medium text-text-primary",k=w||"text-sm font-normal text-text-secondary mt-2";let D=h||"flex items-center py-1 "+(b?"justify-between":"");"horizontal"!==y&&(D="block w-full text-left"),(0,s.useEffect)(()=>{x(a)},[a]);const j=c?"enable":"yes",A=c?"disable":"no",T=(0,s.useCallback)(t=>{const r=t?j:A;x(r);const o=new CustomEvent("wcf:toggle:change",{bubbles:!0,detail:{name:n,value:r}});document.dispatchEvent(o),e&&e({name:n,value:r}),u&&u()},[j,A,n,e,u]);function L(){"prompt"===d.type&&_!==d.check.toUpperCase()||(E(!1),M(""),"alert"!==d.type&&T(!0))}function O(){E(!1),M("")}return(0,i.createElement)("div",{className:`wcf-field wcf-toggle-field ${I} `},(0,i.createElement)("div",{className:`wcf-field__data ${D}`},o&&(0,i.createElement)("div",{className:"wcf-field__data--content-left flex-1 min-w-0"},(0,i.createElement)("div",{className:`wcf-field__data--label ${S}`},(0,i.createElement)("label",null,o,p&&(0,i.createElement)(dM,{text:p}))),l&&(0,i.createElement)("div",{className:`wcf-field__desc ${k}`},Zm(l))),(0,i.createElement)("div",{className:"wcf-field__data--content-right ml-2"},(0,i.createElement)("div",{className:"flex justify-center"},(0,i.createElement)("input",{type:"hidden",name:n,value:v}),(0,i.createElement)(Pg,{id:r||n,value:j===v,onChange:function(e){if(e&&d)return"alert"===d.type?void E(!0):"confirm"===d.type||"prompt"===d.type?(M(""),void E(!0)):void 0;T(e)},disabled:f})))),!o&&l&&(0,i.createElement)("div",{className:`wcf-field__desc ${k}`},Zm(l)),function(){if(!d)return null;const e="prompt"===d.type,t="alert"===d.type,n=!e||_===d.check.toUpperCase();return(0,i.createElement)(bh,{open:N,setOpen:e=>{e||O()},exitOnClickOutside:!1,exitOnEsc:!0,className:"wcf-toggle-notice-popup"},(0,i.createElement)(bh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)("div",{className:"flex items-center gap-2"},(0,i.createElement)(jh,{className:"w-8 h-8 text-support-warning","aria-hidden":"true"}),(0,i.createElement)(bh.Title,null,t?(0,C.__)("Notice","cartflows"):(0,C.__)("Confirmation Required","cartflows"))),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,null,(0,i.createElement)("p",{className:"text-sm text-text-secondary m-0"},d.message),e&&(0,i.createElement)("div",{className:"mt-4"},(0,i.createElement)(tg,{value:_,onChange:e=>M(e),placeholder:d.check.toUpperCase(),size:"md"}))),(0,i.createElement)(bh.Footer,{className:"flex gap-3 justify-end"},t?(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:O},(0,C.__)("OK","cartflows")):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:O},(0,C.__)("Cancel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"md",destructive:!0,onClick:L,disabled:!n},(0,C.__)("Confirm","cartflows"))))))}())},bM=function(e){const{name:t,label:n,desc:r,tooltip:o,options:a,layout:l="horizontal",value:c,showRadio:u=!0,after:d}=e;(0,s.useEffect)(()=>{void 0===c&&p("")},[]);const[f,p]=(0,s.useState)(c);function m(t){p(t);const n=new CustomEvent("wcf:selectioncard:change",{bubbles:!0,detail:{e:{},name:e.name,newValue:t}});document.dispatchEvent(n)}function h(e){return e.tooltip?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(dM,{text:e.tooltip}),e.label):e.desc?{heading:e.label,description:e.desc}:e.label}return(0,i.createElement)("div",{className:"wcf-field wcf-select-option--card"},(0,i.createElement)("div",{className:"wcf-field__data flex flex-col gap-6"},n&&r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-field__data--content-left"},n&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left"},(0,i.createElement)("label",null,n,o&&(0,i.createElement)(dM,{text:o})))),(0,i.createElement)("div",{className:"wcf-field__desc text-sm text-left font-normal text-text-tertiary"},Zm(r))),(0,i.createElement)("div",{className:"wcf-field__data--content-right w-full"},"horizontal"===l?(0,i.createElement)("div",{className:"grid gap-[13px]",style:{gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`}},a.map(e=>{const n=f===e.value;return(0,i.createElement)("label",{key:e.value,className:"flex flex-col items-center gap-3 p-3 rounded-md cursor-pointer transition-all relative border border-solid "+(n?"border-brand-300 bg-brand-25":"border-border-subtle hover:border-border-interactive")},(0,i.createElement)("input",{type:"radio",name:t,value:e.value,checked:n,onChange:()=>m(e.value),className:"sr-only"}),u&&(0,i.createElement)("span",{className:"absolute top-2.5 right-2.5 size-4 rounded-full border border-solid flex items-center justify-center "+(n?"bg-toggle-on border-toggle-on":"bg-background-primary border-field-border")},n&&(0,i.createElement)("span",{className:"size-1.5 rounded-full bg-background-primary"})),e.image&&(0,i.createElement)("img",{src:e.image,alt:e.label,className:"wcf-selection-card--image size-11"}),(0,i.createElement)("span",{className:"text-sm font-semibold text-center leading-5 whitespace-nowrap flex items-center gap-1 "+(n?"text-brand-500":"text-text-primary")},e.tooltip&&(0,i.createElement)(dM,{text:e.tooltip,classes:n?"text-brand-500":"hover:text-brand-500"}),e.label))})):(0,i.createElement)(Vg.Group,{name:t,value:f,onChange:m,style:"simple",vertical:!0,columns:1,gapClassName:"gap-0"},a.map((e,t)=>(0,i.createElement)(Vg.Button,(0,y.A)({key:t,value:e.value,label:h(e)},e.image&&{icon:(0,i.createElement)("img",{src:e.image,alt:e.label,className:"wcf-selection-card--image w-12 h-12"})},{minWidth:!1,buttonWrapperClasses:"[&_label]:text-left "+(e.desc?"[&_p:last-child]:!text-text-secondary":"")}))))),d&&(0,i.createElement)("div",{className:"wcf-field__data--content__after"},d)),!n&&r&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Zm(r)))},vM=function(e){const{name:t,id:n,label:r,desc:o,tooltip:a,options:l,onSelect:c,after:u,isSearchable:d=!1}=e,[f,p]=(0,s.useState)(()=>l.find(t=>t.value===e.value)||null),m=(0,s.useRef)(null);return(0,i.createElement)("div",{className:"wcf-field wcf-select-with-icons-option"},(0,i.createElement)("div",{className:"wcf-field__data"},r&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-normal text-left"},(0,i.createElement)("label",null,r,a&&(0,i.createElement)(dM,{text:a}))),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("input",{type:"hidden",ref:m,name:t,defaultValue:f?.value||""}),(0,i.createElement)(lw,{id:n,value:f,onChange:function(t){p(t),m.current&&(m.current.value=t.value);const n=new CustomEvent("wcf:select:change",{bubbles:!0,detail:{e:t,name:e.name,value:t.value,icon:t.icon}});document.dispatchEvent(n),e?.callback&&e.callback(t,e.name,t.value),c&&c()},by:"value",combobox:d,size:"sm"},(0,i.createElement)(lw.Button,{placeholder:"",render:e=>(0,i.createElement)(dM,{text:e?.label||"",icon:e?.icon||(0,i.createElement)(ix,{className:"w-5 h-5"}),classes:"!ml-0"}),type:"button",className:e.class}),(0,i.createElement)(lw.Options,null,l.map(e=>(0,i.createElement)(lw.Option,{key:e.value,value:e},(0,i.createElement)(dM,{text:e.label,icon:e.icon,classes:"group-hover:text-text-on-color !ml-0"})))))),u&&(0,i.createElement)("div",{className:"wcf-field__data--content__after"},u)),o&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},Zm(o)))};function xM({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"}))}const NM=s.forwardRef(xM),EM={billing:["billing_country","billing_address_2","billing_address_1","billing_city","billing_state","billing_postcode"],shipping:["shipping_country","shipping_address_2","shipping_address_1","shipping_city","shipping_state","shipping_postcode"]},_M=function({preSelectedStepId:e=null,isStoreCheckout:t=!1}){const[n,r]=(0,s.useState)([]),[o,a]=(0,s.useState)(e||""),[l,c]=(0,s.useState)(""),[u,d]=(0,s.useState)([]),[f,p]=(0,s.useState)({}),[m,h]=(0,s.useState)([]),[g,w]=(0,s.useState)(null),[y,b]=(0,s.useState)([]),[v,x]=(0,s.useState)([]),[N,E]=(0,s.useState)([]),[_,M]=(0,s.useState)(!0),[I,S]=(0,s.useState)(!1),[k,D]=(0,s.useState)(!1);(0,s.useEffect)(()=>{qf()({path:"/cartflows-pro/v1/admin/checkout-link-data/steps"}).then(t=>{if(r(t),M(!1),e){const n=t.find(t=>t.id===parseInt(e,10));n&&c(n.permalink)}}).catch(()=>M(!1))},[]),(0,s.useEffect)(()=>{qf()({path:"/cartflows-pro/v1/admin/checkout-link-data/coupons"}).then(e=>b(e)).catch(()=>{})},[]),(0,s.useEffect)(()=>{t&&qf()({path:"/cartflows-pro/v1/admin/checkout-link-data/products"}).then(e=>x(e)).catch(()=>{})},[t]),(0,s.useEffect)(()=>{if(!o)return d([]),p({}),h([]),void c("");S(!0);const e=n.find(e=>e.id===parseInt(o,10));e&&c(e.permalink),qf()({path:`/cartflows-pro/v1/admin/checkout-link-data/fields/${o}`}).then(e=>{d(e);const t={};e.forEach(e=>{t[e.id]=""}),p(t),h([]),S(!1)}).catch(()=>S(!1))},[o]);const j=(0,s.useMemo)(()=>{const e=u.find(e=>"country"===e.type);return e?.states||{}},[u]),A=(0,s.useMemo)(()=>{const e=(e,t)=>{const n=u.some(t=>t.section===e&&"address"===t.group),r=u.filter(t=>t.section===e&&"address"!==t.group).map(t=>({label:t.label,value:t.id,section:e}));return{label:t,options:[...n?[{label:t+" "+(0,C.__)("Address","cartflows"),value:`__${e}_address__`,type:"address_group",section:e}]:[],...r]}};return[e("billing",(0,C.__)("Billing","cartflows")),e("shipping",(0,C.__)("Shipping","cartflows"))].filter(e=>e.options.length>0)},[u]),T=(0,s.useCallback)(()=>{if(!l||!o)return"";const e=[];if(m.filter(e=>"address_group"!==e.type).forEach(t=>{const n=f[t.value];n&&""!==n.trim()&&e.push(`${encodeURIComponent(t.value)}=${encodeURIComponent(n)}`)}),m.filter(e=>"address_group"===e.type).forEach(t=>{(EM[t.section]||[]).forEach(t=>{const n=f[t];n&&""!==n.trim()&&e.push(`${encodeURIComponent(t)}=${encodeURIComponent(n)}`)})}),g?.value&&e.push(`coupon=${encodeURIComponent(g.value)}`),N.length>0){const t=N.map(e=>e.value).join(",");e.push(`wcf-add-to-cart=${encodeURIComponent(t)}`)}if(0===e.length)return l;const t=l.includes("?")?"&":"?";return`${l}${t}${e.join("&")}`},[l,o,m,f,g,N]),L=(e,t)=>{p(n=>({...n,[e]:t}))};return(0,i.createElement)("div",{className:"wcf-checkout-link-generator"},!e&&(0,i.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-6"},(0,i.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,i.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,C.__)("Checkout Step","cartflows")),(0,i.createElement)("p",{className:"text-sm text-text-secondary mt-1"},(0,C.__)("Choose the checkout page to build a link for.","cartflows"))),(0,i.createElement)("div",{className:"wcf-field__data--content-right flex-1"},_?(0,i.createElement)("div",{className:"animate-pulse h-9 bg-background-secondary rounded-md w-full"}):(0,i.createElement)("select",{className:"input-field !pl-3 !pr-6 !py-2 !text-sm font-normal !rounded-md text-text-primary !border-border-subtle w-full",value:o,onChange:e=>a(e.target.value)},(0,i.createElement)("option",{value:""},(0,C.__)("— Select a Step —","cartflows")),n.map(e=>(0,i.createElement)("option",{key:e.id,value:e.id},e.title))))),o&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("hr",{className:"border-border-subtle mb-6"}),I?(0,i.createElement)("div",{className:"space-y-3"},[1,2,3].map(e=>(0,i.createElement)("div",{key:e,className:"animate-pulse h-10 bg-background-secondary rounded-md"}))):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-2"},(0,i.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,i.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,C.__)("Select Fields","cartflows")),(0,i.createElement)("p",{className:"text-xs text-text-secondary mt-1"},(0,C.__)("Select the checkout fields to include in the URL.","cartflows"))),(0,i.createElement)("div",{className:"wcf-field__data--content-right flex-1"},(0,i.createElement)(ox,{name:"wcf_clg_fields",isMulti:!0,isSearchable:!0,options:A,value:m,placeholder:(0,C.__)("Select fields…","cartflows"),onChangeCB:e=>{const t=e||[],n=m.filter(e=>"address_group"===e.type&&!t.find(t=>t.value===e.value));if(n.length>0){const e={};n.forEach(t=>{(EM[t.section]||[]).forEach(t=>{e[t]=""})}),p(t=>({...t,...e}))}h(t)},className:"!m-0"}))),m.length>0&&(0,i.createElement)("div",{className:"mb-4 border-t border-border-subtle pb-4"},m.filter(e=>"address_group"!==e.type).map(t=>((t,n,r)=>{const o=u.find(e=>e.id===t),a="country"===o?.type&&o?.options&&Object.keys(o.options).length>0;return(0,i.createElement)("div",{key:t,className:"wcf-field__data flex items-center gap-6 py-3 border-0"},(0,i.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,i.createElement)("label",{htmlFor:`wcf_clg_${t}`,className:"text-sm font-medium text-text-primary"},n),r&&(0,i.createElement)("span",{className:"block text-xs text-text-secondary mt-0.5"},"billing"===r?(0,C.__)("Billing","cartflows"):(0,C.__)("Shipping","cartflows"))),(0,i.createElement)("div",{className:"wcf-field__data--content-right flex-1 "+(e?"":"!ml-5")},a?(0,i.createElement)("select",{id:`wcf_clg_${t}`,name:`wcf_clg_${t}`,className:"input-field !pl-3.5 !pr-6 !py-2.5 !text-sm font-normal !rounded-md text-text-primary !border-border-subtle w-full",value:f[t]||"",onChange:e=>L(t,e.target.value)},(0,i.createElement)("option",{value:""},(0,C.__)("Select Country","cartflows")),Object.entries(o.options).map(([e,t])=>(0,i.createElement)("option",{key:e,value:e},t))):(0,i.createElement)(uw,{name:`wcf_clg_${t}`,id:`wcf_clg_${t}`,value:f[t]||"",placeholder:(0,C.__)("Enter value","cartflows"),onChangeCB:e=>L(t,e),sectionClass:"!p-0",wrapperClass:"block w-full"})))})(t.value,t.label,t.section)),m.filter(e=>"address_group"===e.type).map(e=>(e=>{const t=`${e}_state`,n=f[`${e}_country`]||"",r=n&&j[n]||{},o="billing"===e?(0,C.__)("Billing Address","cartflows"):(0,C.__)("Shipping Address","cartflows"),a=(EM[e]||[]).map(e=>u.find(t=>t.id===e)).filter(Boolean),s="block w-full rounded-md border border-border-subtle bg-white px-3.5 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-1 focus:ring-border-strong",l=s;return(0,i.createElement)("div",{key:e,className:"mt-4 rounded-lg border border-border-subtle overflow-hidden"},(0,i.createElement)("div",{className:"px-4 py-3 bg-background-secondary border-b border-border-subtle"},(0,i.createElement)("span",{className:"text-sm font-semibold text-text-primary"},o)),(0,i.createElement)("div",{className:"divide-y divide-border-subtle"},a.map(e=>{const o=e.id,a="country"===e.type,c=o===t;return(0,i.createElement)("div",{key:o,className:"flex items-center gap-4 px-4 py-3"},(0,i.createElement)("label",{htmlFor:`wcf_clg_${o}`,className:"w-36 shrink-0 text-sm text-text-secondary"},e.label),(0,i.createElement)("div",{className:"flex-1 min-w-0"},a&&(0,i.createElement)("select",{id:`wcf_clg_${o}`,className:l,value:f[o]||"",onChange:e=>{L(o,e.target.value),L(t,"")}},(0,i.createElement)("option",{value:""},(0,C.__)("Select Country","cartflows")),Object.entries(e.options).map(([e,t])=>(0,i.createElement)("option",{key:e,value:e},t))),c&&(0,i.createElement)("select",{id:`wcf_clg_${o}`,className:`${l} disabled:opacity-50 disabled:cursor-not-allowed`,value:f[o]||"",disabled:!n,onChange:e=>L(o,e.target.value)},(0,i.createElement)("option",{value:""},n?(0,C.__)("Select State","cartflows"):(0,C.__)("Select a country first","cartflows")),Object.entries(r).map(([e,t])=>(0,i.createElement)("option",{key:e,value:e},t))),!a&&!c&&(0,i.createElement)("input",{type:"text",id:`wcf_clg_${o}`,name:`wcf_clg_${o}`,className:s,value:f[o]||"",placeholder:(0,C.__)("Enter value","cartflows"),onChange:e=>L(o,e.target.value)})))})))})(e.section))),(0,i.createElement)("hr",{className:"border-border-subtle mb-4"}),(0,i.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-6"},(0,i.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,i.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,C.__)("Coupon","cartflows")),(0,i.createElement)("p",{className:"text-xs text-text-secondary mt-1"},(0,C.__)("Select a coupon to apply at checkout.","cartflows"))),(0,i.createElement)("div",{className:"wcf-field__data--content-right flex-1"},(0,i.createElement)(ox,{name:"wcf_clg_coupon",isMulti:!1,isSearchable:!0,isClearable:!0,options:y,value:g,placeholder:(0,C.__)("Select Coupon","cartflows"),onChangeCB:e=>w(e||null),className:"!m-0"}),g&&(()=>{const e=y.find(e=>e.value===g.value);return e?(0,i.createElement)("div",{className:"mt-3 rounded-md border border-border-subtle overflow-hidden"},(0,i.createElement)("div",{className:"px-4 py-2.5 bg-background-secondary border-b border-border-subtle"},(0,i.createElement)("span",{className:"text-xs font-semibold text-text-primary"},(0,C.__)("Coupon Details","cartflows"))),(0,i.createElement)("div",{className:"px-4 py-3 text-xs text-text-secondary space-y-2"},(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"font-medium text-text-primary"},(0,C.__)("Type:","cartflows")),(0,i.createElement)("span",null,e.discount_type)),(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"font-medium text-text-primary"},(0,C.__)("Amount:","cartflows")),(0,i.createElement)("span",null,e.amount)),e.expiry_date&&(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"font-medium text-text-primary"},(0,C.__)("Expires:","cartflows")),(0,i.createElement)("span",null,e.expiry_date)),e.description&&(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"font-medium text-text-primary"},(0,C.__)("Description:","cartflows")),(0,i.createElement)("span",null,e.description)))):null})())),t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("hr",{className:"border-border-subtle mb-4"}),(0,i.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-6"},(0,i.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,i.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,C.__)("Select Products","cartflows")),(0,i.createElement)("p",{className:"text-xs text-text-secondary mt-1"},(0,C.__)("Choose products to add to the cart when this checkout link is visited. Selected products will be added to the cart automatically when the link is opened.","cartflows"))),(0,i.createElement)("div",{className:"wcf-field__data--content-right flex-1"},(0,i.createElement)(ox,{name:"wcf_clg_products",isMulti:!0,isSearchable:!0,isClearable:!0,options:v,value:N,placeholder:(0,C.__)("Select products…","cartflows"),onChangeCB:e=>E(e||[]),className:"!m-0"})))),(0,i.createElement)("hr",{className:"border-border-subtle mb-6"}),(0,i.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-4"},(0,i.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,i.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,C.__)("Checkout URL","cartflows"))),(0,i.createElement)("div",{className:"wcf-field__data--content-right flex-1"},(0,i.createElement)("textarea",{className:"w-full input-field font-mono !text-xs !text-text-secondary !py-3 !px-3 !border-border-subtle !rounded-md bg-background-secondary",rows:4,readOnly:!0,value:T()}))),(0,i.createElement)("div",{className:"flex justify-end"},(0,i.createElement)(Ro,{variant:"primary",size:"sm",type:"button",icon:k?(0,i.createElement)(hw,{className:"w-4 h-4"}):(0,i.createElement)(NM,{className:"w-4 h-4"}),onClick:()=>{const e=T();if(e)if(navigator.clipboard)navigator.clipboard.writeText(e).then(()=>{D(!0),setTimeout(()=>D(!1),2e3)});else{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),D(!0),setTimeout(()=>D(!1),2e3)}}},k?(0,C.__)("Copied!","cartflows"):(0,C.__)("Copy URL","cartflows"))))))},MM=function(){const[{step_data:e,flow_type:t}]=Yp(),n=e?.id||null,r="storeCheckout"===t;return(0,i.createElement)("div",{className:"wcf-field wcf-checkout-link-generator-field"},(0,i.createElement)(_M,{preSelectedStepId:n,isStoreCheckout:r}))},IM=function(){const[{page_settings:e,current_ob:t}]=Yp();if(null===e||"undefined"===e)return(0,i.createElement)(Ng,null);const n=e?.settings["multiple-order-bump-design"];return(0,i.createElement)("div",{className:"wcf-order-bump-design-tab"},(0,i.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},n&&Object.keys(n.fields).map(e=>{const r=n.fields[e];let o="";return"borders"===r.id&&(o="grid grid-cols-4 gap-x-2"),"shadow"===r.id&&(o="grid grid-cols-4 gap-x-2"),r.section_fields?(0,i.createElement)("div",{key:e,className:`wcf-order-bump-design-tab--${r.id}-section ${o} border border-border-subtle rounded-md mb-5`},(0,i.createElement)("div",{className:"wcf-order-bump-deign-tab--heading-section col-span-full"},(0,i.createElement)(Q_,{label:r.title,labelClass:"block text-base font-semibold text-text-primary mb-5"})),Object.keys(r.section_fields).map(e=>{const n=r.section_fields[e],o=t[n.name],a=kg.isActiveControl(n,t);return(0,i.createElement)(hM,{key:e,data:n,value:o,isActive:a,field:e,displayAs:"div",tabName:"ob-design"})})):(0,i.createElement)("div",{key:e,className:"wcf-order-bump-design-tab--section mb-5"},(0,i.createElement)(hM,{key:r.name,data:r,value:t[r.name],isActive:kg.isActiveControl(r,t),field:r.name,displayAs:"div",tabName:"ob-design"}))})))};function SM({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 0 1 0 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 0 1 0-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375Z"}))}const kM=s.forwardRef(SM),DM=function(){const[{page_settings:e,current_ob:t},n]=Yp(),[r,o]=(0,s.useState)(t?.product[0]?t?.product[0]:""),[a,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(),d=(0,C.__)("Add","cartflows"),[f,p]=(0,s.useState)({isInProcessing:!1,buttonText:d}),{isInProcessing:m,buttonText:h}=f,g=e?.settings["multiple-order-bump-product"],w=[{value:"",label:"Original",icon:(0,i.createElement)(ix,{className:"w-5 h-5"})},{value:"discount_percent",label:"Percentage",icon:(0,i.createElement)(lx,{className:"w-5 h-5"})},{value:"discount_price",label:"Price",icon:(0,i.createElement)(ux,{className:"w-5 h-5"})},{value:"coupon",label:"Coupon",icon:(0,i.createElement)(kM,{className:"w-5 h-5"})}];return""!==r&&function(){const e=t.discount_type,n=parseFloat(t.discount_value),o=parseFloat(r.original_price);let a=0;"discount_percent"===e?n>0&&(a=o-o*n/100):"discount_price"===e&&n>0&&(a=o-n),r.sell_price=a.toFixed(2)}(),(0,s.useEffect)(()=>{const e=t?.product?.[0];o(e||""),l(!(e&&!e?.is_deleted))},[t]),null===e||"undefined"===e?(0,i.createElement)(xg,null):(0,i.createElement)("div",{className:"wcf-order-bump-product-tab"},""===r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"border border-solid border-border-subtle bg-gray-25 text-center text-sm font-normal rounded-md p-5"},(0,C.__)("Once you have add product, it will be displayed here.","cartflows")),(0,i.createElement)("input",{type:"hidden",name:"product"}),(0,i.createElement)("div",{className:"wcf-ob-product-selection-field__add-new flex justify-between items-end gap-5 mt-5"},(0,i.createElement)(sM,{name:"",desc:"",field:"product",value:"",allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,C.__)("Search for a Product","cartflows"),onChangeCB:u,sectionClass:"w-full"}),(0,i.createElement)(Ro,{type:"button",variant:"outline",size:"md",icon:(0,i.createElement)(yg,{className:"w-4 h-4"}),iconPosition:"left",loading:m,disabled:m,onClick:function(e){e.preventDefault();const t=c?.value;"active"===cartflows_admin.woocommerce_status&&t&&(p({isInProcessing:!0,buttonText:(0,C.__)("Adding…","cartflows")}),qf()({path:`/cartflows-pro/v1/admin/ob-product-data/${t}`}).then(e=>{n({type:"ADD_OB_PRODUCT",product:e}),p({isInProcessing:!1,buttonText:d})}),u())},className:"wcf-select-product-button shrink-0"},h))),""!==r&&(0,i.createElement)(i.Fragment,null,a&&(0,i.createElement)("div",{className:"border border-brand-500 bg-brand-25 text-center text-brand-500 text-xs font-normal rounded-md p-5 mb-5"},(0,C.__)("The product previously added as an Order Bump has been deleted. Please add a new product.","cartflows")),(0,i.createElement)("div",{className:"wcf-ob-product-selection--selected-product flex items-center gap-3 p-3 border border-border-subtle rounded-md"},(0,i.createElement)("div",{className:"wcf-ob-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-2/5"},(0,i.createElement)("div",{className:"flex gap-3 items-center"},(0,i.createElement)("div",{className:"wcf-ob-product-selection--product-image w-20 h-20"},(0,i.createElement)("img",{src:r.product_image?r.product_image:cartflows_admin.image_placeholder,className:"wcf-ob-product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:r.label})),(0,i.createElement)("div",{className:"wcf-ob-product-selection--product-title_text"},(0,i.createElement)("div",{className:"wcf-ob-product-repeater-field__title whitespace-normal text-left","data-product_id":r.value},Zm(String(r?.label))),(0,i.createElement)("input",{type:"hidden",name:"product",value:r.value?r.value:""}),(0,i.createElement)("div",{className:"wcf-ob-product-repeater-field__reg-price mt-1 "},(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:`wcf-ob-product--reg-price ${0<t.discount_value?"line-through text-text-tertiary":""} `},cartflows_admin.woo_currency+r.original_price),0<t.discount_value&&(0,i.createElement)("span",{className:"wcf-ob-product--sale-price"},cartflows_admin.woo_currency+r.sell_price))),"coupon"===t.discount_type&&(0,i.createElement)("span",{className:"coupon-message text-xs mt-0.5 text-text-secondary"},(0,C.__)("Coupon will apply on checkout page","cartflows"))))),(0,i.createElement)("div",{className:"wcf-ob-product-selection--product-discount__wrapper flex items-end gap-3 justify-start w-[55%]"},(0,i.createElement)("div",{className:"wcf-ob-product-selection--product-qty whitespace-nowrap text-sm text-text-secondary"},(0,i.createElement)(xx,{id:"",name:"quantity",class:"input-field !w-16 !m-0 "+("no"===t.display_quantity_field?"disabled":""),value:t.quantity,min:"1",readonly:"no"===t.display_quantity_field})),(0,i.createElement)("div",{className:"wcf-ob-product-selection--product-discount flex items-end whitespace-nowrap text-sm text-text-secondary gap-3"},(0,i.createElement)(vM,{name:"discount_type",value:t.discount_type,class:"!m-0",options:w}),"coupon"!==t.discount_type?(0,i.createElement)(xx,{id:"",class:"input-field !w-16 !m-0",name:"discount_value",value:""===t.discount_type?"":t.discount_value,readonly:""===t.discount_type?"readonly":"",placeholder:""===t.discount_type?"":"0",min:"1",step:"any"}):(0,i.createElement)(lM,{wrapperClass:"w-56",fieldClass:"!border-l-0 !rounded-r-md !rounded-l-none",name:"discount_coupon",placeholder:(0,C.__)("Search for a coupon","cartflows"),multiple:!1,allow_clear:!0,value:""===t.discount_type?"":t.discount_coupon}))),(0,i.createElement)("div",{className:"wcf-product-selection-actions whitespace-nowrap text-right text-sm font-medium w-[5%]"},(0,i.createElement)("div",{className:"wcf-delete-product-item p-2 text-text-tertiary hover:text-brand-500 cursor-pointer flex justify-center items-center",onClick:function(){n({type:"REMOVE_OB_PRODUCT",product:""}),o("")}},(0,i.createElement)($m,{className:"h-18 w-18"})))),(0,i.createElement)("div",{className:"flex mt-5"},(0,i.createElement)("table",{className:"w-full"},(0,i.createElement)("tbody",null,g&&g.fields&&Object.keys(g.fields).map(e=>{const n=g.fields[e],r=n.name,o=t[r],a=kg.isActiveControl(n,t);return(0,i.createElement)(hM,{key:e,data:n,value:o,isActive:a,field:e})}))))))},CM=function(){const[{page_settings:e,current_ob:t}]=Yp();if(null===e||"undefined"===e)return(0,i.createElement)(Ng,null);const n=e?.settings["multiple-order-bump-content"];return(0,i.createElement)("div",{className:"wcf-order-bump-content-tab"},(0,i.createElement)("div",{className:"wcf-order-bump-content-tab__settings"},Object.keys(n.fields).map(e=>{const r=n.fields[e],o=t[r.name],a=kg.isActiveControl(r,t);return(0,i.createElement)(hM,{key:e,data:r,value:o,isActive:a,field:e,options:t,displayAs:"div",tabName:"order-bump-content"})})))},jM=function({rules:e,group_id:t,g_index:n,groups_length:r}){const[{page_settings:o},a]=Yp(),s=o?.settings["multiple-order-bump-rules"],l=s.conditions;return(0,i.createElement)(i.Fragment,null,e.map((o,c)=>{const u=o?.rule_id,d=e[c],f=s.field_data[d.condition],p=f?.operator||[],m=d.operator||p[0]?.value||"";return(0,i.createElement)(i.Fragment,null,0!==c&&(0,i.createElement)("div",{className:"wcf-order-bumps-rules--group_rules__condition-label"},(0,i.createElement)("div",{className:"wcf--condition-label__and_group relative"},(0,i.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,i.createElement)("div",{className:"w-full border-t border-border-subtle border-dashed"})),(0,i.createElement)("div",{className:"relative flex justify-center"},(0,i.createElement)(Lf,{variant:"neutral",type:"rounded",size:"xs",label:(0,C.__)("AND","cartflows"),className:"wcf--condition-label__and_group__text"})))),(0,i.createElement)("div",{className:"wcf-order-bumps-rules--group_rules flex gap-3 items-center","data-rule-id":u,key:u},(0,i.createElement)("input",{type:"hidden",name:`rules[${n}][rules][${c}][rule_id]`,value:u}),(0,i.createElement)("div",{className:"wcf-order-bumps-rules--rule_fields grid gap-3 items-end w-full \n\t\t\t\t\t\t\t\t\t"+(f?.fields?.some(e=>"product"===e.type)?"grid-cols-2":"grid-cols-3")},(0,i.createElement)(cw,{name:`rules[${n}][rules][${c}][condition]`,wrapperClass:"block",options:l,onSelect:()=>{a({type:"RESET_OB_RULE_VALUE",name:"rules",group_id:t,rule_id:u})},value:d.condition}),(0,i.createElement)(cw,{name:`rules[${n}][rules][${c}][operator]`,wrapperClass:"block",options:f.operator,value:Zm(String(m))}),function(e,t,r){const o=r.value;let a="";const s=`rules[${n}][rules][${t}][value]`;return e.map(e=>{switch(e.type){case"select2":a=(0,i.createElement)(ox,{name:`${s}[]`,value:o,placeholder:e.placeholder,tooltip:e.tooltip,options:e.options,isMulti:e.isMulti,isSearchable:e?.enable_search});break;case"number":a=(0,i.createElement)(xx,{name:s,value:o,min:0,placeholder:e.placeholder,tooltip:e.tooltip});break;case"coupon":a="exist"===r.operator||"not_exist"===r.operator?(0,i.createElement)(cw,{name:s,options:[{label:"in parent order",value:"parent_order"}]}):(0,i.createElement)(lM,{name:s,placeholder:e.placeholder,tooltip:e.tooltip,value:o,isMulti:e.isMulti});break;case"product":a=(0,i.createElement)(sM,{name:s,placeholder:e.placeholder,tooltip:e.tooltip,value:o,isMulti:e.isMulti,sectionClass:"col-span-full",showLabelOnly:!0})}return a})}(f.fields,c,d)),(0,i.createElement)("div",{className:"wcf-order-bumps-rules--rule_actions"},function(e,n){return 1===e&&1===r?"":(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)($m,{className:"w-4 h-4 stroke-2 text-text-tertiary"}),className:"!p-1 hover:!bg-background-secondary [&_svg]:hover:text-brand-700",onClick:e=>{e.currentTarget.setAttribute("rule_id",n),(e=>{const n=e.target.getAttribute("rule_id");t&&n&&a({type:"REMOVE_OB_RULE",name:"rules",rule_id:n,group_id:t})})({target:e.currentTarget})},rule_id:n})}(e.length,u))))}))},AM=e=>(0,i.createElement)("svg",(0,y.A)({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),(0,i.createElement)("circle",{cx:"7",cy:"5",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"7",cy:"10",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"7",cy:"15",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"13",cy:"5",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"13",cy:"10",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"13",cy:"15",r:"1.25",fill:"currentColor"})),TM=function(){const[{options:e,current_ob:t},n]=Yp(),[r,o]=(0,s.useState)({ruleGroupId:"",isOpen:!1}),{ruleGroupId:a,isOpen:l}=r;if(null===e||"undefined"===t)return(0,i.createElement)(Sg,null);const c=t.rules;if(void 0===c)return(0,i.createElement)(F_,{content:(0,C.__)("Please Update the CartFlows Pro to the latest version to use the conditional order bump feature.","cartflows")});const u=()=>{const e={group_id:Math.random().toString(36).substring(2,5),rules:[{rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""}]};n({type:"ADD_NEW_OB_GROUP",name:"rules",newGroup:e})},d=function(e){const t=e.target.getAttribute("data-group_id");o({ruleGroupId:t,isOpen:a!==t||!l})};return(0,i.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,i.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,i.createElement)(yM,{name:"is_rule",value:t.is_rule,label:(0,C.__)("Enable conditional order bump ","cartflows"),tooltip:(0,C.__)("By enabling this option, you can create the conditions to display the order bump.","cartflows")})),"yes"===t.is_rule&&c&&(0,i.createElement)("div",{className:"mt-8"},(0,i.createElement)(Zp.ReactSortable,{id:"wcf-order-bump-sortable-wrapper",className:"wcf-order-bump--sortable-wrapper flex flex-col gap-4",list:c,setList:e=>n({type:"SET_OB_RULES_GROUPS",groups:e,fieldName:"rules"}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-order-bumps-rules-page--group_wrapper",filter:".wcf-order-bumps-rules--rule_fields, .wcf-order-bumps-rules--rule_actions, .wcf-field wcf-select-option, .wcf-order-bumps-rules--add-rule__repeater .wcf-button.wcf-button--secondary, .wcf-field__data--content, .wcf-order-bumps-rules-page--group_wrapper__footer, .wcf-checkout-rules--group_header__right",preventOnFilter:!1,onStart:function(){document.getElementsByClassName("wcf-order-bumps-rules--or_group__button")[0].setAttribute("style","display:none")},onEnd:function(){document.getElementsByClassName("wcf-order-bumps-rules--or_group__button")[0].setAttribute("style","display:inline-block")}},c.map((e,t)=>{const r=e.group_id,o=e.rules;return(0,i.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper",key:r},(0,i.createElement)("div",{className:"wcf-order-bumps-rules--group border border-solid border-cartflows-border rounded-md shadow-sm bg-background-primary overflow-hidden","data-group-id":r},(0,i.createElement)("input",{type:"hidden",name:`rules[${t}][group_id]`,value:r}),(0,i.createElement)("div",{className:"wcf-order-bumps-rules--group-header bg-background-primary p-4 flex items-center justify-between gap-4"},(0,i.createElement)("div",{className:"wcf-order-bumps-rules--group_header__left flex gap-4 items-center"},(0,i.createElement)("div",{className:"wcf-order-bumps-rule--sortable-toggle flex cursor-move text-text-tertiary hover:text-text-secondary"},(0,i.createElement)(AM,null)),(0,i.createElement)("span",{className:"wcf-group-header--text font-sm font-normal text-text-tertiary"},(0,C.__)("Show this order bump if following conditions are true","cartflows"))),(0,i.createElement)("div",{className:"wcf-order-bumps-rules--group_header__right flex gap-2 items-center"},a===r&&l?(0,i.createElement)(gg,{className:"w-4 h-4 stroke-1 text-text-tertiary hover:text-text-secondary cursor-pointer","aria-hidden":"true",onClick:d,"data-group_id":r}):(0,i.createElement)(Lp,{className:"w-4 h-4 stroke-1 text-text-tertiary hover:text-text-secondary cursor-pointer","aria-hidden":"true",onClick:d,"data-group_id":r}))),(0,i.createElement)("div",{id:`wcf-order-bumps-rules--group-${r}`,className:"p-4 bg-background-secondary border-t border-solid border-border-subtle border-0 "+(a===r&&l?"visible":"hidden")},(0,i.createElement)("div",{className:"wcf-order-bumps-rules--group_rules--wrapper flex flex-col gap-4"},0!==o.length&&(0,i.createElement)(jM,{rules:o,group_id:r,g_index:t,groups_length:c.length})),(0,i.createElement)("div",{className:"wcf-order-bumps-rules--add-rule__repeater flex mt-4"},(0,i.createElement)(Ro,{variant:"link",size:"sm",icon:(0,i.createElement)(yg,{className:"w-4 h-4 stroke-2"}),iconPosition:"left",className:"wcf-order-bumps-rules--add-rule__button hover:!no-underline",onClick:()=>(e=>{const t={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};n({type:"ADD_NEW_OB_RULE",name:"rules",newRule:t,group_id:e})})(r)},(0,C.__)("Add Condition","cartflows"))))),(0,i.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper__footer"},(0,i.createElement)("div",{className:"wcf-order-bumps-rules--or_group relative my-4"},(0,i.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,i.createElement)("div",{className:"w-full border-t border-border-subtle border-dashed"})),(0,i.createElement)("div",{className:"relative flex justify-center"},(0,i.createElement)(Lf,{variant:"neutral",type:"rounded",size:"xs",label:(0,C.__)("OR","cartflows"),className:"wcf-order-bumps-rules--or_group__text"}))),parseInt(t)+1===c.length&&(0,i.createElement)("div",{className:"wcf-order-bumps-rules--or_group__button mt-4"},(0,i.createElement)(Ro,{variant:"outline",size:"md",icon:(0,i.createElement)(yg,{className:"w-4 h-4 stroke-2"}),iconPosition:"left",className:"wcf-order-bumps-rules--or_group_button !bg-brand-25 !text-brand-600 !outline-brand-300 hover:!bg-brand-50 hover:!outline-brand-300",onClick:u},(0,C.__)("Add Conditions Group","cartflows")))))}))))},LM=(0,s.createContext)(null);const OM=e=>!e.isLayoutDirty&&e.willUpdate(!1);function zM(){const e=new Set,t=new WeakMap,n=()=>e.forEach(OM);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const PM=e=>!0===e,RM=({children:e,id:t,inherit:n=!0})=>{const r=(0,s.useContext)(Fc),o=(0,s.useContext)(LM),[a,i]=function(){const e=function(){const e=(0,s.useRef)(!1);return Id(()=>(e.current=!0,()=>{e.current=!1}),[]),e}(),[t,n]=(0,s.useState)(0),r=(0,s.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,s.useCallback)(()=>Qa.postRender(r),[r]),t]}(),l=(0,s.useRef)(null),c=r.id||o;null===l.current&&((e=>PM(!0===e)||"id"===e)(n)&&c&&(t=t?c+"-"+t:c),l.current={id:t,group:PM(n)&&r.group||zM()});const u=(0,s.useMemo)(()=>({...l.current,forceRender:a}),[i]);return(0,j.jsx)(Fc.Provider,{value:u,children:e})},UM=(0,s.createContext)({}),BM=()=>(0,s.useContext)(UM),FM=(0,s.createContext)(null),QM=({children:e,activeItem:t=null,onChange:n,className:r,size:o="sm",orientation:a="horizontal",variant:i="pill",iconPosition:l="left",width:c="full"})=>{const u=Kh(),d=BM()?.activeItem||t,f=(0,s.useCallback)((e,t)=>{n&&n({event:e,value:t})},[n]);let p,m="rounded-full",h="p-1",g="ring-1 ring-tab-border";"vertical"===a?p="gap-0.5":("rounded"===i||"pill"===i)&&("xs"===o||"sm"===o?p="gap-0.5":("md"===o||"lg"===o)&&(p="gap-1")),"rounded"===i||"vertical"===a?m="rounded-md":"underline"===i&&(m="rounded-none",h="p-0",g="border-t-0 border-r-0 border-l-0 border-b border-solid border-tab-border","xs"===o?p="gap-0":"sm"===o?p="gap-2.5":("md"===o||"lg"===o)&&(p="gap-3"));const w=Se(`box-border [&>*]:box-border flex items-center ${"full"===c?"w-full":""} ${"vertical"===a?"flex-col":""}`,m,h,p,g,"underline"!==i?"bg-tab-background":"",r);return(0,j.jsx)("div",{className:w,children:(0,j.jsx)(FM.Provider,{value:{activeItem:d,onChange:f,size:o,variant:i,orientation:a,iconPosition:l,width:c},children:(0,j.jsx)(RM,{id:u,children:s.Children.map(e,e=>(0,s.isValidElement)(e)?s.cloneElement(e):null)})})})};QM.displayName="Tabs.Group";const VM=(0,s.forwardRef)(({slug:e,text:t,icon:n,className:r,disabled:o=!1,badge:a=null,...i},l)=>{const c=(0,s.useContext)(FM);if(!c)throw new Error("Tab should be used inside Tabs Group");const{activeItem:u,onChange:d,size:f,variant:p,orientation:m,iconPosition:h,width:g}=c,w={xs:"px-1.5 py-0.5 text-xs [&_svg]:size-3",sm:"underline"===p?"py-1.5 text-sm [&_svg]:size-4":"px-3 py-1.5 text-sm [&_svg]:size-4",md:"underline"===p?"py-2 text-base [&_svg]:size-5":"px-3.5 py-1.5 text-base [&_svg]:size-5",lg:"underline"===p?"p-2.5 text-lg [&_svg]:size-6":"px-3.5 py-1.5 text-lg [&_svg]:size-6"}[f],y=Se("relative border-none bg-transparent text-text-secondary cursor-pointer flex items-center justify-center transition-[box-shadow,color,background-color] duration-200","full"===g?"flex-1":"","vertical"===m?"w-full justify-between":"");let b="rounded-full";"rounded"===p?b="rounded-md":"underline"===p&&(b="rounded-none");const v=Se(y,"border-none",b,"hover:text-text-primary","focus:outline-none",w,u===e?"bg-background-primary text-text-primary shadow-sm":"",o?"text-text-disabled cursor-not-allowed hover:text-text-disabled":"",r),x=Se("flex items-center gap-1");return(0,j.jsxs)(vf.button,{ref:l,className:v,disabled:o,onClick:n=>{d(n,{slug:e,text:t})},...i,layoutRoot:!0,children:[u===e&&"underline"===p&&(0,j.jsx)(vf.span,{layoutId:"underline",layoutDependency:u,className:"absolute right-0 left-0 -bottom-px h-px bg-border-interactive"}),(0,j.jsxs)("span",{className:x,children:["left"===h&&n&&(0,j.jsx)("span",{className:"mr-1 contents center-center transition duration-150",children:n}),t,"right"===h&&n&&(0,j.jsx)("span",{className:"ml-1 contents center-center transition duration-150",children:n})]}),a&&(0,s.isValidElement)(a)&&a]})});VM.displayName="Tabs.Tab";const YM=({activeItem:e,children:t})=>(0,j.jsx)(UM.Provider,{value:{activeItem:e},children:t}),ZM=({slug:e,children:t})=>{const n=BM();if(!n)throw new Error("TabPanel should be used inside Tabs");return e===n.activeItem?(0,j.jsx)(j.Fragment,{children:t}):null};ZM.displayName="Tabs.Panel",YM.Group=QM,YM.Tab=VM,YM.Panel=ZM;const WM=function(){const[{current_ob:e}]=Yp(),[t,n]=(0,s.useState)(!1),r=()=>{n(!0)},o=()=>{n(!1)},a=e,l=e=>{let t=a?.product;return e&&t&&(Array.isArray(t)&&(t=a?.product[0]),e=(e=(e=(e=e.replace("{{product_name}}",t?.product_name)).replace("{{product_price}}",t?.display_price?t?.display_price:t?.original_price)).replace("{{product_desc}}",t?.product_desc)).replace("{{quantity}}",a?.quantity)),e},c=()=>(()=>{let e=a?.product;return Array.isArray(e)&&(e=a?.product[0]),"variable"===e?.type||!0===e?.is_variable})()?(0,i.createElement)("div",{className:"wcf-order-bump-choose-variation-preview"},(0,C.__)("Choose a variation","cartflows")):null,u=a?.position,d=Zm(l(a?.checkbox_label)||""),f=Zm(l(a?.hl_text)||""),p=Zm(l(a?.desc_text)||""),m=a?.show_arrow,h=a?.style,g=Zm(l(a?.title_text)||""),w=a?.action_element,y=a?.show_animation,b=a?.enable_show_image,v=a?.display_quantity_field,x="yes"===y?"wcf-blink":"",N=(0,i.createElement)("svg",{version:"1.1",className:`wcf-pointing-arrow ${x}`,id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"20px",height:"15px",fill:"red",viewBox:"310 253 90 70",enableBackground:"new 310 253 90 70"},(0,i.createElement)("g",null,(0,i.createElement)("g",null,(0,i.createElement)("path",{d:"M364.348,253.174c-0.623,0.26-1.029,0.867-1.029,1.54v18.257h-51.653c-0.919,0-1.666,0.747-1.666,1.666v26.658c0,0.92,0.747,1.666,1.666,1.666h51.653v18.327c0,0.673,0.406,1.28,1.026,1.54c0.623,0.257,1.34,0.116,1.816-0.36l33.349-33.238 c0.313-0.313,0.49-0.737,0.49-1.18c0-0.443-0.177-0.866-0.487-1.179l-33.349-33.335 C365.688,253.058,364.971,252.915,364.348,253.174z"})))),E=a?.bg_color,_=a?.border_style,M=a?.border_color,I=a?.box_border_width,S=a?.box_border_radius,k=a?.box_shadow_color,D=""!==a?.box_shadow_horizontal?a?.box_shadow_horizontal:0,j=""!==a?.box_shadow_vertical?a?.box_shadow_vertical:0,A=""!==a?.box_shadow_blur?a?.box_shadow_blur:0,T=""!==a?.box_shadow_spread?a?.box_shadow_spread:0,L=a?.label_color?a?.label_color:"#7a7a7a",O=a?.label_bg_color,z=a?.desc_text_color,P=a?.hl_text_color,R=a?.button_text_color,U=a?.button_text_hover_color,B=a?.button_color,F=a?.button_border_width,Q=a?.button_border_style,V=a?.button_border_color,Y=a?.button_border_radius,Z=a?.button_hover_color,W=a?.title_text_color,G=a?.label_border_style,H=a?.label_border_width,$=a?.label_border_radius,X=a?.label_border_color,q={background:E,borderStyle:_,borderColor:M,borderRadius:""!==S?S+"px":"4px",borderWidth:""!==I?I+"px":"1px",boxShadow:D+"px "+j+"px "+A+"px "+T+"px "+k};let J={},K={},ee={};"style-1"===h?(J={borderColor:M,borderBottomStyle:"inherit"!==_?_:"solid",background:O,borderWidth:I+"px"},q.borderStyle="inherit"!==_?_:"solid"):"style-2"===h?(J={borderColor:M,borderTopStyle:"inherit"!==_?_:"solid",background:O,borderWidth:I+"px"},q.borderStyle="inherit"!==_?_:"solid"):"style-3"===h?q.borderStyle="inherit"!==_?_:"solid":"style-4"===h?(q.borderStyle="inherit"!==_?_:"solid",ee={color:t?U:R,background:t?Z:B,borderWidth:""!==F?F+"px":"1px",borderStyle:"inherit"!==Q?Q:"none",borderColor:V,borderRadius:""!==Y?Y+"px":"3px"}):"style-5"===h&&(q.borderStyle="inherit"!==_?_:"",K={borderStyle:"inherit"!==G?G:"",borderWidth:H+"px",borderRadius:$+"px",borderColor:X,background:O,padding:O?"5px 10px":"5px 0"},ee={color:t?U:R,background:t?Z:B,borderWidth:""!==F?F+"px":"1px",borderStyle:"inherit"!==Q?Q:"solid",borderColor:V,borderRadius:""!==Y?Y+"px":"3px"});let te="",ne="left",re="auto";"yes"===b&&(te=a?.product_image,ne=a?.ob_image_position,re=""!==a?.ob_image_width?a?.ob_image_width+"px":"auto"),(0,s.useEffect)(()=>{const e=document.getElementById("wcf-order-bump-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")});return()=>{window.removeEventListener("scroll",n)}},[]);const oe=function(){let e="";return"yes"===v&&(e=(0,i.createElement)("div",{className:"wcf-ob-qty-selection-wrap"},(0,i.createElement)("span",{className:"wcf-ob-qty-selection-btn wcf-ob-qty-decrement wcf-ob-qty-change-icon"},"-"),(0,i.createElement)("input",{type:"number",className:"wcf-order-bump-quantity-updater",name:"wcf_order_bump_quantity",placeholder:"1",defaultValue:a?.quantity,min:"1"}),(0,i.createElement)("span",{className:"wcf-ob-qty-selection-btn wcf-ob-qty-increment wcf-ob-qty-change-icon"},"+"))),e};return(0,i.createElement)("div",{id:"wcf-order-bump-preview-wrapper",className:"wcf-order-bump-preview-wrapper"},(0,i.createElement)("div",{className:`wcf-bump-order-wrap wcf-bump-order-${h} wcf-${u} box-border`,style:q},function(){let e="";return"style-1"===h?e=(0,i.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ne} `},(0,i.createElement)("div",{className:"wcf-bump-order-field-wrap",style:J},"right"!==ne&&(0,i.createElement)("label",{style:{color:L}},"yes"===m&&N,(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,i.createElement)("span",{className:"wcf-bump-order-label"},d)),"right"===ne&&(0,i.createElement)("label",{style:{color:L}},(0,i.createElement)("span",{className:"wcf-bump-order-label"},d),(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===m&&N)),(0,i.createElement)("div",{className:"wcf-content-container"},""!==te&&"right"!==ne&&(0,i.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"!==re?re:""}},(0,i.createElement)("img",{src:te,className:"wcf-image",alt:(0,C.__)("Order Bump Product Image","cartflows")})),(0,i.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,i.createElement)("div",{className:"wcf-bump-order-offer"},(0,i.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:P}},f)),(0,i.createElement)("div",{className:"wcf-bump-order-desc",style:{color:z}},p),c(),oe()),""!==te&&"right"===ne&&(0,i.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"!==re?re:""}},(0,i.createElement)("img",{src:te,className:"wcf-image",alt:(0,C.__)("Order Bump Product Image","cartflows")})))):"style-2"===h?e=(0,i.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ne} `},(0,i.createElement)("div",{className:"wcf-bump-order-offer"},(0,i.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:P}},f)),(0,i.createElement)("div",{className:"wcf-content-container"},""!==te&&"right"!==ne&&(0,i.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"===re?"":re}},(0,i.createElement)("img",{src:te,className:"wcf-image",alt:(0,C.__)("Order Bump Product Image","cartflows")})),(0,i.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,i.createElement)("div",{className:"wcf-bump-order-desc",style:{color:z}},p),c(),oe()),""!==te&&"right"===ne&&(0,i.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"===re?"":re}},(0,i.createElement)("img",{src:te,className:"wcf-image",alt:(0,C.__)("Order Bump Product Image","cartflows")}))),(0,i.createElement)("div",{className:"wcf-bump-order-field-wrap",style:J},"right"!==ne&&(0,i.createElement)("label",{style:{color:L}},"yes"===m&&N,(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,i.createElement)("span",{className:"wcf-bump-order-label"},d)),"right"===ne&&(0,i.createElement)("label",{style:{color:L}},(0,i.createElement)("span",{className:"wcf-bump-order-label"},d),(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===m&&N))):"style-3"===h?e=(0,i.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ne} `},"right"!==ne&&(0,i.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==te&&"top"!==ne&&(0,i.createElement)("div",{className:"wcf-bump-order-action"},"yes"===m&&N,(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),""!==te&&(0,i.createElement)("div",{className:"wcf-bump-order-image",style:{maxWidth:"auto"!==re?re:""}},(0,i.createElement)("img",{src:te,className:"wcf-image",alt:(0,C.__)("Order Bump Product Image","cartflows")})),(0,i.createElement)("div",{className:"wcf-bump-order-text"},(0,i.createElement)("div",{className:"wcf-bump-order-label"},""===te&&(0,i.createElement)(i.Fragment,null,"yes"===m&&N,(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),""!==te&&"top"===ne&&(0,i.createElement)(i.Fragment,null,"yes"===m&&N,(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),(0,i.createElement)("label",{style:{color:W}},g)),(0,i.createElement)("div",{className:"wcf-bump-order-desc",style:{color:z}},p),c(),oe())),"right"===ne&&(0,i.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,i.createElement)("div",{className:"wcf-bump-order-text"},(0,i.createElement)("div",{className:"wcf-bump-order-label"},(0,i.createElement)("label",{style:{color:W}},g),""===te&&(0,i.createElement)(i.Fragment,null,"yes"===m&&N,(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}))),(0,i.createElement)("div",{className:"wcf-bump-order-desc",style:{color:z}},p),c(),oe()),""!==te&&(0,i.createElement)("div",{className:"wcf-bump-order-image",style:{maxWidth:"auto"!==re?re:""}},(0,i.createElement)("img",{src:te,className:"wcf-image",alt:(0,C.__)("Order Bump Product Image","cartflows")})),""!==te&&(0,i.createElement)("div",{className:"wcf-bump-order-action"},(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===m&&N))):"style-4"===h?e=(0,i.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ne} `},(0,i.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==te&&"right"!==ne&&(0,i.createElement)("div",{className:"wcf-bump-order-image"},(0,i.createElement)("img",{src:te,className:"wcf-image",style:{width:"auto"===re?"100px":re},alt:(0,C.__)("Order Bump Product Image","cartflows")})),"right"!==ne&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-bump-order-text"},(0,i.createElement)("div",{className:"wcf-bump-order-info"},(0,i.createElement)("div",{className:"wcf-bump-order-label"},(0,i.createElement)("label",{style:{color:W}},g)),(0,i.createElement)("div",{className:"wcf-bump-order-desc",style:{color:z}},p),c(),oe())),(0,i.createElement)("div",{className:"wcf-bump-order-action"},(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,i.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:r,onMouseLeave:o},(0,C.__)("Add","cartflows")))),"right"===ne&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-bump-order-action"},(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,i.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:r,onMouseLeave:o},(0,C.__)("Add","cartflows"))),(0,i.createElement)("div",{className:"wcf-bump-order-text"},(0,i.createElement)("div",{className:"wcf-bump-order-info"},(0,i.createElement)("div",{className:"wcf-bump-order-label"},(0,i.createElement)("label",{style:{color:W}},g)),(0,i.createElement)("div",{className:"wcf-bump-order-desc",style:{color:z}},p),c(),oe()))),""!==te&&"right"===ne&&(0,i.createElement)("div",{className:"wcf-bump-order-image"},(0,i.createElement)("img",{src:te,className:"wcf-image",style:{width:"auto"===re?"100px":re},alt:(0,C.__)("Order Bump Product Image","cartflows")})))):"style-5"===h&&(e=(0,i.createElement)("div",{className:"wcf-bump-order-content"},(0,i.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,i.createElement)("div",{className:`wcf-bump-order-info wcf-bump-order-image-${ne} `},""!==te&&"right"!==ne&&(0,i.createElement)("div",{className:"wcf-bump-order-image"},(0,i.createElement)("img",{src:te,className:"wcf-image",style:{width:re},alt:(0,C.__)("Order Bump Product Image","cartflows")})),(0,i.createElement)("div",{className:"wcf-bump-order-text"},""!==g&&(0,i.createElement)("div",{className:"wcf-bump-order-label",style:{color:W}},(0,i.createElement)("span",null,g)),""!==p&&(0,i.createElement)("div",{className:"wcf-bump-order-desc",style:{color:z}},p),c(),oe(),"checkbox"===w&&(0,i.createElement)("div",{className:"wcf-bump-order-action",style:K},"yes"===m&&N,(0,i.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,i.createElement)("label",{style:{color:L}},d)),"button"===w&&(0,i.createElement)("div",{className:"wcf-bump-order-action wcf-ob-action-button"},(0,i.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:r,onMouseLeave:o},(0,C.__)("Add","cartflows")))),""!==te&&"right"===ne&&(0,i.createElement)("div",{className:"wcf-bump-order-image"},(0,i.createElement)("img",{src:te,className:"wcf-image",style:{width:re},alt:(0,C.__)("Order Bump Product Image","cartflows")})))))),e}()))};function GM({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"}))}const HM=s.forwardRef(GM);function $M({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"}))}const XM=s.forwardRef($M);function qM({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42"}))}const JM=s.forwardRef(qM);function KM({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z"}),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const eI=s.forwardRef(KM),tI=()=>{const[{flow_id:e,step_id:t,current_ob:n},r]=Yp(),[,o]=f();return{saveOrderBump:(0,s.useCallback)(()=>{o({status:"PROCESSING"});const a=document.querySelector(".wcf-slide-out-panel--form, .wcf-step-settings-view");if(!a)return o({status:"RESET"}),Promise.resolve(!1);if(null===n)return o({status:"SAVED"}),Promise.resolve(!0);if("undefined"!=typeof tinymce){const e=tinymce.get("wcf-order-bump-desc-editor");e&&e.save()}const i=new window.FormData(a),s=n.id;return i.append("action","cartflows_pro_save_order_bump_settings"),i.append("security",cartflows_admin.save_order_bump_settings_nonce),i.append("post_id",e),i.append("step_id",t),i.append("ob_id",s),qf()({url:cartflows_admin.ajax_url,method:"POST",body:i}).then(e=>{if(e.data&&e.data.success){const e=new window.FormData;return e.append("action","cartflows_pro_get_current_order_bump"),e.append("security",cartflows_admin.get_current_order_bump_nonce),e.append("ob_id",s),e.append("step_id",t),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>(e.data&&e.data.success&&e.data.current_ob&&r({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:s}),o({status:"SAVED"}),window.wcfUnsavedChanges=!1,!0))}return o({status:"RESET"}),!1}).catch(e=>(console.error(e),o({status:"RESET"}),!1))},[e,t,n,r,o])}},nI=function(e){const[{step_id:t,options:n,current_ob:r},o]=Yp(),[a,l]=(0,s.useState)("product"),c=new URLSearchParams((0,h.useLocation)().search),u=e.ob_id,d=c.get("obtab"),f=Oh(),{saveOrderBump:p}=tI();!function(){const[{current_ob:e},t]=Yp(),n=function(n){const{name:r,value:o}=n.detail;if(r.includes("[")){const n=r.split("["),a=[];for(let e=1;e<n.length;e++)a.push(n[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=e[i];switch(a.length){case 2:s[a[0]][a[1]]=o;break;case 4:s[a[0]][a[1]][a[2]][a[3]]=o}t({type:"SET_OB_OPTION",name:i,value:s})}void 0!==e&&(window.wcfUnsavedChanges=!0,t({type:"SET_OB_OPTION",name:r,value:o}))},r=[{type:"select"},{type:"select2"},{type:"checkbox"},{type:"text"},{type:"textarea"},{type:"code"},{type:"number"},{type:"radio"},{type:"color"},{type:"font"},{type:"product"},{type:"coupon"},{type:"image-selector"},{type:"wpeditor"},{type:"toggle"},{type:"selectioncard"}];(0,s.useEffect)(()=>(e&&r.map(function(e){return document.addEventListener(`wcf:${e.type}:change`,n),""}),()=>{r.map(function(e){return document.removeEventListener(`wcf:${e.type}:change`,n),""})}),[e])}();const m=[{name:(0,C.__)("Product","cartflows"),slug:"product",icon:(0,i.createElement)(HM,{className:"w-18 h-18 stroke-2"})},{name:(0,C.__)("Content","cartflows"),slug:"content",icon:(0,i.createElement)(XM,{className:"w-18 h-18 stroke-2"})},{name:(0,C.__)("Styles","cartflows"),slug:"styles",icon:(0,i.createElement)(JM,{className:"w-18 h-18 stroke-2"})},{name:(0,C.__)("Conditions","cartflows"),slug:"conditions",icon:(0,i.createElement)(eI,{className:"w-18 h-18 stroke-2"})}];if((0,s.useEffect)(()=>((async()=>{!function(){const e=new window.FormData;e.append("action","cartflows_pro_get_current_order_bump"),e.append("security",cartflows_admin.get_current_order_bump_nonce),e.append("ob_id",u),e.append("step_id",t),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.data.success&&o({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:u})})}(),null!==n&&"undefined"!==n||qf()({path:`/cartflows/v1/admin/step-data/${t}`}).then(e=>{if(e.billing_fields){const t=Object.entries(e.billing_fields.fields).map(([e,t])=>({...t,key:e}));e.billing_fields=t}if(e.shipping_fields){const t=Object.entries(e.shipping_fields.fields).map(([e,t])=>({...t,key:e}));e.shipping_fields=t}o({type:"SET_STEP_DATA",data:e})})})(),()=>{}),[]),null===r||"undefined"===r){let e="";switch(d){case"design":case"content":e=(0,i.createElement)(Ng,null);break;case"product":default:e=(0,i.createElement)(xg,null);break;case"settings":e=(0,i.createElement)(Eg,null);break;case"conditions":e=(0,i.createElement)(Sg,null)}return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(zm,{containerType:"flex",direction:"column",className:"wcf-page-wrapper wcf-order-bump-page-wrapper"},e))}if(r&&u!==r.id)return"";return(0,i.createElement)(zm,{containerType:"flex",direction:"column",gap:"md",className:"wcf-order-bump-page-wrapper p-6 bg-background-secondary rounded-b-lg"},(0,i.createElement)("div",{className:"wcf-order-bump-content-tab__preview"},(0,i.createElement)(WM,null)),(0,i.createElement)(YM.Group,{variant:"pill",size:"sm",width:"full",activeItem:a,onChange:({value:e})=>async function(e){e!==a?(await async function(){return!!window.wcfUnsavedChanges&&await f({title:(0,C.__)("Save Changes","cartflows"),description:(0,C.__)("You have made changes. Do you want to save the changes?","cartflows"),actionBtnText:(0,C.__)("Save","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows"),onConfirm:p})}()||l(e),window.wcfUnsavedChanges=!1):l(e)}(e.slug),className:"wcf-order-bump--tabs-wrapper mt-8 mb-4"},m.map(e=>(0,i.createElement)(YM.Tab,{key:e.slug,slug:e.slug,text:e.name,icon:e.icon}))),function(){let e=(0,i.createElement)("h1",null,"404 Not Found");switch(a){case"styles":e=(0,i.createElement)(IM,null);break;case"product":default:e=(0,i.createElement)(DM,null);break;case"content":e=(0,i.createElement)(CM,null);break;case"conditions":e=(0,i.createElement)(TM,null)}return(0,i.createElement)(i.Fragment,null,e)}())},rI=function(e){const{flow_id:t,step_id:n,data:r,callback:o,dispatch:a,onEditClick:l}=e,[{},c]=Yp(),u=a||c,[d,f]=(0,s.useState)(r.status),[p,m]=(0,s.useState)(!1),[h,g]=(0,s.useState)(""),[w,y]=(0,s.useState)(!1),[b,v]=(0,s.useState)(!1),x=(0,s.createRef)(),[N,E]=(0,s.useState)(""),_=Oh();(0,s.useEffect)(()=>{f(d)},[d,N]);let M=r.title;const I=function(e){e.preventDefault(),y(!0)},S=function(e){e.preventDefault(),y(!1)};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-order-bump border-b border-border-subtle border-solid border-0 last:border-0",onDragEnd:o},(0,i.createElement)(zm,{containerType:"flex",align:"center",className:"wcf-order-bump__content-wrapper relative p-6 text-sm gap-2"},(0,i.createElement)("div",{className:"wcf-order-bump__data wcf-column--product w-[70%]"},(0,i.createElement)("div",{className:"wcf-order-bump__data-title flex items-center gap-2"},(0,i.createElement)("span",{className:"text-sm font-medium text-text-primary flex gap-2 justify-center items-center"},function(){""===M&&(M=(0,C.__)("(no title)","cartflows"));let e=um(M,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),t=(0,i.createElement)(Wo,{content:(0,C.__)("Edit Step Name","cartflows"),placement:"bottom"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)(Gh,{className:"w-4 h-4 stroke-1"}),onClick:I,className:"wcf-ob-header__title--edit"}));return w&&(e=(0,i.createElement)(tg,{size:"sm",ref:x,defaultValue:M,className:"new-step-title focus:!ring-0 focus:!ring-offset-0"}),t=(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"primary",size:"xs",loading:b,onClick:()=>function(e){v(!0);const t=x.current.value,r=new window.FormData;r.append("action","cartflows_pro_update_order_bump_title"),r.append("security",cartflows_admin.update_order_bump_title_nonce),r.append("step_id",n),r.append("new_title",t),r.append("ob_id",e),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{u({type:"SET_OB_TITLE",title:t,name:"wcf-order-bumps",ob_id:e}),v(!1),y(!1),hm.success((0,C.__)("Order bump title updated!","cartflows"))})}(r.id)},(0,C.__)("Save","cartflows")),(0,i.createElement)(Ro,{variant:"secondary",size:"xs",onClick:S},(0,C.__)("Cancel","cartflows")))),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"wcf-ob-header__title--text"},e),(0,i.createElement)("span",{className:"wcf-ob-header__title--buttons flex gap-2"},t))}()),""===r.product&&(0,i.createElement)(Lf,{label:(0,C.__)("No product","cartflows"),variant:"warning",icon:(0,i.createElement)(Ph,{className:"w-4 h-4"}),size:"xs"}))),(0,i.createElement)(zm,{containerType:"flex",gap:"xs",className:"wcf_order_bump__status w-[12%]"},(0,i.createElement)(Pg,{value:d,size:"md",onChange:()=>function(e){m(!0);const r=new window.FormData;r.append("action","cartflows_pro_update_order_bump_status"),r.append("security",cartflows_admin.update_order_bump_status_nonce),r.append("ob_id",e),r.append("post_id",t),r.append("step_id",n),r.append("ob_status",!d),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{u({type:"SET_OB_STATUS",name:"wcf-order-bumps",newStatus:!d,ob_id:e}),f(!d),m(!1),hm.success(d?(0,C.__)("Order bump disabled!","cartflows"):(0,C.__)("Order bump enabled!","cartflows"))})}(r.id),disabled:p}),p&&(0,i.createElement)(Kg,{size:"sm",variant:"primary"})),(0,i.createElement)(zm,{containerType:"flex",justify:"between",className:"wcf-order-bump__action wcf-column--actions w-[12%]"},(0,i.createElement)(Wo,{content:(0,C.__)("Duplicate Order Bump","cartflows"),placement:"bottom"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:"clone"===h?(0,i.createElement)(Kg,{size:"sm"}):(0,i.createElement)(Gm,{className:"w-4 h-4 stroke-1"}),onClick:()=>(e=>{const t=new window.FormData;g("clone"),t.append("action","cartflows_pro_clone_order_bump"),t.append("security",cartflows_admin.clone_order_bump_nonce),t.append("ob_id",e),t.append("step_id",n),qf()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{e.success&&(u({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}),g(""),hm.success((0,C.__)("Order bump cloned!","cartflows")))})})(r.id),className:"wcf-clone-bump-button"})),(0,i.createElement)(Wo,{content:(0,C.__)("Edit Order Bump","cartflows"),placement:"bottom"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)(eI,{className:"w-4 h-4 stroke-1"}),onClick:()=>{return e=r.id,void("function"!=typeof l?E(!N&&e?e:""):l(e));var e},className:"wcf-setting-bump-button "+(N===r.id?"!bg-brand-50 !text-brand-500":"")})),(0,i.createElement)(Wo,{content:(0,C.__)("Delete Order Bump","cartflows"),placement:"bottom"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:"delete"===h?(0,i.createElement)(Kg,{size:"sm"}):(0,i.createElement)($m,{className:"w-4 h-4 stroke-1"}),onClick:()=>async function(e){if(!await _({title:(0,C.__)("Trash Order Bump","cartflows"),description:(0,C.__)("Do you really want to trash this order bump permanently?","cartflows"),actionBtnText:(0,C.__)("Trash","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")}))return;g("delete");const r=new window.FormData;r.append("action","cartflows_pro_delete_order_bump"),r.append("security",cartflows_admin.delete_order_bump_nonce),r.append("ob_id",e),r.append("post_id",t),r.append("step_id",n),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(t=>{t.success&&(u({type:"REMOVE_ORDER_BUMP",name:"wcf-order-bumps",ob_id:e}),g(""),hm.success((0,C.__)("Order bump deleted!","cartflows")))})}(r.id),className:"wcf-remove-order-bump-button"}))))),N&&(0,i.createElement)(nI,{ob_id:N}))},oI=function(){return(0,i.createElement)("div",{className:"wcf-multiple-order-bumps is-placeholder"},(0,i.createElement)("div",{className:"wcf-multiple-order-bumps__add-new"},(0,i.createElement)("span",{className:"wcf-add-new-order-bump wcf-button--primary"})),(0,i.createElement)("div",{className:"wcf-multiple-order-bumps__header"},(0,i.createElement)("div",{className:"wcf-column wcf-column--title"},"Title"),(0,i.createElement)("div",{className:"wcf-column wcf-column--status"},"Status"),(0,i.createElement)("div",{className:"wcf-column wcf-column--actions"},"Actions")),(0,i.createElement)("div",{className:"wcf-multiple-order-bumps__content"},(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-order-bump"},(0,i.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,i.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,i.createElement)("div",{className:"wcf-order-bump__data-title"},(0,i.createElement)("span",{title:"ob"}))),(0,i.createElement)("div",{className:"wcf_order_bump__status"},(0,i.createElement)("span",{className:"wcf-ob-status"})),(0,i.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,i.createElement)("span",{title:"Edit Order Bump"}))))),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-order-bump"},(0,i.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,i.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,i.createElement)("div",{className:"wcf-order-bump__data-title"},(0,i.createElement)("span",{title:"ob"}))),(0,i.createElement)("div",{className:"wcf_order_bump__status"},(0,i.createElement)("span",{className:"wcf-ob-status"})),(0,i.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,i.createElement)("span",{title:"Edit Order Bump"})))))))},aI=window.wp.compose,iI=window.wp.data,sI=(0,aI.compose)((0,iI.withDispatch)(e=>{const{updateCFProStatus:t}=e("wcf/importer");return{updateCFProStatus(e){t(e)}}}))(({title:e,updateCFProStatus:t})=>{const n=e||(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
17 -(0,C.__)("Activate %s","cartflows"),cartflows_admin.cf_pro_type_inactive),[r,o]=(0,s.useState)({isProcessing:!1,buttonText:n}),{isProcessing:a,buttonText:l}=r;return(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:a,disabled:a,onClick:e=>{e.preventDefault(),o({isProcessing:!0,buttonText:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
18 -(0,C.__)("Activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}),Jf({slug:"cartflows-pro",init:"cartflows-pro/cartflows-pro.php",name:"cartflows-pro"}).then(e=>{console.log(e),o({isProcessing:!1,buttonText:(0,C.__)("Successfully Activated!","cartflows")}),setTimeout(()=>{t("active")},3e3)}).catch(e=>{console.log(e),o({isProcessing:!1,buttonText:(0,C.__)("Failed! Activation!","cartflows")})})}},l)))}),lI=({buttonLink:e,title:t,buttonStyle:n="primary"})=>{const r=t||(0,C.__)("Upgrade to Cartflows Pro","cartflows"),o=e?.buttonLink||getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans);return(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(Ro,{tag:"a",href:o,target:"_blank",rel:"noreferrer",variant:n,size:"md",className:"no-underline"},r)))};function cI({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const uI=s.forwardRef(cI),dI=({title:e})=>{const t=e||"Activate Cartflows Pro License";return(0,i.createElement)(Ro,{tag:"a",href:cartflows_admin?.license_popup_url,rel:"noreferrer",variant:"primary",size:"md",icon:(0,i.createElement)(uI,null),iconPosition:"right",className:"no-underline"},t)},fI=({buttonLink:e,ctaText:t}={})=>{const[{license_status:n}]=f(),r=t||(0,C.__)("Upgrade to CartFlows Pro","cartflows"),o=new URLSearchParams((0,h.useLocation)().search).get("tab"),a=cartflows_admin.cf_pro_status;return wcfCartflowsTypePro()||"inactive"!==a||"pro"!==wcfInactivepluginType()?wcfCartflowsTypePlusPro()?"Activated"!==n?"analytics"===o?(0,i.createElement)(lI,{buttonLink:e,title:r}):(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(dI,{title:(0,C.__)("Activate the License","cartflows")}))):null:wcfInactiveProPlus()?(0,i.createElement)(sI,null):(0,i.createElement)(lI,{buttonLink:e,title:r}):(0,i.createElement)(sI,null)},pI=({title:e,description:t,buttonLink:n,className:r=""})=>(0,i.createElement)("div",{className:r},(0,i.createElement)(zm,{direction:"row",align:"stretch",gap:"xs",className:"bg-brand-25 border border-solid border-brand-200 rounded-lg p-3 shadow-sm"},(0,i.createElement)(zm,{direction:"row",align:"center",gap:"xs",className:"flex-1"},(0,i.createElement)(zm,{direction:"column",gap:"xs",className:"flex-1"},(0,i.createElement)(Vm,{size:14,weight:600,color:"primary",lineHeight:20},e),(0,i.createElement)(Vm,{size:14,weight:400,color:"secondary",lineHeight:20},t)),(0,i.createElement)(zm,{align:"center",gap:"xs",className:"shrink-0"},(0,i.createElement)(fI,{buttonLink:n}))))),mI=(e="pro")=>{const[{license_status:t}]=f();return!("plus-pro"===e?wcfCartflowsTypePlusPro():wcfCartflowsPro())||"Activated"!==t},hI=function({orderBumps:e,stepId:t,flowId:n,pageSettings:r,onChange:o,onEditClick:a,hideDocLink:l=!1,hideAddControl:c=!1}={}){const[u,d]=Yp(),f=Array.isArray(e),p=f?null:u?.options,m=f?t:u?.step_id,h=f?n:u?.flow_id,g=f?r:u?.page_settings,w=f?e=>o?.(e):d,y=mI("plus-pro"),[b,v]=(0,s.useState)(),[x,N]=(0,s.useState)(""),E=(0,C.__)("Add","cartflows"),[_,M]=(0,s.useState)({button_text:E,is_processing:!1}),{button_text:I,is_processing:S}=_;if(y)return(0,i.createElement)(pI,{title:(0,C.__)("Add Extra Revenue to Every Checkout Effortlessly","cartflows"),description:(0,C.__)("Show a perfectly timed add-on offer at checkout. Customers buy more in one click — zero extra steps, zero coding needed.","cartflows")});if(!f&&(null===p||"undefined"===g))return(0,i.createElement)(oI,null);const k=g,D=f?e:p["wcf-order-bumps"],j=D?Object.keys(D).length:0,A=g?.settings?.["multiple-order-bump-design"],T=()=>{const t=f?e:p["wcf-order-bumps"];if(!t)return;const n=[];Object.keys(t).map(e=>(n.push(t[e].id),""));const r=new window.FormData;r.append("action","cartflows_pro_reorder_order_bumps"),r.append("security",cartflows_admin.reorder_order_bumps_nonce),r.append("step_id",m),r.append("sorted_obs",n),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{})};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(zm,{containerType:"flex",direction:"column",gap:"sm",className:"wcf-multiple-order-bumps--wrapper"},j>0&&(0,i.createElement)("div",{className:"wcf-multiple-order-bumps border border-solid border-border-subtle sm:mx-0 sm:rounded-lg"},(0,i.createElement)(zm,{containerType:"flex",direction:"row",className:"wcf-multiple-order-bumps__header border-b border-solid border-border-subtle border-0 bg-background-secondary px-6 py-4 gap-2 text-left sm:rounded-t-lg"},(0,i.createElement)(Vm,{as:"span",size:"sm",weight:500,className:"wcf-column wcf-column--title w-[70%]"},(0,C.__)("Title","cartflows")),(0,i.createElement)(Vm,{as:"span",size:"sm",weight:500,className:"wcf-column wcf-column--status w-[13%]"},(0,C.__)("Status","cartflows")),(0,i.createElement)(Vm,{as:"span",size:"sm",weight:500,className:"wcf-column wcf-column--actions w-[12%] sr-only"},(0,C.__)("Actions","cartflows"))),(0,i.createElement)("div",{className:"wcf-multiple-order-bumps__content"},D&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Zp.ReactSortable,{list:D,setList:e=>w({type:"SET_OB",obs:e,fieldName:"wcf-order-bumps",step_id:m,flow_id:h}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-order-bump",filter:".wcf-order-bump__action, .wcf_order_bump__status, .wcf-order-bump__data-title a",preventOnFilter:!1},D.map(e=>(0,i.createElement)(rI,{key:e.id,flow_id:h,step_id:m,data:e,title:e.title,settings:k?.settings?.["multiple-order-bump"],design_settings:A,callback:T,dispatch:f?w:void 0,onEditClick:a})))))),0===j&&(0,i.createElement)("div",{className:"border border-border-subtle border-solid bg-gray-25 rounded-md px-5 py-5 text-sm text-text-secondary text-center"},(0,C.__)("Create an order bump.","cartflows")),!c&&(0,i.createElement)(zm,{containerType:"flex",gap:"sm",className:"wcf-multiple-order-bumps__add-new mt-5"},(0,i.createElement)("div",{className:"flex-1 flex flex-col gap-1"},(0,i.createElement)(tg,{size:"md",value:b||"",onChange:v,placeholder:(0,C.__)("Enter order bump name","cartflows"),error:!!x,className:"focus:!ring-0 focus:!ring-offset-0"}),x&&(0,i.createElement)("span",{className:"text-sm font-normal text-brand-500"},x)),(0,i.createElement)(Ro,{variant:"outline",icon:(0,i.createElement)(yg,{className:"w-4 h-4 stroke-1"}),iconPosition:"left",loading:S,disabled:S,onClick:function(e){if(e.preventDefault(),void 0!==b){N(""),M({button_text:(0,C.__)("Adding…","cartflows"),is_processing:!0});const t={title:b,id:Math.random().toString(36).substring(2,5)},n=new window.FormData;n.append("action","cartflows_pro_add_order_bump"),n.append("security",cartflows_admin.add_order_bump_nonce),n.append("ob_id",t.id),n.append("post_id",h),n.append("step_id",m),n.append("title",b),qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(t=>{t.success&&(w({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:t.data.order_bumps}),v(""),M({button_text:E,is_processing:!1}),hm.success((0,C.__)("Order bump added!","cartflows"))),e.target.blur()})}else N((0,C.__)("Please enter the order bump title","cartflows")),e.target.blur()},className:"wcf-add-new-order-bump font-normal h-fit"},I))),!l&&(0,i.createElement)(F_,{content:(0,C.sprintf)(
19 -// translators: %1$s: link html start, %2$s: link html end
20 -// translators: %1$s: link html start, %2$s: link html end
21 -(0,C.__)("For more information about order bump settings please %1$sClick here.%2$s","cartflows"),'<a href="https://cartflows.com/docs/how-to-add-order-bumps-to-woocommerce-sales-funnel" class="text-brand-500 hover:text-brand-600 no-underline" target="_blank">',"</a>")}))},gI=function({stepId:e,flowId:t,flowType:n,initialBumps:r,onCountChange:o}){const[a,l]=(0,s.useState)(Array.isArray(r)?r:[]),[c,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(""),[p,m]=(0,s.useState)(""),[g,w]=(0,s.useState)(!1),y=(0,h.useHistory)(),b=mI("plus-pro");(0,s.useEffect)(()=>{Array.isArray(r)&&l(r)},[r]),(0,s.useEffect)(()=>{o?.(a.length)},[a.length]);const v=(0,s.useCallback)(e=>{if(e&&"object"==typeof e)switch(e.type){case"UPDATE_ORDER_BUMP":Array.isArray(e.order_bumps)&&l(e.order_bumps);break;case"SET_OB":Array.isArray(e.obs)&&l(e.obs);break;case"SET_OB_STATUS":l(t=>t.map(t=>t.id===e.ob_id?{...t,status:e.newStatus}:t));break;case"SET_OB_TITLE":l(t=>t.map(t=>t.id===e.ob_id?{...t,title:e.title}:t));break;case"REMOVE_ORDER_BUMP":l(t=>t.filter(t=>t.id!==e.ob_id));break;case"SET_OB_PRODUCT":l(t=>t.map(t=>t.id===e.ob_id?{...t,product:e.product}:t))}},[]),x=(0,s.useCallback)(r=>{const o=`?page=cartflows&path=${"storeCheckout"===n?"store-checkout":"flows"}&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps&ob_id=${r}`;y?.push&&y.push({pathname:"admin.php",search:o})},[n,t,e,y]),N=()=>{g||(u(!1),f(""),m(""))},E=()=>{const n=(d||"").trim();if(""===n)return void m((0,C.__)("Please enter the order bump title","cartflows"));m(""),w(!0);const r=new window.FormData;r.append("action","cartflows_pro_add_order_bump"),r.append("security",cartflows_admin.add_order_bump_nonce);const o=window.crypto&&"function"==typeof window.crypto.randomUUID?window.crypto.randomUUID():Math.random().toString(36).slice(2,12)+Math.random().toString(36).slice(2,12);r.append("ob_id",o),r.append("post_id",t),r.append("step_id",e),r.append("title",n),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>{e?.success?(v({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}),hm.success((0,C.__)("Order bump added!","cartflows")),u(!1),f("")):m((0,C.__)("Failed to add order bump.","cartflows"))}).catch(()=>{m((0,C.__)("Failed to add order bump.","cartflows"))}).finally(()=>{w(!1)})};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(hI,{orderBumps:a,stepId:e,flowId:t,pageSettings:null,onChange:v,onEditClick:x,hideDocLink:!0,hideAddControl:!0}),!b&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("button",{type:"button",onClick:()=>u(!0),className:"wcf-add-order-bump-trigger w-full mt-2.5 py-2.5 flex items-center justify-center gap-1 border border-solid border-border-subtle rounded-lg bg-transparent text-sm font-medium text-text-secondary hover:text-text-primary hover:border-border-strong cursor-pointer"},(0,i.createElement)(yg,{className:"w-4 h-4 stroke-2"}),(0,C.__)("Add Order Bump","cartflows")),(0,i.createElement)(bh,{open:c,setOpen:e=>{e||N()},exitOnClickOutside:!1},(0,i.createElement)(bh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(bh.Title,null,(0,C.__)("Order Bump","cartflows")),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,null,(0,i.createElement)("label",{htmlFor:"wcf-add-order-bump-title",className:"block text-sm font-medium text-text-primary mb-2"},(0,C.__)("Order Bump Name","cartflows")),(0,i.createElement)(tg,{id:"wcf-add-order-bump-title",type:"text",size:"md",value:d,onChange:e=>{f(e),p&&m("")},placeholder:(0,C.__)("Enter Order Bump name","cartflows"),error:!!p,onKeyDown:e=>{"Enter"!==e.key||g||(e.preventDefault(),E())}}),(0,i.createElement)("p",{className:"flex items-center gap-1 text-xs font-normal text-text-tertiary mt-2 m-0"},(0,i.createElement)(vg,{className:"w-3.5 h-3.5 stroke-2"}),(0,C.__)("Configure product and settings after creation.","cartflows")),p&&(0,i.createElement)("p",{className:"text-sm font-normal text-brand-500 mt-2 m-0"},p)),(0,i.createElement)(bh.Footer,{className:"flex gap-3 justify-end"},(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:N,disabled:g},(0,C.__)("Cancel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:E,loading:g,disabled:g},(0,C.__)("Add Order Bump","cartflows")))))))},wI=function({stepId:e,flowId:t,flowType:n,initialBumps:r=[]}){const[o,a]=(0,s.useState)(!0),[l,c]=(0,s.useState)(r.length),u=(0,s.useCallback)(e=>{c(e)},[]);return(0,i.createElement)("div",{className:"wcf-order-bump-section px-4 py-4 border-t border-solid border-border-subtle border-0"},(0,i.createElement)("div",{className:"flex items-center justify-between"},(0,i.createElement)("div",{className:"flex items-center gap-1.5"},(0,i.createElement)(mg,{className:"w-4 h-4 text-text-primary stroke-1"}),(0,i.createElement)(Vm,{as:"span",size:14,weight:400,color:"primary"},(0,C.__)("Order Bumps","cartflows")," ",(0,i.createElement)("span",{className:"text-text-primary font-normal"},"(",l,")"))),(0,i.createElement)(Ro,{variant:"link",size:"xs",icon:o?(0,i.createElement)(gg,{className:"w-3.5 h-3.5 stroke-2"}):(0,i.createElement)(Lp,{className:"w-3.5 h-3.5 stroke-2"}),iconPosition:"right",onClick:()=>a(!o)},o?(0,C.__)("Hide","cartflows"):(0,C.__)("Show","cartflows"))),o&&(0,i.createElement)("div",{className:"mt-2.5"},(0,i.createElement)(gI,{stepId:e,flowId:t,flowType:n,initialBumps:r,onCountChange:u})))},yI=function(e){const[{is_cf_pro:t,global_checkout:n,flow_id:r,flow_type:o}]=Yp(),{id:a,title:s,type:l,actions:c,menu_actions:u,offer_yes_next_step:d,offer_no_next_step:f,invalid:p=!1,step_disabled:m=!1,setShowAbtestUpgradePopup:h=()=>{},order_bumps:g=[]}=e,w=!!p,b=a;"storeCheckout"===o&&(["checkout"].includes(l)&&(delete u.clone,w||delete u.delete),w&&(delete u.clone,delete u.abtest));let v=!1,x=!1,N=[],E=[],_=0;wcfCartflowsTypePro()&&(v=!!e["ab-test-ui"]&&e["ab-test-ui"],x=!!e["ab-test-start"]&&e["ab-test-start"],N=e["ab-test-variations"]?e["ab-test-variations"]:[],E=e["ab-test-archived-variations"]?e["ab-test-archived-variations"]:[],_=N.length,_<2&&(v=!1));let M="";"storeCheckout"===o&&w&&(M+=" invalid-step wcf-store-checkout pointer-events-none touch-none"),v&&(M+=" wcf-ab-test flex flex-col items-center"),wcfCartflowsTypePlusPro()||"upsell"!==l&&"downsell"!==l||(M+=" invalid-step pro-inactive pointer-events-none touch-none !bg-background-secondary !text-text-disabled !border-0"),m&&!v&&(M+=" invalid-step step-disabled touch-none !bg-background-secondary !text-text-disabled !border-0");const I={is_cf_pro:t,global_checkout:n,flow_id:r,ab_test_ui:v,control_id:b,step_id:a,type:l,title:s,actions:Object.values(c),menu_actions:Object.values(u),has_product_assigned:e.is_product_assigned,offer_yes_next_step:d,offer_no_next_step:f,ab_test_archived_variations:E,invalidStep:w,setShowAbtestUpgradePopup:h,step_disabled:m};return(0,i.createElement)("div",{className:"wcf-step-wrap box-border bg-background-primary border border-solid border-border-subtle shadow-sm rounded-lg overflow-hidden"+M,id:a},v&&(0,i.createElement)(og,{flow_id:r,control_id:b,step_id:a,abvariations:N,ab_test_start:x}),function(){let e="";if(I.step_id=a,v&&_>1){let t=0;e=N.map(e=>(b!==e.id&&++t,I.is_variation=!0,I.control_id=b,I.step_id=e.id,I.title=e.title,I.actions=Object.values(e.actions),I.menu_actions=Object.values(e.menu_actions),I.has_product_assigned=e.is_product_assigned,I.var_badge_count=t,I.offer_yes_next_step=e.offer_yes_next_step,I.offer_no_next_step=e.offer_no_next_step,I.offer_yes_step_id=e.offer_yes_step_id,I.offer_no_step_id=e.offer_no_step_id,I.step_disabled=e.step_disabled,(0,i.createElement)(Jh,(0,y.A)({},I,{key:e.id}))))}else e=(0,i.createElement)(Jh,I);return e}(),function(){if(v&&E.length>0){const e={flow_id:r,control_id:b,type:l,archived_variations:E};return(0,i.createElement)(fg,e)}}(),"checkout"===l&&wcfCartflowsPro()&&(0,i.createElement)(wI,{stepId:a,flowId:r,flowType:o,initialBumps:Array.isArray(g)?g:[]}))},bI=({variant:e="rectangular",className:t,...n})=>{const r={circular:"rounded-full bg-gray-200 ",rectangular:"rounded-md bg-gray-200"}[e],o={circular:"size-10",rectangular:"w-96 h-3"}[e];return(0,j.jsx)("div",{className:Se(r,"animate-pulse",o,t),...n})},vI=function(){return(0,i.createElement)("div",{className:"w-full"},Array(3).fill().map((e,t)=>(0,i.createElement)("div",{key:t,className:"wcf-step-wrap bg-background-primary border border-border-subtle shadow-sm rounded-lg mb-4 p-4 flex items-center gap-4"},(0,i.createElement)("div",{className:"flex"},(0,i.createElement)(bI,{className:"w-3 h-10 rounded"})),(0,i.createElement)(bI,{className:"w-[72px] h-[72px] rounded-lg flex-shrink-0"}),(0,i.createElement)("div",{className:"flex flex-col gap-2 w-[40%]"},(0,i.createElement)(bI,{className:"h-3 w-24 rounded-md"}),(0,i.createElement)(bI,{className:"h-4 w-48 rounded-md"})),(0,i.createElement)("div",{className:"flex items-center justify-around w-[35%] gap-4"},[1,2,3].map(e=>(0,i.createElement)("div",{key:e,className:"flex flex-col gap-2 items-center"},(0,i.createElement)(bI,{className:"h-3 w-16 rounded-md"}),(0,i.createElement)(bI,{className:"h-4 w-8 rounded-md"})))),(0,i.createElement)("div",{className:"flex items-center gap-2 ml-auto"},[1,2,3,4].map(e=>(0,i.createElement)(bI,{key:e,variant:"circular",className:"size-8"}))))))};function xI({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 0 0-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 0 0-16.536-1.84M7.5 14.25 5.106 5.272M6 20.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm12.75 0a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"}))}const NI=s.forwardRef(xI);function EI({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const _I=s.forwardRef(EI);function MI({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const II=s.forwardRef(MI),SI=function(){return(0,i.createElement)("div",{className:"wcf-design-page is-placeholder"},(0,i.createElement)("div",{className:"wcf-design-page__content"},(0,i.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},(0,i.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,i.createElement)("div",{className:"wcf-design-page__customize"},(0,i.createElement)("div",{className:"wcf-design-page__button"}),(0,i.createElement)("div",{className:"wcf-design-page__button"})),(0,i.createElement)("div",{className:"wcf-design-page__text"},(0,i.createElement)("div",{className:"title wcf-placeholder__width--60"})),(0,i.createElement)("div",{className:"wcf-design-page__WPeditor"},(0,i.createElement)("div",{className:"title wcf-placeholder__width--80"}))),(0,i.createElement)("div",{className:"wcf-design-page__settings"},(0,i.createElement)("div",{className:"title"}),(0,i.createElement)("div",{className:"wcf-field wcf-checkbox-field"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("div",{className:"wcf-settings"},(0,i.createElement)("form",null,(0,i.createElement)("div",{className:"wcf-vertical-nav"},(0,i.createElement)("div",{className:"wcf-vertical-nav__menu"},Array(5).fill().map(e=>(0,i.createElement)("div",{className:"wcf-settings-nav__tab",key:e},(0,i.createElement)(Ig,{height:"45px"})))),(0,i.createElement)("div",{className:"wcf-vertical-nav__content"},(0,i.createElement)(_g,{fontSize:"35px",width:"225px"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"65%"}),(0,i.createElement)(Mg,null),(0,i.createElement)(_g,{fontSize:"35px",width:"300px"}),(0,i.createElement)(_g,{width:"60%"}),(0,i.createElement)(_g,{width:"60%"}),(0,i.createElement)(_g,{width:"45%"}),(0,i.createElement)(Mg,null),(0,i.createElement)(_g,{fontSize:"35px",width:"300px"}),(0,i.createElement)(_g,{width:"60%"}),(0,i.createElement)(_g,{width:"60%"}),(0,i.createElement)(_g,{width:"45%"})))))))},kI=function({settings:e,displayAs:t="tr"}){const[{options:n}]=Yp();return(0,i.createElement)("div",{className:"wcf-list-options"},(0,i.createElement)("div",{className:"wcf-list-options-wrapper"},"tr"===t?(0,i.createElement)("table",{className:"w-full"},(0,i.createElement)("tbody",null,Object.keys(e.fields).map(t=>{const r=e.fields[t],o=n[r.name]?n[r.name]:"",a=dm.isActiveControl(r,n);return(0,i.createElement)(hM,{key:t,data:r,value:o,isActive:a,field:t})}))):(0,i.createElement)("div",{className:"wcf-list-options-container"},Object.keys(e.fields).map(r=>{const o=e.fields[r],a=n[o.name]?n[o.name]:"",s=dm.isActiveControl(o,n);return(0,i.createElement)(hM,{key:r,data:o,value:a,isActive:s,field:r,tabName:"list-options",displayAs:t})}))))},DI=function(e){const[t,n]=(0,s.useState)(e.isOpen?"":"collapsed"),r=e.settings.title.replace(/ /g,"_").toLowerCase(),o=e.settings.title.replace(/ /g,"-").toLowerCase();return(0,i.createElement)("div",{className:`wcf-${o} accordion-item bg-background-primary -mx-8 border-b border-border-subtle ${!1===e?.isActive?"hidden":""}`},(0,i.createElement)("h2",{className:"accordion-header mb-0 "+("landing"===e?.settings?.step_type&&"general"===e?.settings?.slug?"hidden":""),id:`wcf_${r}_toggler`.toLowerCase()},(0,i.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none ${t}`,type:"button","data-bs-toggle":"collapse","data-bs-target":`#wcf_collapse_${r}`,"aria-expanded":"false","aria-controls":`wcf_collapse_${r}`,onClick:function(){n("collapsed"===t?"":"collapsed")}},(0,i.createElement)("span",null,e.settings.title),""===t?(0,i.createElement)(gg,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}):(0,i.createElement)(Lp,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}))),(0,i.createElement)("div",{id:`wcf_collapse_${r}`,className:`accordion-collapse px-8 pt-4 pb-8 ${t}`,"aria-labelledby":`wcf_${r}_toggler`},(0,i.createElement)("div",{className:"accordion-body"},(0,i.createElement)(kI,{settings:e.settings,displayAs:e.displayAs?e.displayAs:"tr"}))))},CI=function(){const[{step_id:e,design_settings:t,options:n,flow_type:r,flow_id:o,step_data:a,is_flow_instant_checkout:l}]=Yp(),c=t.settings,u=c?Object.values(c).sort(function(e,t){return e.priority-t.priority}):"",[{step_title:d}]=Yp(),f=(0,h.useHistory)(),p=Oh();return(0,s.useEffect)(()=>{let e=!0;return()=>{e=!1}},[]),""===e?(0,i.createElement)(SI,null):(0,i.createElement)("div",{className:"wcf-design-page"},"storeCheckout"===r&&d&&"yes"!==l&&(0,i.createElement)("div",{className:"mb-3"},(0,i.createElement)("div",{className:"wcf-change-step wcf-button wcf-secondary-button",onClick:async function(){await p({title:(0,C.__)("Update Template","cartflows"),description:(0,C.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"),actionBtnText:(0,C.__)("Update","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})&&f.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&step_id=${e}&flow_id=${o}&tab=update-template`)}},(0,i.createElement)("span",{className:""},(0,C.__)("Change Template","cartflows")))),(0,i.createElement)("div",{className:"wcf-step-notices-wrapper rounded-md bg-alert-background-warning border border-yellow-200 p-4 mb-3"},(0,i.createElement)("div",{className:"flex"},(0,i.createElement)("div",{className:"text-sm text-support-warning"},"yes"===l&&["checkout","upsell","downsell","thankyou"].includes(a?.type)?(0,i.createElement)(i.Fragment,null,(0,C.sprintf)(
14 +(0,j.__)("Please upgrade to the %1$s CartFlows Higher Plan %2$s to use %3$s feature.","cartflows"),`<a href="${getUtmUrl("https://cartflows.com",{utm_campaign:"feature"})}" target="_blank">`,"</a>",n))))))},PE={sm:"text-xs [&>svg]:size-4 rounded",md:"text-sm [&>svg]:size-5 rounded-md",lg:"text-base [&>svg]:size-6 rounded-md"},RE={input:{sm:"py-1.5 px-2 rounded",md:"p-2.5 rounded-md",lg:"p-3 rounded-md"},content:{sm:"p-1.5",md:"p-1.5",lg:"p-2"},title:{sm:"p-2 text-xs",md:"p-2 text-sm",lg:"p-2 text-sm"},item:{sm:"text-sm text-text-secondary rounded",md:"text-base text-text-secondary rounded-md",lg:"text-base text-text-secondary rounded-md"},icon:{sm:"p-1 text-sm [&>svg]:size-4 text-icon-secondary",md:"p-2 text-base [&>svg]:size-5 text-icon-secondary",lg:"p-2 text-base [&>svg]:size-5 text-icon-secondary"},dialog:{sm:"mt-1 rounded-md",md:"mt-1.5 rounded-lg",lg:"mt-1.5 rounded-lg"}},UE={primary:"bg-field-primary-background outline outline-1 outline-field-border hover:outline-border-strong focus-within:outline-focus-border focus-within:hover:outline-focus-border",secondary:"bg-field-secondary-background outline outline-1 outline-field-border hover:outline-border-strong focus-within:outline-focus-border focus-within:hover:outline-focus-border",ghost:"bg-field-secondary-background outline outline-1 outline-transparent focus-within:outline-focus-border"},BE={ghost:"cursor-not-allowed text-text-disabled placeholder:text-text-disabled",primary:"outline-border-disabled hover:outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled placeholder:text-text-disabled",secondary:"outline-border-disabled hover:outline-border-disabled cursor-not-allowed text-text-disabled placeholder:text-text-disabled"},FE=(0,p.createContext)({}),YE=()=>(0,p.useContext)(FE),ZE=(0,p.forwardRef)(({className:e,size:t="sm",open:n=!1,setOpen:r,onOpenChange:o,loading:a=!1,clearAfterSelect:i=!0,closeAfterSelect:s=!0,variant:l="primary",filter:c=!0,...u},d)=>{const[f,m]=(0,p.useState)(""),[h,g]=(0,p.useState)(a??!1),[w,y]=(0,p.useState)(null),b=p.useRef([]),v=(0,p.useMemo)(()=>"function"==typeof r?r:o,[r,o]),{refs:x,floatingStyles:N,context:I}=uo({open:n,onOpenChange:v,placement:"bottom-start",whileElementsMounted:Cn,middleware:[Bn(2),Yn({padding:10}),Zn({apply({rects:e,elements:t,availableHeight:n}){t.floating.style.maxHeight=`${n}px`,t.floating.style.width=`${e.reference.width}px`,t.floating.style.fontFamily=window.getComputedStyle(t.reference).fontFamily}})]}),M=xo(I,{listRef:b,activeIndex:w,onNavigate:y,loop:!0,openOnArrowKeyDown:!1}),E=co(I),{getReferenceProps:_,getFloatingProps:S,getItemProps:D}=ho([E,M]);return(0,p.useEffect)(()=>{const e=Ce(),t=t=>{const n="Mac OS"===e?t.metaKey:t.ctrlKey;if("/"===t.key&&n&&(t.preventDefault(),x.reference&&x.reference.current)){const e=x.reference.current instanceof HTMLElement?x.reference.current.querySelector("input"):null;e&&e.focus()}};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[x.reference]),(0,p.useEffect)(()=>{n||y(null)},[n]),(0,C.jsx)(FE.Provider,{value:{size:t,open:n,onOpenChange:v,refs:x,floatingStyles:N,context:I,getReferenceProps:_,getFloatingProps:S,getItemProps:D,activeIndex:w,setActiveIndex:y,listRef:b,searchTerm:f,setSearchTerm:m,isLoading:h,setIsLoading:g,clearAfterSelect:i,closeAfterSelect:s,variant:l,filter:c},children:(0,C.jsx)("div",{className:Se("searchbox-wrapper box-border relative w-full",e),...u,ref:d})})});ZE.displayName="SearchBox";const VE=(0,p.forwardRef)(({className:e,type:t="text",placeholder:n="Search...",disabled:r=!1,onChange:o=()=>{},...a},i)=>{const{size:s,refs:l,getReferenceProps:c,searchTerm:u,setSearchTerm:d,open:f,setActiveIndex:p,listRef:m,onOpenChange:h,variant:g}=YE(),w="lg"===s?"sm":"xs";return(0,C.jsxs)("div",{ref:l.setReference,className:Se("w-full group relative flex justify-center items-center gap-1.5 focus-within:z-10 transition-all ease-in-out duration-200",UE[g],RE.input[s],r?BE[g]:"focus-within:ring-2 focus-within:ring-focus focus-within:ring-offset-2 focus-within:border-focus-border focus-within:hover:border-focus-border",e),...c(),children:[(0,C.jsx)("span",{className:Se(PE[s],r?"text-icon-disabled":"text-icon-secondary group-hover:text-icon-primary group-focus-within:text-icon-primary","flex justify-center items-center"),children:(0,C.jsx)(Sw,{})}),(0,C.jsx)("input",{type:t,ref:i,className:Se(PE[s],"flex-grow font-medium bg-transparent border-none outline-none border-transparent focus:ring-0 p-0 min-h-fit",r&&"text-field-placeholder focus-within:text-field-input group-hover:text-field-input placeholder:text-field-placeholder"),disabled:r,value:u,onChange:e=>{const t=e.target.value;d(t),o(t),"function"==typeof h&&(t.trim()?h(!0):h(!1))},onFocus:()=>{r||"function"!=typeof h||u?.trim()&&h(!0)},onKeyDown:e=>{if(!r){if("ArrowDown"===e.key||"ArrowUp"===e.key)return void(f&&(e.preventDefault(),"ArrowDown"===e.key?p(e=>null===e?0:e):"ArrowUp"===e.key&&p(e=>{const t=m?.current?.length||0;return null===e&&t>0?t-1:e})));"Escape"===e.key&&h(!1)}},placeholder:n,...Le(a,["size","open","onOpenChange","loading"])}),(0,C.jsx)(Qo,{label:"Mac OS"===Ce()?"⌘/":"Ctrl /",size:w,type:"rounded",variant:"neutral",className:"bg-background-primary"})]})});VE.displayName="SearchBox.Input";const GE=({className:e,children:t,...n})=>{const{size:r,open:o,refs:a,floatingStyles:i,getFloatingProps:s,context:l}=YE();return o?(0,C.jsx)(Kr,{context:l,initialFocus:-1,returnFocus:!0,children:(0,C.jsx)("div",{ref:a.setFloating,style:{...i},className:Se("bg-background-primary rounded-md border border-solid border-border-subtle shadow-soft-shadow-lg overflow-y-auto text-wrap focus:outline-none",RE.dialog[r],e),...s(),...n,children:t})}):null};GE.displayName="SearchBox.Content";const WE=({children:e,id:t,root:n})=>(0,C.jsx)(Gr,{id:t,root:n,children:e});WE.displayName="SearchBox.Portal";const HE=({children:e,className:t})=>{const{searchTerm:n,isLoading:r,listRef:o,filter:a=!0}=YE();if(!a)return(0,C.jsx)(cr,{elementsRef:o,children:(0,C.jsx)("div",{className:t,children:e})});const i=p.Children.toArray(e).map(e=>{if(p.isValidElement(e)&&e.type===$E){const t=p.Children.toArray(e.props.children).filter(e=>p.isValidElement(e)&&"string"==typeof e.props.children&&e.props.children.toLowerCase().includes(n.toLowerCase()));return t.length>0?(0,p.cloneElement)(e,{children:t}):null}return e}).filter(Boolean);return r?(0,C.jsx)(JE,{}):(0,C.jsx)(cr,{elementsRef:o,children:(0,C.jsx)("div",{className:t,children:i.some(e=>p.isValidElement(e)&&e.type!==qE)?i:(0,C.jsx)(QE,{})})})};HE.displayName="SearchBox.List";const QE=({children:e="No results found.",className:t})=>{const{size:n}=YE();return(0,C.jsx)("div",{className:Se("flex justify-center items-center",RE.item[n],"text-text-tertiary p-4",t),children:e})};QE.displayName="SearchBox.Empty";const $E=({heading:e,children:t})=>{const{size:n}=YE();return(0,C.jsxs)("div",{className:Se(RE.content[n],RE.item[n]),children:[e&&(0,C.jsx)("div",{className:Se(RE.title[n],"text-text-tertiary"),children:e}),t]})};$E.displayName="SearchBox.Group";const XE=(0,p.forwardRef)(({className:e,icon:t,children:n,onClick:r,...o},a)=>{const{size:i,setSearchTerm:s,clearAfterSelect:l,getItemProps:c,activeIndex:u,onOpenChange:d,closeAfterSelect:f}=YE(),{ref:m,index:h}=function(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:o,elementsRef:a,labelsRef:i}=p.useContext(lr),[s,l]=p.useState(null),c=p.useRef(null),u=p.useCallback(e=>{if(c.current=e,null!==s&&(a.current[s]=e,i)){var n;const r=void 0!==t;i.current[s]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}},[s,a,i,t]);return ir(()=>{const e=c.current;if(e)return n(e),()=>{r(e)}},[n,r]),ir(()=>{const e=c.current?o.get(c.current):null;null!=e&&l(e)},[o]),p.useMemo(()=>({ref:u,index:null==s?-1:s}),[s,u])}(),g=u===h;return(0,C.jsxs)("button",{type:"button",ref:e=>{"function"==typeof a?a(e):a&&(a.current=e),m(e)},className:Se("flex w-full items-center justify-start gap-1 p-1 cursor-pointer border-none bg-transparent text-left focus:outline-none",g&&"bg-background-secondary",!g&&"hover:bg-background-secondary focus:bg-background-secondary",RE.item[i],e),...c?.({role:"option","aria-selected":g,onClick:()=>{"function"==typeof r&&r(),l&&s(""),f&&d(!1)},...o}),children:[t&&(0,C.jsx)("span",{className:Se(RE.icon[i],"flex items-center justify-center"),children:t}),(0,C.jsx)("span",{className:Se("flex-grow py-0.5 px-1 font-normal",RE.item[i]),children:n})]})});XE.displayName="SearchBox.Item";const JE=({loadingIcon:e=(0,C.jsx)(zw,{})})=>{const{size:t}=YE(),n=p.isValidElement(e)?(0,p.cloneElement)(e,{size:t}):e;return(0,C.jsx)("div",{className:Se("flex justify-center p-4",PE[t],RE.item[t]),children:n})};JE.displayName="SearchBox.Loading";const qE=(0,p.forwardRef)(({className:e,...t},n)=>(0,C.jsx)("hr",{ref:n,className:Se("border-0 border-t border-border-subtle border-solid m-0",e),...t}));qE.displayName="SearchBox.Separator",ZE.Input=VE,ZE.Loading=JE,ZE.Separator=qE,ZE.Content=GE,ZE.List=HE,ZE.Empty=QE,ZE.Group=$E,ZE.Item=XE,ZE.Portal=WE;const KE=function(e){const{label:t,name:n,desc:r,value:o,allowed_products:a=[],include_products:s=[],excluded_products:l=[],excluded_product_ids:c=[],tooltip:u,placeholder:d,onChangeCB:f,nameComp:p,attr:m,isMulti:h=!1,showLabelOnly:g=!1,sectionClass:y="",wrapperClass:b="",labelClass:v="",descClass:x=""}=e,N=e=>h?e:Array.isArray(e)?e[0]||null:e,[I,M]=(0,i.useState)(N(o)),[E,_]=(0,i.useState)([]),[S,D]=(0,i.useState)(!1),[k,C]=(0,i.useState)(!1),[A,T]=(0,i.useState)(!1),L=(0,i.useRef)(null),O=(0,i.useRef)("");(0,i.useEffect)(()=>{M(N(o))},[o]);const z=Array.isArray(c)&&c.length>0,P=async(e,t)=>{const n=new window.FormData;return n.append("allowed_products",a),n.append("include_products",s),n.append("exclude_products",l),n.append("action","cartflows_json_search_products"),n.append("security",cartflows_admin.json_search_products_nonce),n.append("term",e),t&&z&&n.append("exclude_product_ids",c.join(",")),await Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n})||[]},R=e=>e?.label?g||!e.value?e.label:`${e.label} (#${e.value})`:"";return(0,i.createElement)("div",{className:`wcf-select2-field wcf-product-field ${y}`},(0,i.createElement)("div",{className:`wcf-selection-field ${b}`},t&&(0,i.createElement)("label",{className:`block text-sm font-medium text-left mb-2 ${v}`},t,u&&(0,i.createElement)(n_,{text:u})),h?(I||[]).map(e=>(0,i.createElement)("input",{key:e.value,type:"hidden",name:`${n}[]`,value:e.value})):(0,i.createElement)("input",{type:"hidden",name:p?n:`${n}[]`,value:I?.value||""}),h&&(I||[]).length>0&&(0,i.createElement)("div",{className:"mb-2 flex flex-wrap gap-1.5"},(I||[]).map(t=>(0,i.createElement)(Qo,{key:t.value,label:R(t),size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>(t=>{const n=(I||[]).filter(e=>e.value!==t.value);M(n);const r=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),f&&f(n)})(t)}))),!h&&I?.label&&(0,i.createElement)("div",{className:"mb-2 flex"},(0,i.createElement)(Qo,{label:R(I),size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>{M(null);const t=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:null}});document.dispatchEvent(t),f&&f(null)}})),(0,i.createElement)(ZE,(0,w.A)({open:S,setOpen:e=>{e&&O.current.length<3||D(e)},filter:!1,size:"md",variant:"secondary",clearAfterSelect:!0,closeAfterSelect:!0},m),(0,i.createElement)(ZE.Input,{ref:L,placeholder:d||(0,j.__)("Search for a Product","cartflows"),onChange:async e=>{if(O.current=e,e.length>=3){C(!0);const t=await P(e,!0);if(O.current!==e)return;if(_(t),0===t.length&&z){const t=await P(e,!1);if(O.current!==e)return;T(t.length>0)}else T(!1);C(!1)}else _([]),T(!1),C(!1)},className:"[&>span:last-of-type]:hidden [&>span:first-of-type>svg]:size-4 !w-auto"}),(0,i.createElement)(ZE.Portal,null,(0,i.createElement)(ZE.Content,null,(0,i.createElement)(ZE.List,null,k&&(0,i.createElement)(ZE.Loading,null),!k&&E.length>0&&(0,i.createElement)(ZE.Group,null,E.map(t=>(0,i.createElement)(ZE.Item,{key:t.value,onClick:()=>(t=>{const n=h?[...I||[],t]:t;M(n);const r=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),f&&f(n)})(t)},(0,i.createElement)("div",{className:"wcf-select-option--row flex w-full items-center justify-between cursor-pointer"},(0,i.createElement)("div",{className:"wcf-select-option--row-option flex items-center gap-3"},(0,i.createElement)("span",null,t?.label||""," ",t.value?"(#"+t?.value+")":""),t?.type_label&&(0,i.createElement)("span",{className:"wcf-badge wcf-badge--neutral text-xs leading-[0.5rem] capitalize !py-1.5 !px-2 cursor-pointer"},t.type_label),t?.stock_status&&(0,i.createElement)("span",{className:`wcf-badge ${t.in_stock?"wcf-badge--success":"wcf-badge--error"} text-xs leading-[0.5rem] capitalize !py-1.5 !px-2 cursor-pointer`},t?.stock_status||"")),t.price_range&&(0,i.createElement)("div",null,(0,i.createElement)("span",{className:"text-xs leading-3 font-normal cursor-pointer"},t?.price_range)))))),!k&&0===E.length&&S&&(0,i.createElement)(ZE.Empty,null,A?(0,j.__)("All matching products are already added.","cartflows"):(0,j.__)("No products found.","cartflows"))))))),r&&(0,i.createElement)("div",{className:`wcf-field-desc text-sm font-normal text-text-tertiary mt-3 ${x}`},Nh(r)))},e_=function(e){const{label:t,name:n,desc:r,value:o,tooltip:a,placeholder:s,onChangeCB:l,nameComp:c,isMulti:u=!1,sectionClass:d="",wrapperClass:f="",descClass:p="",fieldClass:m="",size:h="md",attr:g}=e,y=e=>!u&&Array.isArray(e)?e[0]||null:e,[b,v]=(0,i.useState)(()=>y(o)),[x,N]=(0,i.useState)([]),[I,M]=(0,i.useState)(!1),[E,_]=(0,i.useState)(!1),S=(0,i.useRef)(null),D=(0,i.useRef)("");return(0,i.useEffect)(()=>{v(y(o))},[o]),(0,i.createElement)("div",{className:`wcf-select2-field wcf-coupon-field ${d}`},(0,i.createElement)("div",{className:`wcf-coupon-field-wrapper ${f}`},t&&(0,i.createElement)("label",{className:"block text-sm font-medium text-left mb-2",htmlFor:`${n}-search`},t,a&&(0,i.createElement)(n_,{text:a})),u?(b||[]).map(e=>(0,i.createElement)("input",{key:e.value,type:"hidden",name:`${n}[]`,value:e.value})):(0,i.createElement)("input",{type:"hidden",name:c?n:`${n}[]`,value:b?.value||""}),(0,i.createElement)(ZE,(0,w.A)({open:I,setOpen:e=>{e&&D.current.length<3||M(e)},filter:!1,size:h,variant:"secondary",clearAfterSelect:!0,closeAfterSelect:!0},g),(0,i.createElement)(ZE.Input,{id:`${n}-search`,ref:S,placeholder:s||(0,j.__)("Search for a coupon","cartflows"),onChange:async e=>{if(D.current=e,e.length>=3){_(!0);const t=new window.FormData;t.append("action","cartflows_json_search_coupons"),t.append("security",cartflows_admin.json_search_coupons_nonce),t.append("term",e);const n=await Ep()({url:cartflows_admin.ajax_url,method:"POST",body:t});N(n||[]),_(!1)}else N([]),_(!1)},className:`[&>span:last-of-type]:hidden [&>span:last-of-type]:absolute [&>span:first-of-type>svg]:size-4 !w-auto ${m}`}),(0,i.createElement)(ZE.Portal,null,(0,i.createElement)(ZE.Content,null,(0,i.createElement)(ZE.List,null,E&&(0,i.createElement)(ZE.Loading,null),!E&&x.length>0&&(0,i.createElement)(ZE.Group,null,x.map(t=>(0,i.createElement)(ZE.Item,{key:t.value,onClick:()=>(t=>{const n=u?[...b||[],t]:t;v(n);const r=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),l&&l(n)})(t)},(0,i.createElement)("span",null,t?.label||"")))),!E&&0===x.length&&I&&(0,i.createElement)(ZE.Empty,null,(0,j.__)("No coupons found.","cartflows")))))),u&&(b||[]).length>0&&(0,i.createElement)("div",{className:"mt-2 flex flex-wrap gap-1.5"},(b||[]).map(t=>(0,i.createElement)(Qo,{key:t.value,label:t.label,size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>(t=>{const n=(b||[]).filter(e=>e.value!==t.value);v(n);const r=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),l&&l(n)})(t)}))),!u&&b?.label&&(0,i.createElement)("div",{className:"mt-2 flex"},(0,i.createElement)(Qo,{label:b.label,size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>{v(null);const t=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:null}});document.dispatchEvent(t),l&&l(null)}}))),r&&(0,i.createElement)("div",{className:`wcf-field-desc flex items-start gap-1 text-sm font-normal text-text-tertiary mt-3 text-left ${p}`},(0,i.createElement)(Lo,{className:"w-4 h-4 shrink-0 mt-px"}),(0,i.createElement)("span",null,Nh(r))))},t_=To("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),n_=function(e){const{text:t,position:n="default",classes:r="text-text-tertiary",icon:o="",portalId:a="wcf-settings-app",triggers:s=["hover","focus"],arrow:l=!0,interactive:c=!1}=e,u="default"===n?"bottom":n,d=("string"==typeof t?t.replace(/<[^>]+>/g,"").trim():"")||(0,j.__)("More information","cartflows");return(0,i.createElement)(Wo,{content:"string"==typeof t?Nh(t):t,placement:u,arrow:l,interactive:c,tooltipPortalId:a,triggers:s,className:"z-[999999]"},(0,i.createElement)("span",{tabIndex:0,"aria-label":d,className:dp()(r,"wcf-tooltip-icon inline-flex cursor-pointer ml-1")},""===o?(0,i.createElement)(t_,{className:"w-3.5 h-3.5 stroke-2"}):o))},r_=function(e){const{subClass:t="",label:n,desc:r}=e;return(0,i.createElement)("div",{className:"wcf-field wcf-sub-heading-field"},n&&(0,i.createElement)("div",{className:`wcf-field__data--label ${t}`},(0,i.createElement)("label",null,n)),r&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},Nh(r)))},o_=function(e){const{name:t,id:n,label:r,value:o,placeholder:a,tooltip:s,desc:l,type:c,min:u,max:d,readonly:f,icon:p,onChangeCB:m,iconOnClick:h,afterClickIcon:g,attr:y}=e,[b,v]=(0,i.useState)(o),[x,N]=(0,i.useState)(c||"password"),[I,M]=(0,i.useState)(p||"");return(0,i.useEffect)(()=>{v(o),N(c),M(p)},[o]),(0,i.createElement)("div",{className:"wcf-field wcf-password-field text-left"},(0,i.createElement)("div",{className:"wcf-field__data flex items-center justify-between gap-2.5"},r&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left"},(0,i.createElement)("label",{className:"whitespace-nowrap",htmlFor:n||t},r,s&&(0,i.createElement)(n_,{text:s}))),(0,i.createElement)("div",{className:"wcf-field__data--content w-1/2"},(0,i.createElement)(Qw,(0,w.A)({type:x,name:t,value:b,id:n||t,onChange:function(n){v(n);const r=new CustomEvent("wcf:password:change",{bubbles:!0,detail:{e:{target:{value:n,name:t}},name:e.name,value:n}});document.dispatchEvent(r),m&&m(n)},placeholder:a,min:u,max:d,readOnly:f,size:"md",className:`${e.class?e.class:""} w-full`,suffix:I?(0,i.createElement)("span",{className:`${I} pointer-events-auto cursor-pointer`,onClick:function(){h&&"show_field_value"===h&&("text"===x?(N("password"),M(p)):(N("text"),M(g)))},role:"button",tabIndex:0}):null},y)))),l&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Nh(l)))},a_=function(){return(0,i.createElement)("div",{className:"wcf-field wcf-separator-field border-x-0 border-t-0 border-b border-solid border-border-subtle"})},i_=function(e){const t=e.data;let n=e.value;const r=e.displayAs?e.displayAs:"tr";let o="";switch(""===n&&(n=t.value),t.type){case"text":o=(0,i.createElement)($w,{id:t.name,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,class:t?.class,name:t.name,value:t.value?t.value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,desc:t.desc,tooltip:t.tooltip,displayAlign:t.display_align,size:e.fieldSize});break;case"datetime":o=(0,i.createElement)(CE,{id:t.name,name:t.name,value:t.value?t.value:n,label:t.label,placeholder:t.placeholder,desc:t.desc,tooltip:t.tooltip,displayAlign:t.display_align,class:t?.class});break;case"number":o=(0,i.createElement)(dN,{type:t.type,id:t.name,class:t?.class,name:t.name,value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,min:t.min,max:t.max,desc:t.desc,tooltip:t.tooltip,afterfield:t.afterfield,width:t.width,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align,size:e.fieldSize});break;case"checkbox":o=(0,i.createElement)(fw,{id:t.name,name:t.name,className:t?.class,value:n,label:t.label,desc:t.desc,notice:t.notice,backComp:t.backComp,tooltip:t.tooltip,child_className:t.child_class,isDisabled:t.isDisabled,displayAlign:t.display_align,isPro:t.is_pro});break;case"toggle":o=(0,i.createElement)(u_,{id:t.name,name:t.name,className:t.class,value:n,label:t.label,desc:t.desc,notice:t.notice,backComp:t.backComp,tooltip:t.tooltip,child_className:t.child_class,displayAlign:t.display_align,fullWidth:t.is_fullwidth,isDisabled:t?.is_disabled});break;case"radio":o=(0,i.createElement)(Ew,{id:t.name,name:t.name,value:void 0===n?"":n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,child_className:t.child_class});break;case"textarea":o=(0,i.createElement)(qw,{id:t.name,name:t.name,className:t?.class,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,rows:t.rows,cols:t.cols,displayAlign:t.display_align,size:e.fieldSize});break;case"code":o=(0,i.createElement)(Kw,{id:t.name,name:t.name,value:n,label:t.label,tooltip:t.tooltip,displayAlign:t.display_align,language:t.language});break;case"select":o=(0,i.createElement)(Ww,{id:t.name,name:t.name,class:t.class,value:n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,prodata:t?.pro_options,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,contentClass:t?.contentClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align,isDisabled:t.isDisabled,size:e.fieldSize});break;case"select_card":o=(0,i.createElement)(d_,{id:t.name,name:t.name,value:n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,prodata:t?.pro_options,layout:t?.layout,showRadio:t?.display_radio});break;case"select2":o=(0,i.createElement)(Yx,{id:t.name,name:t.name,value:n,label:t.label,placeholder:t.placeholder,desc:t.desc,tooltip:t.tooltip,options:t.options,isMulti:t.isMulti,displayAlign:t.display_align,isSearchable:t?.enable_search});break;case"product":o=(0,i.createElement)("div",null,(0,i.createElement)(KE,{name:t.name,label:t.label,desc:t.desc,field:t.fieldtype,allowed_products:t.allowed_product_types?t.allowed_product_types:"",include_products:t.include_product_types?t.include_product_types:"",excluded_products:t.excluded_product_types?t.excluded_product_types:"",placeholder:t.placeholder,tooltip:t.tooltip,value:n,nameComp:t.nameComp,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass}));break;case"coupon":o=(0,i.createElement)("div",null,(0,i.createElement)(e_,{name:t.name,label:t.label,desc:t.desc,field:t.fieldtype,placeholder:t.placeholder,tooltip:t.tooltip,value:n,nameComp:t.nameComp}));break;case"product-repeater":o=(0,i.createElement)(tN,{id:t.name,name:t.name,value:n,label:t.label,products:t.products});break;case"font-family":o=(0,i.createElement)(iN,{id:t.name,name:t.name,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,font_weight_name:t.font_weight_name,font_weight_value:t.font_weight_value,displayAlign:t.display_align});break;case"separator":o=(0,i.createElement)(a_,null);break;case"sub-heading":o=(0,i.createElement)(r_,{subclassName:t.subClass,label:t.label,desc:t.desc});break;case"color-picker":o=(0,i.createElement)(oN,{id:t.name,name:t.name,label:t.label,value:n,default:t.default,desc:t.desc,tooltip:t.tooltip,displayAlign:t.display_align,withBg:t.withBg,size:e.fieldSize});break;case"password":o=(0,i.createElement)(o_,{type:t.type,id:t.name,name:t.name,value:t.value?t.value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,desc:t.desc,tooltip:t.tooltip,class:t.class,icon:t.icon,iconOnClick:t.iconclick,afterClickIcon:t.afterIcon});break;case"image-selector":const r=t?.objName?t?.objName:"product_img_obj",a=e?.options&&e?.options[r]?e?.options[r]:t?.value;o=(0,i.createElement)(uN,{id:t.name,name:t.name,label:t.label,value:n,desc:t.desc,tooltip:t.tooltip,isNameArray:t.isNameArray,objName:r,objValue:a,singleButton:t?.singleButton,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align});break;case"doc":o=(0,i.createElement)(LE,{content:t?.content,icon:t?.icon||""});break;case"pro-notice":o=(0,i.createElement)("p",{className:"wcf-pro-update-notice"},(0,j.sprintf)(/* translators: %s is replaced with feature name */ /* translators: %s is replaced with feature name */
15 +(0,j.__)("Please upgrade to the CartFlows Higher Plan to use the %s feature.","cartflows"),t.feature));break;case"heading":o=(0,i.createElement)(OE,{label:t.label,desc:t.desc,sectionClass:t?.sectionClass,labelClass:t?.labelClass,descClass:t?.descClass});break;case"alert":o=(0,i.createElement)(g_,{variant:t.variant,label:t.label,desc:t.desc,className:t?.class});break;case"checkout-link-generator":o=(0,i.createElement)(p_,{stepId:t.step_id});break;case"wp-editor":o=(0,i.createElement)(s_,{name:t.name,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,rows:t.rows,cols:t.cols,id:t.id,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align})}return"tr"===r?(0,i.createElement)("tr",{className:`wcf-field-row-${e.field} ${e.class?e.class:""} ${e.isActive?"":"wcf-hide"}`,key:t.name},(0,i.createElement)("th",{scope:"row",className:"py-2"},(0,i.createElement)(i.Fragment,null,o))):(0,i.createElement)("div",{key:t.name,className:`wcf-${e.tabName}-tab--row wcf-field-row-${e.field} mb-4 last:mb-0 ${e.class?e.class:""} ${e.isActive?"":"hidden"}`},o)},s_=function(e){const{name:t,value:n,label:r,desc:o,id:a,tooltip:s,rows:l,cols:c,sectionClass:u=!1,wrapperClass:d=!1,labelClass:f,descClass:p,displayAlign:m="horizontal"}=e,[h,g]=(0,i.useState)(n),w=u||"text-left",y=p||"text-sm font-normal text-text-tertiary mt-2";let b=d||"flex items-center gap-2.5",v=f||"text-sm font-medium text-text-primary text-left mb-2";function x(t,n){g(n);const r=new CustomEvent("wcf:wpeditor:change",{bubbles:!0,detail:{e:t,name:e.name,value:n}});document.dispatchEvent(r)}return"horizontal"!==m&&(b="block w-full text-left",v+=" mb-2"),(0,i.useEffect)(()=>{let e=!0;return e&&(wp.editor.initialize(a,{tinymce:!0,quicktags:!0,mediaButtons:!1}),jQuery(document).on("tinymce-editor-setup",function(e,n){n.settings.toolbar1="bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,cartflows_ob",n.on("change",function(){x(e,n.getContent())}),n.on("keyup",function(){x(e,n.getContent())}),n.settings.forced_root_block=!1,"desc_text"===t&&n.addButton("cartflows_ob",{type:"menubutton",text:"",icon:"cartflows-logo cartflows-logo-icon",menu:[{text:"Product Name",value:"{{product_name}}",onclick(){n.insertContent(this.value())}},{text:"Product Desc",value:"{{product_desc}}",onclick(){n.insertContent(this.value())}},{text:"Product Price",value:"{{product_price}}",onclick(){n.insertContent(this.value())}},{text:"Product Quantity",value:"{{quantity}}",onclick(){n.insertContent(this.value())}}].sort(function(e,t){return e.text.localeCompare(t.text)})})})),()=>{e=!1,tinymce.activeEditor.destroy()}},[]),(0,i.createElement)("div",{className:`wcf-field wcf-wp-editor-field ${w}`},(0,i.createElement)("div",{className:`wcf-field__data ${b}`},r&&(0,i.createElement)("div",{className:`wcf-field__data--label ${v}`},(0,i.createElement)("label",null,r,s&&(0,i.createElement)(n_,{text:s}))),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("textarea",{className:e.class,name:t,value:h,id:a,rows:l||"10",cols:c||"60",onChange:function(t){g(t.target.value);const n=new CustomEvent("wcf:wpeditor:change",{bubbles:!0,detail:{e:t,name:e.name,value:t.target.value}});document.dispatchEvent(n)}}))),o&&(0,i.createElement)("div",{className:`wcf-field__desc ${y}`},Nh(o)))};function l_({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const c_=p.forwardRef(l_),u_=function({onChange:e,...t}){const{name:n,id:r,label:o,value:a,desc:s,backComp:l=!1,onClick:c,notice:u,isDisabled:d=!1,tooltip:f,sectionClass:p="",wrapperClass:m="",labelClass:h="",descClass:g="",displayAlign:w="horizontal",fullWidth:y=!0}=t,[b,v]=(0,i.useState)(a),[x,N]=(0,i.useState)(!1),[I,M]=(0,i.useState)(""),E=p||"text-left",_=h||"text-sm font-medium text-text-primary",S=g||"text-sm font-normal text-text-secondary mt-2";let D=m||`flex ${s?"items-start":"items-center"} py-1 ${y?"justify-between":""}`;"horizontal"!==w&&(D="block w-full text-left"),(0,i.useEffect)(()=>{v(a)},[a]);const k=l?"enable":"yes",C=l?"disable":"no",A=(0,i.useCallback)(t=>{const r=t?k:C;v(r);const o=new CustomEvent("wcf:toggle:change",{bubbles:!0,detail:{name:n,value:r}});document.dispatchEvent(o),e&&e({name:n,value:r}),c&&c()},[k,C,n,e,c]);function T(){"prompt"===u.type&&I!==u.check.toUpperCase()||(N(!1),M(""),"alert"!==u.type&&A(!0))}function L(){N(!1),M("")}return(0,i.createElement)("div",{className:`wcf-field wcf-toggle-field ${E} `},(0,i.createElement)("div",{className:`wcf-field__data ${D}`},o&&(0,i.createElement)("div",{className:"wcf-field__data--content-left flex-1 min-w-0"},(0,i.createElement)("div",{className:`wcf-field__data--label ${_}`},(0,i.createElement)("label",{htmlFor:r||n},o,f&&(0,i.createElement)(n_,{text:f}))),s&&(0,i.createElement)("div",{className:`wcf-field__desc ${S}`},Nh(s))),(0,i.createElement)("div",{className:"wcf-field__data--content-right ml-2"},(0,i.createElement)("div",{className:"flex justify-center"},(0,i.createElement)("input",{type:"hidden",name:n,value:b}),(0,i.createElement)(yw,{id:r||n,value:k===b,onChange:function(e){if(e&&u)return"alert"===u.type?void N(!0):"confirm"===u.type||"prompt"===u.type?(M(""),void N(!0)):void 0;A(e)},disabled:d})))),!o&&s&&(0,i.createElement)("div",{className:`wcf-field__desc ${S}`},Nh(s)),function(){if(!u)return null;const e="prompt"===u.type,t="alert"===u.type,n=!e||I===u.check.toUpperCase();return(0,i.createElement)(Jh,{open:x,setOpen:e=>{e||L()},exitOnClickOutside:!1,exitOnEsc:!0,className:"wcf-toggle-notice-popup"},(0,i.createElement)(Jh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)("div",{className:"flex items-center gap-2"},(0,i.createElement)(c_,{className:"w-8 h-8 text-support-warning","aria-hidden":"true"}),(0,i.createElement)(Jh.Title,null,t?(0,j.__)("Notice","cartflows"):(0,j.__)("Confirmation Required","cartflows"))),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)(Jh.Body,null,(0,i.createElement)("p",{className:"text-sm text-text-secondary m-0"},u.message),e&&(0,i.createElement)("div",{className:"mt-4"},(0,i.createElement)(Qw,{value:I,onChange:e=>M(e),placeholder:u.check.toUpperCase(),size:"md"}))),(0,i.createElement)(Jh.Footer,{className:"flex gap-3 justify-end"},t?(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:L},(0,j.__)("OK","cartflows")):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:L},(0,j.__)("Cancel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"md",destructive:!0,onClick:T,disabled:!n},(0,j.__)("Confirm","cartflows"))))))}())},d_=function(e){const{name:t,label:n,desc:r,tooltip:o,options:a,layout:s="horizontal",value:l,showRadio:c=!0,after:u}=e;(0,i.useEffect)(()=>{void 0===l&&f("")},[]);const[d,f]=(0,i.useState)(l);function p(t){f(t);const n=new CustomEvent("wcf:selectioncard:change",{bubbles:!0,detail:{e:{},name:e.name,newValue:t}});document.dispatchEvent(n)}function m(e){return e.tooltip?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(n_,{text:e.tooltip}),e.label):e.desc?{heading:e.label,description:e.desc}:e.label}return(0,i.createElement)("div",{className:"wcf-field wcf-select-option--card"},(0,i.createElement)("div",{className:"wcf-field__data flex flex-col gap-6"},n&&r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-field__data--content-left"},n&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left"},(0,i.createElement)("label",null,n,o&&(0,i.createElement)(n_,{text:o})))),(0,i.createElement)("div",{className:"wcf-field__desc text-sm text-left font-normal text-text-tertiary"},Nh(r))),(0,i.createElement)("div",{className:"wcf-field__data--content-right w-full"},"horizontal"===s?(0,i.createElement)("div",{className:"grid gap-[13px]",style:{gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`}},a.map(e=>{const n=d===e.value;return(0,i.createElement)("label",{key:e.value,className:"flex flex-col items-center gap-3 p-3 rounded-md cursor-pointer transition-all relative border border-solid "+(n?"border-brand-300 bg-brand-25":"border-border-subtle hover:border-border-interactive")},(0,i.createElement)("input",{type:"radio",name:t,value:e.value,checked:n,onChange:()=>p(e.value),className:"sr-only"}),c&&(0,i.createElement)("span",{className:"absolute top-2.5 right-2.5 size-4 rounded-full border border-solid flex items-center justify-center "+(n?"bg-toggle-on border-toggle-on":"bg-background-primary border-field-border")},n&&(0,i.createElement)("span",{className:"size-1.5 rounded-full bg-background-primary"})),e.image&&(0,i.createElement)("img",{src:e.image,alt:e.label,className:"wcf-selection-card--image size-11"}),(0,i.createElement)("span",{className:"text-sm font-semibold text-center leading-5 whitespace-nowrap flex items-center gap-1 "+(n?"text-brand-500":"text-text-primary")},e.tooltip&&(0,i.createElement)(n_,{text:e.tooltip,classes:n?"text-brand-500":"hover:text-brand-500"}),e.label))})):(0,i.createElement)(Mw.Group,{name:t,value:d,onChange:p,style:"simple",vertical:!0,columns:1,gapClassName:"gap-0"},a.map((e,t)=>(0,i.createElement)(Mw.Button,(0,w.A)({key:t,value:e.value,label:m(e)},e.image&&{icon:(0,i.createElement)("img",{src:e.image,alt:e.label,className:"wcf-selection-card--image w-12 h-12"})},{minWidth:!1,buttonWrapperClasses:"[&_label]:text-left "+(e.desc?"[&_p:last-child]:!text-text-secondary":"")}))))),u&&(0,i.createElement)("div",{className:"wcf-field__data--content__after"},u)),!n&&r&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},Nh(r)))},f_=function(e){const{name:t,id:n,label:r,desc:o,tooltip:a,options:s,onSelect:l,after:c,isSearchable:u=!1}=e,[d,f]=(0,i.useState)(()=>s.find(t=>t.value===e.value)||null),p=(0,i.useRef)(null);return(0,i.createElement)("div",{className:"wcf-field wcf-select-with-icons-option"},(0,i.createElement)("div",{className:"wcf-field__data"},r&&(0,i.createElement)("div",{className:"wcf-field__data--label text-sm font-normal text-left"},(0,i.createElement)("label",{htmlFor:n||t},r,a&&(0,i.createElement)(n_,{text:a}))),(0,i.createElement)("div",{className:"wcf-field__data--content"},(0,i.createElement)("input",{type:"hidden",ref:p,name:t,defaultValue:d?.value||""}),(0,i.createElement)(Gw,{id:n||t,value:d,onChange:function(t){f(t),p.current&&(p.current.value=t.value);const n=new CustomEvent("wcf:select:change",{bubbles:!0,detail:{e:t,name:e.name,value:t.value,icon:t.icon}});document.dispatchEvent(n),e?.callback&&e.callback(t,e.name,t.value),l&&l()},by:"value",combobox:u,size:"sm"},(0,i.createElement)(Gw.Button,{placeholder:"",render:e=>(0,i.createElement)(n_,{text:e?.label||"",icon:e?.icon||(0,i.createElement)(Vx,{className:"w-5 h-5"}),classes:"!ml-0"}),type:"button",className:e.class}),(0,i.createElement)(Gw.Options,null,s.map(e=>(0,i.createElement)(Gw.Option,{key:e.value,value:e},(0,i.createElement)(n_,{text:e.label,icon:e.icon,classes:"group-hover:text-text-on-color !ml-0"})))))),c&&(0,i.createElement)("div",{className:"wcf-field__data--content__after"},c)),o&&(0,i.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},Nh(o)))},p_=function(){const[{step_data:e,flow_type:t}]=Nm(),n=e?.id||null,r="storeCheckout"===t,o=(0,k.applyFilters)("cartflows.settings.checkoutLinkGenerator",null);return o?(0,i.createElement)("div",{className:"wcf-field wcf-checkout-link-generator-field"},(0,i.createElement)(o,{preSelectedStepId:n,isStoreCheckout:r})):(0,i.createElement)(vh,{size:"sm",color:"secondary"},(0,j.__)("Please update CartFlows Pro to the latest version to use this setting.","cartflows"))},m_=({design:e="inline",theme:t="light",variant:n="neutral",className:r="",title:o="",content:a="",icon:i=null,onClose:s,action:l={label:"",onClick:()=>{},type:"link"}})=>{const c=()=>{"function"==typeof s&&s()},u={neutral:"ring-alert-border-neutral bg-alert-background-neutral",custom:"ring-alert-border-neutral bg-alert-background-neutral",info:"ring-alert-border-info bg-alert-background-info",success:"ring-alert-border-green bg-alert-background-green",warning:"ring-alert-border-warning bg-alert-background-warning",error:"ring-alert-border-danger bg-alert-background-danger"},d="bg-background-inverse ring-background-inverse",f={light:"text-icon-secondary",dark:"text-icon-inverse"},p=()=>{l?.onClick?.(c)};return"stack"===e?(0,C.jsx)("div",{role:"alert",className:Se("flex items-center justify-start p-4 gap-2 relative ring-1 rounded-md shadow-lg","dark"===t?d:u?.[n],r),children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Fo({variant:n,icon:i,theme:t})}),(0,C.jsxs)("div",{className:"flex flex-col items-start justify-start gap-0.5 mr-7",children:[Zo({title:o,theme:t}),Vo({content:a,theme:t}),l?.label&&"function"==typeof l?.onClick&&(0,C.jsx)("div",{className:"mt-2.5",children:Yo({actionLabel:l?.label,actionType:l?.type??"button",onAction:p,theme:t})})]}),(0,C.jsx)("div",{className:"absolute right-4 top-4 [&_svg]:size-5",children:(0,C.jsx)("button",{className:Se("bg-transparent m-0 p-0 border-none focus:outline-none focus-visible:ring-2 focus-visible:ring-toggle-on focus-visible:ring-offset-2 active:outline-none cursor-pointer rounded",f[t]??f.light),onClick:()=>c(),"aria-label":"Close alert",children:(0,C.jsx)(Ho,{"aria-hidden":"true"})})})]})}):(0,C.jsxs)("div",{role:"alert",className:Se("flex items-center justify-between p-3 gap-2 relative ring-1 rounded-lg shadow-lg","dark"===t?d:u?.[n],r),children:[(0,C.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[(0,C.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Fo({variant:n,icon:i,theme:t})}),(0,C.jsxs)("p",{className:"content-start space-x-1 my-0 mr-10 px-1",children:[Zo({title:o,theme:t,inline:!0}),Vo({content:a,theme:t,inline:!0})]})]}),(0,C.jsxs)("div",{className:"flex h-full justify-start gap-4 [&_svg]:size-4",children:[l?.label&&"function"==typeof l?.onClick&&(0,C.jsx)("div",{className:"self-center flex h-5",children:Yo({actionLabel:l?.label,actionType:l?.type??"button",onAction:p,theme:t})}),"function"==typeof s&&(0,C.jsx)("button",{className:Se("self-start bg-transparent m-0 border-none p-0.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-toggle-on focus-visible:ring-offset-2 active:outline-none cursor-pointer size-5 rounded",f[t]??f.light),onClick:()=>c(),"aria-label":"Close alert",children:(0,C.jsx)(Ho,{"aria-hidden":"true"})})]})]})},h_=["neutral","info","success","warning","error"],g_=function({variant:e="neutral",label:t="",desc:n="",className:r=""}){const o=h_.includes(e)?e:"neutral";return(0,i.createElement)(m_,{className:`wcf-field wcf-alert-field shadow-none ${r}`,variant:o,design:"inline",title:t,content:n?Nh(n):""})},w_=function({settings:e,displayAs:t="tr"}){const[{options:n}]=Nm();return(0,i.createElement)("div",{className:"wcf-list-options"},(0,i.createElement)("div",{className:"wcf-list-options-wrapper"},"tr"===t?(0,i.createElement)("table",{className:"w-full"},(0,i.createElement)("tbody",null,Object.keys(e.fields).map(t=>{const r=e.fields[t],o=n[r.name]?n[r.name]:"",a=Zm.isActiveControl(r,n);return(0,i.createElement)(i_,{key:t,data:r,value:o,isActive:a,field:t})}))):(0,i.createElement)("div",{className:"wcf-list-options-container"},Object.keys(e.fields).map(r=>{const o=e.fields[r],a=n[o.name]?n[o.name]:"",s=Zm.isActiveControl(o,n);return(0,i.createElement)(i_,{key:r,data:o,value:a,isActive:s,field:r,tabName:"list-options",displayAs:t})}))))},y_=function(e){const[t,n]=(0,i.useState)(e.isOpen?"":"collapsed"),r=e.settings.title.replace(/ /g,"_").toLowerCase(),o=e.settings.title.replace(/ /g,"-").toLowerCase();return(0,i.createElement)("div",{className:`wcf-${o} accordion-item bg-background-primary -mx-6 border-b border-border-subtle ${!1===e?.isActive?"hidden":""}`},(0,i.createElement)("h2",{className:"accordion-header mb-0 "+("landing"===e?.settings?.step_type&&"general"===e?.settings?.slug?"hidden":""),id:`wcf_${r}_toggler`.toLowerCase()},(0,i.createElement)("button",{className:`wcf-accordion-button appearance-none bg-transparent border-none cursor-pointer relative flex justify-between items-center w-full py-4 px-6 text-base font-semibold text-text-primary text-left transition focus:outline-none ${t}`,type:"button","data-bs-toggle":"collapse","data-bs-target":`#wcf_collapse_${r}`,"aria-expanded":"false","aria-controls":`wcf_collapse_${r}`,onClick:function(){n("collapsed"===t?"":"collapsed")}},(0,i.createElement)("span",null,e.settings.title),""===t?(0,i.createElement)(jg,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}):(0,i.createElement)(Fp,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}))),(0,i.createElement)("div",{id:`wcf_collapse_${r}`,className:`accordion-collapse px-6 pt-4 pb-8 ${t}`,"aria-labelledby":`wcf_${r}_toggler`},(0,i.createElement)("div",{className:"accordion-body"},(0,i.createElement)(w_,{settings:e.settings,displayAs:e.displayAs?e.displayAs:"tr"}))))},b_=function(){const[{step_id:e,design_settings:t,options:n,flow_type:r,flow_id:o,step_data:a,is_flow_instant_checkout:s}]=Nm(),l=t.settings,c=l?Object.values(l).sort(function(e,t){return e.priority-t.priority}):"",[{step_title:u}]=Nm(),f=(0,d.useHistory)(),p=dg();return(0,i.useEffect)(()=>{let e=!0;return()=>{e=!1}},[]),""===e?(0,i.createElement)(lw,null):(0,i.createElement)("div",{className:"wcf-design-page"},"storeCheckout"===r&&u&&"yes"!==s&&(0,i.createElement)("div",{className:"mb-3"},(0,i.createElement)("div",{className:"wcf-change-step wcf-button wcf-secondary-button",onClick:async function(){await p({title:(0,j.__)("Update Template","cartflows"),description:(0,j.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"),actionBtnText:(0,j.__)("Update","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")})&&f.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&step_id=${e}&flow_id=${o}&tab=update-template`)}},(0,i.createElement)("span",{className:""},(0,j.__)("Change Template","cartflows")))),(0,i.createElement)("div",{className:"wcf-step-notices-wrapper rounded-md bg-alert-background-warning border border-yellow-200 p-4 mb-3"},(0,i.createElement)("div",{className:"flex"},(0,i.createElement)("div",{className:"text-sm text-support-warning"},"yes"===s&&["checkout","upsell","downsell","thankyou"].includes(a?.type)?(0,i.createElement)(i.Fragment,null,(0,j.sprintf)(
22 16 // translators: %s: The current step type.
23 17 // translators: %s: The current step type.
24 -(0,C.__)("Use this setting to customize the style of the Instant %s Layout.","cartflows"),"thankyou"===a?.type?(0,C.__)("Thank You","cartflows"):a?.type.charAt(0).toUpperCase()+a?.type.slice(1))):(0,i.createElement)(i.Fragment,null,(0,C.__)("If you are using shortcodes, enable this design settings to apply styles.","cartflows"))))),u&&(0,i.createElement)("div",{className:"wcf-design-page__settings"},(0,i.createElement)("div",{className:"mb-4"},(0,i.createElement)(yM,{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:n["wcf-enable-design-settings"],label:(0,C.__)("Enable Design Settings","cartflows"),fullWidth:!0})),"yes"===n["wcf-enable-design-settings"]&&Object.keys(u).map((e,t)=>(0,i.createElement)(DI,{settings:u[e],key:e,isOpen:0===t,isActive:dm.isActiveControl(u[e],n)}))))},jI=({title:e="",description:t="",icon:n=null,iconPosition:r="right",tag:o="h2",size:a="sm",className:i=""})=>{const s={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!e)return null;const l=()=>(0,j.jsx)(o,{className:Se("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[a]),children:e});return t?(0,j.jsxs)("div",{className:i,children:[(0,j.jsxs)("div",{children:[n&&"left"===r&&(0,j.jsxs)("div",{className:Se("flex items-center",s[a]),children:[n,l()]}),n&&"right"===r&&(0,j.jsxs)("div",{className:Se("flex items-center",s[a]),children:[l(),n]}),!n&&l()]}),(0,j.jsx)("p",{className:Se("text-text-secondary font-normal my-0",{xs:"text-sm",sm:"text-sm",md:"text-base",lg:"text-base"}[a]),children:t})]}):(0,j.jsxs)("div",{className:i,children:[n&&"left"===r&&(0,j.jsxs)("div",{className:Se("flex items-center",s[a]),children:[n,l()]}),n&&"right"===r&&(0,j.jsxs)("div",{className:Se("flex items-center",s[a]),children:[l(),n]}),!n&&l()]})},AI=function(e){const t=e.heading?e.heading:"",n=e.subHeading?e.subHeading:"",r=e.description?e.description:"",o=e.btnText||(0,C.__)("Upgrade to CartFlows Pro","cartflows"),a=e.class?e.class:"",s=e.usps?e.usps:"";return(0,i.createElement)("div",{className:`wcf-upgrade-to-pro-cta ${a}`},(0,i.createElement)("div",{className:"bg-brand-25 border border-solid border-brand-200 rounded-xl px-5 py-5 lg:px-6 sm:py-5"},(0,i.createElement)("div",{className:"flex flex-col gap-3"},t&&(0,i.createElement)(jI,{size:"sm",tag:"h2",title:t}),n&&(0,i.createElement)(Vm,{size:14,color:"secondary"},n),(0,i.createElement)("div",{className:"flex items-center"},(0,i.createElement)(fI,{buttonLink:e.buttonLink,ctaText:o}))),r&&(0,i.createElement)(Vm,{size:14,color:"secondary",className:"wcf-upgrade-to-pro-cta--text mt-3"},r),s&&(0,i.createElement)("ul",{className:"wcf-upgrade-to-pro-cta-list list-none p-0 m-0 mt-3"},s.map((e,t)=>(0,i.createElement)("li",{className:"wcf-upgrade-to-pro-cta-list-item flex gap-2 items-center mb-2",key:t},(0,i.createElement)(Uh,{className:"w-18 h-18 stroke-2 text-brand-500 shrink-0"}),(0,i.createElement)(Vm,{size:14,color:"secondary"},e))))))},TI=function(){return(0,i.createElement)("div",{className:"wcf-settings-nav"},(0,i.createElement)("div",{className:"wcf-settings-nav__tabs"},Array(5).fill().map(e=>(0,i.createElement)("div",{className:"wcf-settings-nav__tab",key:e},(0,i.createElement)(Ig,{height:"45px"})))),(0,i.createElement)("div",{className:"wcf-settings-nav__content"},(0,i.createElement)(_g,{fontSize:"35px",width:"225px"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"65%"}),(0,i.createElement)(Mg,null),(0,i.createElement)(_g,{fontSize:"35px",width:"300px"}),(0,i.createElement)(_g,{width:"60%"}),(0,i.createElement)(_g,{width:"60%"}),(0,i.createElement)(_g,{width:"45%"})))},LI=function(){const[{step_id:e,flow_id:t,step_data:n}]=Yp(),[r,o]=(0,s.useState)("collapsed"),a=(0,h.useHistory)(),l=Oh();return(0,i.createElement)("div",{className:"wcf-change-step-template accordion-item bg-background-primary -mx-8 border-b border-border-subtle"},(0,i.createElement)("h2",{className:"accordion-header mb-0",id:"wcf_change_step_template_toggler"},(0,i.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none ${r}`,type:"button","data-bs-toggle":"collapse","data-bs-target":"#wcf_collapse_change_step_template","aria-expanded":"false","aria-controls":"wcf_collapse_change_step_template",onClick:function(){o("collapsed"===r?"":"collapsed")}},(0,i.createElement)("span",null,(0,C.__)("Change Template","cartflows")),""===r?(0,i.createElement)(gg,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}):(0,i.createElement)(Lp,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}))),(0,i.createElement)("div",{id:"wcf_collapse_change_step_template",className:`accordion-collapse px-8 pt-4 pb-8 ${r}`,"aria-labelledby":"wcf_change_step_template_toggler"},(0,i.createElement)("div",{className:"accordion-body"},(0,i.createElement)("div",{className:"mb-3 flex items-center gap-4"},(0,i.createElement)("img",{src:function(){let e="";switch(n.type){case"landing":e=ch;break;case"checkout":e=uh;break;case"optin":e=ph;break;case"thankyou":e=mh;break;case"upsell":e=dh;break;case"downsell":e=fh}return e}(),alt:n.type,className:"rounded-lg w-[85px] h-[85px]"}),(0,i.createElement)("div",{className:"wcf-template-content"},(0,i.createElement)("div",{className:"wcf-step-template-type mb-3"},(0,i.createElement)("span",{className:"text-sm font-medium"},(0,C.__)("Step Type: ","cartflows")),(0,i.createElement)("span",{className:"text-sm font-normal text-text-secondary capitalize"},n.type)),(0,i.createElement)("div",{className:"wcf-change-step wcf-button wcf-secondary-button",onClick:async function(){await l({title:(0,C.__)("Update Template","cartflows"),description:(0,C.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"),actionBtnText:(0,C.__)("Update","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})&&a.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}step_id=${e}&tab=update-template`)}},(0,i.createElement)("span",{className:""},(0,C.__)("Update Template","cartflows"))))))))},OI=function(){const[{step_data:e,settings_data:t,page_builder:n,flow_type:r,step_title:o,options:a}]=Yp(),[{license_status:s}]=f();let l=!0;if(void 0!==e.id&&(l=!1),l||!t?.settings)return(0,i.createElement)(TI,null);const c=t.settings,u=Object.values(c).sort(function(e,t){return e.priority-t.priority});return["upsell","downsell"].includes(e.type)&&wcfCartflowsPro()&&"Activated"!==s?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,i.createElement)(AI,{heading:(0,C.__)("License is required!","cartflows"),subHeading:(0,C.__)("Activate the license to modify this offer step's settings","cartflows")}))):(0,i.createElement)("div",{className:"wcf-settings-page"},c&&Object.keys(u).map((t,r)=>"other"!==n&&"shortcode"===u[t].slug?null:(u[t].step_type=e?.type||"",(0,i.createElement)(DI,{settings:u[t],key:t,displayAs:"div",isOpen:0===r,isActive:dm.isActiveControl(u[t],a)}))),"storeCheckout"===r&&o&&(0,i.createElement)(LI,null))},zI=function({settings:e},t="tr"){const[{options:n}]=Yp(),r=e=>{let t="";const r=e.name;if(r&&r.includes("[")){const o=r.split("["),a=[];for(let e=1;e<o.length;e++)a.push(o[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=n[i],l=n["wcf-offer-product"];if((null==l||""===l||l.length<=0)&&("wcf-offer-product[original_price]"===r||"wcf-offer-product[sell_price]"===r))return(0,C.__)("No product Selected","cartflows");const c=Array.isArray(l)?parseFloat(l[0].original_price):parseFloat(l.original_price);if("wcf-offer-product[sell_price]"===r&&c){const t=n["wcf-offer-discount"],r=parseFloat(n["wcf-offer-discount-value"]);let o=c;return"discount_percent"===t?r>0&&(o=(c-c*r/100).toFixed(2)):"discount_price"===t&&r>0&&(o=(c-r).toFixed(2)),e.class=o<0?"error_field":"",o}t=s[a[0]]}else t=n[e.name]?n[e.name]:"";return t};return(0,i.createElement)("div",{className:"wcf-list-options wcf-offer-list-options"},(0,i.createElement)("div",{className:"wcf-list-options-wrapper"},"tr"===t?(0,i.createElement)("table",{className:"w-full"},(0,i.createElement)("tbody",null,Object.keys(e.fields).map(t=>{const o=e.fields[t],a=r(o),s=dm.isActiveControl(o,n);return(0,i.createElement)(hM,{key:t,data:o,value:a,isActive:s,field:t})}))):(0,i.createElement)("div",{className:"wcf-list-options-container"},Object.keys(e.fields).map(o=>{const a=e.fields[o],s=r(a),l=dm.isActiveControl(a,n);return(0,i.createElement)(hM,{key:o,data:a,value:s,isActive:l,field:o,tabName:"list-options",displayAs:t})}))),(0,i.createElement)("table",null,(0,i.createElement)("tbody",null)))},PI=function(){return(0,i.createElement)("div",{className:"wcf-checkout-products is-placeholder"},(0,i.createElement)("div",{className:"wcf-checkout-products--selection wcf-checkout__section"},(0,i.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,i.createElement)("div",{className:"wcf-list-options"},(0,i.createElement)("div",{className:"wcf-list-options__title"},(0,i.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("th",null,(0,i.createElement)("div",{className:"wcf-checkout-product-selection-field"},(0,i.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new"},(0,i.createElement)("div",{className:"wcf-checkout-products__button"}),(0,i.createElement)("div",{className:"wcf-checkout-products__button"})))))))))),(0,i.createElement)("div",{className:"wcf-checkout-products__pro-options"},(0,i.createElement)("div",{className:"wcf-checkout-products--coupon"},(0,i.createElement)("div",{className:"wcf-coupon-selection-wrapper"},(0,i.createElement)("div",{className:"wcf-list-options"},(0,i.createElement)("div",{className:"wcf-list-options__title"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("th",null,(0,i.createElement)("div",null,(0,i.createElement)("div",{className:"wcf-select2-field"},(0,i.createElement)("div",{className:"title"}))))))))))),(0,i.createElement)("div",{className:"wcf-field wcf-submit"},(0,i.createElement)("div",{className:"wcf-checkout-products__button"})))},RI=function(){const[{settings_data:e,page_settings:t,options:n,step_data:r},o]=Yp(),[{license_status:a}]=f(),l=n["wcf-offer-product"]?n["wcf-offer-product"]:"",c=[{value:"",label:"No Discount",icon:(0,i.createElement)(ix,{className:"w-5 h-5"})},{value:"discount_percent",label:"Discount Percentage",icon:(0,i.createElement)(lx,{className:"w-5 h-5"})},{value:"discount_price",label:"Discount Price",icon:(0,i.createElement)(ux,{className:"w-5 h-5"})}],[u,d]=(0,s.useState)(),[p,m]=(0,s.useState)(""),h=(0,C.__)("Add","cartflows"),g=void 0===l.discount_type||""===l.discount_type?"disable":"enable",[w,y]=(0,s.useState)(g);(0,s.useEffect)(()=>{y(l?.discount_type?"enable":"disable")},[l]);const[b,v]=(0,s.useState)({isInProcessing:!1,buttonText:h}),{isInProcessing:x,buttonText:N}=b;return void 0===e.settings?(0,i.createElement)(PI,null):["upsell","downsell"].includes(r.type)&&wcfCartflowsPro()&&"Activated"!==a?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,i.createElement)(AI,{heading:(0,C.__)("License is required!","cartflows"),subHeading:(0,C.__)("Activate the license to modify this offer step's settings","cartflows")}))):(0!==l.length&&function(){const e=n["wcf-offer-discount"],t=parseFloat(n["wcf-offer-discount-value"]),r=parseFloat(l.original_price);let o=0;"discount_percent"===e?t>0&&(o=r-r*t/100):"discount_price"===e&&t>0&&(o=r-t),l.sell_price=o.toFixed(2)}(),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-offer-product--wrapper"},(0,i.createElement)("div",{className:"wcf-offer-products--selection wcf-products__section"},0===l.length?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("input",{name:"wcf-offer-product[]",type:"hidden",value:""}),(0,i.createElement)("div",{className:"wcf-offer-no-product--notice border border-border-subtle bg-gray-25 text-center text-sm font-normal rounded-md p-5"},(0,C.__)("Once you select the product, they will be displayed here.","cartflows")),(0,i.createElement)("div",{className:"wcf-offer-product-selection-field__add-new flex justify-between items-end gap-5 mt-5"},(0,i.createElement)(sM,{name:"",desc:"",field:"product",value:p,allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,C.__)("Search for a Product","cartflows"),onChangeCB:d,sectionClass:"flex-1"}),(0,i.createElement)(Ro,{type:"button",variant:"outline",size:"md",icon:(0,i.createElement)(yg,{className:"w-4 h-4"}),iconPosition:"left",loading:x,disabled:x,onClick:function(){const e=u?.value;m(u),e&&(v({isInProcessing:!0,buttonText:(0,C.__)("Adding…","cartflows")}),qf()({path:`/cartflows/v1/admin/product-data/${e}`}).then(t=>{console.log(t),o({type:"ADD_OFFER_PRODUCT",field_name:"wcf-offer-product",product_data:{value:e,quantity:"1",label:u?.label,img_url:t?.img_url,original_price:t?.regular_price}}),m(null),v({isInProcessing:!1,buttonText:h})}),d(null))},className:"wcf-select-product-button shrink-0 h-fit"},N))):(0,i.createElement)("div",{className:"overflow-visible shadow border border-border-subtle rounded-md"},(0,i.createElement)("div",{className:"wcf-offer-product-selection--header border-b border-border-subtle flex gap-4 p-3"},(0,i.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-2/5"},(0,C.__)("Items","cartflows")),(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-20"},(0,C.__)("Quantity","cartflows")),(0,i.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-44"},(0,C.__)("Discount","cartflows")),(0,i.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-24"},(0,C.__)("Shipping Rate","cartflows")),(0,i.createElement)("div",{className:"relative w-[5%]"},(0,i.createElement)("span",{className:"sr-only"},(0,C.__)("Delete","cartflows"))))),(0,i.createElement)("div",{className:"wcf-offer-product-selection--selected-product flex items-center p-3 gap-4"},(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-2/5"},(0,i.createElement)("div",{className:"flex gap-3 items-center"},(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-image flex w-24 h-24"},(0,i.createElement)("img",{src:l.img_url?l.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:Zm(l.label)})),(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-title_text"},(0,i.createElement)("div",{className:"wcf-offer-product-repeater-field__title whitespace-normal text-left","data-product_id":l.value},Zm(l.label)),(0,i.createElement)("div",{className:"wcf-offer-product-repeater-field__reg-price mt-1"},(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"wcf-offer-product--reg-price "+(0<l.sell_price?"line-through text-text-tertiary":"")},cartflows_admin.woo_currency+l.original_price),0<l.sell_price&&(0,i.createElement)("span",{className:"wcf-offer-product--sale-price"},cartflows_admin.woo_currency+l.sell_price)))))),(0,i.createElement)("div",{className:"flex-1 flex gap-2"},(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-qty"},(0,i.createElement)(xx,{id:"",name:"wcf-offer-quantity",class:"input-field !w-20 !text-sm font-normal !m-0",value:n["wcf-offer-quantity"],min:"1"})),(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-discount flex gap-2"},(0,i.createElement)(vM,{name:"wcf-offer-discount",value:n["wcf-offer-discount"],class:"!w-20 !m-0",options:c,callback:function(e,t,n){y(""===n?"disable":"enable")}}),(0,i.createElement)(xx,{id:"",class:"input-field !w-20 !m-0",name:"wcf-offer-discount-value",value:"disable"===w?"":n["wcf-offer-discount-value"],readonly:"disable"===w?"readonly":"",placeholder:"disable"===w?"":"0",min:"1",step:"any"})),(0,i.createElement)("div",{className:"wcf-offer-product-selection--flat-rate flex"},(0,i.createElement)(xx,{id:"",class:"input-field !w-20 !m-0",name:"wcf-offer-flat-shipping-value",placeholder:"0",value:n["wcf-offer-flat-shipping-value"],min:"0"})),(0,i.createElement)("div",{className:"wcf-offer-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[5%] justify-center"},(0,i.createElement)("div",{className:"wcf-delete-product-item py-2 text-brand-500 hover:text-brand-700 cursor-pointer text-right flex justify-end",onClick:function(){o({type:"REMOVE_OFFER_PRODUCT",field_name:"wcf-offer-product"})}},(0,i.createElement)($m,{className:"h-18 w-18"}))),(0,i.createElement)("input",{name:"wcf-offer-product[]",type:"hidden",className:"wcf-checkout-product-id",value:l.value}))))),(0,i.createElement)("div",{className:"wcf-offer-product--common-settings pt-8"},(0,i.createElement)(zI,{settings:t?.settings.product,displayAs:"div"})))))},UI=function(){return(0,i.createElement)("div",{className:"flex flex-col gap-5"},(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(bI,{className:"w-40 h-4"}),(0,i.createElement)(bI,{className:"w-10 h-5 rounded-full"})),(0,i.createElement)(bI,{className:"w-full h-48 rounded-lg"}),(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)(bI,{className:"w-1/3 h-9 rounded-md"}),(0,i.createElement)(bI,{className:"w-1/3 h-9 rounded-md"}),(0,i.createElement)(bI,{className:"w-1/3 h-9 rounded-md"})),["w-32","w-40","w-28","w-36"].map((e,t)=>(0,i.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,i.createElement)(bI,{className:`${e} h-3.5`}),(0,i.createElement)(bI,{className:"w-full h-10 rounded-md"}))))},BI=function(e){const[{page_settings:t,options:n}]=Yp(),r=e=>{let t="";const r=e.name;if(r&&r.includes("[")){const o=r.split("["),a=[];for(let e=1;e<o.length;e++)a.push(o[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=n[i];if("wcf-pre-checkout-offer-product[original_price]"===r||"wcf-pre-checkout-offer-product[sell_price]"===r){const t=n["wcf-pre-checkout-offer-product"];if(""===t||null==t||t.length<=0)return(0,C.__)("No product Selected","cartflows");const o=Array.isArray(t)?parseFloat(t[0].original_price):parseFloat(t.original_price);if("wcf-pre-checkout-offer-product[original_price]"===r)return isNaN(o)?"":String(o);if("wcf-pre-checkout-offer-product[sell_price]"===r&&!isNaN(o)){const t=n["wcf-pre-checkout-offer-discount"],r=parseFloat(n["wcf-pre-checkout-offer-discount-value"]);let a=o;return"discount_percent"===t?r>0&&(a=(o-o*r/100).toFixed(2)):"discount_price"===t&&r>0&&(a=(o-r).toFixed(2)),e.class=a<0?"error_field":"",isNaN(parseFloat(a))?"":String(a)}}t=s[a[0]]}else t=n[e.name]?n[e.name]:"";return t};let o=[];switch(e.tab){case"product":default:o=t?.settings["checkout-offer-product"];break;case"content":o=t?.settings["checkout-offer-content"];break;case"styles":o=t?.settings["checkout-offer-styles"]}const a=function(t){return Object.keys(t.section_fields).map(o=>{const a=t.section_fields[o],s=r(a),l=dm.isActiveControl(a,n);return(0,i.createElement)(hM,{key:o,data:a,value:s,isActive:l,field:o,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""})})};return(0,i.createElement)("div",{className:"wcf-list-options wcf-co-list-options"},(0,i.createElement)("div",{className:"wcf-co-options-wrapper",id:"wcf-co-options-wrapper"},o&&Object.keys(o.fields).map(t=>{const s=o.fields[t];return s.section_fields?(0,i.createElement)("div",{key:t,className:`wcf-${e.tab?e.tab:"setting"}-tab--${s.id}-section p-5 border border-border-subtle rounded-md mb-5`},(0,i.createElement)("div",{className:`wcf-${e.tab?e.tab:"setting"}-tab--heading-section col-span-full`},(0,i.createElement)(Q_,{label:s.title,labelClass:"block text-base font-semibold text-text-primary mb-5"})),e.displayAs&&"tr"===e.displayAs?(0,i.createElement)("table",{className:"w-full"},(0,i.createElement)("tbody",null,a(s))):(0,i.createElement)("div",{className:"wcf-co-list-options-container"},a(s))):(0,i.createElement)("div",{key:t,className:`wcf-${e.tab?e.tab:"setting"}-tab--section mb-5`},e.displayAs&&"tr"===e.displayAs?(0,i.createElement)("table",{className:"wcf-full"},(0,i.createElement)("tbody",null,(0,i.createElement)(hM,{key:t,data:s,value:r(s),isActive:dm.isActiveControl(s,n),field:s,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""}))):(0,i.createElement)("div",{className:"wcf-co-list-options-container"},(0,i.createElement)(hM,{key:t,data:s,value:r(s),isActive:dm.isActiveControl(s,n),field:s,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""})))})))};function FI({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"}))}const QI=s.forwardRef(FI);function VI({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"}))}const YI=s.forwardRef(VI),ZI=function(){const[{options:e}]=Yp(),[t,n]=(0,s.useState)("");(0,s.useEffect)(()=>{const e=document.getElementById("wcf-checkout-offer-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")});return()=>{window.removeEventListener("scroll",n)}},[]);let r=e["wcf-pre-checkout-offer-product"];null!==r&&Array.isArray(r)&&(r=r[0]);const o=e["wcf-pre-checkout-offer-discount"],a=parseFloat(e["wcf-pre-checkout-offer-discount-value"]);let l="";const c=r?parseFloat(r.original_price).toFixed(2):0;"discount_percent"===o?a>0&&(l=(c-c*a/100).toFixed(2)):"discount_price"===o&&a>0&&(l=(c-a).toFixed(2));const u=r&&r.product_image?r.product_image:cartflows_admin.image_placeholder;return(0,i.createElement)("div",{id:"wcf-checkout-offer-preview-wrapper",className:"fullscreen"===t?"wcf-checkout-offer-preview-wrapper fullscreen":"wcf-checkout-offer-preview-wrapper"},(0,i.createElement)("div",{className:"fullscreen"===t?"p-6":"mt-8 bg-background-secondary p-6 -mx-6"},(0,i.createElement)("div",{className:"wcf-pre-checkout-offer--header flex justify-between items-center mb-5 p-2.5"},(0,i.createElement)(Of,{tag:"span",size:"md",className:"font-semibold text-text-primary"},(0,C.__)("Preview","cartflows")),""===t&&(0,i.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-button p-2.5 text-text-tertiary hover:text-text-secondary cursor-pointer",onClick:()=>n("fullscreen")},(0,i.createElement)(QI,{className:"w-5 h-5 stroke-2",title:(0,C.__)("View in Full Screen","cartflows")})),"fullscreen"===t&&(0,i.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-exit-button p-2.5 text-text-tertiary hover:text-text-secondary cursor-pointer",onClick:()=>n("")},(0,i.createElement)(YI,{className:"w-5 h-5 stroke-2",title:(0,C.__)("Exit Full Screen","cartflows")}))),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-wrapper wcf-pre-checkout-full-width"},(0,i.createElement)("div",{id:"wcf-pre-checkout-offer-modal",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]},className:"bg-background-primary border border-border-subtle rounded-md"},(0,i.createElement)("div",{className:"wcf-content-main-wrapper"},(0,i.createElement)("div",{className:"wcf-lightbox-content p-6",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]}},(0,i.createElement)("div",{className:"wcf-content-modal-progress-bar mb-8"},(0,i.createElement)("div",{className:"wcf-progress-bar-nav",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,i.createElement)("div",{className:"wcf-pre-checkout-progress grid grid-cols-3 text-center text-sm font-normal text-text-secondary max-w-2xl mx-auto"},(0,i.createElement)("div",{className:"wcf-nav-bar-step active"},(0,i.createElement)("div",{className:"wcf-nav-bar-title mb-3",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,C.__)("Order Submitted","cartflows")),(0,i.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,i.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}},(0,i.createElement)("span",{className:"before"})),(0,i.createElement)("span",{className:"order-after",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}}))),(0,i.createElement)("div",{className:"wcf-nav-bar-step active inprogress"},(0,i.createElement)("div",{className:"wcf-nav-bar-title mb-3",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,C.__)("Special Offer","cartflows")),(0,i.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,i.createElement)("span",{className:"before",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}}),(0,i.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}},(0,i.createElement)("span",{className:"before"})),(0,i.createElement)("span",{className:"after"}))),(0,i.createElement)("div",{className:"wcf-nav-bar-step"},(0,i.createElement)("div",{className:"wcf-nav-bar-title mb-3"},(0,C.__)("Order Receipt","cartflows")),(0,i.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,i.createElement)("span",{className:"before"}),(0,i.createElement)("div",{className:"wcf-progress-nav-step"})))))),(0,i.createElement)("div",{className:"wcf-content-main-head text-center mb-8"},(0,i.createElement)("div",{className:"wcf-content-modal-title"},(0,i.createElement)("h1",{style:{color:e["wcf-pre-checkout-offer-title-color"]},className:"text-xl font-semibold text-text-primary mb-2.5"},e["wcf-pre-checkout-offer-popup-title"])),(0,i.createElement)("div",{className:"wcf-content-modal-sub-title"},(0,i.createElement)("span",{style:{color:e["wcf-pre-checkout-offer-subtitle-color"]},className:"text-sm font-normal text-600"},e["wcf-pre-checkout-offer-popup-sub-title"]))),(0,i.createElement)("div",{id:"wcf-pre-checkout-offer-content",className:"woocommerce border-2 border-border-subtle border-dashed rounded items-center",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]}},(0,i.createElement)("div",{className:"flex gap-4 p-5 items-center"},(0,i.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-img w-2/5"},(0,i.createElement)("img",{src:u,alt:"Checkout Offer Product",className:"border border-border-subtle"})),(0,i.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-offer-product-details w-3/5"},(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-product-title"},(0,i.createElement)("h1",{style:{color:e["wcf-pre-checkout-offer-title-color"]}},e["wcf-pre-checkout-offer-product-title"])),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-price",style:{color:e["wcf-pre-checkout-offer-desc-color"],fontWeight:500}},cartflows_admin.woo_currency,""!==l&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("del",{className:"wcf-regular-price"},isNaN(c)?0:c),(0,i.createElement)("span",{className:"wcf-discount-price"}," ",l)),""===l&&(0,i.createElement)("span",{className:"wcf-regular-price"},isNaN(c)?0:c)),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-desc"},(0,i.createElement)("span",{style:{color:e["wcf-pre-checkout-offer-desc-color"],lineHeight:"0"}},Zm((e["wcf-pre-checkout-offer-desc"]||"").toString()))),(0,i.createElement)("input",{type:"hidden",value:"add",className:"wcf-pre-checkout-offer-action"}))),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-actions flex flex-col gap-3 p-5"},(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-add-cart-btn"},(0,i.createElement)("button",{className:"wcf-pre-checkout-offer-btn alt !w-full text-base !bg-brand-500 !rounded !text-text-on-color !font-semibold px-4 py-3 !text-center",style:{backgroundColor:e["wcf-pre-checkout-offer-button-color"],borderColor:e["wcf-pre-checkout-offer-button-color"]}},e["wcf-pre-checkout-offer-popup-btn-text"])),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-skip-btn text-center"},(0,i.createElement)("a",{className:"wcf-pre-checkout-skip text-text-tertiary",href:"#",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},e["wcf-pre-checkout-offer-popup-skip-btn-text"]))))))))))},WI=function(){const[{settings_data:e,options:t}]=Yp(),[n,r]=(0,s.useState)("product"),o=Oh();if(!wcfCartflowsPro())return(0,i.createElement)(V_,{feature:"Checkout Offer",plan_required:"starter"});if(void 0===e.settings)return(0,i.createElement)(UI,null);const a="yes"===t["wcf-pre-checkout-offer"];return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(yM,{name:"wcf-pre-checkout-offer",value:t["wcf-pre-checkout-offer"],label:(0,C.__)("Enable Checkout Offer","cartflows"),fullWidth:!0}),a&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-co-preview"},(0,i.createElement)(ZI,null)),(0,i.createElement)("div",{className:"mt-8 mb-8"},(0,i.createElement)(YM.Group,{variant:"rounded",size:"sm",width:"full",activeItem:n,onChange:({value:e})=>async function(e){e!==n?(await async function(){return!!window.wcfUnsavedChanges&&await o({title:(0,C.__)("Save Changes","cartflows"),description:(0,C.__)("You have made changes. Do you want to save the changes?","cartflows"),actionBtnText:(0,C.__)("Save","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})}()||r(e),window.wcfUnsavedChanges=!1):r(e)}(e.slug)},(0,i.createElement)(YM.Tab,{slug:"product",text:(0,C.__)("Product","cartflows"),icon:(0,i.createElement)(HM,{className:"w-4 h-4"})}),(0,i.createElement)(YM.Tab,{slug:"content",text:(0,C.__)("Content","cartflows"),icon:(0,i.createElement)(XM,{className:"w-4 h-4"})}),(0,i.createElement)(YM.Tab,{slug:"styles",text:(0,C.__)("Styles","cartflows"),icon:(0,i.createElement)(JM,{className:"w-4 h-4"})}))),(0,i.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section"},(0,i.createElement)(BI,{tab:n,displayAs:"div"}))))},GI=function(){return(0,i.createElement)("div",{className:"wcf-checkout-rules-page"},(0,i.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,i.createElement)(_g,{width:"65%"})),(0,i.createElement)("div",{className:"wcf-checkout-rules--group_wrapper"},(0,i.createElement)("div",{className:"wcf-checkout-rules--text"},(0,i.createElement)(_g,{width:"10%"}),(0,i.createElement)(Ig,{width:"25%",height:"35px"}),(0,i.createElement)(_g,{width:"20%"})),(0,i.createElement)("div",{className:"wcf-checkout-rules"},Array(3).fill().map((e,t)=>(0,i.createElement)("div",{className:"wcf-checkout-rule",key:t},(0,i.createElement)("div",{className:"wcf-checkout-rule--select-box"},(0,i.createElement)(Ig,{height:"35px",width:"30%"}),(0,i.createElement)(Ig,{height:"35px",width:"30%"}),(0,i.createElement)(Ig,{height:"35px",width:"30%"})),2!==t&&(0,i.createElement)("div",{className:"wcf-checkout-rule__and"},(0,i.createElement)(Ig,{height:"25px",width:"5%"}))))),(0,i.createElement)(Ig,{height:"40px",width:"9%"})),(0,i.createElement)("div",{className:"wcf-checkout-rules--or"},(0,i.createElement)(Ig,{height:"35px",width:"5%"}),(0,i.createElement)(Ig,{height:"45px",width:"12%"})),(0,i.createElement)("div",{className:"wcf-checkout-rules--default-step"},(0,i.createElement)(_g,{width:"10%"}),(0,i.createElement)(Ig,{width:"25%",height:"35px"}),(0,i.createElement)(_g,{width:"20%"})))},HI=function(){return(0,i.createElement)(pI,{title:(0,C.__)("Show Every Customer the Offer They’ll Actually Buy","cartflows"),description:(0,C.__)("Target offers by location, cart value, and more. Upgrade to CartFlows Pro and turn every visit into a personalized sale.","cartflows")})},$I=function({rules:e,group_id:t,g_index:n,groups_length:r}){const[{page_settings:o},a]=Yp(),s=o?.settings.rules,l=s?.conditions;return(0,i.createElement)(i.Fragment,null,e.map((o,c)=>{const u=o?.rule_id,d=e[c],f=s?.field_data[d.condition],p=f?.operator||[],m=d.operator||p[0]?.value||"",h=String(m).replace(/</g,"&lt;").replace(/>/g,"&gt;"),g=((e=[])=>"wcf-checkout-rules--rule_fields flex flex-col justify-center items-end sm:grid gap-3 w-full "+(e.some(e=>"product"===e.type)?"sm:grid-cols-2":"sm:grid-cols-3"))(f?.fields);return(0,i.createElement)(i.Fragment,null,0!==c&&(0,i.createElement)("div",{className:"wcf-checkout-rules--group_rules__condition-label"},(0,i.createElement)("div",{className:"wcf--condition-label__and_group relative"},(0,i.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,i.createElement)("div",{className:"w-full border-t border-border-subtle border-dashed"})),(0,i.createElement)("div",{className:"relative flex justify-center"},(0,i.createElement)(Lf,{variant:"neutral",type:"rounded",size:"xs",label:(0,C.__)("AND","cartflows"),className:"wcf--condition-label__and_group__text"})))),(0,i.createElement)("div",{className:"wcf-checkout-rules--group_rules flex gap-3 items-center","data-rule-id":u,key:u},(0,i.createElement)("input",{type:"hidden",name:`wcf-checkout-rules[${n}][rules][${c}][rule_id]`,value:u}),(0,i.createElement)("div",{className:g},(0,i.createElement)(cw,{name:`wcf-checkout-rules[${n}][rules][${c}][condition]`,wrapperClass:"block",options:l,onSelect:()=>{a({type:"RESET_RULE_VALUE",name:"wcf-checkout-rules",group_id:t,rule_id:u})},value:d.condition,sectionClass:"w-full sm:!w-auto"}),(0,i.createElement)(cw,{name:`wcf-checkout-rules[${n}][rules][${c}][operator]`,wrapperClass:"block",options:f?.operator,value:Zm(h),sectionClass:"w-full sm:!w-auto"}),function(e,t,r){const o=r.value;let a="";const s=`wcf-checkout-rules[${n}][rules][${t}][value]`;return e&&e?.map(e=>{switch(e.type){case"multitext":a=(0,i.createElement)(wM,{name:`${s}`,value:o,fields:e.fields});break;case"text":a=(0,i.createElement)(uw,{name:`${s}`,value:o,placeholder:e.placeholder,tooltip:e.tooltip,contentClass:"w-full"});break;case"select2":a=(0,i.createElement)(ox,{name:`${s}[]`,value:o,placeholder:e.placeholder,tooltip:e.tooltip,options:e.options,isMulti:e.isMulti,isSearchable:e?.enable_search});break;case"number":a=(0,i.createElement)(xx,{name:s,value:o,min:0,placeholder:e.placeholder,tooltip:e.tooltip});break;case"coupon":a="exist"===r.operator||"not_exist"===r.operator?(0,i.createElement)(cw,{name:s,options:[{label:"in parent order",value:"parent_order"}]}):(0,i.createElement)(lM,{name:s,placeholder:e.placeholder,tooltip:e.tooltip,value:o,isMulti:e.isMulti});break;case"product":a=(0,i.createElement)(sM,{name:s,placeholder:e.placeholder,tooltip:e.tooltip,value:o,isMulti:e.isMulti,sectionClass:"col-span-full",showLabelOnly:!0})}return a})}(f?.fields,c,d)),(0,i.createElement)("div",{className:"wcf-checkout-rules--rule_actions"},function(e,n){return 1===e&&1===r?"":(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)($m,{className:"w-4 h-4 stroke-2 text-text-tertiary"}),className:"!p-1 hover:!bg-background-secondary [&_svg]:hover:text-brand-700",onClick:e=>{e.currentTarget.setAttribute("rule_id",n),(e=>{const n=e.target.getAttribute("rule_id");t&&n&&a({type:"REMOVE_RULE",name:"wcf-checkout-rules",rule_id:n,group_id:t})})({target:e.currentTarget})},rule_id:n})}(e.length,u))))}))},XI=e=>(0,i.createElement)("svg",(0,y.A)({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),(0,i.createElement)("circle",{cx:"7",cy:"5",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"7",cy:"10",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"7",cy:"15",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"13",cy:"5",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"13",cy:"10",r:"1.25",fill:"currentColor"}),(0,i.createElement)("circle",{cx:"13",cy:"15",r:"1.25",fill:"currentColor"})),qI=function(){const[{step_data:e,step_id:t,options:n},r]=Yp(),[o,a]=(0,s.useState)({ruleGroupId:"",isOpen:!1}),[{license_status:l}]=f(),{ruleGroupId:c,isOpen:u}=o;if(!wcfCartflowsPro()||"Activated"!==l)return(0,i.createElement)(HI,null);if(null===n)return(0,i.createElement)(GI,null);const d=n["wcf-checkout-rules"];if(void 0===d)return(0,i.createElement)(F_,{content:(0,C.__)("Please Update the CartFlows Pro to the latest version to use the dynamic offers feature.","cartflows")});const p=()=>{const e={group_id:Math.random().toString(36).substring(2,5),rules:[{rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""}]};r({type:"ADD_NEW_GROUP",name:"wcf-checkout-rules",newGroup:e})},m=function(e){const t=e.target.getAttribute("data-group_id");a({ruleGroupId:t,isOpen:c!==t||!u})};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-checkout-rules-page"},(0,i.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,i.createElement)(yM,{name:"wcf-checkout-rules-option",value:n["wcf-checkout-rules-option"],label:(0,C.__)("Enable Dynamic Offers","cartflows"),tooltip:(0,C.__)("Turn this on to set up rules that decide when visitors should be redirected to a special offer or the next step.","cartflows"),fullWidth:!0})),"yes"===n["wcf-checkout-rules-option"]&&d&&(0,i.createElement)("div",{className:"mt-8"},(0,i.createElement)(Zp.ReactSortable,{id:"wcf-checkout-rules-sortable-wrapper",className:"wcf-checkout-rules--sortable-wrapper flex flex-col gap-4",list:d,setList:e=>r({type:"SET_RULES_GROUPS",groups:e,fieldName:"wcf-checkout-rules",step_id:t}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-checkout-rules--group",filter:".wcf-checkout-rules--rule_fields, .wcf-checkout-rules--rule_actions, .wcf-field.wcf-select-option, .wcf-checkout-rules--add-rule__repeater .wcf-button.wcf-button--secondary, .wcf-field__data--content, .wcf-checkout-rules-page--group_wrapper__footer, .wcf-checkout-rules--group_header",preventOnFilter:!1,onStart:function(){document.getElementsByClassName("wcf-checkout-rules--or_group__button")[0].setAttribute("style","display:none")},onEnd:function(){document.getElementsByClassName("wcf-checkout-rules--or_group__button")[0].setAttribute("style","display:inline-block")}},d.map((t,n)=>{const o=t.group_id,a=t.rules;return(0,i.createElement)("div",{className:"wcf-checkout-rules-page--group_wrapper",key:o},(0,i.createElement)("div",{className:"wcf-checkout-rules--group border border-solid border-cartflows-border rounded-md shadow-sm bg-background-primary overflow-hidden","data-group-id":o},(0,i.createElement)("input",{type:"hidden",name:`wcf-checkout-rules[${n}][group_id]`,value:o}),(0,i.createElement)("div",{className:"wcf-checkout-rules--group-header wcf-redirection-step bg-background-primary p-4 flex items-center justify-between flex-wrap gap-4"},(0,i.createElement)("div",{className:"wcf-checkout-rules--group-header__left flex gap-4 items-center"},(0,i.createElement)("div",{className:"wcf-checkout-rule--sortable-toggle flex cursor-move text-text-tertiary hover:text-text-secondary"},(0,i.createElement)(XI,null)),(0,i.createElement)("div",{className:"border border-solid border-cartflows-border rounded-md shadow-sm flex items-center gap-4 px-3 py-1 h-10 bg-background-primary"},(0,i.createElement)("div",{className:"text-sm font-normal text-text-tertiary whitespace-nowrap"},(0,C.__)("Redirect to:","cartflows")),(0,i.createElement)(cw,{name:`wcf-checkout-rules[${n}][step_id]`,class:"w-full !max-w-full h-auto input-field !text-sm !font-medium !rounded-none !text-text-primary !border-none focus:ring-0 focus:!border-none focus:!shadow-none !outline-0 !outline-none !m-0 !p-0 !placeholder-text-tertiary",value:t.step_id,placeholder:(0,C.__)("Search for step…","cartflows"),options:e.step_lists,overrideCss:!0})),(0,i.createElement)("div",{className:"text-sm font-normal text-text-tertiary"},(0,C.__)("If the following conditions are true","cartflows"))),(0,i.createElement)("div",{className:"wcf-checkout-rules--group-header__right flex gap-2 items-center"},c===o&&u?(0,i.createElement)(gg,{className:"w-4 h-4 stroke-1 text-text-tertiary hover:text-text-secondary cursor-pointer","aria-hidden":"true",onClick:m,"data-group_id":o}):(0,i.createElement)(Lp,{className:"w-4 h-4 stroke-1 text-text-tertiary hover:text-text-secondary cursor-pointer","aria-hidden":"true",onClick:m,"data-group_id":o}))),(0,i.createElement)("div",{id:`wcf-checkout-rules--group-${o}`,className:"p-4 bg-background-secondary border-t border-solid border-border-subtle border-0 "+(c===o&&u?"visible":"hidden")},(0,i.createElement)("div",{className:"wcf-checkout-rules--group-rules__wrapper flex flex-col gap-4"},0!==a.length&&(0,i.createElement)($I,{rules:a,group_id:o,g_index:n,groups_length:d.length})),(0,i.createElement)("div",{className:"wcf-checkout-rules--add-rule__repeater flex mt-4"},(0,i.createElement)(Ro,{variant:"link",size:"sm",icon:(0,i.createElement)(yg,{className:"w-4 h-4 stroke-2"}),iconPosition:"left",className:"wcf-checkout-rules--add-rule__button hover:!no-underline",onClick:()=>(e=>{const t={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};r({type:"ADD_NEW_RULE",name:"wcf-checkout-rules",newRule:t,group_id:e})})(o)},(0,C.__)("Add Condition","cartflows"))))),(0,i.createElement)("div",{className:"wcf-checkout-rules-page--group_wrapper__footer"},(0,i.createElement)("div",{className:"wcf-checkout-rules--or-group relative my-4"},(0,i.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,i.createElement)("div",{className:"w-full border-t border-border-subtle border-dashed"})),(0,i.createElement)("div",{className:"relative flex justify-center"},(0,i.createElement)(Lf,{variant:"neutral",type:"rounded",size:"xs",label:(0,C.__)("OR","cartflows"),className:"wcf-checkout-rules--or_group__text"}))),parseInt(n)+1===d.length&&(0,i.createElement)("div",{className:"wcf-checkout-rules--or_group__button mt-4"},(0,i.createElement)(Ro,{variant:"outline",size:"md",icon:(0,i.createElement)(yg,{className:"w-4 h-4 stroke-2"}),iconPosition:"left",className:"wcf-checkout-rules--or_group_button !bg-brand-25 !text-brand-600 !outline-brand-300 hover:!bg-brand-50 hover:!outline-brand-300",onClick:p},(0,C.__)("Add Dynamic Offer","cartflows")))))}))),"yes"===n["wcf-checkout-rules-option"]&&(0,i.createElement)("div",{className:"wcf-checkout-rules--default-step border border-solid border-cartflows-border rounded-md shadow-sm bg-background-primary p-4 flex items-center justify-between gap-4 mt-8"},(0,i.createElement)("div",{className:"wcf-checkout-rules--default-step__left border border-solid border-cartflows-border rounded-md shadow-sm flex items-center gap-4 px-3 h-10 bg-background-primary"},(0,i.createElement)("div",{className:"text-sm font-normal text-text-tertiary whitespace-nowrap"},(0,C.__)("Redirect to:","cartflows")),(0,i.createElement)(cw,{name:"wcf-checkout-rules-default-step",class:"w-full !max-w-full h-auto input-field !text-sm !font-medium !rounded-none !text-text-primary !border-none focus:ring-0 focus:!border-none focus:!shadow-none !outline-0 !outline-none !m-0 !p-0 !placeholder-text-tertiary",value:n["wcf-checkout-rules-default-step"],placeholder:(0,C.__)("Search for default step…","cartflows"),options:e.step_lists,overrideCss:!0})),(0,i.createElement)("div",{className:"text-sm font-normal text-text-tertiary"},(0,C.__)("If all of the above conditions failed.","cartflows")))))};function JI({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"}))}const KI=s.forwardRef(JI),eS=function(e){const{innerField:t,innerFieldData:n}=e,[{options:r}]=Yp();return(0,i.createElement)("div",{className:"wcf-field-item--fields-settings__wrapper bg-white hidden p-5 border border-solid border-border-subtle my-5 rounded-md shadow-sm",id:`wcf-field-setting-${t}`},n&&Object.keys(n.field_options).map(e=>{const t=n.field_options[e];let o="";const a=function(e){const t=e.name;let n="";if(t.includes("[")){const e=t.split("["),o=[];for(let t=1;t<e.length;t++)o.push(e[t].split("]")[0]);const a=t.substr(0,t.indexOf("["));switch(o.length){case 2:n=r[a][o[0]][o[1]];break;case 3:n=r[a][o[0]][o[1]][o[2]];break;case 4:n=r[a][o[0]][o[1]][o[2]][o[3]];break;default:n=r[a][o[0]]}}else n=r[e.name]?r[e.name]:e.value;return n}(t);switch(t.type){case"text":o=(0,i.createElement)(uw,{name:t.name,value:a,label:t.label,placeholder:t.placeholder,readonly:t.readonly,tooltip:t.tooltip,displayAlign:"vertical"});break;case"number":o=(0,i.createElement)(xx,{name:t.name,value:a,label:t.label,readonly:t.readonly,tooltip:t.tooltip,displayAlign:"vertical",min:t.min});break;case"checkbox":o=(0,i.createElement)(jg,{class:t.class,name:t.name,value:a,label:t.label,desc:t.desc,child_className:t.child_class});break;case"select":o=(0,i.createElement)(cw,{class:t.class,name:t.name,value:a,label:t.label,options:t.options,tooltip:t.tooltip,displayAlign:"vertical"});break;case"doc":o=(0,i.createElement)(F_,{content:t.content})}return(0,i.createElement)("div",{key:t.name,className:`wcf-cfe-field-setting__panel wcf-cfe-field-${e} mb-5 ${"enable-field"===e||"required-field"===e?"hidden":""}`},o)}))},tS=function(e){const[{billing_fields:t,shipping_fields:n},r]=Yp(),{step:o,type:a,removeCallback:l}=e,[c,u]=(0,s.useState)(""),[d,f]=(0,s.useState)("");let p=[];p="billing"===a?t:n;const m=function(e){const t=e.currentTarget.getAttribute("data-name"),n=document.getElementById(`wcf-field-setting-${t}`);n&&(n.classList.contains("hidden")?(n.classList.remove("hidden"),u(t)):(n.classList.add("hidden"),u("")))},h=function(e){l(e,f)},g=({name:e,value:o,fieldName:i})=>{const s=("billing"===a?t:n).map(t=>t.field_options[i].name===e?{...t,field_options:{...t.field_options,[i]:{...t.field_options[i],value:o}}}:t);r({type:"SET_FIELDS",field_type:a,fields:s})};return(0,i.createElement)("div",{className:"py-5"},(0,i.createElement)("div",{className:`wcf-${a}-fields--header flex items-center p-3 gap-4 bg-background-secondary rounded-md`},(0,i.createElement)("div",{className:"w-3/12 pl-7"},(0,C.__)("Label","cartflows")),(0,i.createElement)("div",{className:"w-3/12"},(0,C.__)("ID","cartflows")),(0,i.createElement)("div",{className:"w-1/5 text-center"},(0,C.__)("Enable","cartflows")),(0,i.createElement)("div",{className:"w-1/5 text-center"},(0,C.__)("Required","cartflows")),(0,i.createElement)("div",{className:"w-1/12 text-center"},(0,C.__)("Edit","cartflows"))),(0,i.createElement)(Zp.ReactSortable,{list:[...p],setList:e=>r({type:"SET_FIELDS",field_type:a,fields:e}),direction:"vertical",animation:150,handle:".wcf-field-item-handle",filter:".wcf-field-settings-icon, .wcf-toggle-field"},p&&p.map(e=>{const t=e.key,n=e.field_options["enable-field"],r=e.field_options["required-field"];return(0,i.createElement)("div",{key:t,className:"wcf-field-item-handle "+("yes"!==n.value?"!text-text-tertiary":""),"data-key":t},(0,i.createElement)("div",{className:"wcf-fields-wrapper flex items-center p-3 border-0 border-b border-solid border-border-subtle gap-4"},(0,i.createElement)("div",{className:"wcf-field--label whitespace-nowrap w-3/12 flex items-center mr-auto"},(0,i.createElement)("div",{className:"wcf-cpf--sortable-toggle flex cursor-move text-text-tertiary"},(0,i.createElement)(sh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,i.createElement)(sh,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,i.createElement)("span",{className:"w-44 text-ellipsis overflow-hidden cursor-default text-sm text-text-secondary"},e.label?e.label:e.placeholder," "),("billing_email"===t||"shipping_email"===t)&&"checkout"===o&&(0,i.createElement)(Wo,{content:(0,C.__)("Your email address can't be edited when using the Modern Checkout Style.","cartflows"),placement:"top"},(0,i.createElement)("span",null,(0,i.createElement)(vg,{className:"w-4 h-4 text-icon-secondary cursor-help ml-1"}))),"billing_company"===t&&"checkout"===o&&(0,i.createElement)(Wo,{content:(0,C.__)("The Company field won't be visible if you're using the Instant Layout Style.","cartflows"),placement:"top"},(0,i.createElement)("span",null,(0,i.createElement)(vg,{className:"w-4 h-4 text-icon-secondary cursor-help ml-1"})))),(0,i.createElement)("div",{className:"wcf-field--key whitespace-nowrap w-3/12 text-ellipsis overflow-hidden mr-auto cursor-default"},e.key),(0,i.createElement)("div",{className:"wcf-field--is-enable w-1/5 wcf-toggle-field flex justify-center"},(0,i.createElement)(Pg,{value:"yes"===n.value,onChange:e=>g({name:n.name,value:e?"yes":"no",fieldName:"enable-field"})}),(0,i.createElement)("input",{type:"hidden",name:n.name,value:n.value})),(0,i.createElement)("div",{className:"wcf-field--is-required w-1/5 wcf-toggle-field flex justify-center"},(0,i.createElement)(Pg,{value:"yes"===n.value&&"yes"===r.value,onChange:e=>g({name:r.name,value:e?"yes":"no",fieldName:"required-field"}),disabled:"yes"!==n.value}),(0,i.createElement)("input",{type:"hidden",name:r.name,value:"yes"!==n.value?"no":r.value})),(0,i.createElement)("div",{className:"wcf-field-settings-icon flex gap-2 w-1/12 justify-center items-center"},(0,i.createElement)("div",{onClick:m,"data-name":t},(0,i.createElement)($h,{className:"w-4 h-4 cursor-pointer "+(c===t?"text-brand-500":"text-text-tertiary hover:text-brand-500"),"data-name":t})),e.custom&&(0,i.createElement)("div",{"data-key":t,"data-type":a,onClick:h},t===d?(0,i.createElement)(Pf,{className:"wcf-delete-cpf--button-processing p-1 h-4 w-4 text-brand-500 pointer-events-none animate-spin","data-key":t,"data-type":a}):(0,i.createElement)($m,{className:"wcf-delete-cpf--button-delete p-1 h-4 w-4 text-brand-500 cursor-pointer","data-key":t,"data-type":a})))),(0,i.createElement)(eS,{innerField:t,innerFieldData:e,removecustomField:h,type:a}))})))},nS={left:{open:{x:0},exit:{x:"-100%"}},right:{open:{x:0},exit:{x:"100%"}}},rS=({children:e,className:t})=>{const{open:n,position:r,handleClose:o,transitionDuration:a,getFloatingProps:i,drawerContainerRef:s,scrollLock:l,context:c,className:u,refs:d}=mS();return c&&i?(0,j.jsx)(lp,{children:n&&(0,j.jsx)(no,{ref:s,lockScroll:l,className:Se("z-50",u),children:(0,j.jsx)(Kr,{context:c,modal:!0,...d?.reference&&{returnFocus:d.reference},children:(0,j.jsx)("div",{className:"fixed inset-0 overflow-hidden",children:(0,j.jsx)("div",{className:"relative inset-0 h-full flex items-center",children:(0,j.jsx)("div",{className:Se("flex items-center justify-center h-full w-full",{"justify-start":"left"===r,"justify-end":"right"===r}),children:(0,j.jsx)(vf.div,{className:Se("flex flex-col w-120 h-full bg-background-primary shadow-2xl overflow-hidden z-20",t),initial:"exit",animate:"open",exit:"exit",variants:nS[r],transition:a,ref:e=>{setTimeout(()=>{d?.setFloating(e)},1e3*((a?.duration||.3)+.1))},"aria-label":"drawer",role:"dialog","aria-modal":"true",...i?.(),children:"function"==typeof e?e({close:o}):e})})})})})})}):null};rS.displayName="Drawer.Panel";const oS=({children:e,className:t,...n})=>(0,j.jsx)("div",{className:Se("space-y-2 px-5 pt-5 pb-4",t),...n,children:e});oS.displayName="Drawer.Header";const aS=({children:e,as:t="h3",className:n,...r})=>(0,j.jsx)(t,{className:Se("text-base font-semibold text-text-primary m-0 p-0",n),...r,children:e});aS.displayName="Drawer.Title";const iS=({children:e,as:t="p",className:n,...r})=>(0,j.jsx)(t,{className:Se("text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",n),...r,children:e});iS.displayName="Drawer.Description";const sS=({children:e,className:t,...n})=>(0,j.jsx)("div",{className:Se("px-5 pb-4 pt-2 flex flex-col flex-1 overflow-y-auto overflow-x-hidden",t),...n,children:e});sS.displayName="Drawer.Body";const lS=({children:e,className:t})=>{const{design:n,handleClose:r}=mS();return(0,j.jsx)("div",{className:Se("px-5 py-4 flex justify-end gap-3 mt-auto",{"bg-background-secondary":"footer-divided"===n,"border-t border-b-0 border-x-0 border-solid border-border-subtle":"footer-bordered"===n},t),children:e?"function"==typeof e?e({close:r}):e:null})};lS.displayName="Drawer.Footer";const cS=({className:e,...t})=>(0,j.jsx)("button",{className:Se("bg-transparent inline-flex justify-center items-center border-0 p-1 m-0 cursor-pointer focus:outline-none outline-none shadow-none",e),"aria-label":"Close drawer",...t,children:(0,j.jsx)(Tf,{className:"size-4 text-text-primary shrink-0"})}),uS=({children:e,as:t=s.Fragment,...n})=>{const{handleClose:r}=mS();return e?t===s.Fragment?"function"==typeof e?e({close:r}):(0,s.isValidElement)(e)?(0,s.cloneElement)(e,{onClick:r}):(0,j.jsx)(cS,{onClick:r,...n}):(0,j.jsx)(t,{...n,onClick:r,children:e}):(0,j.jsx)(cS,{onClick:r,...n})};uS.displayName="Drawer.CloseButton";const dS={open:{opacity:1},exit:{opacity:0}},fS=({className:e,...t})=>{const{open:n,drawerContainerRef:r,transitionDuration:o}=mS(),[a,i]=(0,s.useState)(null);(0,s.useEffect)(()=>{r?.current&&i(r.current)},[n,r]);const l=(0,j.jsx)(lp,{mode:"wait",children:n&&(0,s.createElement)(vf.div,{className:Se("fixed inset-0 -z-10 bg-background-inverse/90",e),...t,initial:"exit",animate:"open",exit:"exit",variants:dS,transition:o,key:"backdrop"})});return a?(0,un.createPortal)(l,a):l};fS.displayName="Drawer.Backdrop";const pS=(0,s.createContext)({}),mS=()=>(0,s.useContext)(pS),hS=({open:e,setOpen:t,children:n,trigger:r,className:o,exitOnClickOutside:a=!1,exitOnEsc:i=!0,design:l="simple",position:c="right",transitionDuration:u=.2,scrollLock:d=!0})=>{const f=void 0!==e&&void 0!==t,[p,m]=(0,s.useState)(!1),h=(0,s.useRef)(null),g=(0,s.useMemo)(()=>f?e:p,[e,p,f]),w=(0,s.useMemo)(()=>f?t:m,[t,m,f]),y=()=>{g||w(!0)},{refs:b,context:v}=uo({open:g,onOpenChange:w,transform:!1}),x=co(v,{enabled:i||a,escapeKey:i,outsidePress:e=>!!a&&!e?.target?.closest("ul.fui-toast-container")}),N=Eo(v,{role:"dialog"}),E=ao(v),{getFloatingProps:_}=ho([x,N,E]),M=(0,s.useCallback)(()=>(0,s.isValidElement)(r)?(0,s.cloneElement)(r,{onClick:ke(y,r.props.onClick),ref:b.setReference,"aria-haspopup":"dialog","aria-expanded":g}):"function"==typeof r?r({onClick:y}):null,[r,y,b.setReference]);return(0,j.jsxs)(j.Fragment,{children:[M(),(0,j.jsx)(pS.Provider,{value:{open:g,setOpen:w,handleClose:()=>{g&&w(!1)},design:l,position:c,drawerContainerRef:h,transitionDuration:{duration:u},getFloatingProps:_,scrollLock:d,context:v,className:o,refs:b},children:n})]})};hS.displayName="Drawer",hS.Panel=rS,hS.Header=oS,hS.Title=aS,hS.Description=iS,hS.Body=sS,hS.CloseButton=uS,hS.Footer=lS,hS.Backdrop=fS,hS.Portal=({children:e,...t})=>(0,j.jsx)(Zr,{...t,children:e});const gS=function(e){const{addNewField:t,step_type:n}=e,r=(0,C.__)("Add New Field","cartflows"),o=(0,C.__)("Date & Time","cartflows"),[a,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)(r),[p,m]=(0,s.useState)(),h=function(){l(!1),u(!1),b(!1),f(r)},[g,w]=(0,s.useState)(!1),[y,b]=(0,s.useState)(!1),[v,x]=(0,s.useState)(!0),[N,E]=(0,s.useState)(!1),[_,M]=(0,s.useState)(!1),[I,S]=(0,s.useState)(!1),[k,D]=(0,s.useState)("datetime-local"),[j,A]=(0,s.useState)(o),T=function(){b(!y)},[L,O]=(0,s.useState)(!1),z=function(){const e=document.getElementById("wcf-checkout-custom-fields[0][type]").value;E(!1),M(!1),S(!1),x(!1),O(!1),"text"===e||"textarea"===e?x(!0):"select"===e?S(!0):"checkbox"===e?E(!0):"radio"===e?M(!0):"file"===e&&O(!0),w(e)},P=function(e){let t=e.replace(/[^a-zA-Z\d ]/g," ");t=t.replace(/\s/g,"_").toLowerCase(),m(t)},R=function(e){D(e.target.value),"datetime-local"===e.target.value?A(o):A(e.target.value)},U=function(){let e="";if("datetime"!==g)return e;switch(k){case"date":e="yyyy-mm-dd";break;case"time":e="hh:mm";break;case"datetime-local":e="yyyy-mm-dd hh.mm";break;default:e=""}return e};return(0,i.createElement)("div",{className:"wcf-custom-field-box"},(0,i.createElement)("div",{className:"flex justify-end"},(0,i.createElement)(Ro,{variant:"outline",size:"md",className:"wcf-add-custom-field text-brand-500 bg-brand-50 outline-brand-500",onClick:function(e){e.preventDefault(),m(""),l(!a)},icon:(0,i.createElement)(yg,{className:"h-18 w-18 text-brand-500"}),iconPosition:"left"},(0,C.__)("Add Custom Field","cartflows"))),(0,i.createElement)(hS,{open:a,setOpen:e=>{e||h()},position:"right",exitOnClickOutside:!1,className:"wcf-add-custom-field-drawer z-999999"},(0,i.createElement)(hS.Panel,{className:"pointer-events-auto w-screen max-w-xl flex flex-col h-full"},(0,i.createElement)(hS.Backdrop,null),(0,i.createElement)(hS.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(hS.Title,null,(0,C.__)("Add Custom Field","cartflows")),(0,i.createElement)(hS.CloseButton,{type:"button"})),(0,i.createElement)(hS.Body,{className:"wcf-cfe-content flex-1 overflow-y-auto"},function(){const e=[{value:"billing",label:(0,C.__)("Billing","cartflows")},{value:"shipping",label:(0,C.__)("Shipping","cartflows")}],t=[{value:"text",label:(0,C.__)("Text","cartflows")},{value:"textarea",label:(0,C.__)("TextArea","cartflows")},{value:"number",label:(0,C.__)("Number","cartflows")},{value:"datetime",label:(0,C.__)("Date & Time","cartflows")},{value:"checkbox",label:(0,C.__)("Checkbox","cartflows")},{value:"radio",label:(0,C.__)("Radio","cartflows")},{value:"select",label:(0,C.__)("Select","cartflows")},{value:"hidden",label:(0,C.__)("Hidden","cartflows")},{value:"file",label:(0,C.__)("File","cartflows")}],r=[{value:"33",label:(0,C.__)("33%","cartflows")},{value:"50",label:(0,C.__)("50%","cartflows")},{value:"100",label:(0,C.__)("100%","cartflows")}],o="w-full max-wi-full input-field !text-sm font-normal !rounded-md text-text-tertiary !border-border-subtle focus:ring focus:!ring-brand-100 focus:!border-brand-500 focus:!shadow-none !outline-0 !outline-none !m-0";return(0,i.createElement)("div",{className:"wcf-custom-field-form--wrapper text-left"},"checkout"===n&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(cw,{class:"wcf-cpf-add_to",name:"wcf-checkout-custom-fields[0][add_to]",options:e,label:(0,C.__)("Add To","cartflows"),displayAlign:"vertical"})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(cw,{class:"wcf-cpf-type",id:"wcf-checkout-custom-fields[0][type]",name:"wcf-checkout-custom-fields[0][type]",options:t,label:(0,C.__)("Type","cartflows"),onSelect:z,displayAlign:"vertical"})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(uw,{class:`wcf-cpf-label ${o}`,name:"wcf-checkout-custom-fields[0][label]",label:Zm((0,C.sprintf)(/* translators: %$s is replaced with the HTML tag */ /* translators: %$s is replaced with the HTML tag */
25 -(0,C.__)("Label %1$s*%2$s","cartflows"),'<span class="text-brand-300">',"</span>")),onChangeCB:P,displayAlign:"vertical",placeholder:(0,C.__)("e.g. Phone Number","cartflows")})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(uw,{class:`wcf-cpf-name ${o}`,name:"wcf-checkout-custom-fields[0][key]",value:p,label:(0,C.__)("Field ID","cartflows"),displayAlign:"vertical",placeholder:(0,C.__)("e.g. phone_number","cartflows")}),(0,i.createElement)(Vm,{as:"span",className:"text-sm font-normal text-text-tertiary mt-2 block"},(0,C.__)('Field value will store in this meta key. Add field id without prefix like "billing_" or "shipping_". Use "_" instead of spaces.',"cartflows"))),"number"===g&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(xx,{class:`wcf-cpf-min ${o}`,name:"wcf-checkout-custom-fields[0][min]",label:(0,C.__)("Min Value","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,C.__)("e.g. 0","cartflows")})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(xx,{class:`wcf-cpf-max ${o}`,name:"wcf-checkout-custom-fields[0][max]",label:(0,C.__)("Max Value","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,C.__)("e.g. 100","cartflows")}))),(I||_)&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(fw,{class:`wcf-cpf-options ${o}`,name:"wcf-checkout-custom-fields[0][options]",label:(0,C.__)("Options","cartflows"),placeholder:(0,C.__)("Enter your options separated by (|).","cartflows"),displayAlign:"vertical"})),N&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(cw,{class:"wcf-cpf-default",name:"wcf-checkout-custom-fields[0][default]",label:(0,C.__)("Default","cartflows"),options:[{value:"1",label:(0,C.__)("Checked","cartflows")},{value:"0",label:(0,C.__)("UnChecked","cartflows")}],displayAlign:"vertical"})),"datetime"===g&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(cw,{class:`wcf-cpf-date-input ${o}`,name:"wcf-checkout-custom-fields[0][date_input]",label:(0,C.__)("Field Input Type","cartflows"),options:[{label:(0,C.__)("Date & Time","cartflows"),value:"datetime-local"},{label:(0,C.__)("Date","cartflows"),value:"date"},{label:(0,C.__)("Time","cartflows"),value:"time"}],displayAlign:"vertical",value:k,onSelect:R})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(uw,{class:`wcf-cpf-min-date ${o}`,labelClass:"text-sm font-medium text-left capitalize",textFieldType:k,name:"wcf-checkout-custom-fields[0][default]",label:(0,C.__)("Min ","cartflows")+j,displayAlign:"vertical",placeholder:U()})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(uw,{class:`wcf-cpf-max-date ${o}`,labelClass:"text-sm font-medium text-left capitalize",textFieldType:k,name:"wcf-checkout-custom-fields[0][default]",label:(0,C.__)("Max ","cartflows")+j,displayAlign:"vertical",placeholder:U()}))),!N&&!L&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(uw,{class:`wcf-cpf-default ${o}`,textFieldType:"datetime"===g&&k?k:"text",name:"wcf-checkout-custom-fields[0][default]",label:(0,C.__)("Default","cartflows"),displayAlign:"vertical",placeholder:U()||(0,C.__)("e.g. Default value","cartflows")})),v&&!L&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(uw,{class:`wcf-cpf-placeholder ${o}`,name:"wcf-checkout-custom-fields[0][placeholder]",label:(0,C.__)("Placeholder","cartflows"),displayAlign:"vertical",placeholder:(0,C.__)("e.g. Enter your phone number","cartflows")})),"file"===g&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(xx,{class:`wcf-cpf-file-size ${o}`,name:"wcf-checkout-custom-fields[0][file_size]",label:(0,C.__)("File Size (MB)","cartflows"),tooltip:(0,C.__)("Enter the maximum allowed file size. Default is 5MB.","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,C.__)("e.g. 5","cartflows")})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(uw,{class:`wcf-cpf-accepted-file-types ${o}`,textFieldType:"text",name:"wcf-checkout-custom-fields[0][accepted_file_types]",label:(0,C.__)("Accepted File Types","cartflows"),tooltip:(0,C.__)("Enter comma-separated file extensions (e.g. jpg, png, gif)","cartflows"),displayAlign:"vertical",placeholder:(0,C.__)("e.g. jpg, png, gif","cartflows")}))),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(cw,{class:"wcf-cpf-width",name:"wcf-checkout-custom-fields[0][width]",options:r,value:"100",label:(0,C.__)("Width","cartflows"),displayAlign:"vertical"})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(jg,{class:"wcf-cpf-show-in-email",name:"wcf-checkout-custom-fields[0][show_in_email]",label:(0,C.__)("Show in Email","cartflows")})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(jg,{class:"wcf-cpf-required",name:"wcf-checkout-custom-fields[0][required]",label:(0,C.__)("Required","cartflows"),onClick:T})),!y&&"optin"!==n&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(jg,{class:"wcf-cpf-optimized",name:"wcf-checkout-custom-fields[0][optimized]",label:(0,C.__)("Collapsible","cartflows")})))}()),(0,i.createElement)(hS.Footer,{className:"flex gap-3 justify-end"},(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:function(e){e.preventDefault(),l(!1)}},(0,C.__)("Cancel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:function(e){e.preventDefault(),f((0,C.__)("Adding…","cartflows")),u(!0),c||t(e,h,f)||u(!1)}},d)))))},wS=function(){return(0,i.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section is-placeholder"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("form",null,(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))))),(0,i.createElement)("div",{className:"wcf-field wcf-submit"},(0,i.createElement)("div",{className:"wcf-checkout-custom-fields__button"})))),(0,i.createElement)(_g,{fontSize:"35px",width:"400px"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"80%"}),(0,i.createElement)(_g,{width:"65%"}))},yS=function(){const[{custom_fields:e,step_id:t,options:n,billing_fields:r,shipping_fields:o},a]=Yp(),[l,c]=(0,s.useState)("collapsed"),[u,d]=(0,s.useState)("billing"),f=Oh();if(void 0===e)return(0,i.createElement)(wS,null);const p=[{name:(0,C.__)("Billing Fields","cartflows"),slug:"billing",icon:(0,i.createElement)(KI,{className:"w-5 h-5","aria-hidden":"true"})},{name:(0,C.__)("Shipping Fields","cartflows"),slug:"shipping",icon:(0,i.createElement)(mg,{className:"w-5 h-5","aria-hidden":"true"})}],m=async function(e,n){if(e.preventDefault(),!await f({title:(0,C.__)("Delete Field","cartflows"),description:(0,C.__)("Are you really want to delete field?","cartflows"),actionBtnText:(0,C.__)("Delete","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")}))return;const i=new FormData,s=e.target.getAttribute("data-key"),l=e.target.getAttribute("data-type");n(s),i.append("action","cartflows_pro_delete_custom_field"),i.append("security",cartflows_admin.delete_custom_field_nonce),i.append("post_id",t),i.append("key",s),i.append("type",l),i.append("step","checkout"),qf()({url:cartflows_admin.ajax_url,method:"POST",body:i}).then(e=>{if(e.status){const e=r.filter(function(e){return e.key!==s});a({type:"SET_FIELDS",field_type:"billing",fields:e});const t=o.filter(function(e){return e.key!==s});a({type:"SET_FIELDS",field_type:"shipping",fields:t}),n(""),hm.success((0,C.__)("Custom field deleted!","cartflows"))}})};return(0,i.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,i.createElement)(DI,{settings:e.extra_fields,isOpen:!0}),(0,i.createElement)("div",{className:"wcf-field-editor accordion-item bg-background-primary -mx-8 border-b border-border-subtle"},(0,i.createElement)("h2",{className:"accordion-header mb-0",id:"wcf_field_editor_toggler"},(0,i.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none ${l}`,type:"button","data-bs-toggle":"collapse","data-bs-target":"#wcf_collapse_field_editor_toggler","aria-expanded":"false","aria-controls":"wcf_collapse_field_editor_toggler",onClick:function(){c("collapsed"===l?"":"collapsed")}},(0,i.createElement)("span",null,(0,C.__)("Field Editor","cartflows")),""===l?(0,i.createElement)(gg,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}):(0,i.createElement)(Lp,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}))),(0,i.createElement)("div",{id:"wcf_collapse_field_editor_toggler",className:`accordion-collapse px-8 pt-4 pb-8 ${l}`,"aria-labelledby":"wcf_field_editor_toggler"},(0,i.createElement)("div",{className:"accordion-body"},(0,i.createElement)(yM,{name:"wcf-custom-checkout-fields",value:n["wcf-custom-checkout-fields"],label:(0,C.__)("Enable Custom Field Editor","cartflows"),classes:"wcf-enable-custom-field-editor",fullWidth:!0}),"yes"===n["wcf-custom-checkout-fields"]&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-checkout-fields-tabs isolate inline-flex h-11 rounded-md shadow-sm w-full mt-4 mb-0"},p.map(e=>{const t=e.slug===u,n=t?"z-10 bg-brand-25 border-primary-300 hover:bg-brand-25 outline-none text-primary-600":"bg-background-primary border-border-subtle hover:bg-brand-25 hover:border-primary-600";return(0,i.createElement)("button",{type:"button",className:Uf()("relative text-center w-3/6 items-center border px-4 py-2 text-sm font-medium text-text-primary hover:text-primary-600",n),onClick:()=>d(e.slug),key:e.slug},(0,i.createElement)("span",{className:(t?"text-primary-600":"")+" text-sm font-medium text-center flex justify-center items-center gap-1"},e.icon,e.name))})),"billing"===u&&(0,i.createElement)("div",{id:"wcf-billing-fields",className:"wcf-billing-fields billing-field-sortable wcf-field-row w-full"},r&&(0,i.createElement)(tS,{data:r,step:"checkout",type:"billing",removeCallback:m})),"shipping"===u&&(0,i.createElement)("div",{id:"wcf-shipping-fields",className:"wcf-shipping-fields shipping-field-sortable wcf-field-row w-full"},o&&(0,i.createElement)(tS,{data:o,step:"checkout",type:"shipping",removeCallback:m})),(0,i.createElement)("div",{className:"text-end"},wcfCartflowsPro()&&(0,i.createElement)("div",{className:""},(0,i.createElement)(gS,{addNewField:function(e,i,s){e.preventDefault();const l=document.getElementsByClassName("wcf-cpf-add_to")[0],c=document.getElementsByClassName("wcf-cpf-type")[0],u=document.getElementsByClassName("wcf-cpf-label")[0],d=document.getElementsByClassName("wcf-cpf-name")[0],f=document.getElementsByClassName("wcf-cpf-min")[0],p=document.getElementsByClassName("wcf-cpf-max")[0],m=document.getElementsByClassName("wcf-cpf-default")[0],h=document.getElementsByClassName("wcf-cpf-placeholder")[0],g=document.getElementsByClassName("wcf-cpf-options")[0],w=document.getElementsByClassName("wcf-cpf-min-date")[0],y=document.getElementsByClassName("wcf-cpf-max-date")[0],b=document.getElementsByClassName("wcf-cpf-width")[0],v=document.getElementsByClassName("wcf-cpf-show-in-email")[0],x=document.getElementsByClassName("wcf-cpf-required")[0],N=document.getElementsByClassName("wcf-cpf-optimized")[0],E=document.getElementsByClassName("wcf-cpf-date-input")[0],_=E?E.value:"",M=document.getElementsByClassName("wcf-cpf-file-size")[0],I=document.getElementsByClassName("wcf-cpf-accepted-file-types")[0];if(""===u.value){const e=document.createElement("span");return e.className="text-xs text-brand-500",e.textContent=(0,C.__)("Label is required field","cartflows"),document.querySelector(".wcf-cpf-label").insertAdjacentElement("afterend",e),u.focus(),s((0,C.__)("Add New Field","cartflows")),""}const S=["jpg","jpeg","png","gif","webp","ico","pdf","mp3","m4a","ogg","wav","mp4","m4v","mov","wmv","avi","mpg","ogv","3gp","3g2"];if(I&&I.value.trim()){const e=I.value.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e).filter(e=>!S.includes(e));if(e.length){const t=document.querySelector(".wcf-cpf-accepted-file-types + .wcf-cpf-error");t&&t.remove();const n=document.createElement("span");return n.className="wcf-cpf-error text-xs text-brand-500",n.textContent=(0,C.sprintf)(/* translators: %s: invalid extensions */ /* translators: %s: invalid extensions */
26 -(0,C.__)("Invalid file type(s): %s","cartflows"),e.join(", ")),I.insertAdjacentElement("afterend",n),I.focus(),s((0,C.__)("Add New Field","cartflows")),""}}const k=new FormData;k.append("add_to",l?l.value:""),k.append("type",c?c.value:""),k.append("label",u?u.value:""),k.append("name",d?d.value:""),k.append("default",m?m.value:""),k.append("min",f?f.value:""),k.append("max",p?p.value:""),k.append("placeholder",h?h.value:""),k.append("min_date",w?w.value:""),k.append("max_date",y?y.value:""),k.append("options",g?g.value:""),k.append("date_input",_||"datetime-local"),k.append("width",b?b.value:""),k.append("required",x?x.value:""),k.append("show_in_email",v?v.value:""),k.append("optimized",N?N.value:""),k.append("file_size",M?M.value:"5"),k.append("accepted_file_types",I?I.value:""),k.append("action","cartflows_pro_prepare_custom_field"),k.append("security",cartflows_admin.prepare_custom_field_nonce),k.append("post_id",t),k.append("save_field_name","wcf_field_order_"),qf()({url:cartflows_admin.ajax_url,method:"POST",body:k}).then(e=>{if(e.success){const t=e.data,i=t.field_data;if("billing"===t.add_to){r.push(i);const e=n.wcf_field_order_billing;e[t.new_field.key]=t.new_field,a({type:"SET_OPTION",name:"wcf_field_order_billing",value:e}),a({type:"SET_FIELDS",field_type:"billing",fields:r})}if("shipping"===t.add_to){o.push(i);const e=n.wcf_field_order_shipping;e[t.new_field.key]=t.new_field,a({type:"SET_OPTION",name:"wcf_field_order_shipping",value:e}),a({type:"SET_FIELDS",field_type:"shipping",fields:o})}hm.success((0,C.__)("Custom field added!","cartflows"))}i()})},step_type:"checkout"}))))))),(0,i.createElement)(DI,{settings:e.checkout_settings}),(0,i.createElement)(DI,{settings:e.button_settings})))},bS=function(){return(0,i.createElement)("div",{className:"wcf-custom-field-editor is-placeholder"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("form",null,(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("div",{className:"checkbox-title"})))),(0,i.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,i.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("div",{className:"wcf-optin-fields"},(0,i.createElement)("div",{className:"title"}),(0,i.createElement)("div",{className:"title"}),(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("div",{className:"wcf-field wcf-submit"},(0,i.createElement)("div",{className:"wcf-optin-form-field__button"})))))},vS=function(){const[{custom_fields:e,step_id:t,options:n,billing_fields:r},o]=Yp();if(void 0===e)return(0,i.createElement)(bS,null);const a=e.extra_fields;return(0,i.createElement)("div",{className:"wcf-custom-field-editor"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,i.createElement)("h3",{className:"wcf-custom-field-editor__title hidden relative justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none"},(0,C.__)("Field Editor","cartflows")),(0,i.createElement)("div",{className:"wcf-optin-fields--enable_option px-8 py-4 -mx-6 pt-0"},a&&Object.keys(a.fields).map(e=>{const t=a.fields[e],r=n[t.name]?n[t.name]:"";return(0,i.createElement)("div",{key:e,className:"w-full"},(0,i.createElement)(yM,{name:t.name,value:r,label:t.label,desc:t.desc,fullWidth:!0}))})),"yes"===n["wcf-optin-enable-custom-fields"]&&(0,i.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,i.createElement)("div",{id:"wcf-optin-fields",className:"billing-field-sortable wcf-field-row"},(0,i.createElement)(tS,{data:r,step:"optin",type:"billing",removeCallback:function(e){e.preventDefault();const n=new FormData,a=e.target.getAttribute("data-key"),i=e.target.getAttribute("data-type");n.append("action","cartflows_pro_delete_custom_field"),n.append("security",cartflows_admin.delete_custom_field_nonce),n.append("post_id",t),n.append("key",a),n.append("type",i),n.append("step","optin"),qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>{if(e.status){const e=r.filter(function(e){return e.key!==a});o({type:"SET_FIELDS",field_type:"billing",fields:e}),hm.success((0,C.__)("Custom field deleted!","cartflows"))}})}})),(0,i.createElement)("div",{className:"wcf-custom-field-editor-title-section"},wcfCartflowsPro()&&(0,i.createElement)("div",{className:"wcf-custom-field-editor-buttons"},(0,i.createElement)(gS,{addNewField:function(e,a,i){e.preventDefault();const s=document.getElementsByClassName("wcf-cpf-type")[0],l=document.getElementsByClassName("wcf-cpf-label")[0],c=document.getElementsByClassName("wcf-cpf-name")[0],u=document.getElementsByClassName("wcf-cpf-default")[0],d=document.getElementsByClassName("wcf-cpf-placeholder")[0],f=document.getElementsByClassName("wcf-cpf-min")[0],p=document.getElementsByClassName("wcf-cpf-max")[0],m=document.getElementsByClassName("wcf-cpf-options")[0],h=document.getElementsByClassName("wcf-cpf-min-date")[0],g=document.getElementsByClassName("wcf-cpf-max-date")[0],w=document.getElementsByClassName("wcf-cpf-width")[0],y=document.getElementsByClassName("wcf-cpf-show-in-email")[1],b=document.getElementsByClassName("wcf-cpf-required")[1],v=document.getElementsByClassName("wcf-cpf-date-input")[0],x=v?v.value:"";if(""===l.value){const e=document.createElement("span");return e.className="text-xs text-brand-500",e.textContent=(0,C.__)("Label is required field","cartflows"),document.querySelector(".wcf-cpf-label").insertAdjacentElement("afterend",e),l.focus(),i((0,C.__)("Add New Field","cartflows")),!1}const N=new FormData;N.append("add_to","billing"),N.append("type",s?s.value:""),N.append("label",l?l.value:""),N.append("name",c?c.value:""),N.append("default",u?u.value:""),N.append("placeholder",d?d.value:""),N.append("options",m?m.value:""),N.append("min",f?f.value:""),N.append("max",p?p.value:""),N.append("width",w?w.value:""),N.append("min_date",h?h.value:""),N.append("max_date",g?g.value:""),N.append("show_in_email",y?y.value:""),N.append("date_input",x||"datetime-local"),N.append("required",b?b.value:""),N.append("action","cartflows_pro_prepare_custom_field"),N.append("security",cartflows_admin.prepare_custom_field_nonce),N.append("post_id",t),N.append("save_field_name","wcf-optin-fields-"),qf()({url:cartflows_admin.ajax_url,method:"POST",body:N}).then(e=>{if(e.success){const t=e.data,a=t.field_data;if("billing"===t.add_to){r.push(a);const e=n["wcf-optin-fields-billing"];e[t.new_field.key]=t.new_field,o({type:"SET_OPTION",name:"wcf-optin-fields-billing",value:e}),o({type:"SET_FIELDS",field_type:"billing",fields:r})}hm.success((0,C.__)("Custom field added!","cartflows"))}a()})},step_type:"optin"}))))))},xS=To("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),NS=({type:e="simple",defaultValue:t=[],autoClose:n=!1,disabled:r=!1,children:o,className:a})=>{const[i,l]=(0,s.useState)(Array.isArray(t)?t:[t]);return(0,j.jsx)("div",{className:Se("boxed"===e?"space-y-3":"",a),children:s.Children.map(o,t=>{if(s.isValidElement(t)&&"value"in t.props){const o=!1!==t.props.collapsible,a=!o||i.includes(t.props.value);return s.cloneElement(t,{isOpen:a,onToggle:o?()=>(e=>{l(t=>n?t.includes(e)?[]:[e]:t.includes(e)?t.filter(t=>t!==e):[...t,e])})(t.props.value):void 0,type:e,disabled:r||t.props.disabled})}return t})})};NS.displayName="Accordion";const ES=({isOpen:e,onToggle:t,type:n="simple",disabled:r=!1,children:o,className:a})=>{const i={simple:"border-0",separator:"border-0 border-b border-solid border-border-subtle",boxed:"border border-solid border-border-subtle rounded-md"}[n];return(0,j.jsx)("div",{className:Se(i,a),children:s.Children.map(o,o=>s.isValidElement(o)?s.cloneElement(o,{isOpen:e,onToggle:t,type:n,disabled:r}):o)})};ES.displayName="Accordion.Item";const _S=({onClick:e,onToggle:t,isOpen:n,iconType:r="arrow",collapsible:o=!0,disabled:a=!1,tag:i="h3",type:s="simple",children:l,className:c,...u})=>{const d={simple:"px-2 py-3",separator:"px-2 py-4",boxed:"px-3 py-4"}[s];return(0,j.jsx)(i,{className:"flex m-0 hover:bg-background-secondary transition duration-150 ease-in-out",children:(0,j.jsxs)("button",{className:Se("flex w-full items-center justify-between text-sm font-medium transition-all appearance-none bg-transparent border-0 cursor-pointer gap-3",d,a&&"cursor-not-allowed opacity-40",c),onClick:ke(e,!a&&o?t:void 0),"aria-expanded":n,"aria-disabled":a,disabled:a,...u,children:[(0,j.jsx)("div",{className:"flex items-center gap-2 text-text-primary font-semibold text-left",children:l}),o?"arrow"===r?(0,j.jsx)(cp,{className:Se("flex-shrink-0 text-icon-secondary size-5 transition-transform duration-300 ease-in-out",n?"rotate-180":"rotate-0"),"aria-hidden":"true"}):"plus-minus"===r?(0,j.jsx)(vf.span,{initial:{opacity:0,rotate:n?-180:0},animate:{opacity:1,rotate:n?0:180},exit:{opacity:0},transition:{duration:.3,ease:"easeInOut"},className:"flex items-center flex-shrink-0 text-icon-secondary","aria-hidden":"true",children:n?(0,j.jsx)(Dg,{}):(0,j.jsx)(xS,{})},n?"minus":"plus"):null:null]})})};_S.displayName="Accordion.Trigger";const MS=({isOpen:e,disabled:t=!1,type:n="simple",children:r,className:o})=>{const a={simple:"px-2 pb-3",separator:"px-2 pb-4",boxed:"px-3 pb-4"}[n];return(0,j.jsx)(lp,{initial:!1,children:e&&(0,j.jsx)(vf.div,{variants:{open:{height:"auto",opacity:1,overflow:"unset",transition:{overflow:{delay:1}}},closed:{height:0,opacity:0,overflow:"hidden"}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:Se("text-text-secondary w-full text-sm transition-[height, opacity, transform] ease-in box-border",t&&"opacity-40",o),"aria-hidden":!e,role:"region",children:(0,j.jsx)("div",{className:Se(a),children:r})},"content")})};MS.displayName="Accordion.Content";const IS=Object.assign(NS,{Item:ES,Trigger:_S,Content:MS}),SS=function({title:e,children:t,defaultOpen:n=!0,badge:r,className:o=""}){return(0,i.createElement)("div",{className:`-mx-8 border-b border-border-subtle last:border-b-0 ${o}`.trim()},(0,i.createElement)(IS,{type:"simple",defaultValue:n?"section":[],autoClose:!1},(0,i.createElement)(IS.Item,{value:"section"},(0,i.createElement)(IS.Trigger,{iconType:"arrow",className:"px-8 py-4"},(0,i.createElement)("span",{className:"flex items-center gap-2 text-sm font-semibold text-text-primary"},e,r&&r)),(0,i.createElement)(IS.Content,{className:"px-8 pb-8 pt-0"},t))))},kS=function(e){const[{license_status:t}]=f(),n=e.btnText||(0,C.__)("Upgrade to CartFlows Pro","cartflows"),r=function(r){return(0,i.createElement)(SS,{title:r.title,badge:(0,i.createElement)(Lf,{label:(0,C.__)("PRO","cartflows"),size:"xs",variant:"primary"}),defaultOpen:!1},(0,i.createElement)("div",{className:"p-5 border border-border-subtle rounded-lg bg-brand-25"},(0,i.createElement)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between"},(0,i.createElement)("div",null,(0,i.createElement)("p",{className:"text-sm font-medium text-text-primary mb-1"},r.noticeTitle),(0,i.createElement)("p",{className:"text-sm font-normal text-text-secondary"},r.noticeDesc)),(0,i.createElement)("div",{className:"flex items-center gap-4 shrink-0"},function(){const r=cartflows_admin.cf_pro_status;return wcfCartflowsTypePro()||"inactive"!==r||"pro"!==wcfInactivepluginType()?wcfCartflowsTypePlusPro()?"Activated"!==t?(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(dI,{title:(0,C.__)("Activate the License","cartflows")}))):void 0:wcfInactiveProPlus()?(0,i.createElement)(sI,null):(0,i.createElement)(lI,{buttonLink:e.buttonLink,title:n,buttonStyle:"secondary"}):(0,i.createElement)(sI,null)}()))))};return(0,i.createElement)(i.Fragment,null,r({title:(0,C.__)("Auto Apply Coupon","cartflows"),noticeTitle:(0,C.__)("Apply Discounts Automatically and Convert More Customers","cartflows"),noticeDesc:(0,C.__)("Remove friction at checkout — discounts activate the moment customers arrive. Upgrade to Pro and watch conversions climb immediately.","cartflows")}),r({title:(0,C.__)("Product Options","cartflows"),noticeTitle:(0,C.__)("Let Customers Choose Exactly What They Want","cartflows"),noticeDesc:(0,C.__)("Offer flexible product options right at checkout — quantities, variations, and more. Upgrade to CartFlows Pro and start customizing your offers today.","cartflows")}))},DS=function(){const[{step_data:e,settings_data:t,page_settings:n,options:r}]=Yp(),[{license_status:o}]=f(),a=n;if(void 0===t.settings)return(0,i.createElement)(PI,null);const s=r["wcf-checkout-products"];return(0,i.createElement)("div",{className:"wcf-checkout-products"},(0,i.createElement)(SS,{title:a.settings.product.title,defaultOpen:!0},(0,i.createElement)(kI,{settings:a.settings.product})),"checkout"===e.type&&(!wcfCartflowsPro()||"Activated"!==o)&&(0,i.createElement)(kS,null),"checkout"===e.type&&wcfCartflowsPro()&&"Activated"===o&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(SS,{title:a.settings.coupon.title},(0,i.createElement)(kI,{settings:a.settings.coupon})),s&&(0,i.createElement)(SS,{title:a.settings["product-options"].title},(0,i.createElement)(kI,{settings:a.settings["product-options"]}))))},CS=function(){const[{settings_data:e,page_settings:t,options:n},r]=Yp(),o=n["wcf-optin-product"]?n["wcf-optin-product"]:[],[a,l]=(0,s.useState)(),[c,u]=(0,s.useState)(""),[d,f]=(0,s.useState)(!1),p=(0,C.__)("Add","cartflows"),[m,h]=(0,s.useState)({isInProcessing:!1,buttonText:p}),{isInProcessing:g,buttonText:w}=m;return void 0===e.settings?(0,i.createElement)(PI,null):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-optin-product--wrapper"},(0,i.createElement)("h2",{className:"text-base font-semibold text-text-primary py-4"},(0,C.__)("Optin Product","cartflows")),(0,i.createElement)("div",{className:"wcf-optin-products--selection wcf-products__section"},0===o.length||""===o[0]?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("input",{name:"wcf-optin-product[]",type:"hidden",value:""}),(0,i.createElement)("div",{className:"wcf-optin-no-product--notice border border-border-subtle bg-gray-25 text-center text-sm font-normal rounded-md p-5"},(0,C.__)("Select free & virtual product only. Once you select a product, it will be displayed here.","cartflows")),(0,i.createElement)("div",{className:"wcf-optin-product-selection-field__add-new flex justify-between items-end gap-5 mt-5"},(0,i.createElement)(sM,{name:"",desc:"",field:"product",value:c,allowed_products:"simple",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,C.__)("Search for a Free & Virtual Product","cartflows"),onChangeCB:e=>{l(e),f(!1)},sectionClass:"flex-1 "+(d?"border border-border-error":"")}),(0,i.createElement)(Ro,{type:"button",variant:"outline",size:"md",icon:(0,i.createElement)(yg,{className:"w-4 h-4"}),iconPosition:"left",loading:g,disabled:g,onClick:function(){const e=a?.value;u(a),e&&(h({isInProcessing:!0,buttonText:(0,C.__)("Adding…","cartflows")}),qf()({path:`/cartflows/v1/admin/product-data/${e}`}).then(t=>{t.regular_price>0||!t.is_virtual?f(!0):(f(!1),r({type:"ADD_OPTIN_PRODUCT",field_name:"wcf-optin-product",product_data:{value:e,label:a?.label,img_url:t?.img_url}})),u(null),h({isInProcessing:!1,buttonText:p})}),l(null))},className:"wcf-select-product-button shrink-0 h-fit"},w)),d&&(0,i.createElement)("span",{className:"text-sm mt-2 text-text-error wcf-field-required-error inline-block"},(0,C.__)("Please select a free & virtual product only.","cartflows")),(0,i.createElement)(fx,null)):(0,i.createElement)("div",{className:"overflow-visible shadow border border-border-subtle rounded-md"},(0,i.createElement)("div",{className:"wcf-optin-product-selection--selected-product flex items-center p-3 gap-4"},(0,i.createElement)("div",{className:"wcf-optin-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-1/2"},(0,i.createElement)("div",{className:"flex gap-3 items-center"},(0,i.createElement)("div",{className:"wcf-optin-product-selection--product-image flex w-20 h-20"},(0,i.createElement)("img",{src:o.img_url?o.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:Zm(o.label)})),(0,i.createElement)("div",{className:"wcf-optin-product-selection--product-title_text"},(0,i.createElement)("div",{className:"wcf-offer-product-repeater-field__title whitespace-normal text-left","data-product_id":o.value},Zm(o.label)),(0,i.createElement)("div",{className:"wcf-optin-product-repeater-field__reg-price mt-1"},(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"wcf-offer-product--reg-price"},(0,C.__)("Free","cartflows"))))))),(0,i.createElement)("div",{className:"wcf-optin-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[5%] justify-center ml-auto"},(0,i.createElement)("div",{className:"wcf-delete-product-item cursor-pointer text-text-secondary hover:text-brand-500 p-1 hover:bg-background-secondary focus:bg-background-secondary rounded relative justify-end",onClick:function(){r({type:"REMOVE_OPTIN_PRODUCT",field_name:"wcf-optin-product"})}},(0,i.createElement)($m,{className:"h-18 w-18"}))),(0,i.createElement)("input",{name:"wcf-optin-product[]",type:"hidden",className:"wcf-checkout-product-id",value:o.value})))),(0,i.createElement)("div",{className:"wcf-offer-product--common-settings pt-2"},(0,i.createElement)(zI,{settings:t?.settings.product,displayAs:"div"}))))};function jS(e,t){var n;if(!t)return"";const r=Object.values(t).find(t=>t.id===e);return null!==(n=r?.title)&&void 0!==n?n:""}function AS(e,t,n,r){if(!t?.type)return null;switch(e){case"design":default:return(0,i.createElement)(CI,null);case"settings":return(0,i.createElement)(OI,null);case"products":return"checkout"===t.type?"storeCheckout"!==n||cartflows_admin.store_checkout_show_product_tab?(0,i.createElement)(DS,null):(r("order_bumps"),(0,i.createElement)(hI,null)):["upsell","downsell"].includes(t.type)?(0,i.createElement)(RI,null):"optin"===t.type?(0,i.createElement)(CS,null):"landing"===t.type||"thankyou"===t.type?(r("settings"),(0,i.createElement)(OI,null)):(0,i.createElement)(OI,null);case"checkout_form_fields":return(0,i.createElement)(yS,null);case"order_bumps":return(0,i.createElement)(hI,null);case"checkout_offer":return(0,i.createElement)(WI,null);case"optin_form_fields":return(0,i.createElement)(vS,null);case"dynamic-offers":return(0,i.createElement)(qI,null)}}const TS=To("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]),LS=To("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]),OS=(0,s.createContext)({isCollapsed:!1,setIsCollapsed:()=>{},collapsible:!0}),zS=({children:e,className:t,onCollapseChange:n,collapsible:r=!0,borderOn:o=!0,collapsed:a=!1,...i})=>{const l=(0,s.useRef)(null),[c,u]=(0,s.useState)(()=>!r&&a?a:Te("sidebar-collapsed")||window.innerWidth<1280);return(0,s.useEffect)(()=>{"function"==typeof n&&n(c)},[c,n]),(0,s.useEffect)(()=>{if(!r&&a)return;const e=()=>{const e=window.innerWidth<1280;if(r)if(e)u(!0),Ae("sidebar-collapsed",!0);else{const e=Te("sidebar-collapsed");u(e||!1)}else u(!1),(e=>{if(!(typeof window>"u"))try{localStorage.removeItem(e)}catch(e){console.error(e)}})("sidebar-collapsed")};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[r]),(0,j.jsx)(OS.Provider,{value:{isCollapsed:c,setIsCollapsed:u,collapsible:r},children:(0,j.jsx)("div",{ref:l,className:Se("h-full overflow-auto w-72 px-4 py-4 gap-4 flex flex-col bg-background-primary",o&&"border-0 border-r border-solid border-border-subtle","transition-all duration-200",c&&"w-16 px-2",t),...i,children:e})})};zS.displayName="Sidebar";const PS=({children:e})=>(0,j.jsx)("div",{className:"space-y-2",children:e});PS.displayName="Sidebar.Header";const RS=({children:e})=>(0,j.jsx)("div",{className:Se("space-y-4 grow items-start"),children:e});RS.displayName="Sidebar.Body";const US=({children:e})=>{const{isCollapsed:t,setIsCollapsed:n,collapsible:r}=(0,s.useContext)(OS);return(0,j.jsxs)("div",{className:"space-y-4",children:[e,r&&(0,j.jsx)("button",{className:Se("bg-transparent w-full border-0 p-0 m-0 flex items-center gap-2 text-base cursor-pointer",t&&"justify-center"),onClick:()=>{n(!t),Ae("sidebar-collapsed",!t)},"aria-label":t?"Expand sidebar":"Collapse sidebar",children:t?(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(Wo,{title:"Expand",children:(0,j.jsx)(TS,{className:"size-5"})})}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(LS,{className:"size-5"})," Collapse"]})})]})};US.displayName="Sidebar.Footer";const BS=({children:e,className:t})=>(0,j.jsx)("div",{className:Se("w-full",t),children:e});BS.displayName="Sidebar.Item";const FS=Object.assign(zS,{Header:PS,Body:RS,Footer:US,Item:BS}),QS=function({accordionGroups:e,currentTab:t,currentSection:n,onTabChange:r,onSectionChange:o}){const[a,l]=(0,s.useState)(()=>new Set((null!=e?e:[]).filter(e=>e.sections.length>0).map(e=>e.id)));(0,s.useEffect)(()=>{const t=(null!=e?e:[]).filter(e=>e.sections.length>0).map(e=>e.id);l(e=>{let n=!1;const r=new Set(e);return t.forEach(e=>{r.has(e)||(r.add(e),n=!0)}),n?r:e})},[e]);const c=(null!=e?e:[]).find(e=>e.id===t),u=n&&c?.sections.length>0?`${t}|${n}`:t,d={};return(null!=e?e:[]).forEach(e=>{0===e.sections.length?d[e.id]=e.name:e.sections.forEach(e=>{d[`${e.tabId}|${e.id}`]=e.name})}),(0,i.createElement)("div",{className:"wcf-step-setting--sidebar-wrapper w-full lg:w-auto"},(0,i.createElement)("div",{className:"lg:hidden px-6 py-4",onClickCapture:e=>e.preventDefault()},(0,i.createElement)(lw,{value:u,onChange:e=>{if(e.includes("|")){const[t,n]=e.split("|");o(t,n)}else r(e)},size:"md"},(0,i.createElement)(lw.Button,{placeholder:(0,C.__)("Select a Settings Tab","cartflows"),render:e=>{var t;return null!==(t=d[e])&&void 0!==t?t:e}}),(0,i.createElement)(lw.Portal,null,(0,i.createElement)(lw.Options,null,(null!=e?e:[]).map(e=>e.sections.length>0?(0,i.createElement)(lw.OptionGroup,{key:e.id,label:e.name},e.sections.map(e=>(0,i.createElement)(lw.Option,{key:e.id,value:`${e.tabId}|${e.id}`},e.name))):(0,i.createElement)(lw.Option,{key:e.id,value:e.id},e.name)))))),(0,i.createElement)("div",{className:"wcf-step-setting--sidebar hidden lg:flex h-full min-h-screen flex-col w-auto sticky top-0 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-[420px] after:h-screen after:bg-background-primary after:-z-10"},(0,i.createElement)(FS,{borderOn:!0,className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow"},(0,i.createElement)(FS.Body,{className:"!p-0 pt-2"},(0,i.createElement)(FS.Item,null,(0,i.createElement)(fp,{className:"w-full p-0 bg-transparent",size:"md"},(0,i.createElement)("ul",{className:"m-0 p-0 list-none flex flex-col gap-0.5"},(null!=e?e:[]).map(e=>{const c=a.has(e.id),u=t===e.id,d=e.sections.length>0,f=e.icon,p=d&&u;return(0,i.createElement)(s.Fragment,{key:e.id},(0,i.createElement)(fp.Item,{active:!d&&u,onClick:()=>(e=>{if(0===e.sections.length)r(e.id);else if(a.has(e.id))l(t=>{const n=new Set(t);return n.delete(e.id),n});else{l(t=>new Set([...t,e.id]));const t=e.sections[0];o(t.tabId,t.id)}})(e),className:d?"hover:!bg-transparent":"hover:!bg-brand-25 hover:[&>svg]:!text-brand-600 "+(u?"!bg-brand-25 !text-text-primary [&>svg]:!text-brand-600":"")},(0,i.createElement)(f,{className:p?"!text-icon-interactive":""}),(0,i.createElement)("div",{className:"flex-1"},e.name),d&&(0,i.createElement)(Lp,{className:"!size-4 shrink-0 text-icon-secondary transition-transform duration-200 "+(c?"rotate-180":"")})),d&&c&&(0,i.createElement)("div",{className:"border-l border-solid border-r-0 border-t-0 border-b-0 border-border-subtle pl-4 ml-5"},e.sections.map(e=>{const r=t===e.tabId&&n===e.id;return(0,i.createElement)(fp.Item,{key:e.id,active:r,onClick:()=>o(e.tabId,e.id),className:"p-1 hover:!bg-brand-25 "+(r?"!bg-brand-25 !text-text-primary":"")},(0,i.createElement)("div",null,e.name))})))}))))))))};function VS({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const YS=s.forwardRef(VS),ZS=function({section:e}){const[{options:t,page_builder:n,step_data:r}]=Yp();if(!e)return null;if("shortcode"===e.slug&&"other"!==n)return null;const o={...e,step_type:r?.type||""};return!1===dm.isActiveControl(o,t)?null:(0,i.createElement)("div",{className:"wcf-section-content"},(0,i.createElement)(kI,{settings:o,displayAs:"div"}))};function WS({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"}))}const GS=s.forwardRef(WS);function HS({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 18.75a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h6m-9 0H3.375a1.125 1.125 0 0 1-1.125-1.125V14.25m17.25 4.5a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h1.125c.621 0 1.129-.504 1.09-1.124a17.902 17.902 0 0 0-3.213-9.193 2.056 2.056 0 0 0-1.58-.86H14.25M16.5 18.75h-2.25m0-11.177v-.958c0-.568-.422-1.048-.987-1.106a48.554 48.554 0 0 0-10.026 0 1.106 1.106 0 0 0-.987 1.106v7.635m12-6.677v6.677m0 4.5v-4.5m0 0h-12"}))}const $S=s.forwardRef(HS),XS=function(){const[{options:e},t]=Yp(),n="yes"===e["wcf-show-coupon-field"],r="yes"===e["wcf-optimize-coupon-field"],o="yes"===e["wcf-checkout-additional-fields"],a="yes"===e["wcf-optimize-order-note-field"],s="yes"===e["wcf-shipto-diff-addr-fields"],l="yes"===e["wcf-google-autoaddress"],c="yes"===e["wcf-custom-no-shipping-method-message-toggle"],u=e["wcf-no-shipping-method-message"]||"",d=e["wcf-order-review-summary-position"]||"top",f=(e,n)=>{t({type:"SET_OPTION",name:e,value:n})},p=[{value:"top",label:(0,C.__)("Top","cartflows")},{value:"bottom",label:(0,C.__)("Bottom","cartflows")}];return(0,i.createElement)("div",{className:"flex flex-col gap-4"},(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Coupon Field","cartflows")),(0,i.createElement)(Pg,{value:n,onChange:e=>f("wcf-show-coupon-field",e?"yes":"no")})),n&&(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Collapsible Coupon Field","cartflows")),(0,i.createElement)(Pg,{value:r,onChange:e=>f("wcf-optimize-coupon-field",e?"yes":"no")}))),(0,i.createElement)("input",{type:"hidden",name:"wcf-show-coupon-field",value:n?"yes":"no"}),(0,i.createElement)("input",{type:"hidden",name:"wcf-optimize-coupon-field",value:r?"yes":"no"}),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Additional Field","cartflows")),(0,i.createElement)(Pg,{value:o,onChange:e=>f("wcf-checkout-additional-fields",e?"yes":"no")})),o&&(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Collapsible Additional Field","cartflows")),(0,i.createElement)(Pg,{value:a,onChange:e=>f("wcf-optimize-order-note-field",e?"yes":"no")}))),(0,i.createElement)("input",{type:"hidden",name:"wcf-checkout-additional-fields",value:o?"yes":"no"}),(0,i.createElement)("input",{type:"hidden",name:"wcf-optimize-order-note-field",value:a?"yes":"no"}),(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Ship To Different Address","cartflows")),(0,i.createElement)(Pg,{value:s,onChange:e=>f("wcf-shipto-diff-addr-fields",e?"yes":"no")})),(0,i.createElement)("input",{type:"hidden",name:"wcf-shipto-diff-addr-fields",value:s?"yes":"no"}),(0,i.createElement)("div",{className:"flex flex-col py-1"},(0,i.createElement)("div",{className:"flex items-center justify-between"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Google Address Autocomplete","cartflows")),(0,i.createElement)(Pg,{value:l,onChange:e=>f("wcf-google-autoaddress",e?"yes":"no")})),(0,i.createElement)("div",{className:"flex items-start gap-1 text-sm font-normal text-text-tertiary mt-2"},(0,i.createElement)(vg,{className:"w-4 h-4 shrink-0 mt-px text-icon-secondary"}),(0,i.createElement)("span",null,(0,C.__)("Before enabling this option, make sure that you have added API key in Google Address Autocomplete Settings.","cartflows")))),(0,i.createElement)("input",{type:"hidden",name:"wcf-google-autoaddress",value:l?"yes":"no"}),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)("div",{className:"flex items-center gap-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Custom Shipping Message","cartflows")),(0,i.createElement)(Wo,{content:(0,C.__)("Turn this on to show a custom message when no shipping options are available at checkout.","cartflows"),placement:"top"},(0,i.createElement)("span",null,(0,i.createElement)(vg,{className:"w-4 h-4 text-icon-secondary cursor-help"})))),(0,i.createElement)(Pg,{value:c,onChange:e=>f("wcf-custom-no-shipping-method-message-toggle",e?"yes":"no")})),(0,i.createElement)("input",{type:"hidden",name:"wcf-custom-no-shipping-method-message-toggle",value:c?"yes":"no"}),c&&(0,i.createElement)("div",{className:"flex flex-col gap-1.5"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Shipping Message","cartflows")),(0,i.createElement)(dw,{value:u,rows:2,size:"md",className:"w-full",placeholder:(0,C.__)("There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.","cartflows"),onChange:e=>f("wcf-no-shipping-method-message",e)}))),(0,i.createElement)("input",{type:"hidden",name:"wcf-no-shipping-method-message",value:u}),(0,i.createElement)("div",{className:"flex items-center gap-3"},(0,i.createElement)("div",{className:"flex items-center gap-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Order Summary Position","cartflows")),(0,i.createElement)(Wo,{content:(0,C.__)("Choose this option to adjust where the order summary appears on mobile devices.","cartflows"),placement:"top"},(0,i.createElement)("span",null,(0,i.createElement)(vg,{className:"w-4 h-4 text-icon-secondary cursor-help"})))),(0,i.createElement)("div",{className:"w-32"},(0,i.createElement)(lw,{value:d,onChange:e=>f("wcf-order-review-summary-position",e),size:"md"},(0,i.createElement)(lw.Button,{type:"button",render:e=>{const t=p.find(t=>t.value===e);return t?t.label:e}}),(0,i.createElement)(lw.Portal,null,(0,i.createElement)(lw.Options,null,p.map(e=>(0,i.createElement)(lw.Option,{value:e.value,key:e.value},e.label))))))),(0,i.createElement)("input",{type:"hidden",name:"wcf-order-review-summary-position",value:d}))},qS=function({sectionId:e}){const[{custom_fields:t,step_id:n,options:r,billing_fields:o,shipping_fields:a},l]=Yp(),[c,u]=(0,s.useState)("billing"),d=Oh();if(void 0===t)return(0,i.createElement)(wS,null);if("form-settings"===e)return(0,i.createElement)(XS,null);if("form-headings"===e&&t.checkout_settings)return(0,i.createElement)(ZS,{section:{...t.checkout_settings,slug:"checkout_settings"}});if("place-order-button"===e&&t.button_settings)return(0,i.createElement)(ZS,{section:{...t.button_settings,slug:"button_settings"}});if("field-editor"===e){const e=async function(e,t){if(e.preventDefault(),!await d({title:(0,C.__)("Delete Field","cartflows"),description:(0,C.__)("Are you really want to delete field?","cartflows"),actionBtnText:(0,C.__)("Delete","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")}))return;const r=new FormData,i=e.target.getAttribute("data-key"),s=e.target.getAttribute("data-type");t(i),r.append("action","cartflows_pro_delete_custom_field"),r.append("security",cartflows_admin.delete_custom_field_nonce),r.append("post_id",n),r.append("key",i),r.append("type",s),r.append("step","checkout"),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>{e.status&&(l({type:"SET_FIELDS",field_type:"billing",fields:o.filter(e=>e.key!==i)}),l({type:"SET_FIELDS",field_type:"shipping",fields:a.filter(e=>e.key!==i)}),t(""))})},t=function(e,t,i){e.preventDefault();const s=document.getElementsByClassName("wcf-cpf-add_to")[0],c=document.getElementsByClassName("wcf-cpf-type")[0],u=document.getElementsByClassName("wcf-cpf-label")[0],d=document.getElementsByClassName("wcf-cpf-name")[0],f=document.getElementsByClassName("wcf-cpf-min")[0],p=document.getElementsByClassName("wcf-cpf-max")[0],m=document.getElementsByClassName("wcf-cpf-default")[0],h=document.getElementsByClassName("wcf-cpf-placeholder")[0],g=document.getElementsByClassName("wcf-cpf-options")[0],w=document.getElementsByClassName("wcf-cpf-min-date")[0],y=document.getElementsByClassName("wcf-cpf-max-date")[0],b=document.getElementsByClassName("wcf-cpf-width")[0],v=document.getElementsByClassName("wcf-cpf-show-in-email")[0],x=document.getElementsByClassName("wcf-cpf-required")[0],N=document.getElementsByClassName("wcf-cpf-optimized")[0],E=document.getElementsByClassName("wcf-cpf-date-input")[0],_=E?E.value:"",M=document.getElementsByClassName("wcf-cpf-file-size")[0],I=document.getElementsByClassName("wcf-cpf-accepted-file-types")[0];if(""===u.value){const e=document.createElement("span");return e.className="text-xs text-brand-500",e.textContent=(0,C.__)("Label is required field","cartflows"),document.querySelector(".wcf-cpf-label").insertAdjacentElement("afterend",e),u.focus(),i((0,C.__)("Add New Field","cartflows")),""}const S=["jpg","jpeg","png","gif","webp","ico","pdf","mp3","m4a","ogg","wav","mp4","m4v","mov","wmv","avi","mpg","ogv","3gp","3g2"];if(I&&I.value.trim()){const e=I.value.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e).filter(e=>!S.includes(e));if(e.length){const t=document.querySelector(".wcf-cpf-accepted-file-types + .wcf-cpf-error");t&&t.remove();const n=document.createElement("span");return n.className="wcf-cpf-error text-xs text-brand-500",n.textContent=(0,C.sprintf)(/* translators: %s: invalid extensions */ /* translators: %s: invalid extensions */
27 -(0,C.__)("Invalid file type(s): %s","cartflows"),e.join(", ")),I.insertAdjacentElement("afterend",n),I.focus(),i((0,C.__)("Add New Field","cartflows")),""}}const k=new FormData;k.append("add_to",s?s.value:""),k.append("type",c?c.value:""),k.append("label",u?u.value:""),k.append("name",d?d.value:""),k.append("default",m?m.value:""),k.append("min",f?f.value:""),k.append("max",p?p.value:""),k.append("placeholder",h?h.value:""),k.append("min_date",w?w.value:""),k.append("max_date",y?y.value:""),k.append("options",g?g.value:""),k.append("date_input",_||"datetime-local"),k.append("width",b?b.value:""),k.append("required",x?x.value:""),k.append("show_in_email",v?v.value:""),k.append("optimized",N?N.value:""),k.append("file_size",M?M.value:"5"),k.append("accepted_file_types",I?I.value:""),k.append("action","cartflows_pro_prepare_custom_field"),k.append("security",cartflows_admin.prepare_custom_field_nonce),k.append("post_id",n),k.append("save_field_name","wcf_field_order_"),qf()({url:cartflows_admin.ajax_url,method:"POST",body:k}).then(e=>{if(e.success){const t=e.data,n=t.field_data;if("billing"===t.add_to){o.push(n);const e=r.wcf_field_order_billing;e[t.new_field.key]=t.new_field,l({type:"SET_OPTION",name:"wcf_field_order_billing",value:e}),l({type:"SET_FIELDS",field_type:"billing",fields:o})}if("shipping"===t.add_to){a.push(n);const e=r.wcf_field_order_shipping;e[t.new_field.key]=t.new_field,l({type:"SET_OPTION",name:"wcf_field_order_shipping",value:e}),l({type:"SET_FIELDS",field_type:"shipping",fields:a})}}t()})};return(0,i.createElement)("div",{className:"wcf-field-editor-section"},(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Custom Field Editor","cartflows")),(0,i.createElement)(Pg,{value:"yes"===r["wcf-custom-checkout-fields"],onChange:e=>l({type:"SET_OPTION",name:"wcf-custom-checkout-fields",value:e?"yes":"no"})})),(0,i.createElement)("input",{type:"hidden",name:"wcf-custom-checkout-fields",value:r["wcf-custom-checkout-fields"]}),"yes"===r["wcf-custom-checkout-fields"]&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-checkout-fields-tabs mt-4 mb-0"},(0,i.createElement)(YM.Group,{variant:"rounded",size:"sm",width:"full",activeItem:c,onChange:({value:e})=>u(e.slug)},(0,i.createElement)(YM.Tab,{slug:"billing",text:(0,C.__)("Billing Fields","cartflows"),icon:(0,i.createElement)(GS,{className:"w-4 h-4"}),type:"button"}),(0,i.createElement)(YM.Tab,{slug:"shipping",text:(0,C.__)("Shipping Fields","cartflows"),icon:(0,i.createElement)($S,{className:"w-4 h-4"}),type:"button"}))),"billing"===c&&o&&(0,i.createElement)("div",{id:"wcf-billing-fields",className:"wcf-billing-fields billing-field-sortable wcf-field-row w-full"},(0,i.createElement)(tS,{data:o,step:"checkout",type:"billing",removeCallback:e})),"shipping"===c&&a&&(0,i.createElement)("div",{id:"wcf-shipping-fields",className:"wcf-shipping-fields shipping-field-sortable wcf-field-row w-full"},(0,i.createElement)(tS,{data:a,step:"checkout",type:"shipping",removeCallback:e})),(0,i.createElement)("div",{className:"text-end"},wcfCartflowsPro()&&(0,i.createElement)(gS,{addNewField:t,step_type:"checkout"}))))}return null},JS=function(){const[{options:e,page_settings:t},n]=Yp();if(mI())return(0,i.createElement)(pI,{title:(0,C.__)("Let Customers Choose Exactly What They Want","cartflows"),description:(0,C.__)("Offer flexible product options right at checkout — quantities, variations, and more. Upgrade to CartFlows Pro and start customizing your offers today.","cartflows")});const r="yes"===e["wcf-enable-product-options"],o=e["wcf-product-options"]||"force-all",a="yes"===e["wcf-enable-product-variation"],s=e["wcf-product-variation-options"]||"inline",l="yes"===e["wcf-enable-product-quantity"],c=t?.settings?.["product-options"]?.desc||null,u=(e,t)=>{n({type:"SET_OPTION",name:e,value:t})};return(0,i.createElement)("div",{className:"flex flex-col"},(0,i.createElement)("div",{className:"flex items-center justify-between py-4"},(0,i.createElement)(Of,{htmlFor:"wcf-enable-product-options-switch",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Product Options","cartflows")),(0,i.createElement)(Pg,{id:"wcf-enable-product-options-switch",value:r,onChange:e=>u("wcf-enable-product-options",e?"yes":"no")})),(0,i.createElement)("input",{type:"hidden",name:"wcf-enable-product-options",value:r?"yes":"no"}),r&&(0,i.createElement)("div",{className:"flex flex-col gap-2 pb-4 border-b border-border-subtle border-solid border-0"},(0,i.createElement)(Of,{tag:"p",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Conditions","cartflows")),(0,i.createElement)(Vg.Group,{gapClassName:"gap-1.5",value:o,onChange:e=>u("wcf-product-options",e),style:"simple",size:"sm",vertical:!0,className:"w-full"},(0,i.createElement)(Vg.Button,{value:"force-all",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,C.__)("Restrict user to purchase all products","cartflows")}}),(0,i.createElement)(Vg.Button,{value:"single-selection",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,C.__)("Let user select one product from all options","cartflows")}}),(0,i.createElement)(Vg.Button,{value:"multiple-selection",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,C.__)("Let user select multiple products from all options","cartflows")}}))),(0,i.createElement)("input",{type:"hidden",name:"wcf-product-options",value:o}),(0,i.createElement)("div",{className:"flex items-center justify-between py-4"},(0,i.createElement)(Of,{htmlFor:"wcf-enable-product-variation-switch",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Variations","cartflows")),(0,i.createElement)(Pg,{id:"wcf-enable-product-variation-switch",value:a,onChange:e=>u("wcf-enable-product-variation",e?"yes":"no")})),(0,i.createElement)("input",{type:"hidden",name:"wcf-enable-product-variation",value:a?"yes":"no"}),a&&(0,i.createElement)("div",{className:"flex flex-col gap-2 pb-4 border-b border-border-subtle border-solid border-0"},(0,i.createElement)(Vg.Group,{gapClassName:"gap-1.5",value:s,onChange:e=>u("wcf-product-variation-options",e),style:"simple",size:"sm",vertical:!0,className:"w-full"},(0,i.createElement)(Vg.Button,{value:"inline",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,C.__)("Show variations inline","cartflows")}}),(0,i.createElement)(Vg.Button,{value:"popup",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,C.__)("Show variations in popup","cartflows")}}))),(0,i.createElement)("input",{type:"hidden",name:"wcf-product-variation-options",value:s}),(0,i.createElement)("div",{className:"flex items-center justify-between py-4 !pb-0"},(0,i.createElement)(Of,{htmlFor:"wcf-enable-product-quantity-switch",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Enable Quantity","cartflows")),(0,i.createElement)(Pg,{id:"wcf-enable-product-quantity-switch",value:l,onChange:e=>u("wcf-enable-product-quantity",e?"yes":"no")})),(0,i.createElement)("input",{type:"hidden",name:"wcf-enable-product-quantity",value:l?"yes":"no"}),c&&(0,i.createElement)("div",{className:"flex items-start gap-1 text-sm font-normal text-text-tertiary mt-2"},(0,i.createElement)(vg,{className:"w-4 h-4 shrink-0 mt-px text-icon-secondary"}),(0,i.createElement)("span",null,Zm(c))))},KS={landing:ch,checkout:uh,upsell:dh,downsell:fh,optin:ph,thankyou:mh},ek=function(){var e;const[{step_id:t,flow_id:n,step_data:r}]=Yp(),o=(0,h.useHistory)(),a=Oh(),s=r?.type||"",l=null!==(e=KS[s])&&void 0!==e?e:null;return(0,i.createElement)("div",{className:"flex flex-col gap-4"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-normal text-text-secondary"},(0,C.__)("Replace this step with a different template. Your current design and content for this step will be permanently removed.","cartflows")),(0,i.createElement)("div",{className:"flex items-center gap-4"},l&&(0,i.createElement)("img",{src:l,alt:s,className:"rounded-lg w-[72px] h-[72px]"}),(0,i.createElement)("div",{className:"flex flex-col gap-1"},(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,C.__)("Step Type","cartflows")),(0,i.createElement)(Of,{tag:"span",size:"sm",className:"font-normal text-text-secondary capitalize"},s))),(0,i.createElement)("div",null,(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:async()=>{await a({title:(0,C.__)("Update Template","cartflows"),description:(0,C.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"),actionBtnText:(0,C.__)("Update","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})&&o.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&step_id=${t}&tab=update-template`)}},(0,C.__)("Update Template","cartflows"))))};function tk({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))}const nk=s.forwardRef(tk),rk=function({onEditingChange:e}){const[{step_id:t,flow_id:n},r]=Yp();let[{step_title:o}]=Yp();(0,s.useEffect)(()=>{let e=!0;return e&&qf()({path:`/cartflows/v1/admin/flow-data/${n}`}).then(t=>{e&&r({type:"SET_FLOW_DATA",data:t})}),()=>{e=!1}},[o]);const[a,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),[d,f]=(0,s.useState)("");if(!1===o)return null;if(a)return(0,i.createElement)("div",{className:"flex items-center gap-2 flex-1 min-w-0"},(0,i.createElement)(tg,{id:"new-step-title",value:d,onChange:f,size:"md",className:"!py-2",autoComplete:"off"}),(0,i.createElement)(Ro,{variant:"primary",size:"sm",type:"button",loading:c,disabled:c,onClick:n=>{n.preventDefault(),u(!0);const o=new window.FormData;o.append("action","cartflows_update_step_title"),o.append("security",cartflows_admin.update_step_title_nonce),o.append("step_id",t),o.append("new_step_title",d),qf()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(()=>{r({type:"SET_STEP_TITLE",title:d}),u(!1),l(!1),e?.(!1),hm.success((0,C.__)("Step title updated successfully!","cartflows"))})}},(0,C.__)("Save","cartflows")),(0,i.createElement)(Ro,{variant:"outline",size:"sm",type:"button",disabled:c,onClick:t=>{t.preventDefault(),l(!1),e?.(!1)}},(0,C.__)("Cancel","cartflows")));""===o&&(o=(0,C.__)("(no title)","cartflows"));const p=um(o,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length);return(0,i.createElement)("div",{className:"wcf-edit-step__title-wrap flex items-center gap-1.5"},(0,i.createElement)("span",{className:"wcf-steps-header__title--text text-xl font-semibold text-text-primary truncate max-w-xs",title:o},p),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",type:"button",icon:(0,i.createElement)(nk,null),onClick:t=>{t.preventDefault(),f(o||""),l(!0),e?.(!0)},"aria-label":(0,C.__)("Edit Step Name","cartflows")}))},ok=function({currentTab:e,currentSection:t,sectionObject:n,stepData:r,flowType:o,buttonRef:a,wooStatus:l,setActiveTab:c,backUrl:u}){const[{options:d,is_flow_instant_checkout:p,step_data:m,flow_title:h,step_title:g}]=Yp(),[{license_status:w}]=f(),[y,b]=(0,s.useState)(!1),[v,x]=(0,s.useState)((0,C.__)("Activate WooCommerce","cartflows")),N=l||!l&&"landing"===r?.type,E=mI(),_=mI("plus-pro"),M="coupon"===t&&E,I="product-options"===t&&E,k="dynamic-offers"===e&&E,D="order_bumps"===e&&_,j=["upsell","downsell"].includes(m?.type)&&wcfCartflowsPro()&&"Activated"!==w,A=M||I||k||D||j,T=A||!l&&["checkout","upsell","downsell","thankyou"].includes(r?.type),L="storeCheckout"===o?"store-checkout":"flows",O="storeCheckout"===o?(0,C.__)("Store Checkout","cartflows"):(0,C.__)("Funnels","cartflows"),z=g&&!1!==g?(0,C.sprintf)(/* translators: %s: step name */ /* translators: %s: step name */
28 -(0,C.__)("%s Settings","cartflows"),g):(0,C.__)("Step Settings","cartflows"),P=(e=!0)=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)("nav",{"aria-label":(0,C.__)("Breadcrumb","cartflows"),className:"flex items-center gap-1 py-1 text-xs text-text-tertiary flex-wrap"},(0,i.createElement)("a",{href:`admin.php?page=cartflows&path=${L}`,className:"text-text-secondary hover:text-text-primary no-underline transition-colors"},O),h&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{"aria-hidden":"true",className:"mx-0.5"},">"),(0,i.createElement)("a",{href:`admin.php${u}`,className:"text-text-secondary hover:text-text-primary no-underline transition-colors"},h)),(0,i.createElement)("span",{"aria-hidden":"true",className:"mx-0.5"},">"),(0,i.createElement)("span",{"aria-current":"page",className:"text-text-primary font-medium"},z)),(0,i.createElement)("div",{className:"flex justify-between items-center h-10"},(0,i.createElement)("div",{className:"flex items-center gap-2.5"+(y?" flex-1 min-w-0":"")},(0,i.createElement)(S,{to:{pathname:"admin.php",search:u},className:"text-icon-secondary hover:text-icon-primary no-underline shrink-0 transition-colors","aria-label":(0,C.__)("Back to funnel","cartflows")},(0,i.createElement)(YS,{className:"w-5 h-5 flex stroke-1"})),(0,i.createElement)(rk,{onEditingChange:b})),e&&!T&&!y&&(0,i.createElement)(bw,{id:"wcf-save-step-meta",ref:a})));if(!N)return(0,i.createElement)("div",{className:"wcf-step-settings--container min-w-0 max-w-4.5xl flex flex-col gap-3 p-4 md:p-8 mx-auto w-full box-border"},P(!1),(0,i.createElement)("div",{className:"bg-brand-25 border border-border-subtle rounded-lg px-5 py-4 lg:px-7 sm:py-6 flex justify-between gap-6"},(0,i.createElement)("div",{className:"max-w-full"},(0,i.createElement)("h2",{className:"text-base font-medium tracking-tight text-text-primary sm:text-base"},(0,C.__)("WooCommerce is Required!","cartflows")),(0,i.createElement)("p",{className:"wcf-upgrade-to-pro-cta--text text-base font-normal text-text-secondary mt-2"},(0,C.sprintf)(
18 +(0,j.__)("Use this setting to customize the style of the Instant %s Layout.","cartflows"),"thankyou"===a?.type?(0,j.__)("Thank You","cartflows"):a?.type.charAt(0).toUpperCase()+a?.type.slice(1))):(0,i.createElement)(i.Fragment,null,(0,j.__)("If you are using shortcodes, enable this design settings to apply styles.","cartflows"))))),c&&(0,i.createElement)("div",{className:"wcf-design-page__settings"},(0,i.createElement)("div",{className:"mb-4"},(0,i.createElement)(u_,{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:n["wcf-enable-design-settings"],label:(0,j.__)("Enable Design Settings","cartflows"),fullWidth:!0})),"yes"===n["wcf-enable-design-settings"]&&Object.keys(c).map((e,t)=>(0,i.createElement)(y_,{settings:c[e],key:e,isOpen:0===t,isActive:Zm.isActiveControl(c[e],n)}))))},v_=({title:e="",description:t="",icon:n=null,iconPosition:r="right",tag:o="h2",size:a="sm",className:i=""})=>{const s={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!e)return null;const l=()=>(0,C.jsx)(o,{className:Se("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[a]),children:e});return t?(0,C.jsxs)("div",{className:i,children:[(0,C.jsxs)("div",{children:[n&&"left"===r&&(0,C.jsxs)("div",{className:Se("flex items-center",s[a]),children:[n,l()]}),n&&"right"===r&&(0,C.jsxs)("div",{className:Se("flex items-center",s[a]),children:[l(),n]}),!n&&l()]}),(0,C.jsx)("p",{className:Se("text-text-secondary font-normal my-0",{xs:"text-sm",sm:"text-sm",md:"text-base",lg:"text-base"}[a]),children:t})]}):(0,C.jsxs)("div",{className:i,children:[n&&"left"===r&&(0,C.jsxs)("div",{className:Se("flex items-center",s[a]),children:[n,l()]}),n&&"right"===r&&(0,C.jsxs)("div",{className:Se("flex items-center",s[a]),children:[l(),n]}),!n&&l()]})},x_=function(e){const t=e.heading?e.heading:"",n=e.subHeading?e.subHeading:"",r=e.description?e.description:"",o=e.btnText||(0,j.__)("Upgrade to CartFlows Pro","cartflows"),a=e.class?e.class:"",s=e.usps?e.usps:"";return(0,i.createElement)("div",{className:`wcf-upgrade-to-pro-cta ${a}`},(0,i.createElement)("div",{className:"bg-brand-25 border border-solid border-brand-200 rounded-xl px-5 py-5 lg:px-6 sm:py-5"},(0,i.createElement)("div",{className:"flex flex-col gap-3"},t&&(0,i.createElement)(v_,{size:"sm",tag:"h2",title:t}),n&&(0,i.createElement)(vh,{size:14,color:"secondary"},n),(0,i.createElement)("div",{className:"flex items-center"},(0,i.createElement)(Pg,{buttonLink:e.buttonLink,ctaText:o}))),r&&(0,i.createElement)(vh,{size:14,color:"secondary",className:"wcf-upgrade-to-pro-cta--text mt-3"},r),s&&(0,i.createElement)("ul",{className:"wcf-upgrade-to-pro-cta-list list-none p-0 m-0 mt-3"},s.map((e,t)=>(0,i.createElement)("li",{className:"wcf-upgrade-to-pro-cta-list-item flex gap-2 items-center mb-2",key:t},(0,i.createElement)(hg,{className:"w-18 h-18 stroke-2 text-brand-500 shrink-0"}),(0,i.createElement)(vh,{size:14,color:"secondary"},e))))))},N_=function(){return(0,i.createElement)("div",{className:"wcf-settings-nav"},(0,i.createElement)("div",{className:"wcf-settings-nav__tabs"},Array(5).fill().map(e=>(0,i.createElement)("div",{className:"wcf-settings-nav__tab",key:e},(0,i.createElement)(sw,{height:"45px"})))),(0,i.createElement)("div",{className:"wcf-settings-nav__content"},(0,i.createElement)(aw,{fontSize:"35px",width:"225px"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"65%"}),(0,i.createElement)(iw,null),(0,i.createElement)(aw,{fontSize:"35px",width:"300px"}),(0,i.createElement)(aw,{width:"60%"}),(0,i.createElement)(aw,{width:"60%"}),(0,i.createElement)(aw,{width:"45%"})))};function I_({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const M_=p.forwardRef(I_),E_=function(){const[{step_id:e,flow_id:t,step_data:n}]=Nm(),[r,o]=(0,i.useState)("collapsed"),a=(0,d.useHistory)(),s=dg();return(0,i.createElement)("div",{className:"wcf-change-step-template accordion-item bg-background-primary -mx-8 border-b border-border-subtle"},(0,i.createElement)("h2",{className:"accordion-header mb-0",id:"wcf_change_step_template_toggler"},(0,i.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none ${r}`,type:"button","data-bs-toggle":"collapse","data-bs-target":"#wcf_collapse_change_step_template","aria-expanded":"false","aria-controls":"wcf_collapse_change_step_template",onClick:function(){o("collapsed"===r?"":"collapsed")}},(0,i.createElement)("span",null,(0,j.__)("Change Template","cartflows")),""===r?(0,i.createElement)(M_,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}):(0,i.createElement)(dm,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}))),(0,i.createElement)("div",{id:"wcf_collapse_change_step_template",className:`accordion-collapse px-8 pt-4 pb-8 ${r}`,"aria-labelledby":"wcf_change_step_template_toggler"},(0,i.createElement)("div",{className:"accordion-body"},(0,i.createElement)("div",{className:"mb-3 flex items-center gap-4"},(0,i.createElement)("img",{src:function(){let e="";switch(n.type){case"landing":e=Fh;break;case"checkout":e=Yh;break;case"optin":e=Gh;break;case"thankyou":e=Wh;break;case"upsell":e=Zh;break;case"downsell":e=Vh}return e}(),alt:n.type,className:"rounded-lg w-[85px] h-[85px]"}),(0,i.createElement)("div",{className:"wcf-template-content"},(0,i.createElement)("div",{className:"wcf-step-template-type mb-3"},(0,i.createElement)("span",{className:"text-sm font-medium"},(0,j.__)("Step Type: ","cartflows")),(0,i.createElement)("span",{className:"text-sm font-normal text-text-secondary capitalize"},n.type)),(0,i.createElement)("div",{className:"wcf-change-step wcf-button wcf-secondary-button",onClick:async function(){await s({title:(0,j.__)("Update Template","cartflows"),description:(0,j.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"),actionBtnText:(0,j.__)("Update","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")})&&a.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}step_id=${e}&tab=update-template`)}},(0,i.createElement)("span",{className:""},(0,j.__)("Update Template","cartflows"))))))))},S_=function(){const[{step_data:e,settings_data:t,page_builder:n,flow_type:r,step_title:o,options:a}]=Nm(),[{license_status:s}]=l();let c=!0;if(void 0!==e.id&&(c=!1),c||!t?.settings)return(0,i.createElement)(N_,null);const u=t.settings,d=Object.values(u).sort(function(e,t){return e.priority-t.priority});return["upsell","downsell"].includes(e.type)&&wcfCartflowsPro()&&"Activated"!==s?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,i.createElement)(x_,{heading:(0,j.__)("License is required!","cartflows"),subHeading:(0,j.__)("Activate the license to modify this offer step's settings","cartflows")}))):(0,i.createElement)("div",{className:"wcf-settings-page"},u&&Object.keys(d).map((t,r)=>"other"!==n&&"shortcode"===d[t].slug?null:(d[t].step_type=e?.type||"",(0,i.createElement)(y_,{settings:d[t],key:t,displayAs:"div",isOpen:0===r,isActive:Zm.isActiveControl(d[t],a)}))),"storeCheckout"===r&&o&&(0,i.createElement)(E_,null))},D_=function({settings:e},t="tr"){const[{options:n}]=Nm(),r=e=>{let t="";const r=e.name;if(r&&r.includes("[")){const o=r.split("["),a=[];for(let e=1;e<o.length;e++)a.push(o[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=n[i],l=n["wcf-offer-product"];if((null==l||""===l||l.length<=0)&&("wcf-offer-product[original_price]"===r||"wcf-offer-product[sell_price]"===r))return(0,j.__)("No product Selected","cartflows");const c=Array.isArray(l)?parseFloat(l[0].original_price):parseFloat(l.original_price);if("wcf-offer-product[sell_price]"===r&&c){const t=n["wcf-offer-discount"],r=parseFloat(n["wcf-offer-discount-value"]);let o=c;return"discount_percent"===t?r>0&&(o=(c-c*r/100).toFixed(2)):"discount_price"===t&&r>0&&(o=(c-r).toFixed(2)),e.class=o<0?"error_field":"",o}t=s[a[0]]}else t=n[e.name]?n[e.name]:"";return t};return(0,i.createElement)("div",{className:"wcf-list-options wcf-offer-list-options"},(0,i.createElement)("div",{className:"wcf-list-options-wrapper"},"tr"===t?(0,i.createElement)("table",{className:"w-full"},(0,i.createElement)("tbody",null,Object.keys(e.fields).map(t=>{const o=e.fields[t],a=r(o),s=Zm.isActiveControl(o,n);return(0,i.createElement)(i_,{key:t,data:o,value:a,isActive:s,field:t})}))):(0,i.createElement)("div",{className:"wcf-list-options-container"},Object.keys(e.fields).map(o=>{const a=e.fields[o],s=r(a),l=Zm.isActiveControl(a,n);return(0,i.createElement)(i_,{key:o,data:a,value:s,isActive:l,field:o,tabName:"list-options",displayAs:t})}))),(0,i.createElement)("table",null,(0,i.createElement)("tbody",null)))},j_=function(){return(0,i.createElement)("div",{className:"wcf-checkout-products is-placeholder"},(0,i.createElement)("div",{className:"wcf-checkout-products--selection wcf-checkout__section"},(0,i.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,i.createElement)("div",{className:"wcf-list-options"},(0,i.createElement)("div",{className:"wcf-list-options__title"},(0,i.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("th",null,(0,i.createElement)("div",{className:"wcf-checkout-product-selection-field"},(0,i.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new"},(0,i.createElement)("div",{className:"wcf-checkout-products__button"}),(0,i.createElement)("div",{className:"wcf-checkout-products__button"})))))))))),(0,i.createElement)("div",{className:"wcf-checkout-products__pro-options"},(0,i.createElement)("div",{className:"wcf-checkout-products--coupon"},(0,i.createElement)("div",{className:"wcf-coupon-selection-wrapper"},(0,i.createElement)("div",{className:"wcf-list-options"},(0,i.createElement)("div",{className:"wcf-list-options__title"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("th",null,(0,i.createElement)("div",null,(0,i.createElement)("div",{className:"wcf-select2-field"},(0,i.createElement)("div",{className:"title"}))))))))))),(0,i.createElement)("div",{className:"wcf-field wcf-submit"},(0,i.createElement)("div",{className:"wcf-checkout-products__button"})))},k_=function(){const[{settings_data:e,page_settings:t,options:n,step_data:r},o]=Nm(),[{license_status:a}]=l(),s=n["wcf-offer-product"]?n["wcf-offer-product"]:"",c=[{value:"",label:"No Discount",icon:(0,i.createElement)(Vx,{className:"w-5 h-5"})},{value:"discount_percent",label:"Discount Percentage",icon:(0,i.createElement)(Wx,{className:"w-5 h-5"})},{value:"discount_price",label:"Discount Price",icon:(0,i.createElement)(Qx,{className:"w-5 h-5"})}],[u,d]=(0,i.useState)(),[f,p]=(0,i.useState)(""),m=(0,j.__)("Add","cartflows"),h=void 0===s.discount_type||""===s.discount_type?"disable":"enable",[g,w]=(0,i.useState)(h);(0,i.useEffect)(()=>{w(s?.discount_type?"enable":"disable")},[s]);const[y,b]=(0,i.useState)({isInProcessing:!1,buttonText:m}),{isInProcessing:v,buttonText:x}=y;return void 0===e.settings?(0,i.createElement)(j_,null):["upsell","downsell"].includes(r.type)&&wcfCartflowsPro()&&"Activated"!==a?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,i.createElement)(x_,{heading:(0,j.__)("License is required!","cartflows"),subHeading:(0,j.__)("Activate the license to modify this offer step's settings","cartflows")}))):(0!==s.length&&function(){const e=n["wcf-offer-discount"],t=parseFloat(n["wcf-offer-discount-value"]),r=parseFloat(s.original_price);let o=0;"discount_percent"===e?t>0&&(o=r-r*t/100):"discount_price"===e&&t>0&&(o=r-t),s.sell_price=o.toFixed(2)}(),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-offer-product--wrapper"},(0,i.createElement)("div",{className:"wcf-offer-products--selection wcf-products__section"},0===s.length?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("input",{name:"wcf-offer-product[]",type:"hidden",value:""}),(0,i.createElement)("div",{className:"wcf-offer-no-product--notice border border-border-subtle bg-gray-25 text-center text-sm font-normal rounded-md p-5"},(0,j.__)("Once you select the product, they will be displayed here.","cartflows")),(0,i.createElement)("div",{className:"wcf-offer-product-selection-field__add-new flex justify-between items-end gap-5 mt-5"},(0,i.createElement)(KE,{name:"",desc:"",field:"product",value:f,allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,j.__)("Search for a Product","cartflows"),onChangeCB:d,sectionClass:"flex-1"}),(0,i.createElement)(Ro,{type:"button",variant:"outline",size:"md",icon:(0,i.createElement)(Kx,{className:"w-4 h-4"}),iconPosition:"left",loading:v,disabled:v,onClick:function(){const e=u?.value;p(u),e&&(b({isInProcessing:!0,buttonText:(0,j.__)("Adding…","cartflows")}),Ep()({path:`/cartflows/v1/admin/product-data/${e}`}).then(t=>{console.log(t),o({type:"ADD_OFFER_PRODUCT",field_name:"wcf-offer-product",product_data:{value:e,quantity:"1",label:u?.label,img_url:t?.img_url,original_price:t?.regular_price}}),p(null),b({isInProcessing:!1,buttonText:m})}),d(null))},className:"wcf-select-product-button shrink-0 h-fit"},x))):(0,i.createElement)("div",{className:"overflow-visible shadow border border-border-subtle rounded-md"},(0,i.createElement)("div",{className:"wcf-offer-product-selection--header border-b border-border-subtle flex gap-4 p-3"},(0,i.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-2/5"},(0,j.__)("Items","cartflows")),(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-20"},(0,j.__)("Quantity","cartflows")),(0,i.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-44"},(0,j.__)("Discount","cartflows")),(0,i.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-24"},(0,j.__)("Shipping Rate","cartflows")),(0,i.createElement)("div",{className:"relative w-[5%]"},(0,i.createElement)("span",{className:"sr-only"},(0,j.__)("Delete","cartflows"))))),(0,i.createElement)("div",{className:"wcf-offer-product-selection--selected-product flex items-center p-3 gap-4"},(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-2/5"},(0,i.createElement)("div",{className:"flex gap-3 items-center"},(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-image flex w-24 h-24"},(0,i.createElement)("img",{src:s.img_url?s.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:Nh(s.label)})),(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-title_text"},(0,i.createElement)("div",{className:"wcf-offer-product-repeater-field__title whitespace-normal text-left","data-product_id":s.value},Nh(s.label)),(0,i.createElement)("div",{className:"wcf-offer-product-repeater-field__reg-price mt-1"},(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"wcf-offer-product--reg-price "+(0<s.sell_price?"line-through text-text-tertiary":"")},cartflows_admin.woo_currency+s.original_price),0<s.sell_price&&(0,i.createElement)("span",{className:"wcf-offer-product--sale-price"},cartflows_admin.woo_currency+s.sell_price)))))),(0,i.createElement)("div",{className:"flex-1 flex gap-2"},(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-qty"},(0,i.createElement)(dN,{id:"",name:"wcf-offer-quantity",class:"input-field !w-20 !text-sm font-normal !m-0",value:n["wcf-offer-quantity"],min:"1"})),(0,i.createElement)("div",{className:"wcf-offer-product-selection--product-discount flex gap-2"},(0,i.createElement)(f_,{name:"wcf-offer-discount",value:n["wcf-offer-discount"],class:"!w-20 !m-0",options:c,callback:function(e,t,n){w(""===n?"disable":"enable")}}),(0,i.createElement)(dN,{id:"",class:"input-field !w-20 !m-0",name:"wcf-offer-discount-value",value:"disable"===g?"":n["wcf-offer-discount-value"],readonly:"disable"===g?"readonly":"",placeholder:"disable"===g?"":"0",min:"1",step:"any"})),(0,i.createElement)("div",{className:"wcf-offer-product-selection--flat-rate flex"},(0,i.createElement)(dN,{id:"",class:"input-field !w-20 !m-0",name:"wcf-offer-flat-shipping-value",placeholder:"0",value:n["wcf-offer-flat-shipping-value"],min:"0"})),(0,i.createElement)("div",{className:"wcf-offer-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[5%] justify-center"},(0,i.createElement)("div",{className:"wcf-delete-product-item py-2 text-brand-500 hover:text-brand-700 cursor-pointer text-right flex justify-end",onClick:function(){o({type:"REMOVE_OFFER_PRODUCT",field_name:"wcf-offer-product"})}},(0,i.createElement)(_h,{className:"h-18 w-18"}))),(0,i.createElement)("input",{name:"wcf-offer-product[]",type:"hidden",className:"wcf-checkout-product-id",value:s.value}))))),(0,i.createElement)("div",{className:"wcf-offer-product--common-settings pt-8"},(0,i.createElement)(D_,{settings:t?.settings.product,displayAs:"div"})))))},C_=function(){return(0,i.createElement)("div",{className:"wcf-multiple-order-bumps is-placeholder"},(0,i.createElement)("div",{className:"wcf-multiple-order-bumps__add-new"},(0,i.createElement)("span",{className:"wcf-add-new-order-bump wcf-button--primary"})),(0,i.createElement)("div",{className:"wcf-multiple-order-bumps__header"},(0,i.createElement)("div",{className:"wcf-column wcf-column--title"},"Title"),(0,i.createElement)("div",{className:"wcf-column wcf-column--status"},"Status"),(0,i.createElement)("div",{className:"wcf-column wcf-column--actions"},"Actions")),(0,i.createElement)("div",{className:"wcf-multiple-order-bumps__content"},(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-order-bump"},(0,i.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,i.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,i.createElement)("div",{className:"wcf-order-bump__data-title"},(0,i.createElement)("span",{title:"ob"}))),(0,i.createElement)("div",{className:"wcf_order_bump__status"},(0,i.createElement)("span",{className:"wcf-ob-status"})),(0,i.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,i.createElement)("span",{title:"Edit Order Bump"}))))),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-order-bump"},(0,i.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,i.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,i.createElement)("div",{className:"wcf-order-bump__data-title"},(0,i.createElement)("span",{title:"ob"}))),(0,i.createElement)("div",{className:"wcf_order_bump__status"},(0,i.createElement)("span",{className:"wcf-ob-status"})),(0,i.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,i.createElement)("span",{title:"Edit Order Bump"})))))))},A_=function(){const[{step_id:e,flow_id:t,options:n,page_settings:r},o]=Nm(),a=Yg("plus-pro"),[{license_status:s}]=l(),[c,u]=(0,i.useState)(!1),d=(0,k.applyFilters)("cartflows.stepSettings.orderBumps",null);if(a||!d){const e=wcfCartflowsPro()&&"Activated"!==s;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Rg,{title:(0,j.__)("Add Extra Revenue to Every Checkout Effortlessly","cartflows"),description:(0,j.__)("Increase the value of every order by offering relevant add-ons customers can buy at checkout in a single click.","cartflows"),onButtonClick:e?void 0:()=>u(!0)}),(0,i.createElement)(Fg,{feature:"order-bump",open:c,setOpen:u}))}return null!==n&&r?(0,i.createElement)(d,{stepId:e,flowId:t,options:n,pageSettings:r,onDispatch:o}):(0,i.createElement)(C_,null)};function T_({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"}))}const L_=p.forwardRef(T_),O_=(0,p.createContext)(null);const z_=e=>!e.isLayoutDirty&&e.willUpdate(!1);function P_(){const e=new Set,t=new WeakMap,n=()=>e.forEach(z_);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const R_=e=>!0===e,U_=({children:e,id:t,inherit:n=!0})=>{const r=(0,p.useContext)(hl),o=(0,p.useContext)(O_),[a,i]=function(){const e=function(){const e=(0,p.useRef)(!1);return Zl(()=>(e.current=!0,()=>{e.current=!1}),[]),e}(),[t,n]=(0,p.useState)(0),r=(0,p.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,p.useCallback)(()=>pi.postRender(r),[r]),t]}(),s=(0,p.useRef)(null),l=r.id||o;null===s.current&&((e=>R_(!0===e)||"id"===e)(n)&&l&&(t=t?l+"-"+t:l),s.current={id:t,group:R_(n)&&r.group||P_()});const c=(0,p.useMemo)(()=>({...s.current,forceRender:a}),[i]);return(0,C.jsx)(hl.Provider,{value:c,children:e})},B_=(0,p.createContext)({}),F_=()=>(0,p.useContext)(B_),Y_=(0,p.createContext)(null),Z_=({children:e,activeItem:t=null,onChange:n,className:r,size:o="sm",orientation:a="horizontal",variant:i="pill",iconPosition:s="left",width:l="full","aria-label":c})=>{const u=(0,p.useMemo)(()=>cw(),[]),d=F_(),f="activeItem"in d,m=d?.activeItem||t,h=(0,p.useCallback)((e,t)=>{n&&n({event:e,value:t})},[n]);let g,w="rounded-full",y="p-1",b="ring-1 ring-tab-border";"vertical"===a?g="gap-0.5":("rounded"===i||"pill"===i)&&("xs"===o||"sm"===o?g="gap-0.5":("md"===o||"lg"===o)&&(g="gap-1")),"rounded"===i||"vertical"===a?w="rounded-md":"underline"===i&&(w="rounded-none",y="p-0",b="border-t-0 border-r-0 border-l-0 border-b border-solid border-tab-border","xs"===o?g="gap-0":"sm"===o?g="gap-2.5":("md"===o||"lg"===o)&&(g="gap-3"));const v=Se(`box-border [&>*]:box-border flex items-center ${"full"===l?"w-full":""} ${"vertical"===a?"flex-col":""}`,w,y,g,b,"underline"!==i?"bg-tab-background":"",r);return(0,C.jsx)("div",{className:v,role:"tablist","aria-orientation":a,...c&&{"aria-label":c},onKeyDown:e=>{const t=Array.from(e.currentTarget.querySelectorAll('[role="tab"]:not([disabled])')),n=t.findIndex(t=>t===e.currentTarget.ownerDocument.activeElement);if(-1===n)return;const r="vertical"!==a,o=r?"ArrowLeft"===e.key:"ArrowUp"===e.key,i=r?"ArrowRight"===e.key:"ArrowDown"===e.key;if(!o&&!i&&"Home"!==e.key&&"End"!==e.key)return;e.preventDefault();let s=n;o?s=n<=0?t.length-1:n-1:i?s=n>=t.length-1?0:n+1:"Home"===e.key?s=0:"End"===e.key&&(s=t.length-1),t[s].focus()},children:(0,C.jsx)(Y_.Provider,{value:{activeItem:m,onChange:h,size:o,variant:i,orientation:a,iconPosition:s,width:l,hasPanels:f},children:(0,C.jsx)(U_,{id:u,children:p.Children.map(e,e=>(0,p.isValidElement)(e)?p.cloneElement(e):null)})})})};Z_.displayName="Tabs.Group";const V_=(0,p.forwardRef)(({slug:e,text:t,icon:n,className:r,disabled:o=!1,badge:a=null,...i},s)=>{const l=(0,p.useContext)(Y_);if(!l)throw new Error("Tab should be used inside Tabs Group");const{activeItem:c,onChange:u,size:d,variant:f,orientation:m,iconPosition:h,width:g,hasPanels:w}=l,y={xs:"px-1.5 py-0.5 text-xs [&_svg]:size-3",sm:"underline"===f?"py-1.5 text-sm [&_svg]:size-4":"px-3 py-1.5 text-sm [&_svg]:size-4",md:"underline"===f?"py-2 text-base [&_svg]:size-5":"px-3.5 py-1.5 text-base [&_svg]:size-5",lg:"underline"===f?"p-2.5 text-lg [&_svg]:size-6":"px-3.5 py-1.5 text-lg [&_svg]:size-6"}[d],b=Se("relative border-none bg-transparent text-text-secondary cursor-pointer flex items-center justify-center transition-[box-shadow,color,background-color] duration-200","full"===g?"flex-1":"","vertical"===m?"w-full justify-between":"");let v="rounded-full";"rounded"===f?v="rounded-md":"underline"===f&&(v="rounded-none");const x=Se(b,"border-none",v,"hover:text-text-primary","focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-border-strong",y,c===e?"bg-background-primary text-text-primary shadow-sm":"",o?"text-text-disabled cursor-not-allowed hover:text-text-disabled":"",r),N=Se("flex items-center gap-1");return(0,C.jsxs)(Xf.button,{ref:s,className:x,disabled:o,onClick:n=>{u(n,{slug:e,text:t})},layoutRoot:!0,role:"tab","aria-selected":c===e,...w&&{"aria-controls":`panel-${e}`},id:`tab-${e}`,tabIndex:c===e?0:-1,...i,children:[c===e&&"underline"===f&&(0,C.jsx)(Xf.span,{layoutId:"underline",layoutDependency:c,className:"absolute right-0 left-0 -bottom-px h-px bg-border-interactive"}),(0,C.jsxs)("span",{className:N,children:["left"===h&&n&&(0,C.jsx)("span",{className:"mr-1 contents center-center transition duration-150",children:n}),t,"right"===h&&n&&(0,C.jsx)("span",{className:"ml-1 contents center-center transition duration-150",children:n})]}),a&&(0,p.isValidElement)(a)&&a]})});V_.displayName="Tabs.Tab";const G_=({activeItem:e,children:t})=>(0,C.jsx)(B_.Provider,{value:{activeItem:e},children:t}),W_=({slug:e,children:t})=>{const n=F_();if(!n)throw new Error("TabPanel should be used inside Tabs");return e!==n.activeItem?null:(0,C.jsx)("div",{role:"tabpanel",id:`panel-${e}`,"aria-labelledby":`tab-${e}`,tabIndex:0,children:t})};W_.displayName="Tabs.Panel",G_.Group=Z_,G_.Tab=V_,G_.Panel=W_;const H_=function(){return(0,i.createElement)("div",{className:"flex flex-col gap-5"},(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(Gg,{className:"w-40 h-4"}),(0,i.createElement)(Gg,{className:"w-10 h-5 rounded-full"})),(0,i.createElement)(Gg,{className:"w-full h-48 rounded-lg"}),(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)(Gg,{className:"w-1/3 h-9 rounded-md"}),(0,i.createElement)(Gg,{className:"w-1/3 h-9 rounded-md"}),(0,i.createElement)(Gg,{className:"w-1/3 h-9 rounded-md"})),["w-32","w-40","w-28","w-36"].map((e,t)=>(0,i.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,i.createElement)(Gg,{className:`${e} h-3.5`}),(0,i.createElement)(Gg,{className:"w-full h-10 rounded-md"}))))},Q_=function(e){const[{page_settings:t,options:n}]=Nm(),r=e=>{let t="";const r=e.name;if(r&&r.includes("[")){const o=r.split("["),a=[];for(let e=1;e<o.length;e++)a.push(o[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=n[i];if("wcf-pre-checkout-offer-product[original_price]"===r||"wcf-pre-checkout-offer-product[sell_price]"===r){const t=n["wcf-pre-checkout-offer-product"];if(""===t||null==t||t.length<=0)return(0,j.__)("No product Selected","cartflows");const o=Array.isArray(t)?parseFloat(t[0].original_price):parseFloat(t.original_price);if("wcf-pre-checkout-offer-product[original_price]"===r)return isNaN(o)?"":String(o);if("wcf-pre-checkout-offer-product[sell_price]"===r&&!isNaN(o)){const t=n["wcf-pre-checkout-offer-discount"],r=parseFloat(n["wcf-pre-checkout-offer-discount-value"]);let a=o;return"discount_percent"===t?r>0&&(a=(o-o*r/100).toFixed(2)):"discount_price"===t&&r>0&&(a=(o-r).toFixed(2)),e.class=a<0?"error_field":"",isNaN(parseFloat(a))?"":String(a)}}t=s[a[0]]}else t=n[e.name]?n[e.name]:"";return t};let o=[];switch(e.tab){case"product":default:o=t?.settings["checkout-offer-product"];break;case"content":o=t?.settings["checkout-offer-content"];break;case"styles":o=t?.settings["checkout-offer-styles"]}const a=function(t){return Object.keys(t.section_fields).map(o=>{const a=t.section_fields[o],s=r(a),l=Zm.isActiveControl(a,n);return(0,i.createElement)(i_,{key:o,data:a,value:s,isActive:l,field:o,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""})})};return(0,i.createElement)("div",{className:"wcf-list-options wcf-co-list-options"},(0,i.createElement)("div",{className:"wcf-co-options-wrapper",id:"wcf-co-options-wrapper"},o&&Object.keys(o.fields).map(t=>{const s=o.fields[t];return s.section_fields?(0,i.createElement)("div",{key:t,className:`wcf-${e.tab?e.tab:"setting"}-tab--${s.id}-section p-5 border border-border-subtle rounded-md mb-5`},(0,i.createElement)("div",{className:`wcf-${e.tab?e.tab:"setting"}-tab--heading-section col-span-full`},(0,i.createElement)(OE,{label:s.title,labelClass:"block text-base font-semibold text-text-primary mb-5"})),e.displayAs&&"tr"===e.displayAs?(0,i.createElement)("table",{className:"w-full"},(0,i.createElement)("tbody",null,a(s))):(0,i.createElement)("div",{className:"wcf-co-list-options-container"},a(s))):(0,i.createElement)("div",{key:t,className:`wcf-${e.tab?e.tab:"setting"}-tab--section mb-5`},e.displayAs&&"tr"===e.displayAs?(0,i.createElement)("table",{className:"wcf-full"},(0,i.createElement)("tbody",null,(0,i.createElement)(i_,{key:t,data:s,value:r(s),isActive:Zm.isActiveControl(s,n),field:s,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""}))):(0,i.createElement)("div",{className:"wcf-co-list-options-container"},(0,i.createElement)(i_,{key:t,data:s,value:r(s),isActive:Zm.isActiveControl(s,n),field:s,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""})))})))};function $_({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"}))}const X_=p.forwardRef($_);function J_({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"}))}const q_=p.forwardRef(J_),K_=function(){const[{options:e}]=Nm(),[t,n]=(0,i.useState)("");(0,i.useEffect)(()=>{const e=document.getElementById("wcf-checkout-offer-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")});return()=>{window.removeEventListener("scroll",n)}},[]);let r=e["wcf-pre-checkout-offer-product"];null!==r&&Array.isArray(r)&&(r=r[0]);const o=e["wcf-pre-checkout-offer-discount"],a=parseFloat(e["wcf-pre-checkout-offer-discount-value"]);let s="";const l=r?parseFloat(r.original_price).toFixed(2):0;"discount_percent"===o?a>0&&(s=(l-l*a/100).toFixed(2)):"discount_price"===o&&a>0&&(s=(l-a).toFixed(2));const c=r&&r.product_image?r.product_image:cartflows_admin.image_placeholder;return(0,i.createElement)("div",{id:"wcf-checkout-offer-preview-wrapper",className:"fullscreen"===t?"wcf-checkout-offer-preview-wrapper fullscreen":"wcf-checkout-offer-preview-wrapper"},(0,i.createElement)("div",{className:"fullscreen"===t?"p-6":"mt-8 bg-background-secondary p-6 -mx-6"},(0,i.createElement)("div",{className:"wcf-pre-checkout-offer--header flex justify-between items-center mb-5 p-2.5"},(0,i.createElement)(cp,{tag:"span",size:"md",className:"font-semibold text-text-primary"},(0,j.__)("Preview","cartflows")),""===t&&(0,i.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-button p-2.5 text-text-tertiary hover:text-text-secondary cursor-pointer",onClick:()=>n("fullscreen")},(0,i.createElement)(X_,{className:"w-5 h-5 stroke-2",title:(0,j.__)("View in Full Screen","cartflows")})),"fullscreen"===t&&(0,i.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-exit-button p-2.5 text-text-tertiary hover:text-text-secondary cursor-pointer",onClick:()=>n("")},(0,i.createElement)(q_,{className:"w-5 h-5 stroke-2",title:(0,j.__)("Exit Full Screen","cartflows")}))),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-wrapper wcf-pre-checkout-full-width"},(0,i.createElement)("div",{id:"wcf-pre-checkout-offer-modal",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]},className:"bg-background-primary border border-border-subtle rounded-md"},(0,i.createElement)("div",{className:"wcf-content-main-wrapper"},(0,i.createElement)("div",{className:"wcf-lightbox-content p-6",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]}},(0,i.createElement)("div",{className:"wcf-content-modal-progress-bar mb-8"},(0,i.createElement)("div",{className:"wcf-progress-bar-nav",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,i.createElement)("div",{className:"wcf-pre-checkout-progress grid grid-cols-3 text-center text-sm font-normal text-text-secondary max-w-2xl mx-auto"},(0,i.createElement)("div",{className:"wcf-nav-bar-step active"},(0,i.createElement)("div",{className:"wcf-nav-bar-title mb-3",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,j.__)("Order Submitted","cartflows")),(0,i.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,i.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}},(0,i.createElement)("span",{className:"before"})),(0,i.createElement)("span",{className:"order-after",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}}))),(0,i.createElement)("div",{className:"wcf-nav-bar-step active inprogress"},(0,i.createElement)("div",{className:"wcf-nav-bar-title mb-3",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,j.__)("Special Offer","cartflows")),(0,i.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,i.createElement)("span",{className:"before",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}}),(0,i.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}},(0,i.createElement)("span",{className:"before"})),(0,i.createElement)("span",{className:"after"}))),(0,i.createElement)("div",{className:"wcf-nav-bar-step"},(0,i.createElement)("div",{className:"wcf-nav-bar-title mb-3"},(0,j.__)("Order Receipt","cartflows")),(0,i.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,i.createElement)("span",{className:"before"}),(0,i.createElement)("div",{className:"wcf-progress-nav-step"})))))),(0,i.createElement)("div",{className:"wcf-content-main-head text-center mb-8"},(0,i.createElement)("div",{className:"wcf-content-modal-title"},(0,i.createElement)("h1",{style:{color:e["wcf-pre-checkout-offer-title-color"]},className:"text-xl font-semibold text-text-primary mb-2.5"},e["wcf-pre-checkout-offer-popup-title"])),(0,i.createElement)("div",{className:"wcf-content-modal-sub-title"},(0,i.createElement)("span",{style:{color:e["wcf-pre-checkout-offer-subtitle-color"]},className:"text-sm font-normal text-600"},e["wcf-pre-checkout-offer-popup-sub-title"]))),(0,i.createElement)("div",{id:"wcf-pre-checkout-offer-content",className:"woocommerce border-2 border-border-subtle border-dashed rounded items-center",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]}},(0,i.createElement)("div",{className:"flex gap-4 p-5 items-center"},(0,i.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-img w-2/5"},(0,i.createElement)("img",{src:c,alt:"Checkout Offer Product",className:"border border-border-subtle max-w-full h-auto"})),(0,i.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-offer-product-details w-3/5"},(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-product-title"},(0,i.createElement)("h1",{style:{color:e["wcf-pre-checkout-offer-title-color"]}},e["wcf-pre-checkout-offer-product-title"])),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-price",style:{color:e["wcf-pre-checkout-offer-desc-color"],fontWeight:500}},cartflows_admin.woo_currency,""!==s&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("del",{className:"wcf-regular-price"},isNaN(l)?0:l),(0,i.createElement)("span",{className:"wcf-discount-price"}," ",s)),""===s&&(0,i.createElement)("span",{className:"wcf-regular-price"},isNaN(l)?0:l)),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-desc"},(0,i.createElement)("span",{style:{color:e["wcf-pre-checkout-offer-desc-color"],lineHeight:"0"}},Nh((e["wcf-pre-checkout-offer-desc"]||"").toString()))),(0,i.createElement)("input",{type:"hidden",value:"add",className:"wcf-pre-checkout-offer-action"}))),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-actions flex flex-col gap-3 p-5"},(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-add-cart-btn"},(0,i.createElement)("button",{className:"wcf-pre-checkout-offer-btn alt !w-full text-base !bg-brand-500 !rounded !text-text-on-color !font-semibold px-4 py-3 !text-center",style:{backgroundColor:e["wcf-pre-checkout-offer-button-color"],borderColor:e["wcf-pre-checkout-offer-button-color"]}},e["wcf-pre-checkout-offer-popup-btn-text"])),(0,i.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-skip-btn text-center"},(0,i.createElement)("a",{className:"wcf-pre-checkout-skip text-text-tertiary",href:"#",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},e["wcf-pre-checkout-offer-popup-skip-btn-text"]))))))))))},eS=function(){const[{settings_data:e,options:t}]=Nm(),[n,r]=(0,i.useState)("product"),o=dg();if(!wcfCartflowsPro())return(0,i.createElement)(zE,{feature:"Checkout Offer",plan_required:"starter"});if(void 0===e.settings)return(0,i.createElement)(H_,null);const a="yes"===t["wcf-pre-checkout-offer"];return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(u_,{name:"wcf-pre-checkout-offer",value:t["wcf-pre-checkout-offer"],label:(0,j.__)("Enable Checkout Offer","cartflows"),fullWidth:!0}),a&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-co-preview"},(0,i.createElement)(K_,null)),(0,i.createElement)("div",{className:"mt-8 mb-8"},(0,i.createElement)(G_.Group,{variant:"rounded",size:"sm",width:"full",activeItem:n,onChange:({value:e})=>async function(e){e!==n?(await async function(){return!!window.wcfUnsavedChanges&&await o({title:(0,j.__)("Save Changes","cartflows"),description:(0,j.__)("You have made changes. Do you want to save the changes?","cartflows"),actionBtnText:(0,j.__)("Save","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")})}()||r(e),window.wcfUnsavedChanges=!1):r(e)}(e.slug)},(0,i.createElement)(G_.Tab,{slug:"product",text:(0,j.__)("Product","cartflows"),icon:(0,i.createElement)(Qg,{className:"w-4 h-4"})}),(0,i.createElement)(G_.Tab,{slug:"content",text:(0,j.__)("Content","cartflows"),icon:(0,i.createElement)(L_,{className:"w-4 h-4"})}),(0,i.createElement)(G_.Tab,{slug:"styles",text:(0,j.__)("Styles","cartflows"),icon:(0,i.createElement)(ow,{className:"w-4 h-4"})}))),(0,i.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section"},(0,i.createElement)(Q_,{tab:n,displayAs:"div"}))))},tS=function(){return(0,i.createElement)("div",{className:"wcf-checkout-rules-page"},(0,i.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,i.createElement)(aw,{width:"65%"})),(0,i.createElement)("div",{className:"wcf-checkout-rules--group_wrapper"},(0,i.createElement)("div",{className:"wcf-checkout-rules--text"},(0,i.createElement)(aw,{width:"10%"}),(0,i.createElement)(sw,{width:"25%",height:"35px"}),(0,i.createElement)(aw,{width:"20%"})),(0,i.createElement)("div",{className:"wcf-checkout-rules"},Array(3).fill().map((e,t)=>(0,i.createElement)("div",{className:"wcf-checkout-rule",key:t},(0,i.createElement)("div",{className:"wcf-checkout-rule--select-box"},(0,i.createElement)(sw,{height:"35px",width:"30%"}),(0,i.createElement)(sw,{height:"35px",width:"30%"}),(0,i.createElement)(sw,{height:"35px",width:"30%"})),2!==t&&(0,i.createElement)("div",{className:"wcf-checkout-rule__and"},(0,i.createElement)(sw,{height:"25px",width:"5%"}))))),(0,i.createElement)(sw,{height:"40px",width:"9%"})),(0,i.createElement)("div",{className:"wcf-checkout-rules--or"},(0,i.createElement)(sw,{height:"35px",width:"5%"}),(0,i.createElement)(sw,{height:"45px",width:"12%"})),(0,i.createElement)("div",{className:"wcf-checkout-rules--default-step"},(0,i.createElement)(aw,{width:"10%"}),(0,i.createElement)(sw,{width:"25%",height:"35px"}),(0,i.createElement)(aw,{width:"20%"})))},nS=function(){return(0,i.createElement)(Rg,{title:(0,j.__)("Show Every Customer the Offer They’ll Actually Buy","cartflows"),description:(0,j.__)("Target offers by location, cart value, and more. Upgrade to CartFlows Pro and turn every visit into a personalized sale.","cartflows")})},rS=function(){const[{step_data:e,step_id:t,flow_id:n,options:r,page_settings:o},a]=Nm(),[{license_status:s}]=l(),c=(0,k.applyFilters)("cartflows.stepSettings.dynamicOffers",null);return wcfCartflowsPro()&&"Activated"===s&&c?null===r?(0,i.createElement)(tS,null):(0,i.createElement)(c,{stepId:t,flowId:n,options:r,stepData:e,pageSettings:o,onDispatch:a}):(0,i.createElement)(nS,null)},oS=function(e){const{innerField:t,innerFieldData:n}=e,[{options:r}]=Nm();return(0,i.createElement)("div",{className:"wcf-field-item--fields-settings__wrapper bg-white hidden p-5 border border-solid border-border-subtle my-5 rounded-md shadow-sm",id:`wcf-field-setting-${t}`},n&&Object.keys(n.field_options).map(e=>{const t=n.field_options[e];let o="";const a=function(e){const t=e.name;let n="";if(t.includes("[")){const e=t.split("["),o=[];for(let t=1;t<e.length;t++)o.push(e[t].split("]")[0]);const a=t.substr(0,t.indexOf("["));switch(o.length){case 2:n=r[a][o[0]][o[1]];break;case 3:n=r[a][o[0]][o[1]][o[2]];break;case 4:n=r[a][o[0]][o[1]][o[2]][o[3]];break;default:n=r[a][o[0]]}}else n=r[e.name]?r[e.name]:e.value;return n}(t);switch(t.type){case"text":o=(0,i.createElement)($w,{name:t.name,value:a,label:t.label,placeholder:t.placeholder,readonly:t.readonly,tooltip:t.tooltip,displayAlign:"vertical"});break;case"number":o=(0,i.createElement)(dN,{name:t.name,value:a,label:t.label,readonly:t.readonly,tooltip:t.tooltip,displayAlign:"vertical",min:t.min});break;case"checkbox":o=(0,i.createElement)(fw,{class:t.class,name:t.name,value:a,label:t.label,desc:t.desc,child_className:t.child_class});break;case"select":o=(0,i.createElement)(Ww,{class:t.class,name:t.name,value:a,label:t.label,options:t.options,tooltip:t.tooltip,displayAlign:"vertical"});break;case"doc":o=(0,i.createElement)(LE,{content:t.content})}return(0,i.createElement)("div",{key:t.name,className:`wcf-cfe-field-setting__panel wcf-cfe-field-${e} mb-5 ${"enable-field"===e||"required-field"===e?"hidden":""}`},o)}))},aS=function(e){const[{billing_fields:t,shipping_fields:n},r]=Nm(),{step:o,type:a,removeCallback:s}=e,[l,c]=(0,i.useState)(""),[u,d]=(0,i.useState)("");let f=[];f="billing"===a?t:n;const p=function(e){const t=e.currentTarget.getAttribute("data-name"),n=document.getElementById(`wcf-field-setting-${t}`);n&&(n.classList.contains("hidden")?(n.classList.remove("hidden"),c(t)):(n.classList.add("hidden"),c("")))},m=function(e){s(e,d)},h=({name:e,value:o,fieldName:i})=>{const s=("billing"===a?t:n).map(t=>t.field_options[i].name===e?{...t,field_options:{...t.field_options,[i]:{...t.field_options[i],value:o}}}:t);r({type:"SET_FIELDS",field_type:a,fields:s})};return(0,i.createElement)("div",{className:"py-5"},(0,i.createElement)("div",{className:`wcf-${a}-fields--header flex items-center p-3 gap-4 bg-background-secondary rounded-md`},(0,i.createElement)("div",{className:"w-3/12 pl-7"},(0,j.__)("Label","cartflows")),(0,i.createElement)("div",{className:"w-3/12"},(0,j.__)("ID","cartflows")),(0,i.createElement)("div",{className:"w-1/5 text-center"},(0,j.__)("Enable","cartflows")),(0,i.createElement)("div",{className:"w-1/5 text-center"},(0,j.__)("Required","cartflows")),(0,i.createElement)("div",{className:"w-1/12 text-center"},(0,j.__)("Edit","cartflows"))),(0,i.createElement)(Im.ReactSortable,{list:[...f],setList:e=>r({type:"SET_FIELDS",field_type:a,fields:e}),direction:"vertical",animation:150,handle:".wcf-field-item-handle",filter:".wcf-field-settings-icon, .wcf-toggle-field"},f&&f.map(e=>{const t=e.key,n=e.field_options["enable-field"],r=e.field_options["required-field"];return(0,i.createElement)("div",{key:t,className:"wcf-field-item-handle "+("yes"!==n.value?"!text-text-tertiary":""),"data-key":t},(0,i.createElement)("div",{className:"wcf-fields-wrapper flex items-center p-3 border-0 border-b border-solid border-border-subtle gap-4"},(0,i.createElement)("div",{className:"wcf-field--label whitespace-nowrap w-3/12 flex items-center mr-auto"},(0,i.createElement)("div",{className:"wcf-cpf--sortable-toggle flex cursor-move text-text-tertiary"},(0,i.createElement)(Rh,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,i.createElement)(Rh,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,i.createElement)("span",{className:"w-44 text-ellipsis overflow-hidden cursor-default text-sm text-text-secondary"},e.label?e.label:e.placeholder," "),("billing_email"===t||"shipping_email"===t)&&"checkout"===o&&(0,i.createElement)(Wo,{content:(0,j.__)("Your email address can't be edited when using the Modern Checkout Style.","cartflows"),placement:"top"},(0,i.createElement)("span",null,(0,i.createElement)(Xx,{className:"w-4 h-4 text-icon-secondary cursor-help ml-1"}))),"billing_company"===t&&"checkout"===o&&(0,i.createElement)(Wo,{content:(0,j.__)("The Company field won't be visible if you're using the Instant Layout Style.","cartflows"),placement:"top"},(0,i.createElement)("span",null,(0,i.createElement)(Xx,{className:"w-4 h-4 text-icon-secondary cursor-help ml-1"})))),(0,i.createElement)("div",{className:"wcf-field--key whitespace-nowrap w-3/12 text-ellipsis overflow-hidden mr-auto cursor-default"},e.key),(0,i.createElement)("div",{className:"wcf-field--is-enable w-1/5 wcf-toggle-field flex justify-center"},(0,i.createElement)(yw,{value:"yes"===n.value,onChange:e=>h({name:n.name,value:e?"yes":"no",fieldName:"enable-field"})}),(0,i.createElement)("input",{type:"hidden",name:n.name,value:n.value})),(0,i.createElement)("div",{className:"wcf-field--is-required w-1/5 wcf-toggle-field flex justify-center"},(0,i.createElement)(yw,{value:"yes"===n.value&&"yes"===r.value,onChange:e=>h({name:r.name,value:e?"yes":"no",fieldName:"required-field"}),disabled:"yes"!==n.value}),(0,i.createElement)("input",{type:"hidden",name:r.name,value:"yes"!==n.value?"no":r.value})),(0,i.createElement)("div",{className:"wcf-field-settings-icon flex gap-2 w-1/12 justify-center items-center"},(0,i.createElement)("div",{onClick:p,"data-name":t},(0,i.createElement)(Ig,{className:"w-4 h-4 cursor-pointer "+(l===t?"text-brand-500":"text-text-tertiary hover:text-brand-500"),"data-name":t})),e.custom&&(0,i.createElement)("div",{"data-key":t,"data-type":a,onClick:m},t===u?(0,i.createElement)(Dp,{className:"wcf-delete-cpf--button-processing p-1 h-4 w-4 text-brand-500 pointer-events-none animate-spin","data-key":t,"data-type":a}):(0,i.createElement)(_h,{className:"wcf-delete-cpf--button-delete p-1 h-4 w-4 text-brand-500 cursor-pointer","data-key":t,"data-type":a})))),(0,i.createElement)(oS,{innerField:t,innerFieldData:e,removecustomField:m,type:a}))})))},iS={left:{open:{x:0},exit:{x:"-100%"}},right:{open:{x:0},exit:{x:"100%"}}},sS=({children:e,className:t,ariaLabel:n})=>{const{open:r,position:o,handleClose:a,transitionDuration:i,getFloatingProps:s,drawerContainerRef:l,scrollLock:c,context:u,className:d,refs:f,titleId:p,descriptionId:m,hasTitleRef:h,hasDescriptionRef:g}=yS();return u&&s?(0,C.jsx)(Bp,{children:r&&(0,C.jsx)(no,{ref:l,lockScroll:c,className:Se("z-50",d),children:(0,C.jsx)(Kr,{context:u,modal:!0,...f?.reference&&{returnFocus:f.reference},children:(0,C.jsx)("div",{className:"fixed inset-0 overflow-hidden",children:(0,C.jsx)("div",{className:"relative inset-0 h-full flex items-center",children:(0,C.jsx)("div",{className:Se("flex items-center justify-center h-full w-full",{"justify-start":"left"===o,"justify-end":"right"===o}),children:(0,C.jsx)(Xf.div,{className:Se("flex flex-col w-120 h-full bg-background-primary shadow-2xl overflow-hidden z-20",t),initial:"exit",animate:"open",exit:"exit",variants:iS[o],transition:i,ref:e=>{setTimeout(()=>{f?.setFloating(e)},1e3*((i?.duration||.3)+.1))},"aria-label":h?.current?void 0:n,"aria-labelledby":h?.current?p:void 0,"aria-describedby":g?.current?m:void 0,role:"dialog","aria-modal":"true",...s?.(),children:"function"==typeof e?e({close:a}):e})})})})})})}):null};sS.displayName="Drawer.Panel";const lS=({children:e,className:t,...n})=>(0,C.jsx)("div",{className:Se("space-y-2 px-5 pt-5 pb-4",t),...n,children:e});lS.displayName="Drawer.Header";const cS=({children:e,as:t="h3",className:n,...r})=>{const{titleId:o,hasTitleRef:a}=yS();return(0,p.useEffect)(()=>(a&&(a.current=!0),()=>{a&&(a.current=!1)}),[a]),(0,C.jsx)(t,{id:o,className:Se("text-base font-semibold text-text-primary m-0 p-0",n),...r,children:e})};cS.displayName="Drawer.Title";const uS=({children:e,as:t="p",className:n,...r})=>{const{descriptionId:o,hasDescriptionRef:a}=yS();return(0,p.useEffect)(()=>(a&&(a.current=!0),()=>{a&&(a.current=!1)}),[a]),(0,C.jsx)(t,{id:o,className:Se("text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",n),...r,children:e})};uS.displayName="Drawer.Description";const dS=({children:e,className:t,...n})=>(0,C.jsx)("div",{className:Se("px-5 pb-4 pt-2 flex flex-col flex-1 overflow-y-auto overflow-x-hidden",t),...n,children:e});dS.displayName="Drawer.Body";const fS=({children:e,className:t})=>{const{design:n,handleClose:r}=yS();return(0,C.jsx)("div",{className:Se("px-5 py-4 flex justify-end gap-3 mt-auto",{"bg-background-secondary":"footer-divided"===n,"border-t border-b-0 border-x-0 border-solid border-border-subtle":"footer-bordered"===n},t),children:e?"function"==typeof e?e({close:r}):e:null})};fS.displayName="Drawer.Footer";const pS=({className:e,...t})=>(0,C.jsx)("button",{className:Se("bg-transparent inline-flex justify-center items-center border-0 p-1 m-0 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-border-strong outline-none shadow-none",e),"aria-label":"Close drawer",...t,children:(0,C.jsx)(Ho,{className:"size-4 text-text-primary shrink-0"})}),mS=({children:e,as:t=p.Fragment,...n})=>{const{handleClose:r}=yS();return e?t===p.Fragment?"function"==typeof e?e({close:r}):(0,p.isValidElement)(e)?(0,p.cloneElement)(e,{onClick:r}):(0,C.jsx)(pS,{onClick:r,...n}):(0,C.jsx)(t,{...n,onClick:r,children:e}):(0,C.jsx)(pS,{onClick:r,...n})};mS.displayName="Drawer.CloseButton";const hS={open:{opacity:1},exit:{opacity:0}},gS=({className:e,...t})=>{const{open:n,drawerContainerRef:r,transitionDuration:o}=yS(),[a,i]=(0,p.useState)(null);(0,p.useEffect)(()=>{r?.current&&i(r.current)},[n,r]);const s=(0,C.jsx)(Bp,{mode:"wait",children:n&&(0,p.createElement)(Xf.div,{className:Se("fixed inset-0 -z-10 bg-background-inverse/90",e),...t,initial:"exit",animate:"open",exit:"exit",variants:hS,transition:o,key:"backdrop"})});return a?(0,dn.createPortal)(s,a):s};gS.displayName="Drawer.Backdrop";const wS=(0,p.createContext)({}),yS=()=>(0,p.useContext)(wS),bS=({open:e,setOpen:t,children:n,trigger:r,className:o,exitOnClickOutside:a=!1,exitOnEsc:i=!0,design:s="simple",position:l="right",transitionDuration:c=.2,scrollLock:u=!0})=>{const d=void 0!==e&&void 0!==t,[f,m]=(0,p.useState)(!1),h=(0,p.useRef)(null),g=(0,p.useId)(),w=`${g}-title`,y=`${g}-description`,b=(0,p.useRef)(!1),v=(0,p.useRef)(!1),x=(0,p.useMemo)(()=>d?e:f,[e,f,d]),N=(0,p.useMemo)(()=>d?t:m,[t,m,d]),I=()=>{x||N(!0)},{refs:M,context:E}=uo({open:x,onOpenChange:N,transform:!1}),_=co(E,{enabled:i||a,escapeKey:i,outsidePress:e=>!!a&&!e?.target?.closest("ul.fui-toast-container")}),S=Io(E,{role:"dialog"}),D=ao(E),{getFloatingProps:j}=ho([_,S,D]),k=(0,p.useCallback)(()=>(0,p.isValidElement)(r)?(0,p.cloneElement)(r,{onClick:De(I,r.props.onClick),ref:M.setReference,"aria-haspopup":"dialog","aria-expanded":x}):"function"==typeof r?r({onClick:I,"aria-haspopup":"dialog","aria-expanded":x}):null,[r,I,M.setReference]);return(0,C.jsxs)(C.Fragment,{children:[k(),(0,C.jsx)(wS.Provider,{value:{open:x,setOpen:N,handleClose:()=>{x&&N(!1)},design:s,position:l,drawerContainerRef:h,transitionDuration:{duration:c},getFloatingProps:j,scrollLock:u,context:E,className:o,refs:M,titleId:w,descriptionId:y,hasTitleRef:b,hasDescriptionRef:v},children:n})]})};bS.displayName="Drawer",bS.Panel=sS,bS.Header=lS,bS.Title=cS,bS.Description=uS,bS.Body=dS,bS.CloseButton=mS,bS.Footer=fS,bS.Backdrop=gS,bS.Portal=({children:e,...t})=>(0,C.jsx)(Gr,{...t,children:e});const vS=function(e){const{addNewField:t,step_type:n}=e,r=(0,j.__)("Add New Field","cartflows"),o=(0,j.__)("Date & Time","cartflows"),[a,s]=(0,i.useState)(!1),[l,c]=(0,i.useState)(!1),[u,d]=(0,i.useState)(r),[f,p]=(0,i.useState)(),m=function(){s(!1),c(!1),y(!1),d(r)},[h,g]=(0,i.useState)(!1),[w,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)(!0),[x,N]=(0,i.useState)(!1),[I,M]=(0,i.useState)(!1),[E,_]=(0,i.useState)(!1),[S,D]=(0,i.useState)("datetime-local"),[k,C]=(0,i.useState)(o),A=function(){y(!w)},[T,L]=(0,i.useState)(!1),O=function(){const e=document.getElementById("wcf-checkout-custom-fields[0][type]").value;N(!1),M(!1),_(!1),v(!1),L(!1),"text"===e||"textarea"===e?v(!0):"select"===e?_(!0):"checkbox"===e?N(!0):"radio"===e?M(!0):"file"===e&&L(!0),g(e)},z=function(e){let t=e.replace(/[^a-zA-Z\d ]/g," ");t=t.replace(/\s/g,"_").toLowerCase(),p(t)},P=function(e){D(e.target.value),"datetime-local"===e.target.value?C(o):C(e.target.value)},R=function(){let e="";if("datetime"!==h)return e;switch(S){case"date":e="yyyy-mm-dd";break;case"time":e="hh:mm";break;case"datetime-local":e="yyyy-mm-dd hh.mm";break;default:e=""}return e};return(0,i.createElement)("div",{className:"wcf-custom-field-box"},(0,i.createElement)("div",{className:"flex justify-end"},(0,i.createElement)(Ro,{variant:"outline",size:"md",className:"wcf-add-custom-field text-brand-500 bg-brand-50 outline-brand-500",onClick:function(e){e.preventDefault(),p(""),s(!a)},icon:(0,i.createElement)(Kx,{className:"h-18 w-18 text-brand-500"}),iconPosition:"left"},(0,j.__)("Add Custom Field","cartflows"))),(0,i.createElement)(bS,{open:a,setOpen:e=>{e||m()},position:"right",exitOnClickOutside:!1,className:"wcf-add-custom-field-drawer z-999999"},(0,i.createElement)(bS.Panel,{className:"pointer-events-auto w-screen max-w-xl flex flex-col h-full"},(0,i.createElement)(bS.Backdrop,null),(0,i.createElement)(bS.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(bS.Title,null,(0,j.__)("Add Custom Field","cartflows")),(0,i.createElement)(bS.CloseButton,{type:"button"})),(0,i.createElement)(bS.Body,{className:"wcf-cfe-content flex-1 overflow-y-auto"},function(){const e=[{value:"billing",label:(0,j.__)("Billing","cartflows")},{value:"shipping",label:(0,j.__)("Shipping","cartflows")}],t=[{value:"text",label:(0,j.__)("Text","cartflows")},{value:"textarea",label:(0,j.__)("TextArea","cartflows")},{value:"number",label:(0,j.__)("Number","cartflows")},{value:"datetime",label:(0,j.__)("Date & Time","cartflows")},{value:"checkbox",label:(0,j.__)("Checkbox","cartflows")},{value:"radio",label:(0,j.__)("Radio","cartflows")},{value:"select",label:(0,j.__)("Select","cartflows")},{value:"hidden",label:(0,j.__)("Hidden","cartflows")},{value:"file",label:(0,j.__)("File","cartflows")}],r=[{value:"33",label:(0,j.__)("33%","cartflows")},{value:"50",label:(0,j.__)("50%","cartflows")},{value:"100",label:(0,j.__)("100%","cartflows")}],o="w-full max-wi-full input-field !text-sm font-normal !rounded-md text-text-tertiary !border-border-subtle focus:ring focus:!ring-brand-100 focus:!border-brand-500 focus:!shadow-none !outline-0 !outline-none !m-0";return(0,i.createElement)("div",{className:"wcf-custom-field-form--wrapper text-left"},"checkout"===n&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(Ww,{class:"wcf-cpf-add_to",name:"wcf-checkout-custom-fields[0][add_to]",options:e,label:(0,j.__)("Add To","cartflows"),displayAlign:"vertical"})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(Ww,{class:"wcf-cpf-type",id:"wcf-checkout-custom-fields[0][type]",name:"wcf-checkout-custom-fields[0][type]",options:t,label:(0,j.__)("Type","cartflows"),onSelect:O,displayAlign:"vertical"})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)($w,{class:`wcf-cpf-label ${o}`,name:"wcf-checkout-custom-fields[0][label]",label:Nh((0,j.sprintf)(/* translators: %$s is replaced with the HTML tag */ /* translators: %$s is replaced with the HTML tag */
19 +(0,j.__)("Label %1$s*%2$s","cartflows"),'<span class="text-brand-300">',"</span>")),onChangeCB:z,displayAlign:"vertical",placeholder:(0,j.__)("e.g. Phone Number","cartflows")})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)($w,{class:`wcf-cpf-name ${o}`,name:"wcf-checkout-custom-fields[0][key]",value:f,label:(0,j.__)("Field ID","cartflows"),displayAlign:"vertical",placeholder:(0,j.__)("e.g. phone_number","cartflows")}),(0,i.createElement)(vh,{as:"span",className:"text-sm font-normal text-text-tertiary mt-2 block"},(0,j.__)('Field value will store in this meta key. Add field id without prefix like "billing_" or "shipping_". Use "_" instead of spaces.',"cartflows"))),"number"===h&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(dN,{class:`wcf-cpf-min ${o}`,name:"wcf-checkout-custom-fields[0][min]",label:(0,j.__)("Min Value","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,j.__)("e.g. 0","cartflows")})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(dN,{class:`wcf-cpf-max ${o}`,name:"wcf-checkout-custom-fields[0][max]",label:(0,j.__)("Max Value","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,j.__)("e.g. 100","cartflows")}))),(E||I)&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(qw,{class:`wcf-cpf-options ${o}`,name:"wcf-checkout-custom-fields[0][options]",label:(0,j.__)("Options","cartflows"),placeholder:(0,j.__)("Enter your options separated by (|).","cartflows"),displayAlign:"vertical"})),x&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(Ww,{class:"wcf-cpf-default",name:"wcf-checkout-custom-fields[0][default]",label:(0,j.__)("Default","cartflows"),options:[{value:"1",label:(0,j.__)("Checked","cartflows")},{value:"0",label:(0,j.__)("UnChecked","cartflows")}],displayAlign:"vertical"})),"datetime"===h&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(Ww,{class:`wcf-cpf-date-input ${o}`,name:"wcf-checkout-custom-fields[0][date_input]",label:(0,j.__)("Field Input Type","cartflows"),options:[{label:(0,j.__)("Date & Time","cartflows"),value:"datetime-local"},{label:(0,j.__)("Date","cartflows"),value:"date"},{label:(0,j.__)("Time","cartflows"),value:"time"}],displayAlign:"vertical",value:S,onSelect:P})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)($w,{class:`wcf-cpf-min-date ${o}`,labelClass:"text-sm font-medium text-left capitalize",textFieldType:S,name:"wcf-checkout-custom-fields[0][default]",label:(0,j.__)("Min ","cartflows")+k,displayAlign:"vertical",placeholder:R()})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)($w,{class:`wcf-cpf-max-date ${o}`,labelClass:"text-sm font-medium text-left capitalize",textFieldType:S,name:"wcf-checkout-custom-fields[0][default]",label:(0,j.__)("Max ","cartflows")+k,displayAlign:"vertical",placeholder:R()}))),!x&&!T&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)($w,{class:`wcf-cpf-default ${o}`,textFieldType:"datetime"===h&&S?S:"text",name:"wcf-checkout-custom-fields[0][default]",label:(0,j.__)("Default","cartflows"),displayAlign:"vertical",placeholder:R()||(0,j.__)("e.g. Default value","cartflows")})),b&&!T&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)($w,{class:`wcf-cpf-placeholder ${o}`,name:"wcf-checkout-custom-fields[0][placeholder]",label:(0,j.__)("Placeholder","cartflows"),displayAlign:"vertical",placeholder:(0,j.__)("e.g. Enter your phone number","cartflows")})),"file"===h&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(dN,{class:`wcf-cpf-file-size ${o}`,name:"wcf-checkout-custom-fields[0][file_size]",label:(0,j.__)("File Size (MB)","cartflows"),tooltip:(0,j.__)("Enter the maximum allowed file size. Default is 5MB.","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,j.__)("e.g. 5","cartflows")})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)($w,{class:`wcf-cpf-accepted-file-types ${o}`,textFieldType:"text",name:"wcf-checkout-custom-fields[0][accepted_file_types]",label:(0,j.__)("Accepted File Types","cartflows"),tooltip:(0,j.__)("Enter comma-separated file extensions (e.g. jpg, png, gif)","cartflows"),displayAlign:"vertical",placeholder:(0,j.__)("e.g. jpg, png, gif","cartflows")}))),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(Ww,{class:"wcf-cpf-width",name:"wcf-checkout-custom-fields[0][width]",options:r,value:"100",label:(0,j.__)("Width","cartflows"),displayAlign:"vertical"})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(fw,{class:"wcf-cpf-show-in-email",name:"wcf-checkout-custom-fields[0][show_in_email]",label:(0,j.__)("Show in Email","cartflows")})),(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(fw,{class:"wcf-cpf-required",name:"wcf-checkout-custom-fields[0][required]",label:(0,j.__)("Required","cartflows"),onClick:A})),!w&&"optin"!==n&&(0,i.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,i.createElement)(fw,{class:"wcf-cpf-optimized",name:"wcf-checkout-custom-fields[0][optimized]",label:(0,j.__)("Collapsible","cartflows")})))}()),(0,i.createElement)(bS.Footer,{className:"flex gap-3 justify-end"},(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:function(e){e.preventDefault(),s(!1)}},(0,j.__)("Cancel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:function(e){e.preventDefault(),d((0,j.__)("Adding…","cartflows")),c(!0),l||t(e,m,d)||c(!1)}},u)))))},xS=function(){return(0,i.createElement)("div",{className:"wcf-custom-field-editor is-placeholder"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("form",null,(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("div",{className:"checkbox-title"})))),(0,i.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,i.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("div",{className:"wcf-optin-fields"},(0,i.createElement)("div",{className:"title"}),(0,i.createElement)("div",{className:"title"}),(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("div",{className:"wcf-field wcf-submit"},(0,i.createElement)("div",{className:"wcf-optin-form-field__button"})))))},NS=function(){const[{custom_fields:e,step_id:t,options:n,billing_fields:r},o]=Nm();if(void 0===e)return(0,i.createElement)(xS,null);const a=e.extra_fields,s=(0,k.applyFilters)("cartflows.stepSettings.optinFieldActions",null),l=s?s({stepId:t,dispatch:o,toast:Wm,billingFields:r,options:n}):null,c=l?l.removeField:e=>e.preventDefault();return(0,i.createElement)("div",{className:"wcf-custom-field-editor"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,i.createElement)("h3",{className:"wcf-custom-field-editor__title hidden relative justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none"},(0,j.__)("Field Editor","cartflows")),(0,i.createElement)("div",{className:"wcf-optin-fields--enable_option px-8 py-4 -mx-6 pt-0"},a&&Object.keys(a.fields).map(e=>{const t=a.fields[e],r=n[t.name]?n[t.name]:"";return(0,i.createElement)("div",{key:e,className:"w-full"},(0,i.createElement)(u_,{name:t.name,value:r,label:t.label,desc:t.desc,fullWidth:!0}))})),"yes"===n["wcf-optin-enable-custom-fields"]&&(0,i.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,i.createElement)("div",{id:"wcf-optin-fields",className:"billing-field-sortable wcf-field-row"},(0,i.createElement)(aS,{data:r,step:"optin",type:"billing",removeCallback:c})),(0,i.createElement)("div",{className:"wcf-custom-field-editor-title-section"},l&&(0,i.createElement)("div",{className:"wcf-custom-field-editor-buttons"},(0,i.createElement)(vS,{addNewField:l.addNewField,step_type:"optin"}))))))},IS=({type:e="simple",defaultValue:t=[],autoClose:n=!1,disabled:r=!1,children:o,className:a})=>{const[i,s]=(0,p.useState)(Array.isArray(t)?t:[t]);return(0,C.jsx)("div",{className:Se("boxed"===e?"space-y-3":"",a),children:p.Children.map(o,t=>{if(p.isValidElement(t)&&"value"in t.props){const o=!1!==t.props.collapsible,a=!o||i.includes(t.props.value);return p.cloneElement(t,{isOpen:a,onToggle:o?()=>(e=>{s(t=>n?t.includes(e)?[]:[e]:t.includes(e)?t.filter(t=>t!==e):[...t,e])})(t.props.value):void 0,type:e,disabled:r||t.props.disabled})}return t})})};IS.displayName="Accordion";const MS=({isOpen:e,onToggle:t,type:n="simple",disabled:r=!1,children:o,className:a})=>{const i=(0,p.useMemo)(()=>`accordion-content-${cw()}`,[]),s=(0,p.useMemo)(()=>`accordion-trigger-${cw()}`,[]),l={simple:"border-0",separator:"border-0 border-b border-solid border-border-subtle",boxed:"border border-solid border-border-subtle rounded-md"}[n];return(0,C.jsx)("div",{className:Se(l,a),children:p.Children.map(o,o=>p.isValidElement(o)?p.cloneElement(o,{isOpen:e,onToggle:t,type:n,disabled:r,contentId:i,triggerId:s}):o)})};MS.displayName="Accordion.Item";const ES=({onClick:e,onToggle:t,isOpen:n,iconType:r="arrow",collapsible:o=!0,disabled:a=!1,tag:i="h3",type:s="simple",children:l,className:c,contentId:u,triggerId:d,...f})=>{const p={simple:"px-2 py-3",separator:"px-2 py-4",boxed:"px-3 py-4"}[s];return(0,C.jsx)(i,{className:"flex m-0 hover:bg-background-secondary transition duration-150 ease-in-out",children:(0,C.jsxs)("button",{id:d,className:Se("flex w-full items-center justify-between text-sm font-medium transition-all appearance-none bg-transparent border-0 cursor-pointer gap-3",p,a&&"cursor-not-allowed opacity-40",c),onClick:De(e,!a&&o?t:void 0),"aria-expanded":n,"aria-controls":u,"aria-disabled":a,disabled:a,...f,children:[(0,C.jsx)("div",{className:"flex items-center gap-2 text-text-primary font-semibold text-left",children:l}),o?"arrow"===r?(0,C.jsx)(Fp,{className:Se("flex-shrink-0 text-icon-secondary size-5 transition-transform duration-300 ease-in-out",n?"rotate-180":"rotate-0"),"aria-hidden":"true"}):"plus-minus"===r?(0,C.jsx)(Xf.span,{initial:{opacity:0,rotate:n?-180:0},animate:{opacity:1,rotate:n?0:180},exit:{opacity:0},transition:{duration:.3,ease:"easeInOut"},className:"flex items-center flex-shrink-0 text-icon-secondary","aria-hidden":"true",children:n?(0,C.jsx)(uw,{}):(0,C.jsx)(ey,{})},n?"minus":"plus"):null:null]})})};ES.displayName="Accordion.Trigger";const _S=({isOpen:e,disabled:t=!1,type:n="simple",children:r,className:o,contentId:a,triggerId:i})=>{const s={simple:"px-2 pb-3",separator:"px-2 pb-4",boxed:"px-3 pb-4"}[n];return(0,C.jsx)("div",{className:Se("text-text-secondary w-full text-sm box-border",t&&"opacity-40",o),role:"region",id:a,"aria-labelledby":i,"aria-hidden":!e,children:(0,C.jsx)(Bp,{initial:!1,children:e&&(0,C.jsx)(Xf.div,{variants:{open:{height:"auto",opacity:1,overflow:"unset",transition:{overflow:{delay:1}}},closed:{height:0,opacity:0,overflow:"hidden"}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},children:(0,C.jsx)("div",{className:Se(s),children:r})},"content")})})};_S.displayName="Accordion.Content";const SS=Object.assign(IS,{Item:MS,Trigger:ES,Content:_S}),DS=function({title:e,children:t,defaultOpen:n=!0,badge:r,className:o=""}){return(0,i.createElement)("div",{className:`-mx-8 border-b border-border-subtle last:border-b-0 ${o}`.trim()},(0,i.createElement)(SS,{type:"simple",defaultValue:n?"section":[],autoClose:!1},(0,i.createElement)(SS.Item,{value:"section"},(0,i.createElement)(SS.Trigger,{iconType:"arrow",className:"px-8 py-4"},(0,i.createElement)("span",{className:"flex items-center gap-2 text-sm font-semibold text-text-primary"},e,r&&r)),(0,i.createElement)(SS.Content,{className:"px-8 pb-8 pt-0"},t))))},jS=function(e){const[{license_status:t}]=l(),n=e.btnText||(0,j.__)("Upgrade to CartFlows Pro","cartflows"),r=function(r){return(0,i.createElement)(DS,{title:r.title,badge:(0,i.createElement)(Qo,{label:(0,j.__)("PRO","cartflows"),size:"xs",variant:"primary"}),defaultOpen:!1},(0,i.createElement)("div",{className:"p-5 border border-border-subtle rounded-lg bg-brand-25"},(0,i.createElement)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between"},(0,i.createElement)("div",null,(0,i.createElement)("p",{className:"text-sm font-medium text-text-primary mb-1"},r.noticeTitle),(0,i.createElement)("p",{className:"text-sm font-normal text-text-secondary"},r.noticeDesc)),(0,i.createElement)("div",{className:"flex items-center gap-4 shrink-0"},function(){const r=cartflows_admin.cf_pro_status;return wcfCartflowsTypePro()||"inactive"!==r||"pro"!==wcfInactivepluginType()?wcfCartflowsTypePlusPro()?"Activated"!==t?(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(zg,{title:(0,j.__)("Activate the License","cartflows")}))):void 0:wcfInactiveProPlus()?(0,i.createElement)(Ag,null):(0,i.createElement)(Tg,{buttonLink:e.buttonLink,title:n,buttonStyle:"secondary"}):(0,i.createElement)(Ag,null)}()))))};return(0,i.createElement)(i.Fragment,null,r({title:(0,j.__)("Auto Apply Coupon","cartflows"),noticeTitle:(0,j.__)("Apply Discounts Automatically and Convert More Customers","cartflows"),noticeDesc:(0,j.__)("Remove friction at checkout — discounts activate the moment customers arrive. Upgrade to Pro and watch conversions climb immediately.","cartflows")}),r({title:(0,j.__)("Product Options","cartflows"),noticeTitle:(0,j.__)("Let Customers Choose Exactly What They Want","cartflows"),noticeDesc:(0,j.__)("Offer flexible product options right at checkout — quantities, variations, and more. Upgrade to CartFlows Pro and start customizing your offers today.","cartflows")}))},kS=function(){const[{step_data:e,settings_data:t,page_settings:n,options:r}]=Nm(),[{license_status:o}]=l(),a=n;if(void 0===t.settings)return(0,i.createElement)(j_,null);const s=r["wcf-checkout-products"];return(0,i.createElement)("div",{className:"wcf-checkout-products"},(0,i.createElement)(DS,{title:a.settings.product.title,defaultOpen:!0},(0,i.createElement)(w_,{settings:a.settings.product})),"checkout"===e.type&&(!wcfCartflowsPro()||"Activated"!==o)&&(0,i.createElement)(jS,null),"checkout"===e.type&&wcfCartflowsPro()&&"Activated"===o&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DS,{title:a.settings.coupon.title},(0,i.createElement)(w_,{settings:a.settings.coupon})),s&&(0,i.createElement)(DS,{title:a.settings["product-options"].title},(0,i.createElement)(w_,{settings:a.settings["product-options"]}))))},CS=function(){const[{settings_data:e,page_settings:t,options:n},r]=Nm(),o=n["wcf-optin-product"]?n["wcf-optin-product"]:[],[a,s]=(0,i.useState)(),[l,c]=(0,i.useState)(""),[u,d]=(0,i.useState)(!1),f=(0,j.__)("Add","cartflows"),[p,m]=(0,i.useState)({isInProcessing:!1,buttonText:f}),{isInProcessing:h,buttonText:g}=p;return void 0===e.settings?(0,i.createElement)(j_,null):(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-optin-product--wrapper"},(0,i.createElement)("h2",{className:"text-base font-semibold text-text-primary py-4"},(0,j.__)("Optin Product","cartflows")),(0,i.createElement)("div",{className:"wcf-optin-products--selection wcf-products__section"},0===o.length||""===o[0]?(0,i.createElement)(i.Fragment,null,(0,i.createElement)("input",{name:"wcf-optin-product[]",type:"hidden",value:""}),(0,i.createElement)("div",{className:"wcf-optin-no-product--notice border border-border-subtle bg-gray-25 text-center text-sm font-normal rounded-md p-5"},(0,j.__)("Select free & virtual product only. Once you select a product, it will be displayed here.","cartflows")),(0,i.createElement)("div",{className:"wcf-optin-product-selection-field__add-new flex justify-between items-end gap-5 mt-5"},(0,i.createElement)(KE,{name:"",desc:"",field:"product",value:l,allowed_products:"simple",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,j.__)("Search for a Free & Virtual Product","cartflows"),onChangeCB:e=>{s(e),d(!1)},sectionClass:"flex-1 "+(u?"border border-border-error":"")}),(0,i.createElement)(Ro,{type:"button",variant:"outline",size:"md",icon:(0,i.createElement)(Kx,{className:"w-4 h-4"}),iconPosition:"left",loading:h,disabled:h,onClick:function(){const e=a?.value;c(a),e&&(m({isInProcessing:!0,buttonText:(0,j.__)("Adding…","cartflows")}),Ep()({path:`/cartflows/v1/admin/product-data/${e}`}).then(t=>{t.regular_price>0||!t.is_virtual?d(!0):(d(!1),r({type:"ADD_OPTIN_PRODUCT",field_name:"wcf-optin-product",product_data:{value:e,label:a?.label,img_url:t?.img_url}})),c(null),m({isInProcessing:!1,buttonText:f})}),s(null))},className:"wcf-select-product-button shrink-0 h-fit"},g)),u&&(0,i.createElement)("span",{className:"text-sm mt-2 text-text-error wcf-field-required-error inline-block"},(0,j.__)("Please select a free & virtual product only.","cartflows")),(0,i.createElement)(eN,null)):(0,i.createElement)("div",{className:"overflow-visible shadow border border-border-subtle rounded-md"},(0,i.createElement)("div",{className:"wcf-optin-product-selection--selected-product flex items-center p-3 gap-4"},(0,i.createElement)("div",{className:"wcf-optin-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-1/2"},(0,i.createElement)("div",{className:"flex gap-3 items-center"},(0,i.createElement)("div",{className:"wcf-optin-product-selection--product-image flex w-20 h-20"},(0,i.createElement)("img",{src:o.img_url?o.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:Nh(o.label)})),(0,i.createElement)("div",{className:"wcf-optin-product-selection--product-title_text"},(0,i.createElement)("div",{className:"wcf-offer-product-repeater-field__title whitespace-normal text-left","data-product_id":o.value},Nh(o.label)),(0,i.createElement)("div",{className:"wcf-optin-product-repeater-field__reg-price mt-1"},(0,i.createElement)("div",{className:"flex gap-2"},(0,i.createElement)("span",{className:"wcf-offer-product--reg-price"},(0,j.__)("Free","cartflows"))))))),(0,i.createElement)("div",{className:"wcf-optin-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[5%] justify-center ml-auto"},(0,i.createElement)("div",{className:"wcf-delete-product-item cursor-pointer text-text-secondary hover:text-brand-500 p-1 hover:bg-background-secondary focus:bg-background-secondary rounded relative justify-end",onClick:function(){r({type:"REMOVE_OPTIN_PRODUCT",field_name:"wcf-optin-product"})}},(0,i.createElement)(_h,{className:"h-18 w-18"}))),(0,i.createElement)("input",{name:"wcf-optin-product[]",type:"hidden",className:"wcf-checkout-product-id",value:o.value})))),(0,i.createElement)("div",{className:"wcf-offer-product--common-settings pt-2"},(0,i.createElement)(D_,{settings:t?.settings.product,displayAs:"div"}))))};function AS(e,t){var n;if(!t)return"";const r=Object.values(t).find(t=>t.id===e);return null!==(n=r?.title)&&void 0!==n?n:""}function TS(e,t,n,r){if(!t?.type)return null;switch(e){case"design":default:return(0,i.createElement)(b_,null);case"settings":return(0,i.createElement)(S_,null);case"products":return"checkout"===t.type?"storeCheckout"!==n||cartflows_admin.store_checkout_show_product_tab?(0,i.createElement)(kS,null):(r("order_bumps"),(0,i.createElement)(A_,null)):["upsell","downsell"].includes(t.type)?(0,i.createElement)(k_,null):"optin"===t.type?(0,i.createElement)(CS,null):"landing"===t.type||"thankyou"===t.type?(r("settings"),(0,i.createElement)(S_,null)):(0,i.createElement)(S_,null);case"order_bumps":return(0,i.createElement)(A_,null);case"checkout_offer":return(0,i.createElement)(eS,null);case"optin_form_fields":return(0,i.createElement)(NS,null);case"dynamic-offers":return(0,i.createElement)(rS,null)}}const LS=To("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]),OS=To("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]),zS=(0,p.createContext)({isCollapsed:!1,setIsCollapsed:()=>{},collapsible:!0}),PS=({children:e,className:t,onCollapseChange:n,collapsible:r=!0,borderOn:o=!0,collapsed:a=!1,...i})=>{const s=(0,p.useRef)(null),[l,c]=(0,p.useState)(()=>!r&&a?a:Te("sidebar-collapsed")||(typeof window>"u"?a:window.innerWidth<1280));return(0,p.useEffect)(()=>{"function"==typeof n&&n(l)},[l,n]),(0,p.useEffect)(()=>{if(!r&&a)return;const e=()=>{const e=window.innerWidth<1280;if(r)if(e)c(!0),Ae("sidebar-collapsed",!0);else{const e=Te("sidebar-collapsed");c(e||!1)}else c(!1),(e=>{if(!(typeof window>"u"))try{localStorage.removeItem(e)}catch(e){console.error(e)}})("sidebar-collapsed")};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[r]),(0,C.jsx)(zS.Provider,{value:{isCollapsed:l,setIsCollapsed:c,collapsible:r},children:(0,C.jsx)("nav",{ref:s,"aria-label":"Sidebar",className:Se("h-full overflow-auto w-72 px-4 py-4 gap-4 flex flex-col bg-background-primary",o&&"border-0 border-r border-solid border-border-subtle","transition-all duration-200",l&&"w-16 px-2",t),...i,children:e})})};PS.displayName="Sidebar";const RS=({children:e})=>(0,C.jsx)("div",{className:"space-y-2",children:e});RS.displayName="Sidebar.Header";const US=({children:e})=>(0,C.jsx)("div",{className:Se("space-y-4 grow items-start"),children:e});US.displayName="Sidebar.Body";const BS=({children:e})=>{const{isCollapsed:t,setIsCollapsed:n,collapsible:r}=(0,p.useContext)(zS);return(0,C.jsxs)("div",{className:"space-y-4",children:[e,r&&(0,C.jsx)("button",{className:Se("bg-transparent w-full border-0 p-0 m-0 flex items-center gap-2 text-base cursor-pointer",t&&"justify-center"),onClick:()=>{n(!t),Ae("sidebar-collapsed",!t)},"aria-label":t?"Expand sidebar":"Collapse sidebar",children:t?(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(Wo,{title:"Expand",children:(0,C.jsx)(LS,{className:"size-5"})})}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(OS,{className:"size-5"})," Collapse"]})})]})};BS.displayName="Sidebar.Footer";const FS=({children:e,className:t})=>(0,C.jsx)("div",{className:Se("w-full",t),children:e});FS.displayName="Sidebar.Item";const YS=Object.assign(PS,{Header:RS,Body:US,Footer:BS,Item:FS}),ZS=function({accordionGroups:e,currentTab:t,currentSection:n,onTabChange:r,onSectionChange:o}){const[a,s]=(0,i.useState)(()=>new Set((null!=e?e:[]).filter(e=>e.sections.length>0).map(e=>e.id)));(0,i.useEffect)(()=>{const t=(null!=e?e:[]).filter(e=>e.sections.length>0).map(e=>e.id);s(e=>{let n=!1;const r=new Set(e);return t.forEach(e=>{r.has(e)||(r.add(e),n=!0)}),n?r:e})},[e]);const l=(null!=e?e:[]).find(e=>e.id===t),c=n&&l?.sections.length>0?`${t}|${n}`:t,u={};return(null!=e?e:[]).forEach(e=>{0===e.sections.length?u[e.id]=e.name:e.sections.forEach(e=>{u[`${e.tabId}|${e.id}`]=e.name})}),(0,i.createElement)("div",{className:"wcf-step-setting--sidebar-wrapper w-full lg:w-auto"},(0,i.createElement)("div",{className:"lg:hidden px-6 py-4",onClickCapture:e=>e.preventDefault()},(0,i.createElement)(Gw,{value:c,onChange:e=>{if(e.includes("|")){const[t,n]=e.split("|");o(t,n)}else r(e)},size:"md"},(0,i.createElement)(Gw.Button,{placeholder:(0,j.__)("Select a Settings Tab","cartflows"),render:e=>{var t;return null!==(t=u[e])&&void 0!==t?t:e}}),(0,i.createElement)(Gw.Portal,null,(0,i.createElement)(Gw.Options,null,(null!=e?e:[]).map(e=>e.sections.length>0?(0,i.createElement)(Gw.OptionGroup,{key:e.id,label:e.name},e.sections.map(e=>(0,i.createElement)(Gw.Option,{key:e.id,value:`${e.tabId}|${e.id}`},e.name))):(0,i.createElement)(Gw.Option,{key:e.id,value:e.id},e.name)))))),(0,i.createElement)("div",{className:"wcf-step-setting--sidebar hidden lg:flex h-full min-h-screen flex-col w-auto sticky top-0 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-[420px] after:h-screen after:bg-background-primary after:-z-10"},(0,i.createElement)(YS,{borderOn:!0,className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow"},(0,i.createElement)(YS.Body,{className:"!p-0 pt-2"},(0,i.createElement)(YS.Item,null,(0,i.createElement)(Vp,{className:"w-full p-0 bg-transparent",size:"md"},(0,i.createElement)("ul",{className:"m-0 p-0 list-none flex flex-col gap-0.5"},(null!=e?e:[]).map(e=>{const l=a.has(e.id),c=t===e.id,u=e.sections.length>0,d=e.icon,f=u&&c;return(0,i.createElement)(i.Fragment,{key:e.id},(0,i.createElement)(Vp.Item,{active:!u&&c,onClick:()=>(e=>{if(0===e.sections.length)r(e.id);else if(a.has(e.id))s(t=>{const n=new Set(t);return n.delete(e.id),n});else{s(t=>new Set([...t,e.id]));const t=e.sections[0];o(t.tabId,t.id)}})(e),className:u?"hover:!bg-transparent":"hover:!bg-brand-25 hover:[&>svg]:!text-brand-600 "+(c?"!bg-brand-25 !text-text-primary [&>svg]:!text-brand-600":"")},(0,i.createElement)(d,{className:f?"!text-icon-interactive":""}),(0,i.createElement)("div",{className:"flex-1"},e.name),u&&(0,i.createElement)(dm,{className:"!size-4 shrink-0 text-icon-secondary transition-transform duration-200 "+(l?"rotate-180":"")})),u&&l&&(0,i.createElement)("div",{className:"border-l border-solid border-r-0 border-t-0 border-b-0 border-border-subtle pl-4 ml-5"},e.sections.map(e=>{const r=t===e.tabId&&n===e.id;return(0,i.createElement)(Vp.Item,{key:e.id,active:r,onClick:()=>o(e.tabId,e.id),className:"p-1 hover:!bg-brand-25 "+(r?"!bg-brand-25 !text-text-primary":"")},(0,i.createElement)("div",null,e.name))})))}))))))))};function VS({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const GS=p.forwardRef(VS),WS=function({section:e}){const[{options:t,page_builder:n,step_data:r}]=Nm();if(!e)return null;if("shortcode"===e.slug&&"other"!==n)return null;const o={...e,step_type:r?.type||""};return!1===Zm.isActiveControl(o,t)?null:(0,i.createElement)("div",{className:"wcf-section-content"},(0,i.createElement)(w_,{settings:o,displayAs:"div"}))},HS=To("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),QS=To("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]),$S=function(){return(0,i.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section is-placeholder"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,i.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,i.createElement)("div",{className:"title"})),(0,i.createElement)("form",null,(0,i.createElement)("table",null,(0,i.createElement)("tbody",null,(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))),(0,i.createElement)("tr",null,(0,i.createElement)("td",null,(0,i.createElement)("div",{className:"title"}))))),(0,i.createElement)("div",{className:"wcf-field wcf-submit"},(0,i.createElement)("div",{className:"wcf-checkout-custom-fields__button"})))),(0,i.createElement)(aw,{fontSize:"35px",width:"400px"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"80%"}),(0,i.createElement)(aw,{width:"65%"}))},XS=function(){const[{options:e},t]=Nm(),n="yes"===e["wcf-show-coupon-field"],r="yes"===e["wcf-optimize-coupon-field"],o="yes"===e["wcf-checkout-additional-fields"],a="yes"===e["wcf-optimize-order-note-field"],s="yes"===e["wcf-shipto-diff-addr-fields"],l="yes"===e["wcf-google-autoaddress"],c="yes"===e["wcf-custom-no-shipping-method-message-toggle"],u=e["wcf-no-shipping-method-message"]||"",d=e["wcf-order-review-summary-position"]||"top",f=(e,n)=>{t({type:"SET_OPTION",name:e,value:n})},p=[{value:"top",label:(0,j.__)("Top","cartflows")},{value:"bottom",label:(0,j.__)("Bottom","cartflows")}];return(0,i.createElement)("div",{className:"flex flex-col gap-4"},(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Enable Coupon Field","cartflows")),(0,i.createElement)(yw,{value:n,onChange:e=>f("wcf-show-coupon-field",e?"yes":"no")})),n&&(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Collapsible Coupon Field","cartflows")),(0,i.createElement)(yw,{value:r,onChange:e=>f("wcf-optimize-coupon-field",e?"yes":"no")}))),(0,i.createElement)("input",{type:"hidden",name:"wcf-show-coupon-field",value:n?"yes":"no"}),(0,i.createElement)("input",{type:"hidden",name:"wcf-optimize-coupon-field",value:r?"yes":"no"}),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Enable Additional Field","cartflows")),(0,i.createElement)(yw,{value:o,onChange:e=>f("wcf-checkout-additional-fields",e?"yes":"no")})),o&&(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Collapsible Additional Field","cartflows")),(0,i.createElement)(yw,{value:a,onChange:e=>f("wcf-optimize-order-note-field",e?"yes":"no")}))),(0,i.createElement)("input",{type:"hidden",name:"wcf-checkout-additional-fields",value:o?"yes":"no"}),(0,i.createElement)("input",{type:"hidden",name:"wcf-optimize-order-note-field",value:a?"yes":"no"}),(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Enable Ship To Different Address","cartflows")),(0,i.createElement)(yw,{value:s,onChange:e=>f("wcf-shipto-diff-addr-fields",e?"yes":"no")})),(0,i.createElement)("input",{type:"hidden",name:"wcf-shipto-diff-addr-fields",value:s?"yes":"no"}),(0,i.createElement)("div",{className:"flex flex-col py-1"},(0,i.createElement)("div",{className:"flex items-center justify-between"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Enable Google Address Autocomplete","cartflows")),(0,i.createElement)(yw,{value:l,onChange:e=>f("wcf-google-autoaddress",e?"yes":"no")})),(0,i.createElement)("div",{className:"flex items-start gap-1 text-sm font-normal text-text-tertiary mt-2"},(0,i.createElement)(Xx,{className:"w-4 h-4 shrink-0 mt-px text-icon-secondary"}),(0,i.createElement)("span",null,(0,j.__)("Before enabling this option, make sure that you have added API key in Google Address Autocomplete Settings.","cartflows")))),(0,i.createElement)("input",{type:"hidden",name:"wcf-google-autoaddress",value:l?"yes":"no"}),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)("div",{className:"flex items-center gap-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Enable Custom Shipping Message","cartflows")),(0,i.createElement)(Wo,{content:(0,j.__)("Turn this on to show a custom message when no shipping options are available at checkout.","cartflows"),placement:"top"},(0,i.createElement)("span",null,(0,i.createElement)(Xx,{className:"w-4 h-4 text-icon-secondary cursor-help"})))),(0,i.createElement)(yw,{value:c,onChange:e=>f("wcf-custom-no-shipping-method-message-toggle",e?"yes":"no")})),(0,i.createElement)("input",{type:"hidden",name:"wcf-custom-no-shipping-method-message-toggle",value:c?"yes":"no"}),c&&(0,i.createElement)("div",{className:"flex flex-col gap-1.5"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Shipping Message","cartflows")),(0,i.createElement)(Jw,{value:u,rows:2,size:"md",className:"w-full",placeholder:(0,j.__)("There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.","cartflows"),onChange:e=>f("wcf-no-shipping-method-message",e)}))),(0,i.createElement)("input",{type:"hidden",name:"wcf-no-shipping-method-message",value:u}),(0,i.createElement)("div",{className:"flex items-center gap-3"},(0,i.createElement)("div",{className:"flex items-center gap-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Order Summary Position","cartflows")),(0,i.createElement)(Wo,{content:(0,j.__)("Choose this option to adjust where the order summary appears on mobile devices.","cartflows"),placement:"top"},(0,i.createElement)("span",null,(0,i.createElement)(Xx,{className:"w-4 h-4 text-icon-secondary cursor-help"})))),(0,i.createElement)("div",{className:"w-32"},(0,i.createElement)(Gw,{value:d,onChange:e=>f("wcf-order-review-summary-position",e),size:"md"},(0,i.createElement)(Gw.Button,{type:"button",render:e=>{const t=p.find(t=>t.value===e);return t?t.label:e}}),(0,i.createElement)(Gw.Portal,null,(0,i.createElement)(Gw.Options,null,p.map(e=>(0,i.createElement)(Gw.Option,{value:e.value,key:e.value},e.label))))))),(0,i.createElement)("input",{type:"hidden",name:"wcf-order-review-summary-position",value:d}))},JS=function({sectionId:e}){const[{custom_fields:t,step_id:n,options:r,billing_fields:o,shipping_fields:a},s]=Nm(),[l,c]=(0,i.useState)("billing"),u=dg();if(void 0===t)return(0,i.createElement)($S,null);if("form-settings"===e)return(0,i.createElement)(XS,null);if("form-headings"===e&&t.checkout_settings)return(0,i.createElement)(WS,{section:{...t.checkout_settings,slug:"checkout_settings"}});if("place-order-button"===e&&t.button_settings)return(0,i.createElement)(WS,{section:{...t.button_settings,slug:"button_settings"}});if("field-editor"===e){const e=(0,k.applyFilters)("cartflows.stepSettings.customFieldActions",null),t=e?e({stepId:n,dispatch:s,confirm:u,billingFields:o,shippingFields:a,options:r}):null,d=t?t.removeField:e=>e.preventDefault();return(0,i.createElement)("div",{className:"wcf-field-editor-section"},(0,i.createElement)("div",{className:"flex items-center justify-between py-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Enable Custom Field Editor","cartflows")),(0,i.createElement)(yw,{value:"yes"===r["wcf-custom-checkout-fields"],onChange:e=>s({type:"SET_OPTION",name:"wcf-custom-checkout-fields",value:e?"yes":"no"})})),(0,i.createElement)("input",{type:"hidden",name:"wcf-custom-checkout-fields",value:r["wcf-custom-checkout-fields"]}),"yes"===r["wcf-custom-checkout-fields"]&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-checkout-fields-tabs mt-4 mb-0"},(0,i.createElement)(G_.Group,{variant:"rounded",size:"sm",width:"full",activeItem:l,onChange:({value:e})=>c(e.slug)},(0,i.createElement)(G_.Tab,{slug:"billing",text:(0,j.__)("Billing Fields","cartflows"),icon:(0,i.createElement)(HS,{className:"w-4 h-4"}),type:"button"}),(0,i.createElement)(G_.Tab,{slug:"shipping",text:(0,j.__)("Shipping Fields","cartflows"),icon:(0,i.createElement)(QS,{className:"w-4 h-4"}),type:"button"}))),"billing"===l&&o&&(0,i.createElement)("div",{id:"wcf-billing-fields",className:"wcf-billing-fields billing-field-sortable wcf-field-row w-full"},(0,i.createElement)(aS,{data:o,step:"checkout",type:"billing",removeCallback:d})),"shipping"===l&&a&&(0,i.createElement)("div",{id:"wcf-shipping-fields",className:"wcf-shipping-fields shipping-field-sortable wcf-field-row w-full"},(0,i.createElement)(aS,{data:a,step:"checkout",type:"shipping",removeCallback:d})),(0,i.createElement)("div",{className:"text-end"},t&&(0,i.createElement)(vS,{addNewField:t.addNewField,step_type:"checkout"}))))}return null},qS=function(){const[{step_id:e,flow_id:t,options:n,page_settings:r},o]=Nm(),a=Yg(),s=(0,k.applyFilters)("cartflows.stepSettings.productOptions",null);return a||!s?(0,i.createElement)(Rg,{title:(0,j.__)("Let Customers Choose Exactly What They Want","cartflows"),description:(0,j.__)("Offer flexible product options right at checkout — quantities, variations, and more. Upgrade to CartFlows Pro and start customizing your offers today.","cartflows")}):(0,i.createElement)(s,{stepId:e,flowId:t,options:n,pageSettings:r,onDispatch:o})},KS={landing:Fh,checkout:Yh,upsell:Zh,downsell:Vh,optin:Gh,thankyou:Wh},eD=function(){var e;const[{step_id:t,flow_id:n,step_data:r}]=Nm(),o=(0,d.useHistory)(),a=dg(),s=r?.type||"",l=null!==(e=KS[s])&&void 0!==e?e:null;return(0,i.createElement)("div",{className:"flex flex-col gap-4"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-normal text-text-secondary"},(0,j.__)("Replace this step with a different template. Your current design and content for this step will be permanently removed.","cartflows")),(0,i.createElement)("div",{className:"flex items-center gap-4"},l&&(0,i.createElement)("img",{src:l,alt:s,className:"rounded-lg w-[72px] h-[72px]"}),(0,i.createElement)("div",{className:"flex flex-col gap-1"},(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,j.__)("Step Type","cartflows")),(0,i.createElement)(cp,{tag:"span",size:"sm",className:"font-normal text-text-secondary capitalize"},s))),(0,i.createElement)("div",null,(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:async()=>{await a({title:(0,j.__)("Update Template","cartflows"),description:(0,j.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"),actionBtnText:(0,j.__)("Update","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")})&&o.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&step_id=${t}&tab=update-template`)}},(0,j.__)("Update Template","cartflows"))))};function tD({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))}const nD=p.forwardRef(tD),rD=function({onEditingChange:e}){const[{step_id:t,flow_id:n},r]=Nm();let[{step_title:o}]=Nm();(0,i.useEffect)(()=>{let e=!0;return e&&Ep()({path:`/cartflows/v1/admin/flow-data/${n}`}).then(t=>{e&&r({type:"SET_FLOW_DATA",data:t})}),()=>{e=!1}},[o]);const[a,s]=(0,i.useState)(!1),[l,c]=(0,i.useState)(!1),[u,d]=(0,i.useState)(""),f=(0,i.useRef)(null);(0,i.useEffect)(()=>{a&&f.current?.focus()},[a]);if(!1===o)return null;if(a)return(0,i.createElement)("div",{className:"flex items-center gap-2 flex-1 min-w-0"},(0,i.createElement)(Qw,{ref:f,id:"new-step-title",value:u,onChange:d,size:"md",className:"!py-2",autoComplete:"off"}),(0,i.createElement)(Ro,{variant:"primary",size:"sm",type:"button",loading:l,disabled:l,onClick:n=>{n.preventDefault(),c(!0);const o=new window.FormData;o.append("action","cartflows_update_step_title"),o.append("security",cartflows_admin.update_step_title_nonce),o.append("step_id",t),o.append("new_step_title",u),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(()=>{r({type:"SET_STEP_TITLE",title:u}),c(!1),s(!1),e?.(!1),Wm.success((0,j.__)("Step title updated successfully!","cartflows"))})}},(0,j.__)("Save","cartflows")),(0,i.createElement)(Ro,{variant:"outline",size:"sm",type:"button",disabled:l,onClick:t=>{t.preventDefault(),s(!1),e?.(!1)}},(0,j.__)("Cancel","cartflows")));""===o&&(o=(0,j.__)("(no title)","cartflows"));const p=Ym(o,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length);return(0,i.createElement)("div",{className:"wcf-edit-step__title-wrap flex items-center gap-1.5"},(0,i.createElement)("span",{className:"wcf-steps-header__title--text text-xl font-semibold text-text-primary truncate max-w-xs",title:o},p),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",type:"button",icon:(0,i.createElement)(nD,null),onClick:t=>{t.preventDefault(),d(o||""),s(!0),e?.(!0)},"aria-label":(0,j.__)("Edit Step Name","cartflows")}))},oD=To("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),aD={sm:{text:"text-sm",separator:"text-sm",separatorIconSize:16},md:{text:"text-base",separator:"text-base",separatorIconSize:18}},iD=(0,p.createContext)({sizes:aD.sm}),sD=({children:e,size:t="sm"})=>{const n=aD[t]||aD.sm;return(0,C.jsx)(iD.Provider,{value:{sizes:n},children:(0,C.jsx)("nav",{className:"flex m-0","aria-label":"Breadcrumb",children:(0,C.jsx)("ul",{className:"m-0 inline-flex items-center space-x-1 md:space-x-1",children:e})})})};sD.displayName="Breadcrumb";const lD=({children:e})=>(0,C.jsx)(C.Fragment,{children:e});lD.displayName="Breadcrumb.List";const cD=({children:e})=>(0,C.jsx)("li",{className:"m-0 inline-flex items-center gap-2",children:e});cD.displayName="Breadcrumb.Item";const uD=({href:e,children:t,className:n,as:r="a",...o})=>{const{sizes:a}=(0,p.useContext)(iD);return(0,C.jsx)(r,{href:e,className:Se(a.text,"px-1 font-medium no-underline text-text-tertiary hover:text-text-primary hover:underline","focus:outline-none focus:ring-1 focus:ring-border-interactive focus:border-border-interactive focus:rounded-sm","transition-all duration-200",n),...o,children:t})};uD.displayName="Breadcrumb.Link";const dD=({type:e})=>{const{sizes:t}=(0,p.useContext)(iD),n={slash:(0,C.jsx)("span",{className:Se("mx-1",t.separator),children:"/"}),arrow:(0,C.jsx)(pN,{size:t.separatorIconSize})};return(0,C.jsx)("li",{role:"separator",className:"flex items-center text-text-tertiary mx-2 p-0 list-none","aria-hidden":"true",children:n[e]||n.arrow})};dD.displayName="Breadcrumb.Separator";const fD=()=>{const{sizes:e}=(0,p.useContext)(iD);return(0,C.jsx)("span",{role:"img","aria-label":"More pages",children:(0,C.jsx)(oD,{"aria-hidden":"true",className:"mt-[2px] text-text-tertiary",size:e.separatorIconSize+4})})};fD.displayName="Breadcrumb.Ellipsis";const pD=({children:e})=>{const{sizes:t}=(0,p.useContext)(iD);return(0,C.jsx)("span",{className:Se(t.text,"font-medium text-text-primary"),children:e})};pD.displayName="Breadcrumb.Page",sD.List=lD,sD.Item=cD,sD.Link=uD,sD.Separator=dD,sD.Ellipsis=fD,sD.Page=pD;const mD=function({currentTab:e,currentSection:t,sectionObject:n,stepData:r,flowType:o,buttonRef:a,wooStatus:s,setActiveTab:c,backUrl:u}){const[{options:d,is_flow_instant_checkout:f,step_data:p,flow_title:m,step_title:h}]=Nm(),[{license_status:g}]=l(),[w,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)((0,j.__)("Activate WooCommerce","cartflows")),x=s||!s&&"landing"===r?.type,N=Yg(),I=Yg("plus-pro"),M="coupon"===t&&N,E="product-options"===t&&N,S="checkout-link"===t&&N,D="checkout-expiry"===t&&N,k="dynamic-offers"===e&&N,C="order_bumps"===e&&I,A=["upsell","downsell"].includes(p?.type)&&wcfCartflowsPro()&&"Activated"!==g,T=M||E||S||D||k||C||A,L=T||"checkout-link"===t||!s&&["checkout","upsell","downsell","thankyou"].includes(r?.type),O="storeCheckout"===o?"store-checkout":"flows",z="storeCheckout"===o?(0,j.__)("Store Checkout","cartflows"):(0,j.__)("Funnels","cartflows"),P=h&&!1!==h?(0,j.sprintf)(/* translators: %s: step name */ /* translators: %s: step name */
20 +(0,j.__)("%s Settings","cartflows"),h):(0,j.__)("Step Settings","cartflows"),R=(e=!0)=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)(sD,{size:"sm"},(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Link,{href:`admin.php?page=cartflows&path=${O}`,className:"font-normal"},z)),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)(pN,{className:"w-3 h-3 stroke-2"})),m&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Link,{href:`admin.php${u}`,className:"font-normal"},m)),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)(pN,{className:"w-3 h-3 stroke-2"}))),(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Page,null,P))),(0,i.createElement)("div",{className:"flex justify-between items-center h-10"},(0,i.createElement)("div",{className:"flex items-center gap-2.5"+(w?" flex-1 min-w-0":"")},(0,i.createElement)(_,{to:{pathname:"admin.php",search:u},className:"text-icon-secondary hover:text-icon-primary no-underline shrink-0 transition-colors","aria-label":(0,j.__)("Back to funnel","cartflows")},(0,i.createElement)(GS,{className:"w-5 h-5 flex stroke-1"})),(0,i.createElement)(rD,{onEditingChange:y})),e&&!L&&!w&&(0,i.createElement)(ny,{id:"wcf-save-step-meta",ref:a})));if(!x)return(0,i.createElement)("div",{className:"wcf-step-settings--container min-w-0 max-w-4.5xl flex flex-col gap-3 p-4 md:p-8 mx-auto w-full box-border"},R(!1),(0,i.createElement)("div",{className:"bg-brand-25 border border-border-subtle rounded-lg px-5 py-4 lg:px-7 sm:py-6 flex justify-between gap-6"},(0,i.createElement)("div",{className:"max-w-full"},(0,i.createElement)("h2",{className:"text-base font-medium tracking-tight text-text-primary sm:text-base"},(0,j.__)("WooCommerce is Required!","cartflows")),(0,i.createElement)("p",{className:"wcf-upgrade-to-pro-cta--text text-base font-normal text-text-secondary mt-2"},(0,j.sprintf)(
29 21 // translators: %s: step type
30 22 // translators: %s: step type
31 -(0,C.__)("To modify the %s step options, please install and activate the WooCommerce plugin.","cartflows"),r?.type))),(0,i.createElement)("div",{className:"mt-10 flex items-center gap-x-6 lg:mt-0 lg:flex-shrink-0"},(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:(R=x,()=>{const e=new window.FormData;e.append("action","cartflows_activate_plugin"),e.append("init","woocommerce/woocommerce.php"),e.append("security",cartflows_admin.activate_plugin_nonce),R((0,C.__)("Activating…","cartflows")),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{R((0,C.__)("Activated","cartflows")),window.location.reload()})})},v))));var R;let U;return U="change-template"===t&&"storeCheckout"===o&&"yes"!==p?(0,C.__)("Change Template","cartflows"):"checkout_form_fields"===e&&t?{"form-settings":(0,C.__)("Form Settings","cartflows"),"field-editor":(0,C.__)("Field Editor","cartflows"),"form-headings":(0,C.__)("Form Headings","cartflows"),"place-order-button":(0,C.__)("Place Order Button","cartflows")}[t]||jS(e,r?.tabs):n?.title||jS(e,r?.tabs),(0,i.createElement)(zm,{containerType:"flex",direction:"column",gap:"sm",className:"wcf-step-settings--container min-w-0 max-w-3.5xl p-4 md:p-8 mx-auto w-full box-border"},P(),(0,i.createElement)(zm,{containerType:"flex",direction:"column",className:A?"!gap-5 mb-8":"!gap-5 bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm mb-8 p-6"},U&&(0,i.createElement)(jI,{title:U,tag:"h5",size:"xs",className:"text-text-primary"}),j?(0,i.createElement)(AI,{heading:(0,C.__)("License is required!","cartflows"),subHeading:(0,C.__)("Activate the license to modify this offer step's settings","cartflows")}):M?(0,i.createElement)(pI,{title:(0,C.__)("Apply Discounts Automatically and Convert More Customers","cartflows"),description:(0,C.__)("Remove friction at checkout — discounts activate the moment customers arrive. Upgrade to Pro and watch conversions climb immediately.","cartflows")}):"design"===e?(0,i.createElement)("div",{className:"space-y-4"},(0,i.createElement)("div",{className:"wcf-step-notices-wrapper rounded-md bg-brand-25 border border-solid border-border-interactive p-4"},(0,i.createElement)("div",{className:"text-sm text-brand-600"},"yes"===p&&["checkout","upsell","downsell","thankyou"].includes(m?.type)?(0,C.sprintf)(
23 +(0,j.__)("To modify the %s step options, please install and activate the WooCommerce plugin.","cartflows"),r?.type))),(0,i.createElement)("div",{className:"mt-10 flex items-center gap-x-6 lg:mt-0 lg:flex-shrink-0"},(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:(U=v,()=>{const e=new window.FormData;e.append("action","cartflows_activate_plugin"),e.append("init","woocommerce/woocommerce.php"),e.append("security",cartflows_admin.activate_plugin_nonce),U((0,j.__)("Activating…","cartflows")),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{U((0,j.__)("Activated","cartflows")),window.location.reload()})})},b))));var U;let B;return B="change-template"===t&&"storeCheckout"===o&&"yes"!==f?(0,j.__)("Change Template","cartflows"):"checkout_form_fields"===e&&t?{"form-settings":(0,j.__)("Form Settings","cartflows"),"field-editor":(0,j.__)("Field Editor","cartflows"),"form-headings":(0,j.__)("Form Headings","cartflows"),"place-order-button":(0,j.__)("Place Order Button","cartflows")}[t]||AS(e,r?.tabs):n?.title||AS(e,r?.tabs),(0,i.createElement)(ph,{containerType:"flex",direction:"column",gap:"sm",className:"wcf-step-settings--container min-w-0 max-w-4.5xl p-4 md:p-8 mx-auto w-full box-border"},R(),(0,i.createElement)(ph,{containerType:"flex",direction:"column",className:T?"!gap-5 mb-8":"!gap-5 bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm mb-8 p-6"},B&&(0,i.createElement)(v_,{title:B,tag:"h5",size:"xs",className:"text-text-primary"}),A?(0,i.createElement)(x_,{heading:(0,j.__)("License is required!","cartflows"),subHeading:(0,j.__)("Activate the license to modify this offer step's settings","cartflows")}):M?(0,i.createElement)(Rg,{title:(0,j.__)("Apply Discounts Automatically and Convert More Customers","cartflows"),description:(0,j.__)("Remove friction at checkout — discounts activate the moment customers arrive. Upgrade to Pro and watch conversions climb immediately.","cartflows")}):S?(0,i.createElement)(Rg,{title:(0,j.__)("Share Pre-Filled Checkout Links","cartflows"),description:(0,j.__)("Generate shareable links that add your products to the cart and send customers straight to checkout. Upgrade to Pro to create one-click checkout links.","cartflows")}):D?(0,i.createElement)(Rg,{title:(0,j.__)("Add Real Scarcity with Checkout Expiry","cartflows"),description:(0,j.__)("Automatically close a checkout after a set number of orders or a deadline and redirect late visitors. Upgrade to Pro to turn urgency into more conversions.","cartflows")}):"design"===e?(0,i.createElement)("div",{className:"space-y-4"},(0,i.createElement)("div",{className:"wcf-step-notices-wrapper rounded-md bg-brand-25 border border-solid border-border-interactive p-4"},(0,i.createElement)("div",{className:"text-sm text-brand-600"},"yes"===f&&["checkout","upsell","downsell","thankyou"].includes(p?.type)?(0,j.sprintf)(
32 24 // translators: %s: The current step type.
33 25 // translators: %s: The current step type.
34 -(0,C.__)("Use this to customize how your Instant %s page looks.","cartflows"),"thankyou"===m?.type?(0,C.__)("Thank You","cartflows"):m?.type.charAt(0).toUpperCase()+m?.type.slice(1)):(0,i.createElement)(i.Fragment,null,(0,C.__)("If you are using shortcodes, enable this design settings to apply styles.","cartflows")))),(0,i.createElement)(yM,{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:d["wcf-enable-design-settings"],label:(0,C.__)("Enable Design Settings","cartflows"),fullWidth:!0}),"yes"===d["wcf-enable-design-settings"]&&n&&(0,i.createElement)(ZS,{section:n})):"checkout_form_fields"===e&&t?(0,i.createElement)(qS,{sectionId:t}):"product-options"===t&&n?(0,i.createElement)(JS,null):"change-template"===t&&"storeCheckout"===o&&"yes"!==p?(0,i.createElement)(ek,null):"checkout_offer"===e?(0,i.createElement)("div",{className:"wcf-page-wrapper"},AS(e,r,o,c)):n&&("products"!==e||"storeCheckout"!==o||cartflows_admin.store_checkout_show_product_tab)?(0,i.createElement)(ZS,{section:n}):(0,i.createElement)("div",{className:"wcf-page-wrapper"},AS(e,r,o,c))))},ak=function(){return(0,i.createElement)("div",{className:"wcf-step-settings-view flex flex-col lg:flex-row lg:gap-6 items-start w-full"},(0,i.createElement)("div",{className:"wcf-step-setting--sidebar hidden lg:flex h-full min-h-screen flex-col w-auto sticky top-0 after:content-[''] after:fixed after:left-0 after:top-0 after:w-[420px] after:h-screen after:bg-background-primary after:-z-10"},(0,i.createElement)("div",{className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow bg-background-primary border-0 border-r border-solid border-border-subtle"},(0,i.createElement)("div",{className:"flex flex-col gap-0.5 pt-2"},[["w-20",!0,["w-24","w-20"]],["w-24",!1,[]],["w-16",!0,["w-28","w-20","w-24"]],["w-20",!1,[]],["w-16",!1,[]]].map(([e,t,n],r)=>(0,i.createElement)("div",{key:r,className:"flex flex-col"},(0,i.createElement)("div",{className:"flex items-center gap-2.5 px-3 py-2"},(0,i.createElement)(bI,{className:"w-5 h-5 rounded"}),(0,i.createElement)(bI,{className:`h-3 ${e} flex-1`}),t&&(0,i.createElement)(bI,{className:"w-4 h-4 rounded"})),n.length>0&&(0,i.createElement)("div",{className:"flex flex-col gap-0.5 ml-10"},n.map((e,t)=>(0,i.createElement)("div",{key:t,className:"px-2 py-1.5"},(0,i.createElement)(bI,{className:`h-3 ${e}`}))))))))),(0,i.createElement)("div",{className:"wcf-step-settings--container min-w-0 max-w-3.5xl p-4 md:p-8 mx-auto w-full flex flex-col gap-3"},(0,i.createElement)("div",{className:"flex items-center gap-2 py-1"},(0,i.createElement)(bI,{className:"w-14 h-2.5"}),(0,i.createElement)(bI,{className:"w-2 h-2.5"}),(0,i.createElement)(bI,{className:"w-20 h-2.5"}),(0,i.createElement)(bI,{className:"w-2 h-2.5"}),(0,i.createElement)(bI,{className:"w-28 h-2.5"})),(0,i.createElement)("div",{className:"flex justify-between items-center h-10"},(0,i.createElement)("div",{className:"flex items-center gap-2.5"},(0,i.createElement)(bI,{className:"w-5 h-5 rounded"}),(0,i.createElement)(bI,{className:"w-40 h-5"})),(0,i.createElement)(bI,{className:"w-28 h-9 rounded-lg"})),(0,i.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm overflow-hidden mb-8 p-6 flex flex-col gap-5"},(0,i.createElement)(bI,{className:"w-32 h-4"}),["w-28","w-36","w-24","w-32"].map((e,t)=>(0,i.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,i.createElement)(bI,{className:`${e} h-3.5`}),(0,i.createElement)(bI,{className:"w-full h-10 rounded-md"}))))))};function ik(e,t,n,r,o){if("checkout_form_fields"===e)return"form-settings";if(o?.settings){const t=Object.entries(o.settings).filter(([,t])=>t.tab===e&&t.title).sort(([,e],[,t])=>e.priority-t.priority);if(t.length>0){var a;const[e,n]=t[0];return null!==(a=n.slug)&&void 0!==a?a:e}}if("settings"===e&&t?.settings){var i,s;const e=Object.values(t.settings).sort((e,t)=>e.priority-t.priority);return null!==(i=null!==(s=e[0]?.slug)&&void 0!==s?s:e[0]?.id)&&void 0!==i?i:null}if("design"===e&&n?.settings&&"yes"===r?.["wcf-enable-design-settings"]){var l,c;const e=Object.values(n.settings).sort((e,t)=>e.priority-t.priority);return null!==(l=null!==(c=e[0]?.slug)&&void 0!==c?c:e[0]?.id)&&void 0!==l?l:null}return null}const sk=function(e){var t,n,r;const[{flow_id:o,step_data:a,flow_type:l,options:c,page_builder:u,is_flow_instant_checkout:d,settings_data:p,design_settings:m,page_settings:g},w]=Yp(),y=(0,s.useRef)(null),b=Oh(),[{},v]=f(),x=(0,h.useHistory)(),N=new URLSearchParams((0,h.useLocation)()?.search),E=null!==(t=N.get("step_id"))&&void 0!==t?t:"",_=null!==(n=N.get("tab"))&&void 0!==n?n:"",M=null!==(r=N.get("section"))&&void 0!==r?r:null,{saveOrderBump:I}=tI(),[S,k]=(0,s.useState)(_||"products"),[D,j]=(0,s.useState)(M),A="active"===cartflows_admin.woocommerce_status;let T=!0;0!==Object.keys(a).length&&a.id.toString()===E&&(T=!1);const L=e=>{const t={};return Object.entries(e).forEach(([e,n])=>{const r={...n,step_type:a?.type||""};!1!==dm.isActiveControl(r,c)&&(t[e]=n)}),t},O=(0,s.useMemo)(()=>{if(!m?.settings)return m;const e={};return Object.entries(m.settings).forEach(([t,n])=>{if(["shortcode","shortcodes"].includes(n.slug)&&"other"!==u)return;const r={...n,step_type:a?.type||""};!1!==dm.isActiveControl(r,c)&&(e[t]=n)}),{...m,settings:e}},[m,u,a?.type,c]),z=(0,s.useMemo)(()=>{if(!p?.settings)return p;const e=L(p.settings),t={};return Object.entries(e).forEach(([e,n])=>{["shortcode","shortcodes"].includes(n.slug)&&"other"!==u||(t[e]=n)}),{...p,settings:t}},[p,u,a?.type,c]),P=(0,s.useMemo)(()=>g?.settings?{...g,settings:L(g.settings)}:g,[g,a?.type,c]);(0,s.useEffect)(()=>{let e=!0;return""!==E&&(async()=>{qf()({path:`/cartflows/v1/admin/step-data/${E}`}).then(t=>{if(e){if(t.billing_fields){const e=Object.entries(t.billing_fields.fields).map(([e,t])=>({...t,key:e}));t.billing_fields=e}if(t.shipping_fields){const e=Object.entries(t.shipping_fields.fields).map(([e,t])=>({...t,key:e}));t.shipping_fields=e}w({type:"SET_STEP_DATA",data:t})}})})(),()=>{e=!1}},[E]),(0,s.useEffect)(()=>{if(!T&&!M){const e=ik(S,z,O,c,P);j(e)}},[T]);const R=null!=D?D:T?null:ik(S,z,O,c,P);let U=[];if(a?.tabs){const e=a.tabs,t=Object.values(e).sort((e,t)=>e.priority-t.priority);let n=t.map(e=>({name:e.title,id:e.id}));B=n,F=a,n="other"!==u&&"yes"!==d||["upsell","downsell"].includes(F?.type)&&"yes"!==F?.options?.["wcf-enable-instant-layout"]?B.filter(e=>"design"!==e.id):B,U=function(e,t,n,r,o,a,i){return e.map(e=>{const s={id:e.id,name:e.name,icon:(l=e.id,null!==(c={products:HM,order_bumps:NI,checkout_form_fields:_I,"dynamic-offers":II,checkout_offer:mg,settings:$h,optin_form_fields:mg,design:JM}[l])&&void 0!==c?c:$h),sections:[]};var l,c;return"settings"===e.id&&t?.settings?(s.sections=Object.values(t.settings).sort((e,t)=>e.priority-t.priority).map(e=>{var t;return{id:null!==(t=e.slug)&&void 0!==t?t:e.id,tabId:"settings",name:e.title}}),"storeCheckout"===a&&"yes"!==i&&s.sections.push({id:"change-template",tabId:"settings",name:(0,C.__)("Change Template","cartflows")})):"design"===e.id&&n?.settings&&"yes"===r?.["wcf-enable-design-settings"]?s.sections=Object.values(n.settings).sort((e,t)=>e.priority-t.priority).map(e=>{var t;return{id:null!==(t=e.slug)&&void 0!==t?t:e.id,tabId:"design",name:e.title}}):"checkout_form_fields"===e.id?s.sections=[{id:"form-settings",tabId:"checkout_form_fields",name:(0,C.__)("Form Settings","cartflows")},{id:"field-editor",tabId:"checkout_form_fields",name:(0,C.__)("Field Editor","cartflows")},{id:"form-headings",tabId:"checkout_form_fields",name:(0,C.__)("Form Headings","cartflows")},{id:"place-order-button",tabId:"checkout_form_fields",name:(0,C.__)("Place Order Button","cartflows")}]:o?.settings&&"checkout_offer"!==e.id&&(s.sections=Object.entries(o.settings).filter(([,t])=>t.tab===e.id&&t.title).sort(([,e],[,t])=>e.priority-t.priority).map(([t,n])=>{var r;return{id:null!==(r=n.slug)&&void 0!==r?r:t,tabId:e.id,name:n.title}})),s})}(n,z,O,c,P,l,d)}var B,F;const Q=function(e,t,n,r,o){if(!t)return null;if(o?.settings){const n=Object.entries(o.settings).find(([n,r])=>{var o;return r.tab===e&&(null!==(o=r.slug)&&void 0!==o?o:n)===t});if(n)return n[1]}var a,i;return"settings"===e&&n?.settings?null!==(a=Object.values(n.settings).find(e=>{var n;return(null!==(n=e.slug)&&void 0!==n?n:e.id)===t}))&&void 0!==a?a:null:"design"===e&&r?.settings&&null!==(i=Object.values(r.settings).find(e=>{var n;return(null!==(n=e.slug)&&void 0!==n?n:e.id)===t}))&&void 0!==i?i:null}(S,R,z,O,P),V=async function(){return!!window.wcfUnsavedChanges&&await b({title:"Save Changes",description:"You have made changes. Do you want to save the changes?",actionBtnText:"Yes",cancelBtnText:"No"})},Y=(e,t)=>{const n=new URLSearchParams(window.location.search);n.set("tab",e),t?n.set("section",t):n.delete("section"),x.push({search:n.toString()})},Z="storeCheckout"===l?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${o}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${o}`;return T?(0,i.createElement)(ak,null):(0,i.createElement)("form",{className:"wcf-step-settings-view flex flex-col lg:flex-row lg:gap-6 items-start w-full",onSubmit:function(t){t.preventDefault();const n=new window.FormData(t.target);if("yes"===c["wcf-enable-product-options"]&&Object.entries(c["wcf-product-options-data"]).forEach(([e,t])=>{Object.entries(t).forEach(([t,r])=>{n.append(`wcf-product-options-data[${e}][${t}]`,r)})}),"order_bumps"===S)I();else{if(n.append("action","cartflows_save_meta_settings"),n.append("security",cartflows_admin.save_meta_settings_nonce),n.append("post_id",o),n.append("step_id",E),"products"===S&&"checkout"===a.type&&"single-selection"===c["wcf-product-options"]){const e=n.get("wcf_default_add_to_cart[]");n.set(`wcf-product-options-data[${e}][add_to_cart]`,"yes")}qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{v({status:"SAVED"}),hm.success((0,C.__)("Settings saved successfully!","cartflows")),["products"].includes(S)&&e.renderCb()}).catch(()=>{v({status:"UNSAVED"}),hm.error((0,C.__)("Failed to save settings. Please try again.","cartflows"))})}}},(0,i.createElement)(QS,{accordionGroups:U,currentTab:S,currentSection:R,onTabChange:async function(e){if(e===S)return;await V()&&y.current?.click();const t=ik(e,z,O,c,P);k(e),j(t),Y(e,t),window.wcfUnsavedChanges=!1},onSectionChange:async function(e,t){e===S&&t===D||(await V()&&y.current?.click(),k(e),j(t),Y(e,t),window.wcfUnsavedChanges=!1)}}),(0,i.createElement)(ok,{currentTab:S,currentSection:R,sectionObject:Q,stepData:a,flowType:l,renderCb:e.renderCb,buttonRef:y,wooStatus:A,setActiveTab:k,backUrl:Z}))},lk=To("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),ck=To("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]),uk=To("LayoutPanelTop",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]),dk=To("LayoutPanelLeft",[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]),fk=To("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]),pk=To("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),mk=To("Spline",[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]]),hk=To("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),gk=To("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),wk=To("Focus",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),yk=To("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);var bk={value:()=>{}};function vk(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new xk(r)}function xk(e){this._=e}function Nk(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function Ek(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=bk,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}xk.prototype=vk.prototype={constructor:xk,on:function(e,t){var n,r,o=this._,a=(r=o,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=a[i]).type)o[n]=Ek(o[n],e.name,t);else if(null==t)for(n in o)o[n]=Ek(o[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=Nk(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new xk(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),a=0;a<n;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(r=this._[e]).length;a<n;++a)r[a].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,a=r.length;o<a;++o)r[o].value.apply(t,n)}};const _k=vk;function Mk(){}function Ik(e){return null==e?Mk:function(){return this.querySelector(e)}}function Sk(){return[]}function kk(e){return null==e?Sk:function(){return this.querySelectorAll(e)}}function Dk(e){return function(){return this.matches(e)}}function Ck(e){return function(t){return t.matches(e)}}var jk=Array.prototype.find;function Ak(){return this.firstElementChild}var Tk=Array.prototype.filter;function Lk(){return Array.from(this.children)}function Ok(e){return new Array(e.length)}function zk(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Pk(e,t,n,r,o,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],r[s]=i):n[s]=new zk(e,a[s]);for(;s<l;++s)(i=t[s])&&(o[s]=i)}function Rk(e,t,n,r,o,a,i){var s,l,c,u=new Map,d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(r[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new zk(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function Uk(e){return e.__data__}function Bk(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Fk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}zk.prototype={constructor:zk,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var Qk="http://www.w3.org/1999/xhtml";const Vk={svg:"http://www.w3.org/2000/svg",xhtml:Qk,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yk(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Vk.hasOwnProperty(t)?{space:Vk[t],local:e}:e}function Zk(e){return function(){this.removeAttribute(e)}}function Wk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gk(e,t){return function(){this.setAttribute(e,t)}}function Hk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function $k(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Xk(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function qk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Jk(e){return function(){this.style.removeProperty(e)}}function Kk(e,t,n){return function(){this.style.setProperty(e,t,n)}}function eD(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function tD(e,t){return e.style.getPropertyValue(t)||qk(e).getComputedStyle(e,null).getPropertyValue(t)}function nD(e){return function(){delete this[e]}}function rD(e,t){return function(){this[e]=t}}function oD(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function aD(e){return e.trim().split(/^|\s+/)}function iD(e){return e.classList||new sD(e)}function sD(e){this._node=e,this._names=aD(e.getAttribute("class")||"")}function lD(e,t){for(var n=iD(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function cD(e,t){for(var n=iD(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function uD(e){return function(){lD(this,e)}}function dD(e){return function(){cD(this,e)}}function fD(e,t){return function(){(t.apply(this,arguments)?lD:cD)(this,e)}}function pD(){this.textContent=""}function mD(e){return function(){this.textContent=e}}function hD(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function gD(){this.innerHTML=""}function wD(e){return function(){this.innerHTML=e}}function yD(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function bD(){this.nextSibling&&this.parentNode.appendChild(this)}function vD(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xD(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Qk&&t.documentElement.namespaceURI===Qk?t.createElement(e):t.createElementNS(n,e)}}function ND(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ED(e){var t=Yk(e);return(t.local?ND:xD)(t)}function _D(){return null}function MD(){var e=this.parentNode;e&&e.removeChild(this)}function ID(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function SD(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kD(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function DD(e,t,n){return function(){var r,o=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var i=0,s=o.length;i<s;++i)if((r=o[i]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=t);this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(r):this.__on=[r]}}function CD(e,t,n){var r=qk(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function jD(e,t){return function(){return CD(this,e,t)}}function AD(e,t){return function(){return CD(this,e,t.apply(this,arguments))}}sD.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var TD=[null];function LD(e,t){this._groups=e,this._parents=t}function OD(){return new LD([[document.documentElement]],TD)}LD.prototype=OD.prototype={constructor:LD,select:function(e){"function"!=typeof e&&(e=Ik(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new LD(r,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return function(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}(e.apply(this,arguments))}}(e):kk(e);for(var t=this._groups,n=t.length,r=[],o=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(r.push(e.call(i,i.__data__,c,s)),o.push(i));return new LD(r,o)},selectChild:function(e){return this.select(null==e?Ak:function(e){return function(){return jk.call(this.children,e)}}("function"==typeof e?e:Ck(e)))},selectChildren:function(e){return this.selectAll(null==e?Lk:function(e){return function(){return Tk.call(this.children,e)}}("function"==typeof e?e:Ck(e)))},filter:function(e){"function"!=typeof e&&(e=Dk(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new LD(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,Uk);var n=t?Rk:Pk,r=this._parents,o=this._groups;"function"!=typeof e&&(e=function(e){return function(){return e}}(e));for(var a=o.length,i=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=r[c],d=o[c],f=d.length,p=Bk(e.call(u,u&&u.__data__,c,r)),m=p.length,h=s[c]=new Array(m),g=i[c]=new Array(m);n(u,d,h,g,l[c]=new Array(f),p,t);for(var w,y,b=0,v=0;b<m;++b)if(w=h[b]){for(b>=v&&(v=b+1);!(y=g[v])&&++v<m;);w._next=y||null}}return(i=new LD(i,r))._enter=s,i._exit=l,i},enter:function(){return new LD(this._enter||this._groups.map(Ok),this._parents)},exit:function(){return new LD(this._exit||this._groups.map(Ok),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,a=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?a.remove():n(a),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,a=r.length,i=Math.min(o,a),s=new Array(o),l=0;l<i;++l)for(var c,u=n[l],d=r[l],f=u.length,p=s[l]=new Array(f),m=0;m<f;++m)(c=u[m]||d[m])&&(p[m]=c);for(;l<o;++l)s[l]=n[l];return new LD(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],a=o.length-1,i=o[a];--a>=0;)(r=o[a])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Fk);for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a){for(var i,s=n[a],l=s.length,c=o[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new LD(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var i=r[o];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,a=t[n],i=0,s=a.length;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this},attr:function(e,t){var n=Yk(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?Wk:Zk:"function"==typeof t?n.local?Xk:$k:n.local?Hk:Gk)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Jk:"function"==typeof t?eD:Kk)(e,t,null==n?"":n)):tD(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?nD:"function"==typeof t?oD:rD)(e,t)):this.node()[e]},classed:function(e,t){var n=aD(e+"");if(arguments.length<2){for(var r=iD(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?fD:t?uD:dD)(n,t))},text:function(e){return arguments.length?this.each(null==e?pD:("function"==typeof e?hD:mD)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?gD:("function"==typeof e?yD:wD)(e)):this.node().innerHTML},raise:function(){return this.each(bD)},lower:function(){return this.each(vD)},append:function(e){var t="function"==typeof e?e:ED(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:ED(e),r=null==t?_D:"function"==typeof t?t:Ik(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(MD)},clone:function(e){return this.select(e?SD:ID)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?DD:kD,r=0;r<i;++r)this.each(s(a[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<i;++r)if((o=a[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?AD:jD)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],a=0,i=o.length;a<i;++a)(r=o[a])&&(yield r)}};const zD=OD;function PD(e){return"string"==typeof e?new LD([[document.querySelector(e)]],[document.documentElement]):new LD([[e]],TD)}function RD(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const UD={passive:!1},BD={capture:!0,passive:!1};function FD(e){e.stopImmediatePropagation()}function QD(e){e.preventDefault(),e.stopImmediatePropagation()}function VD(e){var t=e.document.documentElement,n=PD(e).on("dragstart.drag",QD,BD);"onselectstart"in t?n.on("selectstart.drag",QD,BD):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function YD(e,t){var n=e.document.documentElement,r=PD(e).on("dragstart.drag",null);t&&(r.on("click.drag",QD,BD),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ZD=e=>()=>e;function WD(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:a,x:i,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function GD(e){return!e.ctrlKey&&!e.button}function HD(){return this.parentNode}function $D(e,t){return null==t?{x:e.x,y:e.y}:t}function XD(){return navigator.maxTouchPoints||"ontouchstart"in this}function qD(){var e,t,n,r,o=GD,a=HD,i=$D,s=XD,l={},c=_k("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",w,UD).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,s){if(!r&&o.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(PD(i.view).on("mousemove.drag",m,BD).on("mouseup.drag",h,BD),VD(i.view),FD(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function m(r){if(QD(r),!n){var o=r.clientX-e,a=r.clientY-t;n=o*o+a*a>d}l.mouse("drag",r)}function h(e){PD(e.view).on("mousemove.drag mouseup.drag",null),YD(e.view,n),QD(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(r=b(this,s,e,t,i[n].identifier,i[n]))&&(FD(e),r("start",e,i[n]))}}function w(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(QD(e),n("drag",e,r[t]))}function y(e){var t,n,o=e.changedTouches,a=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<a;++t)(n=l[o[t].identifier])&&(FD(e),n("end",e,o[t]))}function b(e,t,n,r,o,a){var s,d,p,m=c.copy(),h=RD(a||n,t);if(null!=(p=i.call(e,new WD("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:h[0],y:h[1],dx:0,dy:0,dispatch:m}),r)))return s=p.x-h[0]||0,d=p.y-h[1]||0,function n(a,i,c){var g,w=h;switch(a){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":h=RD(c||i,t),g=u}m.call(a,e,new WD(a,{sourceEvent:i,subject:p,target:f,identifier:o,active:g,x:h[0]+s,y:h[1]+d,dx:h[0]-w[0],dy:h[1]-w[1],dispatch:m}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:ZD(!!e),f):o},f.container=function(e){return arguments.length?(a="function"==typeof e?e:ZD(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:ZD(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:ZD(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function JD(e){return((e=Math.exp(e))+1/e)/2}WD.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};const KD=function e(t,n,r){function o(e,o){var a,i,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-s,m=d-l,h=p*p+m*m;if(h<1e-12)i=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*m,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(h),w=(f*f-c*c+r*h)/(2*c*n*g),y=(f*f-c*c-r*h)/(2*f*n*g),b=Math.log(Math.sqrt(w*w+1)-w),v=Math.log(Math.sqrt(y*y+1)-y);i=(v-b)/t,a=function(e){var r=e*i,o=JD(b),a=c/(n*g)*(o*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*r+b)-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+a*p,l+a*m,c*o/JD(t*r+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);var eC,tC,nC=0,rC=0,oC=0,aC=0,iC=0,sC=0,lC="object"==typeof performance&&performance.now?performance:Date,cC="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function uC(){return iC||(cC(dC),iC=lC.now()+sC)}function dC(){iC=0}function fC(){this._call=this._time=this._next=null}function pC(e,t,n){var r=new fC;return r.restart(e,t,n),r}function mC(){iC=(aC=lC.now())+sC,nC=rC=0;try{!function(){uC(),++nC;for(var e,t=eC;t;)(e=iC-t._time)>=0&&t._call.call(void 0,e),t=t._next;--nC}()}finally{nC=0,function(){for(var e,t,n=eC,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:eC=t);tC=e,gC(r)}(),iC=0}}function hC(){var e=lC.now(),t=e-aC;t>1e3&&(sC-=t,aC=e)}function gC(e){nC||(rC&&(rC=clearTimeout(rC)),e-iC>24?(e<1/0&&(rC=setTimeout(mC,e-lC.now()-sC)),oC&&(oC=clearInterval(oC))):(oC||(aC=lC.now(),oC=setInterval(hC,1e3)),nC=1,cC(mC)))}function wC(e,t,n){var r=new fC;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}fC.prototype=pC.prototype={constructor:fC,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?uC():+n)+(null==t?0:+t),this._next||tC===this||(tC?tC._next=this:eC=this,tC=this),this._call=e,this._time=n,gC()},stop:function(){this._call&&(this._call=null,this._time=1/0,gC())}};var yC=_k("start","end","cancel","interrupt"),bC=[];function vC(e,t,n,r,o,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function a(l){var c,u,d,f;if(1!==n.state)return s();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return wC(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(wC(function(){3===n.state&&(n.state=4,n.timer.restart(i,n.delay,n.time),i(l))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function i(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),a=-1,i=r.length;++a<i;)r[a].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=pC(function(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:o,on:yC,tween:bC,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function xC(e,t){var n=EC(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function NC(e,t){var n=EC(e,t);if(n.state>3)throw new Error("too late; already running");return n}function EC(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function _C(e,t){var n,r,o,a=e.__transition,i=!0;if(a){for(o in t=null==t?null:t+"",a)(n=a[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[o]):i=!1;i&&delete e.__transition}}function MC(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var IC,SC=180/Math.PI,kC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function DC(e,t,n,r,o,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*SC,skewX:Math.atan(l)*SC,scaleX:i,scaleY:s}}function CC(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,r,o,a,i,s){if(e!==o||r!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:MC(e,o)},{i:l-2,x:MC(r,a)})}else(o||a)&&i.push("translate("+o+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(o(n)+"rotate(",null,r)-2,x:MC(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(o(n)+"skewX(",null,r)-2,x:MC(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(a.skewX,i.skewX,s,l),function(e,t,n,r,a,i){if(e!==n||t!==r){var s=a.push(o(a)+"scale(",null,",",null,")");i.push({i:s-4,x:MC(e,n)},{i:s-2,x:MC(t,r)})}else 1===n&&1===r||a.push(o(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var jC=CC(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?kC:DC(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),AC=CC(function(e){return null==e?kC:(IC||(IC=document.createElementNS("http://www.w3.org/2000/svg","g")),IC.setAttribute("transform",e),(e=IC.transform.baseVal.consolidate())?DC((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):kC)},", ",")",")");function TC(e,t){var n,r;return function(){var o=NC(this,e),a=o.tween;if(a!==n)for(var i=0,s=(r=n=a).length;i<s;++i)if(r[i].name===t){(r=r.slice()).splice(i,1);break}o.tween=r}}function LC(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var a=NC(this,e),i=a.tween;if(i!==r){o=(r=i).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}a.tween=o}}function OC(e,t,n){var r=e._id;return e.each(function(){var e=NC(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return EC(e,r).value[t]}}function zC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function PC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function RC(){}var UC=.7,BC=1/UC,FC="\\s*([+-]?\\d+)\\s*",QC="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",VC="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",YC=/^#([0-9a-f]{3,8})$/,ZC=new RegExp(`^rgb\\(${FC},${FC},${FC}\\)$`),WC=new RegExp(`^rgb\\(${VC},${VC},${VC}\\)$`),GC=new RegExp(`^rgba\\(${FC},${FC},${FC},${QC}\\)$`),HC=new RegExp(`^rgba\\(${VC},${VC},${VC},${QC}\\)$`),$C=new RegExp(`^hsl\\(${QC},${VC},${VC}\\)$`),XC=new RegExp(`^hsla\\(${QC},${VC},${VC},${QC}\\)$`),qC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function JC(){return this.rgb().formatHex()}function KC(){return this.rgb().formatRgb()}function ej(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=YC.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?tj(t):3===n?new oj(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?nj(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?nj(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ZC.exec(e))?new oj(t[1],t[2],t[3],1):(t=WC.exec(e))?new oj(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=GC.exec(e))?nj(t[1],t[2],t[3],t[4]):(t=HC.exec(e))?nj(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=$C.exec(e))?uj(t[1],t[2]/100,t[3]/100,1):(t=XC.exec(e))?uj(t[1],t[2]/100,t[3]/100,t[4]):qC.hasOwnProperty(e)?tj(qC[e]):"transparent"===e?new oj(NaN,NaN,NaN,0):null}function tj(e){return new oj(e>>16&255,e>>8&255,255&e,1)}function nj(e,t,n,r){return r<=0&&(e=t=n=NaN),new oj(e,t,n,r)}function rj(e,t,n,r){return 1===arguments.length?function(e){return e instanceof RC||(e=ej(e)),e?new oj((e=e.rgb()).r,e.g,e.b,e.opacity):new oj}(e):new oj(e,t,n,null==r?1:r)}function oj(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function aj(){return`#${cj(this.r)}${cj(this.g)}${cj(this.b)}`}function ij(){const e=sj(this.opacity);return`${1===e?"rgb(":"rgba("}${lj(this.r)}, ${lj(this.g)}, ${lj(this.b)}${1===e?")":`, ${e})`}`}function sj(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function lj(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cj(e){return((e=lj(e))<16?"0":"")+e.toString(16)}function uj(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fj(e,t,n,r)}function dj(e){if(e instanceof fj)return new fj(e.h,e.s,e.l,e.opacity);if(e instanceof RC||(e=ej(e)),!e)return new fj;if(e instanceof fj)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,s=a-o,l=(a+o)/2;return s?(i=t===a?(n-r)/s+6*(n<r):n===a?(r-t)/s+2:(t-n)/s+4,s/=l<.5?a+o:2-a-o,i*=60):s=l>0&&l<1?0:i,new fj(i,s,l,e.opacity)}function fj(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function pj(e){return(e=(e||0)%360)<0?e+360:e}function mj(e){return Math.max(0,Math.min(1,e||0))}function hj(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function gj(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}zC(RC,ej,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:JC,formatHex:JC,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return dj(this).formatHsl()},formatRgb:KC,toString:KC}),zC(oj,rj,PC(RC,{brighter(e){return e=null==e?BC:Math.pow(BC,e),new oj(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?UC:Math.pow(UC,e),new oj(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new oj(lj(this.r),lj(this.g),lj(this.b),sj(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:aj,formatHex:aj,formatHex8:function(){return`#${cj(this.r)}${cj(this.g)}${cj(this.b)}${cj(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ij,toString:ij})),zC(fj,function(e,t,n,r){return 1===arguments.length?dj(e):new fj(e,t,n,null==r?1:r)},PC(RC,{brighter(e){return e=null==e?BC:Math.pow(BC,e),new fj(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?UC:Math.pow(UC,e),new fj(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new oj(hj(e>=240?e-240:e+120,o,r),hj(e,o,r),hj(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new fj(pj(this.h),mj(this.s),mj(this.l),sj(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=sj(this.opacity);return`${1===e?"hsl(":"hsla("}${pj(this.h)}, ${100*mj(this.s)}%, ${100*mj(this.l)}%${1===e?")":`, ${e})`}`}}));const wj=e=>()=>e;function yj(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):wj(isNaN(e)?t:e)}const bj=function e(t){var n=function(e){return 1===(e=+e)?yj:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):wj(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=rj(e)).r,(t=rj(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=yj(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function vj(e){return function(t){var n,r,o=t.length,a=new Array(o),i=new Array(o),s=new Array(o);for(n=0;n<o;++n)r=rj(t[n]),a[n]=r.r||0,i[n]=r.g||0,s[n]=r.b||0;return a=e(a),i=e(i),s=e(s),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=s(e),r+""}}}vj(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,s=r<t-1?e[r+2]:2*a-o;return gj((n-r/t)*t,i,o,a,s)}}),vj(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],s=e[(r+2)%t];return gj((n-r/t)*t,o,a,i,s)}});var xj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nj=new RegExp(xj.source,"g");function Ej(e,t){var n,r,o,a=xj.lastIndex=Nj.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=xj.exec(e))&&(r=Nj.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,l.push({i,x:MC(n,r)})),a=Nj.lastIndex;return a<t.length&&(o=t.slice(a),s[i]?s[i]+=o:s[++i]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function _j(e,t){var n;return("number"==typeof t?MC:t instanceof ej?bj:(n=ej(t))?(t=n,bj):Ej)(e,t)}function Mj(e){return function(){this.removeAttribute(e)}}function Ij(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Sj(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===r?o:o=t(r=i,n)}}function kj(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===r?o:o=t(r=i,n)}}function Dj(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttribute(e)}}function Cj(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttributeNS(e.space,e.local)}}function jj(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Aj(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Tj(e,t){return function(){xC(this,e).delay=+t.apply(this,arguments)}}function Lj(e,t){return t=+t,function(){xC(this,e).delay=t}}function Oj(e,t){return function(){NC(this,e).duration=+t.apply(this,arguments)}}function zj(e,t){return t=+t,function(){NC(this,e).duration=t}}var Pj=zD.prototype.constructor;function Rj(e){return function(){this.style.removeProperty(e)}}var Uj=0;function Bj(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Fj(){return++Uj}var Qj=zD.prototype;Bj.prototype=function(e){return zD().transition(e)}.prototype={constructor:Bj,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Ik(e));for(var r=this._groups,o=r.length,a=new Array(o),i=0;i<o;++i)for(var s,l,c=r[i],u=c.length,d=a[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,vC(d[f],t,n,f,d,EC(s,n)));return new Bj(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=kk(e));for(var r=this._groups,o=r.length,a=[],i=[],s=0;s<o;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),m=EC(l,n),h=0,g=p.length;h<g;++h)(f=p[h])&&vC(f,t,n,h,p,m);a.push(p),i.push(l)}return new Bj(a,i,t,n)},selectChild:Qj.selectChild,selectChildren:Qj.selectChildren,filter:function(e){"function"!=typeof e&&(e=Dk(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new Bj(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,a=Math.min(r,o),i=new Array(r),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<r;++s)i[s]=t[s];return new Bj(i,this._parents,this._name,this._id)},selection:function(){return new Pj(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Fj(),r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=EC(i,t);vC(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Bj(r,this._parents,e,n)},call:Qj.call,nodes:Qj.nodes,node:Qj.node,size:Qj.size,empty:Qj.empty,each:Qj.each,on:function(e,t){var n=this._id;return arguments.length<2?EC(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?xC:NC;return function(){var i=a(this,e),s=i.on;s!==r&&(o=(r=s).copy()).on(t,n),i.on=o}}(n,e,t))},attr:function(e,t){var n=Yk(e),r="transform"===n?AC:_j;return this.attrTween(e,"function"==typeof t?(n.local?Cj:Dj)(n,r,OC(this,"attr."+e,t)):null==t?(n.local?Ij:Mj)(n):(n.local?kj:Sj)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=Yk(e);return this.tween(n,(r.local?jj:Aj)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?jC:_j;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var a=tD(this,e),i=(this.style.removeProperty(e),tD(this,e));return a===i?null:a===n&&i===r?o:o=t(n=a,r=i)}}(e,r)).on("end.style."+e,Rj(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,a;return function(){var i=tD(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=tD(this,e)),i===l?null:i===r&&l===o?a:(o=l,a=t(r=i,s))}}(e,r,OC(this,"style."+e,t))).each(function(e,t){var n,r,o,a,i="style."+t,s="end."+i;return function(){var l=NC(this,e),c=l.on,u=null==l.value[i]?a||(a=Rj(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,a=n+"";return function(){var i=tD(this,e);return i===a?null:i===r?o:o=t(r=i,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function a(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(OC(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=EC(this.node(),n).tween,a=0,i=o.length;a<i;++a)if((r=o[a]).name===e)return r.value;return null}return this.each((null==t?TC:LC)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Tj:Lj)(t,e)):EC(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Oj:zj)(t,e)):EC(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){NC(this,e).ease=t}}(t,e)):EC(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;NC(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--o&&a()}};n.each(function(){var n=NC(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===o&&a()})},[Symbol.iterator]:Qj[Symbol.iterator]};var Vj={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Yj(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}zD.prototype.interrupt=function(e){return this.each(function(){_C(this,e)})},zD.prototype.transition=function(e){var t,n;e instanceof Bj?(t=e._id,e=e._name):(t=Fj(),(n=Vj).time=uC(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)(i=s[c])&&vC(i,e,t,c,s,n||Yj(i,t));return new Bj(r,this._parents,e,t)};const Zj=e=>()=>e;function Wj(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Gj(e,t,n){this.k=e,this.x=t,this.y=n}Gj.prototype={constructor:Gj,scale:function(e){return 1===e?this:new Gj(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Gj(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Hj=new Gj(1,0,0);function $j(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Hj;return e.__zoom}function Xj(e){e.stopImmediatePropagation()}function qj(e){e.preventDefault(),e.stopImmediatePropagation()}function Jj(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Kj(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function eA(){return this.__zoom||Hj}function tA(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nA(){return navigator.maxTouchPoints||"ontouchstart"in this}function rA(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}function oA(){var e,t,n,r=Jj,o=Kj,a=rA,i=tA,s=nA,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=KD,f=_k("start","zoom","end"),p=0,m=10;function h(e){e.property("__zoom",eA).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",S).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new Gj(t,e.x,e.y)}function w(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new Gj(e.k,r,o)}function y(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){v(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){v(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,a=arguments,i=v(e,a).event(r),s=o.apply(e,a),l=null==n?y(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new Gj(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function v(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function N(e,...t){if(r.apply(this,arguments)){var n=v(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,i.apply(this,arguments)))),u=RD(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],_C(this),n.start()}qj(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(w(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function E(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,i=v(this,t,!0).event(e),s=PD(e.view).on("mousemove.zoom",function(e){if(qj(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>p}i.event(e).zoom("mouse",a(w(i.that.__zoom,i.mouse[0]=RD(e,o),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),YD(e.view,i.moved),qj(e),i.event(e).end()},!0),l=RD(e,o),u=e.clientX,d=e.clientY;VD(e.view),Xj(e),i.mouse=[l,this.__zoom.invert(l)],_C(this),i.start()}}function _(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,i=RD(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=a(w(g(n,l),i,s),o.apply(this,t),c);qj(e),u>0?PD(this).transition().duration(u).call(b,d,i,e):PD(this).call(h.transform,d,i,e)}}function M(n,...o){if(r.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=v(this,o,n.changedTouches.length===u).event(n);for(Xj(n),i=0;i<u;++i)l=[l=RD(s=c[i],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,a=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),a&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),_C(this),d.start())}}function I(e,...t){if(this.__zooming){var n,r,o,i,s=v(this,t).event(e),l=e.changedTouches,u=l.length;for(qj(e),n=0;n<u;++n)o=RD(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],m=s.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,y=(y=m[0]-f[0])*y+(y=m[1]-f[1])*y;r=g(r,Math.sqrt(h/y)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(w(r,o,i),s.extent,c))}}function S(e,...r){if(this.__zooming){var o,a,i=v(this,r).event(e),s=e.changedTouches,l=s.length;for(Xj(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)a=s[o],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=RD(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<m)){var c=PD(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return h.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",eA),e!==o?b(e,t,n,r):o.interrupt().each(function(){v(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},h.scaleBy=function(e,t,n,r){h.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},h.scaleTo=function(e,t,n,r){h.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,i=null==n?y(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(w(g(r,l),i,s),e,c)},n,r)},h.translateBy=function(e,t,n,r){h.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},h.translateTo=function(e,t,n,r,i){h.transform(e,function(){var e=o.apply(this,arguments),i=this.__zoom,s=null==r?y(e):"function"==typeof r?r.apply(this,arguments):r;return a(Hj.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=PD(this.that).datum();f.call(e,this.that,new Wj(e,{sourceEvent:this.sourceEvent,target:h,type:e,transform:this.that.__zoom,dispatch:f}),t)}},h.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:Zj(+e),h):i},h.filter=function(e){return arguments.length?(r="function"==typeof e?e:Zj(!!e),h):r},h.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Zj(!!e),h):s},h.extent=function(e){return arguments.length?(o="function"==typeof e?e:Zj([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),h):o},h.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],h):[l[0],l[1]]},h.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],h):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},h.constrain=function(e){return arguments.length?(a=e,h):a},h.duration=function(e){return arguments.length?(u=+e,h):u},h.interpolate=function(e){return arguments.length?(d=e,h):d},h.on=function(){var e=f.on.apply(f,arguments);return e===f?h:e},h.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,h):Math.sqrt(p)},h.tapDistance=function(e){return arguments.length?(m=+e,h):m},h}function aA(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=new Array(o),i=new Array(r);for(n=0;n<o;++n)a[n]=cA(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}function iA(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function sA(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=cA(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}function lA(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}}function cA(e,t){var n,r=typeof t;return null==t||"boolean"===r?wj(t):("number"===r?MC:"string"===r?(n=ej(t))?(t=n,bj):Ej:t instanceof ej?bj:t instanceof Date?iA:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?lA:Array.isArray(t)?aA:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?sA:MC)(e,t)}$j.prototype=Gj.prototype;const uA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],dA=["Enter"," ","Escape"],fA={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var pA,mA,hA;!function(e){e.Strict="strict",e.Loose="loose"}(pA||(pA={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(mA||(mA={})),function(e){e.Partial="partial",e.Full="full"}(hA||(hA={}));const gA={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var wA,yA,bA;!function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(wA||(wA={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(yA||(yA={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(bA||(bA={}));const vA={[bA.Left]:bA.Right,[bA.Right]:bA.Left,[bA.Top]:bA.Bottom,[bA.Bottom]:bA.Top};function xA(e){return null===e?null:e?"valid":"invalid"}const NA=e=>"id"in e&&"source"in e&&"target"in e,EA=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_A=(e,t=[0,0])=>{const{width:n,height:r}=XA(e),o=e.origin??t,a=n*o[0],i=r*o[1];return{x:e.position.x-a,y:e.position.y-i}},MA=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=TA(n,PA(e)),r=!0)}),r?OA(n):{x:0,y:0,width:0,height:0}},IA=(e,t,[n,r,o]=[0,0,1],a=!1,i=!1)=>{const s={...YA(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const t of e.values()){const{measured:e,selectable:n=!0,hidden:r=!1}=t;if(i&&!n||r)continue;const o=e.width??t.width??t.initialWidth??null,c=e.height??t.height??t.initialHeight??null,u=UA(s,zA(t)),d=(o??0)*(c??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&l.push(t)}return l};function SA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:a}){const i=n.get(e),s=i.parentId?n.get(i.parentId):void 0,{x:l,y:c}=s?s.internals.positionAbsolute:{x:0,y:0},u=i.origin??r;let d=i.extent||o;if("parent"!==i.extent||i.expandParent)s&&$A(i.extent)&&(d=[[i.extent[0][0]+l,i.extent[0][1]+c],[i.extent[1][0]+l,i.extent[1][1]+c]]);else if(s){const e=s.measured.width,t=s.measured.height;e&&t&&(d=[[l,c],[l+e,c+t]])}else a?.("005","Only child nodes can use a parent extent.");const f=$A(d)?DA(t,d,i.measured):t;return void 0!==i.measured.width&&void 0!==i.measured.height||a?.("015","It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."),{position:{x:f.x-l+(i.measured.width??0)*u[0],y:f.y-c+(i.measured.height??0)*u[1]},positionAbsolute:f}}const kA=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),DA=(e={x:0,y:0},t,n)=>({x:kA(e.x,t[0][0],t[1][0]-(n?.width??0)),y:kA(e.y,t[0][1],t[1][1]-(n?.height??0))});function CA(e,t,n){const{width:r,height:o}=XA(n),{x:a,y:i}=n.internals.positionAbsolute;return DA(e,[[a,i],[a+r,i+o]],t)}const jA=(e,t,n)=>e<t?kA(Math.abs(e-t),1,t)/t:e>n?-kA(Math.abs(e-n),1,t)/t:0,AA=(e,t,n=15,r=40)=>[jA(e.x,r,t.width-r)*n,jA(e.y,r,t.height-r)*n],TA=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),LA=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),OA=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),zA=(e,t=[0,0])=>{const{x:n,y:r}=EA(e)?e.internals.positionAbsolute:_A(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},PA=(e,t=[0,0])=>{const{x:n,y:r}=EA(e)?e.internals.positionAbsolute:_A(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},RA=(e,t)=>OA(TA(LA(e),LA(t))),UA=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},BA=e=>FA(e.width)&&FA(e.height)&&FA(e.x)&&FA(e.y),FA=e=>!isNaN(e)&&isFinite(e),QA=(e,t)=>{},VA=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),YA=({x:e,y:t},[n,r,o],a=!1,i=[1,1])=>{const s={x:(e-n)/o,y:(t-r)/o};return a?VA(s,i):s},ZA=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function WA(e,t){if("number"==typeof e)return Math.floor(.5*(t-t/(1+e)));if("string"==typeof e&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}const GA=(e,t,n,r,o,a)=>{const i=function(e,t,n){if("string"==typeof e||"number"==typeof e){const r=WA(e,n),o=WA(e,t);return{top:r,right:o,bottom:r,left:o,x:2*o,y:2*r}}if("object"==typeof e){const r=WA(e.top??e.y??0,n),o=WA(e.bottom??e.y??0,n),a=WA(e.left??e.x??0,t),i=WA(e.right??e.x??0,t);return{top:r,right:i,bottom:o,left:a,x:a+i,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(a,t,n),s=(t-i.x)/e.width,l=(n-i.y)/e.height,c=Math.min(s,l),u=kA(c,r,o),d=t/2-(e.x+e.width/2)*u,f=n/2-(e.y+e.height/2)*u,p=function(e,t,n,r,o,a){const{x:i,y:s}=ZA(e,[t,n,r]),{x:l,y:c}=ZA({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=o-l,d=a-c;return{left:Math.floor(i),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}(e,d,f,u,t,n),m=Math.min(p.left-i.left,0),h=Math.min(p.top-i.top,0);return{x:d-m+Math.min(p.right-i.right,0),y:f-h+Math.min(p.bottom-i.bottom,0),zoom:u}},HA=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function $A(e){return null!=e&&"parent"!==e}function XA(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function qA(e){return void 0!==(e.measured?.width??e.width??e.initialWidth)&&void 0!==(e.measured?.height??e.height??e.initialHeight)}function JA(e,t={width:0,height:0},n,r,o){const a={...e},i=r.get(n);if(i){const e=i.origin||o;a.x+=i.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=i.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function KA(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function eT(e){return{...fA,...e||{}}}function tT(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:a,y:i}=sT(e),s=YA({x:a-(o?.left??0),y:i-(o?.top??0)},r),{x:l,y:c}=n?VA(s,t):s;return{xSnapped:l,ySnapped:c,...s}}const nT=e=>({width:e.offsetWidth,height:e.offsetHeight}),rT=e=>e?.getRootNode?.()||window?.document,oT=["INPUT","SELECT","TEXTAREA"];function aT(e){const t=e.composedPath?.()?.[0]||e.target;return 1===t?.nodeType&&(oT.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}const iT=e=>"clientX"in e,sT=(e,t)=>{const n=iT(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},lT=(e,t,n,r,o)=>{const a=t.querySelectorAll(`.${e}`);return a&&a.length?Array.from(a).map(t=>{const a=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:o,position:t.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...nT(t)}}):null};function cT({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*o+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}function uT(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function dT({pos:e,x1:t,y1:n,x2:r,y2:o,c:a}){switch(e){case bA.Left:return[t-uT(t-r,a),n];case bA.Right:return[t+uT(r-t,a),n];case bA.Top:return[t,n-uT(n-o,a)];case bA.Bottom:return[t,n+uT(o-n,a)]}}function fT({sourceX:e,sourceY:t,sourcePosition:n=bA.Bottom,targetX:r,targetY:o,targetPosition:a=bA.Top,curvature:i=.25}){const[s,l]=dT({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=dT({pos:a,x1:r,y1:o,x2:e,y2:t,c:i}),[d,f,p,m]=cT({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,f,p,m]}function pT({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,a=n<e?n+o:n-o,i=Math.abs(r-t)/2;return[a,r<t?r+i:r-i,o,i]}function mT({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const a=TA(PA(e),PA(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const i={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return UA(i,OA(a))>0}const hT=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,gT=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||hT;let o;return o=NA(e)?{...e}:{...e,id:r(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(o,t)?t:(null===o.sourceHandle&&delete o.sourceHandle,null===o.targetHandle&&delete o.targetHandle,t.concat(o))};function wT({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,a,i,s]=pT({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,a,i,s]}const yT={[bA.Left]:{x:-1,y:0},[bA.Right]:{x:1,y:0},[bA.Top]:{x:0,y:-1},[bA.Bottom]:{x:0,y:1}},bT=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function vT(e,t,n,r){const o=Math.min(bT(e,t)/2,bT(t,n)/2,r),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i)return`L ${a+o*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+o*(e.y<n.y?-1:1)}Q ${a},${i} ${a+o*s},${i}`}function xT({sourceX:e,sourceY:t,sourcePosition:n=bA.Bottom,targetX:r,targetY:o,targetPosition:a=bA.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,p,m,h]=function({source:e,sourcePosition:t=bA.Bottom,target:n,targetPosition:r=bA.Top,center:o,offset:a,stepPosition:i}){const s=yT[t],l=yT[r],c={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+l.x*a,y:n.y+l.y*a},d=(({source:e,sourcePosition:t=bA.Bottom,target:n})=>t===bA.Left||t===bA.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:c,sourcePosition:t,target:u}),f=0!==d.x?"x":"y",p=d[f];let m,h,g=[];const w={x:0,y:0},y={x:0,y:0},[,,b,v]=pT({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){"x"===f?(m=o.x??c.x+(u.x-c.x)*i,h=o.y??(c.y+u.y)/2):(m=o.x??(c.x+u.x)/2,h=o.y??c.y+(u.y-c.y)*i);const e=[{x:m,y:c.y},{x:m,y:u.y}],t=[{x:c.x,y:h},{x:u.x,y:h}];g=s[f]===p?"x"===f?e:t:"x"===f?t:e}else{const o=[{x:c.x,y:u.y}],i=[{x:u.x,y:c.y}];if(g="x"===f?s.x===p?i:o:s.y===p?o:i,t===r){const t=Math.abs(e[f]-n[f]);if(t<=a){const r=Math.min(a-1,a-t);s[f]===p?w[f]=(c[f]>e[f]?-1:1)*r:y[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){const e="x"===f?"y":"x",t=s[f]===l[e],n=c[e]>u[e],r=c[e]<u[e];(1===s[f]&&(!t&&n||t&&r)||1!==s[f]&&(!t&&r||t&&n))&&(g="x"===f?o:i)}const d={x:c.x+w.x,y:c.y+w.y},b={x:u.x+y.x,y:u.y+y.y};Math.max(Math.abs(d.x-g[0].x),Math.abs(b.x-g[0].x))>=Math.max(Math.abs(d.y-g[0].y),Math.abs(b.y-g[0].y))?(m=(d.x+b.x)/2,h=g[0].y):(m=g[0].x,h=(d.y+b.y)/2)}const x={x:c.x+w.x,y:c.y+w.y},N={x:u.x+y.x,y:u.y+y.y};return[[e,...x.x!==g[0].x||x.y!==g[0].y?[x]:[],...g,...N.x!==g[g.length-1].x||N.y!==g[g.length-1].y?[N]:[],n],m,h,b,v]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:a,center:{x:s,y:l},offset:c,stepPosition:u});let g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=vT(d[e-1],d[e],d[e+1],i);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function NT(e){return e&&!(!e.internals.handleBounds&&!e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function ET(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function _T(e,t,n=bA.Left,r=!1){const o=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:i,height:s}=t??XA(e);if(r)return{x:o+i/2,y:a+s/2};switch(t?.position??n){case bA.Top:return{x:o+i/2,y:a};case bA.Right:return{x:o+i,y:a+s/2};case bA.Bottom:return{x:o+i/2,y:a+s};case bA.Left:return{x:o,y:a+s/2}}}function MT(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function IT(e,t){return e?"string"==typeof e?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`:""}const ST={nodeOrigin:[0,0],nodeExtent:uA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},kT={...ST,checkEquality:!0};function DT(e,t){const n={...e};for(const e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function CT(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],r=[];for(const t of e.handles){const o={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(o):"target"===t.type&&r.push(o)}return{source:n,target:r}}function jT(e){return"manual"===e}function AT(e,t,n,r={}){const o=DT(kT,r),a={i:0},i=new Map(t),s=o?.elevateNodesOnSelect&&!jT(o.zIndexMode)?1e3:0;let l=e.length>0,c=!1;t.clear(),n.clear();for(const u of e){let e=i.get(u.id);if(o.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{const n=_A(u,o.nodeOrigin),r=$A(u.extent)?u.extent:o.nodeExtent,a=DA(n,r,XA(u));e={...o.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:a,handleBounds:CT(u,e),z:LT(u,s,o.zIndexMode),userNode:u}},t.set(u.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(l=!1),u.parentId&&TT(e,t,n,r,a),c||=u.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function TT(e,t,n,r,o){const{elevateNodesOnSelect:a,nodeOrigin:i,nodeExtent:s,zIndexMode:l}=DT(ST,r),c=e.parentId,u=t.get(c);if(!u)return void console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),o&&!u.parentId&&void 0===u.internals.rootParentIndex&&"auto"===l&&(u.internals.rootParentIndex=++o.i,u.internals.z=u.internals.z+10*o.i),o&&void 0!==u.internals.rootParentIndex&&(o.i=u.internals.rootParentIndex);const d=a&&!jT(l)?1e3:0,{x:f,y:p,z:m}=function(e,t,n,r,o,a){const{x:i,y:s}=t.internals.positionAbsolute,l=XA(e),c=_A(e,n),u=$A(e.extent)?DA(c,e.extent,l):c;let d=DA({x:i+u.x,y:s+u.y},r,l);"parent"===e.extent&&(d=CA(d,l,t));const f=LT(e,o,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}(e,u,i,s,d,l),{positionAbsolute:h}=e.internals,g=f!==h.x||p!==h.y;(g||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:f,y:p}:h,z:m}})}function LT(e,t,n){const r=FA(e.zIndex)?e.zIndex:0;return jT(n)?r:r+(e.selected?t:0)}function OT(e,t,n,r=[0,0]){const o=[],a=new Map;for(const n of e){const e=t.get(n.parentId);if(!e)continue;const r=a.get(n.parentId)?.expandedRect??zA(e),o=RA(r,n.rect);a.set(n.parentId,{expandedRect:o,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},i)=>{const s=a.internals.positionAbsolute,l=XA(a),c=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(l.width,Math.round(t.width)),p=Math.max(l.height,Math.round(t.height)),m=(f-l.width)*c[0],h=(p-l.height)*c[1];(u>0||d>0||m||h)&&(o.push({id:i,type:"position",position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(i)?.forEach(t=>{e.some(e=>e.id===t.id)||o.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})})),(l.width<t.width||l.height<t.height||u||d)&&o.push({id:i,type:"dimensions",setAttributes:!0,dimensions:{width:f+(u?c[0]*u-m:0),height:p+(d?c[1]*d-h:0)}})}),o}function zT(e,t,n,r,o,a){let i=o;const s=r.get(i)||new Map;r.set(i,s.set(n,t)),i=`${o}-${e}`;const l=r.get(i)||new Map;if(r.set(i,l.set(n,t)),a){i=`${o}-${e}-${a}`;const s=r.get(i)||new Map;r.set(i,s.set(n,t))}}function PT(e,t,n){e.clear(),t.clear();for(const r of n){const{source:n,target:o,sourceHandle:a=null,targetHandle:i=null}=r,s={edgeId:r.id,source:n,target:o,sourceHandle:a,targetHandle:i},l=`${n}-${a}--${o}-${i}`;zT("source",s,`${o}-${i}--${n}-${a}`,e,n,a),zT("target",s,l,e,o,i),t.set(r.id,r)}}function RT(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return!!n&&(!!n.selected||RT(n,t))}function UT(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function BT({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){const o=[];for(const[e,a]of t){const t=n.get(e)?.internals.userNode;t&&o.push({...t,position:a.position,dragging:r})}if(!e)return[o[0],o];const a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:o[0],o]}function FT(e,t,n,r,o,a=!1){const i=r.get(e);if(!i)return null;const s="strict"===o?i.internals.handleBounds?.[t]:[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]],l=(n?s?.find(e=>e.id===n):s?.[0])??null;return l&&a?{...l,..._T(i,l,l.position,!0)}:l}function QT(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}const VT=()=>!0;function YT(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:a,doc:i,lib:s,flowId:l,isValidConnection:c=VT,nodeLookup:u}){const d="target"===a,f=t?i.querySelector(`.${s}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=sT(e),h=i.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,w={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const e=QT(void 0,g),t=g.getAttribute("data-nodeid"),a=g.getAttribute("data-handleid"),i=g.classList.contains("connectable"),s=g.classList.contains("connectableend");if(!t||!e)return w;const l={source:d?t:r,sourceHandle:d?a:o,target:d?r:t,targetHandle:d?o:a};w.connection=l;const f=i&&s&&(n===pA.Strict?d&&"source"===e||!d&&"target"===e:t!==r||a!==o);w.isValid=f&&c(l),w.toHandle=FT(t,e,a,u,n,!0)}return w}const ZT={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:a,isTarget:i,domNode:s,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:w=VT,onReconnectEnd:y,updateConnection:b,getTransform:v,getFromHandle:x,autoPanSpeed:N,dragThreshold:E=1,handleDomNode:_}){const M=rT(e.target);let I,S=0;const{x:k,y:D}=sT(e),C=QT(a,_),j=s?.getBoundingClientRect();let A=!1;if(!j||!C)return;const T=FT(o,C,r,l,t);if(!T)return;let L=sT(e,j),O=!1,z=null,P=!1,R=null;function U(){if(!u||!j)return;const[e,t]=AA(L,j,N);f({x:e,y:t}),S=requestAnimationFrame(U)}const B={...T,nodeId:o,type:C,position:T.position},F=l.get(o);let Q={inProgress:!0,isValid:null,from:_T(F,B,bA.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:F,to:L,toHandle:null,toPosition:vA[B.position],toNode:null,pointer:L};function V(){A=!0,b(Q),m?.(e,{nodeId:o,handleId:r,handleType:C})}function Y(e){if(!A){const{x:t,y:n}=sT(e),r=t-k,o=n-D;if(!(r*r+o*o>E*E))return;V()}if(!x()||!B)return void Z(e);const a=v();L=sT(e,j),I=function(e,t,n,r){let o=[],a=1/0;const i=function(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(const e of t.values())UA(o,zA(e))>0&&r.push(e);return r}(e,n,t+250);for(const n of i){const i=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(const s of i){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;const{x:i,y:l}=_T(n,s,s.position,!0),c=Math.sqrt(Math.pow(i-e.x,2)+Math.pow(l-e.y,2));c>t||(c<a?(o=[{...s,x:i,y:l}],a=c):c===a&&o.push({...s,x:i,y:l}))}}if(!o.length)return null;if(o.length>1){const e="source"===r.type?"target":"source";return o.find(t=>t.type===e)??o[0]}return o[0]}(YA(L,a,!1,[1,1]),n,l,B),O||(U(),O=!0);const s=YT(e,{handle:I,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:i?"target":"source",isValidConnection:w,doc:M,lib:c,flowId:d,nodeLookup:l});R=s.handleDomNode,z=s.connection,P=function(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}(!!I,s.isValid);const u=l.get(o),f=u?_T(u,B,bA.Left,!0):Q.from,p={...Q,from:f,isValid:P,to:s.toHandle&&P?ZA({x:s.toHandle.x,y:s.toHandle.y},a):L,toHandle:s.toHandle,toPosition:P&&s.toHandle?s.toHandle.position:vA[B.position],toNode:s.toHandle?l.get(s.toHandle.nodeId):null,pointer:L};b(p),Q=p}function Z(e){if(!("touches"in e&&e.touches.length>0)){if(A){(I||R)&&z&&P&&h?.(z);const{inProgress:t,...n}=Q,r={...n,toPosition:Q.toHandle?Q.toPosition:null};g?.(e,r),a&&y?.(e,r)}p(),cancelAnimationFrame(S),O=!1,P=!1,z=null,R=null,M.removeEventListener("mousemove",Y),M.removeEventListener("mouseup",Z),M.removeEventListener("touchmove",Y),M.removeEventListener("touchend",Z)}}0===E&&V(),M.addEventListener("mousemove",Y),M.addEventListener("mouseup",Z),M.addEventListener("touchmove",Y),M.addEventListener("touchend",Z)},isValid:YT},WT=e=>({x:e.x,y:e.y,zoom:e.k}),GT=({x:e,y:t,zoom:n})=>Hj.translate(e,t).scale(n),HT=(e,t)=>e.target.closest(`.${t}`),$T=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),XT=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,qT=(e,t=0,n=XT,r=()=>{})=>{const o="number"==typeof t&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},JT=e=>{const t=e.ctrlKey&&HA()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function KT({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:a,onPanZoomStart:i,onPanZoomEnd:s,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=oA().scaleExtent([t,n]).translateExtent(r),f=PD(e).call(d);w({x:o.x,y:o.y,zoom:kA(o.zoom,t,n)},[[0,0],[u.width,u.height]],r);const p=f.on("wheel.zoom"),m=f.on("dblclick.zoom");function h(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?cA:KD).transform(qT(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function g(){d.on("zoom",null)}async function w(e,t,n){const r=GT(e),o=d?.constrain()(r,t,n);return o&&await h(o),new Promise(e=>e(o))}return d.wheelDelta(JT),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:o,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:w,preventScrolling:y,zoomOnPinch:b,zoomOnScroll:v,zoomOnDoubleClick:x,zoomActivationKeyPressed:N,lib:E,onTransformChange:_,connectionInProgress:M,paneClickDistance:I,selectionOnDrag:S}){r&&!c.isZoomingOrPanning&&g();const k=o&&!N&&!r;d.clickDistance(S?1/0:!FA(I)||I<0?0:I);const D=k?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:i,onPanZoomStart:s,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(HT(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&i){const e=RD(u),t=JT(u),o=d*Math.pow(2,t);return void r.scaleTo(n,o,e,u)}const f=1===u.deltaMode?20:1;let p=o===mA.Vertical?0:u.deltaX*f,m=o===mA.Horizontal?0:u.deltaY*f;!HA()&&u.shiftKey&&o!==mA.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-p/d*a,-m/d*a,{internal:!0});const h=WT(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,h),e.panScrollTimeout=setTimeout(()=>{c?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}({zoomPanValues:c,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:w,zoomOnPinch:b,onPanZoomStart:i,onPanZoom:a,onPanZoomEnd:s}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const a="wheel"===r.type,i=!t&&a&&!r.ctrlKey,s=HT(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),i||s)return null;r.preventDefault(),n.call(this,r,o)}}({noWheelClassName:e,preventScrolling:y,d3ZoomHandler:p});if(f.on("wheel.zoom",D,{passive:!1}),!r){const e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;const o=WT(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,"mousedown"===r.sourceEvent?.type&&t(!0),n&&n?.(r.sourceEvent,o)}}({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:i});d.on("start",e);const t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return a=>{e.usedRightMouseButton=!(!n||!$T(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),o&&!a.sourceEvent?.internal&&o?.(a.sourceEvent,WT(a.transform))}}({zoomPanValues:c,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:_});d.on("zoom",t);const r=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:a}){return i=>{if(!i.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&$T(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&a(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const t=WT(i.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(i.sourceEvent,t)},n?150:0)}}}({zoomPanValues:c,panOnDrag:u,panOnScroll:o,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:l});d.on("end",r)}const C=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:i,noWheelClassName:s,noPanClassName:l,lib:c,connectionInProgress:u}){return d=>{const f=e||t,p=n&&d.ctrlKey,m="wheel"===d.type;if(1===d.button&&"mousedown"===d.type&&(HT(d,`${c}-flow__node`)||HT(d,`${c}-flow__edge`)))return!0;if(!(r||f||o||a||n))return!1;if(i)return!1;if(u&&!m)return!1;if(HT(d,s)&&m)return!1;if(HT(d,l)&&(!m||o&&m&&!e))return!1;if(!n&&d.ctrlKey&&m)return!1;if(!n&&"touchstart"===d.type&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!o&&!p&&m)return!1;if(!r&&("mousedown"===d.type||"touchstart"===d.type))return!1;if(Array.isArray(r)&&!r.includes(d.button)&&"mousedown"===d.type)return!1;const h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}({zoomActivationKeyPressed:N,panOnDrag:u,zoomOnScroll:v,panOnScroll:o,zoomOnDoubleClick:x,zoomOnPinch:b,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:E,connectionInProgress:M});d.filter(C),x?f.on("dblclick.zoom",m):f.on("dblclick.zoom",null)},destroy:g,setViewport:async function(e,t){const n=GT(e);return await h(n,t),new Promise(e=>e(n))},setViewportConstrained:w,getViewport:function(){const e=f?$j(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?cA:KD).scaleTo(qT(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?cA:KD).scaleBy(qT(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){d?.scaleExtent(e)},setTranslateExtent:function(e){d?.translateExtent(e)},syncViewport:function(e){if(f){const t=GT(e),n=f.property("__zoom");n.k===e.zoom&&n.x===e.x&&n.y===e.y||d?.transform(f,t,null,{sync:!0})}},setClickDistance:function(e){const t=!FA(e)||e<0?0:e;d?.clickDistance(t)}}}var eL;function tL(e){return{isHorizontal:e.includes("right")||e.includes("left"),isVertical:e.includes("bottom")||e.includes("top"),affectsX:e.includes("left"),affectsY:e.includes("top")}}function nL(e,t){return Math.max(0,t-e)}function rL(e,t){return Math.max(0,e-t)}function oL(e,t,n){return Math.max(0,t-e,e-n)}function aL(e,t){return e?!t:t}!function(e){e.Line="line",e.Handle="handle"}(eL||(eL={}));const iL={width:0,height:0,x:0,y:0},sL={...iL,pointerX:0,pointerY:0,aspectRatio:1};function lL(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,a=e.measured.width??0,i=e.measured.height??0,s=n[0]*a,l=n[1]*i;return[[r-s,o-l],[r+a-s,o+i-l]]}function cL(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=cL(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var uL=n(9242);const dL=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(r,o,a);return a},{useDebugValue:fL}=s,{useSyncExternalStoreWithSelector:pL}=uL,mL=e=>e;function hL(e,t=mL,n){const r=pL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return fL(r),r}const gL=(e,t)=>{const n=(e=>e?dL(e):dL)(e),r=(e,r=t)=>hL(n,e,r);return Object.assign(r,n),r};function wL(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const yL=(0,s.createContext)(null),bL=yL.Provider,vL="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function xL(e,t){const n=(0,s.useContext)(yL);if(null===n)throw new Error(vL);return hL(n,e,t)}function NL(){const e=(0,s.useContext)(yL);if(null===e)throw new Error(vL);return(0,s.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const EL={display:"none"},_L={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ML="react-flow__node-desc",IL="react-flow__edge-desc",SL=e=>e.ariaLiveMessage,kL=e=>e.ariaLabelConfig;function DL({rfId:e}){const t=xL(SL);return(0,j.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_L,children:t})}function CL({rfId:e,disableKeyboardA11y:t}){const n=xL(kL);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{id:`${ML}-${e}`,style:EL,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,j.jsx)("div",{id:`${IL}-${e}`,style:EL,children:n["edge.a11yDescription.default"]}),!t&&(0,j.jsx)(DL,{rfId:e})]})}const jL=(0,s.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...o},a)=>{const i=`${e}`.split("-");return(0,j.jsx)("div",{className:cL(["react-flow__panel",n,...i]),style:r,ref:a,...o,children:t})});function AL({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,j.jsx)(jL,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:(0,j.jsx)("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}jL.displayName="Panel";const TL=e=>{const t=[],n=[];for(const[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(const[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},LL=e=>e.id;function OL(e,t){return wL(e.selectedNodes.map(LL),t.selectedNodes.map(LL))&&wL(e.selectedEdges.map(LL),t.selectedEdges.map(LL))}function zL({onSelectionChange:e}){const t=NL(),{selectedNodes:n,selectedEdges:r}=xL(TL,OL);return(0,s.useEffect)(()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChangeHandlers.forEach(e=>e(o))},[n,r,e]),null}const PL=e=>!!e.onSelectionChangeHandlers;function RL({onSelectionChange:e}){const t=xL(PL);return e||t?(0,j.jsx)(zL,{onSelectionChange:e}):null}const UL="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,BL=[0,0],FL={x:0,y:0,zoom:1},QL=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],VL=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),YL={translateExtent:uA,nodeOrigin:BL,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ZL(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:c}=xL(VL,wL),u=NL();UL(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=YL,l()}),[]);const d=(0,s.useRef)(YL);return UL(()=>{for(const s of QL){const l=e[s];l!==d.current[s]&&void 0!==e[s]&&("nodes"===s?t(l):"edges"===s?n(l):"minZoom"===s?r(l):"maxZoom"===s?o(l):"translateExtent"===s?a(l):"nodeExtent"===s?i(l):"ariaLabelConfig"===s?u.setState({ariaLabelConfig:eT(l)}):"fitView"===s?u.setState({fitViewQueued:l}):"fitViewOptions"===s?u.setState({fitViewOptions:l}):u.setState({[s]:l}))}d.current=e},QL.map(t=>e[t])),null}function WL(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}const GL="undefined"!=typeof document?document:null;function HL(e=null,t={target:GL,actInsideInputWithModifier:!0}){const[n,r]=(0,s.useState)(!1),o=(0,s.useRef)(!1),a=(0,s.useRef)(new Set([])),[i,l]=(0,s.useMemo)(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,s.useEffect)(()=>{const n=t?.target??GL,s=t?.actInsideInputWithModifier??!0;if(null!==e){const e=e=>{if(o.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!o.current||o.current&&!s)&&aT(e))return!1;const n=XL(e.code,l);if(a.current.add(e[n]),$L(i,a.current,!1)){const n=e.composedPath?.()?.[0]||e.target,a="BUTTON"===n?.nodeName||"A"===n?.nodeName;!1===t.preventDefault||!o.current&&a||e.preventDefault(),r(!0)}},c=e=>{const t=XL(e.code,l);$L(i,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),o.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,r]),n}function $L(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function XL(e,t){return t.includes(e)?"code":"key"}function qL(e,t){const n=[],r=new Map,o=[];for(const t of e)if("add"!==t.type)if("remove"===t.type||"replace"===t.type)r.set(t.id,[t]);else{const e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}else o.push(t);for(const e of t){const t=r.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}const o={...e};for(const e of t)JL(e,o);n.push(o)}return o.length&&o.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function JL(e,t){switch(e.type){case"select":t.selected=e.selected;break;case"position":void 0!==e.position&&(t.position=e.position),void 0!==e.dragging&&(t.dragging=e.dragging);break;case"dimensions":void 0!==e.dimensions&&(t.measured={...e.dimensions},e.setAttributes&&(!0!==e.setAttributes&&"width"!==e.setAttributes||(t.width=e.dimensions.width),!0!==e.setAttributes&&"height"!==e.setAttributes||(t.height=e.dimensions.height))),"boolean"==typeof e.resizing&&(t.resizing=e.resizing)}}function KL(e,t){return qL(e,t)}function eO(e,t){return qL(e,t)}function tO(e,t){return{id:e,type:"select",selected:t}}function nO(e,t=new Set,n=!1){const r=[];for(const[o,a]of e){const e=t.has(o);void 0===a.selected&&!e||a.selected===e||(n&&(a.selected=e),r.push(tO(a.id,e)))}return r}function rO({items:e=[],lookup:t}){const n=[],r=new Map(e.map(e=>[e.id,e]));for(const[r,o]of e.entries()){const e=t.get(o.id),a=e?.internals?.userNode??e;void 0!==a&&a!==o&&n.push({id:o.id,item:o,type:"replace"}),void 0===a&&n.push({item:o,type:"add",index:r})}for(const[e]of t)void 0===r.get(e)&&n.push({id:e,type:"remove"});return n}function oO(e){return{id:e.id,type:"remove"}}const aO=e=>(e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e))(e);function iO(e){return(0,s.forwardRef)(e)}function sO(e){const[t,n]=(0,s.useState)(BigInt(0)),[r]=(0,s.useState)(()=>function(){let e=[];return{get:()=>e,reset:()=>{e=[]},push:t=>{e.push(t),n(e=>e+BigInt(1))}}}());return UL(()=>{const t=r.get();t.length&&(e(t),r.reset())},[t]),r}const lO=(0,s.createContext)(null);function cO({children:e}){const t=NL(),n=(0,s.useCallback)(e=>{const{nodes:n=[],setNodes:r,hasDefaultNodes:o,onNodesChange:a,nodeLookup:i,fitViewQueued:s,onNodesChangeMiddlewareMap:l}=t.getState();let c=n;for(const t of e)c="function"==typeof t?t(c):t;let u=rO({items:c,lookup:i});for(const e of l.values())u=e(u);o&&r(c),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{const{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[]),r=sO(n),o=(0,s.useCallback)(e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:a,edgeLookup:i}=t.getState();let s=n;for(const t of e)s="function"==typeof t?t(s):t;o?r(s):a&&a(rO({items:s,lookup:i}))},[]),a=sO(o),i=(0,s.useMemo)(()=>({nodeQueue:r,edgeQueue:a}),[]);return(0,j.jsx)(lO.Provider,{value:i,children:e})}const uO=e=>!!e.panZoom;function dO(){const e=(()=>{const e=NL();return(0,s.useMemo)(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,a],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:a,maxZoom:i,panZoom:s}=e.getState(),l=GA(t,r,o,a,i,n?.padding??.1);return s?(await s.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:a,domNode:i}=e.getState();if(!i)return t;const{x:s,y:l}=i.getBoundingClientRect(),c={x:t.x-s,y:t.y-l},u=n.snapGrid??o,d=n.snapToGrid??a;return YA(c,r,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:a}=r.getBoundingClientRect(),i=ZA(t,n);return{x:i.x+o,y:i.y+a}}}),[])})(),t=NL(),n=function(){const e=(0,s.useContext)(lO);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),r=xL(uO),o=(0,s.useMemo)(()=>{const e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},o=e=>{n.edgeQueue.push(e)},a=e=>{const{nodeLookup:n,nodeOrigin:r}=t.getState(),o=aO(e)?e:n.get(e.id),a=o.parentId?JA(o.position,o.measured,o.parentId,n,r):o.position,i={...o,position:a,width:o.measured?.width??o.width,height:o.measured?.height??o.height};return zA(i)},i=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){const e="function"==typeof t?t(r):t;return n.replace&&aO(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{o(r=>r.map(r=>{if(r.id===e){const e="function"==typeof t?t(r):t;return n.replace&&NA(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:o,addNodes:e=>{const t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{const t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{const{nodes:e=[],edges:n=[],transform:r}=t.getState(),[o,a,i]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:o,y:a,zoom:i}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{const{nodes:r,edges:o,onNodesDelete:a,onEdgesDelete:i,triggerNodeChanges:s,triggerEdgeChanges:l,onDelete:c,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await async function({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const a=new Set(e.map(e=>e.id)),i=[];for(const e of n){if(!1===e.deletable)continue;const t=a.has(e.id),n=!t&&e.parentId&&i.find(t=>t.id===e.parentId);(t||n)&&i.push(e)}const s=new Set(t.map(e=>e.id)),l=r.filter(e=>!1!==e.deletable),c=((e,t)=>{const n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))})(i,l),u=c;for(const e of l)s.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!o)return{edges:u,nodes:i};const d=await o({nodes:i,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:i}:{edges:[],nodes:[]}:d}({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:o,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){const e=f.map(oO);i?.(f),l(e)}if(m){const e=d.map(oO);a?.(d),s(e)}return(m||p)&&c?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{const o=BA(e),i=o?e:a(e),s=void 0!==r;return i?(r||t.getState().nodes).filter(r=>{const a=t.getState().nodeLookup.get(r.id);if(a&&!o&&(r.id===e.id||!a.internals.positionAbsolute))return!1;const l=zA(s?r:a),c=UA(l,i);return n&&c>0||c>=l.width*l.height||c>=i.width*i.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{const r=BA(e)?e:a(e);if(!r)return!1;const o=UA(r,t);return n&&o>0||o>=t.width*t.height||o>=r.width*r.height},updateNode:i,updateNodeData:(e,t,n={replace:!1})=>{i(e,e=>{const r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{const r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{const{nodeLookup:n,nodeOrigin:r}=t.getState();return((e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const r="string"==typeof n;let o=t.nodeLookup||r?void 0:n;t.nodeLookup&&(o=r?t.nodeLookup.get(n):EA(n)?n:t.nodeLookup.get(n.id));const a=o?PA(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return TA(e,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return OA(n)})(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{const r=t.getState().fitViewResolver??function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,s.useMemo)(()=>({...o,...e,viewportInitialized:r}),[r])}const fO=e=>e.selected,pO="undefined"!=typeof window?window:void 0,mO={position:"absolute",width:"100%",height:"100%",top:0,left:0},hO=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function gO({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:a=mA.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:v,selectionOnDrag:x}){const N=NL(),E=(0,s.useRef)(null),{userSelectionActive:_,lib:M,connectionInProgress:I}=xL(hO,wL),S=HL(p),k=(0,s.useRef)();!function(e){const t=NL();(0,s.useEffect)(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??1))return!1;const n=nT(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004","The React Flow parent container needs a width and a height to render the graph."),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener("resize",n);const t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener("resize",n),t&&e.current&&t.unobserve(e.current)}}},[])}(E);const D=(0,s.useCallback)(e=>{y?.({x:e[0],y:e[1],zoom:e[2]}),b||N.setState({transform:e})},[y,b]);return(0,s.useEffect)(()=>{if(E.current){k.current=KT({domNode:E.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:e=>N.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{const{onViewportChangeStart:n,onMoveStart:r}=N.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{const{onViewportChange:n,onMove:r}=N.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{const{onViewportChangeEnd:n,onMoveEnd:r}=N.getState();r?.(e,t),n?.(t)}});const{x:e,y:t,zoom:n}=k.current.getViewport();return N.setState({panZoom:k.current,transform:[e,t,n],domNode:E.current.closest(".react-flow")}),()=>{k.current?.destroy()}}},[]),(0,s.useEffect)(()=>{k.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:S,preventScrolling:m,noPanClassName:w,userSelectionActive:_,noWheelClassName:g,lib:M,onTransformChange:D,connectionInProgress:I,selectionOnDrag:x,paneClickDistance:v})},[e,t,n,r,o,a,i,l,S,m,w,_,g,M,D,I,x,v]),(0,j.jsx)("div",{className:"react-flow__renderer",ref:E,style:mO,children:h})}const wO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function yO(){const{userSelectionActive:e,userSelectionRect:t}=xL(wO,wL);return e&&t?(0,j.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const bO=(e,t)=>n=>{n.target===t.current&&e?.(n)},vO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function xO({isSelecting:e,selectionKeyPressed:t,selectionMode:n=hA.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:a,onSelectionStart:i,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){const g=NL(),{userSelectionActive:w,elementsSelectable:y,dragging:b,connectionInProgress:v}=xL(vO,wL),x=y&&(e||w),N=(0,s.useRef)(null),E=(0,s.useRef)(),_=(0,s.useRef)(new Set),M=(0,s.useRef)(new Set),I=(0,s.useRef)(!1),S=e=>{I.current||v?I.current=!1:(c?.(e),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1}))},k=d?e=>d(e):void 0,D=!0===r||Array.isArray(r)&&r.includes(0);return(0,j.jsxs)("div",{className:cL(["react-flow__pane",{draggable:D,dragging:b,selection:e}]),onClick:x?void 0:bO(S,N),onContextMenu:bO(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},N),onWheel:bO(k,N),onPointerEnter:x?void 0:f,onPointerMove:x?e=>{const{userSelectionRect:r,transform:a,nodeLookup:s,edgeLookup:l,connectionLookup:c,triggerNodeChanges:u,triggerEdgeChanges:d,defaultEdgeOptions:f,resetSelectedElements:p}=g.getState();if(!E.current||!r)return;const{x:m,y:h}=sT(e.nativeEvent,E.current),{startX:w,startY:y}=r;if(!I.current){const n=t?0:o;if(Math.hypot(m-w,h-y)<=n)return;p(),i?.(e)}I.current=!0;const b={startX:w,startY:y,x:m<w?m:w,y:h<y?h:y,width:Math.abs(m-w),height:Math.abs(h-y)},v=_.current,x=M.current;_.current=new Set(IA(s,b,a,n===hA.Partial,!0).map(e=>e.id)),M.current=new Set;const N=f?.selectable??!0;for(const e of _.current){const t=c.get(e);if(t)for(const{edgeId:e}of t.values()){const t=l.get(e);t&&(t.selectable??N)&&M.current.add(e)}}KA(v,_.current)||u(nO(s,_.current,!0)),KA(x,M.current)||d(nO(l,M.current)),g.setState({userSelectionRect:b,userSelectionActive:!0,nodesSelectionActive:!1})}:p,onPointerUp:x?e=>{0===e.button&&(e.target?.releasePointerCapture?.(e.pointerId),!w&&e.target===N.current&&g.getState().userSelectionRect&&S?.(e),g.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(l?.(e),g.setState({nodesSelectionActive:_.current.size>0})))}:void 0,onPointerDownCapture:x?n=>{const{domNode:r}=g.getState();if(E.current=r?.getBoundingClientRect(),!E.current)return;const o=n.target===N.current;if(!o&&n.target.closest(".nokey")||!e||!(a&&o||t)||0!==n.button||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),I.current=!1;const{x:i,y:s}=sT(n.nativeEvent,E.current);g.setState({userSelectionRect:{width:0,height:0,startX:i,startY:s,x:i,y:s}}),o||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:x?e=>{I.current&&(e.stopPropagation(),I.current=!1)}:void 0,onPointerLeave:m,ref:N,style:mO,children:[h,(0,j.jsx)(yO,{})]})}function NO({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:i,nodeLookup:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])):l?.("012",(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`)(e))}function EO({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:a,nodeClickDistance:i}){const l=NL(),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)();return(0,s.useEffect)(()=>{d.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let a={x:null,y:null},i=0,s=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;return{update:function({noDragClassName:g,handleSelector:w,domNode:y,isSelectable:b,nodeId:v,nodeClickDistance:x=0}){function N({x:e,y:n}){const{nodeLookup:o,nodeExtent:i,snapGrid:l,snapToGrid:c,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let w=!1;const y=s.size>1,b=y&&i?LA(MA(s)):null,x=y&&c?function({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const a={x:n-o.distance.x,y:r-o.distance.y},i=VA(a,t);return{x:i.x-a.x,y:i.y-a.y}}({dragItems:s,snapGrid:l,x:e,y:n}):null;for(const[t,r]of s){if(!o.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};c&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:VA(a,l));let s=null;if(y&&i&&!r.extent&&b){const{positionAbsolute:e}=r.internals,t=e.x-b.x+i[0][0],n=e.x+r.measured.width-b.x2+i[1][0];s=[[t,e.y-b.y+i[0][1]],[n,e.y+r.measured.height-b.y2+i[1][1]]]}const{position:d,positionAbsolute:f}=SA({nodeId:t,nextPosition:a,nodeLookup:o,nodeExtent:s||i,nodeOrigin:u,onError:p});w=w||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m=m||w,w&&(g(s,!0),h&&(r||d||!v&&f))){const[e,t]=BT({nodeId:v,dragItems:s,nodeLookup:o});r?.(h,s,e,t),d?.(h,e,t),v||f?.(h,t)}}async function E(){if(!u)return;const{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:o}=t();if(!o)return l=!1,void cancelAnimationFrame(i);const[s,d]=AA(c,u,r);0===s&&0===d||(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&N(a)),i=requestAnimationFrame(E)}function _(r){const{nodeLookup:o,multiSelectionActive:i,nodesDraggable:l,transform:c,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:w}=t();d=!0,m&&b||i||!v||o.get(v)?.selected||w(),b&&m&&v&&e?.(v);const y=tT(r.sourceEvent,{transform:c,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=y,s=function(e,t,n,r){const o=new Map;for(const[a,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!RT(i,e))&&(i.draggable||t&&void 0===i.draggable)){const t=e.get(a);t&&o.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return o}(o,l,y,v),s.size>0&&(n||h||!v&&g)){const[e,t]=BT({nodeId:v,dragItems:s,nodeLookup:o});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),v||g?.(r.sourceEvent,t)}}f=PD(y);const M=qD().clickDistance(x).on("start",e=>{const{domNode:n,nodeDragThreshold:r,transform:o,snapGrid:i,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,0===r&&_(e);const l=tT(e.sourceEvent,{transform:o,snapGrid:i,snapToGrid:s,containerBounds:u});a=l,c=sT(e.sourceEvent,u)}).on("drag",e=>{const{autoPanOnNodeDrag:n,transform:r,snapGrid:o,snapToGrid:i,nodeDragThreshold:f,nodeLookup:m}=t(),g=tT(e.sourceEvent,{transform:r,snapGrid:o,snapToGrid:i,containerBounds:u});if(h=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||v&&!m.has(v))&&(p=!0),!p){if(!l&&n&&d&&(l=!0,E()),!d){const t=sT(e.sourceEvent,u),n=t.x-c.x,r=t.y-c.y;Math.sqrt(n*n+r*r)>f&&_(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(c=sT(e.sourceEvent,u),N(g))}}).on("end",e=>{if(d&&!p&&(l=!1,d=!1,cancelAnimationFrame(i),s.size>0)){const{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:i}=t();if(m&&(r(s,!1),m=!1),o||a||!v&&i){const[t,r]=BT({nodeId:v,dragItems:s,nodeLookup:n,dragging:!1});o?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),v||i?.(e.sourceEvent,r)}}}).filter(e=>{const t=e.target;return!e.button&&(!g||!UT(t,`.${g}`,y))&&(!w||UT(t,w,y))});f.call(M)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{NO({id:t,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),(0,s.useEffect)(()=>{if(!t&&e.current&&d.current)return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:i}),()=>{d.current?.destroy()}},[n,r,t,a,e,o,i]),c}function _O(){const e=NL(),t=(0,s.useCallback)(t=>{const{nodeExtent:n,snapToGrid:r,snapGrid:o,nodesDraggable:a,onError:i,updateNodePositions:s,nodeLookup:l,nodeOrigin:c}=e.getState(),u=new Map,d=(e=>t=>t.selected&&(t.draggable||e&&void 0===t.draggable))(a),f=r?o[0]:5,p=r?o[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(const[,e]of l){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=VA(t,o));const{position:a,positionAbsolute:s}=SA({nodeId:e.id,nextPosition:t,nodeLookup:l,nodeExtent:n,nodeOrigin:c,onError:i});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[]);return t}const MO=(0,s.createContext)(null),IO=MO.Provider;MO.Consumer;const SO=()=>(0,s.useContext)(MO),kO=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),DO=(0,s.memo)(iO(function({type:e="source",position:t=bA.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:i,onConnect:s,children:l,className:c,onMouseDown:u,onTouchStart:d,...f},p){const m=i||null,h="target"===e,g=NL(),w=SO(),{connectOnClick:y,noPanClassName:b,rfId:v}=xL(kO,wL),{connectingFrom:x,connectingTo:N,clickConnecting:E,isPossibleEndHandle:_,connectionInProcess:M,clickConnectionInProcess:I,valid:S}=xL(((e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:a,connection:i}=r,{fromHandle:s,toHandle:l,isValid:c}=i,u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:o?.nodeId===e&&o?.id===t&&o?.type===n,isPossibleEndHandle:a===pA.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!o,valid:u&&c}})(w,m,e),wL);w||g.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");const k=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=g.getState();t(gT(o,e))}n?.(o),s?.(o)},D=e=>{if(!w)return;const t=iT(e.nativeEvent);if(o&&(t&&0===e.button||!t)){const t=g.getState();ZT.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:w,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:k,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,j.jsx)("div",{"data-handleid":m,"data-nodeid":w,"data-handlepos":t,"data-id":`${v}-${w}-${m}-${e}`,className:cL(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,c,{source:!h,target:h,connectable:r,connectablestart:o,connectableend:a,clickconnecting:E,connectingfrom:x,connectingto:N,valid:S,connectionindicator:r&&(!M||_)&&(M||I?a:o)}]),onMouseDown:D,onTouchStart:D,onClick:y?t=>{const{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l,lib:c,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!w||!i&&!o)return;if(!i)return r?.(t.nativeEvent,{nodeId:w,handleId:m,handleType:e}),void g.setState({connectionClickStartHandle:{nodeId:w,type:e,id:m}});const p=rT(t.target),h=n||l,{connection:y,isValid:b}=ZT.isValid(t.nativeEvent,{handle:{nodeId:w,id:m,type:e},connectionMode:s,fromNodeId:i.nodeId,fromHandleId:i.id||null,fromType:i.type,isValidConnection:h,flowId:u,doc:p,lib:c,nodeLookup:d});b&&y&&k(y);const v=structuredClone(f);delete v.inProgress,v.toPosition=v.toHandle?v.toHandle.position:null,a?.(t,v),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:l})})),CO={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},jO={input:function({data:e,isConnectable:t,sourcePosition:n=bA.Bottom}){return(0,j.jsxs)(j.Fragment,{children:[e?.label,(0,j.jsx)(DO,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=bA.Top,sourcePosition:r=bA.Bottom}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(DO,{type:"target",position:n,isConnectable:t}),e?.label,(0,j.jsx)(DO,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=bA.Top}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(DO,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},AO=e=>{const{width:t,height:n,x:r,y:o}=MA(e.nodeLookup,{filter:e=>!!e.selected});return{width:FA(t)?t:null,height:FA(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function TO({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=NL(),{width:o,height:a,transformString:i,userSelectionActive:l}=xL(AO,wL),c=_O(),u=(0,s.useRef)(null);(0,s.useEffect)(()=>{n||u.current?.focus({preventScroll:!0})},[n]);const d=!l&&null!==o&&null!==a;if(EO({nodeRef:u,disabled:!d}),!d)return null;const f=e?t=>{const n=r.getState().nodes.filter(e=>e.selected);e(t,n)}:void 0;return(0,j.jsx)("div",{className:cL(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:(0,j.jsx)("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(CO,e.key)&&(e.preventDefault(),c({direction:CO[e.key],factor:e.shiftKey?4:1}))},style:{width:o,height:a}})})}const LO="undefined"!=typeof window?window:void 0,OO=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function zO({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:h,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:x,panOnScrollSpeed:N,panOnScrollMode:E,zoomOnDoubleClick:_,panOnDrag:M,defaultViewport:I,translateExtent:S,minZoom:k,maxZoom:D,preventScrolling:C,onSelectionContextMenu:A,noWheelClassName:T,noPanClassName:L,disableKeyboardA11y:O,onViewportChange:z,isControlledViewport:P}){const{nodesSelectionActive:R,userSelectionActive:U}=xL(OO,wL),B=HL(u,{target:LO}),F=HL(g,{target:LO}),Q=F||M,V=F||x,Y=d&&!0!==Q,Z=B||U||Y;return function({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=NL(),{deleteElements:r}=dO(),o=HL(e,{actInsideInputWithModifier:!1}),a=HL(t,{target:pO});(0,s.useEffect)(()=>{if(o){const{edges:e,nodes:t}=n.getState();r({nodes:t.filter(fO),edges:e.filter(fO)}),n.setState({nodesSelectionActive:!1})}},[o]),(0,s.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}({deleteKeyCode:c,multiSelectionKeyCode:h}),(0,j.jsx)(gO,{onPaneContextMenu:a,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:V,panOnScrollSpeed:N,panOnScrollMode:E,zoomOnDoubleClick:_,panOnDrag:!B&&Q,defaultViewport:I,translateExtent:S,minZoom:k,maxZoom:D,zoomActivationKeyCode:w,preventScrolling:C,noWheelClassName:T,noPanClassName:L,onViewportChange:z,isControlledViewport:P,paneClickDistance:l,selectionOnDrag:Y,children:(0,j.jsxs)(xO,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:i,panOnDrag:Q,isSelecting:!!Z,selectionMode:f,selectionKeyPressed:B,paneClickDistance:l,selectionOnDrag:Y,children:[e,R&&(0,j.jsx)(TO,{onSelectionContextMenu:A,noPanClassName:L,disableKeyboardA11y:O})]})})}zO.displayName="FlowRenderer";const PO=(0,s.memo)(zO);const RO=e=>e.updateNodeInternals;var UO=(0,s.memo)(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:a,onDoubleClick:i,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:h,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:v,internals:x,isParent:N}=xL(t=>{const n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},wL);let E=v.type||"default",_=w?.[E]||jO[E];void 0===_&&(b?.("003",(e=>`Node type "${e}" not found. Using fallback type "default".`)(E)),E="default",_=w?.default||jO.default);const M=!!(v.draggable||l&&void 0===v.draggable),I=!!(v.selectable||c&&void 0===v.selectable),S=!!(v.connectable||u&&void 0===v.connectable),k=!!(v.focusable||d&&void 0===v.focusable),D=NL(),C=qA(v),A=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=NL(),a=(0,s.useRef)(null),i=(0,s.useRef)(null),l=(0,s.useRef)(e.sourcePosition),c=(0,s.useRef)(e.targetPosition),u=(0,s.useRef)(t),d=n&&!!e.internals.handleBounds;return(0,s.useEffect)(()=>{!a.current||e.hidden||d&&i.current===a.current||(i.current&&r?.unobserve(i.current),r?.observe(a.current),i.current=a.current)},[d,e.hidden]),(0,s.useEffect)(()=>()=>{i.current&&(r?.unobserve(i.current),i.current=null)},[]),(0,s.useEffect)(()=>{if(a.current){const n=u.current!==t,r=l.current!==e.sourcePosition,i=c.current!==e.targetPosition;(n||r||i)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}({node:v,nodeType:E,hasDimensions:C,resizeObserver:f}),T=EO({nodeRef:A,disabled:v.hidden||!M,noDragClassName:p,handleSelector:v.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:y}),L=_O();if(v.hidden)return null;const O=XA(v),z=function(e){return void 0===e.internals.handleBounds?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}(v),P=I||M||t||n||r||o,R=n?e=>n(e,{...x.userNode}):void 0,U=r?e=>r(e,{...x.userNode}):void 0,B=o?e=>o(e,{...x.userNode}):void 0,F=a?e=>a(e,{...x.userNode}):void 0,Q=i?e=>i(e,{...x.userNode}):void 0;return(0,j.jsx)("div",{className:cL(["react-flow__node",`react-flow__node-${E}`,{[m]:M},v.className,{selected:v.selected,selectable:I,parent:N,draggable:M,dragging:T}]),ref:A,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:C?"visible":"hidden",...v.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:U,onMouseLeave:B,onContextMenu:F,onClick:n=>{const{selectNodesOnDrag:r,nodeDragThreshold:o}=D.getState();I&&(!r||!M||o>0)&&NO({id:e,store:D,nodeRef:A}),t&&t(n,{...x.userNode})},onDoubleClick:Q,onKeyDown:k?t=>{if(!aT(t.nativeEvent)&&!h)if(dA.includes(t.key)&&I){const n="Escape"===t.key;NO({id:e,store:D,unselect:n,nodeRef:A})}else if(M&&v.selected&&Object.prototype.hasOwnProperty.call(CO,t.key)){t.preventDefault();const{ariaLabelConfig:e}=D.getState();D.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),L({direction:CO[t.key],factor:t.shiftKey?4:1})}}:void 0,tabIndex:k?0:void 0,onFocus:k?()=>{if(h||!A.current?.matches(":focus-visible"))return;const{transform:t,width:n,height:r,autoPanOnNodeFocus:o,setCenter:a}=D.getState();o&&(IA(new Map([[e,v]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(v.position.x+O.width/2,v.position.y+O.height/2,{zoom:t[2]}))}:void 0,role:v.ariaRole??(k?"group":void 0),"aria-roledescription":"node","aria-describedby":h?void 0:`${ML}-${g}`,"aria-label":v.ariaLabel,...v.domAttributes,children:(0,j.jsx)(IO,{value:e,children:(0,j.jsx)(_,{id:e,data:v.data,type:E,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:v.selected??!1,selectable:I,draggable:M,deletable:v.deletable??!0,isConnectable:S,sourcePosition:v.sourcePosition,targetPosition:v.targetPosition,dragging:T,dragHandle:v.dragHandle,zIndex:x.z,parentId:v.parentId,...O})})})});const BO=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function FO(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:a}=xL(BO,wL),i=function(e){const t=xL((0,s.useCallback)((e=>t=>e?IA(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys()))(e),[e]),wL);return t}(e.onlyRenderVisibleElements),l=function(){const e=xL(RO),[t]=(0,s.useState)(()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver(t=>{const n=new Map;t.forEach(e=>{const t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,s.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,j.jsx)("div",{className:"react-flow__nodes",style:mO,children:i.map(i=>(0,j.jsx)(UO,{id:i,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:a},i))})}FO.displayName="NodeRenderer";const QO=(0,s.memo)(FO),VO={[yA.Arrow]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return(0,j.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[yA.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,j.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},YO=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const c=function(e){const t=NL();return(0,s.useMemo)(()=>Object.prototype.hasOwnProperty.call(VO,e)?VO[e]:(t.getState().onError?.("009",(e=>`Marker type "${e}" doesn't exist.`)(e)),null),[e])}(t);return c?(0,j.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:(0,j.jsx)(c,{color:n,strokeWidth:i})}):null},ZO=({defaultColor:e,rfId:t})=>{const n=xL(e=>e.edges),r=xL(e=>e.defaultEdgeOptions),o=(0,s.useMemo)(()=>{const o=function(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const a=new Set;return e.reduce((e,i)=>([i.markerStart||r,i.markerEnd||o].forEach(r=>{if(r&&"object"==typeof r){const o=IT(r,t);a.has(o)||(e.push({id:o,color:r.color||n,...r}),a.add(o))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd});return o},[n,r,t,e]);return o.length?(0,j.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,j.jsx)("defs",{children:o.map(e=>(0,j.jsx)(YO,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};ZO.displayName="MarkerDefinitions";var WO=(0,s.memo)(ZO);function GO({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,p]=(0,s.useState)({x:1,y:0,width:0,height:0}),m=cL(["react-flow__edge-textwrapper",u]),h=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(h.current){const e=h.current.getBBox();p({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,j.jsxs)("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[o&&(0,j.jsx)("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),(0,j.jsx)("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:h,style:r,children:n}),c]}):null}GO.displayName="EdgeText";const HO=(0,s.memo)(GO);function $O({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:i,labelBgPadding:s,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("path",{...u,d:e,fill:"none",className:cL(["react-flow__edge-path",u.className])}),c?(0,j.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&FA(t)&&FA(n)?(0,j.jsx)(HO,{x:t,y:n,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:i,labelBgPadding:s,labelBgBorderRadius:l}):null]})}function XO({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===bA.Left||e===bA.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function qO({sourceX:e,sourceY:t,sourcePosition:n=bA.Bottom,targetX:r,targetY:o,targetPosition:a=bA.Top}){const[i,s]=XO({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=XO({pos:a,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=cT({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${r},${o}`,u,d,f,p]}function JO(e){return(0,s.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:i,targetPosition:s,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:w})=>{const[y,b,v]=qO({sourceX:n,sourceY:r,sourcePosition:i,targetX:o,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,j.jsx)($O,{id:x,path:y,labelX:b,labelY:v,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:w})})}const KO=JO({isInternal:!1}),ez=JO({isInternal:!0});function tz(e){return(0,s.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=bA.Bottom,targetPosition:m=bA.Top,markerEnd:h,markerStart:g,pathOptions:w,interactionWidth:y})=>{const[b,v,x]=xT({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:a,targetPosition:m,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),N=e.isInternal?void 0:t;return(0,j.jsx)($O,{id:N,path:b,labelX:v,labelY:x,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:y})})}KO.displayName="SimpleBezierEdge",ez.displayName="SimpleBezierEdgeInternal";const nz=tz({isInternal:!1}),rz=tz({isInternal:!0});function oz(e){return(0,s.memo)(({id:t,...n})=>{const r=e.isInternal?void 0:t;return(0,j.jsx)(nz,{...n,id:r,pathOptions:(0,s.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}nz.displayName="SmoothStepEdge",rz.displayName="SmoothStepEdgeInternal";const az=oz({isInternal:!1}),iz=oz({isInternal:!0});function sz(e){return(0,s.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{const[g,w,y]=wT({sourceX:n,sourceY:r,targetX:o,targetY:a}),b=e.isInternal?void 0:t;return(0,j.jsx)($O,{id:b,path:g,labelX:w,labelY:y,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}az.displayName="StepEdge",iz.displayName="StepEdgeInternal";const lz=sz({isInternal:!1}),cz=sz({isInternal:!0});function uz(e){return(0,s.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:i=bA.Bottom,targetPosition:s=bA.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:w,interactionWidth:y})=>{const[b,v,x]=fT({sourceX:n,sourceY:r,sourcePosition:i,targetX:o,targetY:a,targetPosition:s,curvature:w?.curvature}),N=e.isInternal?void 0:t;return(0,j.jsx)($O,{id:N,path:b,labelX:v,labelY:x,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:y})})}lz.displayName="StraightEdge",cz.displayName="StraightEdgeInternal";const dz=uz({isInternal:!1}),fz=uz({isInternal:!0});dz.displayName="BezierEdge",fz.displayName="BezierEdgeInternal";const pz={default:fz,straight:cz,step:iz,smoothstep:rz,simplebezier:ez},mz={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},hz=(e,t,n)=>n===bA.Left?e-t:n===bA.Right?e+t:e,gz=(e,t,n)=>n===bA.Top?e-t:n===bA.Bottom?e+t:e,wz="react-flow__edgeupdater";function yz({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:a,onMouseOut:i,type:s}){return(0,j.jsx)("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:i,className:cL([wz,`${wz}-${s}`]),cx:hz(t,r,e),cy:gz(n,r,e),r,stroke:"transparent",fill:"transparent"})}function bz({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:a,targetY:i,sourcePosition:s,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const m=NL(),h=(e,t)=>{if(0!==e.button)return;const{autoPanOnConnect:r,domNode:o,connectionMode:a,connectionRadius:i,lib:s,onConnectStart:l,cancelConnection:p,nodeLookup:h,rfId:g,panBy:w,updateConnection:y}=m.getState(),b="target"===t.type;ZT.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:i,domNode:o,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:b,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:w,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>c?.(n,e),onConnectStart:(r,o)=>{f(!0),u?.(e,n,t.type),l?.(r,o)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:y,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=()=>p(!0),w=()=>p(!1);return(0,j.jsxs)(j.Fragment,{children:[(!0===e||"source"===e)&&(0,j.jsx)(yz,{position:s,centerX:r,centerY:o,radius:t,onMouseDown:e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:g,onMouseOut:w,type:"source"}),(!0===e||"target"===e)&&(0,j.jsx)(yz,{position:l,centerX:a,centerY:i,radius:t,onMouseDown:e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:g,onMouseOut:w,type:"target"})]})}var vz=(0,s.memo)(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:a,onContextMenu:i,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:p,onReconnectEnd:m,rfId:h,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let v=xL(t=>t.edgeLookup.get(e));const x=xL(e=>e.defaultEdgeOptions);v=x?{...x,...v}:v;let N=v.type||"default",E=g?.[N]||pz[N];void 0===E&&(y?.("011",(e=>`Edge type "${e}" not found. Using fallback type "default".`)(N)),N="default",E=g?.default||pz.default);const _=!!(v.focusable||t&&void 0===v.focusable),M=void 0!==f&&(v.reconnectable||n&&void 0===v.reconnectable),I=!!(v.selectable||r&&void 0===v.selectable),S=(0,s.useRef)(null),[k,D]=(0,s.useState)(!1),[C,A]=(0,s.useState)(!1),T=NL(),{zIndex:L,sourceX:O,sourceY:z,targetX:P,targetY:R,sourcePosition:U,targetPosition:B}=xL((0,s.useCallback)(t=>{const n=t.nodeLookup.get(v.source),r=t.nodeLookup.get(v.target);if(!n||!r)return{zIndex:v.zIndex,...mz};const o=function(e){const{sourceNode:t,targetNode:n}=e;if(!NT(t)||!NT(n))return null;const r=t.internals.handleBounds||ET(t.handles),o=n.internals.handleBounds||ET(n.handles),a=MT(r?.source??[],e.sourceHandle),i=MT(e.connectionMode===pA.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!a||!i)return e.onError?.("008",((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`)(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const s=a?.position||bA.Bottom,l=i?.position||bA.Top,c=_T(t,a,s),u=_T(n,i,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:l}}({id:e,sourceNode:n,targetNode:r,sourceHandle:v.sourceHandle||null,targetHandle:v.targetHandle||null,connectionMode:t.connectionMode,onError:y}),a=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:a="basic"}){return"manual"===a?r:(o&&n?r+1e3:r)+Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0)}({selected:v.selected,zIndex:v.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{zIndex:a,...o||mz}},[v.source,v.target,v.sourceHandle,v.targetHandle,v.selected,v.zIndex]),wL),F=(0,s.useMemo)(()=>v.markerStart?`url('#${IT(v.markerStart,h)}')`:void 0,[v.markerStart,h]),Q=(0,s.useMemo)(()=>v.markerEnd?`url('#${IT(v.markerEnd,h)}')`:void 0,[v.markerEnd,h]);if(v.hidden||null===O||null===z||null===P||null===R)return null;const V=a?e=>{a(e,{...v})}:void 0,Y=i?e=>{i(e,{...v})}:void 0,Z=l?e=>{l(e,{...v})}:void 0,W=c?e=>{c(e,{...v})}:void 0,G=u?e=>{u(e,{...v})}:void 0;return(0,j.jsx)("svg",{style:{zIndex:L},children:(0,j.jsxs)("g",{className:cL(["react-flow__edge",`react-flow__edge-${N}`,v.className,w,{selected:v.selected,animated:v.animated,inactive:!I&&!o,updating:k,selectable:I}]),onClick:t=>{const{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=T.getState();I&&(T.setState({nodesSelectionActive:!1}),v.selected&&a?(r({nodes:[],edges:[v]}),S.current?.blur()):n([e])),o&&o(t,v)},onDoubleClick:V,onContextMenu:Y,onMouseEnter:Z,onMouseMove:W,onMouseLeave:G,onKeyDown:_?t=>{if(!b&&dA.includes(t.key)&&I){const{unselectNodesAndEdges:n,addSelectedEdges:r}=T.getState();"Escape"===t.key?(S.current?.blur(),n({edges:[v]})):r([e])}}:void 0,tabIndex:_?0:void 0,role:v.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===v.ariaLabel?void 0:v.ariaLabel||`Edge from ${v.source} to ${v.target}`,"aria-describedby":_?`${IL}-${h}`:void 0,ref:S,...v.domAttributes,children:[!C&&(0,j.jsx)(E,{id:e,source:v.source,target:v.target,type:v.type,selected:v.selected,animated:v.animated,selectable:I,deletable:v.deletable??!0,label:v.label,labelStyle:v.labelStyle,labelShowBg:v.labelShowBg,labelBgStyle:v.labelBgStyle,labelBgPadding:v.labelBgPadding,labelBgBorderRadius:v.labelBgBorderRadius,sourceX:O,sourceY:z,targetX:P,targetY:R,sourcePosition:U,targetPosition:B,data:v.data,style:v.style,sourceHandleId:v.sourceHandle,targetHandleId:v.targetHandle,markerStart:F,markerEnd:Q,pathOptions:"pathOptions"in v?v.pathOptions:void 0,interactionWidth:v.interactionWidth}),M&&(0,j.jsx)(bz,{edge:v,isReconnectable:M,reconnectRadius:d,onReconnect:f,onReconnectStart:p,onReconnectEnd:m,sourceX:O,sourceY:z,targetX:P,targetY:R,sourcePosition:U,targetPosition:B,setUpdateHover:D,setReconnecting:A})]})})});const xz=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Nz({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:a,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:h,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:v}=xL(xz,wL),x=function(e){const t=xL((0,s.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);const n=[];if(t.width&&t.height)for(const e of t.edges){const r=t.nodeLookup.get(e.source),o=t.nodeLookup.get(e.target);r&&o&&mT({sourceNode:r,targetNode:o,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),wL);return t}(t);return(0,j.jsxs)("div",{className:"react-flow__edges",children:[(0,j.jsx)(WO,{defaultColor:e,rfId:n}),x.map(e=>(0,j.jsx)(vz,{id:e,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:o,onReconnect:a,onContextMenu:i,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:h,rfId:n,onError:v,edgeTypes:r,disableKeyboardA11y:g},e))]})}Nz.displayName="EdgeRenderer";const Ez=(0,s.memo)(Nz),_z=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Mz({children:e}){const t=xL(_z);return(0,j.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}const Iz=e=>e.panZoom?.syncViewport;function Sz(e){return e.connection.inProgress?{...e.connection,to:YA(e.connection.to,e.transform)}:{...e.connection}}const kz=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Dz({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:a,height:i,isValid:s,inProgress:l}=xL(kz,wL);return a&&o&&l?(0,j.jsx)("svg",{style:e,width:a,height:i,className:"react-flow__connectionline react-flow__container",children:(0,j.jsx)("g",{className:cL(["react-flow__connection",xA(s)]),children:(0,j.jsx)(Cz,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}const Cz=({style:e,type:t=wA.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:a,fromNode:i,fromHandle:s,fromPosition:l,to:c,toNode:u,toHandle:d,toPosition:f,pointer:p}=function(e){const t=function(e){if(e){const t=t=>{const n=Sz(t);return e(n)};return t}return Sz}(e);return xL(t,wL)}();if(!o)return;if(n)return(0,j.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:s,fromX:a.x,fromY:a.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:f,connectionStatus:xA(r),toNode:u,toHandle:d,pointer:p});let m="";const h={sourceX:a.x,sourceY:a.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case wA.Bezier:[m]=fT(h);break;case wA.SimpleBezier:[m]=qO(h);break;case wA.Step:[m]=xT({...h,borderRadius:0});break;case wA.SmoothStep:[m]=xT(h);break;default:[m]=wT(h)}return(0,j.jsx)("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};Cz.displayName="ConnectionLine";const jz={};function Az(e=jz){(0,s.useRef)(e),NL(),(0,s.useEffect)(()=>{},[e])}function Tz({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:p,onSelectionEnd:m,connectionLineType:h,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:v,selectionMode:x,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:_,deleteKeyCode:M,onlyRenderVisibleElements:I,elementsSelectable:S,defaultViewport:k,translateExtent:D,minZoom:C,maxZoom:A,preventScrolling:T,defaultMarkerColor:L,zoomOnScroll:O,zoomOnPinch:z,panOnScroll:P,panOnScrollSpeed:R,panOnScrollMode:U,zoomOnDoubleClick:B,panOnDrag:F,onPaneClick:Q,onPaneMouseEnter:V,onPaneMouseMove:Y,onPaneMouseLeave:Z,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:H,nodeClickDistance:$,onEdgeContextMenu:X,onEdgeMouseEnter:q,onEdgeMouseMove:J,onEdgeMouseLeave:K,reconnectRadius:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,noDragClassName:oe,noWheelClassName:ae,noPanClassName:ie,disableKeyboardA11y:se,nodeExtent:le,rfId:ce,viewport:ue,onViewportChange:de}){return Az(e),Az(t),NL(),(0,s.useRef)(!1),(0,s.useEffect)(()=>{},[]),function(e){const t=dO(),n=(0,s.useRef)(!1);(0,s.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(n),function(e){const t=xL(Iz),n=NL();(0,s.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t])}(ue),(0,j.jsx)(PO,{onPaneClick:Q,onPaneMouseEnter:V,onPaneMouseMove:Y,onPaneMouseLeave:Z,onPaneContextMenu:G,onPaneScroll:W,paneClickDistance:H,deleteKeyCode:M,selectionKeyCode:b,selectionOnDrag:v,selectionMode:x,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:N,panActivationKeyCode:E,zoomActivationKeyCode:_,elementsSelectable:S,zoomOnScroll:O,zoomOnPinch:z,zoomOnDoubleClick:B,panOnScroll:P,panOnScrollSpeed:R,panOnScrollMode:U,panOnDrag:F,defaultViewport:k,translateExtent:D,minZoom:C,maxZoom:A,onSelectionContextMenu:f,preventScrolling:T,noDragClassName:oe,noWheelClassName:ae,noPanClassName:ie,disableKeyboardA11y:se,onViewportChange:de,isControlledViewport:!!ue,children:(0,j.jsxs)(Mz,{children:[(0,j.jsx)(Ez,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:i,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,onlyRenderVisibleElements:I,onEdgeContextMenu:X,onEdgeMouseEnter:q,onEdgeMouseMove:J,onEdgeMouseLeave:K,reconnectRadius:ee,defaultMarkerColor:L,noPanClassName:ie,disableKeyboardA11y:se,rfId:ce}),(0,j.jsx)(Dz,{style:g,type:h,component:w,containerStyle:y}),(0,j.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,j.jsx)(QO,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:$,onlyRenderVisibleElements:I,noPanClassName:ie,noDragClassName:oe,disableKeyboardA11y:se,nodeExtent:le,rfId:ce}),(0,j.jsx)("div",{className:"react-flow__viewport-portal"})]})})}Tz.displayName="GraphView";const Lz=(0,s.memo)(Tz),Oz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:i,fitViewOptions:s,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f="basic"}={})=>{const p=new Map,m=new Map,h=new Map,g=new Map,w=r??t??[],y=n??e??[],b=u??[0,0],v=d??uA;PT(h,g,w);const{nodesInitialized:x}=AT(y,p,m,{nodeOrigin:b,nodeExtent:v,zIndexMode:f});let N=[0,0,1];if(i&&o&&a){const e=MA(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),{x:t,y:n,zoom:r}=GA(e,o,a,l,c,s?.padding??.1);N=[t,n,r]}return{rfId:"1",width:o??0,height:a??0,transform:N,nodes:y,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:w,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:l,maxZoom:c,translateExtent:uA,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:pA.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:s,fitViewResolver:null,connection:{...gA},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:QA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:fA,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},zz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:i,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>((e,t)=>e?gL(e,t):gL)((p,m)=>{async function h(){const{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:o,height:a,minZoom:i,maxZoom:s}=m();t&&(await async function({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:a},i){if(0===e.size)return Promise.resolve(!0);const s=function(e,t){const n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{!e.measured.width||!e.measured.height||!t?.includeHiddenNodes&&e.hidden||r&&!r.has(e.id)||n.set(e.id,e)}),n}(e,i),l=MA(s),c=GA(l,t,n,i?.minZoom??o,i?.maxZoom??a,i?.padding??.1);return await r.setViewport(c,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)}({nodes:e,width:o,height:a,panZoom:t,minZoom:i,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...Oz({nodes:e,edges:t,width:o,height:a,fitView:i,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{const{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:o,fitViewQueued:a,zIndexMode:i,nodesSelectionActive:s}=m(),{nodesInitialized:l,hasSelectedNodes:c}=AT(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:o,checkEquality:!0,zIndexMode:i}),u=s&&c;a&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:u})},setEdges:e=>{const{connectionLookup:t,edgeLookup:n}=m();PT(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){const{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){const{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{const{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:o,nodeOrigin:a,nodeExtent:i,debug:s,fitViewQueued:l,zIndexMode:c}=m(),{changes:u,updatedInternals:d}=function(e,t,n,r,o,a,i){const s=r?.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const r of e.values()){const e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),l=!0;continue}const s=nT(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){const p=r.nodeElement.getBoundingClientRect(),m=$A(e.extent)?e.extent:a;let{positionAbsolute:h}=e.internals;e.parentId&&"parent"===e.extent?h=CA(h,s,t.get(e.parentId)):m&&(h=DA(h,m,s));const g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:lT("source",r.nodeElement,p,d,e.id),target:lT("target",r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&TT(g,t,n,{nodeOrigin:o,zIndexMode:i}),l=!0,u&&(c.push({id:e.id,type:"dimensions",dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:zA(g,o)}))}}if(f.length>0){const e=OT(f,t,n,o);c.push(...e)}return{changes:c,updatedInternals:l}}(e,n,r,o,a,i,c);d&&(function(e,t,n){const r=DT(ST,n);for(const n of e.values())if(n.parentId)TT(n,e,t,r);else{const e=_A(n,r.nodeOrigin),t=$A(n.extent)?n.extent:r.nodeExtent,o=DA(e,t,XA(n));n.internals.positionAbsolute=o}}(n,r,{nodeOrigin:a,nodeExtent:i,zIndexMode:c}),l?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log("React Flow: trigger node changes",u),t?.(u)))},updateNodePositions:(e,t=!1)=>{const n=[];let r=[];const{nodeLookup:o,triggerNodeChanges:a,connection:i,updateConnection:s,onNodesChangeMiddlewareMap:l}=m();for(const[a,l]of e){const e=o.get(a),c=!!(e?.expandParent&&e?.parentId&&l?.position),u={id:a,type:"position",position:c?{x:Math.max(0,l.position.x),y:Math.max(0,l.position.y)}:l.position,dragging:t};if(e&&i.inProgress&&i.fromNode.id===e.id){const t=_T(e,i.fromHandle,bA.Left,!0);s({...i,from:t})}c&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...l.internals.positionAbsolute,width:l.measured.width??0,height:l.measured.height??0}}),r.push(u)}if(n.length>0){const{parentLookup:e,nodeOrigin:t}=m(),a=OT(n,o,e,t);r.push(...a)}for(const e of l.values())r=e(r);a(r)},triggerNodeChanges:e=>{const{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:o,debug:a}=m();e?.length&&(o&&n(KL(e,r)),a&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{const{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:o,debug:a}=m();e?.length&&(o&&n(eO(e,r)),a&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:a}=m();t?o(e.map(e=>tO(e,!0))):(o(nO(r,new Set([...e]),!0)),a(nO(n)))},addSelectedEdges:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:a}=m();t?a(e.map(e=>tO(e,!0))):(a(nO(n,new Set([...e]))),o(nO(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{const{edges:n,nodes:r,nodeLookup:o,triggerNodeChanges:a,triggerEdgeChanges:i}=m(),s=e||r,l=t||n,c=[];for(const e of s){if(!e.selected)continue;const t=o.get(e.id);t&&(t.selected=!1),c.push(tO(e.id,!1))}const u=[];for(const e of l)e.selected&&u.push(tO(e.id,!1));a(c),i(u)},setMinZoom:e=>{const{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{const{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{const{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:o}=m();if(!o)return;const a=t.reduce((e,t)=>t.selected?[...e,tO(t.id,!1)]:e,[]),i=e.reduce((e,t)=>t.selected?[...e,tO(t.id,!1)]:e,[]);n(a),r(i)},setNodeExtent:e=>{const{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:o,elevateNodesOnSelect:a,nodeExtent:i,zIndexMode:s}=m();e[0][0]===i[0][0]&&e[0][1]===i[0][1]&&e[1][0]===i[1][0]&&e[1][1]===i[1][1]||(AT(t,n,r,{nodeOrigin:o,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{const{transform:t,width:n,height:r,panZoom:o,translateExtent:a}=m();return async function({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,a]],r),s=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(s)}({delta:e,panZoom:o,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{const{width:r,height:o,maxZoom:a,panZoom:i}=m();if(!i)return Promise.resolve(!1);const s=void 0!==n?.zoom?n.zoom:a;return await i.setViewport({x:r/2-e*s,y:o/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...gA}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...Oz()})}},Object.is);function Pz({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:a,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:m}){const[h]=(0,s.useState)(()=>zz({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:u,minZoom:i,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p}));return(0,j.jsx)(bL,{value:h,children:(0,j.jsx)(cO,{children:m})})}function Rz({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:a,height:i,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m}){return(0,s.useContext)(yL)?(0,j.jsx)(j.Fragment,{children:e}):(0,j.jsx)(Pz,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:a,initialHeight:i,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:p,zIndexMode:m,children:e})}const Uz={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var Bz=iO(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:a,edgeTypes:i,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:m,onConnectStart:h,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:x,onNodeContextMenu:N,onNodeDoubleClick:E,onNodeDragStart:_,onNodeDrag:M,onNodeDragStop:I,onNodesDelete:S,onEdgesDelete:k,onDelete:D,onSelectionChange:C,onSelectionDragStart:A,onSelectionDrag:T,onSelectionDragStop:L,onSelectionContextMenu:O,onSelectionStart:z,onSelectionEnd:P,onBeforeDelete:R,connectionMode:U,connectionLineType:B=wA.Bezier,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:V,deleteKeyCode:Y="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:W=!1,selectionMode:G=hA.Full,panActivationKeyCode:H="Space",multiSelectionKeyCode:$=(HA()?"Meta":"Control"),zoomActivationKeyCode:X=(HA()?"Meta":"Control"),snapToGrid:q,snapGrid:J,onlyRenderVisibleElements:K=!1,selectNodesOnDrag:ee,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:re,nodesFocusable:oe,nodeOrigin:ae=BL,edgesFocusable:ie,edgesReconnectable:se,elementsSelectable:le=!0,defaultViewport:ce=FL,minZoom:ue=.5,maxZoom:de=2,translateExtent:fe=uA,preventScrolling:pe=!0,nodeExtent:me,defaultMarkerColor:he="#b1b1b7",zoomOnScroll:ge=!0,zoomOnPinch:we=!0,panOnScroll:ye=!1,panOnScrollSpeed:be=.5,panOnScrollMode:ve=mA.Free,zoomOnDoubleClick:xe=!0,panOnDrag:Ne=!0,onPaneClick:Ee,onPaneMouseEnter:_e,onPaneMouseMove:Me,onPaneMouseLeave:Ie,onPaneScroll:Se,onPaneContextMenu:ke,paneClickDistance:De=1,nodeClickDistance:Ce=0,children:je,onReconnect:Ae,onReconnectStart:Te,onReconnectEnd:Le,onEdgeContextMenu:Oe,onEdgeDoubleClick:ze,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Ue,reconnectRadius:Be=10,onNodesChange:Fe,onEdgesChange:Qe,noDragClassName:Ve="nodrag",noWheelClassName:Ye="nowheel",noPanClassName:Ze="nopan",fitView:We,fitViewOptions:Ge,connectOnClick:He,attributionPosition:$e,proOptions:Xe,defaultEdgeOptions:qe,elevateNodesOnSelect:Je=!0,elevateEdgesOnSelect:Ke=!1,disableKeyboardA11y:et=!1,autoPanOnConnect:tt,autoPanOnNodeDrag:nt,autoPanSpeed:rt,connectionRadius:ot,isValidConnection:at,onError:it,style:st,id:lt,nodeDragThreshold:ct,connectionDragThreshold:ut,viewport:dt,onViewportChange:ft,width:pt,height:mt,colorMode:ht="light",debug:gt,onScroll:wt,ariaLabelConfig:yt,zIndexMode:bt="basic",...vt},xt){const Nt=lt||"1",Et=function(e){const[t,n]=(0,s.useState)("system"===e?null:e);return(0,s.useEffect)(()=>{if("system"!==e)return void n(e);const t=WL(),r=()=>n(t?.matches?"dark":"light");return r(),t?.addEventListener("change",r),()=>{t?.removeEventListener("change",r)}},[e]),null!==t?t:WL()?.matches?"dark":"light"}(ht),_t=(0,s.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),wt?.(e)},[wt]);return(0,j.jsx)("div",{"data-testid":"rf__wrapper",...vt,onScroll:_t,style:{...st,...Uz},ref:xt,className:cL(["react-flow",o,Et]),id:lt,role:"application",children:(0,j.jsxs)(Rz,{nodes:e,edges:t,width:pt,height:mt,fitView:We,fitViewOptions:Ge,minZoom:ue,maxZoom:de,nodeOrigin:ae,nodeExtent:me,zIndexMode:bt,children:[(0,j.jsx)(ZL,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:h,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:re,nodesFocusable:oe,edgesFocusable:ie,edgesReconnectable:se,elementsSelectable:le,elevateNodesOnSelect:Je,elevateEdgesOnSelect:Ke,minZoom:ue,maxZoom:de,nodeExtent:me,onNodesChange:Fe,onEdgesChange:Qe,snapToGrid:q,snapGrid:J,connectionMode:U,translateExtent:fe,connectOnClick:He,defaultEdgeOptions:qe,fitView:We,fitViewOptions:Ge,onNodesDelete:S,onEdgesDelete:k,onDelete:D,onNodeDragStart:_,onNodeDrag:M,onNodeDragStop:I,onSelectionDrag:T,onSelectionDragStart:A,onSelectionDragStop:L,onMove:d,onMoveStart:f,onMoveEnd:p,noPanClassName:Ze,nodeOrigin:ae,rfId:Nt,autoPanOnConnect:tt,autoPanOnNodeDrag:nt,autoPanSpeed:rt,onError:it,connectionRadius:ot,isValidConnection:at,selectNodesOnDrag:ee,nodeDragThreshold:ct,connectionDragThreshold:ut,onBeforeDelete:R,debug:gt,ariaLabelConfig:yt,zIndexMode:bt}),(0,j.jsx)(Lz,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:x,onNodeContextMenu:N,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:i,connectionLineType:B,connectionLineStyle:F,connectionLineComponent:Q,connectionLineContainerStyle:V,selectionKeyCode:Z,selectionOnDrag:W,selectionMode:G,deleteKeyCode:Y,multiSelectionKeyCode:$,panActivationKeyCode:H,zoomActivationKeyCode:X,onlyRenderVisibleElements:K,defaultViewport:ce,translateExtent:fe,minZoom:ue,maxZoom:de,preventScrolling:pe,zoomOnScroll:ge,zoomOnPinch:we,zoomOnDoubleClick:xe,panOnScroll:ye,panOnScrollSpeed:be,panOnScrollMode:ve,panOnDrag:Ne,onPaneClick:Ee,onPaneMouseEnter:_e,onPaneMouseMove:Me,onPaneMouseLeave:Ie,onPaneScroll:Se,onPaneContextMenu:ke,paneClickDistance:De,nodeClickDistance:Ce,onSelectionContextMenu:O,onSelectionStart:z,onSelectionEnd:P,onReconnect:Ae,onReconnectStart:Te,onReconnectEnd:Le,onEdgeContextMenu:Oe,onEdgeDoubleClick:ze,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Ue,reconnectRadius:Be,defaultMarkerColor:he,noDragClassName:Ve,noWheelClassName:Ye,noPanClassName:Ze,rfId:Nt,disableKeyboardA11y:et,nodeExtent:me,viewport:dt,onViewportChange:ft}),(0,j.jsx)(RL,{onSelectionChange:C}),je,(0,j.jsx)(AL,{proOptions:Xe,position:$e}),(0,j.jsx)(CL,{rfId:Nt,disableKeyboardA11y:et})]})})});const Fz=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function Qz({children:e}){const t=xL(Fz);return t?(0,un.createPortal)(e,t):null}const Vz=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function Yz({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,j.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:cL(["react-flow__background-pattern",n,r])})}function Zz({radius:e,className:t}){return(0,j.jsx)("circle",{cx:e,cy:e,r:e,className:cL(["react-flow__background-pattern","dots",t])})}var Wz;!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(Wz||(Wz={}));const Gz={[Wz.Dots]:1,[Wz.Lines]:1,[Wz.Cross]:6},Hz=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $z({id:e,variant:t=Wz.Dots,gap:n=20,size:r,lineWidth:o=1,offset:a=0,color:i,bgColor:l,style:c,className:u,patternClassName:d}){const f=(0,s.useRef)(null),{transform:p,patternId:m}=xL(Hz,wL),h=r||Gz[t],g=t===Wz.Dots,w=t===Wz.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*p[2]||1,y[1]*p[2]||1],v=h*p[2],x=Array.isArray(a)?a:[a,a],N=w?[v,v]:b,E=[x[0]*p[2]||1+N[0]/2,x[1]*p[2]||1+N[1]/2],_=`${m}${e||""}`;return(0,j.jsxs)("svg",{className:cL(["react-flow__background",u]),style:{...c,...mO,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:f,"data-testid":"rf__background",children:[(0,j.jsx)("pattern",{id:_,x:p[0]%b[0],y:p[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:g?(0,j.jsx)(Zz,{radius:v/2,className:d}):(0,j.jsx)(Yz,{dimensions:N,lineWidth:o,variant:t,className:d})}),(0,j.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}$z.displayName="Background";const Xz=(0,s.memo)($z);function qz(){return(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,j.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Jz(){return(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,j.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function Kz(){return(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,j.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function eP(){return(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,j.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function tP(){return(0,j.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,j.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function nP({children:e,className:t,...n}){return(0,j.jsx)("button",{type:"button",className:cL(["react-flow__controls-button",t]),...n,children:e})}const rP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function oP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:i,onFitView:s,onInteractiveChange:l,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":p}){const m=NL(),{isInteractive:h,minZoomReached:g,maxZoomReached:w,ariaLabelConfig:y}=xL(rP,wL),{zoomIn:b,zoomOut:v,fitView:x}=dO(),N="horizontal"===f?"horizontal":"vertical";return(0,j.jsxs)(jL,{className:cL(["react-flow__controls",N,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(nP,{onClick:()=>{b(),a?.()},className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:w,children:(0,j.jsx)(qz,{})}),(0,j.jsx)(nP,{onClick:()=>{v(),i?.()},className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:g,children:(0,j.jsx)(Jz,{})})]}),n&&(0,j.jsx)(nP,{className:"react-flow__controls-fitview",onClick:()=>{x(o),s?.()},title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:(0,j.jsx)(Kz,{})}),r&&(0,j.jsx)(nP,{className:"react-flow__controls-interactive",onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),l?.(!h)},title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:h?(0,j.jsx)(tP,{}):(0,j.jsx)(eP,{})}),u]})}oP.displayName="Controls",(0,s.memo)(oP);const aP=(0,s.memo)(function({id:e,x:t,y:n,width:r,height:o,style:a,color:i,strokeColor:s,strokeWidth:l,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){const{background:m,backgroundColor:h}=a||{},g=i||m||h;return(0,j.jsx)("rect",{className:cL(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:o,style:{fill:g,stroke:s,strokeWidth:l},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}),iP=e=>e.nodes.map(e=>e.id),sP=e=>e instanceof Function?e:()=>e,lP=(0,s.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:i,NodeComponent:s,onClick:l}){const{node:c,x:u,y:d,width:f,height:p}=xL(t=>{const n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};const r=n.internals.userNode,{x:o,y:a}=n.internals.positionAbsolute,{width:i,height:s}=XA(r);return{node:r,x:o,y:a,width:i,height:s}},wL);return c&&!c.hidden&&qA(c)?(0,j.jsx)(s,{x:u,y:d,width:f,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:o,strokeColor:n(c),strokeWidth:a,shapeRendering:i,onClick:l,id:c.id}):null});var cP=(0,s.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:a=aP,onClick:i}){const s=xL(iP,wL),l=sP(t),c=sP(e),u=sP(n),d="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,j.jsx)(j.Fragment,{children:s.map(e=>(0,j.jsx)(lP,{id:e,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:a,onClick:i,shapeRendering:d},e))})});const uP=e=>!e.hidden,dP=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?RA(MA(e.nodeLookup,{filter:uP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}};function fP({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:p="bottom-right",onClick:m,onNodeClick:h,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:v=1,offsetScale:x=5}){const N=NL(),E=(0,s.useRef)(null),{boundingRect:_,viewBB:M,rfId:I,panZoom:S,translateExtent:k,flowWidth:D,flowHeight:C,ariaLabelConfig:A}=xL(dP,wL),T=e?.width??200,L=e?.height??150,O=_.width/T,z=_.height/L,P=Math.max(O,z),R=P*T,U=P*L,B=x*P,F=_.x-(R-_.width)/2-B,Q=_.y-(U-_.height)/2-B,V=R+2*B,Y=U+2*B,Z=`react-flow__minimap-desc-${I}`,W=(0,s.useRef)(0),G=(0,s.useRef)();W.current=P,(0,s.useEffect)(()=>{if(E.current&&S)return G.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=PD(e);return{update:function({translateExtent:e,width:a,height:i,zoomStep:s=1,pannable:l=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0];const f=oA().on("start",e=>{"mousedown"!==e.sourceEvent.type&&"touchstart"!==e.sourceEvent.type||(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",l?o=>{const s=n();if("mousemove"!==o.sourceEvent.type&&"touchmove"!==o.sourceEvent.type||!t)return;const l=[o.sourceEvent.clientX??o.sourceEvent.touches[0].clientX,o.sourceEvent.clientY??o.sourceEvent.touches[0].clientY],c=[l[0]-d[0],l[1]-d[1]];d=l;const f=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-c[0]*f,y:s[1]-c[1]*f},m=[[0,0],[a,i]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on("zoom.wheel",c?e=>{if("wheel"!==e.sourceEvent.type||!t)return;const r=n(),o=e.sourceEvent.ctrlKey&&HA()?10:1,a=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,i=r[2]*Math.pow(2,a*o);t.scaleTo(i)}:null);o.call(f,{})},destroy:function(){o.on("zoom",null)},pointer:RD}}({domNode:E.current,panZoom:S,getTransform:()=>N.getState().transform,getViewScale:()=>W.current}),()=>{G.current?.destroy()}},[S]),(0,s.useEffect)(()=>{G.current?.update({translateExtent:k,width:D,height:C,inversePan:b,pannable:g,zoomStep:v,zoomable:w})},[g,w,b,v,k,D,C]);const H=m?e=>{const[t,n]=G.current?.pointer(e)||[0,0];m(e,{x:t,y:n})}:void 0,$=h?(0,s.useCallback)((e,t)=>{const n=N.getState().nodeLookup.get(t).internals.userNode;h(e,n)},[]):void 0,X=y??A["minimap.ariaLabel"];return(0,j.jsx)(jL,{position:p,style:{...e,"--xy-minimap-background-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof d?d:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof f?f*P:void 0,"--xy-minimap-node-background-color-props":"string"==typeof r?r:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof i?i:void 0},className:cL(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,j.jsxs)("svg",{width:T,height:L,viewBox:`${F} ${Q} ${V} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:E,onClick:H,children:[X&&(0,j.jsx)("title",{id:Z,children:X}),(0,j.jsx)(cP,{onClick:$,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:l}),(0,j.jsx)("path",{className:"react-flow__minimap-mask",d:`M${F-B},${Q-B}h${V+2*B}v${Y+2*B}h${-V-2*B}z\n M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}fP.displayName="MiniMap";const pP=(0,s.memo)(fP),mP={[eL.Line]:"right",[eL.Handle]:"bottom-right"};(0,s.memo)(function({nodeId:e,position:t,variant:n=eL.Handle,className:r,style:o,children:a,color:i,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:p,autoScale:m=!0,shouldResize:h,onResizeStart:g,onResize:w,onResizeEnd:y}){const b=SO(),v="string"==typeof e?e:b,x=NL(),N=(0,s.useRef)(null),E=n===eL.Handle,_=xL((0,s.useCallback)((M=E&&m,e=>M?`${Math.max(1/e.transform[2],1)}`:void 0),[E,m]),wL);var M;const I=(0,s.useRef)(null),S=t??mP[n];(0,s.useEffect)(()=>{if(N.current&&v)return I.current||(I.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const a=PD(e);let i={controlDirection:tL("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:s,keepAspectRatio:l,resizeDirection:c,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m,h={...iL},g={...sL};i={boundaries:s,resizeDirection:c,keepAspectRatio:l,controlDirection:tL(e)};let w,y,b,v=null,x=[],N=!1;const E=qD().on("start",e=>{const{nodeLookup:r,transform:o,snapGrid:a,snapToGrid:i,nodeOrigin:s,paneDomNode:l}=n();if(m=r.get(t),!m)return;v=l?.getBoundingClientRect()??null;const{xSnapped:c,ySnapped:d}=tT(e.sourceEvent,{transform:o,snapGrid:a,snapToGrid:i,containerBounds:v});h={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},g={...h,pointerX:c,pointerY:d,aspectRatio:h.width/h.height},w=void 0,m.parentId&&("parent"===m.extent||m.expandParent)&&(w=r.get(m.parentId),y=w&&"parent"===m.extent?function(e){return[[0,0],[e.measured.width,e.measured.height]]}(w):void 0),x=[],b=void 0;for(const[e,n]of r)if(n.parentId===t&&(x.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const e=lL(n,m,n.origin??s);b=b?[[Math.min(e[0][0],b[0][0]),Math.min(e[0][1],b[0][1])],[Math.max(e[1][0],b[1][0]),Math.max(e[1][1],b[1][1])]]:e}u?.(e,{...h})}).on("drag",e=>{const{transform:t,snapGrid:o,snapToGrid:a,nodeOrigin:s}=n(),l=tT(e.sourceEvent,{transform:t,snapGrid:o,snapToGrid:a,containerBounds:v}),c=[];if(!m)return;const{x:u,y:f,width:E,height:_}=h,M={},I=m.origin??s,{width:S,height:k,x:D,y:C}=function(e,t,n,r,o,a,i,s){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:w,maxHeight:y}=r,{x:b,y:v,width:x,height:N,aspectRatio:E}=e;let _=Math.floor(u?p-e.pointerX:0),M=Math.floor(d?m-e.pointerY:0);const I=x+(l?-_:_),S=N+(c?-M:M),k=-a[0]*x,D=-a[1]*N;let C=oL(I,h,g),j=oL(S,w,y);if(i){let e=0,t=0;l&&_<0?e=nL(b+_+k,i[0][0]):!l&&_>0&&(e=rL(b+I+k,i[1][0])),c&&M<0?t=nL(v+M+D,i[0][1]):!c&&M>0&&(t=rL(v+S+D,i[1][1])),C=Math.max(C,e),j=Math.max(j,t)}if(s){let e=0,t=0;l&&_>0?e=rL(b+_,s[0][0]):!l&&_<0&&(e=nL(b+I,s[1][0])),c&&M>0?t=rL(v+M,s[0][1]):!c&&M<0&&(t=nL(v+S,s[1][1])),C=Math.max(C,e),j=Math.max(j,t)}if(o){if(u){const e=oL(I/E,w,y)*E;if(C=Math.max(C,e),i){let e=0;e=!l&&!c||l&&!c&&f?rL(v+D+I/E,i[1][1])*E:nL(v+D+(l?_:-_)/E,i[0][1])*E,C=Math.max(C,e)}if(s){let e=0;e=!l&&!c||l&&!c&&f?nL(v+I/E,s[1][1])*E:rL(v+(l?_:-_)/E,s[0][1])*E,C=Math.max(C,e)}}if(d){const e=oL(S*E,h,g)/E;if(j=Math.max(j,e),i){let e=0;e=!l&&!c||c&&!l&&f?rL(b+S*E+k,i[1][0])/E:nL(b+(c?M:-M)*E+k,i[0][0])/E,j=Math.max(j,e)}if(s){let e=0;e=!l&&!c||c&&!l&&f?nL(b+S*E,s[1][0])/E:rL(b+(c?M:-M)*E,s[0][0])/E,j=Math.max(j,e)}}}M+=M<0?j:-j,_+=_<0?C:-C,o&&(f?I>S*E?M=(aL(l,c)?-_:_)/E:_=(aL(l,c)?-M:M)*E:u?(M=_/E,c=l):(_=M*E,l=c));const A=l?b+_:b,T=c?v+M:v;return{width:x+(l?-_:_),height:N+(c?-M:M),x:a[0]*_*(l?-1:1)+A,y:a[1]*M*(c?-1:1)+T}}(g,i.controlDirection,l,i.boundaries,i.keepAspectRatio,I,y,b),j=S!==E,A=k!==_,T=D!==u&&j,L=C!==f&&A;if(!(T||L||j||A))return;if((T||L||1===I[0]||1===I[1])&&(M.x=T?D:h.x,M.y=L?C:h.y,h.x=M.x,h.y=M.y,x.length>0)){const e=D-u,t=C-f;for(const n of x)n.position={x:n.position.x-e+I[0]*(S-E),y:n.position.y-t+I[1]*(k-_)},c.push(n)}if((j||A)&&(M.width=!j||i.resizeDirection&&"horizontal"!==i.resizeDirection?h.width:S,M.height=!A||i.resizeDirection&&"vertical"!==i.resizeDirection?h.height:k,h.width=M.width,h.height=M.height),w&&m.expandParent){const e=I[0]*(M.width??0);M.x&&M.x<e&&(h.x=e,g.x=g.x-(M.x-e));const t=I[1]*(M.height??0);M.y&&M.y<t&&(h.y=t,g.y=g.y-(M.y-t))}const O=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:a}){const i=e-t,s=n-r,l=[i>0?1:i<0?-1:0,s>0?1:s<0?-1:0];return i&&o&&(l[0]=-1*l[0]),s&&a&&(l[1]=-1*l[1]),l}({width:h.width,prevWidth:E,height:h.height,prevHeight:_,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),z={...h,direction:O},P=p?.(e,z);!1!==P&&(N=!0,d?.(e,z),r(M,c))}).on("end",e=>{N&&(f?.(e,{...h}),o?.({...h}),N=!1)});a.call(E)},destroy:function(){a.on(".drag",null)}}}({domNode:N.current,nodeId:v,getStoreItems:()=>{const{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,paneDomNode:a}},onChange:(e,t)=>{const{triggerNodeChanges:n,nodeLookup:r,parentLookup:o,nodeOrigin:a}=x.getState(),i=[],s={x:e.x,y:e.y},l=r.get(v);if(l&&l.expandParent&&l.parentId){const t=l.origin??a,n=e.width??l.measured.width??0,c=e.height??l.measured.height??0,u=OT([{id:l.id,parentId:l.parentId,rect:{width:n,height:c,...JA({x:e.x??l.position.x,y:e.y??l.position.y},{width:n,height:c},l.parentId,r,t)}}],r,o,a);i.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==s.x&&void 0!==s.y){const e={id:v,type:"position",position:{...s}};i.push(e)}if(void 0!==e.width&&void 0!==e.height){const t={id:v,type:"dimensions",resizing:!0,setAttributes:!p||("horizontal"===p?"width":"height"),dimensions:{width:e.width,height:e.height}};i.push(t)}for(const e of t){const t={...e,type:"position"};i.push(t)}n(i)},onEnd:({width:e,height:t})=>{const n={id:v,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}})),I.current.update({controlPosition:S,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:p,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:h}),()=>{I.current?.destroy()}},[S,l,c,u,d,f,g,w,y,h]);const k=S.split("-");return(0,j.jsx)("div",{className:cL(["react-flow__resize-control","nodrag",...k,n,r]),ref:N,style:{...o,scale:_,...i&&{[E?"backgroundColor":"borderColor"]:i}},children:a})});const hP=(0,s.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o="start"===e?.position,a="end"===e?.position,{position:s,id:l}="start"==(o?"start":"end")?n?{position:bA.Bottom,id:"bottom"}:r?{position:bA.Right,id:"right"}:{position:bA.Left,id:"left"}:n?{position:bA.Top,id:"top"}:r?{position:bA.Left,id:"left"}:{position:bA.Right,id:"right"};return(0,i.createElement)(i.Fragment,null,a&&(0,i.createElement)(DO,{type:"target",position:s,id:l,style:{background:"#555",border:"2px dotted #555",transition:"all 0.3s ease"},className:`react-flow__handle wcf-handle-${l}`,isConnectable:t}),(0,i.createElement)("div",{className:"wcf-custom-label-node--wrapper bg-primary-50 py-1 px-3 border border-primary-300 rounded-md text-primary-500 text-sm font-medium","aria-label":e.label},e.label),o&&(0,i.createElement)(DO,{type:"source",position:s,id:l,style:{border:"2px dotted #555",transition:"all 0.3s ease"},className:`react-flow__handle wcf-handle-${l}`,isConnectable:t}))});function gP({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const wP=s.forwardRef(gP),yP=(0,s.memo)(({data:e,isConnectable:t})=>{const n="LR"===e.direction?"target":"source",r="LR"===e.direction?"source":"target",o=(Array.isArray(e?.conditions)?e.conditions.length:0)+(e?.defaultStep?1:0),a=o?(0,C.sprintf)(/* translators: %d: number of dynamic-offer conditions on this checkout */ /* translators: %d: number of dynamic-offer conditions on this checkout */
35 -(0,C._n)("%d condition","%d conditions",o,"cartflows"),o):"";return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:n,position:bA.Left,style:{background:"#555"},isConnectable:t,className:"react-flow__handle wcf-handle-left"}),(0,i.createElement)("div",{className:"wcf-custom-node-wrapper wcf-conditional-node",style:{width:"80px",margin:"auto",height:"80px",display:"flex",alignItems:"center",justifyContent:"center",transform:"rotate(45deg)"}},(0,i.createElement)("div",{className:"wcf-custom-node-design"},(0,i.createElement)(S,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.checkoutId}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.checkoutId}`},title:"Dynamic Offers",rel:"noreferrer",className:"wcf-custom-node-content bg-white border border-gray-200 shadow-md",style:{width:"80px",margin:"auto",height:"80px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},(0,i.createElement)(wP,{className:"w-8 h-8 !fill-[none] stroke-2 text-gray-500",style:{transform:"rotate(-45deg)"}})))),(0,i.createElement)("div",{className:"wcf-custom-node-label",style:{fontSize:"11px",fontWeight:"600",marginTop:"8px",textAlign:"center"}},e.label||(0,C.__)("Dynamic Offers","cartflows")),a&&(0,i.createElement)("div",{className:"wcf-conditional-node__summary",style:{fontSize:"10px",color:"#6B7280",marginTop:"2px",textAlign:"center"}},a),(0,i.createElement)(DO,{type:r,position:bA.Right,style:{background:"#555"},isConnectable:t,className:"react-flow__handle wcf-handle-right"}))}),bP="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOEgwVjEwWiIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQiIHI9IjQiIGZpbGw9IiNGRjNCMzAiLz48Y2lyY2xlIGN4PSIyNyIgY3k9IjE0IiByPSI0IiBmaWxsPSIjRkMwIi8+PGNpcmNsZSBjeD0iNDAiIGN5PSIxNCIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjY0IiB5PSIxMCIgd2lkdGg9IjEwNyIgaGVpZ2h0PSI3IiByeD0iMSIgZmlsbD0iI2ZmZiIvPjxyZWN0IHg9IjIzIiB5PSIyMjAiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTY3LjIwNiAyMzMuNWgyLjc5NmMxLjQ3IDAgMi4yNTMtLjc2NyAyLjI1My0xLjgwOSAwLS45NjgtLjY5My0xLjU1My0xLjQzOC0xLjU4OHYtLjA2NGMuNjgtLjE1NCAxLjE4My0uNjM2IDEuMTgzLTEuNDA3IDAtLjk4MS0uNzI5LTEuNjc3LTIuMTc0LTEuNjc3aC0yLjYydjYuNTQ1Wm0xLjM4My0xLjEzMXYtMS43MzloMS4xNmMuNjY1IDAgMS4wNzguMzgzIDEuMDc4LjkyNCAwIC40OTItLjMzNi44MTUtMS4xMS44MTVINjguNTlabTAtMi42NzV2LTEuNjIxaDEuMDUyYy42MTQgMCAuOTYyLjMxNy45NjIuNzkgMCAuNTE3LS40MjIuODMxLS45ODguODMxSDY4LjU5Wm03LjY5IDEuNzE2Yy4wMDIuNjU4LS40NDggMS4wMDMtLjkzNyAxLjAwMy0uNTE1IDAtLjg0Ny0uMzYxLS44NS0uOTM5di0yLjg4M0g3My4xM3YzLjEyNmMuMDAzIDEuMTQ3LjY3NSAxLjg0NyAxLjY2MiAxLjg0Ny43MzkgMCAxLjI2OS0uMzggMS40OS0uOTU2aC4wNXYuODkyaDEuMzA4di00LjkwOWgtMS4zNjJ2Mi44MTlabTMuMjkgMy45MzFjMS4wMTQgMCAxLjU1LS41MTggMS44MjgtMS4zMWwxLjkwOS01LjQzNC0xLjQ0Mi0uMDA2LTEuMDI2IDMuNjA1aC0uMDVsLTEuMDE3LTMuNjA1aC0xLjQzMmwxLjc2MSA1LjA1LS4wOC4yMDdjLS4xNzkuNDYxLS41Mi40ODMtMSAuMzM2bC0uMzA3IDEuMDE2Yy4xOTUuMDgzLjUxMS4xNDEuODU2LjE0MVptMTIuMDE3LTguMzg2aC0xLjM3OHY0LjExNmgtLjA1N2wtMi44MjYtNC4xMTZoLTEuMjE0djYuNTQ1aDEuMzg0di00LjEyaC4wNDhsMi44NDcgNC4xMmgxLjE5NnYtNi41NDVabTMuMzM1IDYuNjQxYzEuNDkgMCAyLjQxNy0xLjAyIDIuNDE3LTIuNTMxIDAtMS41MjItLjkyNy0yLjUzOC0yLjQxNi0yLjUzOC0xLjQ5IDAtMi40MTcgMS4wMTYtMi40MTcgMi41MzggMCAxLjUxMS45MjcgMi41MzEgMi40MTYgMi41MzFabS4wMDctMS4wNTVjLS42ODcgMC0xLjAzOS0uNjI5LTEuMDM5LTEuNDg2IDAtLjg1Ni4zNTItMS40ODkgMS4wMzktMS40ODkuNjc0IDAgMS4wMjYuNjMzIDEuMDI2IDEuNDg5IDAgLjg1Ny0uMzUyIDEuNDg2LTEuMDI2IDEuNDg2Wm00LjE0Ljk1OWgxLjQzOWwuODQzLTMuMDg3aC4wNjFsLjg0NCAzLjA4N2gxLjQ0MWwxLjMzMy00LjkwOWgtMS4zNzRsLS43NDggMy4yNzloLS4wNDJsLS44MDUtMy4yNzloLTEuMzUybC0uNzkzIDMuMjk4aC0uMDQ0bC0uNzYxLTMuMjk4aC0xLjM3OGwxLjMzNiA0LjkwOVptOS4wNzEtMi42MjRjMCAxLjU4OC40MTggMi45MDggMS4yOTEgNC4wNDZoMS4zMDFjLS42NjgtLjg0NC0xLjE3Ni0yLjUzMS0xLjE3Ni00LjA0NiAwLTEuNTEyLjUwOC0zLjE5OSAxLjE3Ni00LjA0M2gtMS4zMDFjLS44NzMgMS4xMzgtMS4yOTEgMi40NTUtMS4yOTEgNC4wNDNabTkuMTgzLTEuNjNjLS4xODMtMS41MTItMS4zMjctMi4zODEtMi44NDItMi4zODEtMS43MjkgMC0zLjA0OSAxLjIyMS0zLjA0OSAzLjM2MiAwIDIuMTM1IDEuMjk4IDMuMzYyIDMuMDQ5IDMuMzYyIDEuNjc4IDAgMi42OTEtMS4xMTUgMi44NDItMi4zMmwtMS40LS4wMDZjLS4xMzEuNy0uNjgxIDEuMTAyLTEuNDE5IDEuMTAyLS45OTQgMC0xLjY2OS0uNzM4LTEuNjY5LTIuMTM4IDAtMS4zNjEuNjY1LTIuMTM4IDEuNjc4LTIuMTM4Ljc1OCAwIDEuMzA0LjQzOCAxLjQxIDEuMTU3aDEuNFptLjc0My0xLjE1aDIuMDA0djUuNDA0aDEuMzY4di01LjQwNGgyLjAwM3YtMS4xNDFoLTUuMzc1djEuMTQxWm02LjU4IDUuNDA0LjQ4Ni0xLjQ5M2gyLjM2MmwuNDg2IDEuNDkzaDEuNDgzbC0yLjI1Ny02LjU0NWgtMS43ODNsLTIuMjYgNi41NDVoMS40ODNabS44MzgtMi41NzMuODA1LTIuNDc3aC4wNTFsLjgwNiAyLjQ3N2gtMS42NjJabTcuMDM2LS43YzAtMS41ODgtLjQxOS0yLjkwOC0xLjI5MS00LjA0NmgtMS4zMDFjLjY2OC44NDQgMS4xNzYgMi41MzEgMS4xNzYgNC4wNDYgMCAxLjUxMi0uNTA4IDMuMTk5LTEuMTc2IDQuMDQzaDEuMzAxYy44NzItMS4xMzggMS4yOTEtMi40NTQgMS4yOTEtNC4wNDNaIiBmaWxsPSIjZmZmIi8+PHJlY3QgeD0iNjUiIHk9IjE2NCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iNzUiIHk9IjU3IiB3aWR0aD0iNTAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSI1MCIgeT0iNDMiIHdpZHRoPSIxMDAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiMyMjcxQjEiLz48cmVjdCB4PSIyMy43NSIgeT0iNzYuNzUiIHdpZHRoPSIxNTIuNSIgaGVpZ2h0PSI2MS41IiByeD0iMS4yNSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxwYXRoIGQ9Im05NS44NzcgMTEzLjQ4MyAxOS4xMTMtMTkuMzg0IDI4LjM0OSAzMi4xNTFINTguODc2bDI0LjUzLTIzLjM1MSAxMS40MjcgMTAuNjA3LjUzMy40OTUuNTEtLjUxOFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIxLjUiLz48cGF0aCBkPSJNMTAxLjI1IDk1YzAgMi45NjItMi4xODcgNS4yNS00Ljc1IDUuMjVzLTQuNzUtMi4yODgtNC43NS01LjI1IDIuMTg3LTUuMjUgNC43NS01LjI1IDQuNzUgMi4yODggNC43NSA1LjI1WiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxwYXRoIGQ9Im0xNjYuNzI3IDExMS4wNiAzLjA1My0zLjA2LTMuMDUzLTMuMDYuOTQtLjk0IDQgNC00IDQtLjk0LS45NFpNMzQuMjcyIDExMS4wNiAzMS4yMTkgMTA4bDMuMDUzLTMuMDYtLjk0LS45NC00IDQgNCA0IC45NC0uOTRaIiBmaWxsPSIjMjI3MUIxIi8+PGNpcmNsZSBjeD0iOTEuNSIgY3k9IjE0Ny41IiByPSIxLjUiIGZpbGw9IiMyMjcxQjEiLz48Y2lyY2xlIGN4PSI5OS41IiBjeT0iMTQ3LjUiIHI9IjEuNSIgZmlsbD0iIzIyNzFCMSIvPjxjaXJjbGUgY3g9IjEwNy41IiBjeT0iMTQ3LjUiIHI9IjEuNSIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjIzIiB5PSIxNzgiIHdpZHRoPSIxNTQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIyMyIgeT0iMTkyIiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMjMiIHk9IjIwNiIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjwvc3ZnPg==";function vP({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const xP=s.forwardRef(vP);function NP({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"}))}const EP=s.forwardRef(NP);function _P({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.51-5.511-3.181"}))}const MP=s.forwardRef(_P);function IP({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z"}))}const SP=s.forwardRef(IP);function kP({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"}))}const DP=s.forwardRef(kP),CP=To("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),jP=To("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]),AP=To("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),TP=To("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]),LP=To("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),OP=To("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]),zP=To("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),PP=To("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),RP=To("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),UP=To("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]),BP=To("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),FP=e=>{const t=Number(e)||0;return 0===t?"—":Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`},QP=({bump:e,settingsUrl:t})=>{const n=!e.revenue&&!e.conversions;return(0,i.createElement)(S,{to:{pathname:"admin.php",search:t},className:"wcf-bump-row bg-background-secondary border border-solid border-border-subtle rounded-md px-3 py-2 no-underline hover:bg-background-tertiary",title:e.title},(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)("span",{className:"wcf-bump-row__icon bg-primary-25 p-1 rounded border border-solid border-primary-300 inline-flex items-center justify-center shrink-0","aria-label":(0,C.__)("Order bump","cartflows")},(0,i.createElement)(BP,{className:"w-3 h-3 stroke-2 text-primary-500"})),(0,i.createElement)(Vm,{as:"span",size:14,color:n?"tertiary":"primary",className:"wcf-bump-row__title truncate flex-1 text-left"},e.title),(0,i.createElement)(Vm,{as:"span",size:12,color:n?"tertiary":"secondary",className:"tabular-nums w-10 text-right"},(e=>{const t=parseInt(e,10)||0;return 0===t?"—":String(t)})(e.conversions)),(0,i.createElement)(Vm,{as:"span",size:14,weight:n?400:600,color:n?"tertiary":"primary",className:"tabular-nums w-14 text-right"},FP(e.revenue)),(0,i.createElement)(Ex,{className:"w-3 h-3 stroke-2 text-text-tertiary shrink-0"})))},VP=({stepId:e,flowId:t,flowType:n,bumps:r=[],compact:o=!1})=>{const[a,l]=(0,s.useState)(!1);if(!Array.isArray(r)||0===r.length)return null;const c=r.reduce((e,t)=>e+(Number(t.revenue)||0),0),u="storeCheckout"===n?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps`;return o?(0,i.createElement)(S,{to:{pathname:"admin.php",search:u},className:"wcf-bumps-section wcf-bumps-section--compact px-3 py-2 border-0 border-t border-b border-solid border-border-subtle no-underline hover:bg-background-secondary"},(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",justify:"between"},(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)(BP,{className:"w-3.5 h-3.5 stroke-2 text-text-primary"}),(0,i.createElement)(Vm,{as:"span",size:12,weight:500,color:"primary"},(0,C.__)("Order Bumps","cartflows")),(0,i.createElement)(Vm,{as:"span",size:12,color:"secondary",className:"tabular-nums"},"(",r.length,")")),(0,i.createElement)(Vm,{as:"span",size:12,color:"secondary",className:"tabular-nums"},FP(c)))):(0,i.createElement)(zm,{containerType:"flex",direction:"column",className:"wcf-bumps-section px-4 py-3 border-0 border-t border-b border-solid border-border-subtle "+(a?"":"!gap-0")},(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",justify:"between",className:a?"mb-2":""},(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)(BP,{className:"w-4 h-4 stroke-2 text-text-primary"}),(0,i.createElement)(Vm,{as:"span",size:14,weight:500,color:"primary"},(0,C.__)("Order Bumps","cartflows")),(0,i.createElement)(Vm,{as:"span",size:12,color:"secondary",className:"tabular-nums"},"(",r.length,")")),(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)(Vm,{as:"span",size:12,color:"tertiary"},(0,C.__)("Total","cartflows")),(0,i.createElement)(Vm,{as:"span",size:12,weight:500,color:"primary",className:"tabular-nums"},FP(c)),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",type:"button",onClick:()=>l(e=>!e),"aria-expanded":a,"aria-label":a?(0,C.__)("Collapse order bumps","cartflows"):(0,C.__)("Expand order bumps","cartflows"),icon:(0,i.createElement)(cp,{className:"stroke-2 transition-transform duration-300 ease-in-out "+(a?"rotate-180":"")}),className:"wcf-bumps-section__toggle !p-0.5 text-text-tertiary hover:text-text-primary"}))),(0,i.createElement)("div",{className:"wcf-bumps-section__body grid transition-[grid-template-rows] duration-300 ease-in-out "+(a?"grid-rows-[1fr]":"grid-rows-[0fr]"),"aria-hidden":!a},(0,i.createElement)("div",{className:"overflow-hidden min-h-0"},(0,i.createElement)(zm,{containerType:"flex",direction:"column",gap:"xs"},r.map(e=>(0,i.createElement)(QP,{key:e.id,bump:e,settingsUrl:u}))),(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",justify:"end",gap:"sm",className:"pt-1.5 mt-0.5"},(0,i.createElement)(Vm,{as:"span",size:12,color:"tertiary",className:"uppercase tracking-wide w-10 text-right"},(0,C.__)("Sales","cartflows")),(0,i.createElement)(Vm,{as:"span",size:12,color:"tertiary",className:"uppercase tracking-wide w-14 text-right"},(0,C.__)("Revenue","cartflows")),(0,i.createElement)("span",{className:"w-3","aria-hidden":"true"})))))},YP={cloneStepRequest({stepId:e,flowId:t,action:n="cartflows_clone_step",controlId:r}){if(!wcfCartflowsPro())return Promise.resolve(null);let o=cartflows_admin.clone_step_nonce;const a=new window.FormData;return"cartflows_clone_ab_test_step"===n&&(o=cartflows_admin.wcf_clone_ab_test_step_nonce,a.append("control_id",r)),a.append("action",n),a.append("security",o),a.append("step_id",e),a.append("post_id",t),window.wcfAction="cloneStep",qf()({url:cartflows_admin.ajax_url,method:"POST",body:a})},createEventHandlers:(e,t,n,r,o={})=>({clone:async function(n){if(n.preventDefault(),!wcfCartflowsPro())return null;const o=n.currentTarget.getAttribute("data-action");if(await t({title:(0,C.__)("Duplicate Step","cartflows"),description:(0,C.__)("Do you want to duplicate this step? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Yes","cartflows"),cancelBtnText:(0,C.__)("No","cartflows")})){r(!0);let t=cartflows_admin.clone_step_nonce;const n=new window.FormData;"cartflows_clone_ab_test_step"===o&&(t=cartflows_admin.wcf_clone_ab_test_step_nonce,n.append("control_id",e?.control_id)),n.append("action",o),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),window.wcfAction="cloneStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Cloning step failed:",e),r(!1)}))}},delete:o.delete||async function(n){n.preventDefault();const o=n.currentTarget.getAttribute("data-action");if(await t({title:(0,C.__)("Delete Step","cartflows"),description:(0,C.__)("Do you want to delete this step? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Yes","cartflows"),cancelBtnText:(0,C.__)("No","cartflows")})){r(!0);let t=cartflows_admin.delete_step_nonce;const n=new window.FormData;"cartflows_delete_ab_test_step"===o&&(t=cartflows_admin.wcf_delete_ab_test_step_nonce,n.append("control_id",e?.control_id)),n.append("action",o),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),window.wcfAction="deleteStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Delete step failed:",e),r(!1)}))}},abtest:function(t){if(t.preventDefault(),!wcfCartflowsTypePro())return null;r(!0);const n=new window.FormData;n.append("action","cartflows_create_ab_test_variation"),n.append("security",cartflows_admin.wcf_create_ab_test_variation_nonce),n.append("step_id",e?.step_id),n.append("flow_id",e?.flow_id),window.wcfAction="abtestStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Create A/B variation failed:",e),r(!1)}))},winner:async function(n){if(n.preventDefault(),await t({title:(0,C.__)("Declare Winner","cartflows"),description:(0,C.__)("Do you want to declare this step as winner? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Declare Winner","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){r(!0);const t=new window.FormData;t.append("action","cartflows_declare_ab_test_winner"),t.append("security",cartflows_admin.wcf_declare_ab_test_winner_nonce),t.append("step_id",e?.step_id),t.append("flow_id",e?.flow_id),window.wcfAction="winnerStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{hm.success((0,C.__)("Winner declared successfully!","cartflows")),window.location.reload()}).catch(e=>{console.error("Declare A/B test winner failed:",e),hm.error((0,C.__)("Failed to declare winner. Please try again.","cartflows")),r(!1)}))}},archived:async function(n){if(n.preventDefault(),await t({title:(0,C.__)("Archive Step","cartflows"),description:(0,C.__)("Do you want to archive this step? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Yes","cartflows"),cancelBtnText:(0,C.__)("No","cartflows")})){r(!0);const t=new window.FormData;t.append("action","cartflows_archive_ab_test_step"),t.append("security",cartflows_admin.wcf_archive_ab_test_step_nonce),t.append("step_id",e?.step_id),t.append("post_id",e?.flow_id),window.wcfAction="archiveStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{window.location.reload()}).catch(e=>{console.error("Archiving step failed:",e),r(!1)}))}},automation:()=>{n.push({pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&automation=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&automation=${e?.step_id}`})}}),async performDelete(e,t,r,o={}){r(!0);let a=cartflows_admin.delete_step_nonce;const i=new window.FormData;"cartflows_delete_ab_test_step"===t&&(a=cartflows_admin.wcf_delete_ab_test_step_nonce,i.append("control_id",e?.control_id)),i.append("action",t),i.append("security",a),i.append("step_id",e?.step_id),i.append("post_id",e?.flow_id),Object.keys(o).length>0&&i.append("redirect_updates",JSON.stringify(o)),window.wcfAction="deleteStep";try{const e=(await Promise.resolve().then(n.t.bind(n,1455,23))).default;await e({url:cartflows_admin.ajax_url,method:"POST",body:i}),window.location.reload()}catch(e){console.error("Delete step failed:",e),r(!1)}},nodeHtml(e,t,n,r,o,a,s,l,c,u,d,f,p=[],m=!1,h=[],g="",w=!1,y=!1){const b=lm(e?.step_type,g),v=()=>{let e=0;return c&&c.visits&&(e=c.visits.total_visits||0),e},x=()=>{let e=0;return c&&c.visits&&(e=c.visits.conversions||0),e},N=()=>c&&c?.visits?.revenue?Zm(c.visits.revenue):0,E=e?.step_type||"",_=sm(e?.step_title||"");return(0,i.createElement)("div",{className:`wcf-custom-node-wrapper${m?" wcf-custom-node-wrapper--compact":""}${w?" wcf-custom-node-wrapper--locked pointer-events-none touch-none opacity-60":""}`},(0,i.createElement)("div",{className:"wcf-custom-node-design"},(0,i.createElement)("div",{className:"wcf-node-actions absolute flex bg-white left-11 -top-16 rounded-md py-0.5 px-1.5 sm:hidden lg:hidden"},(0,i.createElement)(Wo,{content:(0,C.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,C.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(zP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:b?cm():(0,C.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:b?"#!":r,target:b?void 0:"_blank",rel:"noreferrer","aria-label":(0,C.__)("Edit Page","cartflows"),"aria-disabled":b,tabIndex:b?-1:0,className:"wcf-canvas--edit-step p-2 block "+(b?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,i.createElement)(PP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:(0,C.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)(S,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,C.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(RP,{className:"w-5 h-5"})))),(0,i.createElement)("div",{className:"wcf-custom-node-content bg-white border border-gray-200 rounded-lg shadow-md"+(f?" opacity-50":"")},(0,i.createElement)("div",{className:"wcf-custom-node-content--header flex flex-col gap-3 border-b border-gray-200 py-4 px-5"},(0,i.createElement)("div",{className:"wcf-node-step--info-wrapper flex flex-row items-center gap-4 w-full"},(0,i.createElement)("div",{className:"wcf-node-step--icon bg-primary-25 p-2.5 rounded border border-primary-300"},(e=>{let t="";const n="w-5 h-5 stroke-2 text-primary-500";switch(e){case"landing":t=(0,i.createElement)(xP,{className:n});break;case"optin":t=(0,i.createElement)(EP,{className:n});break;case"checkout":t=(0,i.createElement)(NI,{className:n});break;case"upsell":t=(0,i.createElement)(Cp,{className:n});break;case"downsell":t=(0,i.createElement)(MP,{className:n});break;case"thankyou":t=(0,i.createElement)(SP,{className:n});break;default:t=(0,i.createElement)(DP,{className:n})}return t})(E)),(0,i.createElement)("div",{className:"w-full flex flex-col gap-1"},(0,i.createElement)("div",{className:"wcf-node-step--type flex items-center gap-2"},(0,i.createElement)("span",{className:"text-xs font-normal text-gray-400"},(M=E,{landing:(0,C.__)("Landing","cartflows"),optin:(0,C.__)("Optin","cartflows"),checkout:(0,C.__)("Checkout","cartflows"),upsell:(0,C.__)("Upsell","cartflows"),downsell:(0,C.__)("Downsell","cartflows"),thankyou:(0,C.__)("Thank You","cartflows")}[M]||M)),u&&(0,i.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-invalid-sequence-badge"},(0,i.createElement)(Ph,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,C.__)("Invalid Position","cartflows"))),(0,i.createElement)("div",{className:"wcf-node-step--title text-left"},(0,i.createElement)("span",{className:"font-semibold text-sm text-gray-800 hover:text-gray-800"},_)))),function(){let e=null;return d||(e=(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-no-product-badge"},(0,C.__)("No Product Assigned","cartflows"))),e}(),y&&(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-global-checkout-error-badge"},(0,C.__)("Store Checkout - Remove selected checkout product","cartflows")),f&&(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-disabled-step-badge"},(0,C.__)("Disabled","cartflows")),p&&p.length>0&&(0,i.createElement)("div",{className:"wcf-node-warnings flex flex-wrap gap-1"},p.slice(0,2).map((e,t)=>(0,i.createElement)("span",{key:t,className:`wcf-badge wcf-badge--${"error"===e.severity?"error":"warning"} wcf-warning-pill !text-[10px] !px-2 !py-px`,title:e.message},e.message)),p.length>2&&(0,i.createElement)("span",{className:"wcf-badge wcf-warning-pill-more !text-[10px] !px-2 !py-px",title:p.slice(2).map(e=>e.message).join(", ")},"+",p.length-2))),(0,i.createElement)("div",{className:"wcf-custom-node-content--stats flex text-center justify-around items-center py-4 px-5"},(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-view"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,C.__)("Views","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},v())),(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-conversation"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,C.__)("Conversions","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==E?x():"-")),(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-revenue"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,C.__)("Revenue","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==E&&"landing"!==E?N():"-"))),m&&(0,i.createElement)("div",{className:"wcf-custom-node-content--stats-compact flex items-center justify-center gap-2 py-2 px-4 border-t border-gray-200 text-xs text-gray-600"},(0,i.createElement)("span",{className:"tabular-nums"},(0,i.createElement)("span",{className:"font-semibold text-gray-800"},v())," ",(0,i.createElement)("span",{className:"text-gray-400"},(0,C.__)("views","cartflows"))),"thankyou"!==E&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"text-gray-300"},"·"),(0,i.createElement)("span",{className:"tabular-nums"},(0,i.createElement)("span",{className:"font-semibold text-gray-800"},x())," ",(0,i.createElement)("span",{className:"text-gray-400"},(0,C.__)("conv.","cartflows")))),"thankyou"!==E&&"landing"!==E&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"text-gray-300"},"·"),(0,i.createElement)("span",{className:"font-semibold text-gray-800 tabular-nums"},N()))),"checkout"===E&&Array.isArray(h)&&h.length>0&&(0,i.createElement)(VP,{stepId:e?.step_id,flowId:e?.flow_id,flowType:e?.flow_type,bumps:h,compact:m}),(0,i.createElement)("div",{className:"wcf-custom-node-content--footer flex text-center justify-around items-center border-t border-gray-200 py-4 px-5"},(0,i.createElement)(Wo,{content:(0,C.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,C.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 inline-flex items-center justify-center rounded-md"},(0,i.createElement)(zP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:b?cm():(0,C.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:b?"#!":r,target:b?void 0:"_blank",rel:"noreferrer","aria-label":(0,C.__)("Edit Page","cartflows"),"aria-disabled":b,tabIndex:b?-1:0,className:"wcf-canvas--edit-step p-2 inline-flex items-center justify-center rounded-md "+(b?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,i.createElement)(PP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:(0,C.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)(S,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,C.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 inline-flex items-center justify-center rounded-md"},(0,i.createElement)(RP,{className:"w-5 h-5"}))),(o?Object.keys(o):[]).map(t=>{const n=o[t],r=n?.class;let a=!1,c=!1;if((!wcfCartflowsPro()&&n?.pro||"abtest"===n?.slug&&!wcfCartflowsTypePro())&&(a=!0),wcfCartflowsPro()&&n?.pro&&"Activated"!==l&&(c=!0),"automation"===n?.slug&&"downsell"!==E&&"upsell"!==E&&"checkout"!==E)return null;const u=a||c,d=u?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary cursor-pointer "+("delete"===n?.slug?"hover:bg-field-background-error hover:text-button-danger":"hover:bg-badge-hover-gray hover:text-text-primary");return(0,i.createElement)(Wo,{key:n?.slug,content:n?.text,placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n?.link,className:`wcf-step__action-btn relative p-2 inline-flex items-center justify-center rounded-md ${r} ${d}`,"aria-label":n?.text,"data-id":e?.step_id,"data-control-id":e?.step_id,onClick:e=>{a||c?e.preventDefault():"#"===n?.link&&s&&s[n?.slug]&&(e.preventDefault(),s[n?.slug](e))},"data-action":n?.ajaxcall},function(e){let t="";switch(e){case"clone":t=(0,i.createElement)(CP,{className:"h-5 w-5"});break;case"delete":t=(0,i.createElement)(Po,{className:"h-5 w-5"});break;case"abtest":t=(0,i.createElement)(jP,{className:"h-5 w-5"});break;case"archived":t=(0,i.createElement)(AP,{className:"h-5 w-5"});break;case"winner":t=(0,i.createElement)(TP,{className:"h-5 w-5"});break;case"automation":t=(0,i.createElement)(LP,{className:"h-5 w-5"});break;default:t=(0,i.createElement)(OP,{className:"h-5 w-5"})}return t}(n?.slug),u&&(0,i.createElement)(UP,{className:"absolute -top-1 -right-1 w-4 h-4 text-brand-600 fill-brand-600","aria-label":(0,C.__)("Pro feature","cartflows")})))})))));var M}},ZP=YP,WP=(0,s.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o=r?"target":"source",a=r?"source":"target",[,l]=(0,s.useState)(!1),c=Oh(),u=(0,qh.W6)(),[{license_status:d}]=f(),p=ZP.createEventHandlers(e,c,u,l);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:o,position:bA.Left,id:"left",style:{background:"#555",border:"2px dotted #555",transition:"all 0.3s ease",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),(0,i.createElement)(DO,{type:"target",position:bA.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t&&n}),ZP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},bP,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,p,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,void 0,void 0,e.is_locked),(0,i.createElement)("div",{className:"wcf-custom-node-label",title:e.label},e?.label),(0,i.createElement)(DO,{type:a,position:bA.Right,id:"right",style:{border:"2px dotted #555",transition:"all 0.3s ease",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,i.createElement)(DO,{type:"source",position:bA.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),GP="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOEgwVjEwWiIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjY0IiB5PSIxMCIgd2lkdGg9IjEwNyIgaGVpZ2h0PSI3IiByeD0iMSIgZmlsbD0iI2ZmZiIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQiIHI9IjQiIGZpbGw9IiNGRjNCMzAiLz48Y2lyY2xlIGN4PSIyNyIgY3k9IjE0IiByPSI0IiBmaWxsPSIjRkMwIi8+PGNpcmNsZSBjeD0iNDAiIGN5PSIxNCIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjIzIiB5PSIyMTkiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTgxLjY4NiAyMzIuNWgxLjM4M3YtMi4xMjJoMS4xNjRjMS41MDUgMCAyLjM4LS44OTggMi4zOC0yLjIwNSAwLTEuMzAxLS44NTktMi4yMTgtMi4zNDUtMi4yMThoLTIuNTgydjYuNTQ1Wm0xLjM4My0zLjIzMXYtMi4xODNoLjkzNGMuNzk5IDAgMS4xODUuNDM1IDEuMTg1IDEuMDg3IDAgLjY0OC0uMzg2IDEuMDk2LTEuMTc5IDEuMDk2aC0uOTRabTUuNjg2IDMuMzI0Yy43MjYgMCAxLjE5Ni0uMzE3IDEuNDM1LS43NzRoLjAzOXYuNjgxaDEuMjl2LTMuMzExYzAtMS4xNy0uOTktMS42NjItMi4wODMtMS42NjItMS4xNzYgMC0xLjk1LjU2Mi0yLjEzOCAxLjQ1N2wxLjI1OS4xMDNjLjA5My0uMzI2LjM4NC0uNTY2Ljg3My0uNTY2LjQ2MyAwIC43MjguMjMzLjcyOC42MzZ2LjAxOWMwIC4zMTctLjMzNS4zNTgtMS4xODkuNDQxLS45NzEuMDktMS44NDQuNDE2LTEuODQ0IDEuNTEyIDAgLjk3MS42OTQgMS40NjQgMS42MyAxLjQ2NFptLjM5LS45NGMtLjQxOSAwLS43MTktLjE5NS0uNzE5LS41NjkgMC0uMzgzLjMxNi0uNTcyLjc5Ni0uNjM5LjI5Ny0uMDQyLjc4My0uMTEyLjk0Ni0uMjIxdi41MjFjMCAuNTE1LS40MjUuOTA4LTEuMDIzLjkwOFptNC4wOTYgMi42ODhjMS4wMTMgMCAxLjU1LS41MTggMS44MjgtMS4zMWwxLjkwOC01LjQzNC0xLjQ0MS0uMDA2LTEuMDI2IDMuNjA1aC0uMDUybC0xLjAxNi0zLjYwNUg5Mi4wMWwxLjc2MSA1LjA1LS4wOC4yMDdjLS4xNzguNDYxLS41Mi40ODMtMSAuMzM2bC0uMzA3IDEuMDE2Yy4xOTUuMDgzLjUxMi4xNDEuODU3LjE0MVptMTIuMDE2LTguMzg2aC0xLjM3N3Y0LjExNmgtLjA1OGwtMi44MjUtNC4xMTZoLTEuMjE1djYuNTQ1aDEuMzg0di00LjEyaC4wNDhsMi44NDggNC4xMmgxLjE5NXYtNi41NDVabTMuMzM2IDYuNjQxYzEuNDg5IDAgMi40MTYtMS4wMiAyLjQxNi0yLjUzMSAwLTEuNTIyLS45MjctMi41MzgtMi40MTYtMi41MzgtMS40ODkgMC0yLjQxNiAxLjAxNi0yLjQxNiAyLjUzOCAwIDEuNTExLjkyNyAyLjUzMSAyLjQxNiAyLjUzMVptLjAwNi0xLjA1NWMtLjY4NyAwLTEuMDM4LS42MjktMS4wMzgtMS40ODYgMC0uODU2LjM1MS0xLjQ4OSAxLjAzOC0xLjQ4OS42NzUgMCAxLjAyNi42MzMgMS4wMjYgMS40ODkgMCAuODU3LS4zNTEgMS40ODYtMS4wMjYgMS40ODZabTQuMTQxLjk1OWgxLjQzOGwuODQ0LTMuMDg3aC4wNmwuODQ0IDMuMDg3aDEuNDQybDEuMzMyLTQuOTA5aC0xLjM3NGwtLjc0OCAzLjI3OWgtLjA0MWwtLjgwNi0zLjI3OWgtMS4zNTJsLS43OTIgMy4yOThoLS4wNDVsLS43NjEtMy4yOThoLTEuMzc3bDEuMzM2IDQuOTA5WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0yNC40OTUgMTUxLjMzM2EuNS41IDAgMCAxIC41LS41SDE3NmEuNS41IDAgMCAxIC41LjV2NmEuNS41IDAgMCAxLS41LjVIMjQuOTk1YS41LjUgMCAwIDEtLjUtLjV2LTZaTTI0LjQ5NSAxNjguNjY3YS41LjUgMCAwIDEgLjUtLjVIMTc2YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUgyNC45OTVhLjUuNSAwIDAgMS0uNS0uNXYtNlpNMjQuNDk1IDE4NmEuNS41IDAgMCAxIC41LS41SDY4LjI1YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUgyNC45OTVhLjUuNSAwIDAgMS0uNS0uNXYtNlpNNzguMzcgMTg2YS41LjUgMCAwIDEgLjUtLjVoNDMuMjU1YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUg3OC44N2EuNS41IDAgMCAxLS41LS41di02Wk0xMzIuMjQ1IDE4NmEuNS41IDAgMCAxIC41LS41SDE3NmEuNS41IDAgMCAxIC41LjV2NmEuNS41IDAgMCAxLS41LjVoLTQzLjI1NWEuNS41IDAgMCAxLS41LS41di02WiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjQjdDRkUyIi8+PHJlY3QgeD0iMjMuNSIgeT0iMjAyLjUiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIHJ4PSIuNSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjQ0NERUVEIi8+PHJlY3QgeD0iNDMuMzkiIHk9IjIwNCIgd2lkdGg9IjEzMy42MSIgaGVpZ2h0PSIyLjY2NyIgcng9IjEiIGZpbGw9IiNCN0NGRTIiLz48ZyBjbGlwLXBhdGg9InVybCgjYSkiIGZpbGw9IiMyMjcxQjEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjQiPjxwYXRoIGQ9Im05OS4wMDUgODIuMzY4LjQ5NS40OTYuNDk1LS40OTYgMTIuNDAzLTEyLjQwN2ExLjY0OCAxLjY0OCAwIDAgMSAyLjgxMSAxLjE2NGMwIC40MzctLjE3My44NTYtLjQ4MiAxLjE2NGwtMTQuMDYzIDE0LjA2M2ExLjY0MyAxLjY0MyAwIDAgMS0yLjMyOCAwbC03LjAzMi03LjAzMWExLjY0OSAxLjY0OSAwIDAgMSAwLTIuMzMgMS42NDQgMS42NDQgMCAwIDEgMi4zMyAwbDUuMzcgNS4zNzdaIi8+PHBhdGggZD0ibTcwLjIyNiA1Mi4yMDYtLjEzMi0uNTMxaC01Ljc1YTEuNjQ0IDEuNjQ0IDAgMCAxIDAtMy4yODdINzEuMzc1YTEuNjQzIDEuNjQzIDAgMCAxIDEuNTk0IDEuMjQ1bDEuODk5IDcuNi4xMzIuNTNIMTI5Ljk2OGExLjY0MyAxLjY0MyAwIDAgMSAxLjYxNCAxLjk0NmwtNy4wMzEgMzcuNWExLjY0NSAxLjY0NSAwIDAgMS0xLjYxNCAxLjM0MUg4MC43NTFhMS42NDQgMS42NDQgMCAwIDEtMS42MTUtMS4zNDFsLTcuMDIxLTM3LjQzLS4wMDQtLjAyLS4wMDUtLjAyLTEuODgtNy41MzNabTExLjc4MSA0Mi40ODYuMTA3LjU3aDM5LjQ1OWwuMTA3LS41NyA2LjE1NS0zMi44MTMuMTU1LS44MjlINzUuNjk3bC4xNTYuODI5IDYuMTU0IDMyLjgxM1ptLTIuNzA0IDcuNzk5YTguNjc1IDguNjc1IDAgMSAxIDEyLjI2OSAxMi4yNjcgOC42NzUgOC42NzUgMCAwIDEtMTIuMjY5LTEyLjI2N1ptMzIuODEzIDBhOC42NzQgOC42NzQgMCAxIDEgMTIuMjY4IDEyLjI2NiA4LjY3NCA4LjY3NCAwIDAgMS0xMi4yNjgtMTIuMjY2Wm0tMjIuODY5IDkuOTQ0YTUuMzkgNS4zOSAwIDAgMC0zLjgxLTkuMTk4IDUuMzg5IDUuMzg5IDAgMCAwLTMuODA5IDkuMTk4IDUuMzg4IDUuMzg4IDAgMCAwIDcuNjE5IDBabTMyLjgxMyAwYTUuMzkgNS4zOSAwIDAgMC0zLjgxLTkuMTk4IDUuMzkxIDUuMzkxIDAgMCAwLTUuMzg4IDUuMzg4IDUuMzkgNS4zOSAwIDAgMCA5LjE5OCAzLjgxWiIvPjwvZz48cmVjdCB4PSI1MCIgeT0iMTMzIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg2MiA0MykiIGQ9Ik0wIDBoNzV2NzVIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=",HP=(0,s.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o=r?"target":"source",a=r?"source":"target",[,l]=(0,s.useState)(!1),c=Oh(),u=(0,qh.W6)(),[{license_status:d}]=f(),[{is_flow_instant_checkout:p}]=Yp(),m=ZP.createEventHandlers(e,c,u,l);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:o,position:bA.Left,id:"left",style:{background:"#555",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),(0,i.createElement)(DO,{type:"target",position:bA.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t&&n}),ZP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},GP,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,m,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,e.bumps,p,e.is_locked,e.has_store_checkout_product_warning),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e?.label),(0,i.createElement)(DO,{type:a,position:bA.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,i.createElement)(DO,{type:"source",position:bA.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),$P="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFRkVGRUYiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48Y2lyY2xlIGN4PSI5OS44NTIiIGN5PSI5Mi4xMDEiIHI9IjM4LjM1MiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2UtbWl0ZXJsaW1pdD0iMS44NjIiIHN0cm9rZS1kYXNoYXJyYXk9IjIgMyIvPjxjaXJjbGUgY3g9Ijk5Ljg1MiIgY3k9IjkyLjEwMSIgcj0iMzEuNTQzIiBmaWxsPSIjRjZGQUZGIi8+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBkPSJNMTE0LjUgNjMuMzQ3djEyLjEzYTEuNjUgMS42NSAwIDEgMCAzLjMwMiAwdi0xMi4xM2w0LjA4OCA0LjA4OWExLjY1MiAxLjY1MiAwIDEgMCAyLjMzNy0yLjMzN2wtNi45MDctNi45MDdhMS42NDEgMS42NDEgMCAwIDAtMS4xNjktLjQ4NSAxLjY0NCAxLjY0NCAwIDAgMC0xLjE2OC40ODVoLS4wMDFsLTYuOTA2IDYuOTA3YTEuNjUyIDEuNjUyIDAgMSAwIDIuMzM3IDIuMzM3bDQuMDg3LTQuMDlabTE0LjMyMi04LjU5OWExNy45MiAxNy45MiAwIDEgMS0yNS4zNDMgMjUuMzQxIDE3LjkyIDE3LjkyIDAgMCAxIDI1LjM0My0yNS4zNFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIvPjwvZz48ZyBjbGlwLXBhdGg9InVybCgjYikiPjxwYXRoIGQ9Ik02OC42NzUgMTE2LjAyOWEyLjUxIDIuNTEgMCAwIDEgMi41MDgtMi41MDlINzYuMmEyLjUxIDIuNTEgMCAwIDEgMi41MDkgMi41MDl2Ny41MjZhMi41MSAyLjUxIDAgMCAxLTIuNTA5IDIuNTA4aC01LjAxN2EyLjUxIDIuNTEgMCAwIDEtMi41MDgtMi41MDh2LTcuNTI2Wm0xMi41NDMtMTAuMDM0YTIuNTA3IDIuNTA3IDAgMCAxIDIuNTA4LTIuNTA5aDUuMDE3YTIuNTA3IDIuNTA3IDAgMCAxIDIuNTA5IDIuNTA5djE3LjU2YTIuNTEgMi41MSAwIDAgMS0yLjUwOSAyLjUwOGgtNS4wMTdhMi41MSAyLjUxIDAgMCAxLTIuNTA4LTIuNTA4di0xNy41NlpNOTMuNzYgOTMuNDUyYTIuNTA5IDIuNTA5IDAgMCAxIDIuNTA5LTIuNTA5aDUuMDE3YTIuNTEgMi41MSAwIDAgMSAyLjUwOSAyLjUwOXYzMC4xMDNhMi41MTIgMi41MTIgMCAwIDEtMi41MDkgMi41MDhoLTUuMDE3YTIuNTEgMi41MSAwIDAgMS0yLjUwOS0yLjUwOFY5My40NTJaIiBmaWxsPSIjMjI3MUIxIi8+PC9nPjxyZWN0IHg9Ijg4LjQ5NyIgeT0iMTA5Ljc2NSIgd2lkdGg9IjI1LjIzNSIgaGVpZ2h0PSIyNS4yMzUiIHJ4PSIxMi42MTciIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTAxLjExNCAxMTEuODY4YTEwLjUxNyAxMC41MTcgMCAwIDAtOS43MTQgNi40OTEgMTAuNTEzIDEwLjUxMyAwIDEgMCA5LjcxNC02LjQ5MVptMCAxOC45MjZhOC40MTMgOC40MTMgMCAwIDEtNy43NzEtNS4xOTIgOC40MTEgOC40MTEgMCAxIDEgNy43NzEgNS4xOTJaIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTEwMS4xMTQgMTIxLjMzMWMtMi4xMDMgMC0yLjEwMy0uNjYyLTIuMTAzLTEuMDUxIDAtLjM4OS43MzYtMS4wNTIgMi4xMDMtMS4wNTIgMS4zNjcgMCAxLjQ2MS42NzMgMS40NzIgMS4wNTJoMi4xMDNhMy4xNSAzLjE1IDAgMCAwLTIuNTI0LTMuMDI4di0xLjE3OGgtMi4xMDJ2MS4xNDZjLTIuMTAzLjM0Ny0zLjE1NSAxLjcwMy0zLjE1NSAzLjA2IDAgMS4xNzcuNTQ3IDMuMTU0IDQuMjA2IDMuMTU0IDIuMTAzIDAgMi4xMDMuNzE1IDIuMTAzIDEuMDUyIDAgLjMzNi0uNjUyIDEuMDUxLTIuMTAzIDEuMDUxLTEuOTM1IDAtMi4xMDMtLjkwNC0yLjEwMy0xLjA1MWgtMi4xMDNjMCAuOTY3LjY5NCAyLjY4MSAzLjE1NSAzLjA3djEuMTM1aDIuMTAydi0xLjEzNWMyLjEwMy0uMzU4IDMuMTU1LTEuNzE0IDMuMTU1LTMuMDcgMC0xLjE3OC0uNTQ3LTMuMTU1LTQuMjA2LTMuMTU1WiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjUwIiB5PSIxNTAiIHdpZHRoPSIxMDAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiMyMjcxQjEiLz48cmVjdCB4PSIyMyIgeT0iMTY0IiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iNzAiIHk9IjE3OCIgd2lkdGg9IjYwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iMjMiIHk9IjE5NyIgd2lkdGg9IjE1NCIgaGVpZ2h0PSIyMCIgcng9IjIiIGZpbGw9IiMyMjcxQjEiLz48cGF0aCBkPSJtNzMuNCAyMTAuNS40ODYtMS40OTNoMi4zNjJsLjQ4NiAxLjQ5M2gxLjQ4M2wtMi4yNTYtNi41NDVoLTEuNzg0bC0yLjI2IDYuNTQ1aDEuNDg0Wm0uODM4LTIuNTczLjgwNS0yLjQ3N2guMDUybC44MDUgMi40NzdoLTEuNjYyWm02LjczIDIuNjY5YzEuMzA4IDAgMi4xMy0uNzY3IDIuMTkzLTEuODk1aC0xLjI4NGMtLjA4LjUyNC0uNDI1LjgxOC0uODkyLjgxOC0uNjM2IDAtMS4wNDgtLjUzNC0xLjA0OC0xLjQ3NCAwLS45MjYuNDE1LTEuNDU3IDEuMDQ4LTEuNDU3LjQ5OCAwIC44MTguMzI5Ljg5Mi44MThoMS4yODRjLS4wNTctMS4xMzQtLjkxNy0xLjg3OS0yLjE5OC0xLjg3OS0xLjQ5IDAtMi40MSAxLjAzMi0yLjQxIDIuNTM4IDAgMS40OTIuOTA0IDIuNTMxIDIuNDE2IDIuNTMxWm01LjI4MyAwYzEuMzA3IDAgMi4xMjktLjc2NyAyLjE5My0xLjg5NWgtMS4yODVjLS4wOC41MjQtLjQyNS44MTgtLjg5Mi44MTgtLjYzNiAwLTEuMDQ4LS41MzQtMS4wNDgtMS40NzQgMC0uOTI2LjQxNS0xLjQ1NyAxLjA0OC0xLjQ1Ny40OTkgMCAuODE4LjMyOS44OTIuODE4aDEuMjg1Yy0uMDU4LTEuMTM0LS45MTgtMS44NzktMi4yLTEuODc5LTEuNDg5IDAtMi40MSAxLjAzMi0yLjQxIDIuNTM4IDAgMS40OTIuOTA1IDIuNTMxIDIuNDE3IDIuNTMxWm01LjMwMSAwYzEuMjE1IDAgMi4wMzMtLjU5MSAyLjIyNS0xLjUwMmwtMS4yNi0uMDgzYy0uMTM3LjM3NC0uNDg4LjU2OS0uOTQyLjU2OS0uNjggMC0xLjExMi0uNDUxLTEuMTEyLTEuMTgzdi0uMDAzaDMuMzQzdi0uMzc0YzAtMS42NjgtMS4wMS0yLjQ5My0yLjMwOC0yLjQ5My0xLjQ0NCAwLTIuMzggMS4wMjYtMi4zOCAyLjU0MSAwIDEuNTU2LjkyMyAyLjUyOCAyLjQzNCAyLjUyOFptLTEuMDktMy4wNDZhMS4wMzcgMS4wMzcgMCAwIDEgMS4wNTktMS4wMDdjLjU5IDAgMSAuNDIyIDEuMDAzIDEuMDA3aC0yLjA2MVptNC4yMzIgNC43OTFoMS4zNjJ2LTIuNjI3aC4wNDFjLjE4OS40MDkuNjAxLjg2NiAxLjM5NC44NjYgMS4xMTggMCAxLjk5LS44ODUgMS45OS0yLjUyOCAwLTEuNjg4LS45MS0yLjUyNS0xLjk4Ny0yLjUyNS0uODIyIDAtMS4yMTUuNDg5LTEuMzk3Ljg4OGgtLjA2di0uODI0aC0xLjM0M3Y2Ljc1Wm0xLjMzMy00LjI5NmMwLS44NzUuMzctMS40MzUgMS4wMzItMS40MzUuNjc1IDAgMS4wMzMuNTg1IDEuMDMzIDEuNDM1IDAgLjg1Ny0uMzY1IDEuNDUxLTEuMDMzIDEuNDUxLS42NTUgMC0xLjAzMi0uNTc1LTEuMDMyLTEuNDUxWm02Ljk3NC0yLjQ1NGgtLjkyNHYtMS4xNzZoLTEuMzYxdjEuMTc2aC0uNjcydjEuMDIzaC42NzJ2Mi41NTZjLS4wMDcuOTYyLjY0OCAxLjQzOSAxLjYzNiAxLjM5Ny4zNTEtLjAxMy42MDEtLjA4My43MzgtLjEyOGwtLjIxNC0xLjAxM2MtLjA2Ny4wMTMtLjIxMS4wNDUtLjMzOS4wNDUtLjI3MSAwLS40Ni0uMTAyLS40Ni0uNDh2LTIuMzc3aC45MjR2LTEuMDIzWm05LjAxIDEuNjM2YzAtMi4xNDEtMS4zMjktMy4zNjItMy4wNjUtMy4zNjItMS43NDUgMC0zLjA2NSAxLjIyMS0zLjA2NSAzLjM2MiAwIDIuMTMyIDEuMzIgMy4zNjIgMy4wNjUgMy4zNjIgMS43MzYgMCAzLjA2NS0xLjIyIDMuMDY1LTMuMzYyWm0tMS40MDMgMGMwIDEuMzg3LS42NTggMi4xMzgtMS42NjIgMi4xMzgtMS4wMDcgMC0xLjY2Mi0uNzUxLTEuNjYyLTIuMTM4cy42NTUtMi4xMzggMS42NjItMi4xMzhjMS4wMDQgMCAxLjY2Mi43NTEgMS42NjIgMi4xMzhabTUuMDQzLTEuNjM2aC0uOTc1di0uMzI5YzAtLjMzMy4xMzQtLjUyOC41MzMtLjUyOC4xNjMgMCAuMzMuMDM2LjQzOC4wNzFsLjI0LTEuMDIzYTMuNTg5IDMuNTg5IDAgMCAwLS45NjItLjEzNGMtLjkyNCAwLTEuNjExLjUyMS0xLjYxMSAxLjU4OHYuMzU1aC0uNjkzdjEuMDIzaC42OTN2My44ODZoMS4zNjJ2LTMuODg2aC45NzV2LTEuMDIzWm0zLjQ3MSAwaC0uOTc1di0uMzI5YzAtLjMzMy4xMzUtLjUyOC41MzQtLjUyOC4xNjMgMCAuMzI5LjAzNi40MzguMDcxbC4yNC0xLjAyM2EzLjYwMyAzLjYwMyAwIDAgMC0uOTYyLS4xMzRjLS45MjQgMC0xLjYxMS41MjEtMS42MTEgMS41ODh2LjM1NWgtLjY5NHYxLjAyM2guNjk0djMuODg2aDEuMzYxdi0zLjg4NmguOTc1di0xLjAyM1ptMi44OTMgNS4wMDVjMS4yMTUgMCAyLjAzMy0uNTkxIDIuMjI1LTEuNTAybC0xLjI1OS0uMDgzYy0uMTM4LjM3NC0uNDg5LjU2OS0uOTQzLjU2OS0uNjgxIDAtMS4xMTItLjQ1MS0xLjExMi0xLjE4M3YtLjAwM2gzLjM0M3YtLjM3NGMwLTEuNjY4LTEuMDEtMi40OTMtMi4zMDgtMi40OTMtMS40NDUgMC0yLjM4MSAxLjAyNi0yLjM4MSAyLjU0MSAwIDEuNTU2LjkyNCAyLjUyOCAyLjQzNSAyLjUyOFptLTEuMDg5LTMuMDQ2YTEuMDM2IDEuMDM2IDAgMCAxIDEuMDU3LTEuMDA3Yy41OTIgMCAxLjAwMS40MjIgMS4wMDQgMS4wMDdoLTIuMDYxWm00LjIzMSAyLjk1aDEuMzYydi0yLjc3N2MwLS42MDQuNDQxLTEuMDIgMS4wNDItMS4wMi4xODggMCAuNDQ3LjAzMi41NzUuMDc0di0xLjIwOGEyLjAzMyAyLjAzMyAwIDAgMC0uNDI4LS4wNDhjLS41NSAwLTEuMDAxLjMxOS0xLjE4LjkyNmgtLjA1MXYtLjg1NmgtMS4zMnY0LjkwOVoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNNzkuOTIxIDIzMy41aDEuMDc2di0xLjgwNWguNzg2bC45NjQgMS44MDVoMS4xODlsLTEuMDgyLTEuOTc5Yy41OC0uMjQ4LjktLjc1My45LTEuNDQ5IDAtMS4wMTItLjY2OS0xLjY2My0xLjgyNS0xLjY2M2gtMi4wMDh2NS4wOTFabTEuMDc2LTIuNjd2LTEuNTQxaC43MjZjLjYyMiAwIC45MjIuMjc2LjkyMi43ODMgMCAuNTA1LS4zLjc1OC0uOTE3Ljc1OGgtLjczWm01LjE3NiAyLjc0NWMuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45NzktLjA2NGMtLjEwNy4yOS0uMzguNDQyLS43MzMuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTkgMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjMtLjc4M2MuNDYgMCAuNzc4LjMyOC43OC43ODNoLTEuNjAzWm0zLjI5LTEuNTI0djMuOTljMCAuMjg4LS4xMi40MzItLjQ2MS40MzItLjA0NSAwLS4wODUgMC0uMTQtLjAwNXYuODI4Yy4wNzcuMDAyLjE0LjAwNS4yMTQuMDA1LjkgMCAxLjQ0Ny0uMzU4IDEuNDQ3LTEuMjQzdi00LjAwN2gtMS4wNlptLjUyOC0uNDkyYy4zMTYgMCAuNTc0LS4yNDEuNTc0LS41MzcgMC0uMjk0LS4yNTgtLjUzNS0uNTc0LS41MzUtLjMxMyAwLS41NzIuMjQxLS41NzIuNTM1IDAgLjI5Ni4yNTkuNTM3LjU3Mi41MzdabTMuMTIgNC4zODVjLjk0NSAwIDEuNTgxLS40NiAxLjczLTEuMTY5bC0uOTgtLjA2NGMtLjEwNi4yOS0uMzguNDQyLS43MzIuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTggMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjItLjc4M2MuNDYgMCAuNzc4LjMyOC43OC43ODNoLTEuNjAzWm01LjAxNiAyLjM2OWMxLjAxNyAwIDEuNjU1LS41OTcgMS43MDUtMS40NzVoLTFjLS4wNjEuNDA4LS4zMy42MzctLjY5My42MzctLjQ5NCAwLS44MTUtLjQxNS0uODE1LTEuMTQ2IDAtLjcyMS4zMjMtMS4xMzQuODE1LTEuMTM0LjM4OCAwIC42MzcuMjU2LjY5NC42MzdoMWMtLjA0Ni0uODgzLS43MTQtMS40NjItMS43MTEtMS40NjItMS4xNTkgMC0xLjg3NC44MDMtMS44NzQgMS45NzQgMCAxLjE2MS43MDMgMS45NjkgMS44NzkgMS45NjlabTQuNDE0LTMuODkzaC0uNzE4di0uOTE1aC0xLjA2di45MTVoLS41MjF2Ljc5NWguNTIydjEuOTg5Yy0uMDA1Ljc0OC41MDQgMS4xMTkgMS4yNzIgMS4wODYuMjc0LS4wMS40NjgtLjA2NC41NzUtLjA5OWwtLjE2Ny0uNzg4Yy0uMDUyLjAxLS4xNjQuMDM1LS4yNjMuMDM1LS4yMTIgMC0uMzU4LS4wOC0uMzU4LS4zNzN2LTEuODVoLjcxOHYtLjc5NVptNy4wMDggMS4yNzNjMC0xLjY2Ni0xLjAzNC0yLjYxNi0yLjM4NC0yLjYxNi0xLjM1NyAwLTIuMzg0Ljk1LTIuMzg0IDIuNjE2IDAgMS42NTggMS4wMjcgMi42MTUgMi4zODQgMi42MTUgMS4zNSAwIDIuMzg0LS45NSAyLjM4NC0yLjYxNVptLTEuMDkxIDBjMCAxLjA3OC0uNTEyIDEuNjYzLTEuMjkzIDEuNjYzLS43ODMgMC0xLjI5Mi0uNTg1LTEuMjkyLTEuNjYzIDAtMS4wNzkuNTA5LTEuNjYzIDEuMjkyLTEuNjYzLjc4MSAwIDEuMjkzLjU4NCAxLjI5MyAxLjY2M1ptMy45MjItMS4yNzNoLS43NTh2LS4yNTZjMC0uMjU5LjEwNC0uNDEuNDE1LS40MS4xMjcgMCAuMjU2LjAyNy4zNC4wNTRsLjE4Ny0uNzk1YTIuNzc4IDIuNzc4IDAgMCAwLS43NDgtLjEwNWMtLjcxOSAwLTEuMjUzLjQwNi0xLjI1MyAxLjIzNnYuMjc2aC0uNTR2Ljc5NWguNTR2My4wMjNoMS4wNTl2LTMuMDIzaC43NTh2LS43OTVabTIuNyAwaC0uNzU4di0uMjU2YzAtLjI1OS4xMDQtLjQxLjQxNS0uNDEuMTI3IDAgLjI1Ni4wMjcuMzQxLjA1NGwuMTg2LS43OTVhMi43NzggMi43NzggMCAwIDAtLjc0OC0uMTA1Yy0uNzE5IDAtMS4yNTMuNDA2LTEuMjUzIDEuMjM2di4yNzZoLS41NHYuNzk1aC41NHYzLjAyM2gxLjA1OXYtMy4wMjNoLjc1OHYtLjc5NVptMi4yNSAzLjg5M2MuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45NzktLjA2NGMtLjEwNy4yOS0uMzguNDQyLS43MzMuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTggMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjItLjc4M2MuNDYgMCAuNzc4LjMyOC43ODEuNzgzaC0xLjYwM1ptMy4yOTEgMi4yOTRoMS4wNTl2LTIuMTZjMC0uNDcuMzQzLS43OTMuODEtLjc5My4xNDcgMCAuMzQ4LjAyNS40NDguMDU3di0uOTRhMS42MjcgMS42MjcgMCAwIDAtLjMzNC0uMDM3Yy0uNDI3IDAtLjc3OC4yNDktLjkxNy43MjFoLS4wNHYtLjY2NmgtMS4wMjZ2My44MThaIiBmaWxsPSIjQTFBMUExIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5Ny43MzMgNDkpIiBkPSJNMCAwaDM2LjgzN3YzNi44MzdIMHoiLz48L2NsaXBQYXRoPjxjbGlwUGF0aCBpZD0iYiI+PHBhdGggZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjguMzA5IDg5LjU3OCkiIGQ9Ik0wIDBoMzcuODUydjM3Ljg1MkgweiIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==",XP="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFRkVGRUYiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48cmVjdCB4PSI1MCIgeT0iMTUxIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iMjMiIHk9IjE2NSIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjcwIiB5PSIxNzgiIHdpZHRoPSI2MCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjIzIiB5PSIxOTciIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0ibTczLjQgMjEwIC40ODYtMS40OTNoMi4zNjJsLjQ4NiAxLjQ5M2gxLjQ4M2wtMi4yNTYtNi41NDVoLTEuNzg0TDcxLjkxNyAyMTBoMS40ODRabS44MzgtMi41NzMuODA1LTIuNDc3aC4wNTJsLjgwNSAyLjQ3N2gtMS42NjJabTYuNzMgMi42NjljMS4zMDggMCAyLjEzLS43NjcgMi4xOTMtMS44OTVoLTEuMjg0Yy0uMDguNTI0LS40MjUuODE4LS44OTIuODE4LS42MzYgMC0xLjA0OC0uNTM0LTEuMDQ4LTEuNDc0IDAtLjkyNi40MTUtMS40NTcgMS4wNDgtMS40NTcuNDk4IDAgLjgxOC4zMjkuODkyLjgxOGgxLjI4NGMtLjA1Ny0xLjEzNC0uOTE3LTEuODc5LTIuMTk4LTEuODc5LTEuNDkgMC0yLjQxIDEuMDMyLTIuNDEgMi41MzggMCAxLjQ5Mi45MDQgMi41MzEgMi40MTYgMi41MzFabTUuMjgzIDBjMS4zMDcgMCAyLjEyOS0uNzY3IDIuMTkzLTEuODk1aC0xLjI4NWMtLjA4LjUyNC0uNDI1LjgxOC0uODkyLjgxOC0uNjM2IDAtMS4wNDgtLjUzNC0xLjA0OC0xLjQ3NCAwLS45MjYuNDE1LTEuNDU3IDEuMDQ4LTEuNDU3LjQ5OSAwIC44MTguMzI5Ljg5Mi44MThoMS4yODVjLS4wNTgtMS4xMzQtLjkxOC0xLjg3OS0yLjItMS44NzktMS40ODkgMC0yLjQxIDEuMDMyLTIuNDEgMi41MzggMCAxLjQ5Mi45MDUgMi41MzEgMi40MTcgMi41MzFabTUuMzAxIDBjMS4yMTUgMCAyLjAzMy0uNTkxIDIuMjI1LTEuNTAybC0xLjI2LS4wODNjLS4xMzcuMzc0LS40ODguNTY5LS45NDIuNTY5LS42OCAwLTEuMTEyLS40NTEtMS4xMTItMS4xODN2LS4wMDNoMy4zNDN2LS4zNzRjMC0xLjY2OC0xLjAxLTIuNDkzLTIuMzA4LTIuNDkzLTEuNDQ0IDAtMi4zOCAxLjAyNi0yLjM4IDIuNTQxIDAgMS41NTYuOTIzIDIuNTI4IDIuNDM0IDIuNTI4Wm0tMS4wOS0zLjA0NmExLjAzNyAxLjAzNyAwIDAgMSAxLjA1OS0xLjAwN2MuNTkgMCAxIC40MjIgMS4wMDMgMS4wMDdoLTIuMDYxWm00LjIzMiA0Ljc5MWgxLjM2MnYtMi42MjdoLjA0MWMuMTg5LjQwOS42MDEuODY2IDEuMzk0Ljg2NiAxLjExOCAwIDEuOTktLjg4NSAxLjk5LTIuNTI4IDAtMS42ODgtLjkxLTIuNTI1LTEuOTg3LTIuNTI1LS44MjIgMC0xLjIxNS40ODktMS4zOTcuODg4aC0uMDZ2LS44MjRoLTEuMzQzdjYuNzVabTEuMzMzLTQuMjk2YzAtLjg3NS4zNy0xLjQzNSAxLjAzMi0xLjQzNS42NzUgMCAxLjAzMy41ODUgMS4wMzMgMS40MzUgMCAuODU3LS4zNjUgMS40NTEtMS4wMzMgMS40NTEtLjY1NSAwLTEuMDMyLS41NzUtMS4wMzItMS40NTFabTYuOTc0LTIuNDU0aC0uOTI0di0xLjE3NmgtMS4zNjF2MS4xNzZoLS42NzJ2MS4wMjNoLjY3MnYyLjU1NmMtLjAwNy45NjIuNjQ4IDEuNDM5IDEuNjM2IDEuMzk3LjM1MS0uMDEzLjYwMS0uMDgzLjczOC0uMTI4bC0uMjE0LTEuMDEzYy0uMDY3LjAxMy0uMjExLjA0NS0uMzM5LjA0NS0uMjcxIDAtLjQ2LS4xMDItLjQ2LS40OHYtMi4zNzdoLjkyNHYtMS4wMjNabTkuMDEgMS42MzZjMC0yLjE0MS0xLjMyOS0zLjM2Mi0zLjA2NS0zLjM2Mi0xLjc0NSAwLTMuMDY1IDEuMjIxLTMuMDY1IDMuMzYyIDAgMi4xMzIgMS4zMiAzLjM2MiAzLjA2NSAzLjM2MiAxLjczNiAwIDMuMDY1LTEuMjIgMy4wNjUtMy4zNjJabS0xLjQwMyAwYzAgMS4zODctLjY1OCAyLjEzOC0xLjY2MiAyLjEzOC0xLjAwNyAwLTEuNjYyLS43NTEtMS42NjItMi4xMzhzLjY1NS0yLjEzOCAxLjY2Mi0yLjEzOGMxLjAwNCAwIDEuNjYyLjc1MSAxLjY2MiAyLjEzOFptNS4wNDMtMS42MzZoLS45NzV2LS4zMjljMC0uMzMzLjEzNC0uNTI4LjUzMy0uNTI4LjE2MyAwIC4zMy4wMzYuNDM4LjA3MWwuMjQtMS4wMjNhMy41ODkgMy41ODkgMCAwIDAtLjk2Mi0uMTM0Yy0uOTI0IDAtMS42MTEuNTIxLTEuNjExIDEuNTg4di4zNTVoLS42OTN2MS4wMjNoLjY5M1YyMTBoMS4zNjJ2LTMuODg2aC45NzV2LTEuMDIzWm0zLjQ3MSAwaC0uOTc1di0uMzI5YzAtLjMzMy4xMzUtLjUyOC41MzQtLjUyOC4xNjMgMCAuMzI5LjAzNi40MzguMDcxbC4yNC0xLjAyM2EzLjYwMyAzLjYwMyAwIDAgMC0uOTYyLS4xMzRjLS45MjQgMC0xLjYxMS41MjEtMS42MTEgMS41ODh2LjM1NWgtLjY5NHYxLjAyM2guNjk0VjIxMGgxLjM2MXYtMy44ODZoLjk3NXYtMS4wMjNabTIuODkzIDUuMDA1YzEuMjE1IDAgMi4wMzMtLjU5MSAyLjIyNS0xLjUwMmwtMS4yNTktLjA4M2MtLjEzOC4zNzQtLjQ4OS41NjktLjk0My41NjktLjY4MSAwLTEuMTEyLS40NTEtMS4xMTItMS4xODN2LS4wMDNoMy4zNDN2LS4zNzRjMC0xLjY2OC0xLjAxLTIuNDkzLTIuMzA4LTIuNDkzLTEuNDQ1IDAtMi4zODEgMS4wMjYtMi4zODEgMi41NDEgMCAxLjU1Ni45MjQgMi41MjggMi40MzUgMi41MjhabS0xLjA4OS0zLjA0NmExLjAzNiAxLjAzNiAwIDAgMSAxLjA1Ny0xLjAwN2MuNTkyIDAgMS4wMDEuNDIyIDEuMDA0IDEuMDA3aC0yLjA2MVptNC4yMzEgMi45NWgxLjM2MnYtMi43NzdjMC0uNjA0LjQ0MS0xLjAyIDEuMDQyLTEuMDIuMTg4IDAgLjQ0Ny4wMzIuNTc1LjA3NHYtMS4yMDhhMi4wMzMgMi4wMzMgMCAwIDAtLjQyOC0uMDQ4Yy0uNTUgMC0xLjAwMS4zMTktMS4xOC45MjZoLS4wNTF2LS44NTZoLTEuMzJWMjEwWiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik03OS45MjEgMjMzLjVoMS4wNzZ2LTEuODA1aC43ODZsLjk2NCAxLjgwNWgxLjE4OWwtMS4wODItMS45NzljLjU4LS4yNDguOS0uNzUzLjktMS40NDkgMC0xLjAxMi0uNjY5LTEuNjYzLTEuODI1LTEuNjYzaC0yLjAwOHY1LjA5MVptMS4wNzYtMi42N3YtMS41NDFoLjcyNmMuNjIyIDAgLjkyMi4yNzYuOTIyLjc4MyAwIC41MDUtLjMuNzU4LS45MTcuNzU4aC0uNzNabTUuMTc2IDIuNzQ1Yy45NDUgMCAxLjU4MS0uNDYgMS43My0xLjE2OWwtLjk3OS0uMDY0Yy0uMTA3LjI5LS4zOC40NDItLjczMy40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOSAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMy0uNzgzYy40NiAwIC43NzguMzI4Ljc4Ljc4M2gtMS42MDNabTMuMjktMS41MjR2My45OWMwIC4yODgtLjEyLjQzMi0uNDYxLjQzMi0uMDQ1IDAtLjA4NSAwLS4xNC0uMDA1di44MjhjLjA3Ny4wMDIuMTQuMDA1LjIxNC4wMDUuOSAwIDEuNDQ3LS4zNTggMS40NDctMS4yNDN2LTQuMDA3aC0xLjA2Wm0uNTI4LS40OTJjLjMxNiAwIC41NzQtLjI0MS41NzQtLjUzNyAwLS4yOTQtLjI1OC0uNTM1LS41NzQtLjUzNS0uMzEzIDAtLjU3Mi4yNDEtLjU3Mi41MzUgMCAuMjk2LjI1OS41MzcuNTcyLjUzN1ptMy4xMiA0LjM4NWMuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45OC0uMDY0Yy0uMTA2LjI5LS4zOC40NDItLjczMi40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOCAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMi0uNzgzYy40NiAwIC43NzguMzI4Ljc4Ljc4M2gtMS42MDNabTUuMDE2IDIuMzY5YzEuMDE3IDAgMS42NTUtLjU5NyAxLjcwNS0xLjQ3NWgtMWMtLjA2MS40MDgtLjMzLjYzNy0uNjkzLjYzNy0uNDk0IDAtLjgxNS0uNDE1LS44MTUtMS4xNDYgMC0uNzIxLjMyMy0xLjEzNC44MTUtMS4xMzQuMzg4IDAgLjYzNy4yNTYuNjk0LjYzN2gxYy0uMDQ2LS44ODMtLjcxNC0xLjQ2Mi0xLjcxMS0xLjQ2Mi0xLjE1OSAwLTEuODc0LjgwMy0xLjg3NCAxLjk3NCAwIDEuMTYxLjcwMyAxLjk2OSAxLjg3OSAxLjk2OVptNC40MTQtMy44OTNoLS43MTh2LS45MTVoLTEuMDZ2LjkxNWgtLjUyMXYuNzk1aC41MjJ2MS45ODljLS4wMDUuNzQ4LjUwNCAxLjExOSAxLjI3MiAxLjA4Ni4yNzQtLjAxLjQ2OC0uMDY0LjU3NS0uMDk5bC0uMTY3LS43ODhjLS4wNTIuMDEtLjE2NC4wMzUtLjI2My4wMzUtLjIxMiAwLS4zNTgtLjA4LS4zNTgtLjM3M3YtMS44NWguNzE4di0uNzk1Wm03LjAwOCAxLjI3M2MwLTEuNjY2LTEuMDM0LTIuNjE2LTIuMzg0LTIuNjE2LTEuMzU3IDAtMi4zODQuOTUtMi4zODQgMi42MTYgMCAxLjY1OCAxLjAyNyAyLjYxNSAyLjM4NCAyLjYxNSAxLjM1IDAgMi4zODQtLjk1IDIuMzg0LTIuNjE1Wm0tMS4wOTEgMGMwIDEuMDc4LS41MTIgMS42NjMtMS4yOTMgMS42NjMtLjc4MyAwLTEuMjkyLS41ODUtMS4yOTItMS42NjMgMC0xLjA3OS41MDktMS42NjMgMS4yOTItMS42NjMuNzgxIDAgMS4yOTMuNTg0IDEuMjkzIDEuNjYzWm0zLjkyMi0xLjI3M2gtLjc1OHYtLjI1NmMwLS4yNTkuMTA0LS40MS40MTUtLjQxLjEyNyAwIC4yNTYuMDI3LjM0LjA1NGwuMTg3LS43OTVhMi43NzggMi43NzggMCAwIDAtLjc0OC0uMTA1Yy0uNzE5IDAtMS4yNTMuNDA2LTEuMjUzIDEuMjM2di4yNzZoLS41NHYuNzk1aC41NHYzLjAyM2gxLjA1OXYtMy4wMjNoLjc1OHYtLjc5NVptMi43IDBoLS43NTh2LS4yNTZjMC0uMjU5LjEwNC0uNDEuNDE1LS40MS4xMjcgMCAuMjU2LjAyNy4zNDEuMDU0bC4xODYtLjc5NWEyLjc3OCAyLjc3OCAwIDAgMC0uNzQ4LS4xMDVjLS43MTkgMC0xLjI1My40MDYtMS4yNTMgMS4yMzZ2LjI3NmgtLjU0di43OTVoLjU0djMuMDIzaDEuMDU5di0zLjAyM2guNzU4di0uNzk1Wm0yLjI1IDMuODkzYy45NDUgMCAxLjU4MS0uNDYgMS43My0xLjE2OWwtLjk3OS0uMDY0Yy0uMTA3LjI5LS4zOC40NDItLjczMy40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOCAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMi0uNzgzYy40NiAwIC43NzguMzI4Ljc4MS43ODNoLTEuNjAzWm0zLjI5MSAyLjI5NGgxLjA1OXYtMi4xNmMwLS40Ny4zNDMtLjc5My44MS0uNzkzLjE0NyAwIC4zNDguMDI1LjQ0OC4wNTd2LS45NGExLjYyNyAxLjYyNyAwIDAgMC0uMzM0LS4wMzdjLS40MjcgMC0uNzc4LjI0OS0uOTE3LjcyMWgtLjA0di0uNjY2aC0xLjAyNnYzLjgxOFoiIGZpbGw9IiNBMUExQTEiLz48Y2lyY2xlIGN4PSIxMDQuNTQyIiBjeT0iOTAuNTk1IiByPSIzOC43ODYiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEuODYyIiBzdHJva2UtZGFzaGFycmF5PSIyIDMiLz48Y2lyY2xlIGN4PSIxMDQuNTQxIiBjeT0iOTAuNTk1IiByPSIzMS45MDUiIGZpbGw9IiNGNkZBRkYiLz48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxwYXRoIGQ9Im0xMjcuMjU1IDY1LjQ3NC0zLjgwMiAzLjgwNFY1Ny40OGExLjg2MyAxLjg2MyAwIDAgMC0zLjE4Mi0xLjMxOGMtLjM1LjM1LS41NDcuODIzLS41NDcgMS4zMTh2MTEuOGwtMy44MDItMy44MDVhMS44NjUgMS44NjUgMCAxIDAtMi42MzkgMi42MzlsNi45ODYgNi45ODVhMS44NjUgMS44NjUgMCAwIDAgMi42NCAwbDYuOTg1LTYuOTg1YTEuODY2IDEuODY2IDAgMSAwLTIuNjM5LTIuNjM5Wm0xMi4yNjMuMTU1YTE3LjkzIDE3LjkzIDAgMCAxLTM1Ljg1OSAwIDE3LjkyNyAxNy45MjcgMCAwIDEgMTcuOTMtMTcuOTI5IDE3LjkzIDE3LjkzIDAgMCAxIDE3LjkyOSAxNy45M1oiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIxLjQiLz48L2c+PHBhdGggZD0iTTEwNy4xNDUgMTEyLjA2NnYuMDAxYzAgLjk2Ni4zODQgMS44OTMgMS4wNjggMi41NzdsMjAuMjY1IDIwLjI2NWEzLjY0NiAzLjY0NiAwIDAgMCA1LjE1NCAwbDEzLjI3Ny0xMy4yNzdhMy42NDYgMy42NDYgMCAwIDAgMC01LjE1NGwtMjAuMjY1LTIwLjI2NWEzLjY0NyAzLjY0NyAwIDAgMC0yLjU3Ny0xLjA2OEgxMTAuNzlhMy42NDIgMy42NDIgMCAwIDAtMy42NDUgMy42NDV2MTMuMjc2Wm0xNC40NzUtNi4wMzhhMy41OTIgMy41OTIgMCAxIDEtNy4xODUgMCAzLjU5MiAzLjU5MiAwIDAgMSA3LjE4NSAwWiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxyZWN0IHg9IjU1IiB5PSI4OC41MjciIHdpZHRoPSIzNi4zODkiIGhlaWdodD0iMzYuMzg5IiByeD0iMTguMTk0IiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTczLjE5NCA5MS41NmExNS4xNjIgMTUuMTYyIDAgMSAwIDAgMzAuMzI0IDE1LjE2MiAxNS4xNjIgMCAwIDAgMC0zMC4zMjRabTAgMjcuMjkxYTEyLjEyOCAxMi4xMjggMCAwIDEtOC41NzctMjAuNzA2IDEyLjEzIDEyLjEzIDAgMSAxIDguNTc3IDIwLjcwNloiIGZpbGw9IiMyMjcxQjEiLz48cGF0aCBkPSJNNzMuMTk0IDEwNS4yMDZjLTMuMDMyIDAtMy4wMzItLjk1Ni0zLjAzMi0xLjUxNyAwLS41NjEgMS4wNjEtMS41MTYgMy4wMzItMS41MTZzMi4xMDguOTcxIDIuMTIzIDEuNTE2aDMuMDMzYTQuNTQ1IDQuNTQ1IDAgMCAwLTMuNjQtNC4zNjZ2LTEuNjk4aC0zLjAzMnYxLjY1MmMtMy4wMzIuNS00LjU0OCAyLjQ1Ni00LjU0OCA0LjQxMiAwIDEuNjk4Ljc4OCA0LjU0OSA2LjA2NCA0LjU0OSAzLjAzMyAwIDMuMDMzIDEuMDMxIDMuMDMzIDEuNTE2IDAgLjQ4NS0uOTQgMS41MTYtMy4wMzMgMS41MTYtMi43OSAwLTMuMDMyLTEuMzA0LTMuMDMyLTEuNTE2SDY3LjEzYzAgMS4zOTUgMSAzLjg2NiA0LjU0OCA0LjQyN3YxLjYzOGgzLjAzM3YtMS42MzhjMy4wMzItLjUxNSA0LjU0OC0yLjQ3MSA0LjU0OC00LjQyNyAwLTEuNjk4LS43ODgtNC41NDgtNi4wNjUtNC41NDhaIiBmaWxsPSIjMjI3MUIxIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMDIuOTU5IDQ3KSIgZD0iTTAgMGgzNy4yNTl2MzcuMjU5SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+";function qP(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function JP(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add(()=>e.removeEventListener(n,r,o))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return qP(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=JP();return e(t),this.add(()=>t.dispose())},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function KP(){let[e]=(0,s.useState)(JP);return(0,s.useEffect)(()=>()=>e.dispose(),[e]),e}var eR=Object.defineProperty,tR=(e,t,n)=>(((e,t,n)=>{t in e?eR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let nR=new class{constructor(){tR(this,"current",this.detect()),tR(this,"handoffState","pending"),tR(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},rR=(e,t)=>{nR.isServer?(0,s.useEffect)(e,t):(0,s.useLayoutEffect)(e,t)};function oR(e){let t=(0,s.useRef)(e);return rR(()=>{t.current=e},[e]),t}let aR=function(e){let t=oR(e);return s.useCallback((...e)=>t.current(...e),[t])};function iR(){let e=(0,s.useRef)(!1);return rR(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function sR(){let e=function(){let e="undefined"==typeof document;return"useSyncExternalStore"in l&&(e=>e.useSyncExternalStore)(l)(()=>()=>{},()=>!1,()=>!e)}(),[t,n]=s.useState(nR.isHandoffComplete);return t&&!1===nR.isHandoffComplete&&n(!1),s.useEffect(()=>{!0!==t&&n(!0)},[t]),s.useEffect(()=>nR.handoff(),[]),!e&&t}let lR=Symbol();function cR(...e){let t=(0,s.useRef)(e);(0,s.useEffect)(()=>{t.current=e},[e]);let n=aR(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||(null==e?void 0:e[lR]))?void 0:n}var uR,dR;"undefined"!=typeof process&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&"test"===(null==(uR=null==process?void 0:process.env)?void 0:uR.NODE_ENV)&&void 0===(null==(dR=null==Element?void 0:Element.prototype)?void 0:dR.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join("\n")),[]});var fR=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(fR||{});function pR(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}let mR=(0,s.createContext)(null);mR.displayName="OpenClosedContext";var hR=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(hR||{});function gR(){return(0,s.useContext)(mR)}function wR({value:e,children:t}){return s.createElement(mR.Provider,{value:e},t)}function yR({children:e}){return s.createElement(mR.Provider,{value:null},e)}function bR(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}function vR(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,vR),r}var xR=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(xR||{}),NR=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(NR||{});function ER(){let e=function(){let e=(0,s.useRef)([]),t=(0,s.useCallback)(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>null==e))return e.current=n,t}}();return(0,s.useCallback)(t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:a=!0,name:i,mergeRefs:s}){s=null!=s?s:MR;let l=IR(t,e);if(a)return _R(l,n,r,i,s);let c=null!=o?o:0;if(2&c){let{static:e=!1,...t}=l;if(e)return _R(t,n,r,i,s)}if(1&c){let{unmount:e=!0,...t}=l;return vR(e?0:1,{0:()=>null,1:()=>_R({...t,hidden:!0,style:{display:"none"}},n,r,i,s)})}return _R(l,n,r,i,s)}({mergeRefs:e,...t}),[e])}function _R(e,t={},n,r,o){let{as:a=n,children:i,refName:l="ref",...c}=DR(e,["unmount","static"]),u=void 0!==e.ref?{[l]:e.ref}:{},d="function"==typeof i?i(t):i;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){f["data-headlessui-state"]=n.join(" ");for(let e of n)f[`data-${e}`]=""}}if(jR(a)&&(Object.keys(kR(c)).length>0||Object.keys(kR(f)).length>0)){if(!(!(0,s.isValidElement)(d)||Array.isArray(d)&&d.length>1||function(e){return jR(e.type)}(d))){let e=d.props,t=null==e?void 0:e.className,n="function"==typeof t?(...e)=>bR(t(...e),c.className):bR(t,c.className),r=n?{className:n}:{},a=IR(d.props,kR(DR(c,["ref"])));for(let e in f)e in a&&delete f[e];return(0,s.cloneElement)(d,Object.assign({},a,f,u,{ref:o(CR(d),u.ref)},r))}if(Object.keys(kR(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(kR(c)).concat(Object.keys(kR(f))).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"))}return(0,s.createElement)(a,Object.assign({},DR(c,["ref"]),!jR(a)&&u,!jR(a)&&f),d)}function MR(...e){return e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function IR(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function SR(e){var t;return Object.assign((0,s.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function kR(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function DR(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function CR(e){return s.version.split(".")[0]>="19"?e.props.ref:e.ref}function jR(e){return e===s.Fragment||e===Symbol.for("react.fragment")}function AR(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!jR(null!=(t=e.as)?t:RR)||1===s.Children.count(e.children)}let TR=(0,s.createContext)(null);TR.displayName="TransitionContext";var LR=(e=>(e.Visible="visible",e.Hidden="hidden",e))(LR||{});let OR=(0,s.createContext)(null);function zR(e){return"children"in e?zR(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function PR(e,t){let n=oR(e),r=(0,s.useRef)([]),o=iR(),a=KP(),i=aR((e,t=NR.Hidden)=>{let i=r.current.findIndex(({el:t})=>t===e);-1!==i&&(vR(t,{[NR.Unmount](){r.current.splice(i,1)},[NR.Hidden](){r.current[i].state="hidden"}}),a.microTask(()=>{var e;!zR(r)&&o.current&&(null==(e=n.current)||e.call(n))}))}),l=aR(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>i(e,NR.Unmount)}),c=(0,s.useRef)([]),u=(0,s.useRef)(Promise.resolve()),d=(0,s.useRef)({enter:[],leave:[]}),f=aR((e,n,r)=>{c.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),null==t||t.chains.current[n].push([e,new Promise(e=>{c.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(d.current[n].map(([e,t])=>t)).then(()=>e())})]),"enter"===n?u.current=u.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),p=aR((e,t,n)=>{Promise.all(d.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=c.current.shift())||e()}).then(()=>n(t))});return(0,s.useMemo)(()=>({children:r,register:l,unregister:i,onStart:f,onStop:p,wait:u,chains:d}),[l,i,r,f,p,d,u])}OR.displayName="NestingContext";let RR=s.Fragment,UR=xR.RenderStrategy,BR=SR(function(e,t){let{show:n,appear:r=!1,unmount:o=!0,...a}=e,i=(0,s.useRef)(null),l=cR(...AR(e)?[i,t]:null===t?[]:[t]);sR();let c=gR();if(void 0===n&&null!==c&&(n=(c&hR.Open)===hR.Open),void 0===n)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=(0,s.useState)(n?"visible":"hidden"),f=PR(()=>{n||d("hidden")}),[p,m]=(0,s.useState)(!0),h=(0,s.useRef)([n]);rR(()=>{!1!==p&&h.current[h.current.length-1]!==n&&(h.current.push(n),m(!1))},[h,n]);let g=(0,s.useMemo)(()=>({show:n,appear:r,initial:p}),[n,r,p]);rR(()=>{n?d("visible"):!zR(f)&&null!==i.current&&d("hidden")},[n,f]);let w={unmount:o},y=aR(()=>{var t;p&&m(!1),null==(t=e.beforeEnter)||t.call(e)}),b=aR(()=>{var t;p&&m(!1),null==(t=e.beforeLeave)||t.call(e)}),v=ER();return s.createElement(OR.Provider,{value:f},s.createElement(TR.Provider,{value:g},v({ourProps:{...w,as:s.Fragment,children:s.createElement(FR,{ref:l,...w,...a,beforeEnter:y,beforeLeave:b})},theirProps:{},defaultTag:s.Fragment,features:UR,visible:"visible"===u,name:"Transition"})))}),FR=SR(function(e,t){var n,r;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:l,afterLeave:c,enter:u,enterFrom:d,enterTo:f,entered:p,leave:m,leaveFrom:h,leaveTo:g,...w}=e,[y,b]=(0,s.useState)(null),v=(0,s.useRef)(null),x=AR(e),N=cR(...x?[v,t,b]:null===t?[]:[t]),E=null==(n=w.unmount)||n?NR.Unmount:NR.Hidden,{show:_,appear:M,initial:I}=function(){let e=(0,s.useContext)(TR);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[S,k]=(0,s.useState)(_?"visible":"hidden"),D=function(){let e=(0,s.useContext)(OR);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:C,unregister:j}=D;rR(()=>C(v),[C,v]),rR(()=>{if(E===NR.Hidden&&v.current)return _&&"visible"!==S?void k("visible"):vR(S,{hidden:()=>j(v),visible:()=>C(v)})},[S,v,C,j,_,E]);let A=sR();rR(()=>{if(x&&A&&"visible"===S&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,S,A,x]);let T=I&&!M,L=M&&_&&I,O=(0,s.useRef)(!1),z=PR(()=>{O.current||(k("hidden"),j(v))},D),P=aR(e=>{O.current=!0;let t=e?"enter":"leave";z.onStart(v,t,e=>{"enter"===e?null==a||a():"leave"===e&&(null==l||l())})}),R=aR(e=>{let t=e?"enter":"leave";O.current=!1,z.onStop(v,t,e=>{"enter"===e?null==i||i():"leave"===e&&(null==c||c())}),"leave"===t&&!zR(z)&&(k("hidden"),j(v))});(0,s.useEffect)(()=>{x&&o||(P(_),R(_))},[_,x,o]);let U=!(!o||!x||!A||T),[,B]=function(e,t,n,r){let[o,a]=(0,s.useState)(n),{hasFlag:i,addFlag:l,removeFlag:c}=function(e=0){let[t,n]=(0,s.useState)(e),r=(0,s.useCallback)(e=>n(e),[]),o=(0,s.useCallback)(e=>n(t=>t|e),[]),a=(0,s.useCallback)(e=>(t&e)===e,[t]),i=(0,s.useCallback)(e=>n(t=>t&~e),[]),l=(0,s.useCallback)(e=>n(t=>t^e),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:a,removeFlag:i,toggleFlag:l}}(e&&o?3:0),u=(0,s.useRef)(!1),d=(0,s.useRef)(!1),f=KP();return rR(()=>{var o;if(e)return n&&a(!0),t?(null==(o=null==r?void 0:r.start)||o.call(r,n),function(e,{prepare:t,run:n,done:r,inFlight:o}){let a=JP();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:o}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(function(e,t){var n,r;let o=JP();if(!e)return o.dispose;let a=!1;o.add(()=>{a=!0});let i=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter(e=>e instanceof CSSTransition))?r:[];return 0===i.length?(t(),o.dispose):(Promise.allSettled(i.map(e=>e.finished)).then(()=>{a||t()}),o.dispose)}(e,r))})}),a.dispose}(t,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(l(3),c(4)):(l(4),c(2)))},run(){d.current?n?(c(3),l(4)):(c(4),l(3)):n?c(1):l(1)},done(){var e;d.current&&function(e){var t,n;return(null!=(n=null==(t=e.getAnimations)?void 0:t.call(e))?n:[]).some(e=>e instanceof CSSTransition&&"finished"!==e.playState)}(t)||(u.current=!1,c(7),n||a(!1),null==(e=null==r?void 0:r.end)||e.call(r,n))}})):void(n&&l(3))},[e,n,t,f]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}(U,y,_,{start:P,end:R}),F=kR({ref:N,className:(null==(r=bR(w.className,L&&u,L&&d,B.enter&&u,B.enter&&B.closed&&d,B.enter&&!B.closed&&f,B.leave&&m,B.leave&&!B.closed&&h,B.leave&&B.closed&&g,!B.transition&&_&&p))?void 0:r.trim())||void 0,...pR(B)}),Q=0;"visible"===S&&(Q|=hR.Open),"hidden"===S&&(Q|=hR.Closed),_&&"hidden"===S&&(Q|=hR.Opening),!_&&"visible"===S&&(Q|=hR.Closing);let V=ER();return s.createElement(OR.Provider,{value:z},s.createElement(wR,{value:Q},V({ourProps:F,theirProps:w,defaultTag:RR,features:UR,visible:"visible"===S,name:"Transition.Child"})))}),QR=SR(function(e,t){let n=null!==(0,s.useContext)(TR),r=null!==gR();return s.createElement(s.Fragment,null,!n&&r?s.createElement(BR,{ref:t,...e}):s.createElement(FR,{ref:t,...e}))}),VR=Object.assign(BR,{Child:QR,Root:BR});var YR=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(YR||{});function ZR(e,t,n,r){let o=oR(n);(0,s.useEffect)(()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}class WR extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}}var GR,HR,$R,XR=Object.defineProperty,qR=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},JR=(e,t,n)=>(qR(e,t,"read from private field"),n?n.call(e):t.get(e)),KR=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},eU=(e,t,n,r)=>(qR(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class tU{constructor(e){KR(this,GR,{}),KR(this,HR,new WR(()=>new Set)),KR(this,$R,new Set),((e,t,n)=>{((e,t,n)=>{t in e?XR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n)})(this,"disposables",JP()),eU(this,GR,e),nR.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return JR(this,GR)}subscribe(e,t){if(nR.isServer)return()=>{};let n={selector:e,callback:t,current:e(JR(this,GR))};return JR(this,$R).add(n),this.disposables.add(()=>{JR(this,$R).delete(n)})}on(e,t){return nR.isServer?()=>{}:(JR(this,HR).get(e).add(t),this.disposables.add(()=>{JR(this,HR).get(e).delete(t)}))}send(e){let t=this.reduce(JR(this,GR),e);if(t!==JR(this,GR)){eU(this,GR,t);for(let e of JR(this,$R)){let t=e.selector(JR(this,GR));nU(e.current,t)||(e.current=t,e.callback(t))}for(let t of JR(this,HR).get(e.type))t(JR(this,GR),e)}}}function nU(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&rU(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&rU(e.entries(),t.entries()):!(!oU(e)||!oU(t))&&rU(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function rU(e,t){for(;;){let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}}function oU(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}GR=new WeakMap,HR=new WeakMap,$R=new WeakMap;var aU=Object.defineProperty,iU=(e,t,n)=>(((e,t,n)=>{t in e?aU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),sU=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(sU||{});let lU={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(-1!==o){let t=e.stack.slice();return t.splice(o,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(-1===r)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}};class cU extends tU{constructor(){super(...arguments),iU(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),iU(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new cU({stack:[]})}reduce(e,t){return vR(t.type,lU,e,t)}}const uU=new WR(()=>cU.new());var dU=n(8418);function fU(e,t,n=nU){return(0,dU.useSyncExternalStoreWithSelector)(aR(t=>e.subscribe(pU,t)),aR(()=>e.state),aR(()=>e.state),aR(t),n)}function pU(e){return e}function mU(e,t){let n=(0,s.useId)(),r=uU.get(t),[o,a]=fU(r,(0,s.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return rR(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),!!e&&(!a||o)}function hU(e){var t;return nR.isServer?null:null==e?document:null!=(t=null==e?void 0:e.ownerDocument)?t:document}function gU(e){var t,n;return nR.isServer?null:null==e?document:null!=(n=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))?n:document}function wU(e){var t,n;return null!=(n=null==(t=gU(e))?void 0:t.activeElement)?n:null}let yU=new Map,bU=new Map;function vU(e){var t;let n=null!=(t=bU.get(e))?t:0;return bU.set(e,n+1),0!==n||(yU.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>function(e){var t;let n=null!=(t=bU.get(e))?t:1;if(1===n?bU.delete(e):bU.set(e,n-1),1!==n)return;let r=yU.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,yU.delete(e))}(e)}function xU(e){return function(e){return"object"==typeof e&&null!==e&&"nodeType"in e}(e)&&"tagName"in e}function NU(e){return xU(e)&&"accessKey"in e}function EU(e){return xU(e)&&"tabIndex"in e}let _U=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),MU=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var IU=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(IU||{}),SU=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(SU||{}),kU=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(kU||{});var DU=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(DU||{});var CU=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(CU||{});function jU(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let AU=["textarea","input"].join(",");function TU(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let a=Array.isArray(e)?e.length>0?gU(e[0]):document:gU(e),i=Array.isArray(e)?n?function(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let a=r.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(MU)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e):function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(_U)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e);o.length>0&&i.length>1&&(i=i.filter(e=>!o.some(t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))),r=null!=r?r:null==a?void 0:a.activeElement;let s,l=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,i.indexOf(r))-1;if(4&t)return Math.max(0,i.indexOf(r))+1;if(8&t)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=32&t?{preventScroll:!0}:{},d=0,f=i.length;do{if(d>=f||d+f<=0)return 0;let e=c+d;if(16&t)e=(e+f)%f;else{if(e<0)return 3;if(e>=f)return 1}s=i[e],null==s||s.focus(u),d+=l}while(s!==wU(s));return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,AU))&&n}(s)&&s.select(),2}function LU(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function OU(){return LU()||/Android/gi.test(window.navigator.userAgent)}function zU(e,t,n,r){let o=oR(n);(0,s.useEffect)(()=>{if(e)return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r);function n(e){o.current(e)}},[e,t,r])}function PU(e,t,n,r){let o=oR(n);(0,s.useEffect)(()=>{if(e)return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r);function n(e){o.current(e)}},[e,t,r])}function RU(e,t,n){let r=oR(n),o=(0,s.useCallback)(function(e,n){if(e.defaultPrevented)return;let o=n(e);if(null===o||!o.getRootNode().contains(o)||!o.isConnected)return;let a=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of a)if(null!==t&&(t.contains(o)||e.composed&&e.composedPath().includes(t)))return;return!function(e,t=0){var n;return e!==(null==(n=hU(e))?void 0:n.body)&&vR(t,{0:()=>e.matches(_U),1(){let t=e;for(;null!==t;){if(t.matches(_U))return!0;t=t.parentElement}return!1}})}(o,DU.Loose)&&-1!==o.tabIndex&&e.preventDefault(),r.current(e,o)},[r,t]),a=(0,s.useRef)(null);zU(e,"pointerdown",e=>{var t,n;OU()||(a.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),zU(e,"pointerup",e=>{if(OU()||!a.current)return;let t=a.current;return a.current=null,o(e,()=>t)},!0);let i=(0,s.useRef)({x:0,y:0});zU(e,"touchstart",e=>{i.current.x=e.touches[0].clientX,i.current.y=e.touches[0].clientY},!0),zU(e,"touchend",e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-i.current.x)>=30||Math.abs(n-i.current.y)>=30))return o(e,()=>EU(e.target)?e.target:null)},!0),PU(e,"blur",e=>o(e,()=>function(e){return NU(e)&&"IFRAME"===e.nodeName}(window.document.activeElement)?window.document.activeElement:null),!0)}function UU(...e){return(0,s.useMemo)(()=>hU(...e),[...e])}var BU=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(BU||{});let FU=SR(function(e,t){var n;let{features:r=1,...o}=e,a={ref:t,"aria-hidden":!(2&~r)||(null!=(n=o["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}};return ER()({ourProps:a,theirProps:o,slot:{},defaultTag:"span",name:"Hidden"})}),QU=(0,s.createContext)(null);function VU({children:e,node:t}){let[n,r]=(0,s.useState)(null),o=YU(null!=t?t:n);return s.createElement(QU.Provider,{value:o},e,null===o&&s.createElement(FU,{features:BU.Hidden,ref:e=>{var t,n;if(e)for(let o of null!=(n=null==(t=hU(e))?void 0:t.querySelectorAll("html > *, body > *"))?n:[])if(o!==document.body&&o!==document.head&&xU(o)&&null!=o&&o.contains(e)){r(o);break}}}))}function YU(e=null){var t;return null!=(t=(0,s.useContext)(QU))?t:e}function ZU(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=null!=(n=t.defaultView)?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-o);n.style(r,"paddingRight",`${a}px`)}}}function WU(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let GU=function(e,t){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let a=t[e].call(n,...o);a&&(n=a,r.forEach(e=>e()))}}}(0,{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:JP(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=WU(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=WU(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta:()=>e.computedMeta},n=[LU()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=JP();n.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>n.dispose()))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,a=null;t.addEventListener(e,"click",t=>{if(EU(t.target))try{let n=t.target.closest("a");if(!n)return;let{hash:o}=new URL(n.href),i=e.querySelector(o);EU(i)&&!r(i)&&(a=i)}catch{}},!0),t.group(n=>{t.addEventListener(e,"touchstart",e=>{if(n.dispose(),EU(e.target)&&function(e){return xU(e)&&"style"in e}(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,"overscrollBehavior","contain")}else n.style(e.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",e=>{if(EU(e.target)){if(function(e){return NU(e)&&"INPUT"===e.nodeName}(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;o!==t&&window.scrollTo(0,o),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{},ZU(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];n.forEach(({before:e})=>null==e?void 0:e(t)),n.forEach(({after:e})=>null==e?void 0:e(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function HU(e){return(0,s.useMemo)(()=>e,Object.values(e))}GU.subscribe(()=>{let e=GU.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&GU.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&GU.dispatch("TEARDOWN",n)}});let $U=(0,s.createContext)(()=>{});function XU({value:e,children:t}){return s.createElement($U.Provider,{value:e},t)}let qU=(0,s.createContext)(!1);function JU(e){return s.createElement(qU.Provider,{value:e.force},e.children)}let KU=(0,s.createContext)(void 0),eB=(0,s.createContext)(null);function tB(){let e=(0,s.useContext)(eB);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,tB),e}return e}eB.displayName="DescriptionContext";let nB=SR(function(e,t){let n=(0,s.useId)(),r=(0,s.useContext)(KU),{id:o=`headlessui-description-${n}`,...a}=e,i=tB(),l=cR(t);rR(()=>i.register(o),[o,i.register]);let c=HU({...i.slot,disabled:r||!1}),u={ref:l,...i.props,id:o};return ER()({ourProps:u,theirProps:a,slot:c,defaultTag:"p",name:i.name||"Description"})}),rB=Object.assign(nB,{});function oB(e){let t=aR(e),n=(0,s.useRef)(!1);(0,s.useEffect)(()=>(n.current=!1,()=>{n.current=!0,qP(()=>{n.current&&t()})}),[t])}var aB=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(aB||{});function iB(e,t){let n=(0,s.useRef)([]),r=aR(e);(0,s.useEffect)(()=>{let e=[...n.current];for(let[o,a]of t.entries())if(n.current[o]!==a){let o=r(t,e);return n.current=t,o}},[r,...t])}let sB=[];function lB(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)xU(n.current)&&t.add(n.current);return t}!function(){function e(){"loading"!==document.readyState&&((()=>{function e(e){if(!EU(e.target)||e.target===document.body||sB[0]===e.target)return;let t=e.target;t=t.closest(_U),sB.unshift(null!=t?t:e.target),sB=sB.filter(e=>null!=e&&e.isConnected),sB.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",e))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",e),e())}();var cB=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(cB||{});let uB=SR(function(e,t){let n=(0,s.useRef)(null),r=cR(n,t),{initialFocus:o,initialFocusFallback:a,containers:i,features:l=15,...c}=e;sR()||(l=0);let u=UU(n.current);!function(e,{ownerDocument:t}){let n=!!(8&e),r=function(e=!0){let t=(0,s.useRef)(sB.slice());return iB(([e],[n])=>{!0===n&&!1===e&&qP(()=>{t.current.splice(0)}),!1===n&&!0===e&&(t.current=sB.slice())},[e,sB,t]),aR(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(n);iB(()=>{n||function(e){return wU(e)===e}(null==t?void 0:t.body)&&jU(r())},[n]),oB(()=>{n&&jU(r())})}(l,{ownerDocument:u});let d=function(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let a=(0,s.useRef)(null),i=mU(!!(1&e),"focus-trap#initial-focus"),l=iR();return iB(()=>{if(0===e)return;if(!i)return void(null!=o&&o.current&&jU(o.current));let s=n.current;s&&qP(()=>{if(!l.current)return;let n=null==t?void 0:t.activeElement;if(null!=r&&r.current){if((null==r?void 0:r.current)===n)return void(a.current=n)}else if(s.contains(n))return void(a.current=n);if(null!=r&&r.current)jU(r.current);else{if(16&e){if(TU(s,IU.First|IU.AutoFocus)!==SU.Error)return}else if(TU(s,IU.First)!==SU.Error)return;if(null!=o&&o.current&&(jU(o.current),(null==t?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=null==t?void 0:t.activeElement})},[o,i,e]),a}(l,{ownerDocument:u,container:n,initialFocus:o,initialFocusFallback:a});!function(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let a=iR(),i=!!(4&e);ZR(null==t?void 0:t.defaultView,"focus",e=>{if(!i||!a.current)return;let t=lB(r);NU(n.current)&&t.add(n.current);let s=o.current;if(!s)return;let l=e.target;NU(l)?fB(t,l)?(o.current=l,jU(l)):(e.preventDefault(),e.stopPropagation(),jU(s)):jU(o.current)},!0)}(l,{ownerDocument:u,container:n,containers:i,previousActiveElement:d});let f=function(){let e=(0,s.useRef)(0);return PU(!0,"keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}(),p=aR(e=>{if(!NU(n.current))return;let t=n.current;vR(f.current,{[aB.Forwards]:()=>{TU(t,IU.First,{skipElements:[e.relatedTarget,a]})},[aB.Backwards]:()=>{TU(t,IU.Last,{skipElements:[e.relatedTarget,a]})}})}),m=mU(!!(2&l),"focus-trap#tab-lock"),h=KP(),g=(0,s.useRef)(!1),w={ref:r,onKeyDown(e){"Tab"==e.key&&(g.current=!0,h.requestAnimationFrame(()=>{g.current=!1}))},onBlur(e){if(!(4&l))return;let t=lB(i);NU(n.current)&&t.add(n.current);let r=e.relatedTarget;EU(r)&&"true"!==r.dataset.headlessuiFocusGuard&&(fB(t,r)||(g.current?TU(n.current,vR(f.current,{[aB.Forwards]:()=>IU.Next,[aB.Backwards]:()=>IU.Previous})|IU.WrapAround,{relativeTo:e.target}):EU(e.target)&&jU(e.target)))}},y=ER();return s.createElement(s.Fragment,null,m&&s.createElement(FU,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:BU.Focusable}),y({ourProps:w,theirProps:c,defaultTag:"div",name:"FocusTrap"}),m&&s.createElement(FU,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:BU.Focusable}))}),dB=Object.assign(uB,{features:cB});function fB(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let pB=s.Fragment,mB=SR(function(e,t){let{ownerDocument:n=null,...r}=e,o=(0,s.useRef)(null),a=cR(function(e,t=!0){return Object.assign(e,{[lR]:t})}(e=>{o.current=e}),t),i=UU(o.current),l=function(e){let t=(0,s.useContext)(qU),n=(0,s.useContext)(gB),[r,o]=(0,s.useState)(()=>{var r;if(!t&&null!==n)return null!=(r=n.current)?r:null;if(nR.isServer)return null;let o=null==e?void 0:e.getElementById("headlessui-portal-root");if(o)return o;if(null===e)return null;let a=e.createElement("div");return a.setAttribute("id","headlessui-portal-root"),e.body.appendChild(a)});return(0,s.useEffect)(()=>{null!==r&&(null!=e&&e.body.contains(r)||null==e||e.body.appendChild(r))},[r,e]),(0,s.useEffect)(()=>{t||null!==n&&o(n.current)},[n,o,t]),r}(null!=n?n:i),c=(0,s.useContext)(wB),u=KP(),d=ER();return oB(()=>{var e;l&&l.childNodes.length<=0&&(null==(e=l.parentElement)||e.removeChild(l))}),l?(0,un.createPortal)(s.createElement("div",{"data-headlessui-portal":"",ref:e=>{u.dispose(),c&&e&&u.add(c.register(e))}},d({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:pB,name:"Portal"})),l):null}),hB=s.Fragment,gB=(0,s.createContext)(null),wB=(0,s.createContext)(null),yB=SR(function(e,t){let n=cR(t),{enabled:r=!0,ownerDocument:o,...a}=e,i=ER();return r?s.createElement(mB,{...a,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:pB,name:"Portal"})}),bB=SR(function(e,t){let{target:n,...r}=e,o={ref:cR(t)},a=ER();return s.createElement(gB.Provider,{value:n},a({ourProps:o,theirProps:r,defaultTag:hB,name:"Popover.Group"}))}),vB=Object.assign(yB,{Group:bB});var xB=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(xB||{}),NB=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(NB||{});let EB={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},_B=(0,s.createContext)(null);function MB(e){let t=(0,s.useContext)(_B);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,MB),t}return t}function IB(e,t){return vR(t.type,EB,e,t)}_B.displayName="DialogContext";let SB=SR(function(e,t){let n=(0,s.useId)(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:a,initialFocus:i,role:l="dialog",autoFocus:c=!0,__demoMode:u=!1,unmount:d=!1,...f}=e,p=(0,s.useRef)(!1);l="dialog"===l||"alertdialog"===l?l:(p.current||(p.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let m=gR();void 0===o&&null!==m&&(o=(m&hR.Open)===hR.Open);let h=(0,s.useRef)(null),g=cR(h,t),w=UU(h.current),y=o?0:1,[b,v]=(0,s.useReducer)(IB,{titleId:null,descriptionId:null,panelRef:(0,s.createRef)()}),x=aR(()=>a(!1)),N=aR(e=>v({type:0,id:e})),E=!!sR()&&0===y,[_,M]=function(){let e=(0,s.useContext)(wB),t=(0,s.useRef)([]),n=aR(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=aR(n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)}),o=(0,s.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,s.useMemo)(()=>function({children:e}){return s.createElement(wB.Provider,{value:o},e)},[o])]}(),I={get current(){var e;return null!=(e=b.panelRef.current)?e:h.current}},S=YU(),{resolveContainers:k}=function({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=aR(()=>{var r,o;let a=hU(n),i=[];for(let t of e)null!==t&&(xU(t)?i.push(t):"current"in t&&xU(t.current)&&i.push(t.current));if(null!=t&&t.current)for(let e of t.current)i.push(e);for(let e of null!=(r=null==a?void 0:a.querySelectorAll("html > *, body > *"))?r:[])e!==document.body&&e!==document.head&&xU(e)&&"headlessui-portal-root"!==e.id&&(n&&(e.contains(n)||e.contains(null==(o=null==n?void 0:n.getRootNode())?void 0:o.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:aR(e=>r().some(t=>t.contains(e)))}}({mainTreeNode:S,portals:_,defaultContainers:[I]}),D=null!==m&&(m&hR.Closing)===hR.Closing;!function(e,{allowed:t,disallowed:n}={}){let r=mU(e,"inert-others");rR(()=>{var e,o;if(!r)return;let a=JP();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&a.add(vU(t));let i=null!=(o=null==t?void 0:t())?o:[];for(let e of i){if(!e)continue;let t=hU(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)i.some(t=>e.contains(t))||a.add(vU(e));n=n.parentElement}}return a.dispose},[r,t,n])}(!u&&!D&&E,{allowed:aR(()=>{var e,t;return[null!=(t=null==(e=h.current)?void 0:e.closest("[data-headlessui-portal]"))?t:null]}),disallowed:aR(()=>{var e;return[null!=(e=null==S?void 0:S.closest("body > *:not(#headlessui-portal-root)"))?e:null]})});let C=uU.get(null);rR(()=>{if(E)return C.actions.push(r),()=>C.actions.pop(r)},[C,r,E]);let j=fU(C,(0,s.useCallback)(e=>C.selectors.isTop(e,r),[C,r]));RU(j,k,e=>{e.preventDefault(),x()}),function(e,t=("undefined"!=typeof document?document.defaultView:null),n){let r=mU(e,"escape");ZR(t,"keydown",e=>{r&&(e.defaultPrevented||e.key===YR.Escape&&n(e))})}(j,null==w?void 0:w.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),x()}),function(e,t,n=()=>[document.body]){!function(e,t,n=()=>({containers:[]})){let r=function(e){return(0,s.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}(GU),o=t?r.get(t):void 0,a=!!o&&o.count>0;rR(()=>{if(t&&e)return GU.dispatch("PUSH",t,n),()=>GU.dispatch("POP",t,n)},[e,t])}(mU(e,"scroll-lock"),t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}})}(!u&&!D&&E,w,k),function(e,t,n){let r=oR(e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()});(0,s.useEffect)(()=>{if(!e)return;let n=null===t?null:NU(t)?t:t.current;if(!n)return;let o=JP();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(()=>r.current(n));e.observe(n),o.add(()=>e.disconnect())}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),o.add(()=>e.disconnect())}return()=>o.dispose()},[t,r,e])}(E,h,x);let[A,T]=function(){let[e,t]=(0,s.useState)([]);return[e.length>0?e.join(" "):void 0,(0,s.useMemo)(()=>function(e){let n=aR(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),r=(0,s.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return s.createElement(eB.Provider,{value:r},e.children)},[t])]}(),L=(0,s.useMemo)(()=>[{dialogState:y,close:x,setTitleId:N,unmount:d},b],[y,x,N,d,b]),O=HU({open:0===y}),z={ref:g,id:r,role:l,tabIndex:-1,"aria-modal":u?void 0:0===y||void 0,"aria-labelledby":b.titleId,"aria-describedby":A,unmount:d},P=!function(){var e;let[t]=(0,s.useState)(()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null),[n,r]=(0,s.useState)(null!=(e=null==t?void 0:t.matches)&&e);return rR(()=>{if(t)return t.addEventListener("change",e),()=>t.removeEventListener("change",e);function e(e){r(e.matches)}},[t]),n}(),R=cB.None;E&&!u&&(R|=cB.RestoreFocus,R|=cB.TabLock,c&&(R|=cB.AutoFocus),P&&(R|=cB.InitialFocus));let U=ER();return s.createElement(yR,null,s.createElement(JU,{force:!0},s.createElement(vB,null,s.createElement(_B.Provider,{value:L},s.createElement(bB,{target:h},s.createElement(JU,{force:!1},s.createElement(T,{slot:O},s.createElement(M,null,s.createElement(dB,{initialFocus:i,initialFocusFallback:h,containers:k,features:R},s.createElement(XU,{value:x},U({ourProps:z,theirProps:f,slot:O,defaultTag:kB,features:DB,visible:0===y,name:"Dialog"})))))))))))}),kB="div",DB=xR.RenderStrategy|xR.Static,CB=SR(function(e,t){let{transition:n=!1,open:r,...o}=e,a=gR(),i=e.hasOwnProperty("open")||null!==a,l=e.hasOwnProperty("onClose");if(!i&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&"boolean"!=typeof e.open)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if("function"!=typeof e.onClose)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return void 0===r&&!n||o.static?s.createElement(VU,null,s.createElement(SB,{ref:t,open:r,...o})):s.createElement(VU,null,s.createElement(VR,{show:r,transition:n,unmount:o.unmount},s.createElement(SB,{ref:t,...o})))}),jB=SR(function(e,t){let n=(0,s.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...a}=e,[{dialogState:i,unmount:l},c]=MB("Dialog.Panel"),u=cR(t,c.panelRef),d=HU({open:0===i}),f=aR(e=>{e.stopPropagation()}),p={ref:u,id:r,onClick:f},m=o?QR:s.Fragment,h=o?{unmount:l}:{},g=ER();return s.createElement(m,{...h},g({ourProps:p,theirProps:a,slot:d,defaultTag:"div",name:"Dialog.Panel"}))}),AB=(SR(function(e,t){let{transition:n=!1,...r}=e,[{dialogState:o,unmount:a}]=MB("Dialog.Backdrop"),i=HU({open:0===o}),l={ref:t,"aria-hidden":!0},c=n?QR:s.Fragment,u=n?{unmount:a}:{},d=ER();return s.createElement(c,{...u},d({ourProps:l,theirProps:r,slot:i,defaultTag:"div",name:"Dialog.Backdrop"}))}),SR(function(e,t){let n=(0,s.useId)(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:a,setTitleId:i}]=MB("Dialog.Title"),l=cR(t);(0,s.useEffect)(()=>(i(r),()=>i(null)),[r,i]);let c=HU({open:0===a}),u={ref:l,id:r};return ER()({ourProps:u,theirProps:o,slot:c,defaultTag:"h2",name:"Dialog.Title"})})),TB=Object.assign(CB,{Panel:jB,Title:AB,Description:rB});const LB=({sourceStep:e,availableSteps:t,acceptRedirect:n,setAcceptRedirect:r,rejectRedirect:o,setRejectRedirect:a})=>(0,i.createElement)("div",{className:"border border-gray-200 rounded-lg p-4 mb-4"},(0,i.createElement)("div",{className:"font-medium text-gray-800 mb-3"},e.title," (",e.type,")",e.isVariation&&(0,i.createElement)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded"},(0,C.__)("A/B Variation","cartflows"))),(0,i.createElement)("div",{className:"mb-3"},(0,i.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,C.__)("Accept (Yes) - redirect to:","cartflows")),(0,i.createElement)("select",{className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:ring focus:ring-primary-100 focus:border-primary-500 focus:outline-none",value:n,onChange:e=>r(e.target.value)},t.map(e=>(0,i.createElement)("option",{key:`accept-${e.id}`,value:e.id},e.title)))),(0,i.createElement)("div",null,(0,i.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,C.__)("Reject (No) - redirect to:","cartflows")),(0,i.createElement)("select",{className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:ring focus:ring-primary-100 focus:border-primary-500 focus:outline-none",value:o,onChange:e=>a(e.target.value)},t.map(e=>(0,i.createElement)("option",{key:`reject-${e.id}`,value:e.id},e.title))))),OB=({isOpen:e,onClose:t,onConfirm:n,stepToDelete:r,flowSteps:o})=>{const a=(0,s.useRef)(null),[l,c]=(0,s.useState)({}),u=(0,s.useMemo)(()=>{if(!o||!r)return[];const e=[],t=parseInt(r.step_id,10);return o.forEach(n=>{if("upsell"===n.type||"downsell"===n.type){const r=parseInt(n.offer_yes_step_id,10)===t,o=parseInt(n.offer_no_step_id,10)===t;(r||o)&&e.push({id:n.id,title:n.title,type:n.type,currentAccept:n.offer_yes_step_id,currentReject:n.offer_no_step_id,acceptPointsToDeleted:r,rejectPointsToDeleted:o,isVariation:!1,controlStepId:n.id});const a=n["ab-test-variations"];Array.isArray(a)&&a.length>0&&a.forEach(r=>{const o=parseInt(r.offer_yes_step_id,10)===t,a=parseInt(r.offer_no_step_id,10)===t;if(o||a){const t=r.title||`${n.title} - Variation`;e.push({id:r.id,title:t,type:n.type,currentAccept:r.offer_yes_step_id,currentReject:r.offer_no_step_id,acceptPointsToDeleted:o,rejectPointsToDeleted:a,isVariation:!0,controlStepId:n.id})}})}}),e},[o,r]),d=(e,t)=>{if(!o||!r)return[];const n=t||e,a=o.findIndex(e=>parseInt(e.id,10)===parseInt(n,10));if(-1===a)return[];const i=parseInt(r.step_id,10);return o.slice(a+1).filter(e=>parseInt(e.id,10)!==i&&"checkout"!==e.type)};(0,s.useEffect)(()=>{if(u.length>0){const e={};u.forEach(t=>{const n=d(t.id,t.controlStepId),r=n.length>0?n[0].id:"";e[t.id]={accept:t.acceptPointsToDeleted?r:t.currentAccept,reject:t.rejectPointsToDeleted?r:t.currentReject}}),c(e)}},[e,o,r]);const f=(e,t,n)=>{c(r=>({...r,[e]:{...r[e],[t]:n}}))};return e?(0,un.createPortal)((0,i.createElement)(VR.Root,{show:e,as:s.Fragment},(0,i.createElement)(TB,{as:"div",className:"relative z-[99999] wcf-confirm-popup",initialFocus:a,onClose:()=>{}},(0,i.createElement)(VR.Child,{as:s.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,i.createElement)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})),(0,i.createElement)("div",{className:"fixed inset-0 z-10 overflow-y-auto"},(0,i.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0"},(0,i.createElement)(VR.Child,{as:s.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,i.createElement)(TB.Panel,{className:"wcf-confirm-popup-wrapper relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"},(0,i.createElement)("div",{className:"absolute top-0 right-0 hidden pt-4 pr-4 sm:block"},(0,i.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none",onClick:t},(0,i.createElement)("span",{className:"sr-only"},"Close"),(0,i.createElement)(ww,{className:"h-6 w-6","aria-hidden":"true"}))),(0,i.createElement)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},(0,i.createElement)("div",{className:"sm:flex sm:items-start"},(0,i.createElement)("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"},(0,i.createElement)(jh,{className:"h-6 w-6 text-red-600","aria-hidden":"true"})),(0,i.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},(0,i.createElement)(TB.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900 capitalize"},(0,C.__)("Delete Step","cartflows")),(0,i.createElement)("div",{className:"mt-2"},(0,i.createElement)("p",{className:"text-sm text-gray-500"},(0,C.__)("Are you sure you want to delete this step?","cartflows"))))),u.length>0&&(0,i.createElement)("div",{className:"mt-4"},(0,i.createElement)("p",{className:"text-sm font-medium text-gray-700 mb-3"},(0,C.__)("The following steps have edges pointing to this step. Please select where they should redirect after deletion:","cartflows")),u.map(e=>{const t=d(e.id,e.controlStepId),n=l[e.id]||{};return(0,i.createElement)(LB,{key:e.id,sourceStep:e,availableSteps:t,acceptRedirect:n.accept||"",setAcceptRedirect:t=>f(e.id,"accept",t),rejectRedirect:n.reject||"",setRejectRedirect:t=>f(e.id,"reject",t)})}))),(0,i.createElement)("div",{className:"flex bg-gray-50 px-4 py-3 flex-col-reverse sm:flex-row gap-3 sm:justify-end sm:px-6"},(0,i.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:t,ref:a},(0,C.__)("Cancel","cartflows")),(0,i.createElement)("button",{type:"button",className:"wcf-button wcf-primary-button",onClick:()=>{n(l)}},(0,C.__)("Delete","cartflows"))))))))),document.body):null},zB=(0,s.memo)(({data:e,isConnectable:t})=>{const n="upsell"===e.step_type?$P:XP,r="vertical"===e?.axis,o="LR"===e.direction?"target":"source",a="LR"===e.direction?"source":"target",[,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),[d,p]=(0,s.useState)("cartflows_delete_step"),m=Oh(),h=(0,qh.W6)(),[{license_status:g}]=f(),[{steps:w,is_flow_instant_checkout:y}]=Yp(),b=ZP.createEventHandlers(e,m,h,l,{delete:e=>{e.preventDefault();const t=e.currentTarget.getAttribute("data-action")||"cartflows_delete_step";p(t),u(!0)}});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:"target",position:bA.Top,id:"top",style:{background:"#555",visibility:r?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),"LR"===e.direction&&!r&&(0,i.createElement)(DO,{type:o,position:bA.Left,id:"left",style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),"RL"===e.direction&&!r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:o,position:bA.Left,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,i.createElement)(DO,{type:o,position:bA.Left,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})),ZP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},n,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,b,g,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,[],y,e.is_locked),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e?.label),"LR"===e.direction&&!r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:a,position:bA.Right,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,i.createElement)(DO,{type:a,position:bA.Right,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})),"RL"===e.direction&&!r&&(0,i.createElement)(DO,{type:a,position:bA.Right,style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:"source",position:bA.Bottom,id:"a",style:{left:80,background:"#16A34A"},className:"react-flow__handle wcf-handle-bottom-accept",isConnectable:t}),(0,i.createElement)(DO,{type:"source",position:bA.Bottom,id:"b",style:{left:"auto",right:80,background:"#DC2626"},className:"react-flow__handle wcf-handle-bottom-reject",isConnectable:t})),(0,i.createElement)(OB,{isOpen:c,onClose:()=>u(!1),onConfirm:async t=>{u(!1),await ZP.performDelete(e,d,l,t)},stepToDelete:e,flowSteps:w}))}),PB="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTI2LjU4MyA3OS4wMDhWODEuNWEyNy4wOCAyNy4wOCAwIDAgMS0xOS40MDQgMjUuOTU2IDI3LjA4MyAyNy4wODMgMCAxIDEgMy4zNDQtNTAuNzEiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNMTI2LjU4MyA1OS44MzMgOTkuNSA4Ni45NDNsLTguMTI1LTguMTI0IiBzdHJva2U9IiMyMjcxQjEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHJlY3QgeD0iODMiIHk9IjE0MyIgd2lkdGg9IjM1IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iNzgiIHk9IjEyOSIgd2lkdGg9IjQ1IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iMjMiIHk9IjE1NyIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjIzIiB5PSIxNzEiIHdpZHRoPSIxNTQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIyMyIgeT0iMTg1IiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMjMiIHk9IjE5OSIgd2lkdGg9IjkyLjQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSI3MiIgeT0iMjIzIiB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iOTQiIHk9IjIyMyIgd2lkdGg9IjEyIiBoZWlnaHQ9IjEyIiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjExNiIgeT0iMjIzIiB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PC9zdmc+",RB=(0,s.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o=r?"target":"source",a=r?"source":"target",[,l]=(0,s.useState)(!1),c=Oh(),u=(0,qh.W6)(),[{license_status:d}]=f(),[{is_flow_instant_checkout:p}]=Yp(),m=ZP.createEventHandlers(e,c,u,l);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:"target",position:bA.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),(0,i.createElement)(DO,{type:o,position:bA.Left,id:"left",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),ZP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},PB,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,m,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,[],p,e.is_locked),(0,i.createElement)(DO,{type:a,position:bA.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,i.createElement)(DO,{type:"source",position:bA.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e?.label))}),UB="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iMSIgd2lkdGg9IjE5OSIgaGVpZ2h0PSIyNTgiIHJ4PSI5LjUiIGZpbGw9IiNmZmYiIHN0cm9rZT0iI0VBRUFFQSIvPjxwYXRoIGQ9Ik0wIDEwLjVDMCA0Ljk3NyA0LjQ3Ny41IDEwIC41aDE4MGM1LjUyMyAwIDEwIDQuNDc3IDEwIDEwdjE4SDB2LTE4WiIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iI0ZGM0IzMCIvPjxjaXJjbGUgY3g9IjI3IiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iI0ZDMCIvPjxjaXJjbGUgY3g9IjQwIiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjY0IiB5PSIxMC41IiB3aWR0aD0iMTA3IiBoZWlnaHQ9IjciIHJ4PSIxIiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbD0iI0Y2RkFGRiIgZD0iTTExMyA0OWg2NHY5MmgtNjR6Ii8+PHJlY3QgeD0iMTI1IiB5PSI2NCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTEyMC41IDc5YS41LjUgMCAwIDEgLjUtLjVoNDhhLjUuNSAwIDAgMSAuNS41djRhLjUuNSAwIDAgMS0uNS41aC00OGEuNS41IDAgMCAxLS41LS41di00Wk0xMjAuNSA5MGEuNS41IDAgMCAxIC41LS41aDQ4YS41LjUgMCAwIDEgLjUuNXY0YS41LjUgMCAwIDEtLjUuNWgtNDhhLjUuNSAwIDAgMS0uNS0uNXYtNFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iI0I3Q0ZFMiIvPjxyZWN0IHg9IjEyMC41IiB5PSIxMDMuNSIgd2lkdGg9IjQiIGhlaWdodD0iNCIgcng9Ii41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNDQ0RFRUQiLz48cmVjdCB4PSIxMzAiIHk9IjEwNCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjMiIHJ4PSIxIiBmaWxsPSIjQ0NERUVEIi8+PHJlY3QgeD0iMTIwIiB5PSIxMTgiIHdpZHRoPSI1MCIgaGVpZ2h0PSI3IiByeD0iMiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjIzIiB5PSI2MCIgd2lkdGg9IjgwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHBhdGggZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjRTZFQUVEIiBzdHJva2Utd2lkdGg9IjEuNSIgZD0iTTIzLjc1IDc0Ljc1aDc4LjV2NDMuNWgtNzguNXoiLz48cGF0aCBkPSJNNjMgODguMjVhOC43NSA4Ljc1IDAgMSAwIC4wMDEgMTcuNTAxQTguNzUgOC43NSAwIDAgMCA2MyA4OC4yNVptMCAxNi4wMTZhNy4yNjcgNy4yNjcgMCAwIDEgMC0xNC41MzIgNy4yNjcgNy4yNjcgMCAwIDEgMCAxNC41MzJaIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0ibTY3LjA1IDk2Ljc0OC01Ljc4Mi00LjJhLjMxLjMxIDAgMCAwLS40OTUuMjUzdjguMzk4YzAgLjI1Ni4yOS40MDEuNDk1LjI1Mmw1Ljc4My00LjE5OWEuMzEyLjMxMiAwIDAgMCAuMDk1LS4zOTMuMzEyLjMxMiAwIDAgMC0uMDk1LS4xMTFabS01LjAzIDIuNjE3di00LjczTDY1LjI3NSA5N2wtMy4yNTYgMi4zNjVaIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iNTAiIHk9IjE1NiIgd2lkdGg9IjEwMCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjI1IiBjeT0iMTc1IiByPSIyIiBmaWxsPSIjMjI3MUIxIi8+PGNpcmNsZSBjeD0iMjUiIGN5PSIxODkiIHI9IjIiIGZpbGw9IiMyMjcxQjEiLz48Y2lyY2xlIGN4PSIyNSIgY3k9IjIwMyIgcj0iMiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjM1IiB5PSIxNzMiIHdpZHRoPSIxNDIiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIzNSIgeT0iMTg3IiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMzUiIHk9IjIwMSIgd2lkdGg9IjEyMCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjIzIiB5PSIyMTkiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTk0LjQ0MiAyMjkuMjI3YzAtMi4xNDEtMS4zMy0zLjM2Mi0zLjA2NS0zLjM2Mi0xLjc0NSAwLTMuMDY1IDEuMjIxLTMuMDY1IDMuMzYyIDAgMi4xMzIgMS4zMiAzLjM2MiAzLjA2NSAzLjM2MiAxLjczNSAwIDMuMDY1LTEuMjIgMy4wNjUtMy4zNjJabS0xLjQwMyAwYzAgMS4zODctLjY1OSAyLjEzOC0xLjY2MiAyLjEzOC0xLjAwNyAwLTEuNjYyLS43NTEtMS42NjItMi4xMzhzLjY1NS0yLjEzOCAxLjY2Mi0yLjEzOGMxLjAwMyAwIDEuNjYyLjc1MSAxLjY2MiAyLjEzOFptMi40MDIgNS4xMTRoMS4zNjJ2LTIuNjI3aC4wNDFjLjE4OS40MDkuNjAxLjg2NiAxLjM5NC44NjYgMS4xMTggMCAxLjk5MS0uODg1IDEuOTkxLTIuNTI4IDAtMS42ODgtLjkxMS0yLjUyNS0xLjk4OC0yLjUyNS0uODIxIDAtMS4yMTUuNDg5LTEuMzk3Ljg4OGgtLjA2di0uODI0SDk1LjQ0djYuNzVabTEuMzMzLTQuMjk2YzAtLjg3NS4zNy0xLjQzNSAxLjAzMi0xLjQzNS42NzUgMCAxLjAzMy41ODUgMS4wMzMgMS40MzUgMCAuODU3LS4zNjUgMS40NTEtMS4wMzMgMS40NTEtLjY1NSAwLTEuMDMyLS41NzUtMS4wMzItMS40NTFabTYuOTc0LTIuNDU0aC0uOTI0di0xLjE3NmgtMS4zNjF2MS4xNzZoLS42NzJ2MS4wMjNoLjY3MnYyLjU1NmMtLjAwNy45NjIuNjQ4IDEuNDM5IDEuNjM2IDEuMzk3LjM1Mi0uMDEzLjYwMS0uMDgzLjczOC0uMTI4bC0uMjE0LTEuMDEzYy0uMDY3LjAxMy0uMjExLjA0NS0uMzM5LjA0NS0uMjcxIDAtLjQ2LS4xMDItLjQ2LS40OHYtMi4zNzdoLjkyNHYtMS4wMjNabS44ODcgNC45MDloMS4zNjF2LTQuOTA5aC0xLjM2MXY0LjkwOVptLjY4NC01LjU0MmMuNDA1IDAgLjczOC0uMzEuNzM4LS42OSAwLS4zNzctLjMzMy0uNjg3LS43MzgtLjY4Ny0uNDAzIDAtLjczNi4zMS0uNzM2LjY4NyAwIC4zOC4zMzMuNjkuNzM2LjY5Wm0zLjEyOSAyLjcwNGMuMDAzLS42MzMuMzgxLTEuMDA0LjkzLTEuMDA0LjU0NyAwIC44NzYuMzU4Ljg3My45NTl2Mi44ODNoMS4zNjF2LTMuMTI2YzAtMS4xNDQtLjY3MS0xLjg0Ny0xLjY5NC0xLjg0Ny0uNzI4IDAtMS4yNTYuMzU4LTEuNDc2LjkzaC0uMDU4di0uODY2aC0xLjI5N3Y0LjkwOWgxLjM2MXYtMi44MzhaIiBmaWxsPSIjZmZmIi8+PC9zdmc+",BB=(0,s.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o=r?"target":"source",a=r?"source":"target",[,l]=(0,s.useState)(!1),c=Oh(),u=(0,qh.W6)(),[{license_status:d}]=f(),p=ZP.createEventHandlers(e,c,u,l);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:"target",position:bA.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),(0,i.createElement)(DO,{type:o,position:bA.Left,id:"left",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),ZP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},UB,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,p,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,void 0,void 0,e.is_locked),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e?.label),(0,i.createElement)(DO,{type:a,position:bA.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,i.createElement)(DO,{type:"source",position:bA.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),FB={createEventHandlers:(e,t,n,r)=>({clone:async function(n){if(n.preventDefault(),!wcfCartflowsPro())return null;const o=n.currentTarget.getAttribute("data-action");if(await t({title:(0,C.__)("Duplicate Variation","cartflows"),description:(0,C.__)("Do you want to duplicate this variation? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Yes","cartflows"),cancelBtnText:(0,C.__)("No","cartflows")})){r(!0);const t=cartflows_admin.wcf_clone_ab_test_step_nonce,n=new window.FormData;n.append("action",o),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),n.append("control_id",e?.control_id),window.wcfAction="cloneABTestStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Clone Step failed:",e),r(!1)}))}},delete:async function(n){n.preventDefault();const o=n.currentTarget.getAttribute("data-action");if(await t({title:(0,C.__)("Delete Variation","cartflows"),description:(0,C.__)("Do you want to delete this variation? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Yes","cartflows"),cancelBtnText:(0,C.__)("No","cartflows")})){r(!0);const t=cartflows_admin.wcf_delete_ab_test_step_nonce,n=new window.FormData;n.append("action",o),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),n.append("control_id",e?.control_id),window.wcfAction="deleteABTestStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Delete step failed:",e),r(!1)}))}},winner:async function(n){if(n.preventDefault(),await t({title:(0,C.__)("Declare Winner","cartflows"),description:(0,C.__)("Do you want to declare this step as winner? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Declare Winner","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")})){r(!0);const t=new window.FormData;t.append("action","cartflows_declare_ab_test_winner"),t.append("security",cartflows_admin.wcf_declare_ab_test_winner_nonce),t.append("step_id",e?.step_id),t.append("flow_id",e?.flow_id),window.wcfAction="winnerStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{hm.success((0,C.__)("Winner declared successfully!","cartflows")),window.location.reload()}).catch(e=>{console.error("Declare AB Test Winner failed:",e),hm.error((0,C.__)("Failed to declare winner. Please try again.","cartflows")),r(!1)}))}},archived:async function(n){if(n.preventDefault(),await t({title:(0,C.__)("Archive Variation","cartflows"),description:(0,C.__)("Do you want to archive this variation? Are you sure?","cartflows"),actionBtnText:(0,C.__)("Yes","cartflows"),cancelBtnText:(0,C.__)("No","cartflows")})){r(!0);const t=new window.FormData;t.append("action","cartflows_archive_ab_test_step"),t.append("security",cartflows_admin.wcf_archive_ab_test_step_nonce),t.append("step_id",e?.step_id),t.append("post_id",e?.flow_id),window.wcfAction="archiveStep",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{window.location.reload()}).catch(e=>{console.error("Archiving step failed:",e),r(!1)}))}}}),nodeHtml(e,t,n,r,o,a,s,l,c,u,d,f,p,m,h,g,w,y=!1,b=""){const v=lm(e?.step_type,b),x=e?.step_type||"",N=sm(e?.step_title||"");return(0,i.createElement)("div",{className:"wcf-custom-node-wrapper wcf-ab-test-variation"+(y?" wcf-custom-node-wrapper--compact":"")},(0,i.createElement)("div",{className:"wcf-custom-node-design"},(0,i.createElement)("div",{className:"wcf-node-actions absolute flex bg-white left-11 -top-16 rounded-md py-0.5 px-1.5 sm:hidden lg:hidden"},(0,i.createElement)(Wo,{content:(0,C.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,C.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(zP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:v?cm():(0,C.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:v?"#!":r,target:v?void 0:"_blank",rel:"noreferrer","aria-label":(0,C.__)("Edit Page","cartflows"),"aria-disabled":v,tabIndex:v?-1:0,className:"wcf-canvas--edit-step p-2 block "+(v?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,i.createElement)(PP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:(0,C.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)(S,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,C.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(RP,{className:"w-5 h-5"})))),(0,i.createElement)("div",{className:"wcf-custom-node-content bg-white border border-gray-200 rounded-lg shadow-md"+(p?" opacity-50":"")},(0,i.createElement)("div",{className:"wcf-custom-node-content--header flex flex-col gap-3 border-b border-gray-200 py-4 px-5"},(0,i.createElement)("div",{className:"wcf-node-step--info-wrapper flex flex-row items-center gap-4 w-full"},(0,i.createElement)("div",{className:"wcf-node-step--icon bg-primary-25 p-2.5 rounded border border-primary-300"},(e=>{let t="";const n="w-5 h-5 stroke-2 text-primary-500";switch(e){case"landing":t=(0,i.createElement)(xP,{className:n});break;case"optin":t=(0,i.createElement)(EP,{className:n});break;case"checkout":t=(0,i.createElement)(NI,{className:n});break;case"upsell":t=(0,i.createElement)(Cp,{className:n});break;case"downsell":t=(0,i.createElement)(MP,{className:n});break;case"thankyou":t=(0,i.createElement)(SP,{className:n});break;default:t=(0,i.createElement)(DP,{className:n})}return t})(x)),(0,i.createElement)("div",{className:"w-full flex flex-col gap-1"},(0,i.createElement)("div",{className:"wcf-node-step--type flex items-center gap-2"},(0,i.createElement)("span",{className:"text-xs font-normal text-gray-400 capitalize"},x),function(){let t="";return t=e.control_id===e.step_id?(0,i.createElement)("span",{className:"wcf-step-badge bg-primary-500 text-white text-xs px-2.5 py-1 rounded-full"},(0,C.__)("Control","cartflows")):(0,i.createElement)("span",{className:"wcf-step-badge bg-gray-800 text-white text-xs px-2.5 py-1 rounded-full"},(0,C.sprintf)(/* translators: %d is replaced with the count */ /* translators: %d is replaced with the count */
36 -(0,C.__)("Variation-%d","cartflows"),u)),t}(),f&&(0,i.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-invalid-sequence-badge"},(0,i.createElement)(Ph,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,C.__)("Invalid Position","cartflows"))),(0,i.createElement)("div",{className:"wcf-node-step--title text-left"},(0,i.createElement)("span",{className:"font-semibold text-sm text-gray-800 hover:text-gray-800"},N)))),function(){let e=null;return d||(e=(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-no-product-badge"},(0,C.__)("No Product Assigned","cartflows"))),e}(),p&&(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-disabled-step-badge"},(0,C.__)("Disabled","cartflows"))),(0,i.createElement)("div",{className:"wcf-custom-node-content--stats flex text-center justify-around items-center py-4 px-5"},(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-view"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,C.__)("Views","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},(()=>{let e=0;return l&&l.total_visits&&(e=l.total_visits||0),e})())),(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-conversation"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,C.__)("Conversions","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==x?(()=>{let e=0;return l&&l?.conversions&&(e=l.conversions||0),e})():"-")),(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-revenue"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,C.__)("Revenue","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==x&&"landing"!==x?l&&l?.visits?.revenue?Zm(l.visits.revenue):0:"-"))),(0,i.createElement)("div",{className:"wcf-custom-node-content--footer flex text-center justify-around items-center border-t border-gray-200 py-4 px-5"},(0,i.createElement)(Wo,{content:(0,C.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,C.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(zP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:v?cm():(0,C.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:v?"#!":r,target:v?void 0:"_blank",rel:"noreferrer","aria-label":(0,C.__)("Edit Page","cartflows"),"aria-disabled":v,tabIndex:v?-1:0,className:"wcf-canvas--edit-step p-2 block "+(v?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,i.createElement)(PP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:(0,C.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)(S,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,C.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(RP,{className:"w-5 h-5"}))),(o?Object.keys(o):[]).map(t=>{const n=o[t],r=n?.class;let l=!1,c=!1;!wcfCartflowsPro()&&n?.pro&&(l=!0),wcfCartflowsPro()&&n?.pro&&"Activated"!==s&&(c=!0);let u="";return u=l||c?"wcf-pro pointer-events-none opacity-50":"text-text-tertiary",(0,i.createElement)(Wo,{key:n?.slug,content:n?.text,placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n?.link,className:`wcf-step__action-btn ${r} ${u} p-2 text-sm flex gap-1.5 ${"delete"===n?.slug?"hover:bg-field-background-error hover:text-button-danger":"hover:bg-badge-hover-gray hover:text-text-primary"}`,"aria-label":n?.text,"data-id":e?.step_id,"data-control-id":e?.control_id,onClick:e=>{"#"===n?.link&&a&&a[n?.slug]&&(e.preventDefault(),a[n?.slug](e))},"data-action":n?.ajaxcall},(0,i.createElement)("div",{className:"flex items-center gap-1.5"},function(e){let t="";switch(e){case"clone":t=(0,i.createElement)(CP,{className:"h-5 w-5"});break;case"delete":t=(0,i.createElement)(Po,{className:"h-5 w-5"});break;case"archived":t=(0,i.createElement)(AP,{className:"h-5 w-5"});break;case"winner":t=(0,i.createElement)(TP,{className:"h-5 w-5"});break;default:t=(0,i.createElement)(OP,{className:"h-5 w-5"})}return t}(n?.slug),(l||c)&&(0,i.createElement)("span",{className:"wcf-pro-badge px-2 py-0.5 text-xs text-primary-600 rounded-[14px] shadow-[0px_6px_16px_-2px_rgba(240,100,52,0.4)]"},(0,C.__)("PRO","cartflows")))))})))))}},QB=FB,VB=(0,s.memo)(({data:e,isConnectable:t})=>{let n=bP;switch(e.step_type){case"landing":default:n=bP;break;case"checkout":n=GP;break;case"upsell":n=$P;break;case"downsell":n=XP;break;case"optin":n=UB;break;case"thankyou":n=PB}const r="upsell"===e.step_type||"downsell"===e.step_type,o="vertical"===e?.axis,a="LR"===e.direction?"target":"source",l="LR"===e.direction?"source":"target",[,c]=(0,s.useState)(!1),u=Oh(),d=(0,qh.W6)(),[{license_status:p}]=f(),[{is_flow_instant_checkout:m}]=Yp(),h=QB.createEventHandlers(e,u,d,c);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:"target",position:bA.Top,id:"top",style:{visibility:o?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),r&&"RL"===e.direction?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:a,position:bA.Left,className:"react-flow__handle-left-a wcf-handle-left",id:"a",style:{top:50},isConnectable:t}),(0,i.createElement)(DO,{type:a,position:bA.Left,className:"react-flow__handle-left-b wcf-handle-left",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})):(0,i.createElement)(DO,{type:a,position:bA.Left,id:"left",style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),QB.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type,control_id:e?.control_id},n,e.viewPageLink,e.editPage,e.menu_actions,h,p,e.analytics,e.traffic,e.var_badge_count,e.is_product_assigned,e.isInvalidPosition,e?.step_disabled,e?.offer_no_next_step,e?.offer_no_step_id,e?.offer_yes_next_step,e?.offer_yes_step_id,e?.compact,m),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e.label),r&&"LR"===e.direction?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(DO,{type:l,position:bA.Right,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,i.createElement)(DO,{type:l,position:bA.Right,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})):(0,i.createElement)(DO,{type:l,position:bA.Right,className:"react-flow__handle wcf-handle-right",id:"right",isConnectable:t}))}),YB=To("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),ZB=(0,s.forwardRef)(({variant:e="primary",size:t="md",border:n="subtle",src:r,alt:o,children:a,className:i,...l},c)=>{const[u,d]=(0,s.useState)(!1),f={white:"text-text-primary bg-background-primary",gray:"text-text-primary bg-background-secondary",primary:"text-text-on-color bg-background-brand","primary-light":"text-text-primary bg-brand-background-50",dark:"text-text-on-color bg-button-secondary"}[e],p={xxs:"size-5 [&>svg]:size-3 text-xs",xs:"size-6 [&>svg]:size-4 text-sm",sm:"size-8 [&>svg]:size-5 text-base",md:"size-10 [&>svg]:size-6 text-lg",lg:"size-12 [&>svg]:size-12 text-lg"}[t],m={none:"",subtle:"ring-1 ring-border-transparent-subtle",ring:"ring ring-border-subtle"}[r&&"none"===n?"subtle":n],h=r?"object-cover object-center":"",g=!r||u,w=g?"div":"img";return(0,s.useEffect)(()=>{d(!1)},[r]),(0,j.jsx)(w,{ref:c,className:Se("rounded-full overflow-hidden flex items-center justify-center",g&&f,p,m,h,i),...g?{children:(()=>{if(r&&u){if(o&&"string"==typeof o)return o?.[0]?.toUpperCase();if(a&&"string"==typeof a)return a?.[0]?.toUpperCase();if(!a&&!o)return(0,j.jsx)(YB,{})}return a?"string"==typeof a?a?.[0]?.toUpperCase():a:null})()}:{src:r,alt:o,onError:()=>{d(!0)}},...l})}),WB=To("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),GB=To("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),HB=To("CircleArrowDown",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]),$B=To("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]),XB=To("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),qB=To("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),JB=To("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),KB=({action:e,nonce:t,stepId:n,flowId:r,controlId:o})=>{const a=new window.FormData;return a.append("action",e),a.append("security",t),a.append("step_id",n),a.append("flow_id",r),a.append("control_id",o),a},eF=async({confirm:e,title:t,description:n,actionText:r,payload:o,successText:a,errorText:i})=>!!await e({title:t,description:n,actionBtnText:r,cancelBtnText:(0,C.__)("Cancel","cartflows")})&&(e=>qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}))(o).then(()=>{hm.success(a),window.location.reload()}).catch(()=>{hm.error(i)}),tF={restore:({confirm:e,stepId:t,flowId:n,controlId:r})=>eF({confirm:e,title:(0,C.__)("Restore Archived Variation","cartflows"),description:(0,C.__)("Do you want to restore this archived variation? Are you sure?","cartflows"),actionText:(0,C.__)("Restore","cartflows"),payload:KB({action:"cartflows_restore_archive_ab_test_variation",nonce:cartflows_admin.wcf_restore_archive_ab_test_variation_nonce,stepId:t,flowId:n,controlId:r}),successText:(0,C.__)("Variation restored.","cartflows"),errorText:(0,C.__)("Failed to restore variation. Please try again.","cartflows")}),delete:({confirm:e,stepId:t,flowId:n,controlId:r})=>eF({confirm:e,title:(0,C.__)("Trash Archived Variation","cartflows"),description:(0,C.__)("This action will trash this archived variation and its analytics data permanently. Do you want to delete this archived variation?","cartflows"),actionText:(0,C.__)("Trash","cartflows"),payload:KB({action:"cartflows_delete_archive_ab_test_variation",nonce:cartflows_admin.wcf_delete_archive_ab_test_variation_nonce,stepId:t,flowId:n,controlId:r}),successText:(0,C.__)("Variation moved to trash.","cartflows"),errorText:(0,C.__)("Failed to delete variation. Please try again.","cartflows")}),hide:({confirm:e,stepId:t})=>eF({confirm:e,title:(0,C.__)("Hide Archived Variation","cartflows"),description:(0,C.__)("This action will hide this archived variation from the list of steps, but its analytics will be visible. Do you want to hide this archived variation?","cartflows"),actionText:(0,C.__)("Hide","cartflows"),payload:(()=>{const e=new window.FormData;return e.append("action","cartflows_hide_archive_ab_test_variation"),e.append("security",cartflows_admin.hide_archive_ab_test_variation_nonce),e.append("step_id",t),e})(),successText:(0,C.__)("Variation hidden.","cartflows"),errorText:(0,C.__)("Failed to hide variation. Please try again.","cartflows")}),deleteArch:({confirm:e,stepId:t,flowId:n,controlId:r})=>eF({confirm:e,title:(0,C.__)("Trash Archived Variation","cartflows"),description:(0,C.__)("This action will delete this archived variation and its analytics data permanently. Do you want to delete this archived variation?","cartflows"),actionText:(0,C.__)("Delete","cartflows"),payload:KB({action:"cartflows_permanent_delete_archive_ab_test_variation",nonce:cartflows_admin.permanent_delete_archive_ab_test_variation_nonce,stepId:t,flowId:n,controlId:r}),successText:(0,C.__)("Variation permanently deleted.","cartflows"),errorText:(0,C.__)("Failed to delete variation. Please try again.","cartflows")})},nF=({open:e,setOpen:t,variations:n,type:r,flowId:o,controlId:a})=>{const s=Oh(),l=n.filter(e=>"1"!==e.hide),c=l.filter(e=>e.deleted).length;return(0,i.createElement)(bh,{open:e,setOpen:t,design:"footer-divided",exitOnClickOutside:!1,exitOnEsc:!1,className:"!z-[999998]"},(0,i.createElement)(bh.Portal,null,(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Panel,{className:"w-[640px] max-w-[92vw]"},(0,i.createElement)(bh.Header,{className:"flex items-start justify-between"},(0,i.createElement)("div",{className:"space-y-1"},(0,i.createElement)(bh.Title,null,(0,C.__)("Archived Variations","cartflows")),(0,i.createElement)(bh.Description,null,(0,C.__)("Restore a variation back into the test, or delete it permanently.","cartflows"))),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,null,(0,i.createElement)(zm,{containerType:"flex",direction:"column",gap:"xs"},l.map(e=>(0,i.createElement)(zm,{key:e.id,containerType:"flex",direction:"row",align:"center",justify:"between",gap:"md",className:"py-3 border-0 border-t border-solid border-border-subtle first:border-t-0"},(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",gap:"sm"},(0,i.createElement)(ZB,{variant:"primary-light",size:"sm",className:"!rounded-md !text-brand-500 ring-1 ring-brand-200 !p-1"},(e=>({landing:(0,i.createElement)(WB,{className:"w-5 h-5"}),checkout:(0,i.createElement)(GB,{className:"w-5 h-5"}),upsell:(0,i.createElement)(OP,{className:"w-5 h-5"}),downsell:(0,i.createElement)(HB,{className:"w-5 h-5"}),thankyou:(0,i.createElement)($B,{className:"w-5 h-5"}),optin:(0,i.createElement)(XB,{className:"w-5 h-5"})}[e]||(0,i.createElement)(WB,{className:"w-5 h-5"})))(r)),(0,i.createElement)(zm,{containerType:"flex",direction:"column",className:"!gap-1"},(0,i.createElement)(zm,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)(Vm,{size:12,weight:400,color:"tertiary",className:"capitalize"},"thankyou"===r?(0,C.__)("Thank You","cartflows"):r),(0,i.createElement)(Lf,{size:"xs",type:"pill",variant:e.deleted?"red":"inverse",className:"!font-normal text-[0.5rem]",label:(e.deleted?(0,C.__)("Deleted On: ","cartflows"):(0,C.__)("Archived On: ","cartflows"))+e.date})),(0,i.createElement)(Vm,{size:14,weight:400,color:"primary"},e.title))),(0,i.createElement)(zm,{containerType:"flex",direction:"row",gap:"xs"},Object.values(e.actions||{}).map(t=>{const n="delete"===t.slug||"deleteArch"===t.slug?"text-text-secondary hover:bg-field-background-error hover:text-button-danger":"text-text-secondary hover:bg-badge-hover-gray hover:text-text-primary";return(0,i.createElement)(Ro,{key:t.slug,variant:"ghost",size:"xs",icon:(r=t.slug,{restore:(0,i.createElement)(qB,{className:"w-4 h-4"}),delete:(0,i.createElement)(Po,{className:"w-4 h-4"}),hide:(0,i.createElement)(JB,{className:"w-4 h-4"}),deleteArch:(0,i.createElement)(Po,{className:"w-4 h-4"})}[r]),iconPosition:"left",onClick:()=>((e,t)=>{const n=tF[e];n&&n({confirm:s,stepId:t.id,flowId:o,controlId:a})})(t.slug,e),className:`${n} !rounded-md`},t.text);var r})))))),(0,i.createElement)(bh.Footer,{className:"justify-between items-center border-0 border-t border-solid border-border-subtle"},(0,i.createElement)(Vm,{size:12,color:"tertiary"},l.length," ",(0,C.__)("archived","cartflows"),c>0&&` · ${c} ${(0,C.__)("deleted","cartflows")}`),(0,i.createElement)(Ro,{variant:"outline",size:"sm",onClick:()=>t(!1)},(0,C.__)("Close","cartflows"))))))},rF=({variations:e=[],type:t,flowId:n,controlId:r})=>{const o=e.filter(e=>"1"!==e.hide).length,[a,l]=(0,s.useState)(!1);return 0===o?null:(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)(AP,{className:"w-3.5 h-3.5"}),iconPosition:"left",onClick:()=>l(!0),className:"bg-background-primary border border-solid border-border-subtle shadow-sm rounded-full"},(0,i.createElement)("span",{className:"inline-flex items-center gap-1"},(0,C.__)("Archived","cartflows"),(0,i.createElement)(Lf,{size:"xxs",type:"rounded",variant:"inverse",label:String(o),className:"inline-flex"}))),(0,i.createElement)(nF,{open:a,setOpen:l,variations:e,type:t,flowId:n,controlId:r}))},oF=(0,s.memo)(({data:e,isConnectable:t})=>{const{step:n,flow_id:r,isDynamicOfferGroup:o,isOfferABTestGroup:a}=e;if(o)return(0,i.createElement)("div",{className:"dynamic-offer-group-container",style:{width:"100%",height:"100%",position:"relative"}});if(a){if(!n)return null;const e=n["ab-test-variations"]||[],t=n["ab-test-start"]||!1;return(0,i.createElement)("div",{className:"offer-ab-test-group-container"},(0,i.createElement)("div",{className:"ab-test-group-header absolute w-3/4 mx-auto top-[-30px] left-0 right-0 z-10"},(0,i.createElement)(og,{flow_id:r,control_id:n.id,step_id:n.id,abvariations:e,ab_test_start:t,compact:!0})))}if(!n)return null;const s=n["ab-test-variations"]||[],l=n["ab-test-start"]||!1;return(0,i.createElement)("div",{className:"ab-test-group-container"},(0,i.createElement)(DO,{type:"target",position:bA.Top,id:"top",style:{background:"#555",width:"10px",height:"10px",top:"-5px",left:"50%"},isConnectable:t}),(0,i.createElement)(DO,{type:"target",position:bA.Left,id:"left",style:{background:"#555",width:"10px",height:"10px",left:"-5px",top:"50%"},isConnectable:t}),(0,i.createElement)("div",{className:"ab-test-group-header absolute w-3/4 mx-auto top-[-30px] left-0 right-0 z-10"},(0,i.createElement)(og,{flow_id:r,control_id:n.id,step_id:n.id,abvariations:s,ab_test_start:l,compact:!0})),(0,i.createElement)("div",{className:"absolute -bottom-[14px] right-3 z-10"},(0,i.createElement)(rF,{variations:n["ab-test-archived-variations"]||[],type:n.type,flowId:r,controlId:n.id})),(0,i.createElement)(DO,{type:"source",position:bA.Right,id:"right",style:{background:"#555",width:"10px",height:"10px",right:"-5px",top:"50%"},isConnectable:t}),(0,i.createElement)(DO,{type:"source",position:bA.Bottom,id:"bottom",style:{background:"#555",width:"10px",height:"10px",bottom:"-5px",left:"50%"},isConnectable:t}))});oF.displayName="ABTestGroupNode";const aF=oF;var iF=n(6246),sF=n.n(iF);const lF=class{static validateConnection(e,t,n,r){const o=[];if(this.isOfferStep(e.type)&&("landing"!==t.type&&"checkout"!==t.type||o.push({code:"INVALID_OFFER_TARGET",message:`${this.getStepTypeLabel(e.type)} cannot connect to ${this.getStepTypeLabel(t.type)}`,severity:"error"})),e.id===t.id&&o.push({code:"SELF_REFERENCE",message:"Step cannot connect to itself",severity:"error"}),this.isOfferStep(e.type)&&r.steps){const t=r.steps.some(e=>"checkout"===e.type);if(t&&r.stepOrder){const n=this.extractStepId(e.id),a=r.stepOrder.indexOf(n),i=r.stepOrder.findIndex(e=>"checkout"===r.steps.find(t=>t.id===e)?.type);t&&-1!==a&&-1!==i&&a<i&&o.push({code:"OFFER_BEFORE_CHECKOUT",message:"Offer step should come after Checkout",severity:"warning"})}}if("landing"===e.type&&r.stepOrder){const t=this.extractStepId(e.id);0!==r.stepOrder.indexOf(t)&&o.push({code:"LANDING_NOT_FIRST",message:"Landing page should be the first step",severity:"warning"})}const a={isValid:0===o.filter(e=>"error"===e.severity).length,errors:o,warnings:o.filter(e=>"warning"===e.severity)};return console.log("[ValidationHelper] Validation complete:",{isValid:a.isValid,errorCount:o.length,hardErrors:o.filter(e=>"error"===e.severity).length,warnings:o.filter(e=>"warning"===e.severity).length}),a}static validateStepOrder(e,t,n){const r=[];if("storeCheckout"===n){const n=t.find(e=>"checkout"===e.type);n&&0!==e.indexOf(n.id)&&r.push({code:"STORE_CHECKOUT_POSITION",stepId:n.id,message:"Store checkout must be the first step",severity:"error"})}const o=e.findIndex(e=>"checkout"===t.find(t=>t.id===e)?.type);-1!==o&&e.forEach((e,n)=>{const a=t.find(t=>t.id===e);this.isOfferStep(a?.type)&&n<o&&r.push({code:"OFFER_BEFORE_CHECKOUT",stepId:e,message:"Offer step should come after Checkout",severity:"warning"})});const a=e.findIndex(e=>"landing"===t.find(t=>t.id===e)?.type);if(-1!==a&&0!==a){const e=t.find(e=>"landing"===e.type);r.push({code:"LANDING_NOT_FIRST",stepId:e?.id,message:"Landing page should be the first step",severity:"warning"})}const i=e.findIndex(e=>"thankyou"===t.find(t=>t.id===e)?.type);if(-1!==i&&i!==e.length-1){const n=e.slice(i+1).some(e=>{const n=t.find(t=>t.id===e);return n&&!this.isOfferStep(n.type)});if(n){const e=t.find(e=>"thankyou"===e.type);r.push({code:"THANKYOU_NOT_LAST",stepId:e?.id,message:"Thank You page should typically be the last step (or followed only by offers)",severity:"warning"})}}return{isValid:0===r.filter(e=>"error"===e.severity).length,errors:r,warnings:r.filter(e=>"warning"===e.severity)}}static isOfferStep(e){return"upsell"===e||"downsell"===e}static getStepTypeLabel(e){return{landing:"Landing Page",checkout:"Checkout",upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You",optin:"Opt-in"}[e]||e}static extractStepId(e){if(!e)return null;if("wcf_start_node"===e||"wcf_end_node"===e)return null;const t=e.match(/wcf_node_edge_(\d+)/);return t?parseInt(t[1],10):e}static validateStepPosition(e,t,n,r,o){const a=this.validateStepOrder(n,r,o).errors.filter(t=>t.stepId===e.id);return a.length>0?{isValid:0===a.filter(e=>"error"===e.severity).length,errors:a,warnings:a.filter(e=>"warning"===e.severity)}:{isValid:!0,errors:[],warnings:[]}}},cF=class{static hasValidRuleValue(e){return!(!e||!e.value||Array.isArray(e.value)&&(0===e.value.length||e.value.every(e=>""===e||"string"==typeof e&&""===e.trim()))||"string"==typeof e.value&&""===e.value.trim())}static hasValidRules(e){return!!(e&&e.rules&&Array.isArray(e.rules))&&e.rules.some(e=>this.hasValidRuleValue(e))}static hasDynamicOffers(e){return!(!e||"checkout"!==e.type&&"store-checkout"!==e.type)&&(!(!e.conditions||!Array.isArray(e.conditions)||0===e.conditions.length)&&this.getValidTargetSteps(e.conditions,e.default_step).length>0)}static getValidTargetSteps(e,t){const n=[];if(e&&Array.isArray(e)&&e.forEach(e=>{if(e.step_id&&this.hasValidRules(e)){const t=parseInt(e.step_id,10);isNaN(t)||n.push(t)}}),t){const e=parseInt(t,10);isNaN(e)||n.push(e)}return n}static getUniqueTargetSteps(e,t){const n=new Set;if(e&&Array.isArray(e)&&e.forEach(e=>{if(e.step_id){const t=parseInt(e.step_id,10);isNaN(t)||n.add(t)}}),t){const e=parseInt(t,10);isNaN(e)||n.add(e)}return Array.from(n)}static removeConditionsForStep(e,t){return e&&Array.isArray(e)?e.filter(e=>parseInt(e.step_id,10)!==t):[]}static updateDefaultStep(e,t,n){return parseInt(e,10)!==parseInt(t,10)?e:n.length>0&&void 0!==n[0].step_id&&null!==n[0].step_id?n[0].step_id:""}static buildRulesFormData(e,t,n,r){const o=new window.FormData;return o.append("action","cartflows_save_meta_settings"),o.append("security",cartflows_admin.save_meta_settings_nonce),o.append("post_id",t),o.append("step_id",e),o.append("wcf-checkout-rules-option","yes"),n.forEach((e,t)=>{o.append(`wcf-checkout-rules[${t}][group_id]`,e.group_id),o.append(`wcf-checkout-rules[${t}][step_id]`,e.step_id),e?.rules&&Array.isArray(e?.rules)&&e.rules.forEach((e,n)=>{var r,a,i;o.append(`wcf-checkout-rules[${t}][rules][${n}][rule_id]`,null!==(r=e?.rule_id)&&void 0!==r?r:""),o.append(`wcf-checkout-rules[${t}][rules][${n}][condition]`,null!==(a=e?.condition)&&void 0!==a?a:""),o.append(`wcf-checkout-rules[${t}][rules][${n}][operator]`,null!==(i=e?.operator)&&void 0!==i?i:""),Array.isArray(e.value)?e.value.forEach(e=>{o.append(`wcf-checkout-rules[${t}][rules][${n}][value][]`,e)}):o.append(`wcf-checkout-rules[${t}][rules][${n}][value]`,e.value)})}),o.append("wcf-checkout-rules-default-step",r||""),o}static isConditionalEdge(e){return e&&e.source&&e.source.startsWith("conditional-")}static extractCheckoutId(e){if(!e||!e.startsWith("conditional-"))return null;const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}static extractStepId(e,t=null){if(!e)return null;if(e.includes("ab-group-")){const t=e.match(/(?:offer-)?ab-group-(\d+)/);if(t){const e=parseInt(t[1],10);return isNaN(e)?null:e}return null}if(e.includes("wcf_node_edge_")){const n=parseInt(e.replace("wcf_node_edge_",""),10);if(isNaN(n))return null;if(t&&Array.isArray(t))for(const e of t)if(e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].some(e=>e.id===n))return e.id;return n}return null}},uF=["upsell","downsell"],dF=(e,t=[])=>{const n=[];if(!e||!e.type)return n;if(uF.includes(e.type)){const r=new Set(t.map(e=>parseInt(e.id,10))),o=parseInt(e.offer_yes_step_id,10)||0,a=parseInt(e.offer_no_step_id,10)||0;o&&!r.has(o)&&n.push({kind:"broken-redirect",severity:"error",message:(0,C.__)("Accept target step is missing","cartflows")}),a&&!r.has(a)&&n.push({kind:"broken-redirect",severity:"error",message:(0,C.__)("Reject target step is missing","cartflows")})}return n},fF=550,pF=350,mF=-200,hF=300,gF=-50,wF=class{constructor(e,t,n="horizontal"){this.steps=e,this.flowType=t,this.axis=n,this.offerSteps=["upsell","downsell"],this.positions=new Map,this.incomingAcceptEdges=new Map,this.incomingRejectEdges=new Map,this.conditionalTargets=new Map,this.dynamicOfferTargetSteps=new Set,this.stepIndexMap=new Map,this.steps.forEach((e,t)=>{this.stepIndexMap.set(e.id,t)})}calculate(){return this.identifyDynamicOfferTargets(),this.buildIncomingEdgesMap(),this.calculatePositions(),this.positions}identifyDynamicOfferTargets(){this.steps.forEach(e=>{if(cF.hasDynamicOffers(e)){const t=cF.getUniqueTargetSteps(e.conditions,e.default_step),n=this.calculateConditionalFan(t);t.forEach((t,r)=>{this.dynamicOfferTargetSteps.add(t),this.conditionalTargets.set(t,{yOffset:n[r],sourceCheckoutId:e.id})})}})}buildIncomingEdgesMap(){this.steps.forEach(e=>{this.incomingAcceptEdges.set(e.id,[]),this.incomingRejectEdges.set(e.id,[])}),this.steps.forEach((e,t)=>{if(!this.offerSteps.includes(e.type))return;const n=this.hasABTestVariations(e),r=n?e["ab-test-variations"].length:1;if(n){const n=new Set;e["ab-test-variations"].forEach((o,a)=>{const i=o.offer_yes_step_id,s=o.offer_no_step_id;if(i){const n=this.incomingAcceptEdges.get(i);n&&n.push({offerId:e.id,offerIndex:t,hasABTest:!0,variationCount:r,variationIndex:a})}if(s&&!n.has(s)){n.add(s);const o=this.incomingRejectEdges.get(s);o&&o.push({offerId:e.id,offerIndex:t,hasABTest:!0,variationCount:r})}})}else{const n=e.offer_yes_step_id,r=e.offer_no_step_id;if(n){const r=this.incomingAcceptEdges.get(n);r&&r.push({offerId:e.id,offerIndex:t,hasABTest:!1,variationCount:1})}if(r){const n=this.incomingRejectEdges.get(r);n&&n.push({offerId:e.id,offerIndex:t,hasABTest:!1,variationCount:1})}}})}calculatePositions(){this.steps.forEach((e,t)=>{const n=this.calculateYPosition(e,t),r=this.calculateXPositionForStep(e,t),o=cF.hasDynamicOffers(e),a="upsell"===e.type||"downsell"===e.type,i="checkout"===e.type&&Array.isArray(e.bumps)?e.bumps.length:0;this.positions.set(e.id,{x:r,y:n,hasDynamicOffers:o,hasABTest:this.hasABTestVariations(e),isOfferStep:a,bumpCount:i})}),this.adjustXPositionsForIncomingEdges()}bumpStride(e,t){return e&&t?150+50*(t-1):0}calculateXPositionForStep(e,t){if(0===t)return 250;const n="vertical"===this.axis,r=n?380:fF,o=[...this.incomingAcceptEdges.get(e.id)||[],...this.incomingRejectEdges.get(e.id)||[]];if(o.length>0){let e=0,t=!1;if(o.forEach(n=>{const r=this.positions.get(n.offerId);r&&r.x>e&&(e=r.x,t=r.hasDynamicOffers)}),e>0)return e+(t?r+pF:r)}const a=this.steps[t-1],i=this.positions.get(a.id);if(i){let e=r;return i.hasDynamicOffers&&(e+=pF),i.hasABTest&&!i.isOfferStep&&(n?e=700:e+=150),e+=this.bumpStride(n,i.bumpCount),i.x+e}return 250+t*r}adjustXPositionsForIncomingEdges(){let e=!0,t=0;for(;e&&t<10;)e=!1,t++,this.steps.forEach(t=>{const n=this.positions.get(t.id);if(!n)return;const r=[...this.incomingAcceptEdges.get(t.id)||[],...this.incomingRejectEdges.get(t.id)||[]];if(0===r.length)return;let o=0,a=!1;r.forEach(e=>{const t=this.positions.get(e.offerId);t&&t.x>o&&(o=t.x,a=t.hasDynamicOffers)});const i="vertical"===this.axis?380:fF,s=o+(a?i+pF:i);s>n.x&&(n.x=s,this.positions.set(t.id,n),e=!0)})}calculateYPosition(e,t){if(0===t)return 0;if(this.dynamicOfferTargetSteps.has(e.id)){const e=this.steps[t-1],n=this.positions.get(e.id);return(n?n.y:0)+200}const n=this.incomingAcceptEdges.get(e.id)||[],r=this.incomingRejectEdges.get(e.id)||[];if(n.length>0&&r.length>0){const t=new Set(r.map(e=>e.offerId)),o=new Set(n.map(e=>e.offerId));if([...t].some(e=>!o.has(e))){const e=r.filter(e=>!o.has(e.offerId)),t=this.findEarliestSource(e);return this.calculateRejectYPosition(t)}const a=this.findEarliestSource(n),i=this.positions.get(a.offerId);let s=i?i.y:0;return s=this.applyABTestAcceptOffset(e,s),s}if(n.length>0){const t=this.findEarliestSource(n);let r=this.calculateAcceptYPosition(t);return r=this.applyABTestAcceptOffset(e,r),r}if(r.length>0){const e=this.findEarliestSource(r);return this.calculateRejectYPosition(e)}const o=this.steps[t-1],a=this.positions.get(o.id);return a?a.y:0}calculateRejectYPosition(e){const t=this.positions.get(e.offerId);if(!t)return 200;if(e.hasABTest&&e.variationCount>1){const n=this.calculateABGroupHeight(e.variationCount);return t.y+gF+n}return t.y+200}calculateAcceptYPosition(e){const t=this.positions.get(e.offerId);return t?e.hasABTest&&e.variationCount>1&&void 0!==e.variationIndex?t.y+gF+50-e.variationIndex*hF+150:t.y+mF:mF}applyABTestAcceptOffset(e,t){if(this.hasABTestVariations(e)){const n=this.calculateABGroupHeight(e["ab-test-variations"].length);return t+mF-n/3}return t}calculateABGroupHeight(e){return e*hF+50}findEarliestSource(e){return 0===e.length?null:e.reduce((e,t)=>t.offerIndex<e.offerIndex||t.offerIndex===e.offerIndex&&void 0!==t.variationIndex&&void 0!==e.variationIndex&&t.variationIndex<e.variationIndex?t:e,e[0])}calculateConditionalFan(e){const t=e.length;if(0===t)return[];if(1===t)return[0];const n=0-250*(t-1)/2;return e.map((e,t)=>n+250*t)}hasABTestVariations(e){return e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}getMaxX(){let e=0;return this.positions.forEach(t=>{t.x>e&&(e=t.x)}),e}getPosition(e){return this.positions.get(e)||null}isConditionalTarget(e){return this.conditionalTargets.has(e)}isDynamicOfferTarget(e){return this.dynamicOfferTargetSteps.has(e)}static calculateABGroupDimensions(e){return{width:450,height:e*hF+50}}static calculateABVariationPosition(e){return{x:25,y:50+e*hF}}static getABGroupYOffset(){return gF}},yF={getInvalidStepIds(e){const t=new Set;if(!Array.isArray(e))return t;const n="undefined"!=typeof cartflows_admin&&cartflows_admin.old_global_checkout?parseInt(cartflows_admin.old_global_checkout,10):null;let r=!1;return e.forEach(e=>{e&&"object"==typeof e&&("landing"!==e.type?"checkout"===e.type&&(n?parseInt(e.id,10)!==n&&t.add(e.id):r?t.add(e.id):r=!0):t.add(e.id))}),t},filterMenuActions(e,t,n){if(!e||"object"!=typeof e)return e;const r={...e};return"checkout"===t?.type&&(delete r.clone,n||delete r.delete),n&&(delete r.clone,delete r.abtest),r}},bF=class{constructor(e,t,n,r,o="LR",a="horizontal",i=!1){this.steps=e,this.flowType=t,this.flowId=n,this.flowAnalytics=r,this.direction=o,this.axis=a,this.compact=i,this.offerSteps=["upsell","downsell"],this.nonOfferSteps=["landing","checkout","thankyou","optin"],this.storeCheckoutInvalidIds="storeCheckout"===t?yF.getInvalidStepIds(e):new Set,this.positionCalculator=new wF(e,t,a),this.calculatedPositions=null}initializePositions(){this.calculatedPositions=this.positionCalculator.calculate()}getStepPosition(e,t=0,n=0){if(this.calculatedPositions&&this.calculatedPositions.has(e)){const t=this.calculatedPositions.get(e);return{x:t.x,y:t.y}}return{x:t,y:n}}generateNodeId(e){return`wcf_node_edge_${e}`}getStepAnalytics(e){return this.flowAnalytics&&this.flowAnalytics.all_steps&&this.flowAnalytics.all_steps.find(t=>t.id===e)||null}isInvalidPosition(e){if(this.storeCheckoutInvalidIds.has(e.id))return!0;if(!this.offerSteps.includes(e.type))return!1;if(!e.offer_yes_step_id||!e.offer_no_step_id)return!0;const t=this.steps.map(e=>e.id),n=t.indexOf(e.id);return!lF.validateStepPosition(e,n,t,this.steps,this.flowType).isValid}createStartNode(){return{id:"wcf_start_node",type:"label",data:{position:"start",label:(0,C.__)("Start","cartflows"),direction:this.direction,axis:this.axis,compact:this.compact},position:{x:50,y:103}}}createEndNode(e){return{id:"wcf_end_node",type:"label",data:{position:"end",label:(0,C.__)("End","cartflows"),direction:this.direction,axis:this.axis,compact:this.compact},position:{x:e,y:103}}}hasABTestVariations(e){return e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}createRegularStepNode(e,t,n,r){const o=this.offerSteps.includes(e.type)?"offer":e.type,a=this.getStepAnalytics(e.id),i=this.isInvalidPosition(e),s="storeCheckout"===this.flowType&&this.storeCheckoutInvalidIds.has(e.id),l="storeCheckout"===this.flowType&&"checkout"===e.type&&!0===e.is_product_assigned;let c=e.is_product_assigned;(["landing","thankyou"].includes(e.type)||"storeCheckout"===this.flowType&&"checkout"===e.type)&&(c=!0);const u=e.actions?.view?.link||"",d=e.page_builder_edit?e.page_builder_edit.replace(/&amp;/g,"&"):"",f=e.actions?.edit?.link||"",p="storeCheckout"===this.flowType?yF.filterMenuActions(e.menu_actions,e,this.storeCheckoutInvalidIds.has(e.id)):e.menu_actions;return{id:this.generateNodeId(e.id),type:o,data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:e.type,control_id:e.id,editPage:d,editSettings:f,viewPageLink:u,index:t,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:p,ab_test_variations:e["ab-test-variations"],analytics:a,is_product_assigned:c,isInvalidPosition:i,is_locked:s,has_store_checkout_product_warning:l,warnings:dF(e,this.steps),step_disabled:e.step_disabled||!1,bumps:"checkout"===e.type&&e.bumps||[]},position:{x:n,y:r}}}createOfferABTestVariationNode(e,t,n,r){const o=this.getStepAnalytics(t.id),a=t.actions?.edit?.link||"";let i=e.is_product_assigned;(["landing","thankyou"].includes(t.type)||"storeCheckout"===this.flowType&&"checkout"===t.type)&&(i=!0);const s={id:t.id,type:t.type,offer_yes_step_id:e.offer_yes_step_id,offer_no_step_id:e.offer_no_step_id},l=this.isInvalidPosition(s),c=wF.calculateABVariationPosition(r);return{id:this.generateNodeId(e.id),type:"abtest",data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:t.type,control_id:t.id,editPage:e.actions?.edit?.link?e.actions.edit.link.replace(/&amp;/g,"&"):"",editSettings:a,viewPageLink:e.actions?.view?.link||"",index:n,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:e.menu_actions,analytics:o?o["visits-ab"][e.id]:null,traffic:e.traffic,var_badge_count:r,offer_yes_next_step:e.offer_yes_next_step,offer_no_next_step:e.offer_no_next_step,offer_yes_step_id:e.offer_yes_step_id,offer_no_step_id:e.offer_no_step_id,is_product_assigned:i,isInvalidPosition:l,isABTestVariation:!0,isGrouped:!0,step_disabled:e.step_disabled||!1},parentId:`offer-ab-group-${t.id}`,extent:"parent",connectable:!0,draggable:!1,position:c}}createABTestGroupNode(e,t,n){const r=e["ab-test-variations"],{width:o,height:a}=wF.calculateABGroupDimensions(r.length),i="vertical"===this.axis?-25:gF,s=this.flowId;return{id:`ab-group-${e.id}`,type:"group",data:{step:e,flow_id:s,label:e.title},position:{x:t,y:n+i},style:{width:o,height:a,backgroundColor:"transparent",border:"2px dashed #000000",borderRadius:"8px"}}}createOfferABTestGroupNode(e,t,n){const r=e["ab-test-variations"],{width:o,height:a}=wF.calculateABGroupDimensions(r.length),i=this.flowId;return{id:`offer-ab-group-${e.id}`,type:"group",data:{step:e,flow_id:i,label:e.title,isOfferABTestGroup:!0},position:{x:t,y:n+gF},style:{width:o,height:a,backgroundColor:"transparent",border:"2px dashed #000000",borderRadius:"8px"}}}createGroupedABTestVariationNode(e,t,n,r,o,a){const i=this.getStepAnalytics(t.id),s=t.actions?.edit?.link||"";let l=e.is_product_assigned;(["landing","thankyou"].includes(t.type)||"storeCheckout"===this.flowType&&"checkout"===t.type)&&(l=!0),t.type;const c=wF.calculateABVariationPosition(r);return{id:this.generateNodeId(e.id),type:"abtest",data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:t.type,control_id:t.id,editPage:e.actions?.edit?.link?e.actions.edit.link.replace(/&amp;/g,"&"):"",editSettings:s,viewPageLink:e.actions?.view?.link||"",index:n,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:e.menu_actions,analytics:i?i["visits-ab"][e.id]:null,traffic:e.traffic,var_badge_count:r,is_product_assigned:l,isInvalidPosition:!1,isABTestVariation:!0,isGrouped:!0,step_disabled:e.step_disabled||!1},parentId:`ab-group-${t.id}`,extent:"parent",connectable:!1,draggable:!1,position:c}}createConditionalNode(e,t,n){return{id:`conditional-${e.id}`,type:"conditional",position:{x:t,y:n},data:{checkoutId:e.id,conditions:e.conditions,defaultStep:e.default_step,editSettings:e.actions?.edit?.link||"",direction:this.direction,axis:this.axis,compact:this.compact,flow_type:this.flowType,flow_id:this.flowId,label:"Dynamic Offers"},style:{visibility:"visible"}}}buildNodes(){const e=[];this.initializePositions();let t=250;e.push(this.createStartNode()),this.steps.forEach((n,r)=>{if(!wcfCartflowsTypePlusPro()&&this.offerSteps.includes(n.type))return;const o=this.getStepPosition(n.id,t,0),a=o.x,i=o.y;if(cF.hasDynamicOffers(n)){if(this.hasABTestVariations(n)){const t=n["ab-test-variations"],o=this.createABTestGroupNode(n,a,i);e.push(o),t.forEach((t,o)=>{const s=this.createGroupedABTestVariationNode(t,n,r,o,a,i);e.push(s)})}else{const t=this.createRegularStepNode(n,r,a,i);e.push(t)}const o=a+fF,s=this.createConditionalNode(n,o,i);return e.push(s),void(t=o+pF)}if(this.hasABTestVariations(n)){const t=n["ab-test-variations"];if(this.offerSteps.includes(n.type)){const o=this.createOfferABTestGroupNode(n,a,i);e.push(o),t.forEach((t,o)=>{wF.calculateABVariationPosition(o);const a=this.createOfferABTestVariationNode(t,n,r,o);e.push(a)})}else{const o=this.createABTestGroupNode(n,a,i);e.push(o),t.forEach((t,o)=>{const s=this.createGroupedABTestVariationNode(t,n,r,o,a,i);e.push(s)})}}else{const t=this.createRegularStepNode(n,r,a,i);e.push(t)}t=a+fF});const n=this.positionCalculator.getMaxX(),r=Math.max(n+fF,t);return e.push(this.createEndNode(r)),e}},vF=class{constructor(e,t,n=!1,r="custom",o="horizontal"){this.steps=e,this.flowType=t,this.isAnimated=n,this.edgeType=r,this.axis=o,this.offerSteps=["upsell","downsell"]}targetHandleId(e="incoming"){return"vertical"===this.axis?"conditional"===e?"left":"top":"conditional"===e?"top":"left"}sourceHandleId(){return"vertical"===this.axis?"bottom":"right"}generateNodeId(e){return`wcf_node_edge_${e}`}hasABTestVariations(e){return e&&e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}getAllVariationIds(e){return this.hasABTestVariations(e)?e["ab-test-variations"].map(e=>e.id):[e.id]}isOfferStep(e){return e&&this.offerSteps.includes(e.type)}getTargetNodeIds(e){if(!this.hasABTestVariations(e))return[`wcf_node_edge_${e.id}`];if(this.isOfferStep(e)){return e["ab-test-variations"].map(e=>`wcf_node_edge_${e.id}`)}return[`ab-group-${e.id}`]}findStep(e){return this.steps.find(t=>t.id===e)}createStartEdges(){const e=[];if(0===this.steps.length)return e;const t=this.steps[0];return this.getTargetNodeIds(t).forEach(t=>{e.push({id:`wcf_start_node-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:"wcf_start_node",sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),e}createEndEdges(){const e=[];if(0===this.steps.length)return e;const t=this.steps[this.steps.length-1];return this.getTargetNodeIds(t).forEach(t=>{e.push({id:`${t}-wcf_end_node-edge`,animated:this.isAnimated,source:t,sourceHandle:this.sourceHandleId(),target:"wcf_end_node",targetHandle:this.targetHandleId(),type:this.edgeType,deletable:!0,focusable:!0,selectable:!0})}),e}createOfferEdges(e,t,n,r=null){const o=[],a=(r?"a"===n?r.offer_yes_step_id:r.offer_no_step_id:null)||t;if(!a)return o;const i=this.findStep(a);if(!i)return o;const s=this.getTargetNodeIds(i),l="a"===n,c=l?"accept":"reject",u={label:l?(0,C.__)("Accept","cartflows"):(0,C.__)("Reject","cartflows"),labelBgStyle:{fill:l?"#F0FDF4":"#FEF2F2",border:l?"#BBF7D0":"#FECACA"},labelStyle:{fill:l?"#16A34A":"#DC2626",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]};return s.forEach(t=>{o.push({id:`${e}-${t}-edge-${n}`,type:this.edgeType,animated:this.isAnimated,source:this.generateNodeId(e),sourceHandle:n,target:t,targetHandle:this.targetHandleId(),...u,data:{kind:c},deletable:!0,focusable:!0,selectable:!0})}),o}createCheckoutToConditionalEdge(e,t){const n=this.hasABTestVariations(e)?`ab-group-${e.id}`:`wcf_node_edge_${e.id}`;return{id:`${n}-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:n,sourceHandle:this.sourceHandleId(),target:t,deletable:!1,focusable:!0,selectable:!0}}getConditionalEdgeLabel(e,t){if(t.default_step&&parseInt(t.default_step,10)===parseInt(e,10))return{label:(0,C.__)("Default","cartflows"),kind:"default"};if(t.conditions&&Array.isArray(t.conditions))for(let n=0;n<t.conditions.length;n++){const r=t.conditions[n];if(r.step_id&&parseInt(r.step_id,10)===parseInt(e,10))return{label:(0,C.sprintf)(/* translators: %d is replaced with the condition number */ /* translators: %d is replaced with the condition number */
37 -(0,C.__)("Condition %d","cartflows"),n+1),kind:"condition"}}return{label:(0,C.__)("Condition","cartflows"),kind:"condition"}}createConditionalEdges(e,t){const n=[];return cF.getUniqueTargetSteps(e.conditions,e.default_step).forEach((r,o)=>{const a=this.findStep(r);if(!a)return void console.warn(`[EdgeBuilder] Target step ${r} not found`);const{label:i,kind:s}=this.getConditionalEdgeLabel(r,e),l={label:i,labelBgStyle:{fill:"#FDE68A",border:"1px solid #d1d5db"},labelStyle:{fill:"#D97706",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]},c=this.hasABTestVariations(a);this.offerSteps.includes(a.type)&&c?a["ab-test-variations"].forEach(e=>{const r=`wcf_node_edge_${e.id}`,o={id:`${t}-${r}-edge`,type:this.edgeType,animated:this.isAnimated,source:t,target:r,targetHandle:this.targetHandleId("conditional"),...l,deletable:!0,focusable:!0,selectable:!0,data:{kind:s,offerControlId:a.id}};n.push(o)}):this.getTargetNodeIds(a).forEach(e=>{const r={id:`${t}-${e}-edge`,type:this.edgeType,animated:this.isAnimated,source:t,target:e,targetHandle:this.targetHandleId("conditional"),...l,deletable:!0,focusable:!0,selectable:!0,data:{kind:s,controlId:a.id}};n.push(r)})}),n}createRegularEdges(e,t){const n=[],r=this.findStep(t);return r?(this.getTargetNodeIds(r).forEach(t=>{n.push({id:`${e}-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:this.generateNodeId(e),sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),n):n}createRegularEdgesFromGroup(e,t){const n=[],r=this.findStep(t);if(!r)return n;const o=this.getTargetNodeIds(r),a=`ab-group-${e}`;return o.forEach(t=>{n.push({id:`${e}-${t}-edge-group`,type:this.edgeType,animated:this.isAnimated,source:a,sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),n}createSequentialEdges(e,t,n){const r=[];if(!t)return r;if(cF.hasDynamicOffers(e))return r;const o=this.hasABTestVariations(e),a=this.offerSteps.includes(e.type);return o&&!a?(r.push(...this.createRegularEdgesFromGroup(e.id,t.id)),r):(this.getAllVariationIds(e).forEach(n=>{const i=o?e["ab-test-variations"].find(e=>e.id===n):null;if(a){const t=i?i.offer_yes_step_id:e.offer_yes_step_id,o=i?i.offer_no_step_id:e.offer_no_step_id;t&&r.push(...this.createOfferEdges(n,t,"a",i)),o&&r.push(...this.createOfferEdges(n,o,"b",i))}else r.push(...this.createRegularEdges(n,t.id))}),r)}buildEdges(){const e=[],t=new Set;this.steps.forEach(e=>{cF.hasDynamicOffers(e)&&cF.getUniqueTargetSteps(e.conditions,e.default_step).forEach(e=>t.add(e))});const n=this.createStartEdges();e.push(...n),this.steps.forEach((n,r)=>{if(!wcfCartflowsTypePlusPro()&&this.offerSteps.includes(n.type))return;if(t.has(n.id)){if(this.offerSteps.includes(n.type))if(this.hasABTestVariations(n))this.getAllVariationIds(n).forEach(t=>{const r=n["ab-test-variations"].find(e=>e.id===t);if(r){const n=r.offer_yes_step_id,o=r.offer_no_step_id;if(n){const o=this.createOfferEdges(t,n,"a",r);e.push(...o)}if(o){const n=this.createOfferEdges(t,o,"b",r);e.push(...n)}}});else{const t=n.offer_yes_step_id,r=n.offer_no_step_id;if(t){const r=this.createOfferEdges(n.id,t,"a",null);e.push(...r)}if(r){const t=this.createOfferEdges(n.id,r,"b",null);e.push(...t)}}return}const o=this.steps[r+1]||null,a=this.createSequentialEdges(n,o,r);e.push(...a)}),this.steps.forEach(t=>{if(!cF.hasDynamicOffers(t))return;const n=`conditional-${t.id}`,r=this.createCheckoutToConditionalEdge(t,n);e.push(r);const o=this.createConditionalEdges(t,n);e.push(...o)});const r=this.createEndEdges();return e.push(...r),e}},xF=class{constructor(e,t,n,r,o="LR",a="horizontal",i=!1){this.steps=e,this.direction=o,this.axis=a,this.compact=i,this.nodeBuilder=new bF(e,t,n,r,o,a,i),this.edgeBuilder=new vF(e,t,!1,"custom",a)}build(){const e=this.nodeBuilder.buildNodes(),t=this.edgeBuilder.buildEdges();return"vertical"===this.axis?{nodes:this.transpose(e),edges:t}:{nodes:e,edges:t}}transpose(e){return e.map(e=>e.parentId?e:{...e,position:{x:e.position.y,y:e.position.x}})}tidy(e,t){const n="vertical"===this.axis,r=new(sF().graphlib.Graph);let o="LR";n?o="TB":"RL"===this.direction&&(o="RL"),r.setGraph({rankdir:o,ranksep:150,nodesep:120,marginx:50,marginy:50}),r.setDefaultEdgeLabel(()=>({}));const a=new Set(e.filter(e=>e.parentId).map(e=>e.id)),i=this.compact?250:400,s=e=>"group"===e.type?e.style?.width||e.measured?.width||i:e.width||e.measured?.width||("label"===e.type?50:i),l=n?230:300,c=e=>{if("group"===e.type)return e.style?.height||e.measured?.height||300;const t=Array.isArray(e.data?.bumps)?e.data.bumps.length:0,r=n&&t?150+50*(t-1):0;return e.height||e.measured?.height||("label"===e.type?30:l+r)};return e.forEach(e=>{a.has(e.id)||r.setNode(e.id,{width:s(e),height:c(e)})}),t.forEach(e=>{a.has(e.source)||a.has(e.target)||r.setEdge(e.source,e.target)}),sF().layout(r),e.map(e=>{if(a.has(e.id))return e;const t=r.node(e.id);return t?{...e,position:n?{x:e.position.x,y:t.y-t.height/2}:{x:t.x-t.width/2,y:e.position.y}}:e})}static structuralKey(e,t,n="horizontal",r=!1){return e.map(e=>`${e.id}:${e.type}:${e.title}`).join("|")+`:${t}:${n}:${r?"c":"d"}`}},NF=class{constructor(e,t,n,r,o,a,i,s,l,c){this.steps=e,this.flowType=t,this.flowId=n,this.nodes=r,this.edges=o,this.setEdges=a,this.setReorderError=i,this.dispatch=s,this.renderCb=c,this.setSettingsStatus=l,this.offerSteps=["upsell","downsell"],this.edgeType="custom"}extractStepId(e){if(!e)return null;if("wcf_start_node"===e)return"START";if("wcf_end_node"===e)return"END";const t=e.match(/ab-group-(\d+)/);if(t)return parseInt(t[1],10);const n=e.match(/wcf_node_edge_(\d+)/);return n?parseInt(n[1],10):null}generateNodeId(e){return`wcf_node_edge_${e}`}findStep(e){return this.steps.find(t=>t.id===e)}getControlId(e){if("wcf_start_node"===e||"wcf_end_node"===e)return this.extractStepId(e);const t=this.nodes.find(t=>t.id===e);return t?"group"===t.type?this.extractStepId(e):t.data&&t.data.control_id?t.data.control_id:this.extractStepId(e):this.extractStepId(e)}hasABTestVariations(e){return e&&e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}isOfferStep(e){return e&&this.offerSteps.includes(e.type)}getTargetNodeId(e){return this.hasABTestVariations(e)?this.isOfferStep(e)?null:`ab-group-${e.id}`:`wcf_node_edge_${e.id}`}getAllTargetNodeIds(e){return this.hasABTestVariations(e)?this.isOfferStep(e)?e["ab-test-variations"].map(e=>`wcf_node_edge_${e.id}`):[`ab-group-${e.id}`]:[`wcf_node_edge_${e.id}`]}updateOfferRedirection(e,t,n){const r=new window.FormData;return r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",this.flowId),r.append("step_id",e),"a"===t?r.append("wcf-yes-next-step",n):"b"===t&&r.append("wcf-no-next-step",n),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>(e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb()),e)).catch(e=>{throw console.error("[ConnectionHandler] AJAX error:",e),e})}updateStepConnection(e,t){const n=new window.FormData;return n.append("action","cartflows_save_meta_settings"),n.append("security",cartflows_admin.save_meta_settings_nonce),n.append("post_id",this.flowId),n.append("step_id",e),n.append("wcf-next-step-id","END"===t?"":t),qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>(e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb()),e)).catch(e=>{throw console.error("[ConnectionHandler] Non-offer connection AJAX error:",e),e})}validateConnection(e,t,n){const r=[],o=this.getControlId(e.id),a=this.getControlId(t.id);if("START"===o||"END"===a)return{isValid:!0,errors:[],warnings:[]};const i=this.findStep(o),s=this.findStep(a);if(!i||!s)return r.push((0,C.__)("Invalid step connection.","cartflows")),{isValid:!1,errors:r};if(o===a)return r.push((0,C.__)("Step cannot connect to itself.","cartflows")),{isValid:!1,errors:r};if(this.offerSteps.includes(i.type)){if(["landing","checkout"].includes(s.type))return r.push((0,C.__)("Offer steps can only connect to other Offer steps, Optin, or Thank You page.","cartflows")),{isValid:!1,errors:r};if(!["upsell","downsell","optin","thankyou"].includes(s.type))return r.push((0,C.__)("Offer steps can only connect to other Offer steps, Optin, or Thank You page.","cartflows")),{isValid:!1,errors:r}}const l=this.steps.map(e=>e.id);return lF.validateConnection({...e,type:i.type,id:`wcf_node_edge_${o}`},{...t,type:s.type,id:`wcf_node_edge_${a}`},n,{steps:this.steps,stepOrder:l})}createEdgeData(e,t,n){let r={...e,animated:!1,type:this.edgeType,deletable:!0,focusable:!0,selectable:!0};return n&&e.sourceHandle&&("a"===e.sourceHandle?r={...r,label:(0,C.__)("Accept","cartflows"),labelBgStyle:{fill:"#BBF7D0",border:"1px solid #d1d5db"},labelStyle:{fill:"#16A34A",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]}:"b"===e.sourceHandle&&(r={...r,label:(0,C.__)("Reject","cartflows"),labelBgStyle:{fill:"#FEF2F2",border:"1px solid #d1d5db"},labelStyle:{fill:"#DC2626",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]})),r}handleConnect(e){const t=this.nodes.find(t=>t.id===e.source),n=this.nodes.find(t=>t.id===e.target);if(!t||!n)return void console.error("[ConnectionHandler] Source or target node not found");const r=this.getControlId(e.source),o=this.getControlId(e.target),a="START"===r,i="END"===o,s=a?null:this.findStep(r),l=i?null:this.findStep(o);if(!(a||i||s&&l))return console.error("[ConnectionHandler] Source or target step not found"),void console.error("[ConnectionHandler] Available steps:",this.steps.map(e=>e.id));const c=this.validateConnection(t,n,e.sourceHandle);if(!c.isValid)return console.error("[ConnectionHandler] Connection validation failed:",c.errors),this.setReorderError(c.errors[0]),void setTimeout(()=>{this.setReorderError(null)},4e3);const u=s&&this.offerSteps.includes(s.type),d=e.sourceHandle,f=this.createEdgeData(e,s,u),p=i?[e.target]:this.getAllTargetNodeIds(l),m=this.extractStepId(e.source);if(p.length>1){const e=[];p.forEach((t,n)=>{const r={...f,id:`${m}-${t}-edge${d?"-"+d:""}-${n}`,target:t};e.push(r)}),this.setEdges(t=>[...t,...e])}else{f.target=p[0];const e=gT(f,this.edges);this.setEdges(e)}u&&d?(0,Xh.$h)(this.updateOfferRedirection(m,d,o)):!a&&s&&(0,Xh.$h)(this.updateStepConnection(m,o))}},EF=class{constructor(e,t,n,r,o){this.steps=e,this.dispatch=t,this.flowId=n,this.setSettingsStatus=r,this.renderCb=o}async handleDeletion(e){if(!cF.isConditionalEdge(e))return!1;const t=cF.extractCheckoutId(e.source),n=cF.extractStepId(e.target,this.steps);if(!t||!n)return!1;const r=this.steps.find(e=>e.id===t);if(!r||!r.conditions)return console.warn("[ConditionalEdgeHandler] Checkout step or conditions not found"),!1;const o=cF.removeConditionsForStep(r.conditions,n),a=cF.updateDefaultStep(r.default_step,n,o);return await this.saveRules(t,o,a),!0}async saveRules(e,t,n){const r=cF.buildRulesFormData(e,this.flowId,t,n);try{const e=await(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}));e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb())}catch(e){console.error("[ConditionalEdgeHandler] Failed to save rules:",e)}}hasConditionalRules(e){const t=this.steps.find(t=>t.id===e);return cF.hasDynamicOffers(t)}},_F=class{constructor(e,t,n,r,o,a,i,s){this.edges=e,this.setEdges=t,this.onEdgesChangeInternal=n,this.steps=r,this.dispatch=o,this.flowId=a,this.setSettingsStatus=i,this.renderCb=s,this.conditionalHandler=new EF(r,o,a,i,s)}findRelatedEdges(e){const t=this.edges.find(t=>t.id===e);if(!t)return[];if(t.source&&t.source.startsWith("conditional-")&&t.target){const n=cF.extractStepId(t.target,this.steps);if(n){const r=this.steps.find(e=>e.id===n);if(r&&r["ab-test-variations"]&&Array.isArray(r["ab-test-variations"])&&r["ab-test-variations"].length>1){const r=this.edges.filter(r=>!(r.id===e||r.source!==t.source||!r.target)&&cF.extractStepId(r.target,this.steps)===n);return r}}}return t.data&&t.data.offerControlId?this.edges.filter(n=>n.id!==e&&n.data&&n.data.offerControlId===t.data.offerControlId):t.sourceHandle?this.edges.filter(n=>n.id!==e&&n.source===t.source&&n.sourceHandle===t.sourceHandle):[]}async handleEdgeChanges(e){const t=e.filter(e=>"remove"===e.type);if(t.length>0){const n=[];for(const e of t){const t=this.edges.find(t=>t.id===e.id);if(!t)continue;if(await this.conditionalHandler.handleDeletion(t))return;const r=this.findRelatedEdges(e.id);for(const e of r)n.push({type:"remove",id:e.id})}n.length>0&&(e=[...e,...n])}this.onEdgesChangeInternal(e)}},MF=()=>{const e=(0,h.useHistory)(),[{flow_type:t,flow_id:n}]=Yp(),r="storeCheckout"===t,[o,a]=(0,s.useState)(null),l=async({key:e,flowName:t,instantLayout:n})=>{if(!o){a(e);try{const e=await(({flowName:e,instantLayout:t})=>{const n=new window.FormData;return n.append("action","cartflows_create_flow"),n.append("security",cartflows_admin.create_flow_nonce),n.append("flow_name",e),n.append("creation_method","scratch"),n.append("instant_layout",t?"true":"false"),qf()({url:cartflows_admin.ajax_url,method:"POST",body:n})})({flowName:t,instantLayout:n});if(!e?.success)return hm.error((0,C.__)("Failed to create funnel.","cartflows")),void a(null);hm.success((0,C.__)("Funnel created.","cartflows")),window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e.data.flow_id}`}catch(e){hm.error((0,C.__)("Failed to create funnel.","cartflows")),a(null)}}},c=[{key:"template",icon:Gm,title:(0,C.__)("Use a template","cartflows"),description:(0,C.__)("Start with a proven layout from our template library.","cartflows"),cta:(0,C.__)("Browse templates","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:"?page=cartflows&path=library"})}},{key:"quick-checkout",icon:NI,title:(0,C.__)("Quick checkout","cartflows"),description:(0,C.__)("Spin up a checkout funnel with Instant Layout enabled.","cartflows"),cta:(0,C.__)("Create checkout funnel","cartflows"),onClick:()=>l({key:"quick-checkout",flowName:(0,C.__)("Quick Checkout Funnel","cartflows"),instantLayout:!0})},{key:"scratch",icon:yg,title:(0,C.__)("Build from scratch","cartflows"),description:(0,C.__)("Start with an empty funnel and add steps yourself.","cartflows"),cta:(0,C.__)("Create blank funnel","cartflows"),onClick:()=>l({key:"scratch",flowName:(0,C.__)("New Funnel","cartflows"),instantLayout:!1})}],u=[{key:"store-template",icon:Gm,title:(0,C.__)("Use a Store Checkout template","cartflows"),description:(0,C.__)("Start from a ready-made Store Checkout layout.","cartflows"),cta:(0,C.__)("Browse templates","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:"?page=cartflows&path=store-checkout-library"})}},{key:"store-add-step",icon:yg,title:(0,C.__)("Add a step","cartflows"),description:(0,C.__)("Pick a step type to add to this Store Checkout.","cartflows"),cta:(0,C.__)("Add step","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&tab=library`})}}],d=r?u:c,f=r?(0,C.__)("Start building your Store Checkout","cartflows"):(0,C.__)("Create your first funnel","cartflows"),p=r?(0,C.__)("Pick a starting point for this Store Checkout — you can always change things later.","cartflows"):(0,C.__)("Pick how you’d like to begin — you can always change things later.","cartflows"),m=`grid grid-cols-1 ${2===d.length?"md:grid-cols-2":"md:grid-cols-3"} gap-4`;return(0,i.createElement)(zm,{align:"center",justify:"center",className:"wcf-canvas-empty-state w-full h-full bg-background-secondary"},(0,i.createElement)(zm,{direction:"column",gap:"lg",className:"wcf-canvas-empty-state__panel max-w-4xl w-full mx-auto px-6 py-10"},(0,i.createElement)(zm,{direction:"column",align:"center",gap:"xs",className:"text-center"},(0,i.createElement)(jI,{tag:"h2",size:"md",title:f}),(0,i.createElement)(Vm,{size:16,color:"secondary"},p)),(0,i.createElement)("div",{className:m},d.map(e=>{const t=e.icon,n=o===e.key;return(0,i.createElement)(zm,{key:e.key,direction:"column",align:"start",gap:"sm",className:"wcf-canvas-empty-state__card p-5 bg-background-primary rounded-lg border-0.5 border-solid border-border-subtle shadow-sm"},(0,i.createElement)(zm,{align:"center",justify:"center",className:"wcf-canvas-empty-state__icon w-10 h-10 rounded-md bg-primary-50 text-primary-500"},(0,i.createElement)(t,{className:"w-5 h-5 stroke-2"})),(0,i.createElement)(jI,{tag:"h3",size:"sm",title:e.title}),(0,i.createElement)(Vm,{size:14,color:"secondary",className:"flex-1"},e.description),(0,i.createElement)(Ro,{variant:"secondary",size:"sm",loading:n,disabled:!!o&&!n,onClick:e.onClick},e.cta))}))))},IF=[{label:(0,C.__)("Open shortcuts panel","cartflows"),keys:["mod","/"]},{label:(0,C.__)("Open shortcuts panel (alt)","cartflows"),keys:["?"]},{label:(0,C.__)("Exit fullscreen","cartflows"),keys:["Esc"]},{label:(0,C.__)("Fit canvas to view","cartflows"),keys:["F"]},{label:(0,C.__)("Tidy layout","cartflows"),keys:["T"]},{label:(0,C.__)("Toggle vertical / horizontal layout","cartflows"),keys:["V"]},{label:(0,C.__)("Toggle minimap","cartflows"),keys:["M"]},{label:(0,C.__)("Toggle compact / detailed cards","cartflows"),keys:["C"]},{label:(0,C.__)("Zoom in","cartflows"),keys:["+"]},{label:(0,C.__)("Zoom out","cartflows"),keys:["−"]},{label:(0,C.__)("Duplicate selected step","cartflows"),keys:["mod","D"]},{label:(0,C.__)("Delete selected node","cartflows"),keys:["Backspace"]}],SF=({children:e})=>(0,i.createElement)("kbd",{className:"inline-flex items-center justify-center min-w-[1.75rem] h-7 px-2 text-xs font-medium text-text-primary bg-background-secondary border border-solid border-border-subtle rounded shadow-sm"},e),kF=({open:e,onClose:t})=>{const n="undefined"!=typeof navigator&&/mac|iphone|ipad|ipod/i.test(navigator.platform||"")?"⌘":"Ctrl";return(0,i.createElement)(bh,{open:!!e,setOpen:e=>{e||t?.()},exitOnEsc:!0,exitOnClickOutside:!0,scrollLock:!0},(0,i.createElement)(bh.Portal,null,(0,i.createElement)(bh.Panel,{className:"max-w-xl gap-0"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Header,{className:"flex items-center justify-between px-6 pt-5 pb-0"},(0,i.createElement)(bh.Title,null,(0,C.__)("Keyboard shortcuts","cartflows")),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,{className:"px-6 py-4"},(0,i.createElement)(zm,{direction:"column",gap:"sm",className:"m-0 p-0"},IF.map((e,t)=>(0,i.createElement)(zm,{key:t,align:"center",justify:"between",gap:"md"},(0,i.createElement)(Vm,{size:14,color:"primary"},e.label),(0,i.createElement)(zm,{align:"center",gap:"xs"},e.keys.map((e,t)=>(0,i.createElement)(s.Fragment,{key:t},t>0&&(0,i.createElement)(Vm,{size:12,color:"tertiary"},"+"),(0,i.createElement)(SF,null,"mod"===e?n:e)))))))))))},DF="wcf_canvas_axis",CF="wcf_canvas_minimap",jF="wcf_canvas_compact",AF=()=>"vertical"===window.localStorage.getItem(DF)?"vertical":"horizontal",TF=()=>{const e=window.localStorage.getItem(CF);return null===e||"true"===e},LF=()=>{const e=window.localStorage.getItem(jF);return null===e?null:"true"===e},OF={custom:function(e){const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:s,targetPosition:l,style:c={},label:u,labelStyle:d,labelBgStyle:f,data:p,markerEnd:m}=e,g=p?.edgeStyle||"smoothstep",[w,y,b]="bezier"===g?fT({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:l}):xT({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:l}),v=!!u,x=p?.kind;let N=24;"accept"===x||"reject"===x?N=80:("condition"===x||"default"===x)&&(N=110);const[{flow_id:E,flow_type:_}]=Yp(),M=(0,h.useHistory)(),I=e=>{if(!e)return null;if("wcf_start_node"===e||"start"===e||"wcf_end_node"===e||"end"===e)return e;if(e.includes("wcf_node_edge_")){const t=parseInt(e.replace("wcf_node_edge_",""),10);return isNaN(t)?null:t}if(e.startsWith("conditional-")){const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}if(e.startsWith("ab-group-")){const t=parseInt(e.replace("ab-group-",""),10);return isNaN(t)?null:t}return null},S=!("wcf_end_node"===e.target||"end"===e.target||e.target&&e.target.startsWith("conditional-"));return(0,i.createElement)(i.Fragment,null,(0,i.createElement)($O,{id:t,path:w,style:c,markerEnd:m,interactionWidth:20}),(0,i.createElement)(Qz,null,(0,i.createElement)("div",{className:"nodrag nopan wcf-edge-add-button flex items-center justify-center gap-1",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${y}px, ${b}px)`,pointerEvents:"all",width:N,height:v?32:24,backgroundColor:f?.fill,borderRadius:"14px",border:f?.border,padding:v?"4px 6px":"0",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"}},v&&(0,i.createElement)("span",{style:{color:d?.fill,fontWeight:d?.fontWeight,fontSize:d?.fontSize,lineHeight:1,paddingLeft:"4px"}},u),S&&(0,i.createElement)("button",{onClick:t=>{t.stopPropagation();const n=I(e.source),r=I(e.target),o=e.sourceHandle?e.sourceHandle:"accept"===x?"a":"reject"===x?"b":null;if(null!==n&&null!==r){const e={sourceStepId:n,targetStepId:r,sourceHandle:o};window.sessionStorage.setItem("wcf_edge_insertion_context",JSON.stringify(e))}const a="storeCheckout"===_?"admin.php?page=cartflows&path=store-checkout":"admin.php?page=cartflows&path=flows",i=`&action=wcf-edit-flow&flow_id=${E}&tab=library`;M.push({pathname:a,search:i})},className:"flex items-center justify-center hover:opacity-80 transition-opacity cursor-pointer",style:{width:v?"20px":"24px",height:v?"20px":"24px",backgroundColor:v?"white":"#f3f4f6",borderRadius:"50%",border:v?"none":"1px solid #4b5563",padding:0},title:"Add new step"},(0,i.createElement)(yg,{className:"text-primary-600",style:{width:v?"14px":"16px",height:v?"14px":"16px"}})))))}},zF={label:hP,conditional:yP,landing:WP,checkout:HP,offer:zB,thankyou:RB,optin:BB,abtest:VB,group:aF},PF={x:0,y:150,zoom:.75},RF=[10,10],UF={padding:.2,duration:400,minZoom:.3},BF=({x:e,y:t,width:n,height:r,color:o,strokeColor:a,strokeWidth:s,borderRadius:l})=>{const c=e+n/2,u=t+r/2;return(0,i.createElement)("rect",{x:c-160,y:u-120,width:320,height:240,fill:o,stroke:a,strokeWidth:s,rx:l,ry:l})};function FF({renderCb:e}){const[{steps:t,flow_type:n,flow_id:r,flow_analytics:o,emptySteps:a},l]=Yp(),[{},c]=f(),u=(0,s.useMemo)(()=>wcfCartflowsPro()?t:t.filter(e=>"upsell"!==e.type&&"downsell"!==e.type),[t]),[d,p]=(0,s.useState)(""),[m,h]=(0,s.useState)(!1),[g,w]=(0,s.useState)(null),[y,b]=(0,s.useState)("smoothstep"),[v,x]=(0,s.useState)(!0),N=(0,s.useMemo)(()=>({deletable:!0,focusable:!0,selectable:!0,style:{stroke:"#4B5563",strokeWidth:1},markerEnd:{type:yA.ArrowClosed,width:40,height:40,color:"#f06434"},data:{edgeStyle:y}}),[y]),E=""!==d?"wcf-fullscreen":"",_=cartflows_admin.is_rtl?"RL":"LR",M={direction:"initial"},[I,S,k]=function(){const[e,t]=(0,s.useState)([]),n=(0,s.useCallback)(e=>t(t=>KL(e,t)),[]);return[e,t,n]}(),[D,j,A]=function(){const[e,t]=(0,s.useState)([]),n=(0,s.useCallback)(e=>t(t=>eO(e,t)),[]);return[e,t,n]}(),{axis:T,setAxis:L,toggleAxis:O,showMinimap:z,setShowMinimap:P,compact:R,toggleCompact:U}=(({autoCompact:e=!1}={})=>{const[t,n]=(0,s.useState)(AF),[r,o]=(0,s.useState)(TF),[a,i]=(0,s.useState)(LF),l=(0,s.useCallback)(e=>{const t="vertical"===e?"vertical":"horizontal";window.localStorage.setItem(DF,t),n(t)},[]),c=(0,s.useCallback)(()=>{l("horizontal"===AF()?"vertical":"horizontal")},[l]),u=(0,s.useCallback)(e=>{const t=!!e;window.localStorage.setItem(CF,String(t)),o(t)},[]),d=(0,s.useCallback)(e=>{const t=!!e;window.localStorage.setItem(jF,String(t)),i(t)},[]),f=(0,s.useCallback)(()=>{d(!(null===a?e:a))},[a,e,d]);return{axis:t,setAxis:l,toggleAxis:c,showMinimap:r,setShowMinimap:u,compact:null===a?e:a,setCompact:d,toggleCompact:f}})({autoCompact:u.length>12}),[B,F]=(0,s.useState)(0),Q=(0,s.useRef)(T),V=(0,s.useRef)(R),{fitView:Y,zoomIn:Z,zoomOut:W,setCenter:G,getViewport:H}=dO(),{zoom:$}=xL(Vz,wL),X=HL("Escape"),[q,J]=(0,s.useState)(!1),[K,ee]=(0,s.useState)(0),te=()=>{c({status:"SAVED"}),F(e=>e+1),e(),setTimeout(()=>Y(UF),50)};(0,s.useEffect)(()=>{const e=new xF(u,n,r,o,_,T,R),t=e.build(),a=B>0?e.tidy(t.nodes,t.edges):t.nodes,i=t.edges.map(e=>({...e,data:{...e.data,edgeStyle:y}})),s=Q.current!==T;Q.current=T;const l=V.current!==R;V.current=R;const c=B>0||s||l;S(e=>{if(c)return a;const t=new Map(e.map(e=>[e.id,e.position]));return a.map(e=>e.id.startsWith("wcf_node_edge_")&&t.has(e.id)?{...e,position:t.get(e.id)}:e)}),j(i)},[u,n,r,o,_,T,R,B,S,j]);const ne=(0,s.useCallback)(t=>{new NF(u,n,r,I,D,j,w,l,c,e).handleConnect(t)},[u,n,r,I,D,j,l,c,e]),re=(0,s.useCallback)(t=>{new _F(D,j,A,u,l,r,c,e).handleEdgeChanges(t)},[D,j,A,u,l,r,c,e]);(0,s.useEffect)(()=>{j(e=>e.map(e=>({...e,data:{...e.data,edgeStyle:y}})))},[y,j]),(0,s.useEffect)(()=>(document.body.classList.add("wcf-flow-overview-screen"),()=>document.body.classList.remove("wcf-flow-overview-screen")),[]),(0,s.useEffect)(()=>{X&&"fullscreen"===d&&(p(""),Y(UF))},[X,d,Y]),(0,s.useEffect)(()=>{const e=e=>{const t=e.key,n=e.target?.tagName;if("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n&&!e.target?.isContentEditable){if(e.metaKey||e.ctrlKey)return"d"===t.toLowerCase()?(e.preventDefault(),void ee(e=>e+1)):"/"===t?(e.preventDefault(),void J(e=>!e)):void 0;if(e.altKey||e.shiftKey)"?"===t&&(e.preventDefault(),J(e=>!e));else switch(t.toLowerCase()){case"f":e.preventDefault(),Y(UF);break;case"t":e.preventDefault(),te();break;case"v":e.preventDefault(),O(),setTimeout(()=>Y(UF),50);break;case"m":e.preventDefault(),P(!z);break;case"c":e.preventDefault(),U(),setTimeout(()=>Y(UF),50);break;case"+":case"=":e.preventDefault(),Z({duration:200});break;case"-":e.preventDefault(),W({duration:200})}}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[Y,Z,W,O,U,z,P]),(0,s.useEffect)(()=>{if(!K)return;const e=I.find(e=>e.selected&&e.id?.startsWith("wcf_node_edge_"));if(!e)return;const t=e.data?.step_id;if(!t)return;const n=!!e.data?.isABTestVariation;ZP.cloneStepRequest({stepId:t,flowId:e.data?.flow_id||r,action:n?"cartflows_clone_ab_test_step":"cartflows_clone_step",controlId:e.data?.control_id}).then(e=>{!1!==e?.success&&window.location.reload()})},[K,I,r]);const oe=()=>{p("fullscreen"),h(!0),setTimeout(()=>{h(!1)},3e3),Y(UF)},ae=()=>{p(""),Y(UF)};return u.length<=0?(0,i.createElement)("div",{className:`wcf-steps-chart wcf-steps-chart--empty flex w-full h-screen items-center justify-center ${E}`,style:M},a?(0,i.createElement)(MF,null):(0,i.createElement)(Kg,{variant:"primary",size:"lg"})):(0,i.createElement)("div",{className:`wcf-steps-chart flex justify-center mx-auto h-screen w-full ${E}`,style:M},I.length>0&&(0,i.createElement)(Bz,{minZoom:.3,maxZoom:1,nodes:I,edges:D,edgeTypes:OF,colorMode:"light",onNodesChange:k,onEdgesChange:re,onConnect:ne,nodeTypes:zF,snapToGrid:!0,snapGrid:RF,defaultViewport:PF,onInit:e=>{e.fitView(UF)},zoomOnScroll:!1,panOnScroll:!0,panOnScrollMode:"free",elementsSelectable:v,preventScrolling:!1,nodesDraggable:v,nodesConnectable:v,edgesFocusable:!0,reconnectRadius:20,elevateEdgesOnSelect:!0,edgesUpdatable:!1,deleteKeyCode:"Backspace",defaultEdgeOptions:N},(0,i.createElement)(Xz,{variant:"dots",gap:16,size:1,color:"#d1d5db"}),z&&(0,i.createElement)(pP,{pannable:!0,zoomable:!0,position:cartflows_admin.is_rtl?"bottom-left":"bottom-right",bgColor:"#ffffff",nodeColor:"#ffedd5",nodeStrokeColor:"#fdba74",nodeStrokeWidth:1,nodeBorderRadius:3,nodeComponent:BF,maskColor:"rgba(240, 100, 52, 0.04)",maskStrokeColor:"#fdba74",maskStrokeWidth:.5,onClick:(e,t)=>{G(t.x,t.y,{zoom:H().zoom,duration:400})},style:{width:160,height:100,border:"1px solid #ffedd5",borderRadius:"6px",boxShadow:"0 2px 8px rgba(240, 100, 52, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04)"}}),(0,i.createElement)(jL,{position:"top-right",className:"flex flex-col items-end gap-2"},(0,i.createElement)("div",{className:"inline-flex items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Vertical Layout","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(uk,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,C.__)("Vertical Layout","cartflows"),onClick:()=>{"vertical"!==T&&(L("vertical"),setTimeout(()=>Y(UF),50))}})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Horizontal Layout","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(dk,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,C.__)("Horizontal Layout","cartflows"),onClick:()=>{"horizontal"!==T&&(L("horizontal"),setTimeout(()=>Y(UF),50))}}))),(0,i.createElement)("div",{className:"inline-flex flex-col items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:v?(0,C.__)("Lock Interaction","cartflows"):(0,C.__)("Unlock Interaction","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hidden hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:v?(0,i.createElement)(fk,{className:"!fill-[none] stroke-[1.5]"}):(0,i.createElement)(pk,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":v?(0,C.__)("Lock Interaction","cartflows"):(0,C.__)("Unlock Interaction","cartflows"),onClick:()=>x(!v)})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:"smoothstep"===y?(0,C.__)("Switch to Wavy Edges","cartflows"):(0,C.__)("Switch to Smooth Edges","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:"smoothstep"===y?(0,i.createElement)(mk,{className:"!fill-[none] stroke-[1.5]"}):(0,i.createElement)(hk,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,C.__)("Edge Style","cartflows"),onClick:()=>{b(e=>"smoothstep"===e?"bezier":"smoothstep")}})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Tidy Layout","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(gk,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,C.__)("Tidy Layout","cartflows"),onClick:te})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Fit View","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hidden hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(wk,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,C.__)("Fit View","cartflows"),onClick:()=>Y(UF)})),(()=>{const e="fullscreen"===d;return(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:e?(0,C.__)("Exit Full Screen","cartflows"):(0,C.__)("Full Screen","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:e?(0,i.createElement)(lk,{className:"!fill-[none] stroke-[1.5]"}):(0,i.createElement)(ck,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":e?(0,C.__)("Exit Full Screen","cartflows"):(0,C.__)("Full Screen","cartflows"),onClick:e?ae:oe}))})(),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Keyboard Shortcuts (?)","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(yk,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,C.__)("Keyboard Shortcuts","cartflows"),onClick:()=>J(!0)})))),(0,i.createElement)(jL,{position:"bottom-left"},(0,i.createElement)("div",{className:"inline-flex items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",onClick:()=>Y(UF)},(0,C.__)("Fit","cartflows")),(0,i.createElement)("div",{className:"w-px h-4 bg-border-subtle","aria-hidden":"true"}),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(Dg,{className:"stroke-[1.5]"}),"aria-label":(0,C.__)("Zoom Out","cartflows"),onClick:()=>W({duration:200})}),(0,i.createElement)(Vm,{size:12,weight:600,className:"tabular-nums min-w-[44px] text-center"},Math.round(100*$),"%"),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(xS,{className:"stroke-[1.5]"}),"aria-label":(0,C.__)("Zoom In","cartflows"),onClick:()=>Z({duration:200})}))),m&&(0,i.createElement)(jL,{position:"top-center",className:"wcf-steps-chart__exit-screen-msg"},(0,C.__)("Press ESC to exit full screen.","cartflows")),g&&(0,i.createElement)(jL,{position:"top-center",className:"wcf-steps-chart__error-msg"},g)),(0,i.createElement)(kF,{open:q,onClose:()=>J(!1)}))}const QF=function(e){return(0,i.createElement)(Pz,null,(0,i.createElement)(FF,e))},VF=function({renderCb:e}){return(0,i.createElement)("div",{className:"wcf-steps-page-wrapper border-t border-border-subtle -mt-px"},(0,i.createElement)(QF,{renderCb:e}))};function YF({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75v6.75m0 0-3-3m3 3 3-3m-8.25 6a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const ZF=s.forwardRef(YF);function WF({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"}))}const GF=s.forwardRef(WF);function HF({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const $F=s.forwardRef(HF),XF=e=>{var t;const{steps:n}=e,[r,o]=(0,s.useState)(""),[a,l]=(0,s.useState)(""),[{flow_id:c,flow_title:u,flow_type:d},f]=Yp(),p=(0,h.useHistory)(),m=null!==(t=new URLSearchParams((0,h.useLocation)()?.search).get("automation"))&&void 0!==t?t:"";(0,s.useEffect)(()=>{const e=n.find(e=>e.id===parseInt(m));e&&(o(e.title),l(e.type))},[m,n]);return(0,s.useEffect)(()=>{r&&(()=>{const e=new window.FormData;e.append("action","cartflows_get_suretriggers_data"),e.append("security",cartflows_admin.get_suretriggers_data_nonce),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e&&e?.success&&e?.data?.connected&&(e=>{if(e&&u){let t=[];switch(a){case"upsell":t=["cartflows_upsell_offer_accepted","cartflows_upsell_offer_rejected","cartflows_upsell_offer_skipped"];break;case"checkout":t=["wcf_order_bump_item_added","wcf_order_bump_item_removed","wcf_pre_checkout_offer_item_added","wcf_order_bump_item_replaced"];break;case"downsell":t=["cartflows_downsell_offer_accepted","cartflows_downsell_offer_rejected","cartflows_downsell_offer_skipped"]}e.embedded_identifier=m,t&&t.length>0&&(e.allowed_events={CartFlows:{triggers:t}}),e.selected_options={funnel_id:{value:c,label:u},funnel_step_id:{value:m,label:r}},f({type:"SET_SURETRIGGERS_CONFIG",config:e})}})(e?.data?.data)})})()},[r]),(0,i.createElement)(hS,{open:""!==m,setOpen:e=>{e||p.push("storeCheckout"===d?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${c}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${c}`)},position:"right",exitOnClickOutside:!0,exitOnEsc:!1,className:"wcf-funnel-step-setting--slide-out"},(0,i.createElement)(hS.Panel,{className:"pointer-events-auto w-screen max-w-4.5xl relative top-1"},(0,i.createElement)(hS.Backdrop,null),(0,i.createElement)("div",{className:"wcf-slide-out-panel--close bg-background-primary absolute -left-10"},(0,i.createElement)(S,{key:"close",to:{pathname:"admin.php",search:"storeCheckout"===d?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${c}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${c}`},className:"flex justify-center items-center p-2.5 text-text-tertiary hover:text-text-secondary outline-none focus:outline-none shadow-none focus:shadow-none"},(0,i.createElement)("button",{type:"button",onClick:()=>{o("")}},(0,i.createElement)(ww,{className:"w-5 h-5","aria-hidden":"true"})))),(0,i.createElement)(hS.Body,{className:"wcf-slide-out-panel--content-body flex h-full flex-col overflow-y-scroll bg-background-primary shadow-xl !p-0"},!1,(0,i.createElement)("form",null,(0,i.createElement)(hS.Header,{className:"wcf-slide-out-panel--header flex justify-between px-6 py-5 !space-y-0"},(0,i.createElement)("div",{className:"wcf-slide-out-panel--step-title"},(0,i.createElement)(hS.Title,{className:"text-lg font-medium text-text-primary"},(0,C.__)("Automation for","cartflows"),":"," ",r))),(0,i.createElement)("div",{className:"wcf-slide-out-panel--settings flex-1 p-8 border-t border-border-subtle px-6"},(0,i.createElement)("div",{id:"suretriggers-iframe-wrapper",style:{width:"100%",height:"80vh"}}))))))},qF=n.p+"images/abtest_bg.b54fd7f7.png",JF=({visibility:e,setVisibility:t})=>(0,i.createElement)(bh,{open:"show"===e,setOpen:e=>{e||t("hide")},exitOnClickOutside:!0},(0,i.createElement)(bh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(bh.Title,null,(0,C.__)("A/B Testing","cartflows"),(0,i.createElement)("span",{className:"ml-2 inline-flex align-middle"},(0,i.createElement)(Pp,null))),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,null,(0,i.createElement)("img",{src:qF,alt:"Abtest",className:"w-full p-5 bg-background-secondary rounded-lg box-border"}),(0,i.createElement)("div",{className:"mt-5 text-sm"},(0,C.__)("Optimize your sales with A/B testing in CartFlows! Experiment with product pricing, page layouts, messaging, and design. Create variants, analyze results, and discover new ways to boost revenue.","cartflows"))),(0,i.createElement)(bh.Footer,{className:"bg-brand-25"},(0,i.createElement)(Ro,{tag:"a",href:getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans),target:"blank",variant:"primary",className:"w-full no-underline text-center text-sm"},(0,C.__)("Upgrade to Pro","cartflows"))))),KF=function({flowId:e,flowType:t,showConnectorLines:n=!0,tooltipPlacement:r="right"}){const o="storeCheckout"===t?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e}&tab=library`;return(0,i.createElement)("div",{className:"wcf-add-step-connector flex flex-col items-center"},n&&(0,i.createElement)("div",{className:"w-px h-4 bg-background-secondary"}),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Add New Step","cartflows"),placement:r},(0,i.createElement)(S,{to:{pathname:"admin.php",search:o},className:"wcf-add--new-step-connector inline-flex items-center justify-center w-7 h-7 rounded-full border border-solid border-border-subtle bg-background-primary hover:shadow-md hover:bg-background-secondary no-underline"},(0,i.createElement)(yg,{className:"w-3.5 h-3.5 stroke-2 text-text-secondary","aria-hidden":"true"}))),n&&(0,i.createElement)("div",{className:"w-px h-4 bg-background-secondary"}))},eQ=(0,s.createContext)(void 0),tQ=()=>{const e=(0,s.useContext)(eQ);if(!e)throw new Error("Table components must be used within Table component");return e},nQ=({children:e,className:t,checkboxSelection:n=!1,...r})=>{const o={checkboxSelection:n},a=s.Children.toArray(e).find(e=>s.isValidElement(e)&&e.type===lQ),i=s.Children.toArray(e).filter(e=>s.isValidElement(e)&&e.type!==lQ);return(0,j.jsx)(eQ.Provider,{value:o,children:(0,j.jsxs)("div",{className:"flow-root border-0.5 border-solid border-border-subtle rounded-md divide-y-0.5 divide-x-0 divide-solid divide-border-subtle overflow-hidden",children:[(0,j.jsx)("div",{className:"overflow-x-auto w-full",children:(0,j.jsx)("div",{className:"relative",children:(0,j.jsx)("table",{className:Se("table-fixed min-w-full border-collapse border-spacing-0",t),...r,children:i})})}),a]})})},rQ=({children:e,className:t,selected:n,onChangeSelection:r,indeterminate:o,disabled:a,...i})=>{const{checkboxSelection:s}=tQ();return(0,j.jsx)("thead",{className:Se("bg-background-secondary border-x-0 border-t-0 border-b-0.5 border-solid border-border-subtle",t),...i,children:(0,j.jsxs)("tr",{children:[s&&(0,j.jsx)("th",{scope:"col",className:"relative px-5.5 w-11 overflow-hidden",children:(0,j.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,j.jsx)(Cg,{size:"sm",checked:n,indeterminate:o,disabled:a,onChange:e=>{"function"==typeof r&&r(e)},"aria-label":n?"Deselect all":"Select all"})})}),e]})})},oQ=({children:e,className:t,...n})=>(0,j.jsx)("th",{scope:"col",className:Se("p-3 text-left text-sm font-medium leading-5 text-text-primary",t),...n,children:e}),aQ=({children:e,className:t,...n})=>(0,j.jsx)("tbody",{className:Se("bg-background-primary divide-y-0.5 divide-x-0 divide-solid divide-border-subtle",t),...n,children:e}),iQ=({children:e,selected:t,value:n,className:r,onChangeSelection:o,...a})=>{const{checkboxSelection:i}=tQ();return(0,j.jsxs)("tr",{className:Se("hover:bg-background-secondary",t&&"bg-background-secondary",r),...a,children:[i&&(0,j.jsx)("td",{className:"relative px-5.5 w-11 overflow-hidden",children:(0,j.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,j.jsx)(Cg,{size:"sm",checked:t,onChange:e=>{"function"==typeof o&&o(e,n)},"aria-label":"Select row"})})}),e]})},sQ=({children:e,className:t,...n})=>(0,j.jsx)("td",{className:Se("px-3 py-3.5 text-sm font-normal leading-5 text-text-secondary",t),...n,children:e}),lQ=({children:e,className:t,...n})=>{const{checkboxSelection:r}=tQ();return(0,j.jsx)("div",{className:Se("px-3 py-3",r&&"px-4",t),...n,children:e})};nQ.displayName="Table",rQ.displayName="Table.Head",oQ.displayName="Table.HeadCell",aQ.displayName="Table.Body",iQ.displayName="Table.Row",sQ.displayName="Table.Cell",lQ.displayName="Table.Footer",nQ.Head=rQ,nQ.HeadCell=oQ,nQ.Body=aQ,nQ.Row=iQ,nQ.Cell=sQ,nQ.Footer=lQ;const cQ=To("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),uQ=To("CircleDollarSign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]),dQ=To("Banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]]),fQ=To("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]),pQ=To("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),mQ=To("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),hQ=To("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),gQ=To("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),wQ=function({label:e,tooltip:t,value:n,icon:r}){return(0,i.createElement)("div",{className:"bg-[rgba(254, 248, 245, 0.35)] border border-solid border-brand-100 rounded-lg p-5 flex flex-col justify-between gap-3"},(0,i.createElement)("div",{className:"flex items-center justify-between"},(0,i.createElement)("div",{className:"flex items-center gap-1"},(0,i.createElement)(Vm,{as:"span",size:14,weight:400,color:"primary"},e),t&&(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:t,placement:"top"},(0,i.createElement)(Lo,{className:"w-3.5 h-3.5 text-text-tertiary cursor-help flex-shrink-0",strokeWidth:2}))),(0,i.createElement)("div",{className:"flex items-center p-2 rounded-lg bg-brand-25 border border-solid border-brand-100"},r)),(0,i.createElement)(Vm,{as:"div",size:24,weight:600,color:"primary"},null!=n?n:0))},yQ=function({onBack:e}){var t;const[{flow_analytics:n,flow_id:r},o]=Yp(),a=new Date,[l,c]=(0,s.useState)(new Date(a));a.setDate(a.getDate()-7);const[u,d]=(0,s.useState)(new Date(a)),[f,p]=(0,s.useState)(!1),[m,h]=(0,s.useState)(!1),g=n?.revenue,w=n?.all_steps,y=w?w.reduce((e,t)=>e+(Number(t.visits?.total_visits)||0),0):0,b={className:"w-5 h-5 text-brand-500",strokeWidth:1.5},v=[{label:(0,C.__)("Total Visitors","cartflows"),tooltip:(0,C.__)("Sum of all step views in this funnel.","cartflows"),value:y,icon:(0,i.createElement)(cQ,b)},{label:(0,C.__)("Total Orders","cartflows"),tooltip:(0,C.__)("Total number of orders.","cartflows"),value:null!==(t=g?.order_count)&&void 0!==t?t:0,icon:(0,i.createElement)(GB,b)},{label:(0,C.__)("Total Revenue","cartflows"),tooltip:(0,C.__)("Grand total of all orders.","cartflows"),value:g?.gross_sale?Zm(g.gross_sale.toString()):0,icon:(0,i.createElement)(uQ,b)},{label:(0,C.__)("Average Order Value","cartflows"),tooltip:(0,C.__)("Average total of every order.","cartflows"),value:g?.avg_order_value?Zm(g.avg_order_value.toString()):0,icon:(0,i.createElement)(dQ,b)},{label:(0,C.__)("Bump Offer Revenue","cartflows"),tooltip:(0,C.__)("Grand total of all order bumps.","cartflows"),value:g?.bump_offer?Zm(g.bump_offer.toString()):0,icon:(0,i.createElement)(fQ,b)},{label:(0,C.__)("Offers Revenue","cartflows"),tooltip:(0,C.__)("Total upsell/downsell revenue.","cartflows"),value:g?.upsell_revenue?Zm(g.upsell_revenue.toString()):0,icon:(0,i.createElement)(GB,b)},{label:(0,C.__)("Revenue Per Visit","cartflows"),tooltip:(0,C.__)("Revenue per visit.","cartflows"),value:g?.revenue_per_visit?Zm(g.revenue_per_visit.toString()):0,icon:(0,i.createElement)(pQ,b)},{label:(0,C.__)("RPUV","cartflows"),tooltip:(0,C.__)("Revenue per unique visitor.","cartflows"),value:g?.revenue_per_unique_visits?Zm(g.revenue_per_unique_visits.toString()):0,icon:(0,i.createElement)(mQ,b)}];return(0,i.createElement)("div",{className:"wcf-steps-analytics bg-background-primary p-6 shadow-sm border border-border-subtle border-solid rounded-lg"},(0,i.createElement)(zm,{containerType:"flex",justify:"between",align:"center",gap:"none",className:"mt-0 mb-6 cursor-pointer"},(0,i.createElement)(zm,{containerType:"flex",align:"center",gap:"sm"},(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Back to Steps","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",onClick:e,className:"text-text-secondary hover:text-text-primary"},(0,i.createElement)(hQ,{className:"w-5 h-5 !cursor-pointer",strokeWidth:2}))),(0,i.createElement)(jI,{tag:"h3",size:"sm",title:(0,C.__)("Analytics","cartflows")})),(0,i.createElement)(R_,{value:{startDate:u,endDate:l},onChangeCB:({startDate:e,endDate:t})=>{d(e),c(t),((e,t)=>{if(!e||!t)return;p(!0);const n=new window.FormData;n.append("action","cartflows_pro_set_visit_data"),n.append("security",cartflows_admin.set_visit_data_nonce),n.append("flow_id",r),n.append("date_from",fm(e)),n.append("date_to",fm(t)),qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>{p(!1),o({type:"SET_FLOW_ANALYTICS",flow_analytics:e})})})(e,t)},fieldParentWrapperClass:""})),(0,i.createElement)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6"+(f?" opacity-50 pointer-events-none":"")},v.map((e,t)=>(0,i.createElement)(wQ,{key:t,label:e.label,tooltip:e.tooltip,value:e.value,icon:e.icon}))),(0,i.createElement)("div",{className:"bg-background-primary border border-border-subtle rounded-lg overflow-hidden mb-6"},(0,i.createElement)(nQ,null,(0,i.createElement)(nQ.Head,null,(0,i.createElement)(nQ.HeadCell,null,(0,C.__)("Step","cartflows")),(0,i.createElement)(nQ.HeadCell,null,(0,C.__)("Total Visits","cartflows")),(0,i.createElement)(nQ.HeadCell,null,(0,C.__)("Unique Visits","cartflows")),(0,i.createElement)(nQ.HeadCell,null,(0,C.__)("Conversions","cartflows")),(0,i.createElement)(nQ.HeadCell,null,(0,C.__)("Conversion rate","cartflows")),(0,i.createElement)(nQ.HeadCell,null,(0,C.__)("Revenue","cartflows"))),(0,i.createElement)(nQ.Body,null,w&&w.length>0?w.map((e,t)=>{var n,r,o,a,s;const l=e.visits,c="thankyou"===e.type,u=["thankyou","optin","landing"].includes(e.type),d=c?"-":null!==(n=l?.conversions)&&void 0!==n?n:0,f=c?"-":`${null!==(r=l?.conversion_rate)&&void 0!==r?r:0}%`;let p="-";return!u&&l?.revenue&&(p=Zm(l.revenue.toString())),(0,i.createElement)(nQ.Row,{key:t},(0,i.createElement)(nQ.Cell,null,(0,i.createElement)(Vm,{as:"span",size:14,weight:500,color:"primary"},null!==(o=l?.title)&&void 0!==o?o:"")),(0,i.createElement)(nQ.Cell,null,null!==(a=l?.total_visits)&&void 0!==a?a:0),(0,i.createElement)(nQ.Cell,null,null!==(s=l?.unique_visits)&&void 0!==s?s:0),(0,i.createElement)(nQ.Cell,null,d),(0,i.createElement)(nQ.Cell,null,f),(0,i.createElement)(nQ.Cell,null,p))}):(0,i.createElement)(nQ.Row,null,(0,i.createElement)(nQ.Cell,null,(0,i.createElement)(Vm,{as:"span",size:14,color:"secondary"},(0,C.__)("No analytics data available yet.","cartflows"))),(0,i.createElement)(nQ.Cell,null,"-"),(0,i.createElement)(nQ.Cell,null,"-"),(0,i.createElement)(nQ.Cell,null,"-"),(0,i.createElement)(nQ.Cell,null,"-"),(0,i.createElement)(nQ.Cell,null,"-"))))),(0,i.createElement)(zm,{containerType:"flex",justify:"between",align:"center",gap:"none"},(0,i.createElement)(Vm,{as:"p",size:13,color:"secondary",className:"m-0"},(0,i.createElement)(Vm,{as:"span",size:13,weight:500,className:"text-brand-500"},(0,C.__)("Note:","cartflows"))," ",(0,C.__)("The orders which are placed by the admins are not considered while calculating the analytics.","cartflows")),(0,i.createElement)(Ro,{variant:"outline",size:"sm",onClick:()=>{h(!0);const e=new window.FormData;e.append("action","cartflows_pro_reset_flow_analytics"),e.append("security",cartflows_admin.reset_flow_analytics_nonce),e.append("flow_id",r),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{h(!1),window.location.reload()})},loading:m,disabled:m,icon:(0,i.createElement)(gQ,{className:"w-4 h-4"+(m?" animate-spin":""),strokeWidth:2}),iconPosition:"left"},m?(0,C.__)("Resetting","cartflows"):(0,C.__)("Reset Analytics","cartflows"))))},bQ=To("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),vQ=function(){const[{flow_analytics:e}]=Yp(),[{license_status:t}]=f();if(e)return null;let n,r,o,a;return"function"==typeof wcfCartflowsPro&&wcfCartflowsPro()&&"Activated"!==t?(n=(0,C.__)("Activate your license to unlock analytics","cartflows"),r=(0,C.__)("Your CartFlows Pro license isn't active yet. Activate it to see views, conversions, and revenue per step.","cartflows"),o=(0,C.__)("Activate License","cartflows"),a=cartflows_admin?.license_popup_url):(n=(0,C.__)("See Every Step's Performance:","cartflows"),r=(0,C.__)("Know exactly which steps win and which lose. Upgrade to Pro and track views, conversions, and revenue per step.","cartflows"),o=(0,C.__)("Upgrade to Pro","cartflows"),a=getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans)),(0,i.createElement)("div",{className:"wcf-pro-nudge--notice flex justify-center mb-5"},(0,i.createElement)("div",{className:"wcf-pro-nudge--notice-columns flex items-center justify-between w-full border border-brand-200 border-solid p-3 rounded-lg bg-brand-25 gap-3"},(0,i.createElement)("div",{className:"wcf-pro-nudge--notice-column-left flex items-center gap-3 min-w-0"},(0,i.createElement)("div",{className:"flex p-1 border border-solid border-brand-200 rounded-md"},(0,i.createElement)(bQ,{className:"text-brand-500 h-4 w-4"})),(0,i.createElement)("div",{className:"flex min-w-0"},(0,i.createElement)("span",{className:"text-text-primary text-sm font-semibold mr-0.5"},n),(0,i.createElement)(Vm,{as:"span",size:14,color:"secondary",className:"truncate"},r),(0,i.createElement)(Ro,{tag:"a",href:a,target:"_blank",rel:"noreferrer",variant:"link",size:"sm",icon:(0,i.createElement)(ep,null),iconPosition:"right",className:"no-underline !text-sm focus:outline-none focus:ring-0"},o)))))},xQ=function(e){const{type:t}=e,[{flow_id:n,title:r,steps:o,global_checkout:a,status:l},c]=Yp(),[u,d]=(0,s.useState)(!1),f=(0,C.__)("Save","cartflows"),[p,m]=(0,s.useState)({saveBtnString:f,saveBtnProcess:!1}),{saveBtnString:h,saveBtnProcess:g}=p,w=!!Number.isInteger(a),y=Number.isInteger(a)?"disable":"enable",[b,v]=((0,C.__)("Disable Store Checkout","cartflows"),(0,C.__)("Enable Store Checkout","cartflows"),(0,s.useState)(l||"draft")),[x,N]=(0,s.useState)(w),[E,_]=(0,s.useState)(!1),[M,I]=(0,s.useState)(y),S=(0,s.createRef)(),k=Oh();let D="";if("storeCheckout"===t)for(let e=0;e<o.length;e++)if("checkout"===o[e].type){D=o[e].id;break}(0,s.useEffect)(()=>{v(l||"draft")},[l]);const j=function(e){e.preventDefault(),d(!0)},A=function(e){e.preventDefault(),m({saveBtnString:(0,C.__)("Saving…","cartflows"),saveBtnProcess:"processing"});const t=S.current.value,r=new window.FormData;r.append("action","cartflows_update_flow_title"),r.append("security",cartflows_admin.update_flow_title_nonce),r.append("flow_id",n),r.append("new_flow_title",t),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{c({type:"SET_FLOW_TITLE",title:t}),m({saveBtnString:(0,C.__)("Saved","cartflows"),saveBtnProcess:"saved"}),hm.success((0,C.__)("Funnel title updated successfully!","cartflows")),setTimeout(()=>{m({saveBtnString:f,saveBtnProcess:!1}),d(!1)},3e3)})},T=function(e){e.preventDefault(),d(!1)};if(!1===r)return(0,i.createElement)("div",{className:"wcf-edit-flow__title-wrap animate-pulse"},(0,i.createElement)("div",{className:"wcf-flows-header--title wcf-step__title--editable flex gap-2.5 items-center"},(0,i.createElement)("span",{className:"h-3 w-full bg-background-secondary rounded-md px-10 block"})));const L=[{value:"draft",label:(0,C.__)("Draft","cartflows")},{value:"publish",label:(0,C.__)("Publish","cartflows")}];return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-edit-flow__title-wrap w-full"},(0,i.createElement)("div",{className:"wcf-flows-header--title wcf-step__title--editable flex gap-2.5 items-center"},function(){let e=r;""===r&&(e=(0,C.__)("(no title)","cartflows"));let t=um(e,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),n=(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Edit Title","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"ghost",size:"md",className:"wcf-flows-header__title--edit",onClick:j,icon:(0,i.createElement)(nk,{className:"w-5.5 h-5.5 stroke-1","aria-hidden":"true"})}));if(u){t=(0,i.createElement)(tg,{ref:S,id:"new-flow-title",defaultValue:r,autoComplete:"off",size:"sm",className:"wcf-flow-title-input [&>input]:!py-1.5"});let e=null;"processing"===g?e=(0,i.createElement)(Kg,{variant:"primary",size:"sm"}):"saved"===g&&(e=(0,i.createElement)(hw,{className:"w-4 h-4 stroke-2"})),n=(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"primary",size:"sm",className:"!py-1.5",onClick:A,disabled:"processing"===g,icon:e,iconPosition:"left"},h),(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"!py-1.5",onClick:T},(0,C.__)("Cancel","cartflows")))}return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"wcf-flows-header__title--text text-text-primary text-lg sm:text-2xl font-semibold",title:e},t),(0,i.createElement)("span",{className:"wcf-flows-header__title--buttons flex gap-3"},n))}(),"flows"===t&&!u&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"divider h-5 w-px bg-background-secondary"}),(0,i.createElement)("div",{className:"wcf-status-toggle inline-flex items-center border border-solid border-border-subtle p-1 rounded-3xl"},L.map(e=>(0,i.createElement)("button",{key:`status-${e.value}`,type:"button",className:"wcf-status-toggle__btn inline-flex items-center gap-1 px-3 py-1 text-sm cursor-pointer border-0 "+(e.value===b?"font-medium text-text-primary bg-background-primary rounded-3xl shadow-sm":"font-normal text-text-secondary bg-transparent hover:text-text-primary"),onClick:t=>{e.value!==b&&async function(e){e.preventDefault();let t=!1,r="";switch(b){case"draft":case"private":t=await k({title:"Publish Funnel",description:(0,C.__)("Do you really want to publish this funnel?","cartflows"),actionBtnText:(0,C.__)("Publish","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")}),r="publish",window.wcfAction="restoreFlow";break;case"publish":t=await k({title:(0,C.__)("Draft Funnel","cartflows"),description:(0,C.__)("Do you really want to draft this funnel?","cartflows"),actionBtnText:(0,C.__)("Switch to Draft","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")}),r="draft",window.wcfAction="draftFlow"}if(!t)return;const o=new window.FormData;o.append("action","cartflows_update_status"),o.append("security",cartflows_admin.update_status_nonce),o.append("flow_id",n),o.append("new_status",r),(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(e=>{e.success&&(v(r),hm.success("publish"===r?(0,C.__)("Funnel published!","cartflows"):(0,C.__)("Funnel moved to draft!","cartflows")))}))}(t)}},e.value===b&&(0,i.createElement)(hw,{className:"w-4 h-4 stroke-2"}),e.label)))),"storeCheckout"===t&&!u&&(0,i.createElement)("div",{className:"wcf-store-checkout_status--container flex items-center gap-4"},(0,i.createElement)("span",{className:"divider w-px h-5 bg-background-secondary"}),(0,i.createElement)(Pg,{value:x,onChange:()=>(()=>{const e=new window.FormData;_(!0),e.append("action","cartflows_update_store_checkout_status"),e.append("security",cartflows_admin.update_store_checkout_status_nonce),e.append("checkout_id",D),e.append("enable_store_checkout",!x),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&(N(!x),_(!1),c({type:"SET_GLOBAL_CHECKOUT",global_checkout:e.data.checkout_id}),"enable"===M?(I("disable"),hm.success((0,C.__)("Store Checkout enabled!","cartflows"))):(I("enable"),hm.success((0,C.__)("Store Checkout disabled!","cartflows"))))})})(),size:"sm",label:{heading:(0,C.__)("Enable Store Checkout","cartflows")}}),E&&(0,i.createElement)(Kg,{variant:"primary",size:"sm"})))))};function NQ({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"}))}const EQ=s.forwardRef(NQ);function _Q({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z"}))}const MQ=s.forwardRef(_Q);function IQ({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"}))}const SQ=s.forwardRef(IQ),kQ=function(){return(0,i.createElement)("div",{className:"wcf-flow-settings-view flex gap-6 items-start w-full"},(0,i.createElement)("div",{className:"wcf-flow-settings--sidebar h-full min-h-screen flex flex-col w-auto sticky top-0 lg:top-4 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-16 lg:after:w-[254px] after:h-screen after:bg-background-primary after:-z-10"},(0,i.createElement)("div",{className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow bg-background-primary border-0 border-r border-solid border-border-subtle"},(0,i.createElement)("div",{className:"flex flex-col gap-0.5 pt-2"},["w-28","w-24","w-20"].map((e,t)=>(0,i.createElement)("div",{key:t,className:"flex items-center gap-2.5 px-3 py-2 lg:justify-start justify-center"},(0,i.createElement)(bI,{className:"w-5 h-5 rounded"}),(0,i.createElement)(bI,{className:`h-3 ${e} lg:block hidden`})))))),(0,i.createElement)("div",{className:"min-w-0 max-w-3xl p-8 mx-auto w-full flex flex-col gap-3"},(0,i.createElement)("div",{className:"flex items-center gap-2 py-1"},(0,i.createElement)(bI,{className:"w-14 h-2.5"}),(0,i.createElement)(bI,{className:"w-2 h-2.5"}),(0,i.createElement)(bI,{className:"w-20 h-2.5"}),(0,i.createElement)(bI,{className:"w-2 h-2.5"}),(0,i.createElement)(bI,{className:"w-28 h-2.5"})),(0,i.createElement)("div",{className:"flex justify-between items-center h-10"},(0,i.createElement)("div",{className:"flex items-center gap-2.5"},(0,i.createElement)(bI,{className:"w-5 h-5 rounded"}),(0,i.createElement)(bI,{className:"w-40 h-5"})),(0,i.createElement)(bI,{className:"w-28 h-9 rounded-lg"})),(0,i.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm overflow-hidden mb-8 p-6 flex flex-col gap-5"},(0,i.createElement)(bI,{className:"w-32 h-4"}),["w-28","w-36","w-24","w-32"].map((e,t)=>(0,i.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,i.createElement)(bI,{className:`${e} h-3.5`}),(0,i.createElement)(bI,{className:"w-full h-10 rounded-md"}))))))},DQ=function({menuItems:e,currentTab:t,onTabChange:n}){return(0,i.createElement)("div",{className:"wcf-flow-settings--sidebar h-full min-h-screen flex flex-col w-auto sticky top-0 lg:top-4 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-16 lg:after:w-[254px] after:h-screen after:bg-background-primary after:-z-10"},(0,i.createElement)(FS,{borderOn:!0,className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow"},(0,i.createElement)(FS.Body,{className:"!p-0"},(0,i.createElement)(FS.Item,null,(0,i.createElement)(fp,{className:"w-full p-0 bg-transparent",size:"md"},(0,i.createElement)("ul",{className:"m-0 p-0 list-none flex flex-col"},e.map(e=>{const r=e.icon;return(0,i.createElement)(fp.Item,{key:e.slug,active:t===e.slug,onClick:()=>n(e.slug),className:"lg:justify-start justify-center hover:!bg-brand-25 hover:[&>svg]:!text-brand-600 "+(t===e.slug?"!bg-brand-25 !text-text-primary [&>svg]:!text-brand-600":"")},(0,i.createElement)(r,{className:"w-5 h-5"}),(0,i.createElement)("span",{className:"flex-1 lg:block hidden"},e.name))})))))))},CQ=To("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),jQ={sm:{text:"text-sm",separator:"text-sm",separatorIconSize:16},md:{text:"text-base",separator:"text-base",separatorIconSize:18}},AQ=(0,s.createContext)({sizes:jQ.sm}),TQ=({children:e,size:t="sm"})=>{const n=jQ[t]||jQ.sm;return(0,j.jsx)(AQ.Provider,{value:{sizes:n},children:(0,j.jsx)("nav",{className:"flex m-0","aria-label":"Breadcrumb",children:(0,j.jsx)("ul",{className:"m-0 inline-flex items-center space-x-1 md:space-x-1",children:e})})})};TQ.displayName="Breadcrumb";const LQ=({children:e})=>(0,j.jsx)(j.Fragment,{children:e});LQ.displayName="Breadcrumb.List";const OQ=({children:e})=>(0,j.jsx)("li",{className:"m-0 inline-flex items-center gap-2",children:e});OQ.displayName="Breadcrumb.Item";const zQ=({href:e,children:t,className:n,as:r="a",...o})=>{const{sizes:a}=(0,s.useContext)(AQ);return(0,j.jsx)(r,{href:e,className:Se(a.text,"px-1 font-medium no-underline text-text-tertiary hover:text-text-primary hover:underline","focus:outline-none focus:ring-1 focus:ring-border-interactive focus:border-border-interactive focus:rounded-sm","transition-all duration-200",n),...o,children:t})};zQ.displayName="Breadcrumb.Link";const PQ=({type:e})=>{const{sizes:t}=(0,s.useContext)(AQ),n={slash:(0,j.jsx)("span",{className:Se("mx-1",t.separator),children:"/"}),arrow:(0,j.jsx)(Ex,{size:t.separatorIconSize})};return(0,j.jsx)("li",{role:"separator",className:"flex items-center text-text-tertiary mx-2 p-0 list-none","aria-hidden":"true",children:n[e]||n.arrow})};PQ.displayName="Breadcrumb.Separator";const RQ=()=>{const{sizes:e}=(0,s.useContext)(AQ);return(0,j.jsx)(CQ,{className:"mt-[2px] cursor-pointer text-text-tertiary hover:text-text-primary",size:e.separatorIconSize+4})};RQ.displayName="Breadcrumb.Ellipsis";const UQ=({children:e})=>{const{sizes:t}=(0,s.useContext)(AQ);return(0,j.jsx)("span",{className:Se(t.text,"font-medium text-text-primary"),children:e})};UQ.displayName="Breadcrumb.Page",TQ.List=LQ,TQ.Item=OQ,TQ.Link=zQ,TQ.Separator=PQ,TQ.Ellipsis=RQ,TQ.Page=UQ;const BQ=function({sectionObject:e,flowType:t,buttonRef:n,backUrl:r}){const[{title:o}]=Yp(),a="?page=cartflows&path="+("storeCheckout"===t?"store-checkout":"flows");return(0,i.createElement)(zm,{containerType:"flex",direction:"column",gap:"sm",className:"wcf-flow-settings--content min-w-0 max-w-3xl p-8 mx-auto w-full"},(0,i.createElement)(TQ,{size:"sm"},(0,i.createElement)(TQ.Item,null,(0,i.createElement)(TQ.Link,{href:`${cartflows_admin.admin_base_url}admin.php${a}`,className:"font-normal"},(0,C.__)("Funnels","cartflows"))),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)($F,{className:"w-3 h-3 stroke-2"})),(0,i.createElement)(TQ.Item,null,(0,i.createElement)(TQ.Link,{as:S,to:{pathname:"admin.php",search:r},className:"font-normal"},o||(0,C.__)("(no title)","cartflows"))),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)($F,{className:"w-3 h-3 stroke-2"})),(0,i.createElement)(TQ.Item,null,(0,i.createElement)(TQ.Page,null,(0,C.__)("Funnel Settings","cartflows")))),(0,i.createElement)("div",{className:"flex justify-between items-center h-10"},(0,i.createElement)("div",{className:"flex items-center gap-2.5"},(0,i.createElement)(S,{to:{pathname:"admin.php",search:r},className:"text-icon-secondary hover:text-icon-primary no-underline shrink-0 transition-colors","aria-label":(0,C.__)("Back to funnel","cartflows")},(0,i.createElement)(YS,{className:"w-5 h-5 flex stroke-1"})),(0,i.createElement)(xQ,null)),(0,i.createElement)(bw,{id:"wcf-save-flow-settings",ref:n})),(0,i.createElement)(zm,{containerType:"flex",direction:"column",className:"!gap-5 bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm mb-8 p-6"},e?.title&&(0,i.createElement)(jI,{title:e.title,tag:"h5",size:"xs",className:"text-text-primary"}),(0,i.createElement)(ZS,{section:e})))},FQ={instant_layout:EQ,funnel_advanced_options:MQ,general:SQ},QQ=function(e){var t;const[{flow_id:n,flow_settings:r,flow_type:o}]=Yp(),[,a]=f(),l=(0,s.useRef)(null),c=Oh(),[u,d]=(0,s.useState)(null),p=!r||void 0===r.settings,m=(0,s.useMemo)(()=>r?.settings?Object.entries(r.settings).sort(([,e],[,t])=>e.priority-t.priority).map(([e,t])=>({id:e,name:t.title,slug:t.slug,icon:FQ[t.slug]||SQ})):[],[r]),h=null!==(t=null!=u?u:m[0]?.slug)&&void 0!==t?t:"",g=r?.settings?Object.entries(r.settings).find(([,e])=>e.slug===h):null,w=g?g[1]:null,y="storeCheckout"===o?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${n}`;return p?(0,i.createElement)(kQ,null):(0,i.createElement)("form",{className:"wcf-flow-settings-view flex gap-6 items-start w-full",onSubmit:t=>{t.preventDefault();const r=new window.FormData(t.target);r.append("action","cartflows_save_flow_meta_settings"),r.append("security",cartflows_admin.save_flow_meta_settings_nonce),r.append("flow_id",n),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{a({status:"SAVED"}),e.renderCb()})}},(0,i.createElement)(DQ,{menuItems:m,currentTab:h,onTabChange:async e=>{e!==h&&(await(async()=>!!window.wcfUnsavedChanges&&await c({title:"Save Changes",description:"You have made changes. Do you want to save the changes?",actionBtnText:"Yes",cancelBtnText:"No"}))()&&l.current?.click(),d(e),window.wcfUnsavedChanges=!1)}}),(0,i.createElement)(BQ,{currentTab:h,sectionObject:w,flowType:o,buttonRef:l,backUrl:y}))},VQ=function(){var e;const[{flow_id:t,steps:n,emptySteps:r,flow_type:o,is_flow_instant_checkout:a,flow_link:l,options:c,title:u},d]=Yp(),p=new URLSearchParams((0,h.useLocation)()?.search),m=null!==(e=p.get("step_id"))&&void 0!==e?e:"",g="true"===p.get("flow_settings"),w=Oh(),[{canvasMode:b},v]=f(),[x,N]=(0,s.useState)(!1),[E,_]=(0,s.useState)(!1),[M,I]=(0,s.useState)("no"),[k,D]=(0,s.useState)(!1),[j,A]=(0,s.useState)("hide"),T=(0,s.useRef)(n);(0,s.useEffect)(()=>{T.current=n},[n]);const[L,O]=(0,s.useState)("yes"!==cartflows_admin?.instant_checkout_notice_status);let z=!0;n.length>0&&(z=!1);const P=function(){N(!x)};(0,s.useEffect)(()=>{let e=!0;return(async()=>{qf()({path:`/cartflows/v1/admin/flow-data/${t}`}).then(t=>{e&&d({type:"SET_FLOW_DATA",data:t})})})(),()=>{e=!1}},[x]);const R=()=>{const e=t,n=[];T.current.map(e=>(n.push(e.id),""));const r=new window.FormData;r.append("action","cartflows_reorder_flow_steps"),r.append("security",cartflows_admin.reorder_flow_steps_nonce),r.append("step_ids",n),r.append("post_id",e),qf()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>{d({type:"SET_STEPS",steps:e.steps}),hm.success((0,C.__)("Steps reordered successfully!","cartflows"))})};(0,s.useEffect)(()=>{I(c&&c["wcf-testing"]?c["wcf-testing"]:"no")},[c]),(0,s.useEffect)(()=>{"yes"===a&&O(!1)},[a]);let U=!1,B=!1;const F=[],Q=[];if(m)return(0,i.createElement)(zm,{align:"start",className:"wcf-step-settings-view--wrapper -m-8",containerType:"flex"},(0,i.createElement)(sk,{renderCb:P}));if(g)return(0,i.createElement)(zm,{align:"start",className:"wcf-flow-settings-view--wrapper -m-8",containerType:"flex"},(0,i.createElement)(QQ,{renderCb:P}));const V="storeCheckout"===o,Y=V?"?page=cartflows&path=store-checkout":"?page=cartflows&path=flows",Z=V?(0,C.__)("Store Checkout","cartflows"):(0,C.__)("Funnels","cartflows");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-steps-page-wrapper border-t border-border-subtle -mt-px"},(0,i.createElement)("div",{className:"wcf-page-header mb-4"},(0,i.createElement)(TQ,{size:"sm"},(0,i.createElement)(TQ.Item,null,(0,i.createElement)(TQ.Link,{href:`${cartflows_admin.admin_base_url}admin.php${Y}`,className:"font-normal"},Z)),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)($F,{className:"w-3 h-3 stroke-2"})),E?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(TQ.Item,null,(0,i.createElement)(TQ.Link,{as:"button",type:"button",onClick:()=>_(!1),className:"font-normal cursor-pointer bg-transparent border-0 p-0"},u||(0,C.__)("(no title)","cartflows"))),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)($F,{className:"w-3 h-3 stroke-2"})),(0,i.createElement)(TQ.Item,null,(0,i.createElement)(TQ.Page,null,(0,C.__)("Analytics","cartflows")))):(0,i.createElement)(TQ.Item,null,(0,i.createElement)(TQ.Page,null,u||(0,C.__)("(no title)","cartflows")))),(0,i.createElement)("div",{className:"wcf-flow-header flex gap-3 xl:gap-0 justify-between flex-col xl:flex-row w-full mt-4"},(0,i.createElement)(xQ,{type:o}),(0,i.createElement)("div",{className:"wcf-flow-header--actions w-full flex gap-3 items-center xl:justify-end"},(0,i.createElement)("div",{className:"wcf-flow-header--action-canvas-mode flex items-center gap-2"},(0,i.createElement)("span",{className:"text-sm font-medium text-text-secondary"},(0,C.__)("Canvas Mode","cartflows")),(0,i.createElement)(Pg,{name:"wcf-enable-canvas-mode",size:"sm",value:b,onChange:e=>{e&&E&&_(!1),v({status:"UPDATE_CANVAS_MODE",canvasMode:e}),e?localStorage.setItem("wcf_canvas_mode_enabled","true"):localStorage.removeItem("wcf_canvas_mode_enabled")}})),(0,i.createElement)("div",{className:"wcf-flow-header--action-mode-select flex items-center gap-2 w-44"},k&&(0,i.createElement)(Pf,{className:"w-4 h-4 stroke-2 animate-spin text-brand-500"}),(0,i.createElement)(lw,{size:"md",value:M,onChange:e=>(e=>{D(!0);const n=new window.FormData;n.append("action","cartflows_save_flow_meta_settings"),n.append("security",cartflows_admin.save_flow_meta_settings_nonce),n.append("flow_id",t),n.append("wcf-testing",e),qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{d({type:"UPDATE_OPTIONS",options:{...c,"wcf-testing":e}}),D(!1),window.onbeforeunload=null,hm.success("yes"===e?(0,C.__)("Sandbox mode enabled!","cartflows"):(0,C.__)("Sandbox mode disabled!","cartflows"))}).catch(()=>{D(!1),hm.error((0,C.__)("Failed to update sandbox mode.","cartflows"))})})(e)},(0,i.createElement)(lw.Button,{placeholder:(0,C.__)("Select Mode","cartflows"),className:"gap-1",render:()=>"yes"===M?(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(vg,{className:"h-4 w-4 text-amber-500"}),(0,C.__)("Sandbox Mode","cartflows")):(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(Uh,{className:"h-4 w-4 text-support-success"}),(0,C.__)("Live Mode","cartflows"))}),(0,i.createElement)(lw.Options,null,(0,i.createElement)(lw.Option,{value:"no"},(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(Uh,{className:"h-4 w-4 text-support-success"}),(0,C.__)("Live Mode","cartflows"))),(0,i.createElement)(lw.Option,{value:"yes"},(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(vg,{className:"h-4 w-4 text-amber-500"}),(0,C.__)("Sandbox Mode","cartflows")))))),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Funnel Settings","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"p-2.5",tag:S,to:{pathname:"admin.php",search:`?page=cartflows&path=${"storeCheckout"===o?"store-checkout":"flows"}&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`},icon:(0,i.createElement)($h,null)})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,C.__)("Export Funnel","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"p-2.5",onClick:e=>{e.preventDefault();const n=new window.FormData;n.append("action","cartflows_export_flow"),n.append("security",cartflows_admin.export_flow_nonce),n.append("flow_id",t),window.wcfAction="exportFlow",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>{if(e.success){const n=e.data.flow_name||`flow-${t}.json`,r=JSON.stringify(e.data.flows),o=new Blob([r],{type:"application/json"});if(document.documentMode)window.navigator.msSaveOrOpenBlob(o,n);else{const e=document.createElement("a");e.href=URL.createObjectURL(o),e.download=n,e.click()}hm.success((0,C.__)("Funnel exported successfully!","cartflows"))}else hm.error((0,C.__)("Failed to export funnel.","cartflows"))}).catch(()=>{hm.error((0,C.__)("Failed to export funnel.","cartflows"))}))},icon:(0,i.createElement)(ZF,null)})),"storeCheckout"===o&&(0,i.createElement)(Wo,{arrow:!0,content:(0,C.__)("Delete Store Checkout","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"p-2.5",onClick:async e=>{if(e.preventDefault(),!await w({title:(0,C.__)("Delete Store Checkout","cartflows"),description:(0,C.sprintf)(/* translators: %s new line break */ /* translators: %s new line break */
38 -(0,C.__)("Do you really want to delete store checkout?%1$1sNOTE: This action cannot be reversed.","cartflows"),"\r\n"),actionBtnText:(0,C.__)("Delete","cartflows"),cancelBtnText:(0,C.__)("Cancel","cartflows")}))return;const n=new window.FormData;n.append("action","cartflows_delete_flow"),n.append("security",cartflows_admin.delete_flow_nonce),n.append("flow_id",t),window.wcfAction="deleteFlow",(0,Xh.$h)(qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{hm.success((0,C.__)("Store checkout deleted successfully!","cartflows")),d({type:"SET_FLOWS",flows:null}),window.location.replace(cartflows_admin.admin_base_url+"admin.php?page=cartflows&path=store-checkout")}))},icon:(0,i.createElement)($m,null)}))))),E?(0,i.createElement)(yQ,{onBack:()=>_(!1)}):(0,i.createElement)(i.Fragment,null,L&&(0,i.createElement)("div",{className:"wcf-instant-checkout--notice flex justify-center mb-5"},(0,i.createElement)("div",{className:"wcf-instant-checkout--notice-columns flex items-center justify-between w-full border border-brand-200 p-3 rounded-lg bg-background-primary"},(0,i.createElement)("div",{className:"wcf-instant-checkout--notice-column-left flex items-center gap-3"},(0,i.createElement)(NI,{className:"h-5 w-5 text-brand-500 hover:text-brand-600","aria-hidden":"true"}),(0,i.createElement)("span",{className:"text-text-primary text-sm font-medium"},(0,C.__)("Create a distraction free, high-converting checkout experience without needing a page builder.","cartflows"))),(0,i.createElement)("div",{className:"wcf-instant-checkout--notice-column-right flex items-center gap-4"},(0,i.createElement)(S,{to:{pathname:"admin.php",search:"storeCheckout"===o?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`},className:"text-brand-600 text-xs font-medium cursor-pointer no-underline"},(0,C.__)("Enable Instant Layout","cartflows")),(0,i.createElement)(ww,{className:"h-5 w-5 hover:text-brand-600 cursor-pointer","aria-hidden":"true",onClick:e=>{e.preventDefault(),(()=>{const e=new window.FormData;e.append("action","cartflows_hide_instant_checkout_notice"),e.append("security",cartflows_admin.hide_instant_checkout_notice_nonce),e.append("flow_id",t),O(!1),qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e?.status&&O(!1)})})()}})))),(0,i.createElement)("div",{className:"wcf-steps-header flex justify-center mb-5 "+(b?"hidden":"")},(0,i.createElement)("div",{className:"flex justify-between items-center w-full gap-2"},(0,i.createElement)(jI,{tag:"h3",size:"sm",title:(0,C.__)("Funnel Steps","cartflows")}),(0,i.createElement)("div",{className:"wcf-steps-header--actions flex items-center gap-3"},(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:()=>_(!0),icon:(0,i.createElement)(GF,{className:"!w-4 !h-4 stroke-1"}),className:"text-sm font-normal",iconPosition:"left"},(0,C.__)("View Analytics","cartflows")),(0,i.createElement)(Ro,{variant:"outline",size:"md",tag:"a",href:l,target:"_blank",rel:"noreferrer",icon:(0,i.createElement)(Zh,{className:"!w-4 !h-4 stroke-1"}),className:"text-sm font-normal no-underline",iconPosition:"left"},(0,C.__)("View Funnel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"md",tag:S,to:{pathname:"admin.php",search:"storeCheckout"===o?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library`},className:"text-sm font-normal no-underline",icon:(0,i.createElement)(yg,{className:"!w-4 !h-4 stroke-2"}),iconPosition:"left"},(0,C.__)("Add New Step","cartflows"))))),b?(0,i.createElement)(VF,{renderCb:P}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(vQ,null),(0,i.createElement)("div",{className:"wcf-list-steps flex justify-center mb-4"},r&&function(){if(0===n.length)return(0,i.createElement)("div",{className:"wcf-analytics-no-step-notice text-center mb-8 bg-background-primary p-20 rounded-xl w-full"},(0,i.createElement)("svg",{className:"mx-auto h-12 w-12 text-text-secondary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},(0,i.createElement)("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})),(0,i.createElement)("h3",{className:"mt-2 text-sm font-semibold text-text-primary"},(0,C.__)("No Steps Added.","cartflows")),(0,i.createElement)("p",{className:"mt-1 text-sm text-text-secondary"},(0,C.__)("Seems like there are no steps created or added in this flow","cartflows")),(0,i.createElement)("div",{className:"mt-6"},(0,i.createElement)(Ro,{variant:"primary",size:"sm",tag:S,to:{pathname:"admin.php",search:"storeCheckout"===o?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library`},icon:(0,i.createElement)(yg,{className:"w-4 h-4 stroke-2"}),iconPosition:"left"},(0,C.__)("Add New Step","cartflows"))))}(),!r&&z&&(0,i.createElement)(vI,null),!z&&(0,i.createElement)("div",{className:"w-full"},"storeCheckout"===o?(n.length>0&&n.map((e,t)=>{if("checkout"===e.type){if(!cartflows_admin.old_global_checkout)return U=t,"";if(e.id===parseInt(cartflows_admin.old_global_checkout))return U=t,"";F.push(e)}else"landing"===e.type?F.push(e):Q.push(e);return""}),Q.length>0&&(B=!0),(0,i.createElement)(i.Fragment,null,!r&&!z&&(0,i.createElement)(i.Fragment,null,F.map(e=>(0,i.createElement)(yI,(0,y.A)({},e,{key:e.id,invalid:!0,setShowAbtestUpgradePopup:A}))),(0,i.createElement)(yI,(0,y.A)({},n[U],{key:n[U].id,setShowAbtestUpgradePopup:A})),B&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(KF,{flowId:t,flowType:o}),(0,i.createElement)(Zp.ReactSortable,{list:Q,setList:e=>{const t=T.current.filter(e=>"checkout"===e.type||"landing"===e.type);T.current=[...t,...e],d({type:"SET_STORE_STEPS",steps:e})},onEnd:R,swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-step-wrap",filter:".wcf-step__col-actions, .wcf-step__title-text, .wcf-ab-test-popup-content, .wcf-steps-action-buttons, .wcf-archived-wrapper, .wcf-add-step-connector",preventOnFilter:!1},Q.map((e,n)=>"checkout"!==e.type?(0,i.createElement)("div",{key:e.id},(0,i.createElement)(yI,(0,y.A)({},e,{setShowAbtestUpgradePopup:A})),n<Q.length-1&&(0,i.createElement)(KF,{flowId:t,flowType:o})):(0,i.createElement)(i.Fragment,null))))))):(0,i.createElement)(i.Fragment,null,!r&&!z&&(0,i.createElement)(Zp.ReactSortable,{list:n,setList:e=>{T.current=e,d({type:"SET_STEPS",steps:e})},onEnd:R,swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-step-wrap",filter:".wcf-step__col-actions, .wcf-step__title-text, .wcf-ab-test-popup-content, .wcf-add-step-connector",preventOnFilter:!1},n.map((e,r)=>(0,i.createElement)("div",{key:e.id},(0,i.createElement)(yI,(0,y.A)({},e,{setShowAbtestUpgradePopup:A})),r<n.length-1&&(0,i.createElement)(KF,{flowId:t,flowType:o}))))))),(0,i.createElement)("div",{className:"wcf-step-footer flex justify-center pt-2 pb-4"},(0,i.createElement)(KF,{flowId:t,flowType:o,showConnectorLines:!1,tooltipPlacement:"top"}))))),(0,i.createElement)(XF,{renderCb:P,steps:n}),(0,i.createElement)(JF,{visibility:j,setVisibility:A}))},YQ=cartflows_admin.default_page_builder,ZQ=cartflows_admin.required_plugins,WQ=cartflows_admin.required_plugins[YQ],GQ={};GQ[YQ]=Object.values(cartflows_admin.flows_and_steps);const HQ={};HQ[YQ]=Object.values(cartflows_admin.store_checkout_flows_and_steps);const $Q={default_page_builder:YQ,page_builder_group_data:ZQ,page_builder_group:WQ,preview:{},woocommerce_status:cartflows_admin.woocommerce_status,requiredPluginsData:cartflows_admin.required_plugins_data,missingPlugins:cartflows_admin.is_any_required_plugins_missing,flow_count:4,cf_pro_status:cartflows_admin.cf_pro_status,all_flows:{...GQ},store_checkout_flows:{...HQ},all_step_templates:(()=>{const e=[],t=cartflows_admin.flows_and_steps;return t&&t.forEach(t=>{t.steps.forEach(n=>{n.template_ID=t.ID,n.template_type=t.type,e.push(n)})}),e})(),currentFlowSteps:Object.values(cartflows_admin.currentFlowSteps).length?cartflows_admin.currentFlowSteps["wcf-steps"]:[],flowsCount:(()=>{if(!Object.values(cartflows_admin.flows_count).length)return 0;let e=0;for(status in cartflows_admin.flows_count)"publish"===status&&(e+=parseInt(cartflows_admin.flows_count[status]));return e})(),currentFlowId:cartflows_admin.flow_id,selectedStep:"",license_status:cartflows_admin.license_status,stepTypes:{landing:"Landing",checkout:"Checkout",upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You",optin:"Optin"},storeStepTypes:{upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You"}},XQ={getCount:({age:e})=>e,getAllFlows:({all_flows:e})=>e,getStoreCheckoutFlows:({store_checkout_flows:e})=>e,getFlowsList:({all_flows:e},t)=>e[t]?e[t]:[],getStoreCheckoutFlowsList:({store_checkout_flows:e},t)=>e[t]?e[t]:[],getAllStepTemplates:({all_step_templates:e})=>e,isLimitReached:({cf_pro_status:e,flow_count:t})=>("not-installed"===e||"inactive"===e)&&t>=3,getFlowsCount:({})=>0,getcurrentFlowId:({currentFlowId:e})=>e,getLicenseStatus:({license_status:e})=>e,getselectedStepTitle:({stepTypes:e,selectedStep:t})=>e[t]||"",getselectedStep:({selectedStep:e})=>e,getstepTypes:({stepTypes:e})=>e,getStoreStepTypes:({storeStepTypes:e})=>e,getcurrentFlowSteps:({currentFlowSteps:e})=>e,getMissingPlugins:({missingPlugins:e})=>e,getPreview:({preview:e})=>e,getWooCommerceStatus:({woocommerce_status:e})=>e,getDefaultPageBuilder:({default_page_builder:e})=>e,getPageBuilderGroup:({page_builder_group:e})=>e,getFlowCount:({flow_count:e})=>e,getCFProStatus:({cf_pro_status:e})=>e,getCurrentPageBuilderData:({page_builder_group_data:e},t)=>e[t],getRequiredPluginsData:({requiredPluginsData:e})=>e},qQ={updateWooCommerceStatus:e=>({type:"UPDATE_WOOCOMMERCE_STATUS",woocommerce_status:e}),updateCFProStatus:e=>({type:"UPDATE_CF_PRO_STATUS",cf_pro_status:e}),setMissingPlugins:e=>({type:"SET_MISSING_PLUGINS",missingPlugins:e}),setPreview:e=>({type:"SET_PREVIEW",preview:e}),setSelectedStep:e=>({type:"SET_SELECTED_STEP",selectedStep:e}),setRequiredPlugins:(e,t)=>({type:"SET_REQUIRED_PLUGINS",page_builder:e,value:t}),setAllFlows:(e,t)=>({type:"SET_ALL_FLOWS",flows:e,page_builder:t})},{registerStore:JQ}=wp.data;function KQ({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}JQ("wcf/importer",{reducer:(e=$Q,t)=>"SET_MISSING_PLUGINS"===t.type?(console.log("SET_MISSING_PLUGINS",t),{...e,missingPlugins:t.missingPlugins}):"UPDATE_WOOCOMMERCE_STATUS"===t.type?(console.log("UPDATE_WOOCOMMERCE_STATUS",t),{...e,woocommerce_status:t.woocommerce_status}):"UPDATE_CF_PRO_STATUS"===t.type?(console.log("UPDATE_CF_PRO_STATUS",t),{...e,cf_pro_status:t.cf_pro_status}):"SET_SELECTED_STEP"===t.type?(console.log("SET_SELECTED_STEP",t),{...e,selectedStep:t.selectedStep}):"SET_PREVIEW"===t.type?(console.log("SET_PREVIEW",t),{...e,preview:t.preview}):"SET_REQUIRED_PLUGINS"===t.type?(e.requiredPluginsData[t.page_builder]=t.value,{...e}):"SET_ALL_FLOWS"===t.type?(e.all_flows[t.page_builder]=t.flows,{...e}):e,actions:qQ,selectors:XQ});const eV=s.forwardRef(KQ),tV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getstepTypes:t}=e("wcf/importer");return{stepTypes:t()}}),(0,iI.withDispatch)(e=>{const{setSelectedStep:t}=e("wcf/importer");return{setSelectedStep(e){t(e)}}}))(({stepTypes:e,setSelectedStep:t})=>(0,i.createElement)("div",{className:"wcf-create-step__dropdown-list wcf-select-option w-full text-left"},(0,i.createElement)(lw,{onChange:e=>{t(e)},size:"md"},(0,i.createElement)(lw.Button,{placeholder:(0,C.__)("Select Step Type","cartflows"),render:t=>t?e[t]||t:""}),(0,i.createElement)(lw.Options,null,Object.keys(e).map(t=>(0,i.createElement)(lw.Option,{value:t,key:t},e[t]))))));function nV({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const rV=s.forwardRef(nV),oV=(0,aI.compose)((0,iI.withDispatch)(e=>{const{updateWooCommerceStatus:t}=e("wcf/importer");return{updateWooCommerceStatus(e){t(e)}}}))(({title:e,updateWooCommerceStatus:t})=>{const n=e||(0,C.__)("Activate WooCommerce","cartflows"),[r,o]=(0,s.useState)({isProcessing:!1,buttonText:n}),{isProcessing:a,buttonText:l}=r;return(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(Ro,{className:"wcf-button wcf-primary-button",variant:"primary",size:"md",loading:a,disabled:a,onClick:()=>{o({isProcessing:!0,buttonText:(0,C.__)("Activating WooCommerce..","cartflows")}),Jf({slug:"woocommerce",init:"woocommerce/woocommerce.php",name:"WooCommerce"},!1).then(()=>{o({isProcessing:!1,buttonText:(0,C.__)("Successfully Activated!","cartflows")}),setTimeout(()=>{t("active")},3e3)}).catch(e=>{console.log(e),o({isProcessing:!1,buttonText:(0,C.__)("Failed! Activation!","cartflows")})})}},l)))}),aV=(0,aI.compose)((0,iI.withDispatch)(e=>{const{updateWooCommerceStatus:t}=e("wcf/importer");return{updateWooCommerceStatus(e){t(e)}}}))(({updateWooCommerceStatus:e})=>{const t=(0,C.__)("Install WooCommerce","cartflows"),[n,r]=(0,s.useState)({isProcessing:!1,buttonText:t}),{isProcessing:o,buttonText:a}=n;return(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(Ro,{className:"wcf-button wcf-primary-button",variant:"primary",size:"md",loading:o,disabled:o,onClick:()=>{var n;r({isProcessing:!0,buttonText:(0,C.__)("Installing WooCommerce..","cartflows")}),(n={slug:"woocommerce",init:"woocommerce/woocommerce.php",name:"woocommerce"},new Promise((e,t)=>{console.log("plugin.slug",n.slug),wp.updates.queue.push({action:"install-plugin",data:{slug:n.slug,init:n.init,name:n.name,success(t){console.log("Installed Successfully! Activating plugin ",n.slug),e(t,n)},error(e){t(e,n)}}}),wp.updates.queueChecker()})).then(()=>{r({isProcessing:!1,buttonText:(0,C.__)("Successfully Installed!","cartflows")}),e("inactive")}).catch(e=>{console.log(e),r({isProcessing:!1,buttonText:(0,C.__)("Installation Failed!","cartflows")}),setTimeout(()=>{r({isProcessing:!1,buttonText:t})},3e3)})}},a)))}),iV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:o,getcurrentFlowSteps:a,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:o(),currentFlowSteps:a(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:o,woocommerce_status:a,stepTypes:l,license_status:c,setInputFieldVisibility:u,setErrorDesc:d,offerYesStepId:f="",offerNoStepId:p=""})=>{const m=e.type||"",h=e.title||l[m]||"",[g,w]=(0,s.useState)((0,C.__)("Import Step","cartflows")),[y,b]=(0,s.useState)(!1);if(""===e.type)return(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:!0},g);if(1<=(r?r.filter(e=>m===e.type):[]).length&&!wcfCartflowsPro())return u("hidden"),d((0,C.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===o?(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Higher Plan","cartflows"),desc:(0,C.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")}):(d((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
39 -(0,C.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,{description:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
40 -(0,C.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===m||"downsell"===m){if(u("hidden"),!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(d((0,C.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
41 -(0,C.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),m,cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,{description:(0,C.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
42 -(0,C.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),m,cartflows_admin.cf_pro_type_inactive)})):(d((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
43 -(0,C.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),m)),(0,i.createElement)(lI,{desc:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
44 -(0,C.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),m),title:"Get CartFlows Higher Plan"}));if("Activated"!==c)return d((0,C.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
45 -(0,C.__)("Add %1$s step to your flow by activating CartFlows license.","cartflows"),m)),u("hidden"),(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(dI,{title:"Activate License"})))}if("pro"===e.template_type){if(!wcfCartflowsTypePro())return"inactive"===o&&"pro"===wcfInactivepluginType()?(u("hidden"),d((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
46 -(0,C.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,{description:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
47 -(0,C.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)})):(u("hidden"),d((0,C.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")),(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Pro","cartflows"),desc:(0,C.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")}));if(wcfCartflowsTypePro()&&"Activated"!==c)return u("hidden"),d((0,C.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
48 -(0,C.__)("Add %1$s step to your flows by activating license.","cartflows"),m)),(0,i.createElement)(dI,{title:"Activate License"})}return"landing"!==m&&"active"!==a?(u("hidden"),d((0,C.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),"inactive"===a?(0,i.createElement)(oV,{title:`Activate WooCommerce to Import ${h}`,description:(0,C.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,i.createElement)(aV,null)):(u(""),(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:y,disabled:y,icon:(0,i.createElement)(rV,{className:"h-4 w-4 stroke-2"}),iconPosition:"left",onClick:()=>{((e,t,n,r,o,a,i,s="",l="")=>{if(console.log(e,t,n),a)return;n("Importing Step.."),o(!0);const c=new window.FormData;c.append("action","cartflows_import_step"),c.append("security",cartflows_admin.import_step_nonce),c.append("remote_flow_id",e.template_ID),c.append("flow_id",t),c.append("step",JSON.stringify(e)),c.append("step_name",r),s&&c.append("offer_yes_step_id",s),l&&c.append("offer_no_step_id",l);const u=window.sessionStorage.getItem("wcf_edge_insertion_context");if(u)try{const e=JSON.parse(u);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?c.append("is_start_edge","true"):c.append("edge_source_step_id",e.sourceStepId),c.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&c.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}qf()({url:cartflows_admin.ajax_url,method:"POST",body:c}).then(e=>{if(e.success)n((0,C.__)("Imported! Redirecting…","cartflows")),o(!1),hm.success((0,C.__)("Step imported successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}`},3e3);else{let t=e.data.message;e.data.error_code&&404===e.data.error_code&&(t+=(0,C.__)(" Please sync the library and try importing the template again.","cartflows")),i(Zm(t)),n((0,C.__)("Import Failed! Try again.","cartflows")),hm.error((0,C.__)("Failed to import step.","cartflows")),setTimeout(()=>{n((0,C.__)("Import Step","cartflows"))},3e3),o(!1)}}).finally(()=>{window.sessionStorage.removeItem("wcf_edge_insertion_context")})})(e,n,w,t,b,y,d,f,p)}},g))}),sV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getcurrentFlowId:t,getselectedStep:n,getselectedStepTitle:r}=e("wcf/importer");return{currentFlowId:t(),selectedStep:n(),selectedStepTitle:r()}}))(({currentFlowId:e,selectedStep:t,selectedStepTitle:n,stepName:r,offerYesStepId:o="",offerNoStepId:a=""})=>{const[l,c]=(0,s.useState)({isProcessing:!1,buttonText:(0,C.__)("Create Step","cartflows")}),{isProcessing:u,buttonText:d}=l;return(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:u,disabled:u,onClick:i=>{i.preventDefault(),u||(c({isProcessing:!0,buttonText:(0,C.__)("Creating Step..","cartflows")}),((e,t,n,r,o,a="",i="")=>{console.log(e,t,n);const s=new window.FormData;s.append("action","cartflows_create_step"),s.append("flow_id",e),s.append("step_type",t),s.append("step_title",n),s.append("security",cartflows_admin.create_step_nonce),s.append("step_name",o),a&&s.append("offer_yes_step_id",a),i&&s.append("offer_no_step_id",i);const l=window.sessionStorage.getItem("wcf_edge_insertion_context");if(l)try{const e=JSON.parse(l);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?s.append("is_start_edge","true"):s.append("edge_source_step_id",e.sourceStepId),s.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&s.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}qf()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then(t=>{console.log(t),window.sessionStorage.removeItem("wcf_edge_insertion_context"),t.success?(r({isProcessing:!1,buttonText:(0,C.__)("Step Created! Redirecting…","cartflows")}),hm.success((0,C.__)("Step created successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e}`},3e3)):(r({isProcessing:!1,buttonText:(0,C.__)("Failed to Create Step!","cartflows")}),hm.error((0,C.__)("Failed to create step.","cartflows")))})})(e,t,n,c,r,o,a))}},d)}),lV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getFlowsCount:t,getselectedStep:n,getstepTypes:r,getcurrentFlowSteps:o,getCFProStatus:a,getWooCommerceStatus:i,getLicenseStatus:s}=e("wcf/importer");return{flowsCount:t(),selectedStep:n(),stepTypes:r(),currentFlowSteps:o(),cf_pro_status:a(),woocommerce_status:i(),license_status:s()}}))(({selectedStep:e,currentFlowSteps:t,cf_pro_status:n,woocommerce_status:r,license_status:o,stepName:a,setInputFieldVisibility:s,setErrorDesc:l,offerYesStepId:c="",offerNoStepId:u=""})=>{if(""===e)return(0,i.createElement)("button",{className:"wcf-button wcf-primary-button",disabled:!0},(0,C.__)("Create Step","cartflows"));if(1<=(t?t.filter(t=>e===t.type):[]).length&&!wcfCartflowsPro())return s("hidden"),l((0,C.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===n?(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Higher Plan","cartflows")}):(l((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
49 -(0,C.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,{description:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
50 -(0,C.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===e||"downsell"===e){if(!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(s("hidden"),l((0,C.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
51 -(0,C.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),e,cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,null)):(s("hidden"),l((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
52 -(0,C.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),e)),(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Higher Plan","cartflows")}));if(wcfCartflowsTypePlusPro()&&"Activated"!==o)return s("hidden"),l((0,C.__)("Activate license for adding more steps and other features.","cartflows")),(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(dI,{title:(0,C.__)("Activate License","cartflows")})))}return"landing"!==e&&"active"!==r?(s("hidden"),l((0,C.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),"inactive"===r?(0,i.createElement)(oV,null):(0,i.createElement)(aV,null)):(s(""),l(""),(0,i.createElement)(sV,{stepName:a,offerYesStepId:c,offerNoStepId:u}))}),cV=({stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r="",offerNoStepId:o=""})=>(0,i.createElement)("div",{className:"wcf-create-step__button-wrap"},(0,i.createElement)(lV,{stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r,offerNoStepId:o})),uV=e=>{if(!e||!Array.isArray(e))return[];const t=window.sessionStorage.getItem("wcf_edge_insertion_context");let n=-1;if(t)try{const r=JSON.parse(t).sourceStepId;if("wcf_start_node"===r||"start"===r)return e.filter(e=>"checkout"!==e.type);r&&(n=e.findIndex(e=>e.id===r||e.id===parseInt(r,10)))}catch(e){window.sessionStorage.removeItem("wcf_edge_insertion_context")}return-1===n?e.filter(e=>"checkout"!==e.type):e.slice(n+1).filter(e=>"checkout"!==e.type)},dV=({offerYesStepId:e,setOfferYesStepId:t,offerNoStepId:n,setOfferNoStepId:r,availableSteps:o=null})=>{const{currentFlowSteps:a}=(0,iI.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps()})),s=null!==o?o:uV(a);return 0===s.length?null:(0,i.createElement)("div",{className:"mt-5 space-y-4"},(0,i.createElement)("div",{className:"text-sm font-medium text-gray-700 mb-2"},(0,C.__)("Conditional Redirect Settings","cartflows")),(0,i.createElement)("div",null,(0,i.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,C.__)("On Accept (Yes), go to:","cartflows")),(0,i.createElement)("select",{className:"w-full input-field !px-3 !py-2 text-sm font-normal !rounded-md text-gray-600 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:e,onChange:e=>t(e.target.value)},(0,i.createElement)("option",{value:""},(0,C.__)("Default (Auto)","cartflows")),s.map(e=>(0,i.createElement)("option",{key:e.id,value:e.id},e.title)))),(0,i.createElement)("div",null,(0,i.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,C.__)("On Reject (No), go to:","cartflows")),(0,i.createElement)("select",{className:"w-full input-field !px-3 !py-2 text-sm font-normal !rounded-md text-gray-600 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:n,onChange:e=>r(e.target.value)},(0,i.createElement)("option",{value:""},(0,C.__)("Default (Auto)","cartflows")),s.map(e=>(0,i.createElement)("option",{key:e.id,value:e.id},e.title)))))},fV=({visibility:e,setVisibility:t,item:n,type:r,stepName:o,setStepName:a})=>{const l="show"===e,[c,u]=(0,s.useState)(""),[d,f]=(0,s.useState)(""),[p,m]=(0,s.useState)(0),[h,g]=(0,s.useState)(""),[w,y]=(0,s.useState)(""),{currentFlowSteps:b,selectedStep:v}=(0,iI.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps(),selectedStep:e("wcf/importer").getselectedStep()})),x="ready-templates"===r?n&&("upsell"===n.type||"downsell"===n.type):"upsell"===v||"downsell"===v,N=uV(b);return(0,i.createElement)(bh,{open:l,setOpen:e=>{e||t("hide")},exitOnClickOutside:!1},(0,i.createElement)(bh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(bh.Title,null,"hidden"===c?(0,C.__)("Upgrade Required","cartflows"):(0,C.__)("Name Your Step","cartflows")),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,null,(0,i.createElement)("div",{className:`${c}`},(0,i.createElement)("div",{className:"flex justify-between py-2"},(0,i.createElement)("label",{className:"flex gap-1 text-sm font-normal text-text-primary"},(0,C.__)("Step Name","cartflows")),(0,i.createElement)("span",{className:"text-xs font-normal "+(40===p?"text-brand-500":"text-field-placeholder")},p,"/40")),(0,i.createElement)(tg,{type:"text",value:o,onChange:e=>{e.length<=40&&(m(e.length),a(e))},placeholder:(0,C.__)("Enter Step Name","cartflows"),size:"md"})),"hidden"!==c&&x&&N.length>0&&(0,i.createElement)(dV,{offerYesStepId:h,setOfferYesStepId:g,offerNoStepId:w,setOfferNoStepId:y,availableSteps:N}),""!==d&&(0,i.createElement)("p",{className:"text-sm font-regular text-text-secondary mt-3 m-0"},d)),(0,i.createElement)(bh.Footer,{className:"flex gap-3 justify-end"},"ready-templates"===r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:()=>t("hide")},(0,C.__)("Cancel","cartflows")),(0,i.createElement)(iV,{currentStep:n,stepName:o,setInputFieldVisibility:u,setErrorDesc:f,offerYesStepId:h,offerNoStepId:w})),"create-your-own"===r&&(0,i.createElement)(cV,{stepName:o,setInputFieldVisibility:u,setErrorDesc:f,offerYesStepId:h,offerNoStepId:w}))))},pV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,s.useState)("hide"),[r,o]=(0,s.useState)("");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(fV,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:o}),(0,i.createElement)("div",{className:"wcf-step-library--item wcf-step-library--item__start-scratch h-full bg-background-primary rounded-lg shadow-md relative p-5 box-border"},(0,i.createElement)("div",{className:"wcf-step-library--item--scratch-select text-center w-full h-full min-h-[400px] max-h-[400px] flex flex-col gap-4 items-center justify-center"},(0,i.createElement)("h3",{className:"text-base text-text-primary p-4 text-center font-medium"},(0,C.__)("Select Step Type","cartflows")),(0,i.createElement)(tV,null),(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:""===e,icon:(0,i.createElement)(yg,{className:"h-18 w-18 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,C.__)("Create Step","cartflows")),(0,i.createElement)("div",{className:"wcf-learn-how"},(0,i.createElement)("a",{href:`${cartflows_admin.cf_domain_url}/docs/cartflows-step-types/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs`,target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-sm text-text-tertiary hover:text-brand-500"},(0,i.createElement)(uI,{className:"w-18 h-18 stroke-1"}),(0,C.__)("Learn How","cartflows")))),(0,i.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle absolute bottom-0 left-0 w-full"},(0,i.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,C.__)("Create from Scratch","cartflows")))))});function mV({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25"}))}const hV=s.forwardRef(mV),gV=function({item:e}){const[t,n]=(0,s.useState)("hide"),[r,o]=(0,s.useState)("");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(fV,{visibility:t,setVisibility:n,type:"ready-templates",stepName:r,setStepName:o,item:e}),(0,i.createElement)("div",{key:e.id,className:"wcf-template-item group relative cursor-pointer transition ease-in-out delay-150 rounded-lg shadow-md"},"pro"===e.template_type?(0,i.createElement)("div",{className:"z-10 absolute top-5 right-5"},(0,i.createElement)(Pp,null)):"",(0,i.createElement)("div",{className:"wcf-item__inner bg-background-primary border border-border-subtle"},(0,i.createElement)("div",{className:"wcf-item__thumbnail-wrap relative"},(0,i.createElement)("div",{className:"wcf-item__thumbnail overflow-hidden "+("upsell"===e.type||"downsell"===e.type?"max-h-[345px] min-h-[345px]":"min-h-[400px] max-h-[400px]")},(0,i.createElement)("img",{className:"wcf-item__thumbnail-image w-full",src:e.featured_image_url,alt:(0,C.__)("Step thumbnail image","cartflows")})),(0,i.createElement)("div",{className:"wcf-item__view invisible group-hover:visible absolute backdrop-brightness-50 top-0 w-full h-full transition ease-in-out delay-150"},(0,i.createElement)("div",{className:"mx-auto my-0 text-center flex flex-col gap-4 relative top-[35%]"},(0,i.createElement)("span",{className:"wcf-step-preview-wrap"},(0,i.createElement)(Ro,{tag:"a",variant:"outline",size:"sm",href:e.link,target:"_blank",rel:"noreferrer",className:"mx-auto !w-fit no-underline !bg-background-primary/10 !border-white/30 !text-text-on-color hover:!bg-background-primary/20",icon:(0,i.createElement)(uI,{className:"w-4 h-4 stroke-2"})},(0,C.__)("Preview","cartflows"))),(0,i.createElement)("span",{className:"wcf-item__btn",onClick:()=>{n("hide"===t?"show":"hide")}},(0,i.createElement)(Ro,{variant:"primary",size:"sm",className:"mx-auto !w-fit",icon:(0,i.createElement)(hV,{className:"w-4 h-4 stroke-2"})},(0,C.__)("Import","cartflows")))))),(0,i.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle"},(0,i.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},e.title)))))},wV=function(e){const{templates:t,currentStep:n,setcurrentStepCB:r,allowedStepTypes:o}=e,a=t,{step_types:l}=(0,iI.useSelect)(e=>({step_types:e("wcf/importer").getstepTypes()})),c=Object.entries(l),u=e=>!o||o.hasOwnProperty(e);return(0,i.createElement)(s.Fragment,null,(0,i.createElement)("div",{className:"wcf-remote-steps-filters flex gap-4 items-center p-8 mb-8 -m-8 bg-background-primary"},(0,i.createElement)("div",{className:"wcf-categories w-full"},(0,i.createElement)("div",{className:"wcf-step-type-filter--links sm:block lg:block hidden"},(0,i.createElement)(YM.Group,{activeItem:n,variant:"rounded",size:"sm",width:"auto",className:"!bg-transparent !p-0 !ring-0 !gap-4",onChange:({value:e})=>{u(e.slug)&&r(e.slug)}},c.map(([e,t])=>{const r=e===n;return(0,i.createElement)(YM.Tab,{key:e,slug:e,text:t,disabled:!u(e),className:"step-type-filter-item !px-1 !py-1 !font-medium "+(r?"!bg-transparent !shadow-none !text-brand-500":"")})}))),(0,i.createElement)("div",{className:"sm:hidden lg:hidden block"},(0,i.createElement)(lw,{value:n,onChange:e=>{u(e)&&r(e)},size:"sm"},(0,i.createElement)(lw.Button,null),(0,i.createElement)(lw.Options,null,c.map(e=>{const t=e[0],n=e[1],r=u(t);return(0,i.createElement)(lw.Option,{key:t,value:t,disabled:!r},n,r?"":" (Not allowed)")})))))),(0,i.createElement)("div",{className:"wcf-step-importer__list wcf-items-list wcf-row wcf-step-row grid grid-cols-1 sm:grid-cols-4 gap-6 p-6 bg-background-primary shadow-sm rounded-md"},(0,i.createElement)("div",{className:"wcf-start-from-scratch"},(0,i.createElement)(pV,null)),a.map(e=>(0,i.createElement)(gV,{item:e,key:e.id}))))},yV=(0,s.memo)(e=>{const t=(0,C.__)("Sync Library","cartflows"),{template:n}=e,r=n||"",[o,a]=(0,s.useState)({isProcessing:!1,buttonText:t}),{isProcessing:l,buttonText:c}=o,u=async(e,t)=>{const n=new window.FormData;n.append("action","cartflows_import_sites"),n.append("page_no",e),n.append("template",r),n.append("security",cartflows_admin.import_sites_nonce),await qf()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(n=>{n.success&&(a({isProcessing:!0,buttonText:(0,C.sprintf)(/* translators: %d is replaced with the condition number */ /* translators: %d is replaced with the condition number */
53 -(0,C.__)("Importing page %d","cartflows"),e)}),e===t&&(async()=>{const e=new window.FormData;e.append("action","cartflows_update_library_complete"),e.append("template",r),e.append("security",cartflows_admin.update_library_complete_nonce),a({isProcessing:!0,buttonText:(0,C.__)("Sync Complete","cartflows")}),await qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&a({isProcessing:!1,buttonText:(0,C.__)("Sync Complete","cartflows")})}).catch(()=>{})})())}).catch(()=>{})};return(0,i.createElement)(Ro,{variant:"outline",size:"md",loading:l,icon:(0,i.createElement)(Pf,{className:"w-4 h-4 stroke-1"}),className:"wcf-sync whitespace-nowrap sm:whitespace-normal",onClick:e=>{e.preventDefault(),a({isProcessing:!0,buttonText:(0,C.__)("Syncing Library…","cartflows")}),(async()=>{try{const e=new window.FormData;e.append("action","cartflows_sync_library"),e.append("template",r),e.append("security",cartflows_admin.sync_library_nonce),await qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&("updated"===e.data?(a({isProcessing:!1,buttonText:(0,C.__)("Library Synced","cartflows")}),setTimeout(()=>{a({isProcessing:!1,buttonText:t})},5e3)):(async()=>{const e=new window.FormData;e.append("action","cartflows_request_count"),e.append("template",r),e.append("security",cartflows_admin.request_count_nonce),await qf()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(async e=>{if(e.success){a({isProcessing:!0,buttonText:"Importing Pages.."});const t=e.data.count;for(let e=1;e<=t;e++)u(e,t)}else a({isProcessing:!1,buttonText:t})}).catch(()=>{})})())}).catch(()=>{})}catch(e){}})()}},c)}),bV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,s.useState)("hide"),[r,o]=(0,s.useState)(""),[{page_builder:a}]=Yp();return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(fV,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:o}),(0,i.createElement)("div",{className:"wcf-step-library--item__start-scratch flex gap-6 mx-auto max-w-4xl px-10 py-14"},(0,i.createElement)("div",{className:"wcf-step-library--item__card relative bg-gray-25 p-5 flex flex-col gap-4 border border-border-subtle rounded-md items-center justify-center h-72 w-2/3"},(0,i.createElement)(jI,{title:(0,C.__)("Create from Scratch","cartflows"),description:(0,C.__)("Select a step type to get started.","cartflows"),tag:"h3",size:"xs",className:"text-center text-base [&>p]:text-text-secondary"}),(0,i.createElement)("div",{className:"w-full"},(0,i.createElement)(tV,null)),(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:""===e,icon:(0,i.createElement)(yg,{className:"h-5 w-5 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,C.__)("Create Step","cartflows"))),(0,i.createElement)("div",{className:"wcf-step-library--item__info flex flex-col gap-6 justify-center w-3/4"},(0,i.createElement)("h3",{className:"text-xl text-text-primary font-semibold m-0"},"bricks-builder"===a&&(0,C.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===a&&(0,C.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,i.createElement)("span",{className:"text-base text-text-secondary font-normal mt-2"},"bricks-builder"===a&&(0,C.__)("Are you using Bricks Builder? No worries. CartFlows works well with Bricks Builder. Right now we do not have ready templates for Bricks Builder but we are planning to add it very soon.","cartflows"),"other"===a&&(0,C.__)("Are you using any other page builder? No worries. CartFlows works well with every other page builder. Right now we do not have ready templates for every page builder but we are planning to add it very soon.","cartflows")),(0,i.createElement)("span",{className:"mt-2"},(0,i.createElement)("a",{className:"text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:"https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs",target:"_blank",rel:"noreferrer"},(0,C.__)("Learn How","cartflows"),(0,i.createElement)(uI,{className:"w-4 h-4 stroke-1"}))))))}),vV=class{constructor(){this.offerSteps=["upsell","downsell"],this.allStepTypes=["landing","optin","checkout","upsell","downsell","thankyou"]}isOfferStep(e){return this.offerSteps.includes(e)}isStartNode(e){return"wcf_start_node"===e||"start"===e}isEndNode(e){return"wcf_end_node"===e||"end"===e}extractStepIdFromNodeId(e){if(!e||this.isStartNode(e)||this.isEndNode(e))return e;if("string"==typeof e&&e.includes("wcf_node_edge_")){const t=parseInt(e.replace("wcf_node_edge_",""),10);return isNaN(t)?null:t}if("string"==typeof e&&e.startsWith("conditional-")){const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}if("string"==typeof e&&e.startsWith("ab-group-")){const t=parseInt(e.replace("ab-group-",""),10);return isNaN(t)?null:t}return"number"==typeof e?e:null}findStepById(e,t){if(!t||!Array.isArray(t))return null;const n=this.extractStepIdFromNodeId(e);if(!n||this.isStartNode(n)||this.isEndNode(n))return null;const r=t.find(e=>e.id===n);if(r)return r;for(const e of t)if(e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])){if(e["ab-test-variations"].find(e=>e.id===n))return{...e,_variationId:n,_isVariation:!0}}return null}getStepType(e,t){if(this.isStartNode(e))return"start";if(this.isEndNode(e))return"end";const n=this.findStepById(e,t);return n?n.type:null}hasOptinBeforeCheckout(e){if(!e||!Array.isArray(e))return!1;let t=!1;for(let n=e.length-1;n>=0;n--){const r=e[n];if("checkout"===r.type&&(t=!0),t&&"optin"===r.type)return!0}return!1}hasCheckoutBefore(e,t){if(!t||!Array.isArray(t))return!1;for(let n=0;n<e;n++)if("checkout"===t[n].type)return!0;return!1}getStepIndex(e,t){if(!t||!Array.isArray(t))return-1;const n=this.extractStepIdFromNodeId(e);return!n||this.isStartNode(n)||this.isEndNode(n)?-1:t.findIndex(e=>e.id===n)}getAllowedStepTypes(e,t,n){const r=this.getStepType(e,n),o=this.getStepType(t,n);return"start"===r?"optin"===o?["landing","checkout"]:"checkout"===o||"landing"===o?this.hasOptinBeforeCheckout(n)?["landing"]:["landing","optin"]:["landing","optin","checkout"]:"end"===o?["thankyou"]:"checkout"===o?"checkout"===r?[]:this.hasOptinBeforeCheckout(n)?["landing"]:["landing","optin"]:"checkout"===r?"checkout"===o?[]:["upsell","downsell"]:this.isOfferStep(r)?this.isOfferStep(o)?["upsell","downsell"]:["upsell","downsell","optin"]:"landing"===r?"checkout"===o?this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]:"optin"===o?["landing"]:this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]:"optin"===r?"checkout"===o?["landing","checkout"]:"landing"===o?["landing"]:["landing","checkout"]:"thankyou"===r?[]:this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]}getAllowedStepTypesObject(e,t,n,r){const o=this.getAllowedStepTypes(e,t,n),a={};return o.forEach(e=>{r&&r[e]&&(a[e]=r[e])}),a}},xV=function(){const e=(0,h.useHistory)(),[{page_builder:t,flow_id:n,flow_type:r}]=Yp(),[o,a]=(0,s.useState)("landing"),[l,c]=(0,s.useState)(""),[u,d]=(0,s.useState)(null),{all_step_templates:f,stepTypes:p,currentFlowSteps:m}=(0,iI.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates(),stepTypes:e("wcf/importer").getstepTypes(),currentFlowSteps:e("wcf/importer").getcurrentFlowSteps()})),g=[];f.forEach(e=>{o===e.type&&g.push(e)});const[w,y]=(0,s.useState)(g);return(0,s.useEffect)(()=>{if("flows"!==r)return void d(null);const e=window.sessionStorage.getItem("wcf_edge_insertion_context");if(e)try{const t=JSON.parse(e);if(t.sourceStepId&&t.targetStepId){const e=(new vV).getAllowedStepTypesObject(t.sourceStepId,t.targetStepId,m,p);d(e);const n=Object.keys(e);n.length>0&&!e.hasOwnProperty(o)&&a(n[0])}}catch(e){console.error("[Library] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}else d(null)},[r,m,p]),(0,s.useEffect)(()=>()=>{window.sessionStorage.getItem("wcf_edge_insertion_context")&&window.sessionStorage.removeItem("wcf_edge_insertion_context")},[]),(0,s.useEffect)(()=>{y(g)},[o]),(0,i.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,i.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},(0,i.createElement)("h3",{className:"text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs","aria-label":(0,C.__)("Back to Flow","cartflows"),icon:(0,i.createElement)(YS,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{n?e.push(`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${n}`):e.push("admin.php?page=cartflows&path=flows")}}),(0,C.__)("Steps Library","cartflows")),"other"!==t&&"bricks-builder"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"gap-4 flex justify-between items-center"},(0,i.createElement)("div",{className:"wcf-search-steps--form w-56"},(0,i.createElement)(tg,{type:"text",value:l,onChange:function(e){if(c(e),e&&e.length>=3){const t=e.toLowerCase(),n=g.filter(function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)});y(n)}else y(g)},placeholder:(0,C.__)("Search Steps","cartflows"),size:"md",prefix:(0,i.createElement)(eV,{className:"size-4 text-field-placeholder"}),suffix:l.length>=3?(0,i.createElement)(ww,{className:"size-4 cursor-pointer text-field-placeholder pointer-events-auto",onClick:()=>{c(""),y(g)}}):null})),(0,i.createElement)("span",{className:"divider w-px bg-background-secondary h-7"}),(0,i.createElement)(yV,null)))),(0,i.createElement)("div",{className:"wcf-step-library__body"},(0,i.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&"bricks-builder"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-ready-templates"},(0,i.createElement)(wV,{templates:w,currentStep:o,setcurrentStepCB:a,allowedStepTypes:u}))),("other"===t||"bricks-builder"===t)&&(0,i.createElement)("div",{className:"wcf-start-from-scratch current flex items-center justify-center min-h-[500px]"},(0,i.createElement)(bV,null)))))},NV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getDefaultPageBuilder:t}=e("wcf/importer");return{default_page_builder:t()}}))(({default_page_builder:e})=>{const[{flow_id:t}]=Yp();return"library"===new URLSearchParams((0,h.useLocation)().search).get("tab")?(0,i.createElement)(xV,null):(0,i.createElement)("div",{className:"wcf-flow-library wcf-flex"},"bricks-builder"!==e&&"other"!==e?(0,i.createElement)(S,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library&sub=library`},className:"wcf-flow-library__item wcf-flow-library__item--readymade"},"Import from Library"):"",(0,i.createElement)(pV,{page_builder:e}))}),EV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getStoreStepTypes:t}=e("wcf/importer");return{stepTypes:t()}}),(0,iI.withDispatch)(e=>{const{setSelectedStep:t}=e("wcf/importer");return{setSelectedStep(e){t(e)}}}))(({stepTypes:e,setSelectedStep:t})=>(0,i.createElement)("div",{className:"wcf-create-step__dropdown-list wcf-select-option w-full text-left"},(0,i.createElement)(lw,{onChange:e=>{t(e)},size:"md"},(0,i.createElement)(lw.Button,{placeholder:(0,C.__)("Select Step Type","cartflows"),render:t=>t?e[t]||t:""}),(0,i.createElement)(lw.Options,null,Object.keys(e).map(t=>(0,i.createElement)(lw.Option,{value:t,key:t},e[t])))))),_V=(0,aI.compose)((0,iI.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:o,getcurrentFlowSteps:a,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:o(),currentFlowSteps:a(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:o,woocommerce_status:a,stepTypes:l,license_status:c,setInputFieldVisibility:u,setErrorDesc:d})=>{const f=e.type||"",p=e.title||l[f]||"",[m,h]=(0,s.useState)("Import Step"),[g,w]=(0,s.useState)(!1),[y,b]=(0,s.useState)({cta:"",error_msg:""}),{cta:v}=y;if(v)return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:v}}));if(""===e.type)return(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:!0},m);const x=r?r.filter(e=>f===e.type):[];if(console.log("selectedExistSteps.length",x.length),1<=x.length&&!wcfCartflowsPro())return u("hidden"),d((0,C.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===o?(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Higher plan","cartflows")}):(d((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
54 -(0,C.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,null));if("upsell"===f||"downsell"===f){if(u("hidden"),!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(d((0,C.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
55 -(0,C.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),f,cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,null)):(d((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
56 -(0,C.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),f)),(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Higher Plan","cartflows")}));if("Activated"!==c)return u("hidden"),d((0,C.__)("Activate license for adding more flows and other features.","cartflows")),(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(dI,{title:`Activate License and ${m}`})))}return"pro"!==e.template_type||wcfCartflowsTypePro()?"landing"!==f&&"active"!==a?(u("hidden"),"inactive"===a?(d((0,C.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),(0,i.createElement)(oV,{title:`Activate WooCommerce to Import ${p}`})):(0,i.createElement)(aV,null)):(u(""),(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:g,disabled:g,icon:(0,i.createElement)(rV,{className:"h-4 w-4 stroke-2"}),iconPosition:"left",onClick:()=>{((e,t,n,r,o,a,i,s)=>{if(console.log(e,t,n),a)return;n((0,C.__)("Importing Step..","cartflows")),o(!0);const l=new window.FormData;l.append("action","cartflows_import_step"),l.append("security",cartflows_admin.import_step_nonce),l.append("remote_flow_id",e.template_ID),l.append("flow_id",t),l.append("step",JSON.stringify(e)),l.append("step_name",r);const c=window.sessionStorage.getItem("wcf_edge_insertion_context");if(c)try{const e=JSON.parse(c);e.sourceStepId&&e.targetStepId&&(l.append("edge_source_step_id",e.sourceStepId),l.append("edge_target_step_id",e.targetStepId))}catch(e){window.sessionStorage.removeItem("wcf_edge_insertion_context")}qf()({url:cartflows_admin.ajax_url,method:"POST",body:l}).then(e=>{if(e.success)o(!1),n((0,C.__)("Imported! Redirecting…","cartflows")),hm.success((0,C.__)("Step imported successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}`},3e3);else if("call_to_action"in e.data)i({cta:e.data.call_to_action}),s(e.data.message);else{let t=e.data.message;e.data.error_code&&404===e.data.error_code&&(t+=(0,C.__)(" Please sync the library and try importing the template again.","cartflows")),s(Zm(t)),n((0,C.__)("Import Failed! Try again.","cartflows")),hm.error((0,C.__)("Failed to import step.","cartflows")),setTimeout(()=>{n((0,C.__)("Import Step","cartflows"))},3e3),o(!1)}}).finally(()=>{window.sessionStorage.removeItem("wcf_edge_insertion_context")})})(e,n,h,t,w,g,b,d)}},m)):(u("hidden"),"inactive"===o&&"pro"===wcfInactivepluginType()?(u("hidden"),d((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
57 -(0,C.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,null)):(u("hidden"),d((0,C.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")),(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Pro","cartflows")})))}),MV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getcurrentFlowId:t,getselectedStep:n,getselectedStepTitle:r}=e("wcf/importer");return{currentFlowId:t(),selectedStep:n(),selectedStepTitle:r()}}))(({currentFlowId:e,selectedStep:t,selectedStepTitle:n,stepName:r,offerYesStepId:o="",offerNoStepId:a=""})=>{const[l,c]=(0,s.useState)({isProcessing:!1,buttonText:"Create Step"}),{isProcessing:u,buttonText:d}=l;return(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:u,disabled:u,onClick:i=>{i.preventDefault(),u||(c({isProcessing:!0,buttonText:(0,C.__)("Creating Step..","cartflows")}),((e,t,n,r,o,a="",i="")=>{console.log(e,t,n);const s=new window.FormData;s.append("action","cartflows_create_step"),s.append("flow_id",e),s.append("step_type",t),s.append("step_title",n),s.append("security",cartflows_admin.create_step_nonce),s.append("step_name",o),a&&s.append("offer_yes_step_id",a),i&&s.append("offer_no_step_id",i);const l=window.sessionStorage.getItem("wcf_edge_insertion_context");if(l)try{const e=JSON.parse(l);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?s.append("is_start_edge","true"):s.append("edge_source_step_id",e.sourceStepId),s.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&s.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}qf()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then(t=>{console.log(t),window.sessionStorage.removeItem("wcf_edge_insertion_context"),t.success?(r({isProcessing:!1,buttonText:(0,C.__)("Step Created! Redirecting…","cartflows")}),hm.success((0,C.__)("Step created successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e}`},3e3)):(r({isProcessing:!1,buttonText:(0,C.__)("Failed to Create Step!","cartflows")}),hm.error((0,C.__)("Failed to create step.","cartflows")))})})(e,t,n,c,r,o,a))}},d)}),IV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getFlowsCount:t,getselectedStep:n,getstepTypes:r,getcurrentFlowSteps:o,getCFProStatus:a,getWooCommerceStatus:i,getLicenseStatus:s}=e("wcf/importer");return{flowsCount:t(),selectedStep:n(),stepTypes:r(),currentFlowSteps:o(),cf_pro_status:a(),woocommerce_status:i(),license_status:s()}}))(({selectedStep:e,currentFlowSteps:t,cf_pro_status:n,woocommerce_status:r,license_status:o,stepName:a,setInputFieldVisibility:s,setErrorDesc:l,offerYesStepId:c="",offerNoStepId:u=""})=>{if(""===e)return(0,i.createElement)("button",{className:"wcf-button wcf-primary-button",disabled:!0},(0,C.__)("Create Step","cartflows"));if(1<=(t?t.filter(t=>e===t.type):[]).length&&!wcfCartflowsPro())return s("hidden"),l((0,C.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===n?(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Higher Plan","cartflows")}):(l((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
58 -(0,C.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,{description:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
59 -(0,C.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===e||"downsell"===e){if(!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(s("hidden"),l((0,C.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
60 -(0,C.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),e,cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(sI,null)):(s("hidden"),l((0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
61 -(0,C.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),e)),(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Higher Plan","cartflows")}));if(wcfCartflowsTypePlusPro()&&"Activated"!==o)return s("hidden"),l((0,C.__)("Activate license for adding more steps and other features.","cartflows")),(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(dI,{title:(0,C.__)("Activate License","cartflows")})))}return"landing"!==e&&"active"!==r?(s("hidden"),"inactive"===r?(l((0,C.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),(0,i.createElement)(oV,null)):(0,i.createElement)(aV,null)):(s(""),l(""),(0,i.createElement)(MV,{stepName:a,offerYesStepId:c,offerNoStepId:u}))}),SV=({stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r="",offerNoStepId:o=""})=>(0,i.createElement)("div",{className:"wcf-create-step__button-wrap"},(0,i.createElement)(IV,{stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r,offerNoStepId:o})),kV=({visibility:e,setVisibility:t,item:n,type:r,stepName:o,setStepName:a})=>{const l="show"===e,[c,u]=(0,s.useState)(""),[d,f]=(0,s.useState)(""),[p,m]=(0,s.useState)(0),[h,g]=(0,s.useState)(""),[w,y]=(0,s.useState)(""),{currentFlowSteps:b,selectedStep:v}=(0,iI.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps(),selectedStep:e("wcf/importer").getselectedStep()})),x="ready-templates"===r?n&&("upsell"===n.type||"downsell"===n.type):"upsell"===v||"downsell"===v,N=uV(b);return(0,i.createElement)(bh,{open:l,setOpen:e=>{e||t("hide")},exitOnClickOutside:!1},(0,i.createElement)(bh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(bh.Title,null,"hidden"===c?(0,C.__)("Upgrade Required","cartflows"):(0,C.__)("Name Your Step","cartflows")),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,null,(0,i.createElement)("div",{className:`${c}`},(0,i.createElement)("div",{className:"flex justify-between py-2"},(0,i.createElement)("label",{className:"flex gap-1 text-sm font-normal text-text-primary"},(0,C.__)("Step Name","cartflows")),(0,i.createElement)("span",{className:"text-xs font-normal "+(40===p?"text-brand-500":"text-field-placeholder")},p,"/40")),(0,i.createElement)(tg,{type:"text",value:o,onChange:e=>{e.length<=40&&(m(e.length),a(e))},placeholder:(0,C.__)("Enter Step Name","cartflows"),size:"md"})),"hidden"!==c&&x&&N.length>0&&(0,i.createElement)(dV,{offerYesStepId:h,setOfferYesStepId:g,offerNoStepId:w,setOfferNoStepId:y,availableSteps:N}),""!==d&&(0,i.createElement)("p",{className:"text-sm font-regular text-text-secondary mt-3 m-0"},d)),(0,i.createElement)(bh.Footer,{className:"flex gap-3 justify-end"},"ready-templates"===r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:()=>t("hide")},(0,C.__)("Cancel","cartflows")),(0,i.createElement)(_V,{currentStep:n,stepName:o,setInputFieldVisibility:u,setErrorDesc:f,offerYesStepId:h,offerNoStepId:w})),"create-your-own"===r&&(0,i.createElement)(SV,{stepName:o,setInputFieldVisibility:u,setErrorDesc:f,offerYesStepId:h,offerNoStepId:w}))))},DV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,s.useState)("hide"),[r,o]=(0,s.useState)("");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(kV,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:o}),(0,i.createElement)("div",{className:"wcf-step-library--item wcf-step-library--item__start-scratch h-full bg-background-primary rounded-lg shadow-md relative p-5 box-border"},(0,i.createElement)("div",{className:"wcf-step-library--item--scratch-select text-center w-full h-full min-h-[400px] max-h-[400px] flex flex-col gap-4 items-center justify-center"},(0,i.createElement)("h3",{className:"text-base text-text-primary p-4 text-center font-medium m-0"},(0,C.__)("Select Step Type","cartflows")),(0,i.createElement)(EV,null),(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:""===e,icon:(0,i.createElement)(yg,{className:"h-18 w-18 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,C.__)("Create Step","cartflows")),(0,i.createElement)("div",{className:"wcf-learn-how"},(0,i.createElement)("a",{href:`${cartflows_admin.cf_domain_url}docs/cartflows-step-types/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs`,target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-sm text-text-tertiary hover:text-brand-500"},(0,i.createElement)(uI,{className:"w-18 h-18 stroke-1"}),(0,C.__)("Learn More","cartflows")))),(0,i.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle absolute bottom-0 left-0 w-full"},(0,i.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,C.__)("Create from Scratch","cartflows")))))}),CV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r()}}))(({visibility:e,setVisibility:t,errorMessage:n,title:r})=>{const o=r||(0,C.__)("Error","cartflows");return(0,un.createPortal)((0,i.createElement)("div",{className:`wcf-name-your-flow ${e}`},(0,i.createElement)(bh,{open:"show"===e,setOpen:e=>{e||t("hide")},exitOnClickOutside:!0},(0,i.createElement)(bh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(bh.Title,{className:"wcf-name-your-flow--title"},o),(0,i.createElement)(bh.CloseButton,null)),(0,i.createElement)(bh.Body,null,(0,i.createElement)("div",{className:"wcf-name-your-flow__body"},(0,i.createElement)("p",null,n))),(0,i.createElement)(bh.Footer,{className:"wcf-name-your-flow--footer bg-brand-25 flex justify-end gap-4"},(0,i.createElement)(Ro,{variant:"outline",size:"md",className:"no-underline text-center",onClick:()=>t("hide")},(0,C.__)("Close","cartflows")))))),document.getElementById("wcf-json-importer"))}),jV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:o,getcurrentFlowSteps:a,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:o(),currentFlowSteps:a(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:o,woocommerce_status:a,stepTypes:l,license_status:c,setInputFieldVisibility:u,step_id:d})=>{const f=e.type||"",p=e.title||l[f]||"",[m,h]=(0,s.useState)("Choose"),[g,w]=(0,s.useState)(!1),[y,b]=(0,s.useState)("hide"),[v,x]=(0,s.useState)("");if(""===e.type)return(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:!0},m);const N=r?r.filter(e=>f===e.type):[];if(console.log("selectedExistSteps.length",N.length),("upsell"===f||"downsell"===f)&&!wcfCartflowsPro()){if(u("hidden"),!wcfCartflowsTypePlusPro())return"not-installed"!==o||"pro"===cartflows_admin.cf_pro_type&&"plus"===cartflows_admin.cf_pro_type?(0,i.createElement)(sI,{description:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
62 -(0,C.__)("Add unlimited income boosting one-click upsells to your flows by activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}):(0,i.createElement)(lI,{desc:(0,C.__)("Add unlimited income boosting one-click upsells to your flows when you upgrade to our CartFlows Plus or Pro plan today.","cartflows"),title:"Get CartFlows Higher plan"});if("Activated"!==c)return u("hidden"),(0,i.createElement)(dI,{title:`Activate License and ${m}`})}return"pro"!==e.template_type||wcfCartflowsTypePro()?"landing"!==f&&"active"!==a?(u("hidden"),"inactive"===a?(0,i.createElement)(oV,{title:`Activate WooCommerce to Import ${p}`,description:(0,C.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,i.createElement)(aV,null)):(u(""),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:g,disabled:g,onClick:()=>{((e,t,n,r,o,a,i,s,l)=>{if(a)return;n("Changing Template.."),o(!0);const c=new window.FormData;c.append("action","cartflows_update_step"),c.append("security",cartflows_admin.update_step_nonce),c.append("remote_flow_id",e.template_ID),c.append("flow_id",t),c.append("step_id",i),c.append("step",JSON.stringify(e)),c.append("step_name",r),qf()({url:cartflows_admin.ajax_url,method:"POST",body:c}).then(e=>{console.log(e),e.success?(o(!1),n("Changed! Redirecting..."),hm.success((0,C.__)("Template changed successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}`},3e3)):"call_to_action"in e.data&&(n("Choose"),l(e.data.call_to_action),s("show"))})})(e,n,h,t,w,g,d,b,x)}},m),(0,i.createElement)(CV,{visibility:y,setVisibility:b,errorMessage:v}))):(u("hidden"),"not-installed"===o||"pro"!==cartflows_admin.cf_pro_type?(u("hidden"),(0,i.createElement)(lI,{title:(0,C.__)("Get CartFlows Pro","cartflows"),desc:(0,C.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")})):(u("hidden"),(0,i.createElement)(sI,{description:(0,C.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
63 -(0,C.__)("Access all of our pro templates by activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)})))}),AV=function({item:e,mode:t,step_id:n}){void 0===t&&(t="");const[r,o]=(0,s.useState)("hide"),[a,l]=(0,s.useState)("");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(kV,{visibility:r,setVisibility:o,type:"ready-templates",stepName:a,setStepName:l,item:e}),(0,i.createElement)("div",{key:e.id,className:"wcf-template-item group cursor-pointer relative transition ease-in-out delay-150 rounded-lg shadow-md"},"pro"===e.template_type?(0,i.createElement)("div",{className:"z-10 absolute top-5 right-5"},(0,i.createElement)(Pp,null)):"",(0,i.createElement)("div",{className:"wcf-item__inner bg-background-primary border border-border-subtle"},(0,i.createElement)("div",{className:"wcf-item__thumbnail-wrap relative"},(0,i.createElement)("div",{className:"wcf-item__thumbnail overflow-hidden "+("upsell"===e.type||"downsell"===e.type?"max-h-[345px] min-h-[345px]":"min-h-[400px] max-h-[400px]")},(0,i.createElement)("img",{className:"wcf-item__thumbnail-image w-full",src:e.featured_image_url,alt:(0,C.__)("Step thumbnail image","cartflows")})),(0,i.createElement)("div",{className:"wcf-item__view invisible group-hover:visible absolute backdrop-brightness-50 top-0 w-full h-full transition ease-in-out delay-150"},"default"===t&&(0,i.createElement)("div",{className:"mx-auto my-0 text-center flex flex-col gap-4 relative top-[35%]"},(0,i.createElement)("span",{className:"wcf-step-preview-wrap"},(0,i.createElement)(Ro,{tag:"a",variant:"outline",size:"sm",href:e.link,target:"_blank",rel:"noreferrer",className:"mx-auto !w-fit no-underline !bg-background-primary/10 !border-white/30 !text-text-on-color hover:!bg-background-primary/20",icon:(0,i.createElement)(uI,{className:"w-4 h-4 stroke-2"})},(0,C.__)("Preview","cartflows"))),(0,i.createElement)("span",{className:"wcf-item__btn",onClick:()=>{o("hide"===r?"show":"hide")}},(0,i.createElement)(Ro,{variant:"primary",size:"sm",className:"mx-auto !w-fit",icon:(0,i.createElement)(hV,{className:"w-4 h-4 stroke-2"})},(0,C.__)("Import","cartflows")))),"dynamic"===t&&(0,i.createElement)("div",{className:"mx-auto my-0 text-center relative top-1/2"},(0,i.createElement)(jV,{currentStep:e,stepName:"StepName",setInputFieldVisibility:o,step_id:n})))),(0,i.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle"},(0,i.createElement)("span",{className:"wcf-item__heading block text-base text-text-primary font-medium p-4 text-center"},e.title)))))},TV=function(e){const{templates:t,currentStep:n,required_step_type:r,currentStepId:o,setcurrentStepCB:a}=e,l=t,{step_types:c}=(0,iI.useSelect)(e=>({step_types:e("wcf/importer").getStoreStepTypes()})),u=void 0===r?"default":"dynamic",d=void 0===r?c:r;let f=0;void 0!==o&&(f=o);const p=Object.entries(d);return(0,i.createElement)(s.Fragment,null,"default"===u&&(0,i.createElement)("div",{className:"wcf-remote-steps-filters flex gap-4 items-center p-8 mb-8 -m-8 bg-background-primary"},(0,i.createElement)("div",{className:"wcf-categories w-full"},(0,i.createElement)("div",{className:"wcf-step-type-filter--links sm:block lg:block hidden"},(0,i.createElement)(YM.Group,{activeItem:n,variant:"rounded",size:"sm",width:"auto",className:"!bg-transparent !p-0 !ring-0 !gap-4",onChange:({value:e})=>{a(e.slug)}},p.map(([e,t])=>{const r=e===n;return(0,i.createElement)(YM.Tab,{key:e,slug:e,text:t,className:"step-type-filter-item !px-1 !py-1 !font-medium "+(r?"!bg-transparent !shadow-none !text-brand-500":"")})}))),(0,i.createElement)("div",{className:"sm:hidden lg:hidden block"},(0,i.createElement)(lw,{value:n,onChange:e=>{a(e)},size:"sm"},(0,i.createElement)(lw.Button,null),(0,i.createElement)(lw.Options,null,p.map(e=>(0,i.createElement)(lw.Option,{key:e[0],value:e[0]},e[1]))))))),(0,i.createElement)("div",{className:"wcf-step-importer__list wcf-items-list wcf-row wcf-step-row grid grid-cols-1 sm:grid-cols-4 gap-6 p-6 bg-background-primary shadow-sm rounded-md"},(0,i.createElement)("div",{className:"wcf-start-from-scratch"},(0,i.createElement)(DV,null)),l.map(e=>(0,i.createElement)(AV,{item:e,key:e.id,mode:u,step_id:f}))))},LV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,s.useState)("hide"),[r,o]=(0,s.useState)(""),[{page_builder:a}]=Yp();return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(kV,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:o}),(0,i.createElement)("div",{className:"wcf-step-library--item__start-scratch flex gap-6 mx-auto max-w-4xl px-10 py-14"},(0,i.createElement)("div",{className:"wcf-step-library--item__card relative bg-gray-25 p-5 flex flex-col gap-4 border border-border-subtle rounded-md items-center justify-center h-72 w-2/3"},(0,i.createElement)(jI,{title:(0,C.__)("Create from Scratch","cartflows"),description:(0,C.__)("Select a step type to get started.","cartflows"),tag:"h3",size:"xs",className:"text-center text-base [&>p]:text-text-secondary"}),(0,i.createElement)("div",{className:"w-full"},(0,i.createElement)(EV,null)),(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:""===e,icon:(0,i.createElement)(yg,{className:"h-5 w-5 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,C.__)("Create Step","cartflows"))),(0,i.createElement)("div",{className:"wcf-step-library--item__info flex flex-col gap-6 justify-center w-3/4"},(0,i.createElement)("h3",{className:"text-xl text-text-primary font-semibold m-0"},"bricks-builder"===a&&(0,C.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===a&&(0,C.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,i.createElement)("span",{className:"text-base text-text-secondary font-normal mt-2"},"bricks-builder"===a&&(0,C.__)("Are you using Bricks Builder? No worries. CartFlows works well with Bricks Builder. Right now we do not have ready templates for Bricks Builder but we are planning to add it very soon.","cartflows"),"other"===a&&(0,C.__)("Are you using any other page builder? No worries. CartFlows works well with every other page builder. Right now we do not have ready templates for every page builder but we are planning to add it very soon.","cartflows")),(0,i.createElement)("span",{className:"mt-2"},(0,i.createElement)("a",{className:"text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:"https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs",target:"_blank",rel:"noreferrer"},(0,C.__)("Learn How","cartflows"),(0,i.createElement)(uI,{className:"w-4 h-4 stroke-1"}))))))}),OV=function(){const e=(0,h.useHistory)(),[{page_builder:t,flow_id:n}]=Yp(),[r,o]=(0,s.useState)("upsell"),[a,l]=(0,s.useState)(""),{all_step_templates:c}=(0,iI.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates()})),u=[];c.forEach(e=>{r===e.type&&u.push(e)});const[d,f]=(0,s.useState)(u);return(0,s.useEffect)(()=>{f(u)},[r]),(0,i.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,i.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},(0,i.createElement)("h3",{className:"text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs","aria-label":(0,C.__)("Back to Store Checkout","cartflows"),icon:(0,i.createElement)(YS,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{n?e.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`):e.push("admin.php?page=cartflows&path=store-checkout")}}),(0,C.__)("Steps Library","cartflows")),"other"!==t&&"bricks-builder"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"gap-4 flex justify-between items-center"},(0,i.createElement)("div",{className:"wcf-search-steps--form w-56"},(0,i.createElement)(tg,{type:"text",value:a,onChange:function(e){if(l(e),e&&e.length>=3){const t=e.toLowerCase(),n=u.filter(function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)});f(n)}else f(u)},placeholder:(0,C.__)("Search Steps","cartflows"),size:"md",prefix:(0,i.createElement)(eV,{className:"size-4 text-field-placeholder"}),suffix:a.length>=3?(0,i.createElement)(ww,{className:"size-4 cursor-pointer text-field-placeholder pointer-events-auto",onClick:()=>{l(""),f(u)}}):null})),(0,i.createElement)("span",{className:"divider w-px bg-background-secondary h-7"}),(0,i.createElement)(yV,{template:"store-checkout"})))),(0,i.createElement)("div",{className:"wcf-step-library__body"},(0,i.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&"bricks-builder"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-ready-templates"},(0,i.createElement)(TV,{templates:d,currentStep:r,setcurrentStepCB:o}))),("other"===t||"bricks-builder"===t)&&(0,i.createElement)("div",{className:"wcf-start-from-scratch current flex items-center justify-center min-h-[500px]"},(0,i.createElement)(LV,null)))))},zV=(0,aI.compose)((0,iI.withSelect)(e=>{const{getDefaultPageBuilder:t}=e("wcf/importer");return{default_page_builder:t()}}))(({default_page_builder:e})=>{const[{flow_id:t}]=Yp();return"library"===new URLSearchParams((0,h.useLocation)().search).get("tab")?(0,i.createElement)(OV,null):(0,i.createElement)("div",{className:"wcf-flow-library wcf-flex"},"other"!==e?(0,i.createElement)(S,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&action=wcf-edit-flow&flow_id=${t}&tab=library&sub=library`},className:"wcf-flow-library__item wcf-flow-library__item--readymade"},"Import from Library"):"",(0,i.createElement)(DV,null))}),PV=function(){const[{step_data:e,page_builder:t,flow_id:n,step_id:r}]=Yp(),o=(0,h.useHistory)(),a={[e.type]:""},[l,c]=(0,s.useState)(e.type),{all_step_templates:u}=(0,iI.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates()})),d=[];u.forEach(t=>{e.type===t.type&&d.push(t)});const f=async function(){r?o.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&step_id=${r}`):o.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`)};return 0===Object.keys(e).length&&f(),(0,i.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,i.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},"other"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("h3",{className:"flex items-center gap-2 text-2xl font-semibold text-text-primary m-0"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)(YS,{className:"w-6 h-6 stroke-1"}),onClick:f}),(0,C.sprintf)(/* translators: %s is replaced with the step title */ /* translators: %s is replaced with the step title */
64 -(0,C.__)("Templates for %s","cartflows"),e.title)),(0,i.createElement)("div",{className:"wcf-step-library__step-actions"},(0,i.createElement)("div",{className:"wcf-tab-wrapper"},(0,i.createElement)("div",{className:"wcf-get-started-steps"}))))),(0,i.createElement)("div",{className:"wcf-step-library__body"},(0,i.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&e&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-ready-templates current"},(0,i.createElement)(TV,{templates:d,currentStep:l,required_step_type:a,currentStepId:e.id,setcurrentStepCB:c}))),"other"===t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-start-from-scratch current"},(0,i.createElement)(DV,null))))))};function RV({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const UV=s.forwardRef(RV);function BV({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const FV=s.forwardRef(BV);function QV({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const VV=s.forwardRef(QV),YV=({slides:e})=>{const[t,n]=(0,s.useState)(0),[r,o]=(0,s.useState)(!1);return(0,i.createElement)("div",{className:"slider-container mb-2"},(0,i.createElement)("div",{className:"slide-wrapper gap-2 border border-solid border-yellow-400 rounded-lg bg-alert-background-warning p-3"},(0,i.createElement)("div",{className:"slide flex items-center gap-2 "+(r?"fade-out":"fade-in")},(0,i.createElement)("div",{className:"wcf-payment-gateway-notice--icon flex"},(0,i.createElement)(UV,{className:"h-5 w-5 text-support-warning","aria-hidden":"true"})),(0,i.createElement)("div",{dangerouslySetInnerHTML:{__html:e[t]}})),e.length>1&&(0,i.createElement)("div",{className:"slider-dots"},(0,i.createElement)("button",{onClick:()=>{r||(o(!0),setTimeout(()=>{n(0===t?e.length-1:t-1),o(!1)},400))},className:"slider-button "+(0===t?"disabled":""),disabled:0===t},(0,i.createElement)(FV,{className:"h-8 w-8","aria-hidden":"true"})),(0,i.createElement)("button",{onClick:()=>{r||(o(!0),setTimeout(()=>{n(t===e.length-1?0:t+1),o(!1)},400))},className:"slider-button "+(t===e.length-1?"disabled":""),disabled:t===e.length-1},(0,i.createElement)(VV,{className:"h-8 w-8","aria-hidden":"true"})))))},ZV=function(){const e=new URLSearchParams((0,h.useLocation)().search),[{flow_type:t}]=Yp(),n=e.get("tab"),r=!!e.get("step_id"),o="true"===e.get("flow_settings"),a=cartflows_admin.cartflows_admin_notices,s=a.length>0&&!r&&!o;return(0,i.createElement)(i.Fragment,null,s&&(0,i.createElement)("div",{className:"wcf-notices-wrapper"},(0,i.createElement)(YV,{slides:a})),function(){let e="";switch(n){case"library":e="flows"===t?(0,i.createElement)(NV,null):(0,i.createElement)(zV,null);break;case"update-template":e=(0,i.createElement)(PV,null);break;default:e=(0,i.createElement)(VQ,null)}return e}())},WV=function(){const[e]=Yp();return function(){const[{options:e},t]=Yp(),n=function(n){const{name:r,value:o}=n.detail;if(r&&r.includes("[")){const n=r.split("["),a=[];for(let e=1;e<n.length;e++)a.push(n[e].split("]")[0]);const i=r.substr(0,r.indexOf("["));if("wcf-checkout-custom-fields"===i)return"";const s=e[i];if(!s||"object"!=typeof s)return;switch(a.length){case 2:s[a[0]][a[1]]=o;break;case 4:s[a[0]][a[1]][a[2]][a[3]]=o}t({type:"SET_OPTION",name:i,value:s})}void 0!==e[r]&&(window.wcfUnsavedChanges=!0,t({type:"SET_OPTION",name:r,value:o})),"wcf-pre-checkout-offer-product"===r&&(t({type:"SET_OPTION",name:"wcf-pre-checkout-offer-desc",value:null!==e["wcf-pre-checkout-offer-product"]?e["wcf-pre-checkout-offer-product"].product_desc:""}),t({type:"SET_OPTION",name:"wcf-pre-checkout-offer-product-title",value:null!==e["wcf-pre-checkout-offer-product"]?e["wcf-pre-checkout-offer-product"].product_name:""}))},r=[{type:"select"},{type:"select2"},{type:"checkbox"},{type:"text"},{type:"textarea"},{type:"code"},{type:"number"},{type:"radio"},{type:"color"},{type:"font"},{type:"product"},{type:"coupon"},{type:"image-selector"},{type:"toggle"},{type:"selectioncard"},{type:"select-with-logo"}];(0,s.useEffect)(()=>(e&&r.map(function(e){return document.addEventListener(`wcf:${e.type}:change`,n),""}),()=>{r.map(function(e){return document.removeEventListener(`wcf:${e.type}:change`,n),""})}),[e])}(),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ZV,null))},GV=function(e){const t=new URLSearchParams((0,h.useLocation)()?.search).get("flow_id");return"flows"===e.flowType?(Bp.flow_id=t,Bp.flow_type="flows"):(Bp.flow_id=cartflows_admin.global_checkout_id,Bp.flow_type="storeCheckout"),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Vp,{reducer:Fp,initialState:Bp},(0,i.createElement)(WV,{type:e.flowType})))},HV=function(){const e=new URLSearchParams((0,h.useLocation)().search),t=e.get("action"),n=e.get("path");let r="flows";return"store-checkout"===n&&(r="storeCheckout"),wcfWpNavMenuChange(n),(0,i.createElement)(i.Fragment,null,function(){let e="";return e="wcf-edit-flow"===t?(0,i.createElement)(GV,{flowType:r}):(0,i.createElement)("h1",null,"404 Not Found."),e}())};function $V({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z"}))}const XV=s.forwardRef($V);function qV({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m.75 12 3 3m0 0 3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const JV=s.forwardRef(qV);function KV({title:e,titleId:t,...n},r){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?s.createElement("title",{id:t},e):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}const eY=s.forwardRef(KV),tY={"top-left":"top-0 bottom-0 left-0 justify-start items-start","top-right":"top-0 bottom-0 right-0 justify-start items-end","bottom-left":"top-0 bottom-0 left-0 justify-end items-start","bottom-right":"top-0 bottom-0 right-0 justify-end items-end"},nY={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},rY="bg-background-inverse border-background-inverse",oY={light:"text-icon-secondary",dark:"text-icon-inverse"};let aY=!1;const iY=({toastItem:e,title:t="",content:n="",autoDismiss:r=!0,dismissAfter:o=5e3,theme:a="light",design:i="stack",icon:l,variant:c="neutral",removeToast:u})=>{const d=(0,s.useRef)(0),f=(0,s.useRef)(0),p=(0,s.useRef)(),m=(e,t=o)=>{if(r&&!(o<0))return d.current=(new Date).getTime(),setTimeout(()=>{"function"==typeof u&&u(e.id)},t)};(0,s.useEffect)(()=>{const t=o;return p.current=m(e,t),()=>{clearTimeout(p.current)}},[]),(0,s.useEffect)(()=>{!e?.dismiss||"function"!=typeof u||u(e.id)},[e]);const h=()=>{"function"==typeof u&&e?.action?.onClick?.(()=>u(e.id))};let g=null;return"stack"===i&&(g=(0,j.jsx)("div",{className:Se("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===a?rY:nY?.[c],"w-[22.5rem]"),onMouseEnter:()=>{clearTimeout(p.current),f.current=(new Date).getTime()},onMouseLeave:()=>{p.current=m(e,o-(f.current-d.current))},children:"custom"!==e.type?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Fo({variant:c,icon:l,theme:a})}),(0,j.jsxs)("div",{className:"flex flex-col items-start justify-start gap-0.5 mr-6",children:[Vo({title:t,theme:a}),Yo({content:n,theme:a}),e?.action?.label&&"function"==typeof e?.action?.onClick&&(0,j.jsx)("div",{className:"mt-2.5",children:Qo({actionLabel:e?.action?.label,actionType:e?.action?.type??"button",onAction:h,theme:a})})]}),(0,j.jsx)("div",{className:"absolute right-4 top-4 [&_svg]:size-5",children:(0,j.jsx)("button",{className:Se("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",oY[a]??oY.light),onClick:t=>{t.preventDefault(),t.stopPropagation(),"function"==typeof u&&u(e.id)},children:(0,j.jsx)(Tf,{})})})]}):e?.jsx?.({close:()=>u(e.id),action:e?.action?{...e?.action,onClick:h}:null})})),"inline"===i&&(g=(0,j.jsxs)("div",{className:Se("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===a?rY:nY?.[c],"lg:w-[47.5rem] w-full"),children:[(0,j.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Fo({variant:c,icon:l,theme:a})}),(0,j.jsxs)("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0",children:[Vo({title:t,theme:a}),Yo({content:n,theme:a})]}),(0,j.jsx)("div",{className:"absolute right-3 top-3 [&_svg]:size-5",children:(0,j.jsx)("button",{className:Se("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",oY[a]??oY.light),onClick:()=>u(e.id),children:(0,j.jsx)(Tf,{})})})]})),g},sY=(e=>(0,s.memo)(t=>{const n=t.singleTon;return aY&&n?null:(aY=!0,(0,j.jsx)(e,{...t}))}))(({position:e="top-right",design:t="stack",theme:n="light",className:r="",autoDismiss:o=!0,dismissAfter:a=5e3})=>{const[i,l]=(0,s.useState)([]);(0,s.useEffect)(()=>{mm.subscribe(e=>{e?.dismiss?l(t=>t.map(t=>t.id===e.id?{...t,dismiss:!0}:t)):setTimeout(()=>{(0,un.flushSync)(()=>l(t=>-1!==t.findIndex(t=>t.id===e.id)?t.map(t=>t.id===e.id?{...t,...e}:t):[...t,e]))})})},[]);const c=e=>{l(t=>t.filter(t=>t.id!==e))};return(0,j.jsx)("ul",{className:Se("fui-toast-container fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",tY[e]??tY["top-right"],r),children:(0,j.jsx)(lp,{initial:!1,children:i.map(e=>(0,j.jsx)(vf.li,{initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:`toast-${e.id}`,children:(0,j.jsx)(iY,{toastItem:e,title:e.title,content:e?.description,icon:e?.icon??void 0,design:e?.design??t,autoDismiss:e?.autoDismiss??o,dismissAfter:e?.dismissAfter??a,removeToast:c,variant:e.type,theme:e?.theme??n})},e.id))})})});class lY extends s.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,i.createElement)("div",{className:"wcf-error-boundary flex items-center justify-center min-h-[60vh]"},(0,i.createElement)("div",{className:"w-full max-w-md rounded-xl border border-border-subtle bg-background-primary shadow-md text-center overflow-hidden"},(0,i.createElement)("div",{className:"h-1 bg-gradient-to-r from-orange-400 via-red-400 to-orange-400"}),(0,i.createElement)("div",{className:"px-8 pt-8 pb-8"},(0,i.createElement)("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-alert-background-danger ring-8 ring-alert-background-danger/50"},(0,i.createElement)(jh,{className:"h-7 w-7 text-support-error"})),(0,i.createElement)(jI,{size:"md",tag:"h2",className:"mb-2"},(0,C.__)("Something went wrong","cartflows")),(0,i.createElement)(Vm,{size:"sm",color:"tertiary",className:"mb-6 max-w-xs mx-auto"},(0,C.__)("An unexpected error occurred while loading this section. Refreshing the page should fix the issue.","cartflows")),(0,i.createElement)("div",{className:"flex items-center justify-center gap-3"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",onClick:()=>window.history.back()},(0,C.__)("Go Back","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"sm",icon:(0,i.createElement)(Pf,{className:"h-4 w-4"}),onClick:()=>window.location.reload()},(0,C.__)("Refresh Page","cartflows")))))):this.props.children}}const cY=lY;(0,u.H)(document.getElementById("wcf-editor-app")).render((0,i.createElement)(({reducer:e,initialState:t,children:n})=>(0,i.createElement)(d.Provider,{value:(0,s.useReducer)(e,t)},n),{initialState:m,reducer:(e,t)=>{switch(t.status){case"SAVED":return window.wcfUnsavedChanges=!1,{...e,settingsProcess:"saved"};case"PROCESSING":return{...e,settingsProcess:"processing"};case"RESET":return{...e,settingsProcess:!1};case"UNSAVED_CHANGES":return"change"===t.trigger?{...e,unsavedChanges:!0}:{...e,unsavedChanges:!1};case"UPDATE_LICENSE_STATUS":return{...e,license_status:t.license_status};case"UPDATE_CANVAS_MODE":return{...e,canvasMode:t.canvasMode};default:return e}}},(0,i.createElement)(function({children:e}){const[t,n]=(0,s.useState)({isOpen:!1}),[r,o]=(0,s.useState)(!1),a=(0,s.useRef)(),l=(0,s.useRef)(),c=(0,s.useCallback)(e=>new Promise(t=>{n({...e,isOpen:!0}),l.current=e.onConfirm,a.current=r=>{t(r),n({...e,isOpen:!1})}}),[n]);return(0,i.createElement)(Lh.Provider,{value:c},e,(0,i.createElement)(Th,(0,y.A)({isOpen:t.isOpen,isLoading:r},t,{onClose:()=>a.current(!1),onConfirm:()=>(async()=>{try{o(!0),l.current&&await l.current(),a.current&&a.current(!0)}catch(e){a.current&&a.current(!1)}finally{o(!1)}})()})))},null,(0,i.createElement)(cY,null,(0,i.createElement)(function(){return(0,i.createElement)(x,null,(0,i.createElement)(Up,null),(0,i.createElement)("div",{className:"wcf-app-content-wrapper wcf-app-wrapper--editor-app p-8"},(0,i.createElement)(h.Switch,null,(0,i.createElement)(h.Route,{path:"/"},(0,i.createElement)(HV,null)))))},null)),(0,i.createElement)(function(){const{promiseInProgress:e}=(0,Xh.H8)();let t=(0,C.__)("Please wait…","cartflows"),n="";if(e)switch(window.wcfAction){case"cloneFlow":t=(0,C.__)("Please wait. Duplicating funnel…","cartflows"),n=(0,i.createElement)(Gm,{className:"w-18 h-18 text-brand-500"});break;case"draftFlow":t=(0,C.__)("Please wait. Drafting funnel…","cartflows"),n=(0,i.createElement)(Ap,{className:"w-18 h-18 text-brand-500"});break;case"deleteFlow":t=(0,C.__)("Please wait. Deleting funnel…","cartflows"),n=(0,i.createElement)($m,{className:"w-18 h-18 text-brand-500"});break;case"restoreFlow":t=(0,C.__)("Please wait. Restoring funnel…","cartflows"),n=(0,i.createElement)(XV,{className:"w-18 h-18 text-brand-500"});break;case"exportFlow":t=(0,C.__)("Please wait. Exporting…","cartflows"),n=(0,i.createElement)(JV,{className:"w-18 h-18 text-brand-500"});break;case"cloneStep":t=(0,C.__)("Please wait. Duplicating step…","cartflows"),n=(0,i.createElement)(Gm,{className:"w-18 h-18 text-brand-500"});break;case"deleteStep":t=(0,C.__)("Please wait. Deleting step…","cartflows"),n=(0,i.createElement)($m,{className:"w-18 h-18 text-brand-500"});break;case"abtestStep":t=(0,C.__)("Please wait. Creating variation…","cartflows"),n=(0,i.createElement)(Gm,{className:"w-18 h-18 text-brand-500"});break;case"archiveStep":t=(0,C.__)("Please wait. Archiving variation…","cartflows"),n=(0,i.createElement)(eY,{className:"w-18 h-18 text-brand-500"});break;case"winnerStep":t=(0,C.__)("Please wait. Declaring winner…","cartflows"),n=(0,i.createElement)(XV,{className:"w-18 h-18 text-brand-500"});break;default:t=(0,C.__)("Please wait…","cartflows"),n=""}return(0,i.createElement)(bh,{open:!!e,setOpen:()=>{},exitOnClickOutside:!1,exitOnEsc:!1},(0,i.createElement)(bh.Panel,{className:"sm:max-w-sm w-full"},(0,i.createElement)(bh.Backdrop,null),(0,i.createElement)(bh.Body,{className:"flex flex-col items-center py-6"},(0,i.createElement)("div",{className:"relative"},(0,i.createElement)("div",{className:"w-16 h-16 border-brand-200 border-2 rounded-full"}),(0,i.createElement)("div",{className:"w-16 h-16 border-brand-500 border-t-2 animate-spin rounded-full absolute left-0 top-0"}),(0,i.createElement)("div",{className:"w-16 h-16 absolute left-0 top-0 flex justify-center items-center"},n)),(0,i.createElement)("p",{className:"mt-5 text-sm font-normal text-text-secondary text-center m-0"},t))))},null),(0,i.createElement)(sY,{position:"top-right",design:"stack",theme:"light",autoDismiss:!0,dismissAfter:3e3,className:"z-999999"}))))},5146(){window.wcfWpNavMenuChange=function(e){const t=cartflows_admin.admin_base_slug;let n="";"store-checkout"===e&&""!==cartflows_admin.global_checkout_id?n="admin.php?page="+t+"&path=store-checkout&action=wcf-edit-flow&flow_id="+encodeURIComponent(cartflows_admin.global_checkout_id):("store-checkout-library"===e&&(e="store-checkout"),n=e?"admin.php?page="+t+"&path="+encodeURIComponent(e):"admin.php?page="+t);const r=`.wp-submenu-wrap li > a[href$="${n}"]`,o=document.querySelectorAll(r);Array.from(document.getElementsByClassName("current")).forEach(function(e){e.parentElement.classList.contains("wp-submenu")&&e.classList.remove("current")}),Array.from(o).forEach(function(e){e.parentElement.classList.add("current")})},window.wcfUnsavedChanges=!1,window.onbeforeunload=function(){if(wcfUnsavedChanges)return"Unsaved Changes"},window.wcfCartflowsPro=function(){return!!cartflows_admin.is_pro},window.wcfCartflowsTypePro=function(){return!(!cartflows_admin.is_pro||"pro"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypePlus=function(){return!(!cartflows_admin.is_pro||"plus"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypeStarter=function(){return!(!cartflows_admin.is_pro||"starter"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypePlusPro=function(){return wcfCartflowsTypePlus()||wcfCartflowsTypePro()},window.wcfInactiveProPlus=function(){const e=cartflows_admin.cf_pro_type_inactive;return!("inactive"!==cartflows_admin.cf_pro_status||!["CartFlows Pro","CartFlows Plus"].includes(e))},window.wcfInactivepluginType=function(){let e="";switch(cartflows_admin.cf_pro_type_inactive){case"CartFlows Pro":e="pro";break;case"CartFlows Plus":e="plus";break;case"CartFlows Starter":e="starter"}return e},window.getUpgradeToProUrl=function(e=""){let t=cartflows_admin?.cf_upgrade_to_pro_url||cartflows_admin?.cf_domain_url;const n=t.includes("?");return""!==e&&(t+=n?"&"+e:"?"+e),t},window.setSureTriggersConfig=function(e){window?.SureTriggers.init(e)}},6246(e,t,n){e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822(e,t,n){"use strict";var r=n(6857),o=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?o(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},o={};return r.forEach(e.nodes(),function a(i){r.has(o,i)||(o[i]=!0,n[i]=!0,r.forEach(e.outEdges(i),function(e){r.has(n,e.w)?t.push(e):a(e.w)}),delete n[i])}),t}(e);r.forEach(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))})},undo:function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}},135(e,t,n){var r=n(6857),o=n(3988);function a(e,t,n,r,a,i){var s={width:0,height:0,rank:i,borderType:t},l=a[t][i-1],c=o.addDummyNode(e,"border",s,n);a[t][i]=c,e.setParent(c,r),l&&e.setEdge(l,c,{weight:1})}e.exports=function(e){r.forEach(e.children(),function t(n){var o=e.children(n),i=e.node(n);if(o.length&&r.forEach(o,t),r.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,l=i.maxRank+1;s<l;++s)a(e,"borderLeft","_bl",n,i,s),a(e,"borderRight","_br",n,i,s)}})}},4850(e,t,n){"use strict";var r=n(6857);function o(e){r.forEach(e.nodes(),function(t){a(e.node(t))}),r.forEach(e.edges(),function(t){a(e.edge(t))})}function a(e){var t=e.width;e.width=e.height,e.height=t}function i(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||o(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),function(t){i(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.forEach(n.points,i),r.has(n,"y")&&i(n)})}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),function(t){s(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)})}(e),o(e))}}},9859(e){function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909(e,t,n){var r=n(6857),o=n(3988),a=n(8191).Graph;e.exports={debugOrdering:function(e){var t=o.buildLayerMatrix(e),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)}),r.forEach(e.edges(),function(e){n.setEdge(e.v,e.w,{},e.name)}),r.forEach(t,function(e,t){var o="layer"+t;n.setNode(o,{rank:"same"}),r.reduce(e,function(e,t){return n.setEdge(e,t,{style:"invis"}),t})}),n}}},8191(e,t,n){var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031(e,t,n){var r=n(6857),o=n(8191).Graph,a=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new o,i=0,s=0;r.forEach(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),r.forEach(e.edges(),function(e){var r=n.edge(e.v,e.w)||0,o=t(e),a=r+o;n.setEdge(e.v,e.w,a),s=Math.max(s,n.node(e.v).out+=o),i=Math.max(i,n.node(e.w).in+=o)});var c=r.range(s+i+3).map(function(){return new a}),u=i+1;return r.forEach(n.nodes(),function(e){l(c,u,n.node(e))}),{graph:n,buckets:c,zeroIdx:u}}(e,t||i),c=function(e,t,n){for(var r,o=[],a=t[t.length-1],i=t[0];e.nodeCount();){for(;r=i.dequeue();)s(e,t,n,r);for(;r=a.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){o=o.concat(s(e,t,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,function(t){return e.outEdges(t.v,t.w)}),!0)};var i=r.constant(1);function s(e,t,n,o,a){var i=a?[]:void 0;return r.forEach(e.inEdges(o.v),function(r){var o=e.edge(r),s=e.node(r.v);a&&i.push({v:r.v,w:r.w}),s.out-=o,l(t,n,s)}),r.forEach(e.outEdges(o.v),function(r){var o=e.edge(r),a=r.w,i=e.node(a);i.in-=o,l(t,n,i)}),e.removeNode(o.v),i}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202(e,t,n){"use strict";var r=n(6857),o=n(6822),a=n(8209),i=n(9361),s=n(3988).normalizeRanks,l=n(2948),c=n(3988).removeEmptyRanks,u=n(6353),d=n(135),f=n(4850),p=n(1453),m=n(3776),h=n(3988),g=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?h.time:h.notime;n("layout",function(){var t=n(" buildLayoutGraph",function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=I(e.graph());return t.setGraph(r.merge({},y,M(n,w),r.pick(n,b))),r.forEach(e.nodes(),function(n){var o=I(e.node(n));t.setNode(n,r.defaults(M(o,v),x)),t.setParent(n,e.parent(n))}),r.forEach(e.edges(),function(n){var o=I(e.edge(n));t.setEdge(n,r.merge({},E,M(o,N),r.pick(o,_)))}),t}(e)});n(" runLayout",function(){!function(e,t){t(" makeSpaceForEdgeLabels",function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}(e)}),t(" removeSelfEdges",function(){!function(e){r.forEach(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)}),t(" acyclic",function(){o.run(e)}),t(" nestingGraph.run",function(){u.run(e)}),t(" rank",function(){i(h.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),o={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};h.addDummyNode(e,"edge-proxy",o,"_ep")}})}(e)}),t(" removeEmptyRanks",function(){c(e)}),t(" nestingGraph.cleanup",function(){u.cleanup(e)}),t(" normalizeRanks",function(){s(e)}),t(" assignRankMinMax",function(){!function(e){var t=0;r.forEach(e.nodes(),function(n){var o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=r.max(t,o.maxRank))}),e.graph().maxRank=t}(e)}),t(" removeEdgeLabelProxies",function(){!function(e){r.forEach(e.nodes(),function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}(e)}),t(" normalize.run",function(){a.run(e)}),t(" parentDummyChains",function(){l(e)}),t(" addBorderSegments",function(){d(e)}),t(" order",function(){p(e)}),t(" insertSelfEdges",function(){!function(e){var t=h.buildLayerMatrix(e);r.forEach(t,function(t){var n=0;r.forEach(t,function(t,o){var a=e.node(t);a.order=o+n,r.forEach(a.selfEdges,function(t){h.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:a.rank,order:o+ ++n,e:t.e,label:t.label},"_se")}),delete a.selfEdges})})}(e)}),t(" adjustCoordinateSystem",function(){f.adjust(e)}),t(" position",function(){m(e)}),t(" positionSelfEdges",function(){!function(e){r.forEach(e.nodes(),function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),o=r.x+r.width/2,a=r.y,i=n.x-o,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:o+2*i/3,y:a-s},{x:o+5*i/6,y:a-s},{x:o+i,y:a},{x:o+5*i/6,y:a+s},{x:o+2*i/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}(e)}),t(" removeBorderNodes",function(){!function(e){r.forEach(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),o=e.node(n.borderTop),a=e.node(n.borderBottom),i=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-i.x),n.height=Math.abs(a.y-o.y),n.x=i.x+n.width/2,n.y=o.y+n.height/2}}),r.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)}),t(" normalize.undo",function(){a.undo(e)}),t(" fixupEdgeLabelCoords",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}(e)}),t(" undoCoordinateSystem",function(){f.undo(e)}),t(" translateGraph",function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,a=0,i=e.graph(),s=i.marginx||0,l=i.marginy||0;function c(e){var r=e.x,i=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),o=Math.min(o,i-l/2),a=Math.max(a,i+l/2)}r.forEach(e.nodes(),function(t){c(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.has(n,"x")&&c(n)}),t-=s,o-=l,r.forEach(e.nodes(),function(n){var r=e.node(n);r.x-=t,r.y-=o}),r.forEach(e.edges(),function(n){var a=e.edge(n);r.forEach(a.points,function(e){e.x-=t,e.y-=o}),r.has(a,"x")&&(a.x-=t),r.has(a,"y")&&(a.y-=o)}),i.width=n-t+s,i.height=a-o+l}(e)}),t(" assignNodeIntersects",function(){!function(e){r.forEach(e.edges(),function(t){var n,r,o=e.edge(t),a=e.node(t.v),i=e.node(t.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=i,r=a),o.points.unshift(h.intersectRect(a,n)),o.points.push(h.intersectRect(i,r))})}(e)}),t(" reversePoints",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}(e)}),t(" acyclic.undo",function(){o.undo(e)})}(t,n)}),n(" updateInputGraph",function(){!function(e,t){r.forEach(e.nodes(),function(n){var r=e.node(n),o=t.node(n);r&&(r.x=o.x,r.y=o.y,t.children(n).length&&(r.width=o.width,r.height=o.height))}),r.forEach(e.edges(),function(n){var o=e.edge(n),a=t.edge(n);o.points=a.points,r.has(a,"x")&&(o.x=a.x,o.y=a.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)})})};var w=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],v=["width","height"],x={width:0,height:0},N=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},_=["labelpos"];function M(e,t){return r.mapValues(r.pick(e,t),Number)}function I(e){var t={};return r.forEach(e,function(e,n){t[n.toLowerCase()]=e}),t}},6857(e,t,n){var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(7373),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353(e,t,n){var r=n(6857),o=n(3988);function a(e,t,n,i,s,l,c){var u=e.children(c);if(u.length){var d=o.addBorderNode(e,"_bt"),f=o.addBorderNode(e,"_bb"),p=e.node(c);e.setParent(d,c),p.borderTop=d,e.setParent(f,c),p.borderBottom=f,r.forEach(u,function(r){a(e,t,n,i,s,l,r);var o=e.node(r),u=o.borderTop?o.borderTop:r,p=o.borderBottom?o.borderBottom:r,m=o.borderTop?i:2*i,h=u!==p?1:s-l[c]+1;e.setEdge(d,u,{weight:m,minlen:h,nestingEdge:!0}),e.setEdge(p,f,{weight:m,minlen:h,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,d,{weight:0,minlen:s+l[c]})}else c!==t&&e.setEdge(t,c,{weight:0,minlen:n})}e.exports={run:function(e){var t=o.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(o,a){var i=e.children(o);i&&i.length&&r.forEach(i,function(e){n(e,a+1)}),t[o]=a}return r.forEach(e.children(),function(e){n(e,1)}),t}(e),i=r.max(r.values(n))-1,s=2*i+1;e.graph().nestingRoot=t,r.forEach(e.edges(),function(t){e.edge(t).minlen*=s});var l=function(e){return r.reduce(e.edges(),function(t,n){return t+e.edge(n).weight},0)}(e)+1;r.forEach(e.children(),function(r){a(e,t,s,l,i,n,r)}),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}}},8209(e,t,n){"use strict";var r=n(6857),o=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),function(t){!function(e,t){var n,r,a,i=t.v,s=e.node(i).rank,l=t.w,c=e.node(l).rank,u=t.name,d=e.edge(t),f=d.labelRank;if(c!==s+1){for(e.removeEdge(t),a=0,++s;s<c;++a,++s)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},n=o.addDummyNode(e,"edge",r,"_d"),s===f&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(i,n,{weight:d.weight},u),0===a&&e.graph().dummyChains.push(n),i=n;e.setEdge(i,l,{weight:d.weight},u)}}(e,t)})},undo:function(e){r.forEach(e.graph().dummyChains,function(t){var n,r=e.node(t),o=r.edgeLabel;for(e.setEdge(r.edgeObj,o);r.dummy;)n=e.successors(t)[0],e.removeNode(t),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),t=n,r=e.node(t)})}}},4384(e,t,n){var r=n(6857);e.exports=function(e,t,n){var o,a={};r.forEach(n,function(n){for(var r,i,s=e.parent(n);s;){if((r=e.parent(s))?(i=a[r],a[r]=s):(i=o,o=s),i&&i!==s)return void t.setEdge(i,s);s=r}})}},3860(e,t,n){var r=n(6857);e.exports=function(e,t){return r.map(t,function(t){var n=e.inEdges(t);if(n.length){var o=r.reduce(n,function(t,n){var r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}return{v:t}})}},7860(e,t,n){var r=n(6857),o=n(8191).Graph;e.exports=function(e,t,n){var a=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),i=new o({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(t){return e.node(t)});return r.forEach(e.nodes(),function(o){var s=e.node(o),l=e.parent(o);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(i.setNode(o),i.setParent(o,l||a),r.forEach(e[n](o),function(t){var n=t.v===o?t.w:t.v,a=i.edge(n,o),s=r.isUndefined(a)?0:a.weight;i.setEdge(n,o,{weight:e.edge(t).weight+s})}),r.has(s,"minRank")&&i.setNode(o,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),i}},6639(e,t,n){"use strict";var r=n(6857);function o(e,t,n){for(var o=r.zipObject(n,r.map(n,function(e,t){return t})),a=r.flatten(r.map(t,function(t){return r.sortBy(r.map(e.outEdges(t),function(t){return{pos:o[t.w],weight:e.edge(t).weight}}),"pos")}),!0),i=1;i<n.length;)i<<=1;var s=2*i-1;i-=1;var l=r.map(new Array(s),function(){return 0}),c=0;return r.forEach(a.forEach(function(e){var t=e.pos+i;l[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;c+=e.weight*n})),c}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=o(e,t[r-1],t[r]);return n}},1453(e,t,n){"use strict";var r=n(6857),o=n(8918),a=n(6639),i=n(4520),s=n(7860),l=n(4384),c=n(8191).Graph,u=n(3988);function d(e,t,n){return r.map(t,function(t){return s(e,t,n)})}function f(e,t){var n=new c;r.forEach(e,function(e){var o=e.graph().root,a=i(e,o,n,t);r.forEach(a.vs,function(t,n){e.node(t).order=n}),l(e,n,a.vs)})}function p(e,t){r.forEach(t,function(t){r.forEach(t,function(t,n){e.node(t).order=n})})}e.exports=function(e){var t=u.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),i=d(e,r.range(t-1,-1,-1),"outEdges"),s=o(e);p(e,s);for(var l,c=Number.POSITIVE_INFINITY,m=0,h=0;h<4;++m,++h){f(m%2?n:i,m%4>=2),s=u.buildLayerMatrix(e);var g=a(e,s);g<c&&(h=0,l=r.cloneDeep(s),c=g)}p(e,l)}},8918(e,t,n){"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),function(t){return!e.children(t).length}),o=r.max(r.map(n,function(t){return e.node(t).rank})),a=r.map(r.range(o+1),function(){return[]}),i=r.sortBy(n,function(t){return e.node(t).rank});return r.forEach(i,function n(o){if(!r.has(t,o)){t[o]=!0;var i=e.node(o);a[i.rank].push(o),r.forEach(e.successors(o),n)}}),a}},4959(e,t,n){"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,function(e,t){var o=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(o.barycenter=e.barycenter,o.weight=e.weight)}),r.forEach(t.edges(),function(e){var t=n[e.v],o=n[e.w];r.isUndefined(t)||r.isUndefined(o)||(o.indegree++,t.out.push(n[e.w]))}),function(e){var t=[];function n(e){return function(t){var n,o,a,i;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(o=t,a=0,i=0,(n=e).weight&&(a+=n.barycenter*n.weight,i+=n.weight),o.weight&&(a+=o.barycenter*o.weight,i+=o.weight),n.vs=o.vs.concat(n.vs),n.barycenter=a/i,n.weight=i,n.i=Math.min(o.i,n.i),o.merged=!0)}}function o(t){return function(n){n.in.push(t),0===--n.indegree&&e.push(n)}}for(;e.length;){var a=e.pop();t.push(a),r.forEach(a.in.reverse(),n(a)),r.forEach(a.out,o(a))}return r.map(r.filter(t,function(e){return!e.merged}),function(e){return r.pick(e,["vs","i","barycenter","weight"])})}(r.filter(n,function(e){return!e.indegree}))}},4520(e,t,n){var r=n(6857),o=n(3860),a=n(4959),i=n(5169);e.exports=function e(t,n,s,l){var c=t.children(n),u=t.node(n),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(c=r.filter(c,function(e){return e!==d&&e!==f}));var m=o(t,c);r.forEach(m,function(n){if(t.children(n.v).length){var o=e(t,n.v,s,l);p[n.v]=o,r.has(o,"barycenter")&&(a=n,i=o,r.isUndefined(a.barycenter)?(a.barycenter=i.barycenter,a.weight=i.weight):(a.barycenter=(a.barycenter*a.weight+i.barycenter*i.weight)/(a.weight+i.weight),a.weight+=i.weight))}var a,i});var h=a(m,s);!function(e,t){r.forEach(e,function(e){e.vs=r.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}(h,p);var g=i(h,l);if(d&&(g.vs=r.flatten([d,g.vs,f],!0),t.predecessors(d).length)){var w=t.node(t.predecessors(d)[0]),y=t.node(t.predecessors(f)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+w.order+y.order)/(g.weight+2),g.weight+=2}return g}},5169(e,t,n){var r=n(6857),o=n(3988);function a(e,t,n){for(var o;t.length&&(o=r.last(t)).i<=n;)t.pop(),e.push(o.vs),n++;return n}e.exports=function(e,t){var n,i=o.partition(e,function(e){return r.has(e,"barycenter")}),s=i.lhs,l=r.sortBy(i.rhs,function(e){return-e.i}),c=[],u=0,d=0,f=0;s.sort((n=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i})),f=a(c,l,f),r.forEach(s,function(e){f+=e.vs.length,c.push(e.vs),u+=e.barycenter*e.weight,d+=e.weight,f=a(c,l,f)});var p={vs:r.flatten(c,!0)};return d&&(p.barycenter=u/d,p.weight=d),p}},2948(e,t,n){var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),function o(a){var i=n;r.forEach(e.children(a),o),t[a]={low:i,lim:n++}}),t}(e);r.forEach(e.graph().dummyChains,function(n){for(var r=e.node(n),o=r.edgeObj,a=function(e,t,n,r){var o,a,i=[],s=[],l=Math.min(t[n].low,t[r].low),c=Math.max(t[n].lim,t[r].lim);o=n;do{o=e.parent(o),i.push(o)}while(o&&(t[o].low>l||c>t[o].lim));for(a=o,o=r;(o=e.parent(o))!==a;)s.push(o);return{path:i.concat(s.reverse()),lca:a}}(e,t,o.v,o.w),i=a.path,s=a.lca,l=0,c=i[l],u=!0;n!==o.w;){if(r=e.node(n),u){for(;(c=i[l])!==s&&e.node(c).maxRank<r.rank;)l++;c===s&&(u=!1)}if(!u){for(;l<i.length-1&&e.node(c=i[l+1]).minRank<=r.rank;)l++;c=i[l]}e.setParent(n,c),n=e.successors(n)[0]}})}},9741(e,t,n){"use strict";var r=n(6857),o=n(8191).Graph,a=n(3988);function i(e,t){var n={};return r.reduce(t,function(t,o){var a=0,i=0,s=t.length,c=r.last(o);return r.forEach(o,function(t,u){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),function(t){return e.node(t).dummy})}(e,t),f=d?e.node(d).order:s;(d||t===c)&&(r.forEach(o.slice(i,u+1),function(t){r.forEach(e.predecessors(t),function(r){var o=e.node(r),i=o.order;!(i<a||f<i)||o.dummy&&e.node(t).dummy||l(n,r,t)})}),i=u+1,a=f)}),o}),n}function s(e,t){var n={};function o(t,o,a,i,s){var c;r.forEach(r.range(o,a),function(o){c=t[o],e.node(c).dummy&&r.forEach(e.predecessors(c),function(t){var r=e.node(t);r.dummy&&(r.order<i||r.order>s)&&l(n,t,c)})})}return r.reduce(t,function(t,n){var a,i=-1,s=0;return r.forEach(n,function(r,l){if("border"===e.node(r).dummy){var c=e.predecessors(r);c.length&&(a=e.node(c[0]).order,o(n,s,l,i,a),s=l,i=a)}o(n,s,n.length,a,t.length)}),n}),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var o=e[t];o||(e[t]=o={}),o[n]=!0}function c(e,t,n){if(t>n){var o=t;t=n,n=o}return r.has(e[t],n)}function u(e,t,n,o){var a={},i={},s={};return r.forEach(t,function(e){r.forEach(e,function(e,t){a[e]=e,i[e]=e,s[e]=t})}),r.forEach(t,function(e){var t=-1;r.forEach(e,function(e){var l=o(e);if(l.length){l=r.sortBy(l,function(e){return s[e]});for(var u=(l.length-1)/2,d=Math.floor(u),f=Math.ceil(u);d<=f;++d){var p=l[d];i[e]===e&&t<s[p]&&!c(n,e,p)&&(i[p]=e,i[e]=a[e]=a[p],t=s[p])}}})}),{root:a,align:i}}function d(e,t,n,a,i){var s={},l=function(e,t,n,a){var i=new o,s=e.graph(),l=function(e,t,n){return function(o,a,i){var s,l=o.node(a),c=o.node(i),u=0;if(u+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2}if(s&&(u+=n?s:-s),s=0,u+=(l.dummy?t:e)/2,u+=(c.dummy?t:e)/2,u+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(u+=n?s:-s),s=0,u}}(s.nodesep,s.edgesep,a);return r.forEach(t,function(t){var o;r.forEach(t,function(t){var r=n[t];if(i.setNode(r),o){var a=n[o],s=i.edge(a,r);i.setEdge(a,r,Math.max(l(e,t,o),s||0))}o=t})}),i}(e,t,n,i),c=i?"borderLeft":"borderRight";function u(e,t){for(var n=l.nodes(),r=n.pop(),o={};r;)o[r]?e(r):(o[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return u(function(e){s[e]=l.inEdges(e).reduce(function(e,t){return Math.max(e,s[t.v]+l.edge(t))},0)},l.predecessors.bind(l)),u(function(t){var n=l.outEdges(t).reduce(function(e,t){return Math.min(e,s[t.w]-l.edge(t))},Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[t]=Math.max(s[t],n))},l.successors.bind(l)),r.forEach(a,function(e){s[e]=s[n[e]]}),s}function f(e,t){return r.minBy(r.values(t),function(t){var n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return r.forIn(t,function(t,r){var a=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+a,n),o=Math.min(t-a,o)}),n-o})}function p(e,t){var n=r.values(t),o=r.min(n),a=r.max(n);r.forEach(["u","d"],function(n){r.forEach(["l","r"],function(i){var s,l=n+i,c=e[l];if(c!==t){var u=r.values(c);(s="l"===i?o-r.min(u):a-r.max(u))&&(e[l]=r.mapValues(c,function(e){return e+s}))}})})}function m(e,t){return r.mapValues(e.ul,function(n,o){if(t)return e[t.toLowerCase()][o];var a=r.sortBy(r.map(e,o));return(a[1]+a[2])/2})}e.exports={positionX:function(e){var t,n=a.buildLayerMatrix(e),o=r.merge(i(e,n),s(e,n)),l={};r.forEach(["u","d"],function(a){t="u"===a?n:r.values(n).reverse(),r.forEach(["l","r"],function(n){"r"===n&&(t=r.map(t,function(e){return r.values(e).reverse()}));var i=("u"===a?e.predecessors:e.successors).bind(e),s=u(0,t,o,i),c=d(e,t,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,function(e){return-e})),l[a+n]=c})});var c=f(e,l);return p(l,c),m(l,e.graph().align)},findType1Conflicts:i,findType2Conflicts:s,addConflict:l,hasConflict:c,verticalAlignment:u,horizontalCompaction:d,alignCoordinates:p,findSmallestWidthAlignment:f,balance:m}},3776(e,t,n){"use strict";var r=n(6857),o=n(3988),a=n(9741).positionX;e.exports=function(e){(function(e){var t=o.buildLayerMatrix(e),n=e.graph().ranksep,a=0;r.forEach(t,function(t){var o=r.max(r.map(t,function(t){return e.node(t).height}));r.forEach(t,function(t){e.node(t).y=a+o/2}),a+=o+n})})(e=o.asNonCompoundGraph(e)),r.forEach(a(e),function(t,n){e.node(n).x=t})}},8481(e,t,n){"use strict";var r=n(6857),o=n(8191).Graph,a=n(8073).slack;function i(e,t){return r.forEach(e.nodes(),function n(o){r.forEach(t.nodeEdges(o),function(r){var i=r.v,s=o===i?r.w:i;e.hasNode(s)||a(t,r)||(e.setNode(s,{}),e.setEdge(o,s,{}),n(s))})}),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return a(t,n)})}function l(e,t,n){r.forEach(e.nodes(),function(e){t.node(e).rank+=n})}e.exports=function(e){var t,n,r=new o({directed:!1}),c=e.nodes()[0],u=e.nodeCount();for(r.setNode(c,{});i(r,e)<u;)t=s(r,e),n=r.hasNode(t.v)?a(e,t):-a(e,t),l(r,e,n);return r}},9361(e,t,n){"use strict";var r=n(8073).longestPath,o=n(8481),a=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){a(e)}(e);break;case"tight-tree":!function(e){r(e),o(e)}(e);break;case"longest-path":i(e)}};var i=r},6860(e,t,n){"use strict";var r=n(6857),o=n(8481),a=n(8073).slack,i=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,c=n(3988).simplify;function u(e){e=c(e),i(e);var t,n=o(e);for(p(n),d(n,e);t=h(n);)w(n,e,t,g(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=f(e,t,n)}(e,t,n)})}function f(e,t,n){var o=e.node(n).parent,a=!0,i=t.edge(n,o),s=0;return i||(a=!1,i=t.edge(o,n)),s=i.weight,r.forEach(t.nodeEdges(n),function(r){var i,l,c=r.v===n,u=c?r.w:r.v;if(u!==o){var d=c===a,f=t.edge(r).weight;if(s+=d?f:-f,i=n,l=u,e.hasEdge(i,l)){var p=e.edge(n,u).cutvalue;s+=d?-p:p}}}),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),m(e,{},1,t)}function m(e,t,n,o,a){var i=n,s=e.node(o);return t[o]=!0,r.forEach(e.neighbors(o),function(a){r.has(t,a)||(n=m(e,t,n,a,o))}),s.low=i,s.lim=n++,a?s.parent=a:delete s.parent,n}function h(e){return r.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function g(e,t,n){var o=n.v,i=n.w;t.hasEdge(o,i)||(o=n.w,i=n.v);var s=e.node(o),l=e.node(i),c=s,u=!1;s.lim>l.lim&&(c=l,u=!0);var d=r.filter(t.edges(),function(t){return u===y(0,e.node(t.v),c)&&u!==y(0,e.node(t.w),c)});return r.minBy(d,function(e){return a(t,e)})}function w(e,t,n,o){var a=n.v,i=n.w;e.removeEdge(a,i),e.setEdge(o.v,o.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),function(e){return!t.node(e).parent}),o=s(e,n);o=o.slice(1),r.forEach(o,function(n){var r=e.node(n).parent,o=t.edge(n,r),a=!1;o||(o=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?o.minlen:-o.minlen)})}(e,t)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=u,u.initLowLimValues=p,u.initCutValues=d,u.calcCutValue=f,u.leaveEdge=h,u.enterEdge=g,u.exchangeEdges=w},8073(e,t,n){"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),function n(o){var a=e.node(o);if(r.has(t,o))return a.rank;t[o]=!0;var i=r.min(r.map(e.outEdges(o),function(t){return n(t.w)-e.edge(t).minlen}));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),a.rank=i})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988(e,t,n){"use strict";var r=n(6857),o=n(8191).Graph;function a(e,t,n,o){var a;do{a=r.uniqueId(o)}while(e.hasNode(a));return n.dummy=t,e.setNode(a,n),a}function i(e){return r.max(r.map(e.nodes(),function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n}))}e.exports={addDummyNode:a,simplify:function(e){var t=(new o).setGraph(e.graph());return r.forEach(e.nodes(),function(n){t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t},asNonCompoundGraph:function(e){var t=new o({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t},successorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.outEdges(t),function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.inEdges(t),function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,o=e.x,a=e.y,i=t.x-o,s=t.y-a,l=e.width/2,c=e.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(i)*c?(s<0&&(c=-c),n=c*i/s,r=c):(i<0&&(l=-l),n=l,r=l*s/i),{x:o+n,y:a+r}},buildLayerMatrix:function(e){var t=r.map(r.range(i(e)+1),function(){return[]});return r.forEach(e.nodes(),function(n){var o=e.node(n),a=o.rank;r.isUndefined(a)||(t[a][o.order]=n)}),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank}));r.forEach(e.nodes(),function(n){var o=e.node(n);r.has(o,"rank")&&(o.rank-=t)})},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank})),n=[];r.forEach(e.nodes(),function(r){var o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)});var o=0,a=e.graph().nodeRankFactor;r.forEach(n,function(t,n){r.isUndefined(t)&&n%a!==0?--o:o&&r.forEach(t,function(t){e.node(t).rank+=o})})},addBorderNode:function(e,t,n,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),a(e,"border",o,t)},maxRank:i,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038(e){e.exports="0.8.5"},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},1141(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 a=n(5413),i=n(6957);o(n(6957),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=s),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:s,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new i.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?a.ElementType.Tag:void 0,r=new i.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===a.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new i.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===a.ElementType.Comment)this.lastNode.data+=e;else{var t=new i.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new i.Text(""),t=new i.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 i.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=l,t.default=l},6957(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 __)}),a=this&&this.__assign||function(){return a=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},a.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 i=n(5413),s=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),N(this,e)},e}();t.Node=s;var l=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}(s);t.DataNode=l;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Text,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(l);t.Text=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Comment,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(l);t.Comment=u;var d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=i.ElementType.Directive,r}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(l);t.ProcessingInstruction=d;var f=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}(s);t.NodeWithChildren=f;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(f);t.CDATA=p;var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(f);t.Document=m;var h=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?i.ElementType.Script:"style"===t?i.ElementType.Style:i.ElementType.Tag);var a=e.call(this,r)||this;return a.name=t,a.attribs=n,a.type=o,a}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}(f);function g(e){return(0,i.isTag)(e)}function w(e){return e.type===i.ElementType.CDATA}function y(e){return e.type===i.ElementType.Text}function b(e){return e.type===i.ElementType.Comment}function v(e){return e.type===i.ElementType.Directive}function x(e){return e.type===i.ElementType.Root}function N(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?E(e.children):[],o=new h(e.name,a({},e.attribs),r);r.forEach(function(e){return e.parent=o}),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=a({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=a({},e["x-attribsPrefix"])),n=o}else if(w(e)){r=t?E(e.children):[];var i=new p(r);r.forEach(function(e){return e.parent=i}),n=i}else if(x(e)){r=t?E(e.children):[];var s=new m(r);r.forEach(function(e){return e.parent=s}),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else{if(!v(e))throw new Error("Not implemented yet: ".concat(e.type));var l=new d(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map(function(e){return N(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=h,t.isTag=g,t.isCDATA=w,t.isText=y,t.isComment=b,t.isDirective=v,t.isDocument=x,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=N},8362(e,t,n){var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619(e,t,n){var r=n(117);e.exports=function(e){var t,n={},o=[];function a(o){r.has(n,o)||(n[o]=!0,t.push(o),r.each(e.successors(o),a),r.each(e.predecessors(o),a))}return r.each(e.nodes(),function(e){t=[],a(e),t.length&&o.push(t)}),o}},9276(e,t,n){var r=n(117);function o(e,t,n,a,i,s){r.has(a,t)||(a[t]=!0,n||s.push(t),r.each(i(t),function(t){o(e,t,n,a,i,s)}),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var a=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],s={};return r.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);o(e,t,"post"===n,s,a,i)}),i}},4919(e,t,n){var r=n(8905),o=n(117);e.exports=function(e,t,n){return o.transform(e.nodes(),function(o,a){o[a]=r(e,a,t,n)},{})}},8905(e,t,n){var r=n(117),o=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var a,i,s={},l=new o,c=function(e){var t=e.v!==a?e.v:e.w,r=s[t],o=n(e),c=i.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<r.distance&&(r.distance=c,r.predecessor=a,l.decrease(t,c))};for(e.nodes().forEach(function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},l.add(e,n)});l.size()>0&&(a=l.removeMin(),(i=s[a]).distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}(e,String(t),n||a,r||function(t){return e.outEdges(t)})};var a=r.constant(1)},6678(e,t,n){var r=n(117),o=n(6291);e.exports=function(e){return r.filter(o(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},3590(e,t,n){var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},o=e.nodes();return o.forEach(function(e){r[e]={},r[e][e]={distance:0},o.forEach(function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})}),n(e).forEach(function(n){var o=n.v===e?n.w:n.v,a=t(n);r[e][o]={distance:a,predecessor:e}})}),o.forEach(function(e){var t=r[e];o.forEach(function(n){var a=r[n];o.forEach(function(n){var r=a[e],o=t[n],i=a[n],s=r.distance+o.distance;s<i.distance&&(i.distance=s,i.predecessor=o.predecessor)})})}),r}(e,t||o,n||function(t){return e.outEdges(t)})};var o=r.constant(1)},1667(e,t,n){e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(7507)}},498(e,t,n){var r=n(7507);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045(e,t,n){var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016(e,t,n){var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423(e,t,n){var r=n(117),o=n(6454),a=n(1737);e.exports=function(e,t){var n,i=new o,s={},l=new a;function c(e){var r=e.v===n?e.w:e.v,o=l.priority(r);if(void 0!==o){var a=t(e);a<o&&(s[r]=n,l.decrease(r,a))}}if(0===e.nodeCount())return i;r.each(e.nodes(),function(e){l.add(e,Number.POSITIVE_INFINITY),i.setNode(e)}),l.decrease(e.nodes()[0],0);for(var u=!1;l.size()>0;){if(n=l.removeMin(),r.has(s,n))i.setEdge(n,s[n]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(n).forEach(c)}return i}},6291(e,t,n){var r=n(117);e.exports=function(e){var t=0,n=[],o={},a=[];function i(s){var l=o[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(e){r.has(o,e)?o[e].onStack&&(l.lowlink=Math.min(l.lowlink,o[e].index)):(i(e),l.lowlink=Math.min(l.lowlink,o[e].lowlink))}),l.lowlink===l.index){var c,u=[];do{c=n.pop(),o[c].onStack=!1,u.push(c)}while(s!==c);a.push(u)}}return e.nodes().forEach(function(e){r.has(o,e)||i(e)}),a}},7507(e,t,n){var r=n(117);function o(e){var t={},n={},o=[];if(r.each(e.sinks(),function i(s){if(r.has(n,s))throw new a;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),i),delete n[s],o.push(s))}),r.size(t)!==e.nodeCount())throw new a;return o}function a(){}e.exports=o,o.CycleException=a,a.prototype=new Error},1737(e,t,n){var r=n(117);function o(){this._arr=[],this._keyIndices={}}e.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map(function(e){return e.key})},o.prototype.has=function(e){return r.has(this._keyIndices,e)},o.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var o=this._arr,a=o.length;return n[e]=a,o.push({key:e,priority:t}),this._decrease(a),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},o.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},o.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))},o.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},o.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,o=n[e],a=n[t];n[e]=a,n[t]=o,r[a.key]=e,r[o.key]=t}},6454(e,t,n){"use strict";var r=n(117);e.exports=a;var o="\0";function a(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function i(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function l(e,t,n,o){var a=""+t,i=""+n;if(!e&&a>i){var s=a;a=i,i=s}return a+""+i+""+(r.isUndefined(o)?"\0":o)}function c(e,t){return l(e,t.v,t.w,t.name)}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(e){return this._label=e,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return r.keys(this._nodes)},a.prototype.sources=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._in[t])})},a.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._out[t])})},a.prototype.setNodes=function(e,t){var n=arguments,o=this;return r.each(e,function(e){n.length>1?o.setNode(e,t):o.setNode(e)}),this},a.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},a.prototype.node=function(e){return this._nodes[e]},a.prototype.hasNode=function(e){return r.has(this._nodes,e)},a.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},a.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},a.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},a.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},a.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},a.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},a.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},a.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},a.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},a.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),r.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var o={};function a(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(o[e]=r,r):r in o?o[r]:a(r)}return this._isCompound&&r.each(t.nodes(),function(e){t.setParent(e,a(e))}),t},a.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return r.values(this._edgeObjs)},a.prototype.setPath=function(e,t){var n=this,o=arguments;return r.reduce(e,function(e,r){return o.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r}),this},a.prototype.setEdge=function(){var e,t,n,o,a=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(o=arguments[1],a=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var c=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,c))return a&&(this._edgeLabels[c]=o),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=a?o:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var o=""+t,a=""+n;if(!e&&o>a){var i=o;o=a,a=i}var s={v:o,w:a};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[c]=u,i(this._preds[t],e),i(this._sucs[e],t),this._in[t][c]=u,this._out[e][c]=u,this._edgeCount++,this},a.prototype.edge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},a.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,o)},a.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),o=this._edgeObjs[r];return o&&(e=o.v,t=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},a.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=r.values(n);return t?r.filter(o,function(e){return e.v===t}):o}},a.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=r.values(n);return t?r.filter(o,function(e){return e.w===t}):o}},a.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166(e,t,n){e.exports={Graph:n(6454),version:n(4458)}},7494(e,t,n){var r=n(117),o=n(6454);function a(e){return r.map(e.nodes(),function(t){var n=e.node(t),o=e.parent(t),a={v:t};return r.isUndefined(n)||(a.value=n),r.isUndefined(o)||(a.parent=o),a})}function i(e){return r.map(e.edges(),function(t){var n=e.edge(t),o={v:t.v,w:t.w};return r.isUndefined(t.name)||(o.name=t.name),r.isUndefined(n)||(o.value=n),o})}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:a(e),edges:i(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new o(e.options).setGraph(e.value);return r.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),r.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}},117(e,t,n){var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458(e){e.exports="2.1.8"},4499(e,t,n){"use strict";n.r(t),n.d(t,{createBrowserHistory:()=>x,createHashHistory:()=>S,createLocation:()=>p,createMemoryHistory:()=>D,createPath:()=>f,locationsAreEqual:()=>m,parsePath:()=>d});var r=n(8168),o=n(4307),a=n(8783),i=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function l(e){return"/"===e.charAt(0)?e.substr(1):e}function c(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function u(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function d(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}function f(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function p(e,t,n,a){var i;"string"==typeof e?(i=d(e)).state=t:(void 0===(i=(0,r.A)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),a?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,o.A)(i.pathname,a.pathname)):i.pathname=a.pathname:i.pathname||(i.pathname="/"),i}function m(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&(0,a.A)(e.state,t.state)}function h(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach(function(e){return e.apply(void 0,n)})}}}var g=!("undefined"==typeof window||!window.document||!window.document.createElement);function w(e,t){t(window.confirm(e))}var y="popstate",b="hashchange";function v(){try{return window.history.state||{}}catch(e){return{}}}function x(e){void 0===e&&(e={}),g||(0,i.A)(!1);var t,n=window.history,o=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),l=e,d=l.forceRefresh,m=void 0!==d&&d,x=l.getUserConfirmation,N=void 0===x?w:x,E=l.keyLength,_=void 0===E?6:E,M=e.basename?u(s(e.basename)):"";function I(e){var t=e||{},n=t.key,r=t.state,o=window.location,a=o.pathname+o.search+o.hash;return M&&(a=c(a,M)),p(a,r,n)}function S(){return Math.random().toString(36).substr(2,_)}var k=h();function D(e){(0,r.A)(F,e),F.length=n.length,k.notifyListeners(F.location,F.action)}function C(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||T(I(e.state))}function j(){T(I(v()))}var A=!1;function T(e){A?(A=!1,D()):k.confirmTransitionTo(e,"POP",N,function(t){t?D({action:"POP",location:e}):function(e){var t=F.location,n=O.indexOf(t.key);-1===n&&(n=0);var r=O.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(A=!0,P(o))}(e)})}var L=I(v()),O=[L.key];function z(e){return M+f(e)}function P(e){n.go(e)}var R=0;function U(e){1===(R+=e)&&1===e?(window.addEventListener(y,C),a&&window.addEventListener(b,j)):0===R&&(window.removeEventListener(y,C),a&&window.removeEventListener(b,j))}var B=!1,F={length:n.length,action:"POP",location:L,createHref:z,push:function(e,t){var r="PUSH",a=p(e,t,S(),F.location);k.confirmTransitionTo(a,r,N,function(e){if(e){var t=z(a),i=a.key,s=a.state;if(o)if(n.pushState({key:i,state:s},null,t),m)window.location.href=t;else{var l=O.indexOf(F.location.key),c=O.slice(0,l+1);c.push(a.key),O=c,D({action:r,location:a})}else window.location.href=t}})},replace:function(e,t){var r="REPLACE",a=p(e,t,S(),F.location);k.confirmTransitionTo(a,r,N,function(e){if(e){var t=z(a),i=a.key,s=a.state;if(o)if(n.replaceState({key:i,state:s},null,t),m)window.location.replace(t);else{var l=O.indexOf(F.location.key);-1!==l&&(O[l]=a.key),D({action:r,location:a})}else window.location.replace(t)}})},go:P,goBack:function(){P(-1)},goForward:function(){P(1)},block:function(e){void 0===e&&(e=!1);var t=k.setPrompt(e);return B||(U(1),B=!0),function(){return B&&(B=!1,U(-1)),t()}},listen:function(e){var t=k.appendListener(e);return U(1),function(){U(-1),t()}}};return F}var N="hashchange",E={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+l(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:l,decodePath:s},slash:{encodePath:s,decodePath:s}};function _(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function M(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function I(e){window.location.replace(_(window.location.href)+"#"+e)}function S(e){void 0===e&&(e={}),g||(0,i.A)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),o=n.getUserConfirmation,a=void 0===o?w:o,l=n.hashType,d=void 0===l?"slash":l,m=e.basename?u(s(e.basename)):"",y=E[d],b=y.encodePath,v=y.decodePath;function x(){var e=v(M());return m&&(e=c(e,m)),p(e)}var S=h();function k(e){(0,r.A)(B,e),B.length=t.length,S.notifyListeners(B.location,B.action)}var D=!1,C=null;function j(){var e,t,n=M(),r=b(n);if(n!==r)I(r);else{var o=x(),i=B.location;if(!D&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(C===f(o))return;C=null,function(e){if(D)D=!1,k();else{S.confirmTransitionTo(e,"POP",a,function(t){t?k({action:"POP",location:e}):function(e){var t=B.location,n=O.lastIndexOf(f(t));-1===n&&(n=0);var r=O.lastIndexOf(f(e));-1===r&&(r=0);var o=n-r;o&&(D=!0,z(o))}(e)})}}(o)}}var A=M(),T=b(A);A!==T&&I(T);var L=x(),O=[f(L)];function z(e){t.go(e)}var P=0;function R(e){1===(P+=e)&&1===e?window.addEventListener(N,j):0===P&&window.removeEventListener(N,j)}var U=!1,B={length:t.length,action:"POP",location:L,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=_(window.location.href)),n+"#"+b(m+f(e))},push:function(e,t){var n="PUSH",r=p(e,void 0,void 0,B.location);S.confirmTransitionTo(r,n,a,function(e){if(e){var t=f(r),o=b(m+t);if(M()!==o){C=t,function(e){window.location.hash=e}(o);var a=O.lastIndexOf(f(B.location)),i=O.slice(0,a+1);i.push(t),O=i,k({action:n,location:r})}else k()}})},replace:function(e,t){var n="REPLACE",r=p(e,void 0,void 0,B.location);S.confirmTransitionTo(r,n,a,function(e){if(e){var t=f(r),o=b(m+t);M()!==o&&(C=t,I(o));var a=O.indexOf(f(B.location));-1!==a&&(O[a]=t),k({action:n,location:r})}})},go:z,goBack:function(){z(-1)},goForward:function(){z(1)},block:function(e){void 0===e&&(e=!1);var t=S.setPrompt(e);return U||(R(1),U=!0),function(){return U&&(U=!1,R(-1)),t()}},listen:function(e){var t=S.appendListener(e);return R(1),function(){R(-1),t()}}};return B}function k(e,t,n){return Math.min(Math.max(e,t),n)}function D(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,o=t.initialEntries,a=void 0===o?["/"]:o,i=t.initialIndex,s=void 0===i?0:i,l=t.keyLength,c=void 0===l?6:l,u=h();function d(e){(0,r.A)(v,e),v.length=v.entries.length,u.notifyListeners(v.location,v.action)}function m(){return Math.random().toString(36).substr(2,c)}var g=k(s,0,a.length-1),w=a.map(function(e){return p(e,void 0,"string"==typeof e?m():e.key||m())}),y=f;function b(e){var t=k(v.index+e,0,v.entries.length-1),r=v.entries[t];u.confirmTransitionTo(r,"POP",n,function(e){e?d({action:"POP",location:r,index:t}):d()})}var v={length:w.length,action:"POP",location:w[g],index:g,entries:w,createHref:y,push:function(e,t){var r="PUSH",o=p(e,t,m(),v.location);u.confirmTransitionTo(o,r,n,function(e){if(e){var t=v.index+1,n=v.entries.slice(0);n.length>t?n.splice(t,n.length-t,o):n.push(o),d({action:r,location:o,index:t,entries:n})}})},replace:function(e,t){var r="REPLACE",o=p(e,t,m(),v.location);u.confirmTransitionTo(o,r,n,function(e){e&&(v.entries[v.index]=o,d({action:r,location:o}))})},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=v.index+e;return t>=0&&t<v.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return v}},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},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=p(n);o&&o!==m&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),h=l(n),g=0;g<i.length;++g){var w=i[g];if(!(a[w]||r&&r[w]||h&&h[w]||s&&s[w])){var y=f(n,w);try{c(t,w,y)}catch(e){}}}}return t}},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,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,w=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,v=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case s:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case l:return e;default:return t}}case o:return t}}}function N(e){return x(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=a,t.Lazy=g,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return N(e)||x(e)===u},t.isConcurrentMode=N,t.isContextConsumer=function(e){return x(e)===c},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===f},t.isFragment=function(e){return x(e)===a},t.isLazy=function(e){return x(e)===g},t.isMemo=function(e){return x(e)===h},t.isPortal=function(e){return x(e)===o},t.isProfiler=function(e){return x(e)===s},t.isStrictMode=function(e){return x(e)===i},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===s||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===v||e.$$typeof===w)},t.typeOf=x},3404(e,t,n){"use strict";e.exports=n(3072)},5270(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=t.CARRIAGE_RETURN_PLACEHOLDER=t.CARRIAGE_RETURN_REGEX=t.CARRIAGE_RETURN=t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,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"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{}),t.CARRIAGE_RETURN="\r",t.CARRIAGE_RETURN_REGEX=new RegExp(t.CARRIAGE_RETURN,"g"),t.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(),"__"),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(t.CARRIAGE_RETURN_PLACEHOLDER,"g")},5496(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n,u,d,f,m;e=(0,r.escapeSpecialCharacters)(e);var g=s.exec(e),w=null===(t=null==g?void 0:g[1])||void 0===t?void 0:t.toLowerCase();switch(w){case o:var y=c(e);return(0,r.hasOpenTag)(e,a)||null===(n=null==(v=y.querySelector(a))?void 0:v.parentNode)||void 0===n||n.removeChild(v),(0,r.hasOpenTag)(e,i)||null===(u=null==(v=y.querySelector(i))?void 0:v.parentNode)||void 0===u||u.removeChild(v),y.querySelectorAll(o);case a:case i:var b=l(e).querySelectorAll(w);return(0,r.hasOpenTag)(e,i)&&(0,r.hasOpenTag)(e,a)?null!==(f=null===(d=b[0].parentNode)||void 0===d?void 0:d.childNodes)&&void 0!==f?f:h():b;default:return p?p(e):null!==(m=null==(v=l(e,i).querySelector(i))?void 0:v.childNodes)&&void 0!==m?m:h();var v}};var r=n(7731),o="html",a="head",i="body",s=/<([a-zA-Z]+[0-9]?)/,l=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var d=new u;l=c=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),d.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var f=document.implementation.createHTMLDocument();l=function(e,t){if(t){var n=f.documentElement.querySelector(t);return n&&(n.innerHTML=e),f}return f.documentElement.innerHTML=e,f}}var p,m="object"==typeof document&&document.createElement("template");m&&m.content&&(p=function(e){return m.innerHTML=e,m.content.childNodes});var h=function(){return document.createDocumentFragment().childNodes}},2471(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.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t=i.exec(e),n=t?t[1]:void 0;return(0,a.formatDOM)((0,o.default)(e),null,n)};var o=r(n(5496)),a=n(7731),i=/<(![a-zA-Z\s]+)>/},7731(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatAttributes=a,t.hasOpenTag=function(e,t){var n="<"+t,r=e.toLowerCase().indexOf(n);if(-1===r)return!1;var o=e[r+n.length];return">"===o||" "===o||"\t"===o||"\n"===o||"\r"===o||"/"===o},t.escapeSpecialCharacters=function(e){return e.replace(o.CARRIAGE_RETURN_REGEX,o.CARRIAGE_RETURN_PLACEHOLDER)},t.revertEscapedCharacters=s,t.formatDOM=function e(t,n,o){var l,c,u,d;void 0===n&&(n=null);for(var f,p=[],m=0,h=t.length;m<h;m++){var g=t[m];switch(g.nodeType){case 1:var w=i(g.nodeName);(f=new r.Element(w,a(g.attributes))).children=e("template"===w?g.content.childNodes:g.childNodes,f);break;case 3:f=new r.Text(s(null!==(l=g.nodeValue)&&void 0!==l?l:""));break;case 8:f=new r.Comment(null!==(c=g.nodeValue)&&void 0!==c?c:"");break;default:continue}var y=null!==(u=p[m-1])&&void 0!==u?u:null;y&&(y.next=f),f.parent=n,f.prev=y,f.next=null,p.push(f)}return o&&((f=new r.ProcessingInstruction(o.substring(0,o.indexOf(" ")).toLowerCase(),o)).next=null!==(d=p[0])&&void 0!==d?d:null,f.parent=n,p.unshift(f),p[1]&&(p[1].prev=p[0])),p};var r=n(1141),o=n(5270);function a(e){for(var t={},n=0,r=e.length;n<r;n++){var o=e[n];t[o.name]=o.value}return t}function i(e){return function(e){return o.CASE_SENSITIVE_TAG_NAMES_MAP[e]}(e=e.toLowerCase())||e}function s(e){return e.replace(o.CARRIAGE_RETURN_PLACEHOLDER_REGEX,o.CARRIAGE_RETURN)}},840(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&s[e.type]);for(var u in e){var d=e[u];if((0,r.isCustomAttribute)(u))n[u]=d;else{var f=u.toLowerCase(),p=l(f);if(p){var m=(0,r.getPropertyInfo)(p);switch(a.includes(p)&&i.includes(t)&&!c&&(p=l("default"+f)),n[p]=d,null==m?void 0:m.type){case r.BOOLEAN:n[p]=!0;break;case r.OVERLOADED_BOOLEAN:""===d&&(n[p]=!0)}}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,o.setStyleProp)(e.style,n),n};var r=n(4210),o=n(4958),a=["checked","value"],i=["input","select","textarea"],s={reset:!0,submit:!0};function l(e){return r.possibleStandardNames[e]}},308(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.default=function e(t,n){var r,o,c,u,d;void 0===n&&(n={});for(var f=[],p="function"==typeof n.replace,m=null!==(r=n.transform)&&void 0!==r?r:i.returnFirstArg,h=null!==(o=n.library)&&void 0!==o?o:s,g=h.cloneElement,w=h.createElement,y=h.isValidElement,b=t.length,v=0;v<b;v++){var x=t[v];if(p){var N=null===(c=n.replace)||void 0===c?void 0:c.call(n,x,v);if(y(N)){b>1&&(N=g(N,{key:null!==(u=N.key)&&void 0!==u?u:v})),f.push(m(N,x,v));continue}}if("text"!==x.type){var E=x,_={};l(E)?((0,i.setStyleProp)(E.attribs.style,E.attribs),_=E.attribs):E.attribs&&(_=(0,a.default)(E.attribs,E.name));var M=void 0;switch(x.type){case"script":case"style":x.children[0]&&(_.dangerouslySetInnerHTML={__html:x.children[0].data});break;case"tag":"textarea"===x.name&&x.children[0]?_.defaultValue=x.children[0].data:(null===(d=x.children)||void 0===d?void 0:d.length)&&(M=e(x.children,n));break;default:continue}b>1&&(_.key=v),f.push(m(w(x.name,_,M),x,v))}else{var I=!x.data.trim().length;if(I&&x.parent&&!(0,i.canTextBeChildOfNode)(x.parent))continue;if(n.trim&&I)continue;f.push(m(x.data,x,v))}}return 1===f.length?f[0]:f};var o=n(1609),a=r(n(840)),i=n(4958),s={cloneElement:o.cloneElement,createElement:o.createElement,isValidElement:o.isValidElement};function l(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,i.isCustomComponent)(e.name,e.attribs)}},442(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.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){var n;if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,i.default)((0,o.default)(e,null!==(n=null==t?void 0:t.htmlparser2)&&void 0!==n?n:l),t):[]};var o=r(n(2471));t.htmlToDOM=o.default;var a=r(n(840));t.attributesToProps=a.default;var i=r(n(308));t.domToReact=i.default;var s=n(1141);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return s.Text}});var l={lowerCaseAttributeNames:!1}},4958(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.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){return e.includes("-")?!i.has(e):Boolean(t&&"string"==typeof t.is)},t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,a.default)(e,s)}catch(e){t.style={}}else t.style={}};var o=n(1609),a=r(n(5229)),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),s={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(o.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)},t.returnFirstArg=function(e){return e}},5077(e){"use strict";var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function m(){var e={line:d,column:f};return function(t){return t.position=new h(e),y(),t}}function h(e){this.start=e,this.end={line:d,column:f},this.source=l.source}function g(t){var n=new Error(l.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=f,n.source=e,!l.silent)throw n}function w(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function y(){w(r)}function b(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=m();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 g("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function x(){var e=m(),n=w(o);if(n){if(v(),!w(a))return g("property missing ':'");var r=w(i),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return w(s),l}}return h.prototype.content=e,y(),function(){var e,t=[];for(b(t);e=x();)!1!==e&&(t.push(e),b(t));return t}()}},5580(e,t,n){var r=n(6110)(n(9325),"DataView");e.exports=r},1549(e,t,n){var r=n(2032),o=n(3862),a=n(6721),i=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=i,l.prototype.set=s,e.exports=l},79(e,t,n){var r=n(3702),o=n(80),a=n(4739),i=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=i,l.prototype.set=s,e.exports=l},8223(e,t,n){var r=n(6110)(n(9325),"Map");e.exports=r},3661(e,t,n){var r=n(3040),o=n(7670),a=n(289),i=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=i,l.prototype.set=s,e.exports=l},2804(e,t,n){var r=n(6110)(n(9325),"Promise");e.exports=r},6545(e,t,n){var r=n(6110)(n(9325),"Set");e.exports=r},8859(e,t,n){var r=n(3661),o=n(1380),a=n(1459);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},7217(e,t,n){var r=n(79),o=n(1420),a=n(938),i=n(3605),s=n(9817),l=n(945);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=s,c.prototype.set=l,e.exports=c},1873(e,t,n){var r=n(9325).Symbol;e.exports=r},7828(e,t,n){var r=n(9325).Uint8Array;e.exports=r},8303(e,t,n){var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},9770(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},5325(e,t,n){var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},695(e,t,n){var r=n(8096),o=n(2428),a=n(6449),i=n(3656),s=n(361),l=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),u=!n&&o(e),d=!n&&!u&&i(e),f=!n&&!u&&!d&&l(e),p=n||u||d||f,m=p?r(e.length,String):[],h=m.length;for(var g in e)!t&&!c.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,h))||m.push(g);return m}},4932(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},4528(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},882(e){e.exports=function(e,t,n,r){var o=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++o]);++o<a;)n=t(n,e[o],o,e);return n}},4248(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},9811(e,t,n){var r=n(7237)("length");e.exports=r},7805(e,t,n){var r=n(3360),o=n(5288);e.exports=function(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547(e,t,n){var r=n(3360),o=n(5288),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var i=e[t];a.call(e,t)&&o(i,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025(e,t,n){var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733(e,t,n){var r=n(1791),o=n(5950);e.exports=function(e,t){return e&&r(t,o(t),e)}},3838(e,t,n){var r=n(1791),o=n(7241);e.exports=function(e,t){return e&&r(t,o(t),e)}},3360(e,t,n){var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999(e,t,n){var r=n(7217),o=n(3729),a=n(6547),i=n(4733),s=n(3838),l=n(3290),c=n(3007),u=n(2271),d=n(8948),f=n(2),p=n(3349),m=n(5861),h=n(6189),g=n(7199),w=n(5529),y=n(6449),b=n(3656),v=n(7730),x=n(3805),N=n(8440),E=n(5950),_=n(7241),M="[object Arguments]",I="[object Function]",S="[object Object]",k={};k[M]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[S]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[I]=k["[object WeakMap]"]=!1,e.exports=function e(t,n,D,C,j,A){var T,L=1&n,O=2&n,z=4&n;if(D&&(T=j?D(t,C,j,A):D(t)),void 0!==T)return T;if(!x(t))return t;var P=y(t);if(P){if(T=h(t),!L)return c(t,T)}else{var R=m(t),U=R==I||"[object GeneratorFunction]"==R;if(b(t))return l(t,L);if(R==S||R==M||U&&!j){if(T=O||U?{}:w(t),!L)return O?d(t,s(T,t)):u(t,i(T,t))}else{if(!k[R])return j?t:{};T=g(t,R,L)}}A||(A=new r);var B=A.get(t);if(B)return B;A.set(t,T),N(t)?t.forEach(function(r){T.add(e(r,n,D,r,t,A))}):v(t)&&t.forEach(function(r,o){T.set(o,e(r,n,D,o,t,A))});var F=P?void 0:(z?O?p:f:O?_:E)(t);return o(F||t,function(r,o){F&&(r=t[o=r]),a(T,o,e(r,n,D,o,t,A))}),T}},9344(e,t,n){var r=n(3805),o=Object.create,a=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=a},909(e,t,n){var r=n(641),o=n(8329)(r);e.exports=o},3599(e,t,n){var r=n(4394);e.exports=function(e,t,n){for(var o=-1,a=e.length;++o<a;){var i=e[o],s=t(i);if(null!=s&&(void 0===l?s==s&&!r(s):n(s,l)))var l=s,c=i}return c}},6574(e,t,n){var r=n(909);e.exports=function(e,t){var n=[];return r(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}},2523(e){e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1}},3120(e,t,n){var r=n(4528),o=n(5891);e.exports=function e(t,n,a,i,s){var l=-1,c=t.length;for(a||(a=o),s||(s=[]);++l<c;){var u=t[l];n>0&&a(u)?n>1?e(u,n-1,a,i,s):r(s,u):i||(s[s.length]=u)}return s}},6649(e,t,n){var r=n(3221)();e.exports=r},641(e,t,n){var r=n(6649),o=n(5950);e.exports=function(e,t){return e&&r(e,t,o)}},7422(e,t,n){var r=n(1769),o=n(7797);e.exports=function(e,t){for(var n=0,a=(t=r(t,e)).length;null!=e&&n<a;)e=e[o(t[n++])];return n&&n==a?e:void 0}},2199(e,t,n){var r=n(4528),o=n(6449);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},2552(e,t,n){var r=n(1873),o=n(659),a=n(9350),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},3335(e){e.exports=function(e,t){return e>t}},426(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},6131(e,t,n){var r=n(2523),o=n(5463),a=n(6959);e.exports=function(e,t,n){return t==t?a(e,t,n):r(e,o,n)}},7534(e,t,n){var r=n(2552),o=n(346);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},270(e,t,n){var r=n(7068),o=n(346);e.exports=function e(t,n,a,i,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,a,i,e,s))}},7068(e,t,n){var r=n(7217),o=n(5911),a=n(1986),i=n(689),s=n(5861),l=n(6449),c=n(3656),u=n(7167),d="[object Arguments]",f="[object Array]",p="[object Object]",m=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,h,g,w){var y=l(e),b=l(t),v=y?f:s(e),x=b?f:s(t),N=(v=v==d?p:v)==p,E=(x=x==d?p:x)==p,_=v==x;if(_&&c(e)){if(!c(t))return!1;y=!0,N=!1}if(_&&!N)return w||(w=new r),y||u(e)?o(e,t,n,h,g,w):a(e,t,v,n,h,g,w);if(!(1&n)){var M=N&&m.call(e,"__wrapped__"),I=E&&m.call(t,"__wrapped__");if(M||I){var S=M?e.value():e,k=I?t.value():t;return w||(w=new r),g(S,k,n,h,w)}}return!!_&&(w||(w=new r),i(e,t,n,h,g,w))}},9172(e,t,n){var r=n(5861),o=n(346);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},1799(e,t,n){var r=n(7217),o=n(270);e.exports=function(e,t,n,a){var i=n.length,s=i,l=!a;if(null==e)return!s;for(e=Object(e);i--;){var c=n[i];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<s;){var u=(c=n[i])[0],d=e[u],f=c[1];if(l&&c[2]){if(void 0===d&&!(u in e))return!1}else{var p=new r;if(a)var m=a(d,f,u,e,t,p);if(!(void 0===m?o(f,d,3,a,p):m))return!1}}return!0}},5463(e){e.exports=function(e){return e!=e}},5083(e,t,n){var r=n(1882),o=n(7296),a=n(3805),i=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,f=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?f:s).test(i(e))}},6038(e,t,n){var r=n(5861),o=n(346);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},4901(e,t,n){var r=n(2552),o=n(294),a=n(346),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},5389(e,t,n){var r=n(3663),o=n(7978),a=n(3488),i=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):s(e)}},8984(e,t,n){var r=n(5527),o=n(3650),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903(e,t,n){var r=n(3805),o=n(5527),a=n(181),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return a(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&i.call(e,s))&&n.push(s);return n}},6176(e){e.exports=function(e,t){return e<t}},5128(e,t,n){var r=n(909),o=n(4894);e.exports=function(e,t){var n=-1,a=o(e)?Array(e.length):[];return r(e,function(e,r,o){a[++n]=t(e,r,o)}),a}},3663(e,t,n){var r=n(1799),o=n(776),a=n(7197);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978(e,t,n){var r=n(270),o=n(8156),a=n(631),i=n(8586),s=n(756),l=n(7197),c=n(7797);e.exports=function(e,t){return i(e)&&s(t)?l(c(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},5250(e,t,n){var r=n(7217),o=n(7805),a=n(6649),i=n(2824),s=n(3805),l=n(7241),c=n(4974);e.exports=function e(t,n,u,d,f){t!==n&&a(n,function(a,l){if(f||(f=new r),s(a))i(t,n,l,u,e,d,f);else{var p=d?d(c(t,l),a,l+"",t,n,f):void 0;void 0===p&&(p=a),o(t,l,p)}},l)}},2824(e,t,n){var r=n(7805),o=n(3290),a=n(1961),i=n(3007),s=n(5529),l=n(2428),c=n(6449),u=n(3693),d=n(3656),f=n(1882),p=n(3805),m=n(1331),h=n(7167),g=n(4974),w=n(9884);e.exports=function(e,t,n,y,b,v,x){var N=g(e,n),E=g(t,n),_=x.get(E);if(_)r(e,n,_);else{var M=v?v(N,E,n+"",e,t,x):void 0,I=void 0===M;if(I){var S=c(E),k=!S&&d(E),D=!S&&!k&&h(E);M=E,S||k||D?c(N)?M=N:u(N)?M=i(N):k?(I=!1,M=o(E,!0)):D?(I=!1,M=a(E,!0)):M=[]:m(E)||l(E)?(M=N,l(N)?M=w(N):p(N)&&!f(N)||(M=s(E))):I=!1}I&&(x.set(E,M),b(M,E,y,v,x),x.delete(E)),r(e,n,M)}}},6155(e,t,n){var r=n(4932),o=n(7422),a=n(5389),i=n(5128),s=n(3937),l=n(7301),c=n(3714),u=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,function(e){return d(e)?function(t){return o(t,1===e.length?e[0]:e)}:e}):[u];var f=-1;t=r(t,l(a));var p=i(e,function(e,n,o){return{criteria:r(t,function(t){return t(e)}),index:++f,value:e}});return s(p,function(e,t){return c(e,t,n)})}},6001(e,t,n){var r=n(7420),o=n(631);e.exports=function(e,t){return r(e,t,function(t,n){return o(e,n)})}},7420(e,t,n){var r=n(7422),o=n(3170),a=n(1769);e.exports=function(e,t,n){for(var i=-1,s=t.length,l={};++i<s;){var c=t[i],u=r(e,c);n(u,c)&&o(l,a(c,e),u)}return l}},7237(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255(e,t,n){var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,o,a){for(var i=-1,s=n(t((r-e)/(o||1)),0),l=Array(s);s--;)l[a?s:++i]=e,e+=o;return l}},5558(e){e.exports=function(e,t,n,r,o){return o(e,function(e,o,a){n=r?(r=!1,e):t(n,e,o,a)}),n}},9302(e,t,n){var r=n(3488),o=n(6757),a=n(2865);e.exports=function(e,t){return a(o(e,t,r),e+"")}},3170(e,t,n){var r=n(6547),o=n(1769),a=n(361),i=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!i(e))return e;for(var c=-1,u=(t=o(t,e)).length,d=u-1,f=e;null!=f&&++c<u;){var p=s(t[c]),m=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=d){var h=f[p];void 0===(m=l?l(h,p,f):void 0)&&(m=i(h)?h:a(t[c+1])?[]:{})}r(f,p,m),f=f[p]}return e}},9570(e,t,n){var r=n(7334),o=n(3243),a=n(3488),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=i},3937(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},7556(e,t,n){var r=n(1873),o=n(4932),a=n(6449),i=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128(e,t,n){var r=n(1800),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},7301(e){e.exports=function(e){return function(t){return e(t)}}},5765(e,t,n){var r=n(8859),o=n(5325),a=n(9905),i=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var c=-1,u=o,d=e.length,f=!0,p=[],m=p;if(n)f=!1,u=a;else if(d>=200){var h=t?null:s(e);if(h)return l(h);f=!1,u=i,m=new r}else m=t?[]:p;e:for(;++c<d;){var g=e[c],w=t?t(g):g;if(g=n||0!==g?g:0,f&&w==w){for(var y=m.length;y--;)if(m[y]===w)continue e;t&&m.push(w),p.push(g)}else u(m,w,n)||(m!==p&&m.push(w),p.push(g))}return p}},514(e,t,n){var r=n(4932);e.exports=function(e,t){return r(t,function(t){return e[t]})}},1234(e){e.exports=function(e,t,n){for(var r=-1,o=e.length,a=t.length,i={};++r<o;){var s=r<a?t[r]:void 0;n(i,e[r],s)}return i}},9219(e){e.exports=function(e,t){return e.has(t)}},4066(e,t,n){var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769(e,t,n){var r=n(6449),o=n(8586),a=n(1802),i=n(3222);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},9653(e,t,n){var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290(e,t,n){e=n.nmd(e);var r=n(9325),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o?r.Buffer:void 0,s=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169(e,t,n){var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201(e){var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736(e,t,n){var r=n(1873),o=r?r.prototype:void 0,a=o?o.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},1961(e,t,n){var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730(e,t,n){var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,a=e==e,i=r(e),s=void 0!==t,l=null===t,c=t==t,u=r(t);if(!l&&!u&&!i&&e>t||i&&s&&c&&!l&&!u||o&&s&&c||!n&&c||!a)return 1;if(!o&&!i&&!u&&e<t||u&&n&&a&&!o&&!i||l&&n&&a||!s&&a||!c)return-1}return 0}},3714(e,t,n){var r=n(3730);e.exports=function(e,t,n){for(var o=-1,a=e.criteria,i=t.criteria,s=a.length,l=n.length;++o<s;){var c=r(a[o],i[o]);if(c)return o>=l?c:c*("desc"==n[o]?-1:1)}return e.index-t.index}},3007(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},1791(e,t,n){var r=n(6547),o=n(3360);e.exports=function(e,t,n,a){var i=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=a?a(n[c],e[c],c,n,e):void 0;void 0===u&&(u=e[c]),i?o(n,c,u):r(n,c,u)}return n}},2271(e,t,n){var r=n(1791),o=n(4664);e.exports=function(e,t){return r(e,o(e),t)}},8948(e,t,n){var r=n(1791),o=n(6375);e.exports=function(e,t){return r(e,o(e),t)}},5481(e,t,n){var r=n(9325)["__core-js_shared__"];e.exports=r},999(e,t,n){var r=n(9302),o=n(6800);e.exports=function(e){return r(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(a--,i):void 0,s&&o(n[0],n[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++r<a;){var l=n[r];l&&e(t,l,r,i)}return t})}},8329(e,t,n){var r=n(4894);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,s=Object(n);(t?i--:++i<a)&&!1!==o(s[i],i,s););return n}}},3221(e){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),s=i.length;s--;){var l=i[e?s:++o];if(!1===n(a[l],l,a))break}return t}}},2006(e,t,n){var r=n(5389),o=n(4894),a=n(5950);e.exports=function(e){return function(t,n,i){var s=Object(t);if(!o(t)){var l=r(n,3);t=a(t),n=function(e){return l(s[e],e,s)}}var c=e(t,n,i);return c>-1?s[l?t[c]:c]:void 0}}},5508(e,t,n){var r=n(6151),o=n(6800),a=n(7400);e.exports=function(e){return function(t,n,i){return i&&"number"!=typeof i&&o(t,n,i)&&(n=i=void 0),t=a(t),void 0===n?(n=t,t=0):n=a(n),i=void 0===i?t<n?1:-1:a(i),r(t,n,i,e)}}},4517(e,t,n){var r=n(6545),o=n(3950),a=n(4247),i=r&&1/a(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=i},3243(e,t,n){var r=n(6110),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},5911(e,t,n){var r=n(8859),o=n(4248),a=n(9219);e.exports=function(e,t,n,i,s,l){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var m=-1,h=!0,g=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++m<u;){var w=e[m],y=t[m];if(i)var b=c?i(y,w,m,t,e,l):i(w,y,m,e,t,l);if(void 0!==b){if(b)continue;h=!1;break}if(g){if(!o(t,function(e,t){if(!a(g,t)&&(w===e||s(w,e,n,i,l)))return g.push(t)})){h=!1;break}}else if(w!==y&&!s(w,y,n,i,l)){h=!1;break}}return l.delete(e),l.delete(t),h}},1986(e,t,n){var r=n(1873),o=n(7828),a=n(5288),i=n(5911),s=n(317),l=n(4247),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var m=1&r;if(p||(p=l),e.size!=t.size&&!m)return!1;var h=f.get(e);if(h)return h==t;r|=2,f.set(e,t);var g=i(p(e),p(t),r,c,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},689(e,t,n){var r=n(2),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,s){var l=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!l)return!1;for(var d=u;d--;){var f=c[d];if(!(l?f in t:o.call(t,f)))return!1}var p=s.get(e),m=s.get(t);if(p&&m)return p==t&&m==e;var h=!0;s.set(e,t),s.set(t,e);for(var g=l;++d<u;){var w=e[f=c[d]],y=t[f];if(a)var b=l?a(y,w,f,t,e,s):a(w,y,f,e,t,s);if(!(void 0===b?w===y||i(w,y,n,a,s):b)){h=!1;break}g||(g="constructor"==f)}if(h&&!g){var v=e.constructor,x=t.constructor;v==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof x&&x instanceof x||(h=!1)}return s.delete(e),s.delete(t),h}},8816(e,t,n){var r=n(5970),o=n(6757),a=n(2865);e.exports=function(e){return a(o(e,void 0,r),e+"")}},4840(e){var t="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;e.exports=t},2(e,t,n){var r=n(2199),o=n(4664),a=n(5950);e.exports=function(e){return r(e,a,o)}},3349(e,t,n){var r=n(2199),o=n(6375),a=n(7241);e.exports=function(e){return r(e,a,o)}},2651(e,t,n){var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776(e,t,n){var r=n(756),o=n(5950);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},6110(e,t,n){var r=n(5083),o=n(392);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},8879(e,t,n){var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659(e,t,n){var r=n(1873),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[s]=n:delete e[s]),o}},4664(e,t,n){var r=n(9770),o=n(3345),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(e){return null==e?[]:(e=Object(e),r(i(e),function(t){return a.call(e,t)}))}:o;e.exports=s},6375(e,t,n){var r=n(4528),o=n(8879),a=n(4664),i=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,a(e)),e=o(e);return t}:i;e.exports=s},5861(e,t,n){var r=n(5580),o=n(8223),a=n(2804),i=n(6545),s=n(8303),l=n(2552),c=n(7473),u="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",m="[object DataView]",h=c(r),g=c(o),w=c(a),y=c(i),b=c(s),v=l;(r&&v(new r(new ArrayBuffer(1)))!=m||o&&v(new o)!=u||a&&v(a.resolve())!=d||i&&v(new i)!=f||s&&v(new s)!=p)&&(v=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case h:return m;case g:return u;case w:return d;case y:return f;case b:return p}return t}),e.exports=v},392(e){e.exports=function(e,t){return null==e?void 0:e[t]}},9326(e,t,n){var r=n(1769),o=n(2428),a=n(6449),i=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var c=-1,u=(t=r(t,e)).length,d=!1;++c<u;){var f=l(t[c]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&s(u)&&i(f,u)&&(a(e)||o(e))}},9698(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032(e,t,n){var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721(e,t,n){var r=n(1042),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},2749(e,t,n){var r=n(1042),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},5749(e,t,n){var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199(e,t,n){var r=n(9653),o=n(6169),a=n(3201),i=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return a(e);case"[object Symbol]":return i(e)}}},5529(e,t,n){var r=n(9344),o=n(8879),a=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:r(o(e))}},5891(e,t,n){var r=n(1873),o=n(2428),a=n(6449),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},361(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},6800(e,t,n){var r=n(5288),o=n(4894),a=n(361),i=n(3805);e.exports=function(e,t,n){if(!i(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&a(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586(e,t,n){var r=n(6449),o=n(4394),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},4218(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296(e,t,n){var r,o=n(5481),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},5527(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756(e,t,n){var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702(e){e.exports=function(){this.__data__=[],this.size=0}},80(e,t,n){var r=n(6025),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},4739(e,t,n){var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655(e,t,n){var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175(e,t,n){var r=n(6025);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},3040(e,t,n){var r=n(1549),o=n(79),a=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},7670(e,t,n){var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949(e,t,n){var r=n(2651);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},317(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},7197(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224(e,t,n){var r=n(104);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},1042(e,t,n){var r=n(6110)(Object,"create");e.exports=r},3650(e,t,n){var r=n(4335)(Object.keys,Object);e.exports=r},181(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009(e,t,n){e=n.nmd(e);var r=n(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,s=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(n){return e(t(n))}}},6757(e,t,n){var r=n(1033),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,i=-1,s=o(a.length-t,0),l=Array(s);++i<s;)l[i]=a[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=a[i];return c[t]=n(l),r(e,this,c)}}},9325(e,t,n){var r=n(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},4974(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459(e){e.exports=function(e){return this.__data__.has(e)}},4247(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},2865(e,t,n){var r=n(9570),o=n(1811)(r);e.exports=o},1811(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),a=16-(o-r);if(r=o,a>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,n){var r=n(79),o=n(8223),a=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},6959(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},1993(e,t,n){var r=n(9811),o=n(9698),a=n(7927);e.exports=function(e){return o(e)?a(e):r(e)}},1802(e,t,n){var r=n(2224),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)}),t});e.exports=i},7797(e,t,n){var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927(e){var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",a="[^"+t+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+o+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[a,i,s].join("|")+")"+c+l+")*",d="(?:"+[a+r+"?",r,i,s,n].join("|")+")",f=RegExp(o+"(?="+o+")|"+d+u,"g");e.exports=function(e){for(var t=f.lastIndex=0;f.test(e);)++t;return t}},2629(e,t,n){var r=n(9999);e.exports=function(e){return r(e,4)}},8055(e,t,n){var r=n(9999);e.exports=function(e){return r(e,5)}},7334(e){e.exports=function(e){return function(){return e}}},4684(e,t,n){var r=n(9302),o=n(5288),a=n(6800),i=n(7241),s=Object.prototype,l=s.hasOwnProperty,c=r(function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&a(t[0],t[1],c)&&(r=1);++n<r;)for(var u=t[n],d=i(u),f=-1,p=d.length;++f<p;){var m=d[f],h=e[m];(void 0===h||o(h,s[m])&&!l.call(e,m))&&(e[m]=u[m])}return e});e.exports=c},6135(e,t,n){e.exports=n(7373)},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612(e,t,n){var r=n(9770),o=n(6574),a=n(5389),i=n(6449);e.exports=function(e,t){return(i(e)?r:o)(e,a(t,3))}},7309(e,t,n){var r=n(2006)(n(4713));e.exports=r},4713(e,t,n){var r=n(2523),o=n(5389),a=n(1489),i=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:a(n);return l<0&&(l=i(s+l,0)),r(e,o(t,3),l)}},5970(e,t,n){var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},7373(e,t,n){var r=n(3729),o=n(909),a=n(4066),i=n(6449);e.exports=function(e,t){return(i(e)?r:o)(e,a(t))}},2420(e,t,n){var r=n(6649),o=n(4066),a=n(7241);e.exports=function(e,t){return null==e?e:r(e,o(t),a)}},8156(e,t,n){var r=n(7422);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},1448(e,t,n){var r=n(426),o=n(9326);e.exports=function(e,t){return null!=e&&o(e,t,r)}},631(e,t,n){var r=n(8077),o=n(9326);e.exports=function(e,t){return null!=e&&o(e,t,r)}},3488(e){e.exports=function(e){return e}},2428(e,t,n){var r=n(7534),o=n(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,n){var r=n(1882),o=n(294);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},3693(e,t,n){var r=n(4894),o=n(346);e.exports=function(e){return o(e)&&r(e)}},3656(e,t,n){e=n.nmd(e);var r=n(9325),o=n(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},2193(e,t,n){var r=n(8984),o=n(5861),a=n(2428),i=n(6449),s=n(4894),l=n(3656),c=n(5527),u=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||a(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882(e,t,n){var r=n(2552),o=n(3805);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,n){var r=n(9172),o=n(7301),a=n(6009),i=a&&a.isMap,s=i?o(i):r;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1331(e,t,n){var r=n(2552),o=n(8879),a=n(346),i=Function.prototype,s=Object.prototype,l=i.toString,c=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},8440(e,t,n){var r=n(6038),o=n(7301),a=n(6009),i=a&&a.isSet,s=i?o(i):r;e.exports=s},5015(e,t,n){var r=n(2552),o=n(6449),a=n(346);e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&"[object String]"==r(e)}},4394(e,t,n){var r=n(2552),o=n(346);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7167(e,t,n){var r=n(4901),o=n(7301),a=n(6009),i=a&&a.isTypedArray,s=i?o(i):r;e.exports=s},2216(e){e.exports=function(e){return void 0===e}},5950(e,t,n){var r=n(695),o=n(8984),a=n(4894);e.exports=function(e){return a(e)?r(e):o(e)}},7241(e,t,n){var r=n(695),o=n(2903),a=n(4894);e.exports=function(e){return a(e)?r(e,!0):o(e)}},8090(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378(e,t,n){var r=n(4932),o=n(5389),a=n(5128),i=n(6449);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},3916(e,t,n){var r=n(3360),o=n(641),a=n(5389);e.exports=function(e,t){var n={};return t=a(t,3),o(e,function(e,o,a){r(n,o,t(e,o,a))}),n}},4506(e,t,n){var r=n(3599),o=n(3335),a=n(3488);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},104(e,t,n){var r=n(3661);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},5364(e,t,n){var r=n(5250),o=n(999)(function(e,t,n){r(e,t,n)});e.exports=o},1684(e,t,n){var r=n(3599),o=n(6176),a=n(3488);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},6533(e,t,n){var r=n(3599),o=n(5389),a=n(6176);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),a):void 0}},3950(e){e.exports=function(){}},124(e,t,n){var r=n(9325);e.exports=function(){return r.Date.now()}},4383(e,t,n){var r=n(6001),o=n(8816)(function(e,t){return null==e?{}:r(e,t)});e.exports=o},583(e,t,n){var r=n(7237),o=n(7255),a=n(8586),i=n(7797);e.exports=function(e){return a(e)?r(i(e)):o(e)}},3181(e,t,n){var r=n(5508)();e.exports=r},860(e,t,n){var r=n(882),o=n(909),a=n(5389),i=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:i,c=arguments.length<3;return l(e,a(t,4),n,c,o)}},7091(e,t,n){var r=n(8984),o=n(5861),a=n(4894),i=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(a(e))return i(e)?s(e):e.length;var t=o(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031(e,t,n){var r=n(3120),o=n(6155),a=n(9302),i=n(6800),s=a(function(e,t){if(null==e)return[];var n=t.length;return n>1&&i(e,t[0],t[1])?t=[]:n>2&&i(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])});e.exports=s},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},7400(e,t,n){var r=n(9374),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489(e,t,n){var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374(e,t,n){var r=n(4128),o=n(3805),a=n(4394),i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}},9884(e,t,n){var r=n(1791),o=n(7241);e.exports=function(e){return r(e,o(e))}},3222(e,t,n){var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752(e,t,n){var r=n(3729),o=n(9344),a=n(641),i=n(5389),s=n(8879),l=n(6449),c=n(3656),u=n(1882),d=n(3805),f=n(7167);e.exports=function(e,t,n){var p=l(e),m=p||c(e)||f(e);if(t=i(t,4),null==n){var h=e&&e.constructor;n=m?p?new h:[]:d(e)&&u(h)?o(s(e)):{}}return(m?r:a)(e,function(e,r,o){return t(n,e,r,o)}),n}},299(e,t,n){var r=n(3120),o=n(9302),a=n(5765),i=n(3693),s=o(function(e){return a(r(e,1,i,!0))});e.exports=s},7200(e,t,n){var r=n(3222),o=0;e.exports=function(e){var t=++o;return r(e)+t}},5880(e,t,n){var r=n(514),o=n(5950);e.exports=function(e){return null==e?[]:r(e,o(e))}},7248(e,t,n){var r=n(6547),o=n(1234);e.exports=function(e,t){return o(e||[],t||[],r)}},2694(e,t,n){"use strict";var r=n(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=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 s.name="Invariant Violation",s}}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:a,resetWarningCache:o};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5338(e,t,n){"use strict";var r=n(5795);t.H=r.createRoot,r.hydrateRoot},4496(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultArea=void 0,t.defaultArea="default-area"},4601(e,t,n){"use strict";Object.defineProperty(t,"$h",{enumerable:!0,get:function(){return r.trackPromise}}),Object.defineProperty(t,"H8",{enumerable:!0,get:function(){return o.usePromiseTracker}});var r=n(2609),o=(n(4951),n(5398))},5590(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupConfig=t.defaultConfig=void 0;var r=n(4496),o={area:r.defaultArea,delay:0};t.defaultConfig=o,t.setupConfig=function(e){return{area:e&&e.area?e.area:r.defaultArea,delay:e&&e.delay?e.delay:0}}},9220(e,t){"use strict";function n(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 r(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)}}Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,o;return t=e,o=[{key:"emit",value:function(e){if(!e)return this;for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];var a,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}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 i,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw i}}}}(this._e(e));try{for(i.s();!(a=i.n()).done;){var s=a.value;s.apply(s.ctx,[].concat(r)),1==s.off_event&&this.off(e,s)}}catch(e){i.e(e)}finally{i.f()}return this}},{key:"on",value:function(e,t,n){return e?(t.ctx=n,this._e(e).push(t),this):this}},{key:"once",value:function(e,t,n){return e?(t.ctx=n,t.off_event=!0,this.on(e,t)):this}},{key:"off",value:function(e,t){if(!e)return this;if(!this[e])return this;var n=this._e(e);return t?(this[e]=n.filter(function(e){return e!=t}),this):(delete this[e],this)}},{key:"_e",value:function(e){return this[e]||(this[e]=[])}}],o&&r(t.prototype,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.Emitter=o},2609(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackPromise=t.promiseCounterUpdateEventId=t.manuallyResetPromiseCounter=t.manuallyIncrementPromiseCounter=t.manuallyDecrementPromiseCounter=t.getCounter=t.emitter=void 0;var r=n(9220),o=n(4496),a=new r.Emitter;t.emitter=a;var i="promise-counter-update";t.promiseCounterUpdateEventId=i;var s,l,c=(s={},(l=o.defaultArea)in s?Object.defineProperty(s,l,{value:0,enumerable:!0,configurable:!0,writable:!0}):s[l]=0,s);t.getCounter=function(e){return c[e]},t.trackPromise=function(e,t){t=t||o.defaultArea,u(t);var n=function(){return p(t)};return e.then(n,n),e};var u=function(e){d(e);var t=f(e);a.emit(i,t,e)},d=function(e){Boolean(c[e])?c[e]++:c[e]=1},f=function(e){return c[e]>0},p=function(e){c[e]>0&&m(e);var t=f(e);a.emit(i,t,e)},m=function(e){c[e]--};t.manuallyResetPromiseCounter=function(e){e=e||o.defaultArea,c[e]=0,a.emit(i,!1,e)},t.manuallyDecrementPromiseCounter=function(e){e=e||o.defaultArea,p(e)},t.manuallyIncrementPromiseCounter=function(e){e=e||o.defaultArea,u(e)}},4951(e,t,n){"use strict";function r(e){return r="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},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.promiseTrackerHoc=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}(n(1609)),a=n(2609),i=n(5590);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function l(){return l=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},l.apply(this,arguments)}function c(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 u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}t.promiseTrackerHoc=function(e){return function(t){!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&&u(e,t)}(g,t);var n,s,p,m,h=(p=g,m=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=f(p);if(m){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}(this,e)});function g(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),(t=h.call(this,e)).state={promiseInProgress:!1,internalPromiseInProgress:!1,config:(0,i.setupConfig)(e.config)},t.notifyPromiseInProgress=t.notifyPromiseInProgress.bind(d(t)),t.updateProgress=t.updateProgress.bind(d(t)),t.subscribeToCounterUpdate=t.subscribeToCounterUpdate.bind(d(t)),t}return n=g,(s=[{key:"notifyPromiseInProgress",value:function(){var e=this;0===this.state.config.delay?this.setState({promiseInProgress:!0}):setTimeout(function(){var t=Boolean((0,a.getCounter)(e.state.config.area)>0);e.setState({promiseInProgress:t})},this.state.config.delay)}},{key:"updateProgress",value:function(e,t){this.setState({internalPromiseInProgress:e},t),e?this.notifyPromiseInProgress():this.setState({promiseInProgress:!1})}},{key:"subscribeToCounterUpdate",value:function(){var e=this;a.emitter.on(a.promiseCounterUpdateEventId,function(t,n){e.state.config.area===n&&e.updateProgress(t)})}},{key:"componentDidMount",value:function(){this.updateProgress(Boolean((0,a.getCounter)(this.state.config.area)>0),this.subscribeToCounterUpdate)}},{key:"componentWillUnmount",value:function(){a.emitter.off(a.promiseCounterUpdateEventId)}},{key:"render",value:function(){return o.default.createElement(e,l({},this.props,{config:this.state.config,promiseInProgress:this.state.promiseInProgress}))}}])&&c(n.prototype,s),Object.defineProperty(n,"prototype",{writable:!1}),g}(o.Component)}},5398(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePromiseTracker=void 0;var r,o=(r=n(1609))&&r.__esModule?r:{default:r},a=n(2609),i=n(5590);function s(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,a=[],_n=!0,i=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(i)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(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}t.usePromiseTracker=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.defaultConfig,t=o.default.useRef(!1);o.default.useEffect(function(){return t.current=!0,function(){return t.current=!1}},[]);var n=s(o.default.useState((0,i.setupConfig)(e)),1)[0];o.default.useEffect(function(){t.current&&n&&n.area&&(0,a.getCounter)(n.area)>0&&(c(!0),f(!0))},[n]);var r=s(o.default.useState(!1),2),l=r[0],c=r[1],u=s(o.default.useState(!1),2),d=u[0],f=u[1],p=o.default.useRef(l),m=function(e,r){t.current&&n.area===r&&(c(e),p.current=e,e?n&&n.delay&&0!==n.delay?setTimeout(function(){t.current&&p.current&&f(!0)},n.delay):f(!0):f(!1))};return o.default.useEffect(function(){return p.current=l,a.emitter.on(a.promiseCounterUpdateEventId,m),function(){return a.emitter.off(a.promiseCounterUpdateEventId,m)}},[]),{promiseInProgress:d}}},4210(e,t,n){"use strict";function r(e,t,n,r,o,a,i){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=a,this.removeEmptyString=i}const o={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(e=>{o[e]=new r(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([e,t])=>{o[e]=new r(e,1,!1,t,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(e=>{o[e]=new r(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(e=>{o[e]=new r(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(e=>{o[e]=new r(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(e=>{o[e]=new r(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(e=>{o[e]=new r(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(e=>{o[e]=new r(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(e=>{o[e]=new r(e,5,!1,e.toLowerCase(),null,!1,!1)});const a=/[\-\:]([a-z])/g,i=e=>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(e=>{const t=e.replace(a,i);o[t]=new r(t,1,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(e=>{const t=e.replace(a,i);o[t]=new r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(e=>{const t=e.replace(a,i);o[t]=new r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!1,!1)}),o.xlinkHref=new r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!0,!0)});const{CAMELCASE:s,SAME:l,possibleStandardNames:c}=n(6811),u=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]*$")),d=Object.keys(c).reduce((e,t)=>{const n=c[t];return n===l?e[t]=t:n===s?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 o.hasOwnProperty(e)?o[e]:null},t.isCustomAttribute=u,t.possibleStandardNames=d},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}},9296(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=n(6347),a=r(n(1609)),i=n(4499);n(5556),n(7573);var s=r(n(7676));function l(){return(l=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}).apply(this,arguments)}function c(e,t){e.prototype=Object.create(t.prototype),u(e.prototype.constructor=e,t)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=i.createBrowserHistory(t.props),t}c(t,e),t.prototype.render=function(){return a.createElement(o.Router,{history:this.history,children:this.props.children})}})(a.Component),function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=i.createHashHistory(t.props),t}c(t,e),t.prototype.render=function(){return a.createElement(o.Router,{history:this.history,children:this.props.children})}}(a.Component);var f=function(e,t){return"function"==typeof e?e(t):e},p=function(e,t){return"string"==typeof e?i.createLocation(e,null,null,t):e},m=function(e){return e},h=a.forwardRef;void 0===h&&(h=m);var g=h(function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=d(e,["innerRef","navigate","onClick"]),s=i.target,c=l({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=m!==h&&t||n,a.createElement("a",c)}),w=h(function(e,t){var n=e.component,r=void 0===n?g:n,c=e.replace,u=e.to,w=e.innerRef,y=d(e,["component","replace","to","innerRef"]);return a.createElement(o.__RouterContext.Consumer,null,function(e){e||s(!1);var n=e.history,o=p(f(u,e.location),e.location),d=o?n.createHref(o):"",g=l({},y,{href:d,navigate:function(){var t=f(u,e.location),r=i.createPath(e.location)===i.createPath(p(t));(c||r?n.replace:n.push)(t)}});return m!==h?g.ref=t||w:g.innerRef=w,a.createElement(r,g)})}),y=function(e){return e},b=a.forwardRef;void 0===b&&(b=y);b(function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,i=e.activeClassName,c=void 0===i?"active":i,u=e.activeStyle,m=e.className,h=e.exact,g=e.isActive,v=e.location,x=e.sensitive,N=e.strict,E=e.style,_=e.to,M=e.innerRef,I=d(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return a.createElement(o.__RouterContext.Consumer,null,function(e){e||s(!1);var n=v||e.location,i=p(f(_,n),n),d=i.pathname,S=d&&d.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),k=S?o.matchPath(n.pathname,{path:S,exact:h,sensitive:x,strict:N}):null,D=!!(g?g(k,n):k),C="function"==typeof m?m(D):m,j="function"==typeof E?E(D):E;D&&(C=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return e}).join(" ")}(C,c),j=l({},j,u));var A=l({"aria-current":D&&r||null,className:C,style:j,to:i},I);return y!==b?A.ref=t||M:A.innerRef=M,a.createElement(w,A)})});Object.defineProperty(t,"W6",{enumerable:!0,get:function(){return o.useHistory}})},6347(e,t,n){"use strict";n.r(t),n.d(t,{MemoryRouter:()=>E,Prompt:()=>M,Redirect:()=>D,Route:()=>T,Router:()=>N,StaticRouter:()=>U,Switch:()=>B,__HistoryContext:()=>v,__RouterContext:()=>x,generatePath:()=>k,matchPath:()=>A,useHistory:()=>V,useLocation:()=>Y,useParams:()=>Z,useRouteMatch:()=>W,withRouter:()=>F});var r=n(7387),o=n(1609),a=n.n(o),i=n(5556),s=n.n(i),l=n(4499),c=n(1561),u=n(8168),d=n(8505),f=n.n(d),p=(n(7564),n(8587)),m=n(4146),h=n.n(m),g=1073741823,w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},y=a().createContext||function(e,t){var n,o,i,l="__create-react-context-"+((w[i="__global_unique_id__"]=(w[i]||0)+1)+"__"),c=function(e){function n(){for(var t,n,r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(t=e.call.apply(e,[this].concat(a))||this).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(e){r=r.filter(function(t){return t!==e})},get:function(){return n},set:function(e,t){n=e,r.forEach(function(e){return e(n,t)})}}),t}(0,r.A)(n,e);var o=n.prototype;return o.getChildContext=function(){var e;return(e={})[l]=this.emitter,e},o.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((a=r)===(i=o)?0!==a||1/a==1/i:a!=a&&i!=i)?n=0:(n="function"==typeof t?t(r,o):g,0!=(n|=0)&&this.emitter.set(e.value,n))}var a,i},o.render=function(){return this.props.children},n}(a().Component);c.childContextTypes=((n={})[l]=s().object.isRequired,n);var u=function(t){function n(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))||this).observedBits=void 0,e.state={value:e.getValue()},e.onUpdate=function(t,n){(0|e.observedBits)&n&&e.setState({value:e.getValue()})},e}(0,r.A)(n,t);var o=n.prototype;return o.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?g:t},o.componentDidMount=function(){this.context[l]&&this.context[l].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?g:e},o.componentWillUnmount=function(){this.context[l]&&this.context[l].off(this.onUpdate)},o.getValue=function(){return this.context[l]?this.context[l].get():e},o.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(a().Component);return u.contextTypes=((o={})[l]=s().object,o),{Provider:c,Consumer:u}},b=function(e){var t=y();return t.displayName=e,t},v=b("Router-History"),x=b("Router"),N=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen(function(e){n._pendingLocation=e})),n}(0,r.A)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen(function(t){e._isMounted&&e.setState({location:t})})),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return a().createElement(x.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a().createElement(v.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a().Component),E=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,l.createMemoryHistory)(t.props),t}return(0,r.A)(t,e),t.prototype.render=function(){return a().createElement(N,{history:this.history,children:this.props.children})},t}(a().Component),_=function(e){function t(){return e.apply(this,arguments)||this}(0,r.A)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(a().Component);function M(e){var t=e.message,n=e.when,r=void 0===n||n;return a().createElement(x.Consumer,null,function(e){if(e||(0,c.A)(!1),!r||e.staticContext)return null;var n=e.history.block;return a().createElement(_,{onMount:function(e){e.release=n(t)},onUpdate:function(e,r){r.message!==t&&(e.release(),e.release=n(t))},onUnmount:function(e){e.release()},message:t})})}var I={},S=0;function k(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(I[e])return I[e];var t=f().compile(e);return S<1e4&&(I[e]=t,S++),t}(e)(t,{pretty:!0})}function D(e){var t=e.computedMatch,n=e.to,r=e.push,o=void 0!==r&&r;return a().createElement(x.Consumer,null,function(e){e||(0,c.A)(!1);var r=e.history,i=e.staticContext,s=o?r.push:r.replace,d=(0,l.createLocation)(t?"string"==typeof n?k(n,t.params):(0,u.A)({},n,{pathname:k(n.pathname,t.params)}):n);return i?(s(d),null):a().createElement(_,{onMount:function(){s(d)},onUpdate:function(e,t){var n=(0,l.createLocation)(t.to);(0,l.locationsAreEqual)(n,(0,u.A)({},d,{key:n.key}))||s(d)},to:n})})}var C={},j=0;function A(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,a=void 0!==o&&o,i=n.strict,s=void 0!==i&&i,l=n.sensitive,c=void 0!==l&&l;return[].concat(r).reduce(function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=C[n]||(C[n]={});if(r[e])return r[e];var o=[],a={regexp:f()(e,o,t),keys:o};return j<1e4&&(r[e]=a,j++),a}(n,{end:a,strict:s,sensitive:c}),o=r.regexp,i=r.keys,l=o.exec(e);if(!l)return null;var u=l[0],d=l.slice(1),p=e===u;return a&&!p?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:p,params:i.reduce(function(e,t,n){return e[t.name]=d[n],e},{})}},null)}var T=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){var e=this;return a().createElement(x.Consumer,null,function(t){t||(0,c.A)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?A(n.pathname,e.props):t.match,o=(0,u.A)({},t,{location:n,match:r}),i=e.props,s=i.children,l=i.component,d=i.render;return Array.isArray(s)&&function(e){return 0===a().Children.count(e)}(s)&&(s=null),a().createElement(x.Provider,{value:o},o.match?s?"function"==typeof s?s(o):s:l?a().createElement(l,o):d?d(o):null:"function"==typeof s?s(o):null)})},t}(a().Component);function L(e){return"/"===e.charAt(0)?e:"/"+e}function O(e,t){if(!e)return t;var n=L(e);return 0!==t.pathname.indexOf(n)?t:(0,u.A)({},t,{pathname:t.pathname.substr(n.length)})}function z(e){return"string"==typeof e?e:(0,l.createPath)(e)}function P(e){return function(){(0,c.A)(!1)}}function R(){}var U=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).handlePush=function(e){return t.navigateTo(e,"PUSH")},t.handleReplace=function(e){return t.navigateTo(e,"REPLACE")},t.handleListen=function(){return R},t.handleBlock=function(){return R},t}(0,r.A)(t,e);var n=t.prototype;return n.navigateTo=function(e,t){var n=this.props,r=n.basename,o=void 0===r?"":r,a=n.context,i=void 0===a?{}:a;i.action=t,i.location=function(e,t){return e?(0,u.A)({},t,{pathname:L(e)+t.pathname}):t}(o,(0,l.createLocation)(e)),i.url=z(i.location)},n.render=function(){var e=this.props,t=e.basename,n=void 0===t?"":t,r=e.context,o=void 0===r?{}:r,i=e.location,s=void 0===i?"/":i,c=(0,p.A)(e,["basename","context","location"]),d={createHref:function(e){return L(n+z(e))},action:"POP",location:O(n,(0,l.createLocation)(s)),push:this.handlePush,replace:this.handleReplace,go:P(),goBack:P(),goForward:P(),listen:this.handleListen,block:this.handleBlock};return a().createElement(N,(0,u.A)({},c,{history:d,staticContext:o}))},t}(a().Component),B=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){var e=this;return a().createElement(x.Consumer,null,function(t){t||(0,c.A)(!1);var n,r,o=e.props.location||t.location;return a().Children.forEach(e.props.children,function(e){if(null==r&&a().isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?A(o.pathname,(0,u.A)({},e.props,{path:i})):t.match}}),r?a().cloneElement(n,{location:o,computedMatch:r}):null})},t}(a().Component);function F(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=(0,p.A)(t,["wrappedComponentRef"]);return a().createElement(x.Consumer,null,function(t){return t||(0,c.A)(!1),a().createElement(e,(0,u.A)({},r,t,{ref:n}))})};return n.displayName=t,n.WrappedComponent=e,h()(n,e)}var Q=a().useContext;function V(){return Q(v)}function Y(){return Q(x).location}function Z(){var e=Q(x).match;return e?e.params:{}}function W(e){var t=Y(),n=Q(x).match;return e?A(t.pathname,e):n}},9375(e){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},8505(e,t,n){var r=n(9375);e.exports=function e(t,n,o){return r(n)||(o=n||o,n=[]),o=o||{},t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return f(e,t)}(t,n):r(t)?function(t,n,r){for(var o=[],a=0;a<t.length;a++)o.push(e(t[a],n,r).source);return f(new RegExp("(?:"+o.join("|")+")",p(r)),n)}(t,n,o):function(e,t,n){return m(a(e,n),t,n)}(t,n,o)},e.exports.parse=a,e.exports.compile=function(e,t){return c(a(e,t),t)},e.exports.tokensToFunction=c,e.exports.tokensToRegExp=m;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function a(e,t){for(var n,r=[],a=0,s=0,l="",c=t&&t.delimiter||"/";null!=(n=o.exec(e));){var u=n[0],f=n[1],p=n.index;if(l+=e.slice(s,p),s=p+u.length,f)l+=f[1];else{var m=e[s],h=n[2],g=n[3],w=n[4],y=n[5],b=n[6],v=n[7];l&&(r.push(l),l="");var x=null!=h&&null!=m&&m!==h,N="+"===b||"*"===b,E="?"===b||"*"===b,_=h||c,M=w||y,I=h||("string"==typeof r[r.length-1]?r[r.length-1]:"");r.push({name:g||a++,prefix:h||"",delimiter:_,optional:E,repeat:N,partial:x,asterisk:!!v,pattern:M?d(M):v?".*":i(_,I)})}}return s<e.length&&(l+=e.substr(s)),l&&r.push(l),r}function i(e,t){return!t||t.indexOf(e)>-1?"[^"+u(e)+"]+?":u(t)+"|(?:(?!"+u(t)+")[^"+u(e)+"])+?"}function s(e){return encodeURI(e).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function l(e){return encodeURI(e).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function c(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"==typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",p(t)));return function(t,o){for(var a="",i=t||{},c=(o||{}).pretty?s:encodeURIComponent,u=0;u<e.length;u++){var d=e[u];if("string"!=typeof d){var f,p=i[d.name];if(null==p){if(d.optional){d.partial&&(a+=d.prefix);continue}throw new TypeError('Expected "'+d.name+'" to be defined')}if(r(p)){if(!d.repeat)throw new TypeError('Expected "'+d.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(d.optional)continue;throw new TypeError('Expected "'+d.name+'" to not be empty')}for(var m=0;m<p.length;m++){if(f=c(p[m]),!n[u].test(f))throw new TypeError('Expected all "'+d.name+'" to match "'+d.pattern+'", but received `'+JSON.stringify(f)+"`");a+=(0===m?d.prefix:d.delimiter)+f}}else{if(f=d.asterisk?l(p):c(p),!n[u].test(f))throw new TypeError('Expected "'+d.name+'" to match "'+d.pattern+'", but received "'+f+'"');a+=d.prefix+f}}else a+=d}return a}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function d(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function f(e,t){return e.keys=t,e}function p(e){return e&&e.sensitive?"":"i"}function m(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,a=!1!==n.end,i="",s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)i+=u(l);else{var c=u(l.prefix),d="(?:"+l.pattern+")";t.push(l),l.repeat&&(d+="(?:"+c+d+")*"),i+=d=l.optional?l.partial?c+"("+d+")?":"(?:"+c+"("+d+"))?":c+"("+d+")"}}var m=u(n.delimiter||"/"),h=i.slice(-m.length)===m;return o||(i=(h?i.slice(0,-m.length):i)+"(?:"+m+"(?=$))?"),i+=a?"$":o&&h?"":"(?="+m+"|$)",f(new RegExp("^"+i,p(n)),t)}},4912(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for;n&&Symbol.for("react.element"),n&&Symbol.for("react.portal"),n&&Symbol.for("react.fragment"),n&&Symbol.for("react.strict_mode"),n&&Symbol.for("react.profiler"),n&&Symbol.for("react.provider"),n&&Symbol.for("react.context"),n&&Symbol.for("react.async_mode"),n&&Symbol.for("react.concurrent_mode"),n&&Symbol.for("react.forward_ref"),n&&Symbol.for("react.suspense"),n&&Symbol.for("react.suspense_list"),n&&Symbol.for("react.memo"),n&&Symbol.for("react.lazy"),n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope")},7564(e,t,n){"use strict";n(4912)},5901(e,t,n){var r=n(246),o=n(1720),a=n(1609),i=n(2236);function s(e){return e&&e.__esModule?e.default:e}function l(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}function c(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function u(e){e.forEach(e=>c(e.element))}function d(e){e.forEach(e=>{!function(e,t,n){const r=e.children[n]||null;e.insertBefore(t,r)}(e.parentElement,e.element,e.oldIndex)})}function f(e,t){const n=h(e),r={parentElement:e.from};let o=[];switch(n){case"normal":o=[{element:e.item,newIndex:e.newIndex,oldIndex:e.oldIndex,parentElement:e.from}];break;case"swap":o=[{element:e.item,oldIndex:e.oldIndex,newIndex:e.newIndex,...r},{element:e.swapItem,oldIndex:e.newIndex,newIndex:e.oldIndex,...r}];break;case"multidrag":o=e.oldIndicies.map((t,n)=>({element:t.multiDragElement,oldIndex:t.index,newIndex:e.newIndicies[n].index,...r}))}const a=function(e,t){return e.map(e=>({...e,item:t[e.oldIndex]})).sort((e,t)=>e.oldIndex-t.oldIndex)}(o,t);return a}function p(e,t){const n=[...t];return e.concat().reverse().forEach(e=>n.splice(e.oldIndex,1)),n}function m(e,t,n,r){const o=[...t];return e.forEach(e=>{const t=r&&n&&r(e.item,n);o.splice(e.newIndex,0,t||e.item)}),o}function h(e){return e.oldIndicies&&e.oldIndicies.length>0?"multidrag":e.swapItem?"swap":"normal"}l(e.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),l(e.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),l(e.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),l(e.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),l(e.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),l(e.exports,"Options",()=>$882b6d93070905b3$re_export$Options),l(e.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),l(e.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),l(e.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),l(e.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),l(e.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),l(e.exports,"ReactSortable",()=>w);const g={dragging:null};class w extends a.Component{static defaultProps={clone:e=>e};constructor(e){super(e),this.ref=(0,a.createRef)();const t=[...e.list].map(e=>Object.assign(e,{chosen:!1,selected:!1}));e.setList(t,this.sortable,g),s(i)(!e.plugins,'\nPlugins prop is no longer supported.\nInstead, mount it with "Sortable.mount(new MultiDrag())"\nPlease read the updated README.md at https://github.com/SortableJS/react-sortablejs.\n ')}componentDidMount(){if(null===this.ref.current)return;const e=this.makeOptions();s(r).create(this.ref.current,e)}componentDidUpdate(e){e.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){const{tag:e,style:t,className:n,id:r}=this.props,o={style:t,className:n,id:r},i=e&&null!==e?e:"div";return(0,a.createElement)(i,{ref:this.ref,...o},this.getChildren())}getChildren(){const{children:e,dataIdAttr:t,selectedClass:n="sortable-selected",chosenClass:r="sortable-chosen",dragClass:i="sortable-drag",fallbackClass:l="sortable-falback",ghostClass:c="sortable-ghost",swapClass:u="sortable-swap-highlight",filter:d="sortable-filter",list:f}=this.props;if(!e||null==e)return null;const p=t||"data-id";return a.Children.map(e,(e,t)=>{if(void 0===e)return;const i=f[t]||{},{className:l}=e.props,c="string"==typeof d&&{[d.replace(".","")]:!!i.filtered},u=s(o)(l,{[n]:i.selected,[r]:i.chosen,...c});return(0,a.cloneElement)(e,{[p]:e.key,className:u})})}get sortable(){const e=this.ref.current;if(null===e)return null;const t=Object.keys(e).find(e=>e.includes("Sortable"));return t?e[t]:null}makeOptions(){const e=function(e){const{list:t,setList:n,children:r,tag:o,style:a,className:i,clone:s,onAdd:l,onChange:c,onChoose:u,onClone:d,onEnd:f,onFilter:p,onRemove:m,onSort:h,onStart:g,onUnchoose:w,onUpdate:y,onMove:b,onSpill:v,onSelect:x,onDeselect:N,...E}=e;return E}(this.props);return["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"].forEach(t=>e[t]=this.prepareOnHandlerPropAndDOM(t)),["onChange","onClone","onFilter","onSort"].forEach(t=>e[t]=this.prepareOnHandlerProp(t)),{...e,onMove:(e,t)=>{const{onMove:n}=this.props,r=e.willInsertAfter||-1;if(!n)return r;const o=n(e,t,this.sortable,g);return void 0!==o&&o}}}prepareOnHandlerPropAndDOM(e){return t=>{this.callOnHandlerProp(t,e),this[e](t)}}prepareOnHandlerProp(e){return t=>{this.callOnHandlerProp(t,e)}}callOnHandlerProp(e,t){const n=this.props[t];n&&n(e,this.sortable,g)}onAdd(e){const{list:t,setList:n,clone:r}=this.props,o=f(e,[...g.dragging.props.list]);u(o),n(m(o,t,e,r).map(e=>Object.assign(e,{selected:!1})),this.sortable,g)}onRemove(e){const{list:t,setList:n}=this.props,r=h(e),o=f(e,t);d(o);let a=[...t];if("clone"!==e.pullMode)a=p(o,a);else{let t=o;switch(r){case"multidrag":t=o.map((t,n)=>({...t,element:e.clones[n]}));break;case"normal":t=o.map(t=>({...t,element:e.clone}));break;default:s(i)(!0,`mode "${r}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${r}" plugin`)}u(t),o.forEach(t=>{const n=t.oldIndex,r=this.props.clone(t.item,e);a.splice(n,1,r)})}a=a.map(e=>Object.assign(e,{selected:!1})),n(a,this.sortable,g)}onUpdate(e){const{list:t,setList:n}=this.props,r=f(e,t);return u(r),d(r),n(function(e,t){return m(e,p(e,t))}(r,t),this.sortable,g)}onStart(){g.dragging=this}onEnd(){g.dragging=null}onChoose(e){const{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(t,{chosen:!0})),r}),this.sortable,g)}onUnchoose(e){const{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(r,{chosen:!1})),r}),this.sortable,g)}onSpill(e){const{removeOnSpill:t,revertOnSpill:n}=this.props;t&&!n&&c(e.item)}onSelect(e){const{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(t=>{const n=t.index;if(-1===n)return console.log(`"${e.type}" had indice of "${t.index}", which is probably -1 and doesn't usually happen here.`),void console.log(e);r[n].selected=!0}),n(r,this.sortable,g)}onDeselect(e){const{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(e=>{const t=e.index;-1!==t&&(r[t].selected=!0)}),n(r,this.sortable,g)}}var y,b;y=e.exports,b={},Object.keys(b).forEach(function(e){"default"===e||"__esModule"===e||y.hasOwnProperty(e)||Object.defineProperty(y,e,{enumerable:!0,get:function(){return b[e]}})})},1720(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];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)r.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},2236(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>r});function r(e,t){if(!e)throw new Error("Invariant failed")}},1020(e,t,n){"use strict";var r=n(1609),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},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)i.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},4848(e,t,n){"use strict";e.exports=n(1020)},4307(e,t,n){"use strict";function r(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}n.d(t,{A:()=>a});const a=function(e,t){void 0===t&&(t="");var n,a=e&&e.split("/")||[],i=t&&t.split("/")||[],s=e&&r(e),l=t&&r(t),c=s||l;if(e&&r(e)?i=a:a.length&&(i.pop(),i=i.concat(a)),!i.length)return"/";if(i.length){var u=i[i.length-1];n="."===u||".."===u||""===u}else n=!1;for(var d=0,f=i.length;f>=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&r(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m}},246(e,t,n){"use strict";function r(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?r(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e){return a="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},a(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return s=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},s.apply(this,arguments)}function l(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 c(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}n.r(t),n.d(t,{MultiDrag:()=>bt,Sortable:()=>Be,Swap:()=>lt,default:()=>Nt});var u=c(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),d=c(/Edge/i),f=c(/firefox/i),p=c(/safari/i)&&!c(/chrome/i)&&!c(/android/i),m=c(/iP(ad|od|hone)/i),h=c(/chrome/i)&&c(/android/i),g={capture:!1,passive:!1};function w(e,t,n){e.addEventListener(t,n,!u&&g)}function y(e,t,n){e.removeEventListener(t,n,!u&&g)}function b(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function v(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function x(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&b(e,t):b(e,t))||r&&e===n)return e;if(e===n)break}while(e=v(e))}return null}var N,E=/\s+/g;function _(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(E," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(E," ")}}function M(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function I(e,t){var n="";if("string"==typeof e)n=e;else do{var r=M(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function S(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,a=r.length;if(n)for(;o<a;o++)n(r[o],o);return r}return[]}function k(){return document.scrollingElement||document.documentElement}function D(e,t,n,r,o){if(e.getBoundingClientRect||e===window){var a,i,s,l,c,d,f;if(e!==window&&e.parentNode&&e!==k()?(i=(a=e.getBoundingClientRect()).top,s=a.left,l=a.bottom,c=a.right,d=a.height,f=a.width):(i=0,s=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!u))do{if(o&&o.getBoundingClientRect&&("none"!==M(o,"transform")||n&&"static"!==M(o,"position"))){var p=o.getBoundingClientRect();i-=p.top+parseInt(M(o,"border-top-width")),s-=p.left+parseInt(M(o,"border-left-width")),l=i+a.height,c=s+a.width;break}}while(o=o.parentNode);if(r&&e!==window){var m=I(o||e),h=m&&m.a,g=m&&m.d;m&&(l=(i/=g)+(d/=g),c=(s/=h)+(f/=h))}return{top:i,left:s,bottom:l,right:c,width:f,height:d}}}function C(e,t,n){for(var r=O(e,!0),o=D(e)[t];r;){var a=D(r)[n];if(!("top"===n||"left"===n?o>=a:o<=a))return r;if(r===k())break;r=O(r,!1)}return!1}function j(e,t,n,r){for(var o=0,a=0,i=e.children;a<i.length;){if("none"!==i[a].style.display&&i[a]!==Be.ghost&&(r||i[a]!==Be.dragged)&&x(i[a],n.draggable,e,!1)){if(o===t)return i[a];o++}a++}return null}function A(e,t){for(var n=e.lastElementChild;n&&(n===Be.ghost||"none"===M(n,"display")||t&&!b(n,t));)n=n.previousElementSibling;return n||null}function T(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Be.clone||t&&!b(e,t)||n++;return n}function L(e){var t=0,n=0,r=k();if(e)do{var o=I(e),a=o.a,i=o.d;t+=e.scrollLeft*a,n+=e.scrollTop*i}while(e!==r&&(e=e.parentNode));return[t,n]}function O(e,t){if(!e||!e.getBoundingClientRect)return k();var n=e,r=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=M(n);if(n.clientWidth<n.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!n.getBoundingClientRect||n===document.body)return k();if(r||t)return n;r=!0}}}while(n=n.parentNode);return k()}function z(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function P(e,t){return function(){if(!N){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),N=setTimeout(function(){N=void 0},t)}}}function R(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function U(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function B(e,t){M(e,"position","absolute"),M(e,"top",t.top),M(e,"left",t.left),M(e,"width",t.width),M(e,"height",t.height)}function F(e){M(e,"position",""),M(e,"top",""),M(e,"left",""),M(e,"width",""),M(e,"height","")}var Q="Sortable"+(new Date).getTime();var V=[],Y={initializeByDefault:!0},Z={mount:function(e){for(var t in Y)Y.hasOwnProperty(t)&&!(t in e)&&(e[t]=Y[t]);V.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),V.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var a=e+"Global";V.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][a]&&t[r.pluginName][a](o({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](o({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var o in V.forEach(function(r){var o=r.pluginName;if(e.options[o]||r.initializeByDefault){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[o]=a,s(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(o)){var a=this.modifyOption(e,o,e.options[o]);void 0!==a&&(e.options[o]=a)}},getEventProperties:function(e,t){var n={};return V.forEach(function(r){"function"==typeof r.eventProperties&&s(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return V.forEach(function(o){e[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[t]&&(r=o.optionListeners[t].call(e[o.pluginName],n))}),r}};function W(e){var t=e.sortable,n=e.rootEl,r=e.name,a=e.targetEl,i=e.cloneEl,s=e.toEl,l=e.fromEl,c=e.oldIndex,f=e.newIndex,p=e.oldDraggableIndex,m=e.newDraggableIndex,h=e.originalEvent,g=e.putSortable,w=e.extraEventProperties;if(t=t||n&&n[Q]){var y,b=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||u||d?(y=document.createEvent("Event")).initEvent(r,!0,!0):y=new CustomEvent(r,{bubbles:!0,cancelable:!0}),y.to=s||n,y.from=l||n,y.item=a||n,y.clone=i,y.oldIndex=c,y.newIndex=f,y.oldDraggableIndex=p,y.newDraggableIndex=m,y.originalEvent=h,y.pullMode=g?g.lastPutMode:void 0;var x=o(o({},w),Z.getEventProperties(r,t));for(var N in x)y[N]=x[N];n&&n.dispatchEvent(y),b[v]&&b[v].call(t,y)}}var G=["evt"],H=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,G);Z.pluginEvent.bind(Be)(e,t,o({dragEl:X,parentEl:q,ghostEl:J,rootEl:K,nextEl:ee,lastDownEl:te,cloneEl:ne,cloneHidden:re,dragStarted:ge,putSortable:ce,activeSortable:Be.active,originalEvent:r,oldIndex:oe,oldDraggableIndex:ie,newIndex:ae,newDraggableIndex:se,hideGhostForTarget:ze,unhideGhostForTarget:Pe,cloneNowHidden:function(){re=!0},cloneNowShown:function(){re=!1},dispatchSortableEvent:function(e){$({sortable:t,name:e,originalEvent:r})}},a))};function $(e){W(o({putSortable:ce,cloneEl:ne,targetEl:X,rootEl:K,oldIndex:oe,oldDraggableIndex:ie,newIndex:ae,newDraggableIndex:se},e))}var X,q,J,K,ee,te,ne,re,oe,ae,ie,se,le,ce,ue,de,fe,pe,me,he,ge,we,ye,be,ve,xe=!1,Ne=!1,Ee=[],_e=!1,Me=!1,Ie=[],Se=!1,ke=[],De="undefined"!=typeof document,Ce=m,je=d||u?"cssFloat":"float",Ae=De&&!h&&!m&&"draggable"in document.createElement("div"),Te=function(){if(De){if(u)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Le=function(e,t){var n=M(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=j(e,0,t),a=j(e,1,t),i=o&&M(o),s=a&&M(a),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+D(o).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+D(a).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!a||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return o&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=r&&"none"===n[je]||a&&"none"===n[je]&&l+c>r)?"vertical":"horizontal"},Oe=function(e){function t(e,n){return function(r,o,a,i){var s=r.options.group.name&&o.options.group.name&&r.options.group.name===o.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,o,a,i),n)(r,o,a,i);var l=(n?r:o).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==a(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},ze=function(){!Te&&J&&M(J,"display","none")},Pe=function(){!Te&&J&&M(J,"display","")};De&&document.addEventListener("click",function(e){if(Ne)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ne=!1,!1},!0);var Re=function(e){if(X){e=e.touches?e.touches[0]:e;var t=(o=e.clientX,a=e.clientY,Ee.some(function(e){var t=e[Q].options.emptyInsertThreshold;if(t&&!A(e)){var n=D(e),r=o>=n.left-t&&o<=n.right+t,s=a>=n.top-t&&a<=n.bottom+t;return r&&s?i=e:void 0}}),i);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Q]._onDragOver(n)}}var o,a,i},Ue=function(e){X&&X.parentNode[Q]._isOutsideThisEl(e.target)};function Be(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[Q]=this;var n,r,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Le(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Be.supportPointer&&"PointerEvent"in window&&!p,emptyInsertThreshold:5};for(var i in Z.initializePlugins(this,e,a),a)!(i in t)&&(t[i]=a[i]);for(var l in Oe(t),this)"_"===l.charAt(0)&&"function"==typeof this[l]&&(this[l]=this[l].bind(this));this.nativeDraggable=!t.forceFallback&&Ae,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?w(e,"pointerdown",this._onTapStart):(w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),Ee.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(e){if("none"!==M(e,"display")&&e!==Be.ghost){r.push({target:e,rect:D(e)});var t=o({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=I(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}})},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n);return-1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var o=!1,a=0;r.forEach(function(e){var n=0,r=e.target,i=r.fromRect,s=D(r),l=r.prevFromRect,c=r.prevToRect,u=e.rect,d=I(r,!0);d&&(s.top-=d.f,s.left-=d.e),r.toRect=s,r.thisAnimationDuration&&z(l,s)&&!z(i,s)&&(u.top-s.top)/(u.left-s.left)===(i.top-s.top)/(i.left-s.left)&&(n=function(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}(u,l,c,t.options)),z(s,i)||(r.prevFromRect=i,r.prevToRect=s,n||(n=t.options.animation),t.animate(r,u,s,n)),n&&(o=!0,a=Math.max(a,n),clearTimeout(r.animationResetTimer),r.animationResetTimer=setTimeout(function(){r.animationTime=0,r.prevFromRect=null,r.fromRect=null,r.prevToRect=null,r.thisAnimationDuration=null},n),r.thisAnimationDuration=n)}),clearTimeout(n),o?n=setTimeout(function(){"function"==typeof e&&e()},a):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,r){if(r){M(e,"transition",""),M(e,"transform","");var o=I(this.el),a=o&&o.a,i=o&&o.d,s=(t.left-n.left)/(a||1),l=(t.top-n.top)/(i||1);e.animatingX=!!s,e.animatingY=!!l,M(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),M(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),M(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){M(e,"transition",""),M(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}))}function Fe(e,t,n,r,o,a,i,s){var l,c,f=e[Q],p=f.options.onMove;return!window.CustomEvent||u||d?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=o||t,l.relatedRect=a||D(t),l.willInsertAfter=s,l.originalEvent=i,e.dispatchEvent(l),p&&(c=p.call(f,l,i)),c}function Qe(e){e.draggable=!1}function Ve(){Se=!1}function Ye(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function Ze(e){return setTimeout(e,0)}function We(e){return clearTimeout(e)}Be.prototype={constructor:Be,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(we=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,X):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,o=r.preventOnFilter,a=e.type,i=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(i||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=r.filter;if(function(e){ke.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&ke.push(r)}}(n),!X&&!(/mousedown|pointerdown/.test(a)&&0!==e.button||r.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!p||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=x(s,r.draggable,n,!1))&&s.animated||te===s)){if(oe=T(s),ie=T(s,r.draggable),"function"==typeof c){if(c.call(this,e,s,this))return $({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),H("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(r){if(r=x(l,r.trim(),n,!1))return $({sortable:t,rootEl:r,name:"filter",targetEl:s,fromEl:n,toEl:n}),H("filter",t,{evt:e}),!0})))return void(o&&e.cancelable&&e.preventDefault());r.handle&&!x(l,r.handle,n,!1)||this._prepareDragStart(e,i,s)}}},_prepareDragStart:function(e,t,n){var r,o=this,a=o.el,i=o.options,s=a.ownerDocument;if(n&&!X&&n.parentNode===a){var l=D(n);if(K=a,q=(X=n).parentNode,ee=X.nextSibling,te=n,le=i.group,Be.dragged=X,ue={target:X,clientX:(t||e).clientX,clientY:(t||e).clientY},me=ue.clientX-l.left,he=ue.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,X.style["will-change"]="all",r=function(){H("delayEnded",o,{evt:e}),Be.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!f&&o.nativeDraggable&&(X.draggable=!0),o._triggerDragStart(e,t),$({sortable:o,name:"choose",originalEvent:e}),_(X,i.chosenClass,!0))},i.ignore.split(",").forEach(function(e){S(X,e.trim(),Qe)}),w(s,"dragover",Re),w(s,"mousemove",Re),w(s,"touchmove",Re),w(s,"mouseup",o._onDrop),w(s,"touchend",o._onDrop),w(s,"touchcancel",o._onDrop),f&&this.nativeDraggable&&(this.options.touchStartThreshold=4,X.draggable=!0),H("delayStart",this,{evt:e}),!i.delay||i.delayOnTouchOnly&&!t||this.nativeDraggable&&(d||u))r();else{if(Be.eventCanceled)return void this._onDrop();w(s,"mouseup",o._disableDelayedDrag),w(s,"touchend",o._disableDelayedDrag),w(s,"touchcancel",o._disableDelayedDrag),w(s,"mousemove",o._delayedDragTouchMoveHandler),w(s,"touchmove",o._delayedDragTouchMoveHandler),i.supportPointer&&w(s,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,i.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){X&&Qe(X),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._disableDelayedDrag),y(e,"touchend",this._disableDelayedDrag),y(e,"touchcancel",this._disableDelayedDrag),y(e,"mousemove",this._delayedDragTouchMoveHandler),y(e,"touchmove",this._delayedDragTouchMoveHandler),y(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):w(document,t?"touchmove":"mousemove",this._onTouchMove):(w(X,"dragend",this),w(K,"dragstart",this._onDragStart));try{document.selection?Ze(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(xe=!1,K&&X){H("dragStarted",this,{evt:t}),this.nativeDraggable&&w(document,"dragover",Ue);var n=this.options;!e&&_(X,n.dragClass,!1),_(X,n.ghostClass,!0),Be.active=this,e&&this._appendGhost(),$({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(de){this._lastX=de.clientX,this._lastY=de.clientY,ze();for(var e=document.elementFromPoint(de.clientX,de.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(de.clientX,de.clientY))!==t;)t=e;if(X.parentNode[Q]._isOutsideThisEl(e),t)do{if(t[Q]&&t[Q]._onDragOver({clientX:de.clientX,clientY:de.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Pe()}},_onTouchMove:function(e){if(ue){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,a=J&&I(J,!0),i=J&&a&&a.a,s=J&&a&&a.d,l=Ce&&ve&&L(ve),c=(o.clientX-ue.clientX+r.x)/(i||1)+(l?l[0]-Ie[0]:0)/(i||1),u=(o.clientY-ue.clientY+r.y)/(s||1)+(l?l[1]-Ie[1]:0)/(s||1);if(!Be.active&&!xe){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(J){a?(a.e+=c-(fe||0),a.f+=u-(pe||0)):a={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");M(J,"webkitTransform",d),M(J,"mozTransform",d),M(J,"msTransform",d),M(J,"transform",d),fe=c,pe=u,de=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!J){var e=this.options.fallbackOnBody?document.body:K,t=D(X,!0,Ce,!0,e),n=this.options;if(Ce){for(ve=e;"static"===M(ve,"position")&&"none"===M(ve,"transform")&&ve!==document;)ve=ve.parentNode;ve!==document.body&&ve!==document.documentElement?(ve===document&&(ve=k()),t.top+=ve.scrollTop,t.left+=ve.scrollLeft):ve=k(),Ie=L(ve)}_(J=X.cloneNode(!0),n.ghostClass,!1),_(J,n.fallbackClass,!0),_(J,n.dragClass,!0),M(J,"transition",""),M(J,"transform",""),M(J,"box-sizing","border-box"),M(J,"margin",0),M(J,"top",t.top),M(J,"left",t.left),M(J,"width",t.width),M(J,"height",t.height),M(J,"opacity","0.8"),M(J,"position",Ce?"absolute":"fixed"),M(J,"zIndex","100000"),M(J,"pointerEvents","none"),Be.ghost=J,e.appendChild(J),M(J,"transform-origin",me/parseInt(J.style.width)*100+"% "+he/parseInt(J.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,o=n.options;H("dragStart",this,{evt:e}),Be.eventCanceled?this._onDrop():(H("setupClone",this),Be.eventCanceled||((ne=U(X)).draggable=!1,ne.style["will-change"]="",this._hideClone(),_(ne,this.options.chosenClass,!1),Be.clone=ne),n.cloneId=Ze(function(){H("clone",n),Be.eventCanceled||(n.options.removeCloneOnHide||K.insertBefore(ne,X),n._hideClone(),$({sortable:n,name:"clone"}))}),!t&&_(X,o.dragClass,!0),t?(Ne=!0,n._loopId=setInterval(n._emulateDragOver,50)):(y(document,"mouseup",n._onDrop),y(document,"touchend",n._onDrop),y(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(n,r,X)),w(document,"drop",n),M(X,"transform","translateZ(0)")),xe=!0,n._dragStartId=Ze(n._dragStarted.bind(n,t,e)),w(document,"selectstart",n),ge=!0,p&&M(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,r,a,i=this.el,s=e.target,l=this.options,c=l.group,u=Be.active,d=le===c,f=l.sort,p=ce||u,m=this,h=!1;if(!Se){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=x(s,l.draggable,i,!0),U("dragOver"),Be.eventCanceled)return h;if(X.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||m._ignoreWhileAnimating===s)return F(!1);if(Ne=!1,u&&!l.disabled&&(d?f||(r=q!==K):ce===this||(this.lastPutMode=le.checkPull(this,u,X,e))&&c.checkPut(this,u,X,e))){if(a="vertical"===this._getDirection(e,s),t=D(X),U("dragOverValid"),Be.eventCanceled)return h;if(r)return q=K,B(),this._hideClone(),U("revert"),Be.eventCanceled||(ee?K.insertBefore(X,ee):K.appendChild(X)),F(!0);var g=A(i,l.draggable);if(!g||function(e,t,n){var r=D(A(n.el,n.options.draggable));return t?e.clientX>r.right+10||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+10}(e,a,this)&&!g.animated){if(g===X)return F(!1);if(g&&i===e.target&&(s=g),s&&(n=D(s)),!1!==Fe(K,i,X,t,s,n,e,!!s))return B(),i.appendChild(X),q=i,V(),F(!0)}else if(g&&function(e,t,n){var r=D(j(n.el,0,n.options,!0));return t?e.clientX<r.left-10||e.clientY<r.top&&e.clientX<r.right:e.clientY<r.top-10||e.clientY<r.bottom&&e.clientX<r.left}(e,a,this)){var w=j(i,0,l,!0);if(w===X)return F(!1);if(n=D(s=w),!1!==Fe(K,i,X,t,s,n,e,!1))return B(),i.insertBefore(X,w),q=i,V(),F(!0)}else if(s.parentNode===i){n=D(s);var y,b,v,N=X.parentNode!==i,E=!function(e,t,n){var r=n?e.left:e.top,o=n?e.right:e.bottom,a=n?e.width:e.height,i=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return r===i||o===s||r+a/2===i+l/2}(X.animated&&X.toRect||t,s.animated&&s.toRect||n,a),I=a?"top":"left",S=C(s,"top","top")||C(X,"top","top"),k=S?S.scrollTop:void 0;if(we!==s&&(b=n[I],_e=!1,Me=!E&&l.invertSwap||N),y=function(e,t,n,r,o,a,i,s){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!i)if(s&&be<c*o){if(!_e&&(1===ye?l>u+c*a/2:l<d-c*a/2)&&(_e=!0),_e)f=!0;else if(1===ye?l<u+be:l>d-be)return-ye}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return function(e){return T(X)<T(e)?1:-1}(t);return(f=f||i)&&(l<u+c*a/2||l>d-c*a/2)?l>u+c/2?1:-1:0}(e,s,n,a,E?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Me,we===s),0!==y){var L=T(X);do{L-=y,v=q.children[L]}while(v&&("none"===M(v,"display")||v===J))}if(0===y||v===s)return F(!1);we=s,ye=y;var O=s.nextElementSibling,z=!1,P=Fe(K,i,X,t,s,n,e,z=1===y);if(!1!==P)return 1!==P&&-1!==P||(z=1===P),Se=!0,setTimeout(Ve,30),B(),z&&!O?i.appendChild(X):s.parentNode.insertBefore(X,z?O:s),S&&R(S,0,k-S.scrollTop),q=X.parentNode,void 0===b||Me||(be=Math.abs(b-D(s)[I])),V(),F(!0)}if(i.contains(X))return F(!1)}return!1}function U(l,c){H(l,m,o({evt:e,isOwner:d,axis:a?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:f,fromSortable:p,target:s,completed:F,onMove:function(n,r){return Fe(K,i,X,t,n,D(n),e,r)},changed:V},c))}function B(){U("dragOverAnimationCapture"),m.captureAnimationState(),m!==p&&p.captureAnimationState()}function F(t){return U("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(m),m!==p&&(_(X,ce?ce.options.ghostClass:u.options.ghostClass,!1),_(X,l.ghostClass,!0)),ce!==m&&m!==Be.active?ce=m:m===Be.active&&ce&&(ce=null),p===m&&(m._ignoreWhileAnimating=s),m.animateAll(function(){U("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(s===X&&!X.animated||s===i&&!s.animated)&&(we=null),l.dragoverBubble||e.rootEl||s===document||(X.parentNode[Q]._isOutsideThisEl(e.target),!t&&Re(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),h=!0}function V(){ae=T(X),se=T(X,l.draggable),$({sortable:m,name:"change",toEl:i,newIndex:ae,newDraggableIndex:se,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){y(document,"mousemove",this._onTouchMove),y(document,"touchmove",this._onTouchMove),y(document,"pointermove",this._onTouchMove),y(document,"dragover",Re),y(document,"mousemove",Re),y(document,"touchmove",Re)},_offUpEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._onDrop),y(e,"touchend",this._onDrop),y(e,"pointerup",this._onDrop),y(e,"touchcancel",this._onDrop),y(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ae=T(X),se=T(X,n.draggable),H("drop",this,{evt:e}),q=X&&X.parentNode,ae=T(X),se=T(X,n.draggable),Be.eventCanceled||(xe=!1,Me=!1,_e=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),We(this.cloneId),We(this._dragStartId),this.nativeDraggable&&(y(document,"drop",this),y(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),p&&M(document.body,"user-select",""),M(X,"transform",""),e&&(ge&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),J&&J.parentNode&&J.parentNode.removeChild(J),(K===q||ce&&"clone"!==ce.lastPutMode)&&ne&&ne.parentNode&&ne.parentNode.removeChild(ne),X&&(this.nativeDraggable&&y(X,"dragend",this),Qe(X),X.style["will-change"]="",ge&&!xe&&_(X,ce?ce.options.ghostClass:this.options.ghostClass,!1),_(X,this.options.chosenClass,!1),$({sortable:this,name:"unchoose",toEl:q,newIndex:null,newDraggableIndex:null,originalEvent:e}),K!==q?(ae>=0&&($({rootEl:q,name:"add",toEl:q,fromEl:K,originalEvent:e}),$({sortable:this,name:"remove",toEl:q,originalEvent:e}),$({rootEl:q,name:"sort",toEl:q,fromEl:K,originalEvent:e}),$({sortable:this,name:"sort",toEl:q,originalEvent:e})),ce&&ce.save()):ae!==oe&&ae>=0&&($({sortable:this,name:"update",toEl:q,originalEvent:e}),$({sortable:this,name:"sort",toEl:q,originalEvent:e})),Be.active&&(null!=ae&&-1!==ae||(ae=oe,se=ie),$({sortable:this,name:"end",toEl:q,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){H("nulling",this),K=X=q=J=ee=ne=te=re=ue=de=ge=ae=se=oe=ie=we=ye=ce=le=Be.dragged=Be.ghost=Be.clone=Be.active=null,ke.forEach(function(e){e.checked=!0}),ke.length=fe=pe=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":X&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,o=n.length,a=this.options;r<o;r++)x(e=n[r],a.draggable,this.el,!1)&&t.push(e.getAttribute(a.dataIdAttr)||Ye(e));return t},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var o=r.children[t];x(o,this.options.draggable,r,!1)&&(n[e]=o)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return x(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=Z.modifyOption(this,e,t);n[e]=void 0!==r?r:t,"group"===e&&Oe(n)},destroy:function(){H("destroy",this);var e=this.el;e[Q]=null,y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart),y(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ee.splice(Ee.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!re){if(H("hideClone",this),Be.eventCanceled)return;M(ne,"display","none"),this.options.removeCloneOnHide&&ne.parentNode&&ne.parentNode.removeChild(ne),re=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(re){if(H("showClone",this),Be.eventCanceled)return;X.parentNode!=K||this.options.group.revertClone?ee?K.insertBefore(ne,ee):K.appendChild(ne):K.insertBefore(ne,X),this.options.group.revertClone&&this.animate(X,ne),M(ne,"display",""),re=!1}}else this._hideClone()}},De&&w(document,"touchmove",function(e){(Be.active||xe)&&e.cancelable&&e.preventDefault()}),Be.utils={on:w,off:y,css:M,find:S,is:function(e,t){return!!x(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:P,closest:x,toggleClass:_,clone:U,index:T,nextTick:Ze,cancelNextTick:We,detectDirection:Le,getChild:j},Be.get=function(e){return e[Q]},Be.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Be.utils=o(o({},Be.utils),e.utils)),Z.mount(e)})},Be.create=function(e,t){return new Be(e,t)},Be.version="1.14.0";var Ge,He,$e,Xe,qe,Je,Ke=[],et=!1;function tt(){Ke.forEach(function(e){clearInterval(e.pid)}),Ke=[]}function nt(){clearInterval(Je)}var rt,ot=P(function(e,t,n,r){if(t.scroll){var o,a=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,c=k(),u=!1;He!==n&&(He=n,tt(),Ge=t.scroll,o=t.scrollFn,!0===Ge&&(Ge=O(n,!0)));var d=0,f=Ge;do{var p=f,m=D(p),h=m.top,g=m.bottom,w=m.left,y=m.right,b=m.width,v=m.height,x=void 0,N=void 0,E=p.scrollWidth,_=p.scrollHeight,I=M(p),S=p.scrollLeft,C=p.scrollTop;p===c?(x=b<E&&("auto"===I.overflowX||"scroll"===I.overflowX||"visible"===I.overflowX),N=v<_&&("auto"===I.overflowY||"scroll"===I.overflowY||"visible"===I.overflowY)):(x=b<E&&("auto"===I.overflowX||"scroll"===I.overflowX),N=v<_&&("auto"===I.overflowY||"scroll"===I.overflowY));var j=x&&(Math.abs(y-a)<=s&&S+b<E)-(Math.abs(w-a)<=s&&!!S),A=N&&(Math.abs(g-i)<=s&&C+v<_)-(Math.abs(h-i)<=s&&!!C);if(!Ke[d])for(var T=0;T<=d;T++)Ke[T]||(Ke[T]={});Ke[d].vx==j&&Ke[d].vy==A&&Ke[d].el===p||(Ke[d].el=p,Ke[d].vx=j,Ke[d].vy=A,clearInterval(Ke[d].pid),0==j&&0==A||(u=!0,Ke[d].pid=setInterval(function(){r&&0===this.layer&&Be.active._onTouchMove(qe);var t=Ke[this.layer].vy?Ke[this.layer].vy*l:0,n=Ke[this.layer].vx?Ke[this.layer].vx*l:0;"function"==typeof o&&"continue"!==o.call(Be.dragged.parentNode[Q],n,t,e,qe,Ke[this.layer].el)||R(Ke[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=O(f,!1)));et=u}},30),at=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,o=e.activeSortable,a=e.dispatchSortableEvent,i=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||o;i();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(c.clientX,c.clientY);s(),l&&!l.el.contains(u)&&(a("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function it(){}function st(){}function lt(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(e){var t=e.dragEl;rt=t},dragOverValid:function(e){var t=e.completed,n=e.target,r=e.onMove,o=e.activeSortable,a=e.changed,i=e.cancel;if(o.options.swap){var s=this.sortable.el,l=this.options;if(n&&n!==s){var c=rt;!1!==r(n)?(_(n,l.swapClass,!0),rt=n):rt=null,c&&c!==rt&&_(c,l.swapClass,!1)}a(),t(!0),i()}},drop:function(e){var t,n,r,o,a,i,s=e.activeSortable,l=e.putSortable,c=e.dragEl,u=l||this.sortable,d=this.options;rt&&_(rt,d.swapClass,!1),rt&&(d.swap||l&&l.options.swap)&&c!==rt&&(u.captureAnimationState(),u!==s&&s.captureAnimationState(),n=rt,a=(t=c).parentNode,i=n.parentNode,a&&i&&!a.isEqualNode(n)&&!i.isEqualNode(t)&&(r=T(t),o=T(n),a.isEqualNode(i)&&r<o&&o++,a.insertBefore(n,a.children[r]),i.insertBefore(t,i.children[o])),u.animateAll(),u!==s&&s.animateAll())},nulling:function(){rt=null}},s(e,{pluginName:"swap",eventProperties:function(){return{swapItem:rt}}})}it.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=j(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:at},s(it,{pluginName:"revertOnSpill"}),st.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:at},s(st,{pluginName:"removeOnSpill"});var ct,ut,dt,ft,pt,mt=[],ht=[],gt=!1,wt=!1,yt=!1;function bt(){function e(e){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));e.options.supportPointer?w(document,"pointerup",this._deselectMultiDrag):(w(document,"mouseup",this._deselectMultiDrag),w(document,"touchend",this._deselectMultiDrag)),w(document,"keydown",this._checkKeyDown),w(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(t,n){var r="";mt.length&&ut===e?mt.forEach(function(e,t){r+=(t?", ":"")+e.textContent}):r=n.textContent,t.setData("Text",r)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var t=e.dragEl;dt=t},delayEnded:function(){this.isMultiDrag=~mt.indexOf(dt)},setupClone:function(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var r=0;r<mt.length;r++)ht.push(U(mt[r])),ht[r].sortableIndex=mt[r].sortableIndex,ht[r].draggable=!1,ht[r].style["will-change"]="",_(ht[r],this.options.selectedClass,!1),mt[r]===dt&&_(ht[r],this.options.chosenClass,!1);t._hideClone(),n()}},clone:function(e){var t=e.sortable,n=e.rootEl,r=e.dispatchSortableEvent,o=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||mt.length&&ut===t&&(vt(!0,n),r("clone"),o()))},showClone:function(e){var t=e.cloneNowShown,n=e.rootEl,r=e.cancel;this.isMultiDrag&&(vt(!1,n),ht.forEach(function(e){M(e,"display","")}),t(),pt=!1,r())},hideClone:function(e){var t=this,n=(e.sortable,e.cloneNowHidden),r=e.cancel;this.isMultiDrag&&(ht.forEach(function(e){M(e,"display","none"),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}),n(),pt=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&ut&&ut.multiDrag._deselectMultiDrag(),mt.forEach(function(e){e.sortableIndex=T(e)}),mt=mt.sort(function(e,t){return e.sortableIndex-t.sortableIndex}),yt=!0},dragStarted:function(e){var t=this,n=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){mt.forEach(function(e){e!==dt&&M(e,"position","absolute")});var r=D(dt,!1,!0,!0);mt.forEach(function(e){e!==dt&&B(e,r)}),wt=!0,gt=!0}n.animateAll(function(){wt=!1,gt=!1,t.options.animation&&mt.forEach(function(e){F(e)}),t.options.sort&&xt()})}},dragOver:function(e){var t=e.target,n=e.completed,r=e.cancel;wt&&~mt.indexOf(t)&&(n(!1),r())},revert:function(e){var t=e.fromSortable,n=e.rootEl,r=e.sortable,o=e.dragRect;mt.length>1&&(mt.forEach(function(e){r.addAnimationState({target:e,rect:wt?D(e):o}),F(e),e.fromRect=o,t.removeAnimationState(e)}),wt=!1,function(e,t){mt.forEach(function(n,r){var o=t.children[n.sortableIndex+(e?Number(r):0)];o?t.insertBefore(n,o):t.appendChild(n)})}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,r=e.insertion,o=e.activeSortable,a=e.parentEl,i=e.putSortable,s=this.options;if(r){if(n&&o._hideClone(),gt=!1,s.animation&&mt.length>1&&(wt||!n&&!o.options.sort&&!i)){var l=D(dt,!1,!0,!0);mt.forEach(function(e){e!==dt&&(B(e,l),a.appendChild(e))}),wt=!0}if(!n)if(wt||xt(),mt.length>1){var c=pt;o._showClone(t),o.options.animation&&!pt&&c&&ht.forEach(function(e){o.addAnimationState({target:e,rect:ft}),e.fromRect=ft,e.thisAnimationDuration=null})}else o._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,r=e.activeSortable;if(mt.forEach(function(e){e.thisAnimationDuration=null}),r.options.animation&&!n&&r.multiDrag.isMultiDrag){ft=s({},t);var o=I(dt,!0);ft.top-=o.f,ft.left-=o.e}},dragOverAnimationComplete:function(){wt&&(wt=!1,xt())},drop:function(e){var t=e.originalEvent,n=e.rootEl,r=e.parentEl,o=e.sortable,a=e.dispatchSortableEvent,i=e.oldIndex,s=e.putSortable,l=s||this.sortable;if(t){var c=this.options,u=r.children;if(!yt)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),_(dt,c.selectedClass,!~mt.indexOf(dt)),~mt.indexOf(dt))mt.splice(mt.indexOf(dt),1),ct=null,W({sortable:o,rootEl:n,name:"deselect",targetEl:dt,originalEvt:t});else{if(mt.push(dt),W({sortable:o,rootEl:n,name:"select",targetEl:dt,originalEvt:t}),t.shiftKey&&ct&&o.el.contains(ct)){var d,f,p=T(ct),m=T(dt);if(~p&&~m&&p!==m)for(m>p?(f=p,d=m):(f=m,d=p+1);f<d;f++)~mt.indexOf(u[f])||(_(u[f],c.selectedClass,!0),mt.push(u[f]),W({sortable:o,rootEl:n,name:"select",targetEl:u[f],originalEvt:t}))}else ct=dt;ut=l}if(yt&&this.isMultiDrag){if(wt=!1,(r[Q].options.sort||r!==n)&&mt.length>1){var h=D(dt),g=T(dt,":not(."+this.options.selectedClass+")");if(!gt&&c.animation&&(dt.thisAnimationDuration=null),l.captureAnimationState(),!gt&&(c.animation&&(dt.fromRect=h,mt.forEach(function(e){if(e.thisAnimationDuration=null,e!==dt){var t=wt?D(e):h;e.fromRect=t,l.addAnimationState({target:e,rect:t})}})),xt(),mt.forEach(function(e){u[g]?r.insertBefore(e,u[g]):r.appendChild(e),g++}),i===T(dt))){var w=!1;mt.forEach(function(e){e.sortableIndex===T(e)||(w=!0)}),w&&a("update")}mt.forEach(function(e){F(e)}),l.animateAll()}ut=l}(n===r||s&&"clone"!==s.lastPutMode)&&ht.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},nullingGlobal:function(){this.isMultiDrag=yt=!1,ht.length=0},destroyGlobal:function(){this._deselectMultiDrag(),y(document,"pointerup",this._deselectMultiDrag),y(document,"mouseup",this._deselectMultiDrag),y(document,"touchend",this._deselectMultiDrag),y(document,"keydown",this._checkKeyDown),y(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(void 0!==yt&&yt||ut!==this.sortable||e&&x(e.target,this.options.draggable,this.sortable.el,!1)||e&&0!==e.button))for(;mt.length;){var t=mt[0];_(t,this.options.selectedClass,!1),mt.shift(),W({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},s(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[Q];t&&t.options.multiDrag&&!~mt.indexOf(e)&&(ut&&ut!==t&&(ut.multiDrag._deselectMultiDrag(),ut=t),_(e,t.options.selectedClass,!0),mt.push(e))},deselect:function(e){var t=e.parentNode[Q],n=mt.indexOf(e);t&&t.options.multiDrag&&~n&&(_(e,t.options.selectedClass,!1),mt.splice(n,1))}},eventProperties:function(){var e,t=this,n=[],r=[];return mt.forEach(function(e){var o;n.push({multiDragElement:e,index:e.sortableIndex}),o=wt&&e!==dt?-1:wt?T(e,":not(."+t.options.selectedClass+")"):T(e),r.push({multiDragElement:e,index:o})}),{items:(e=mt,function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}(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.")}()),clones:[].concat(ht),oldIndicies:n,newIndicies:r}},optionListeners:{multiDragKey:function(e){return"ctrl"===(e=e.toLowerCase())?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function vt(e,t){ht.forEach(function(n,r){var o=t.children[n.sortableIndex+(e?Number(r):0)];o?t.insertBefore(n,o):t.appendChild(n)})}function xt(){mt.forEach(function(e){e!==dt&&e.parentNode&&e.parentNode.removeChild(e)})}Be.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):this.options.supportPointer?w(document,"pointermove",this._handleFallbackAutoScroll):t.touches?w(document,"touchmove",this._handleFallbackAutoScroll):w(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):(y(document,"pointermove",this._handleFallbackAutoScroll),y(document,"touchmove",this._handleFallbackAutoScroll),y(document,"mousemove",this._handleFallbackAutoScroll)),nt(),tt(),clearTimeout(N),N=void 0},nulling:function(){qe=He=Ge=et=Je=$e=Xe=null,Ke.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,o);if(qe=e,t||this.options.forceAutoScrollFallback||d||u||p){ot(e,this.options,a,t);var i=O(a,!0);!et||Je&&r===$e&&o===Xe||(Je&&nt(),Je=setInterval(function(){var a=O(document.elementFromPoint(r,o),!0);a!==i&&(i=a,tt()),ot(e,n.options,a,t)},10),$e=r,Xe=o)}else{if(!this.options.bubbleScroll||O(a,!0)===k())return void tt();ot(e,this.options,O(a,!1),!1)}}},s(e,{pluginName:"scroll",initializeByDefault:!0})}),Be.mount(st,it);const Nt=Be},5229(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(1133)),o=n(8917);function a(e,t){var n={};return e&&"string"==typeof e?((0,r.default)(e,function(e,r){e&&r&&(n[(0,o.camelCase)(e,t)]=r)}),n):n}a.default=a,e.exports=a},8917(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,o=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},l=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(i,l):e.replace(a,l)).replace(r,s))}},1133(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.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;const r=(0,o.default)(e),a="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;const{property:r,value:o}=e;a?t(r,o,e):o&&(n=n||{},n[r]=o)}),n};const o=r(n(5077))},7676(e){"use strict";e.exports=function(e,t){if(!e)throw new Error("Invariant failed")}},7573(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>r});const r=function(e,t){}},8493(e,t,n){"use strict";var r=n(1609),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,i=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return s(function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})},[e,n,t]),i(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},2162(e,t,n){"use strict";var r=n(1609),o=n(9888),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,s=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return s=t}return s=e}if(t=s,a(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(i=e,t):(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]);var p=i(e,d[0],d[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}},2779(e,t,n){"use strict";var r=n(1609),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useSyncExternalStore,i=r.useRef,s=r.useEffect,l=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=i(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!s){if(s=!0,a=e,e=r(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,o(a,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(a=e,t):(a=e,i=n)}var a,i,s=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),c(p),p}},9888(e,t,n){"use strict";e.exports=n(8493)},9242(e,t,n){"use strict";e.exports=n(2162)},8418(e,t,n){"use strict";e.exports=n(2779)},8783(e,t,n){"use strict";function r(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}n.d(t,{A:()=>o});const o=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});if("object"==typeof t||"object"==typeof n){var o=r(t),a=r(n);return o!==t||a!==n?e(o,a):Object.keys(Object.assign({},t,n)).every(function(r){return e(t[r],n[r])})}return!1}},1609(e){"use strict";e.exports=window.React},5795(e){"use strict";e.exports=window.ReactDOM},1455(e){"use strict";e.exports=window.wp.apiFetch},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=i(e,a(n)))}return e}function a(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=i(t,n));return t}function i(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)}()},8168(e,t,n){"use strict";function r(){return r=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},r.apply(null,arguments)}n.d(t,{A:()=>r})},7387(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(3662);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.A)(e,t)}},8587(e,t,n){"use strict";function r(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}n.d(t,{A:()=>r})},3662(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:()=>r})},1561(e,t,n){"use strict";n.d(t,{A:()=>r});function r(e,t){if(!e)throw new Error("Invariant failed")}}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return r[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=r,e=[],a.O=(t,n,r,o)=>{if(!n){var i=1/0;for(u=0;u<e.length;u++){for(var[n,r,o]=e[u],s=!0,l=0;l<n.length;l++)(!1&o||i>=o)&&Object.keys(a.O).every(e=>a.O[e](n[l]))?n.splice(l--,1):(s=!1,o<i&&(i=o));if(s){e.splice(u--,1);var c=r();void 0!==c&&(t=c)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var i={};t=t||[null,n({}),n([]),n(n)];for(var s=2&r&&e;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{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(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={174:0,306:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[i,s,l]=n,c=0;if(i.some(t=>0!==e[t])){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);if(l)var u=l(a)}for(t&&t(n);c<i.length;c++)o=i[c],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(u)},n=globalThis.webpackChunkcartflows=globalThis.webpackChunkcartflows||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=a.O(void 0,[306],()=>a(5858));i=a.O(i)})();
26 +(0,j.__)("Use this to customize how your Instant %s page looks.","cartflows"),"thankyou"===p?.type?(0,j.__)("Thank You","cartflows"):p?.type.charAt(0).toUpperCase()+p?.type.slice(1)):(0,i.createElement)(i.Fragment,null,(0,j.__)("If you are using shortcodes, enable this design settings to apply styles.","cartflows")))),(0,i.createElement)(u_,{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:d["wcf-enable-design-settings"],label:(0,j.__)("Enable Design Settings","cartflows"),fullWidth:!0}),"yes"===d["wcf-enable-design-settings"]&&n&&(0,i.createElement)(WS,{section:n})):"checkout_form_fields"===e&&t?(0,i.createElement)(JS,{sectionId:t}):"product-options"===t&&n?(0,i.createElement)(qS,null):"change-template"===t&&"storeCheckout"===o&&"yes"!==f?(0,i.createElement)(eD,null):"checkout_offer"===e?(0,i.createElement)("div",{className:"wcf-page-wrapper"},TS(e,r,o,c)):n&&("products"!==e||"storeCheckout"!==o||cartflows_admin.store_checkout_show_product_tab)?(0,i.createElement)(WS,{section:n}):(0,i.createElement)("div",{className:"wcf-page-wrapper"},TS(e,r,o,c))))},hD=function(){return(0,i.createElement)("div",{className:"wcf-step-settings-view flex flex-col lg:flex-row lg:gap-6 items-start w-full"},(0,i.createElement)("div",{className:"wcf-step-setting--sidebar hidden lg:flex h-full min-h-screen flex-col w-auto sticky top-0 after:content-[''] after:fixed after:left-0 after:top-0 after:w-[420px] after:h-screen after:bg-background-primary after:-z-10"},(0,i.createElement)("div",{className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow bg-background-primary border-0 border-r border-solid border-border-subtle"},(0,i.createElement)("div",{className:"flex flex-col gap-0.5 pt-2"},[["w-20",!0,["w-24","w-20"]],["w-24",!1,[]],["w-16",!0,["w-28","w-20","w-24"]],["w-20",!1,[]],["w-16",!1,[]]].map(([e,t,n],r)=>(0,i.createElement)("div",{key:r,className:"flex flex-col"},(0,i.createElement)("div",{className:"flex items-center gap-2.5 px-3 py-2"},(0,i.createElement)(Gg,{className:"w-5 h-5 rounded"}),(0,i.createElement)(Gg,{className:`h-3 ${e} flex-1`}),t&&(0,i.createElement)(Gg,{className:"w-4 h-4 rounded"})),n.length>0&&(0,i.createElement)("div",{className:"flex flex-col gap-0.5 ml-10"},n.map((e,t)=>(0,i.createElement)("div",{key:t,className:"px-2 py-1.5"},(0,i.createElement)(Gg,{className:`h-3 ${e}`}))))))))),(0,i.createElement)("div",{className:"wcf-step-settings--container min-w-0 max-w-4.5xl p-4 md:p-8 mx-auto w-full flex flex-col gap-3"},(0,i.createElement)("div",{className:"flex items-center gap-2 py-1"},(0,i.createElement)(Gg,{className:"w-14 h-2.5"}),(0,i.createElement)(Gg,{className:"w-2 h-2.5"}),(0,i.createElement)(Gg,{className:"w-20 h-2.5"}),(0,i.createElement)(Gg,{className:"w-2 h-2.5"}),(0,i.createElement)(Gg,{className:"w-28 h-2.5"})),(0,i.createElement)("div",{className:"flex justify-between items-center h-10"},(0,i.createElement)("div",{className:"flex items-center gap-2.5"},(0,i.createElement)(Gg,{className:"w-5 h-5 rounded"}),(0,i.createElement)(Gg,{className:"w-40 h-5"})),(0,i.createElement)(Gg,{className:"w-28 h-9 rounded-lg"})),(0,i.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm overflow-hidden mb-8 p-6 flex flex-col gap-5"},(0,i.createElement)(Gg,{className:"w-32 h-4"}),["w-28","w-36","w-24","w-32"].map((e,t)=>(0,i.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,i.createElement)(Gg,{className:`${e} h-3.5`}),(0,i.createElement)(Gg,{className:"w-full h-10 rounded-md"}))))))};function gD(e,t,n,r,o){if("checkout_form_fields"===e)return"form-settings";if(o?.settings){const t=Object.entries(o.settings).filter(([,t])=>t.tab===e&&t.title).sort(([,e],[,t])=>e.priority-t.priority);if(t.length>0){var a;const[e,n]=t[0];return null!==(a=n.slug)&&void 0!==a?a:e}}if("settings"===e&&t?.settings){var i,s;const e=Object.values(t.settings).sort((e,t)=>e.priority-t.priority);return null!==(i=null!==(s=e[0]?.slug)&&void 0!==s?s:e[0]?.id)&&void 0!==i?i:null}if("design"===e&&n?.settings&&"yes"===r?.["wcf-enable-design-settings"]){var l,c;const e=Object.values(n.settings).sort((e,t)=>e.priority-t.priority);return null!==(l=null!==(c=e[0]?.slug)&&void 0!==c?c:e[0]?.id)&&void 0!==l?l:null}return null}const wD=function(e){var t,n,r;const[{flow_id:o,step_data:a,flow_type:s,options:c,page_builder:u,is_flow_instant_checkout:f,settings_data:p,design_settings:m,page_settings:h,current_ob:g},w]=Nm(),y=(0,i.useRef)(null),b=dg(),[{},v]=l(),x=(0,d.useHistory)(),N=new URLSearchParams((0,d.useLocation)()?.search),I=null!==(t=N.get("step_id"))&&void 0!==t?t:"",M=null!==(n=N.get("tab"))&&void 0!==n?n:"",E=null!==(r=N.get("section"))&&void 0!==r?r:null,[_,S]=(0,i.useState)(M||"products"),[D,C]=(0,i.useState)(E),A="active"===cartflows_admin.woocommerce_status;let T=!0;0!==Object.keys(a).length&&a.id.toString()===I&&(T=!1);const L=e=>{const t={};return Object.entries(e).forEach(([e,n])=>{const r={...n,step_type:a?.type||""};!1!==Zm.isActiveControl(r,c)&&(t[e]=n)}),t},O=(0,i.useMemo)(()=>{if(!m?.settings)return m;const e={};return Object.entries(m.settings).forEach(([t,n])=>{if(["shortcode","shortcodes"].includes(n.slug)&&"other"!==u)return;const r={...n,step_type:a?.type||""};!1!==Zm.isActiveControl(r,c)&&(e[t]=n)}),{...m,settings:e}},[m,u,a?.type,c]),z=(0,i.useMemo)(()=>{if(!p?.settings)return p;const e=L(p.settings),t={};return Object.entries(e).forEach(([e,n])=>{["shortcode","shortcodes"].includes(n.slug)&&"other"!==u||(t[e]=n)}),{...p,settings:t}},[p,u,a?.type,c]),P=(0,i.useMemo)(()=>h?.settings?{...h,settings:L(h.settings)}:h,[h,a?.type,c]);(0,i.useEffect)(()=>{let e=!0;return""!==I&&(async()=>{Ep()({path:`/cartflows/v1/admin/step-data/${I}`}).then(t=>{if(e){if(t.billing_fields){const e=Object.entries(t.billing_fields.fields).map(([e,t])=>({...t,key:e}));t.billing_fields=e}if(t.shipping_fields){const e=Object.entries(t.shipping_fields.fields).map(([e,t])=>({...t,key:e}));t.shipping_fields=e}w({type:"SET_STEP_DATA",data:t})}})})(),()=>{e=!1}},[I]),(0,i.useEffect)(()=>{if(!T&&!E){const e=gD(_,z,O,c,P);C(e)}},[T]);const R=null!=D?D:T?null:gD(_,z,O,c,P);let U=[];if(a?.tabs){const e=a.tabs,t=Object.values(e).sort((e,t)=>e.priority-t.priority);let n=t.map(e=>({name:e.title,id:e.id}));B=n,F=a,n="other"!==u&&"yes"!==f||["upsell","downsell"].includes(F?.type)&&"yes"!==F?.options?.["wcf-enable-instant-layout"]?B.filter(e=>"design"!==e.id):B,U=function(e,t,n,r,o,a,i){return e.map(e=>{const s={id:e.id,name:e.name,icon:(l=e.id,null!==(c={products:Qg,order_bumps:Xg,checkout_form_fields:qg,"dynamic-offers":ew,checkout_offer:nw,settings:Ig,optin_form_fields:nw,design:ow}[l])&&void 0!==c?c:Ig),sections:[]};var l,c;return"settings"===e.id&&t?.settings?(s.sections=Object.values(t.settings).sort((e,t)=>e.priority-t.priority).map(e=>{var t;return{id:null!==(t=e.slug)&&void 0!==t?t:e.id,tabId:"settings",name:e.title}}),"storeCheckout"===a&&"yes"!==i&&s.sections.push({id:"change-template",tabId:"settings",name:(0,j.__)("Change Template","cartflows")})):"design"===e.id&&n?.settings&&"yes"===r?.["wcf-enable-design-settings"]?s.sections=Object.values(n.settings).sort((e,t)=>e.priority-t.priority).map(e=>{var t;return{id:null!==(t=e.slug)&&void 0!==t?t:e.id,tabId:"design",name:e.title}}):"checkout_form_fields"===e.id?s.sections=[{id:"form-settings",tabId:"checkout_form_fields",name:(0,j.__)("Form Settings","cartflows")},{id:"field-editor",tabId:"checkout_form_fields",name:(0,j.__)("Field Editor","cartflows")},{id:"form-headings",tabId:"checkout_form_fields",name:(0,j.__)("Form Headings","cartflows")},{id:"place-order-button",tabId:"checkout_form_fields",name:(0,j.__)("Place Order Button","cartflows")}]:o?.settings&&"checkout_offer"!==e.id&&(s.sections=Object.entries(o.settings).filter(([,t])=>t.tab===e.id&&t.title).sort(([,e],[,t])=>e.priority-t.priority).map(([t,n])=>{var r;return{id:null!==(r=n.slug)&&void 0!==r?r:t,tabId:e.id,name:n.title}})),s})}(n,z,O,c,P,s,f)}var B,F;const Y=function(e,t,n,r,o){if(!t)return null;if(o?.settings){const n=Object.entries(o.settings).find(([n,r])=>{var o;return r.tab===e&&(null!==(o=r.slug)&&void 0!==o?o:n)===t});if(n)return n[1]}var a,i;return"settings"===e&&n?.settings?null!==(a=Object.values(n.settings).find(e=>{var n;return(null!==(n=e.slug)&&void 0!==n?n:e.id)===t}))&&void 0!==a?a:null:"design"===e&&r?.settings&&null!==(i=Object.values(r.settings).find(e=>{var n;return(null!==(n=e.slug)&&void 0!==n?n:e.id)===t}))&&void 0!==i?i:null}(_,R,z,O,P),Z=async function(){return!!window.wcfUnsavedChanges&&await b({title:"Save Changes",description:"You have made changes. Do you want to save the changes?",actionBtnText:"Yes",cancelBtnText:"No"})},V=(e,t)=>{const n=new URLSearchParams(window.location.search);n.set("tab",e),t?n.set("section",t):n.delete("section"),x.push({search:n.toString()})},G="storeCheckout"===s?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${o}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${o}`;return T?(0,i.createElement)(hD,null):(0,i.createElement)("form",{className:"wcf-step-settings-view flex flex-col lg:flex-row lg:gap-6 items-start w-full",onSubmit:function(t){t.preventDefault();const n=new window.FormData(t.target);if("yes"===c["wcf-enable-product-options"]&&Object.entries(c["wcf-product-options-data"]).forEach(([e,t])=>{Object.entries(t).forEach(([t,r])=>{const o=`wcf-product-options-data[${e}][${t}]`;n.has(o)||n.append(o,r)})}),"order_bumps"===_){const e=(0,k.applyFilters)("cartflows.stepSettings.orderBumpsSave",null);e?e({flowId:o,stepId:I,currentOb:g,dispatch:w,onStatus:e=>v({status:e})}):(v({status:"UNSAVED"}),Wm.error((0,j.__)("Could not save order bumps. Please update CartFlows Pro to the latest version.","cartflows")))}else{if(n.append("action","cartflows_save_meta_settings"),n.append("security",cartflows_admin.save_meta_settings_nonce),n.append("post_id",o),n.append("step_id",I),"products"===_&&"checkout"===a.type&&"single-selection"===c["wcf-product-options"]){const e=n.get("wcf_default_add_to_cart[]");n.set(`wcf-product-options-data[${e}][add_to_cart]`,"yes")}Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{v({status:"SAVED"}),Wm.success((0,j.__)("Settings saved successfully!","cartflows")),["products"].includes(_)&&e.renderCb()}).catch(()=>{v({status:"UNSAVED"}),Wm.error((0,j.__)("Failed to save settings. Please try again.","cartflows"))})}}},(0,i.createElement)(ZS,{accordionGroups:U,currentTab:_,currentSection:R,onTabChange:async function(e){if(e===_)return;await Z()&&y.current?.click();const t=gD(e,z,O,c,P);S(e),C(t),V(e,t),window.wcfUnsavedChanges=!1},onSectionChange:async function(e,t){e===_&&t===D||(await Z()&&y.current?.click(),S(e),C(t),V(e,t),window.wcfUnsavedChanges=!1)}}),(0,i.createElement)(mD,{currentTab:_,currentSection:R,sectionObject:Y,stepData:a,flowType:s,renderCb:e.renderCb,buttonRef:y,wooStatus:A,setActiveTab:S,backUrl:G}))},yD=To("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),bD=To("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]),vD=To("LayoutPanelTop",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]),xD=To("LayoutPanelLeft",[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]),ND=To("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]),ID=To("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),MD=To("Spline",[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]]),ED=To("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),_D=To("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),SD=To("Focus",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),DD=To("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);var jD={value:()=>{}};function kD(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new CD(r)}function CD(e){this._=e}function AD(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function TD(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=jD,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}CD.prototype=kD.prototype={constructor:CD,on:function(e,t){var n,r,o=this._,a=(r=o,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=a[i]).type)o[n]=TD(o[n],e.name,t);else if(null==t)for(n in o)o[n]=TD(o[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=AD(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new CD(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),a=0;a<n;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(r=this._[e]).length;a<n;++a)r[a].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,a=r.length;o<a;++o)r[o].value.apply(t,n)}};const LD=kD;function OD(){}function zD(e){return null==e?OD:function(){return this.querySelector(e)}}function PD(){return[]}function RD(e){return null==e?PD:function(){return this.querySelectorAll(e)}}function UD(e){return function(){return this.matches(e)}}function BD(e){return function(t){return t.matches(e)}}var FD=Array.prototype.find;function YD(){return this.firstElementChild}var ZD=Array.prototype.filter;function VD(){return Array.from(this.children)}function GD(e){return new Array(e.length)}function WD(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function HD(e,t,n,r,o,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],r[s]=i):n[s]=new WD(e,a[s]);for(;s<l;++s)(i=t[s])&&(o[s]=i)}function QD(e,t,n,r,o,a,i){var s,l,c,u=new Map,d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(r[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new WD(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function $D(e){return e.__data__}function XD(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function JD(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}WD.prototype={constructor:WD,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var qD="http://www.w3.org/1999/xhtml";const KD={svg:"http://www.w3.org/2000/svg",xhtml:qD,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ej(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),KD.hasOwnProperty(t)?{space:KD[t],local:e}:e}function tj(e){return function(){this.removeAttribute(e)}}function nj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rj(e,t){return function(){this.setAttribute(e,t)}}function oj(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function aj(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function ij(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function sj(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function lj(e){return function(){this.style.removeProperty(e)}}function cj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function uj(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function dj(e,t){return e.style.getPropertyValue(t)||sj(e).getComputedStyle(e,null).getPropertyValue(t)}function fj(e){return function(){delete this[e]}}function pj(e,t){return function(){this[e]=t}}function mj(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function hj(e){return e.trim().split(/^|\s+/)}function gj(e){return e.classList||new wj(e)}function wj(e){this._node=e,this._names=hj(e.getAttribute("class")||"")}function yj(e,t){for(var n=gj(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function bj(e,t){for(var n=gj(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function vj(e){return function(){yj(this,e)}}function xj(e){return function(){bj(this,e)}}function Nj(e,t){return function(){(t.apply(this,arguments)?yj:bj)(this,e)}}function Ij(){this.textContent=""}function Mj(e){return function(){this.textContent=e}}function Ej(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function _j(){this.innerHTML=""}function Sj(e){return function(){this.innerHTML=e}}function Dj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function jj(){this.nextSibling&&this.parentNode.appendChild(this)}function kj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cj(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===qD&&t.documentElement.namespaceURI===qD?t.createElement(e):t.createElementNS(n,e)}}function Aj(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Tj(e){var t=ej(e);return(t.local?Aj:Cj)(t)}function Lj(){return null}function Oj(){var e=this.parentNode;e&&e.removeChild(this)}function zj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Rj(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Uj(e,t,n){return function(){var r,o=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var i=0,s=o.length;i<s;++i)if((r=o[i]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=t);this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(r):this.__on=[r]}}function Bj(e,t,n){var r=sj(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Fj(e,t){return function(){return Bj(this,e,t)}}function Yj(e,t){return function(){return Bj(this,e,t.apply(this,arguments))}}wj.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Zj=[null];function Vj(e,t){this._groups=e,this._parents=t}function Gj(){return new Vj([[document.documentElement]],Zj)}Vj.prototype=Gj.prototype={constructor:Vj,select:function(e){"function"!=typeof e&&(e=zD(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new Vj(r,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return function(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}(e.apply(this,arguments))}}(e):RD(e);for(var t=this._groups,n=t.length,r=[],o=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(r.push(e.call(i,i.__data__,c,s)),o.push(i));return new Vj(r,o)},selectChild:function(e){return this.select(null==e?YD:function(e){return function(){return FD.call(this.children,e)}}("function"==typeof e?e:BD(e)))},selectChildren:function(e){return this.selectAll(null==e?VD:function(e){return function(){return ZD.call(this.children,e)}}("function"==typeof e?e:BD(e)))},filter:function(e){"function"!=typeof e&&(e=UD(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new Vj(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,$D);var n=t?QD:HD,r=this._parents,o=this._groups;"function"!=typeof e&&(e=function(e){return function(){return e}}(e));for(var a=o.length,i=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=r[c],d=o[c],f=d.length,p=XD(e.call(u,u&&u.__data__,c,r)),m=p.length,h=s[c]=new Array(m),g=i[c]=new Array(m);n(u,d,h,g,l[c]=new Array(f),p,t);for(var w,y,b=0,v=0;b<m;++b)if(w=h[b]){for(b>=v&&(v=b+1);!(y=g[v])&&++v<m;);w._next=y||null}}return(i=new Vj(i,r))._enter=s,i._exit=l,i},enter:function(){return new Vj(this._enter||this._groups.map(GD),this._parents)},exit:function(){return new Vj(this._exit||this._groups.map(GD),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,a=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?a.remove():n(a),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,a=r.length,i=Math.min(o,a),s=new Array(o),l=0;l<i;++l)for(var c,u=n[l],d=r[l],f=u.length,p=s[l]=new Array(f),m=0;m<f;++m)(c=u[m]||d[m])&&(p[m]=c);for(;l<o;++l)s[l]=n[l];return new Vj(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],a=o.length-1,i=o[a];--a>=0;)(r=o[a])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=JD);for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a){for(var i,s=n[a],l=s.length,c=o[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new Vj(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var i=r[o];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,a=t[n],i=0,s=a.length;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this},attr:function(e,t){var n=ej(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?nj:tj:"function"==typeof t?n.local?ij:aj:n.local?oj:rj)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?lj:"function"==typeof t?uj:cj)(e,t,null==n?"":n)):dj(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?fj:"function"==typeof t?mj:pj)(e,t)):this.node()[e]},classed:function(e,t){var n=hj(e+"");if(arguments.length<2){for(var r=gj(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?Nj:t?vj:xj)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ij:("function"==typeof e?Ej:Mj)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?_j:("function"==typeof e?Dj:Sj)(e)):this.node().innerHTML},raise:function(){return this.each(jj)},lower:function(){return this.each(kj)},append:function(e){var t="function"==typeof e?e:Tj(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Tj(e),r=null==t?Lj:"function"==typeof t?t:zD(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Oj)},clone:function(e){return this.select(e?Pj:zj)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?Uj:Rj,r=0;r<i;++r)this.each(s(a[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<i;++r)if((o=a[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?Yj:Fj)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],a=0,i=o.length;a<i;++a)(r=o[a])&&(yield r)}};const Wj=Gj;function Hj(e){return"string"==typeof e?new Vj([[document.querySelector(e)]],[document.documentElement]):new Vj([[e]],Zj)}function Qj(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const $j={passive:!1},Xj={capture:!0,passive:!1};function Jj(e){e.stopImmediatePropagation()}function qj(e){e.preventDefault(),e.stopImmediatePropagation()}function Kj(e){var t=e.document.documentElement,n=Hj(e).on("dragstart.drag",qj,Xj);"onselectstart"in t?n.on("selectstart.drag",qj,Xj):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ek(e,t){var n=e.document.documentElement,r=Hj(e).on("dragstart.drag",null);t&&(r.on("click.drag",qj,Xj),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const tk=e=>()=>e;function nk(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:a,x:i,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function rk(e){return!e.ctrlKey&&!e.button}function ok(){return this.parentNode}function ak(e,t){return null==t?{x:e.x,y:e.y}:t}function ik(){return navigator.maxTouchPoints||"ontouchstart"in this}function sk(){var e,t,n,r,o=rk,a=ok,i=ak,s=ik,l={},c=LD("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",w,$j).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,s){if(!r&&o.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(Hj(i.view).on("mousemove.drag",m,Xj).on("mouseup.drag",h,Xj),Kj(i.view),Jj(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function m(r){if(qj(r),!n){var o=r.clientX-e,a=r.clientY-t;n=o*o+a*a>d}l.mouse("drag",r)}function h(e){Hj(e.view).on("mousemove.drag mouseup.drag",null),ek(e.view,n),qj(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(r=b(this,s,e,t,i[n].identifier,i[n]))&&(Jj(e),r("start",e,i[n]))}}function w(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(qj(e),n("drag",e,r[t]))}function y(e){var t,n,o=e.changedTouches,a=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<a;++t)(n=l[o[t].identifier])&&(Jj(e),n("end",e,o[t]))}function b(e,t,n,r,o,a){var s,d,p,m=c.copy(),h=Qj(a||n,t);if(null!=(p=i.call(e,new nk("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:h[0],y:h[1],dx:0,dy:0,dispatch:m}),r)))return s=p.x-h[0]||0,d=p.y-h[1]||0,function n(a,i,c){var g,w=h;switch(a){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":h=Qj(c||i,t),g=u}m.call(a,e,new nk(a,{sourceEvent:i,subject:p,target:f,identifier:o,active:g,x:h[0]+s,y:h[1]+d,dx:h[0]-w[0],dy:h[1]-w[1],dispatch:m}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:tk(!!e),f):o},f.container=function(e){return arguments.length?(a="function"==typeof e?e:tk(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:tk(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:tk(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function lk(e){return((e=Math.exp(e))+1/e)/2}nk.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};const ck=function e(t,n,r){function o(e,o){var a,i,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-s,m=d-l,h=p*p+m*m;if(h<1e-12)i=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*m,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(h),w=(f*f-c*c+r*h)/(2*c*n*g),y=(f*f-c*c-r*h)/(2*f*n*g),b=Math.log(Math.sqrt(w*w+1)-w),v=Math.log(Math.sqrt(y*y+1)-y);i=(v-b)/t,a=function(e){var r=e*i,o=lk(b),a=c/(n*g)*(o*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*r+b)-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+a*p,l+a*m,c*o/lk(t*r+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);var uk,dk,fk=0,pk=0,mk=0,hk=0,gk=0,wk=0,yk="object"==typeof performance&&performance.now?performance:Date,bk="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function vk(){return gk||(bk(xk),gk=yk.now()+wk)}function xk(){gk=0}function Nk(){this._call=this._time=this._next=null}function Ik(e,t,n){var r=new Nk;return r.restart(e,t,n),r}function Mk(){gk=(hk=yk.now())+wk,fk=pk=0;try{!function(){vk(),++fk;for(var e,t=uk;t;)(e=gk-t._time)>=0&&t._call.call(void 0,e),t=t._next;--fk}()}finally{fk=0,function(){for(var e,t,n=uk,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:uk=t);dk=e,_k(r)}(),gk=0}}function Ek(){var e=yk.now(),t=e-hk;t>1e3&&(wk-=t,hk=e)}function _k(e){fk||(pk&&(pk=clearTimeout(pk)),e-gk>24?(e<1/0&&(pk=setTimeout(Mk,e-yk.now()-wk)),mk&&(mk=clearInterval(mk))):(mk||(hk=yk.now(),mk=setInterval(Ek,1e3)),fk=1,bk(Mk)))}function Sk(e,t,n){var r=new Nk;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}Nk.prototype=Ik.prototype={constructor:Nk,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?vk():+n)+(null==t?0:+t),this._next||dk===this||(dk?dk._next=this:uk=this,dk=this),this._call=e,this._time=n,_k()},stop:function(){this._call&&(this._call=null,this._time=1/0,_k())}};var Dk=LD("start","end","cancel","interrupt"),jk=[];function kk(e,t,n,r,o,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function a(l){var c,u,d,f;if(1!==n.state)return s();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return Sk(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(Sk(function(){3===n.state&&(n.state=4,n.timer.restart(i,n.delay,n.time),i(l))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function i(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),a=-1,i=r.length;++a<i;)r[a].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Ik(function(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:o,on:Dk,tween:jk,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Ck(e,t){var n=Tk(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Ak(e,t){var n=Tk(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Tk(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Lk(e,t){var n,r,o,a=e.__transition,i=!0;if(a){for(o in t=null==t?null:t+"",a)(n=a[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[o]):i=!1;i&&delete e.__transition}}function Ok(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var zk,Pk=180/Math.PI,Rk={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Uk(e,t,n,r,o,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*Pk,skewX:Math.atan(l)*Pk,scaleX:i,scaleY:s}}function Bk(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,r,o,a,i,s){if(e!==o||r!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:Ok(e,o)},{i:l-2,x:Ok(r,a)})}else(o||a)&&i.push("translate("+o+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(o(n)+"rotate(",null,r)-2,x:Ok(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(o(n)+"skewX(",null,r)-2,x:Ok(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(a.skewX,i.skewX,s,l),function(e,t,n,r,a,i){if(e!==n||t!==r){var s=a.push(o(a)+"scale(",null,",",null,")");i.push({i:s-4,x:Ok(e,n)},{i:s-2,x:Ok(t,r)})}else 1===n&&1===r||a.push(o(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var Fk=Bk(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Rk:Uk(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Yk=Bk(function(e){return null==e?Rk:(zk||(zk=document.createElementNS("http://www.w3.org/2000/svg","g")),zk.setAttribute("transform",e),(e=zk.transform.baseVal.consolidate())?Uk((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):Rk)},", ",")",")");function Zk(e,t){var n,r;return function(){var o=Ak(this,e),a=o.tween;if(a!==n)for(var i=0,s=(r=n=a).length;i<s;++i)if(r[i].name===t){(r=r.slice()).splice(i,1);break}o.tween=r}}function Vk(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var a=Ak(this,e),i=a.tween;if(i!==r){o=(r=i).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}a.tween=o}}function Gk(e,t,n){var r=e._id;return e.each(function(){var e=Ak(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Tk(e,r).value[t]}}function Wk(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Hk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qk(){}var $k=.7,Xk=1/$k,Jk="\\s*([+-]?\\d+)\\s*",qk="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kk="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eC=/^#([0-9a-f]{3,8})$/,tC=new RegExp(`^rgb\\(${Jk},${Jk},${Jk}\\)$`),nC=new RegExp(`^rgb\\(${Kk},${Kk},${Kk}\\)$`),rC=new RegExp(`^rgba\\(${Jk},${Jk},${Jk},${qk}\\)$`),oC=new RegExp(`^rgba\\(${Kk},${Kk},${Kk},${qk}\\)$`),aC=new RegExp(`^hsl\\(${qk},${Kk},${Kk}\\)$`),iC=new RegExp(`^hsla\\(${qk},${Kk},${Kk},${qk}\\)$`),sC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function lC(){return this.rgb().formatHex()}function cC(){return this.rgb().formatRgb()}function uC(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=eC.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?dC(t):3===n?new mC(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?fC(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?fC(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=tC.exec(e))?new mC(t[1],t[2],t[3],1):(t=nC.exec(e))?new mC(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=rC.exec(e))?fC(t[1],t[2],t[3],t[4]):(t=oC.exec(e))?fC(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=aC.exec(e))?vC(t[1],t[2]/100,t[3]/100,1):(t=iC.exec(e))?vC(t[1],t[2]/100,t[3]/100,t[4]):sC.hasOwnProperty(e)?dC(sC[e]):"transparent"===e?new mC(NaN,NaN,NaN,0):null}function dC(e){return new mC(e>>16&255,e>>8&255,255&e,1)}function fC(e,t,n,r){return r<=0&&(e=t=n=NaN),new mC(e,t,n,r)}function pC(e,t,n,r){return 1===arguments.length?function(e){return e instanceof Qk||(e=uC(e)),e?new mC((e=e.rgb()).r,e.g,e.b,e.opacity):new mC}(e):new mC(e,t,n,null==r?1:r)}function mC(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function hC(){return`#${bC(this.r)}${bC(this.g)}${bC(this.b)}`}function gC(){const e=wC(this.opacity);return`${1===e?"rgb(":"rgba("}${yC(this.r)}, ${yC(this.g)}, ${yC(this.b)}${1===e?")":`, ${e})`}`}function wC(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yC(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bC(e){return((e=yC(e))<16?"0":"")+e.toString(16)}function vC(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new NC(e,t,n,r)}function xC(e){if(e instanceof NC)return new NC(e.h,e.s,e.l,e.opacity);if(e instanceof Qk||(e=uC(e)),!e)return new NC;if(e instanceof NC)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,s=a-o,l=(a+o)/2;return s?(i=t===a?(n-r)/s+6*(n<r):n===a?(r-t)/s+2:(t-n)/s+4,s/=l<.5?a+o:2-a-o,i*=60):s=l>0&&l<1?0:i,new NC(i,s,l,e.opacity)}function NC(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function IC(e){return(e=(e||0)%360)<0?e+360:e}function MC(e){return Math.max(0,Math.min(1,e||0))}function EC(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function _C(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}Wk(Qk,uC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lC,formatHex:lC,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return xC(this).formatHsl()},formatRgb:cC,toString:cC}),Wk(mC,pC,Hk(Qk,{brighter(e){return e=null==e?Xk:Math.pow(Xk,e),new mC(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?$k:Math.pow($k,e),new mC(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mC(yC(this.r),yC(this.g),yC(this.b),wC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hC,formatHex:hC,formatHex8:function(){return`#${bC(this.r)}${bC(this.g)}${bC(this.b)}${bC(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gC,toString:gC})),Wk(NC,function(e,t,n,r){return 1===arguments.length?xC(e):new NC(e,t,n,null==r?1:r)},Hk(Qk,{brighter(e){return e=null==e?Xk:Math.pow(Xk,e),new NC(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?$k:Math.pow($k,e),new NC(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new mC(EC(e>=240?e-240:e+120,o,r),EC(e,o,r),EC(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new NC(IC(this.h),MC(this.s),MC(this.l),wC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=wC(this.opacity);return`${1===e?"hsl(":"hsla("}${IC(this.h)}, ${100*MC(this.s)}%, ${100*MC(this.l)}%${1===e?")":`, ${e})`}`}}));const SC=e=>()=>e;function DC(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):SC(isNaN(e)?t:e)}const jC=function e(t){var n=function(e){return 1===(e=+e)?DC:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):SC(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=pC(e)).r,(t=pC(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=DC(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function kC(e){return function(t){var n,r,o=t.length,a=new Array(o),i=new Array(o),s=new Array(o);for(n=0;n<o;++n)r=pC(t[n]),a[n]=r.r||0,i[n]=r.g||0,s[n]=r.b||0;return a=e(a),i=e(i),s=e(s),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=s(e),r+""}}}kC(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,s=r<t-1?e[r+2]:2*a-o;return _C((n-r/t)*t,i,o,a,s)}}),kC(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],s=e[(r+2)%t];return _C((n-r/t)*t,o,a,i,s)}});var CC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,AC=new RegExp(CC.source,"g");function TC(e,t){var n,r,o,a=CC.lastIndex=AC.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=CC.exec(e))&&(r=AC.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,l.push({i,x:Ok(n,r)})),a=AC.lastIndex;return a<t.length&&(o=t.slice(a),s[i]?s[i]+=o:s[++i]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function LC(e,t){var n;return("number"==typeof t?Ok:t instanceof uC?jC:(n=uC(t))?(t=n,jC):TC)(e,t)}function OC(e){return function(){this.removeAttribute(e)}}function zC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PC(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===r?o:o=t(r=i,n)}}function RC(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===r?o:o=t(r=i,n)}}function UC(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttribute(e)}}function BC(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttributeNS(e.space,e.local)}}function FC(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function YC(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function ZC(e,t){return function(){Ck(this,e).delay=+t.apply(this,arguments)}}function VC(e,t){return t=+t,function(){Ck(this,e).delay=t}}function GC(e,t){return function(){Ak(this,e).duration=+t.apply(this,arguments)}}function WC(e,t){return t=+t,function(){Ak(this,e).duration=t}}var HC=Wj.prototype.constructor;function QC(e){return function(){this.style.removeProperty(e)}}var $C=0;function XC(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function JC(){return++$C}var qC=Wj.prototype;XC.prototype=function(e){return Wj().transition(e)}.prototype={constructor:XC,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=zD(e));for(var r=this._groups,o=r.length,a=new Array(o),i=0;i<o;++i)for(var s,l,c=r[i],u=c.length,d=a[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,kk(d[f],t,n,f,d,Tk(s,n)));return new XC(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=RD(e));for(var r=this._groups,o=r.length,a=[],i=[],s=0;s<o;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),m=Tk(l,n),h=0,g=p.length;h<g;++h)(f=p[h])&&kk(f,t,n,h,p,m);a.push(p),i.push(l)}return new XC(a,i,t,n)},selectChild:qC.selectChild,selectChildren:qC.selectChildren,filter:function(e){"function"!=typeof e&&(e=UD(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new XC(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,a=Math.min(r,o),i=new Array(r),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<r;++s)i[s]=t[s];return new XC(i,this._parents,this._name,this._id)},selection:function(){return new HC(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=JC(),r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=Tk(i,t);kk(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new XC(r,this._parents,e,n)},call:qC.call,nodes:qC.nodes,node:qC.node,size:qC.size,empty:qC.empty,each:qC.each,on:function(e,t){var n=this._id;return arguments.length<2?Tk(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?Ck:Ak;return function(){var i=a(this,e),s=i.on;s!==r&&(o=(r=s).copy()).on(t,n),i.on=o}}(n,e,t))},attr:function(e,t){var n=ej(e),r="transform"===n?Yk:LC;return this.attrTween(e,"function"==typeof t?(n.local?BC:UC)(n,r,Gk(this,"attr."+e,t)):null==t?(n.local?zC:OC)(n):(n.local?RC:PC)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=ej(e);return this.tween(n,(r.local?FC:YC)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?Fk:LC;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var a=dj(this,e),i=(this.style.removeProperty(e),dj(this,e));return a===i?null:a===n&&i===r?o:o=t(n=a,r=i)}}(e,r)).on("end.style."+e,QC(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,a;return function(){var i=dj(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=dj(this,e)),i===l?null:i===r&&l===o?a:(o=l,a=t(r=i,s))}}(e,r,Gk(this,"style."+e,t))).each(function(e,t){var n,r,o,a,i="style."+t,s="end."+i;return function(){var l=Ak(this,e),c=l.on,u=null==l.value[i]?a||(a=QC(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,a=n+"";return function(){var i=dj(this,e);return i===a?null:i===r?o:o=t(r=i,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function a(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Gk(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=Tk(this.node(),n).tween,a=0,i=o.length;a<i;++a)if((r=o[a]).name===e)return r.value;return null}return this.each((null==t?Zk:Vk)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ZC:VC)(t,e)):Tk(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?GC:WC)(t,e)):Tk(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){Ak(this,e).ease=t}}(t,e)):Tk(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Ak(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--o&&a()}};n.each(function(){var n=Ak(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===o&&a()})},[Symbol.iterator]:qC[Symbol.iterator]};var KC={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function eA(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}Wj.prototype.interrupt=function(e){return this.each(function(){Lk(this,e)})},Wj.prototype.transition=function(e){var t,n;e instanceof XC?(t=e._id,e=e._name):(t=JC(),(n=KC).time=vk(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)(i=s[c])&&kk(i,e,t,c,s,n||eA(i,t));return new XC(r,this._parents,e,t)};const tA=e=>()=>e;function nA(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function rA(e,t,n){this.k=e,this.x=t,this.y=n}rA.prototype={constructor:rA,scale:function(e){return 1===e?this:new rA(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new rA(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var oA=new rA(1,0,0);function aA(e){for(;!e.__zoom;)if(!(e=e.parentNode))return oA;return e.__zoom}function iA(e){e.stopImmediatePropagation()}function sA(e){e.preventDefault(),e.stopImmediatePropagation()}function lA(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function cA(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function uA(){return this.__zoom||oA}function dA(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function fA(){return navigator.maxTouchPoints||"ontouchstart"in this}function pA(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}function mA(){var e,t,n,r=lA,o=cA,a=pA,i=dA,s=fA,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=ck,f=LD("start","zoom","end"),p=0,m=10;function h(e){e.property("__zoom",uA).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",M).filter(s).on("touchstart.zoom",E).on("touchmove.zoom",_).on("touchend.zoom touchcancel.zoom",S).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new rA(t,e.x,e.y)}function w(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new rA(e.k,r,o)}function y(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){v(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){v(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,a=arguments,i=v(e,a).event(r),s=o.apply(e,a),l=null==n?y(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new rA(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function v(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function N(e,...t){if(r.apply(this,arguments)){var n=v(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,i.apply(this,arguments)))),u=Qj(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],Lk(this),n.start()}sA(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(w(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function I(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,i=v(this,t,!0).event(e),s=Hj(e.view).on("mousemove.zoom",function(e){if(sA(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>p}i.event(e).zoom("mouse",a(w(i.that.__zoom,i.mouse[0]=Qj(e,o),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),ek(e.view,i.moved),sA(e),i.event(e).end()},!0),l=Qj(e,o),u=e.clientX,d=e.clientY;Kj(e.view),iA(e),i.mouse=[l,this.__zoom.invert(l)],Lk(this),i.start()}}function M(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,i=Qj(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=a(w(g(n,l),i,s),o.apply(this,t),c);sA(e),u>0?Hj(this).transition().duration(u).call(b,d,i,e):Hj(this).call(h.transform,d,i,e)}}function E(n,...o){if(r.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=v(this,o,n.changedTouches.length===u).event(n);for(iA(n),i=0;i<u;++i)l=[l=Qj(s=c[i],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,a=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),a&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Lk(this),d.start())}}function _(e,...t){if(this.__zooming){var n,r,o,i,s=v(this,t).event(e),l=e.changedTouches,u=l.length;for(sA(e),n=0;n<u;++n)o=Qj(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],m=s.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,y=(y=m[0]-f[0])*y+(y=m[1]-f[1])*y;r=g(r,Math.sqrt(h/y)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(w(r,o,i),s.extent,c))}}function S(e,...r){if(this.__zooming){var o,a,i=v(this,r).event(e),s=e.changedTouches,l=s.length;for(iA(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)a=s[o],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=Qj(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<m)){var c=Hj(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return h.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",uA),e!==o?b(e,t,n,r):o.interrupt().each(function(){v(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},h.scaleBy=function(e,t,n,r){h.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},h.scaleTo=function(e,t,n,r){h.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,i=null==n?y(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(w(g(r,l),i,s),e,c)},n,r)},h.translateBy=function(e,t,n,r){h.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},h.translateTo=function(e,t,n,r,i){h.transform(e,function(){var e=o.apply(this,arguments),i=this.__zoom,s=null==r?y(e):"function"==typeof r?r.apply(this,arguments):r;return a(oA.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=Hj(this.that).datum();f.call(e,this.that,new nA(e,{sourceEvent:this.sourceEvent,target:h,type:e,transform:this.that.__zoom,dispatch:f}),t)}},h.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:tA(+e),h):i},h.filter=function(e){return arguments.length?(r="function"==typeof e?e:tA(!!e),h):r},h.touchable=function(e){return arguments.length?(s="function"==typeof e?e:tA(!!e),h):s},h.extent=function(e){return arguments.length?(o="function"==typeof e?e:tA([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),h):o},h.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],h):[l[0],l[1]]},h.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],h):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},h.constrain=function(e){return arguments.length?(a=e,h):a},h.duration=function(e){return arguments.length?(u=+e,h):u},h.interpolate=function(e){return arguments.length?(d=e,h):d},h.on=function(){var e=f.on.apply(f,arguments);return e===f?h:e},h.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,h):Math.sqrt(p)},h.tapDistance=function(e){return arguments.length?(m=+e,h):m},h}function hA(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=new Array(o),i=new Array(r);for(n=0;n<o;++n)a[n]=bA(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}function gA(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function wA(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=bA(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}function yA(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}}function bA(e,t){var n,r=typeof t;return null==t||"boolean"===r?SC(t):("number"===r?Ok:"string"===r?(n=uC(t))?(t=n,jC):TC:t instanceof uC?jC:t instanceof Date?gA:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?yA:Array.isArray(t)?hA:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?wA:Ok)(e,t)}aA.prototype=rA.prototype;const vA=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],xA=["Enter"," ","Escape"],NA={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var IA,MA,EA;!function(e){e.Strict="strict",e.Loose="loose"}(IA||(IA={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(MA||(MA={})),function(e){e.Partial="partial",e.Full="full"}(EA||(EA={}));const _A={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var SA,DA,jA;!function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(SA||(SA={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(DA||(DA={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(jA||(jA={}));const kA={[jA.Left]:jA.Right,[jA.Right]:jA.Left,[jA.Top]:jA.Bottom,[jA.Bottom]:jA.Top};function CA(e){return null===e?null:e?"valid":"invalid"}const AA=e=>"id"in e&&"source"in e&&"target"in e,TA=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),LA=(e,t=[0,0])=>{const{width:n,height:r}=iT(e),o=e.origin??t,a=n*o[0],i=r*o[1];return{x:e.position.x-a,y:e.position.y-i}},OA=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=ZA(n,HA(e)),r=!0)}),r?GA(n):{x:0,y:0,width:0,height:0}},zA=(e,t,[n,r,o]=[0,0,1],a=!1,i=!1)=>{const s={...eT(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const t of e.values()){const{measured:e,selectable:n=!0,hidden:r=!1}=t;if(i&&!n||r)continue;const o=e.width??t.width??t.initialWidth??null,c=e.height??t.height??t.initialHeight??null,u=$A(s,WA(t)),d=(o??0)*(c??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&l.push(t)}return l};function PA({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:a}){const i=n.get(e),s=i.parentId?n.get(i.parentId):void 0,{x:l,y:c}=s?s.internals.positionAbsolute:{x:0,y:0},u=i.origin??r;let d=i.extent||o;if("parent"!==i.extent||i.expandParent)s&&aT(i.extent)&&(d=[[i.extent[0][0]+l,i.extent[0][1]+c],[i.extent[1][0]+l,i.extent[1][1]+c]]);else if(s){const e=s.measured.width,t=s.measured.height;e&&t&&(d=[[l,c],[l+e,c+t]])}else a?.("005","Only child nodes can use a parent extent.");const f=aT(d)?UA(t,d,i.measured):t;return void 0!==i.measured.width&&void 0!==i.measured.height||a?.("015","It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."),{position:{x:f.x-l+(i.measured.width??0)*u[0],y:f.y-c+(i.measured.height??0)*u[1]},positionAbsolute:f}}const RA=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),UA=(e={x:0,y:0},t,n)=>({x:RA(e.x,t[0][0],t[1][0]-(n?.width??0)),y:RA(e.y,t[0][1],t[1][1]-(n?.height??0))});function BA(e,t,n){const{width:r,height:o}=iT(n),{x:a,y:i}=n.internals.positionAbsolute;return UA(e,[[a,i],[a+r,i+o]],t)}const FA=(e,t,n)=>e<t?RA(Math.abs(e-t),1,t)/t:e>n?-RA(Math.abs(e-n),1,t)/t:0,YA=(e,t,n=15,r=40)=>[FA(e.x,r,t.width-r)*n,FA(e.y,r,t.height-r)*n],ZA=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),VA=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),GA=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),WA=(e,t=[0,0])=>{const{x:n,y:r}=TA(e)?e.internals.positionAbsolute:LA(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},HA=(e,t=[0,0])=>{const{x:n,y:r}=TA(e)?e.internals.positionAbsolute:LA(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},QA=(e,t)=>GA(ZA(VA(e),VA(t))),$A=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},XA=e=>JA(e.width)&&JA(e.height)&&JA(e.x)&&JA(e.y),JA=e=>!isNaN(e)&&isFinite(e),qA=(e,t)=>{},KA=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),eT=({x:e,y:t},[n,r,o],a=!1,i=[1,1])=>{const s={x:(e-n)/o,y:(t-r)/o};return a?KA(s,i):s},tT=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function nT(e,t){if("number"==typeof e)return Math.floor(.5*(t-t/(1+e)));if("string"==typeof e&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}const rT=(e,t,n,r,o,a)=>{const i=function(e,t,n){if("string"==typeof e||"number"==typeof e){const r=nT(e,n),o=nT(e,t);return{top:r,right:o,bottom:r,left:o,x:2*o,y:2*r}}if("object"==typeof e){const r=nT(e.top??e.y??0,n),o=nT(e.bottom??e.y??0,n),a=nT(e.left??e.x??0,t),i=nT(e.right??e.x??0,t);return{top:r,right:i,bottom:o,left:a,x:a+i,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(a,t,n),s=(t-i.x)/e.width,l=(n-i.y)/e.height,c=Math.min(s,l),u=RA(c,r,o),d=t/2-(e.x+e.width/2)*u,f=n/2-(e.y+e.height/2)*u,p=function(e,t,n,r,o,a){const{x:i,y:s}=tT(e,[t,n,r]),{x:l,y:c}=tT({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=o-l,d=a-c;return{left:Math.floor(i),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}(e,d,f,u,t,n),m=Math.min(p.left-i.left,0),h=Math.min(p.top-i.top,0);return{x:d-m+Math.min(p.right-i.right,0),y:f-h+Math.min(p.bottom-i.bottom,0),zoom:u}},oT=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function aT(e){return null!=e&&"parent"!==e}function iT(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function sT(e){return void 0!==(e.measured?.width??e.width??e.initialWidth)&&void 0!==(e.measured?.height??e.height??e.initialHeight)}function lT(e,t={width:0,height:0},n,r,o){const a={...e},i=r.get(n);if(i){const e=i.origin||o;a.x+=i.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=i.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function cT(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function uT(e){return{...NA,...e||{}}}function dT(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:a,y:i}=wT(e),s=eT({x:a-(o?.left??0),y:i-(o?.top??0)},r),{x:l,y:c}=n?KA(s,t):s;return{xSnapped:l,ySnapped:c,...s}}const fT=e=>({width:e.offsetWidth,height:e.offsetHeight}),pT=e=>e?.getRootNode?.()||window?.document,mT=["INPUT","SELECT","TEXTAREA"];function hT(e){const t=e.composedPath?.()?.[0]||e.target;return 1===t?.nodeType&&(mT.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}const gT=e=>"clientX"in e,wT=(e,t)=>{const n=gT(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},yT=(e,t,n,r,o)=>{const a=t.querySelectorAll(`.${e}`);return a&&a.length?Array.from(a).map(t=>{const a=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:o,position:t.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...fT(t)}}):null};function bT({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*o+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}function vT(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function xT({pos:e,x1:t,y1:n,x2:r,y2:o,c:a}){switch(e){case jA.Left:return[t-vT(t-r,a),n];case jA.Right:return[t+vT(r-t,a),n];case jA.Top:return[t,n-vT(n-o,a)];case jA.Bottom:return[t,n+vT(o-n,a)]}}function NT({sourceX:e,sourceY:t,sourcePosition:n=jA.Bottom,targetX:r,targetY:o,targetPosition:a=jA.Top,curvature:i=.25}){const[s,l]=xT({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=xT({pos:a,x1:r,y1:o,x2:e,y2:t,c:i}),[d,f,p,m]=bT({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,f,p,m]}function IT({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,a=n<e?n+o:n-o,i=Math.abs(r-t)/2;return[a,r<t?r+i:r-i,o,i]}function MT({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const a=ZA(HA(e),HA(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const i={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return $A(i,GA(a))>0}const ET=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,_T=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||ET;let o;return o=AA(e)?{...e}:{...e,id:r(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(o,t)?t:(null===o.sourceHandle&&delete o.sourceHandle,null===o.targetHandle&&delete o.targetHandle,t.concat(o))};function ST({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,a,i,s]=IT({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,a,i,s]}const DT={[jA.Left]:{x:-1,y:0},[jA.Right]:{x:1,y:0},[jA.Top]:{x:0,y:-1},[jA.Bottom]:{x:0,y:1}},jT=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kT(e,t,n,r){const o=Math.min(jT(e,t)/2,jT(t,n)/2,r),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i)return`L ${a+o*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+o*(e.y<n.y?-1:1)}Q ${a},${i} ${a+o*s},${i}`}function CT({sourceX:e,sourceY:t,sourcePosition:n=jA.Bottom,targetX:r,targetY:o,targetPosition:a=jA.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,p,m,h]=function({source:e,sourcePosition:t=jA.Bottom,target:n,targetPosition:r=jA.Top,center:o,offset:a,stepPosition:i}){const s=DT[t],l=DT[r],c={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+l.x*a,y:n.y+l.y*a},d=(({source:e,sourcePosition:t=jA.Bottom,target:n})=>t===jA.Left||t===jA.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:c,sourcePosition:t,target:u}),f=0!==d.x?"x":"y",p=d[f];let m,h,g=[];const w={x:0,y:0},y={x:0,y:0},[,,b,v]=IT({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){"x"===f?(m=o.x??c.x+(u.x-c.x)*i,h=o.y??(c.y+u.y)/2):(m=o.x??(c.x+u.x)/2,h=o.y??c.y+(u.y-c.y)*i);const e=[{x:m,y:c.y},{x:m,y:u.y}],t=[{x:c.x,y:h},{x:u.x,y:h}];g=s[f]===p?"x"===f?e:t:"x"===f?t:e}else{const o=[{x:c.x,y:u.y}],i=[{x:u.x,y:c.y}];if(g="x"===f?s.x===p?i:o:s.y===p?o:i,t===r){const t=Math.abs(e[f]-n[f]);if(t<=a){const r=Math.min(a-1,a-t);s[f]===p?w[f]=(c[f]>e[f]?-1:1)*r:y[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){const e="x"===f?"y":"x",t=s[f]===l[e],n=c[e]>u[e],r=c[e]<u[e];(1===s[f]&&(!t&&n||t&&r)||1!==s[f]&&(!t&&r||t&&n))&&(g="x"===f?o:i)}const d={x:c.x+w.x,y:c.y+w.y},b={x:u.x+y.x,y:u.y+y.y};Math.max(Math.abs(d.x-g[0].x),Math.abs(b.x-g[0].x))>=Math.max(Math.abs(d.y-g[0].y),Math.abs(b.y-g[0].y))?(m=(d.x+b.x)/2,h=g[0].y):(m=g[0].x,h=(d.y+b.y)/2)}const x={x:c.x+w.x,y:c.y+w.y},N={x:u.x+y.x,y:u.y+y.y};return[[e,...x.x!==g[0].x||x.y!==g[0].y?[x]:[],...g,...N.x!==g[g.length-1].x||N.y!==g[g.length-1].y?[N]:[],n],m,h,b,v]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:a,center:{x:s,y:l},offset:c,stepPosition:u});let g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=kT(d[e-1],d[e],d[e+1],i);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function AT(e){return e&&!(!e.internals.handleBounds&&!e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function TT(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function LT(e,t,n=jA.Left,r=!1){const o=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:i,height:s}=t??iT(e);if(r)return{x:o+i/2,y:a+s/2};switch(t?.position??n){case jA.Top:return{x:o+i/2,y:a};case jA.Right:return{x:o+i,y:a+s/2};case jA.Bottom:return{x:o+i/2,y:a+s};case jA.Left:return{x:o,y:a+s/2}}}function OT(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function zT(e,t){return e?"string"==typeof e?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`:""}const PT={nodeOrigin:[0,0],nodeExtent:vA,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},RT={...PT,checkEquality:!0};function UT(e,t){const n={...e};for(const e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function BT(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],r=[];for(const t of e.handles){const o={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(o):"target"===t.type&&r.push(o)}return{source:n,target:r}}function FT(e){return"manual"===e}function YT(e,t,n,r={}){const o=UT(RT,r),a={i:0},i=new Map(t),s=o?.elevateNodesOnSelect&&!FT(o.zIndexMode)?1e3:0;let l=e.length>0,c=!1;t.clear(),n.clear();for(const u of e){let e=i.get(u.id);if(o.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{const n=LA(u,o.nodeOrigin),r=aT(u.extent)?u.extent:o.nodeExtent,a=UA(n,r,iT(u));e={...o.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:a,handleBounds:BT(u,e),z:VT(u,s,o.zIndexMode),userNode:u}},t.set(u.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(l=!1),u.parentId&&ZT(e,t,n,r,a),c||=u.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function ZT(e,t,n,r,o){const{elevateNodesOnSelect:a,nodeOrigin:i,nodeExtent:s,zIndexMode:l}=UT(PT,r),c=e.parentId,u=t.get(c);if(!u)return void console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),o&&!u.parentId&&void 0===u.internals.rootParentIndex&&"auto"===l&&(u.internals.rootParentIndex=++o.i,u.internals.z=u.internals.z+10*o.i),o&&void 0!==u.internals.rootParentIndex&&(o.i=u.internals.rootParentIndex);const d=a&&!FT(l)?1e3:0,{x:f,y:p,z:m}=function(e,t,n,r,o,a){const{x:i,y:s}=t.internals.positionAbsolute,l=iT(e),c=LA(e,n),u=aT(e.extent)?UA(c,e.extent,l):c;let d=UA({x:i+u.x,y:s+u.y},r,l);"parent"===e.extent&&(d=BA(d,l,t));const f=VT(e,o,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}(e,u,i,s,d,l),{positionAbsolute:h}=e.internals,g=f!==h.x||p!==h.y;(g||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:f,y:p}:h,z:m}})}function VT(e,t,n){const r=JA(e.zIndex)?e.zIndex:0;return FT(n)?r:r+(e.selected?t:0)}function GT(e,t,n,r=[0,0]){const o=[],a=new Map;for(const n of e){const e=t.get(n.parentId);if(!e)continue;const r=a.get(n.parentId)?.expandedRect??WA(e),o=QA(r,n.rect);a.set(n.parentId,{expandedRect:o,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},i)=>{const s=a.internals.positionAbsolute,l=iT(a),c=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(l.width,Math.round(t.width)),p=Math.max(l.height,Math.round(t.height)),m=(f-l.width)*c[0],h=(p-l.height)*c[1];(u>0||d>0||m||h)&&(o.push({id:i,type:"position",position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(i)?.forEach(t=>{e.some(e=>e.id===t.id)||o.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})})),(l.width<t.width||l.height<t.height||u||d)&&o.push({id:i,type:"dimensions",setAttributes:!0,dimensions:{width:f+(u?c[0]*u-m:0),height:p+(d?c[1]*d-h:0)}})}),o}function WT(e,t,n,r,o,a){let i=o;const s=r.get(i)||new Map;r.set(i,s.set(n,t)),i=`${o}-${e}`;const l=r.get(i)||new Map;if(r.set(i,l.set(n,t)),a){i=`${o}-${e}-${a}`;const s=r.get(i)||new Map;r.set(i,s.set(n,t))}}function HT(e,t,n){e.clear(),t.clear();for(const r of n){const{source:n,target:o,sourceHandle:a=null,targetHandle:i=null}=r,s={edgeId:r.id,source:n,target:o,sourceHandle:a,targetHandle:i},l=`${n}-${a}--${o}-${i}`;WT("source",s,`${o}-${i}--${n}-${a}`,e,n,a),WT("target",s,l,e,o,i),t.set(r.id,r)}}function QT(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return!!n&&(!!n.selected||QT(n,t))}function $T(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function XT({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){const o=[];for(const[e,a]of t){const t=n.get(e)?.internals.userNode;t&&o.push({...t,position:a.position,dragging:r})}if(!e)return[o[0],o];const a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:o[0],o]}function JT(e,t,n,r,o,a=!1){const i=r.get(e);if(!i)return null;const s="strict"===o?i.internals.handleBounds?.[t]:[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]],l=(n?s?.find(e=>e.id===n):s?.[0])??null;return l&&a?{...l,...LT(i,l,l.position,!0)}:l}function qT(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}const KT=()=>!0;function eL(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:a,doc:i,lib:s,flowId:l,isValidConnection:c=KT,nodeLookup:u}){const d="target"===a,f=t?i.querySelector(`.${s}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=wT(e),h=i.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,w={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const e=qT(void 0,g),t=g.getAttribute("data-nodeid"),a=g.getAttribute("data-handleid"),i=g.classList.contains("connectable"),s=g.classList.contains("connectableend");if(!t||!e)return w;const l={source:d?t:r,sourceHandle:d?a:o,target:d?r:t,targetHandle:d?o:a};w.connection=l;const f=i&&s&&(n===IA.Strict?d&&"source"===e||!d&&"target"===e:t!==r||a!==o);w.isValid=f&&c(l),w.toHandle=JT(t,e,a,u,n,!0)}return w}const tL={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:a,isTarget:i,domNode:s,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:w=KT,onReconnectEnd:y,updateConnection:b,getTransform:v,getFromHandle:x,autoPanSpeed:N,dragThreshold:I=1,handleDomNode:M}){const E=pT(e.target);let _,S=0;const{x:D,y:j}=wT(e),k=qT(a,M),C=s?.getBoundingClientRect();let A=!1;if(!C||!k)return;const T=JT(o,k,r,l,t);if(!T)return;let L=wT(e,C),O=!1,z=null,P=!1,R=null;function U(){if(!u||!C)return;const[e,t]=YA(L,C,N);f({x:e,y:t}),S=requestAnimationFrame(U)}const B={...T,nodeId:o,type:k,position:T.position},F=l.get(o);let Y={inProgress:!0,isValid:null,from:LT(F,B,jA.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:F,to:L,toHandle:null,toPosition:kA[B.position],toNode:null,pointer:L};function Z(){A=!0,b(Y),m?.(e,{nodeId:o,handleId:r,handleType:k})}function V(e){if(!A){const{x:t,y:n}=wT(e),r=t-D,o=n-j;if(!(r*r+o*o>I*I))return;Z()}if(!x()||!B)return void G(e);const a=v();L=wT(e,C),_=function(e,t,n,r){let o=[],a=1/0;const i=function(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(const e of t.values())$A(o,WA(e))>0&&r.push(e);return r}(e,n,t+250);for(const n of i){const i=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(const s of i){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;const{x:i,y:l}=LT(n,s,s.position,!0),c=Math.sqrt(Math.pow(i-e.x,2)+Math.pow(l-e.y,2));c>t||(c<a?(o=[{...s,x:i,y:l}],a=c):c===a&&o.push({...s,x:i,y:l}))}}if(!o.length)return null;if(o.length>1){const e="source"===r.type?"target":"source";return o.find(t=>t.type===e)??o[0]}return o[0]}(eT(L,a,!1,[1,1]),n,l,B),O||(U(),O=!0);const s=eL(e,{handle:_,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:i?"target":"source",isValidConnection:w,doc:E,lib:c,flowId:d,nodeLookup:l});R=s.handleDomNode,z=s.connection,P=function(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}(!!_,s.isValid);const u=l.get(o),f=u?LT(u,B,jA.Left,!0):Y.from,p={...Y,from:f,isValid:P,to:s.toHandle&&P?tT({x:s.toHandle.x,y:s.toHandle.y},a):L,toHandle:s.toHandle,toPosition:P&&s.toHandle?s.toHandle.position:kA[B.position],toNode:s.toHandle?l.get(s.toHandle.nodeId):null,pointer:L};b(p),Y=p}function G(e){if(!("touches"in e&&e.touches.length>0)){if(A){(_||R)&&z&&P&&h?.(z);const{inProgress:t,...n}=Y,r={...n,toPosition:Y.toHandle?Y.toPosition:null};g?.(e,r),a&&y?.(e,r)}p(),cancelAnimationFrame(S),O=!1,P=!1,z=null,R=null,E.removeEventListener("mousemove",V),E.removeEventListener("mouseup",G),E.removeEventListener("touchmove",V),E.removeEventListener("touchend",G)}}0===I&&Z(),E.addEventListener("mousemove",V),E.addEventListener("mouseup",G),E.addEventListener("touchmove",V),E.addEventListener("touchend",G)},isValid:eL},nL=e=>({x:e.x,y:e.y,zoom:e.k}),rL=({x:e,y:t,zoom:n})=>oA.translate(e,t).scale(n),oL=(e,t)=>e.target.closest(`.${t}`),aL=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),iL=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,sL=(e,t=0,n=iL,r=()=>{})=>{const o="number"==typeof t&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},lL=e=>{const t=e.ctrlKey&&oT()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function cL({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:a,onPanZoomStart:i,onPanZoomEnd:s,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=mA().scaleExtent([t,n]).translateExtent(r),f=Hj(e).call(d);w({x:o.x,y:o.y,zoom:RA(o.zoom,t,n)},[[0,0],[u.width,u.height]],r);const p=f.on("wheel.zoom"),m=f.on("dblclick.zoom");function h(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?bA:ck).transform(sL(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function g(){d.on("zoom",null)}async function w(e,t,n){const r=rL(e),o=d?.constrain()(r,t,n);return o&&await h(o),new Promise(e=>e(o))}return d.wheelDelta(lL),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:o,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:w,preventScrolling:y,zoomOnPinch:b,zoomOnScroll:v,zoomOnDoubleClick:x,zoomActivationKeyPressed:N,lib:I,onTransformChange:M,connectionInProgress:E,paneClickDistance:_,selectionOnDrag:S}){r&&!c.isZoomingOrPanning&&g();const D=o&&!N&&!r;d.clickDistance(S?1/0:!JA(_)||_<0?0:_);const j=D?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:i,onPanZoomStart:s,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(oL(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&i){const e=Qj(u),t=lL(u),o=d*Math.pow(2,t);return void r.scaleTo(n,o,e,u)}const f=1===u.deltaMode?20:1;let p=o===MA.Vertical?0:u.deltaX*f,m=o===MA.Horizontal?0:u.deltaY*f;!oT()&&u.shiftKey&&o!==MA.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-p/d*a,-m/d*a,{internal:!0});const h=nL(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,h),e.panScrollTimeout=setTimeout(()=>{c?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}({zoomPanValues:c,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:w,zoomOnPinch:b,onPanZoomStart:i,onPanZoom:a,onPanZoomEnd:s}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const a="wheel"===r.type,i=!t&&a&&!r.ctrlKey,s=oL(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),i||s)return null;r.preventDefault(),n.call(this,r,o)}}({noWheelClassName:e,preventScrolling:y,d3ZoomHandler:p});if(f.on("wheel.zoom",j,{passive:!1}),!r){const e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;const o=nL(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,"mousedown"===r.sourceEvent?.type&&t(!0),n&&n?.(r.sourceEvent,o)}}({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:i});d.on("start",e);const t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return a=>{e.usedRightMouseButton=!(!n||!aL(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),o&&!a.sourceEvent?.internal&&o?.(a.sourceEvent,nL(a.transform))}}({zoomPanValues:c,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:M});d.on("zoom",t);const r=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:a}){return i=>{if(!i.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&aL(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&a(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const t=nL(i.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(i.sourceEvent,t)},n?150:0)}}}({zoomPanValues:c,panOnDrag:u,panOnScroll:o,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:l});d.on("end",r)}const k=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:i,noWheelClassName:s,noPanClassName:l,lib:c,connectionInProgress:u}){return d=>{const f=e||t,p=n&&d.ctrlKey,m="wheel"===d.type;if(1===d.button&&"mousedown"===d.type&&(oL(d,`${c}-flow__node`)||oL(d,`${c}-flow__edge`)))return!0;if(!(r||f||o||a||n))return!1;if(i)return!1;if(u&&!m)return!1;if(oL(d,s)&&m)return!1;if(oL(d,l)&&(!m||o&&m&&!e))return!1;if(!n&&d.ctrlKey&&m)return!1;if(!n&&"touchstart"===d.type&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!o&&!p&&m)return!1;if(!r&&("mousedown"===d.type||"touchstart"===d.type))return!1;if(Array.isArray(r)&&!r.includes(d.button)&&"mousedown"===d.type)return!1;const h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}({zoomActivationKeyPressed:N,panOnDrag:u,zoomOnScroll:v,panOnScroll:o,zoomOnDoubleClick:x,zoomOnPinch:b,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:I,connectionInProgress:E});d.filter(k),x?f.on("dblclick.zoom",m):f.on("dblclick.zoom",null)},destroy:g,setViewport:async function(e,t){const n=rL(e);return await h(n,t),new Promise(e=>e(n))},setViewportConstrained:w,getViewport:function(){const e=f?aA(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?bA:ck).scaleTo(sL(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?bA:ck).scaleBy(sL(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){d?.scaleExtent(e)},setTranslateExtent:function(e){d?.translateExtent(e)},syncViewport:function(e){if(f){const t=rL(e),n=f.property("__zoom");n.k===e.zoom&&n.x===e.x&&n.y===e.y||d?.transform(f,t,null,{sync:!0})}},setClickDistance:function(e){const t=!JA(e)||e<0?0:e;d?.clickDistance(t)}}}var uL;function dL(e){return{isHorizontal:e.includes("right")||e.includes("left"),isVertical:e.includes("bottom")||e.includes("top"),affectsX:e.includes("left"),affectsY:e.includes("top")}}function fL(e,t){return Math.max(0,t-e)}function pL(e,t){return Math.max(0,e-t)}function mL(e,t,n){return Math.max(0,t-e,e-n)}function hL(e,t){return e?!t:t}!function(e){e.Line="line",e.Handle="handle"}(uL||(uL={}));const gL={width:0,height:0,x:0,y:0},wL={...gL,pointerX:0,pointerY:0,aspectRatio:1};function yL(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,a=e.measured.width??0,i=e.measured.height??0,s=n[0]*a,l=n[1]*i;return[[r-s,o-l],[r+a-s,o+i-l]]}function bL(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=bL(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var vL=n(9242);const xL=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(r,o,a);return a},{useDebugValue:NL}=p,{useSyncExternalStoreWithSelector:IL}=vL,ML=e=>e;function EL(e,t=ML,n){const r=IL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return NL(r),r}const _L=(e,t)=>{const n=(e=>e?xL(e):xL)(e),r=(e,r=t)=>EL(n,e,r);return Object.assign(r,n),r};function SL(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const DL=(0,p.createContext)(null),jL=DL.Provider,kL="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function CL(e,t){const n=(0,p.useContext)(DL);if(null===n)throw new Error(kL);return EL(n,e,t)}function AL(){const e=(0,p.useContext)(DL);if(null===e)throw new Error(kL);return(0,p.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const TL={display:"none"},LL={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},OL="react-flow__node-desc",zL="react-flow__edge-desc",PL=e=>e.ariaLiveMessage,RL=e=>e.ariaLabelConfig;function UL({rfId:e}){const t=CL(PL);return(0,C.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:LL,children:t})}function BL({rfId:e,disableKeyboardA11y:t}){const n=CL(RL);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{id:`${OL}-${e}`,style:TL,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,C.jsx)("div",{id:`${zL}-${e}`,style:TL,children:n["edge.a11yDescription.default"]}),!t&&(0,C.jsx)(UL,{rfId:e})]})}const FL=(0,p.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...o},a)=>{const i=`${e}`.split("-");return(0,C.jsx)("div",{className:bL(["react-flow__panel",n,...i]),style:r,ref:a,...o,children:t})});function YL({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,C.jsx)(FL,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:(0,C.jsx)("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}FL.displayName="Panel";const ZL=e=>{const t=[],n=[];for(const[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(const[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},VL=e=>e.id;function GL(e,t){return SL(e.selectedNodes.map(VL),t.selectedNodes.map(VL))&&SL(e.selectedEdges.map(VL),t.selectedEdges.map(VL))}function WL({onSelectionChange:e}){const t=AL(),{selectedNodes:n,selectedEdges:r}=CL(ZL,GL);return(0,p.useEffect)(()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChangeHandlers.forEach(e=>e(o))},[n,r,e]),null}const HL=e=>!!e.onSelectionChangeHandlers;function QL({onSelectionChange:e}){const t=CL(HL);return e||t?(0,C.jsx)(WL,{onSelectionChange:e}):null}const $L="undefined"!=typeof window?p.useLayoutEffect:p.useEffect,XL=[0,0],JL={x:0,y:0,zoom:1},qL=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],KL=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),eO={translateExtent:vA,nodeOrigin:XL,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function tO(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:i,reset:s,setDefaultNodesAndEdges:l}=CL(KL,SL),c=AL();$L(()=>(l(e.defaultNodes,e.defaultEdges),()=>{u.current=eO,s()}),[]);const u=(0,p.useRef)(eO);return $L(()=>{for(const s of qL){const l=e[s];l!==u.current[s]&&void 0!==e[s]&&("nodes"===s?t(l):"edges"===s?n(l):"minZoom"===s?r(l):"maxZoom"===s?o(l):"translateExtent"===s?a(l):"nodeExtent"===s?i(l):"ariaLabelConfig"===s?c.setState({ariaLabelConfig:uT(l)}):"fitView"===s?c.setState({fitViewQueued:l}):"fitViewOptions"===s?c.setState({fitViewOptions:l}):c.setState({[s]:l}))}u.current=e},qL.map(t=>e[t])),null}function nO(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}const rO="undefined"!=typeof document?document:null;function oO(e=null,t={target:rO,actInsideInputWithModifier:!0}){const[n,r]=(0,p.useState)(!1),o=(0,p.useRef)(!1),a=(0,p.useRef)(new Set([])),[i,s]=(0,p.useMemo)(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,p.useEffect)(()=>{const n=t?.target??rO,l=t?.actInsideInputWithModifier??!0;if(null!==e){const e=e=>{if(o.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!o.current||o.current&&!l)&&hT(e))return!1;const n=iO(e.code,s);if(a.current.add(e[n]),aO(i,a.current,!1)){const n=e.composedPath?.()?.[0]||e.target,a="BUTTON"===n?.nodeName||"A"===n?.nodeName;!1===t.preventDefault||!o.current&&a||e.preventDefault(),r(!0)}},c=e=>{const t=iO(e.code,s);aO(i,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),o.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,r]),n}function aO(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function iO(e,t){return t.includes(e)?"code":"key"}function sO(e,t){const n=[],r=new Map,o=[];for(const t of e)if("add"!==t.type)if("remove"===t.type||"replace"===t.type)r.set(t.id,[t]);else{const e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}else o.push(t);for(const e of t){const t=r.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}const o={...e};for(const e of t)lO(e,o);n.push(o)}return o.length&&o.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function lO(e,t){switch(e.type){case"select":t.selected=e.selected;break;case"position":void 0!==e.position&&(t.position=e.position),void 0!==e.dragging&&(t.dragging=e.dragging);break;case"dimensions":void 0!==e.dimensions&&(t.measured={...e.dimensions},e.setAttributes&&(!0!==e.setAttributes&&"width"!==e.setAttributes||(t.width=e.dimensions.width),!0!==e.setAttributes&&"height"!==e.setAttributes||(t.height=e.dimensions.height))),"boolean"==typeof e.resizing&&(t.resizing=e.resizing)}}function cO(e,t){return sO(e,t)}function uO(e,t){return sO(e,t)}function dO(e,t){return{id:e,type:"select",selected:t}}function fO(e,t=new Set,n=!1){const r=[];for(const[o,a]of e){const e=t.has(o);void 0===a.selected&&!e||a.selected===e||(n&&(a.selected=e),r.push(dO(a.id,e)))}return r}function pO({items:e=[],lookup:t}){const n=[],r=new Map(e.map(e=>[e.id,e]));for(const[r,o]of e.entries()){const e=t.get(o.id),a=e?.internals?.userNode??e;void 0!==a&&a!==o&&n.push({id:o.id,item:o,type:"replace"}),void 0===a&&n.push({item:o,type:"add",index:r})}for(const[e]of t)void 0===r.get(e)&&n.push({id:e,type:"remove"});return n}function mO(e){return{id:e.id,type:"remove"}}const hO=e=>(e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e))(e);function gO(e){return(0,p.forwardRef)(e)}function wO(e){const[t,n]=(0,p.useState)(BigInt(0)),[r]=(0,p.useState)(()=>function(){let e=[];return{get:()=>e,reset:()=>{e=[]},push:t=>{e.push(t),n(e=>e+BigInt(1))}}}());return $L(()=>{const t=r.get();t.length&&(e(t),r.reset())},[t]),r}const yO=(0,p.createContext)(null);function bO({children:e}){const t=AL(),n=(0,p.useCallback)(e=>{const{nodes:n=[],setNodes:r,hasDefaultNodes:o,onNodesChange:a,nodeLookup:i,fitViewQueued:s,onNodesChangeMiddlewareMap:l}=t.getState();let c=n;for(const t of e)c="function"==typeof t?t(c):t;let u=pO({items:c,lookup:i});for(const e of l.values())u=e(u);o&&r(c),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{const{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[]),r=wO(n),o=(0,p.useCallback)(e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:a,edgeLookup:i}=t.getState();let s=n;for(const t of e)s="function"==typeof t?t(s):t;o?r(s):a&&a(pO({items:s,lookup:i}))},[]),a=wO(o),i=(0,p.useMemo)(()=>({nodeQueue:r,edgeQueue:a}),[]);return(0,C.jsx)(yO.Provider,{value:i,children:e})}const vO=e=>!!e.panZoom;function xO(){const e=(()=>{const e=AL();return(0,p.useMemo)(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,a],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:a,maxZoom:i,panZoom:s}=e.getState(),l=rT(t,r,o,a,i,n?.padding??.1);return s?(await s.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:a,domNode:i}=e.getState();if(!i)return t;const{x:s,y:l}=i.getBoundingClientRect(),c={x:t.x-s,y:t.y-l},u=n.snapGrid??o,d=n.snapToGrid??a;return eT(c,r,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:a}=r.getBoundingClientRect(),i=tT(t,n);return{x:i.x+o,y:i.y+a}}}),[])})(),t=AL(),n=function(){const e=(0,p.useContext)(yO);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),r=CL(vO),o=(0,p.useMemo)(()=>{const e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},o=e=>{n.edgeQueue.push(e)},a=e=>{const{nodeLookup:n,nodeOrigin:r}=t.getState(),o=hO(e)?e:n.get(e.id),a=o.parentId?lT(o.position,o.measured,o.parentId,n,r):o.position,i={...o,position:a,width:o.measured?.width??o.width,height:o.measured?.height??o.height};return WA(i)},i=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){const e="function"==typeof t?t(r):t;return n.replace&&hO(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{o(r=>r.map(r=>{if(r.id===e){const e="function"==typeof t?t(r):t;return n.replace&&AA(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:o,addNodes:e=>{const t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{const t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{const{nodes:e=[],edges:n=[],transform:r}=t.getState(),[o,a,i]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:o,y:a,zoom:i}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{const{nodes:r,edges:o,onNodesDelete:a,onEdgesDelete:i,triggerNodeChanges:s,triggerEdgeChanges:l,onDelete:c,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await async function({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const a=new Set(e.map(e=>e.id)),i=[];for(const e of n){if(!1===e.deletable)continue;const t=a.has(e.id),n=!t&&e.parentId&&i.find(t=>t.id===e.parentId);(t||n)&&i.push(e)}const s=new Set(t.map(e=>e.id)),l=r.filter(e=>!1!==e.deletable),c=((e,t)=>{const n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))})(i,l),u=c;for(const e of l)s.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!o)return{edges:u,nodes:i};const d=await o({nodes:i,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:i}:{edges:[],nodes:[]}:d}({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:o,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){const e=f.map(mO);i?.(f),l(e)}if(m){const e=d.map(mO);a?.(d),s(e)}return(m||p)&&c?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{const o=XA(e),i=o?e:a(e),s=void 0!==r;return i?(r||t.getState().nodes).filter(r=>{const a=t.getState().nodeLookup.get(r.id);if(a&&!o&&(r.id===e.id||!a.internals.positionAbsolute))return!1;const l=WA(s?r:a),c=$A(l,i);return n&&c>0||c>=l.width*l.height||c>=i.width*i.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{const r=XA(e)?e:a(e);if(!r)return!1;const o=$A(r,t);return n&&o>0||o>=t.width*t.height||o>=r.width*r.height},updateNode:i,updateNodeData:(e,t,n={replace:!1})=>{i(e,e=>{const r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{const r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{const{nodeLookup:n,nodeOrigin:r}=t.getState();return((e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const r="string"==typeof n;let o=t.nodeLookup||r?void 0:n;t.nodeLookup&&(o=r?t.nodeLookup.get(n):TA(n)?n:t.nodeLookup.get(n.id));const a=o?HA(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ZA(e,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return GA(n)})(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{const r=t.getState().fitViewResolver??function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,p.useMemo)(()=>({...o,...e,viewportInitialized:r}),[r])}const NO=e=>e.selected,IO="undefined"!=typeof window?window:void 0,MO={position:"absolute",width:"100%",height:"100%",top:0,left:0},EO=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function _O({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:a=MA.Free,zoomOnDoubleClick:i=!0,panOnDrag:s=!0,defaultViewport:l,translateExtent:c,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:v,selectionOnDrag:x}){const N=AL(),I=(0,p.useRef)(null),{userSelectionActive:M,lib:E,connectionInProgress:_}=CL(EO,SL),S=oO(f),D=(0,p.useRef)();!function(e){const t=AL();(0,p.useEffect)(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??1))return!1;const n=fT(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004","The React Flow parent container needs a width and a height to render the graph."),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener("resize",n);const t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener("resize",n),t&&e.current&&t.unobserve(e.current)}}},[])}(I);const j=(0,p.useCallback)(e=>{y?.({x:e[0],y:e[1],zoom:e[2]}),b||N.setState({transform:e})},[y,b]);return(0,p.useEffect)(()=>{if(I.current){D.current=cL({domNode:I.current,minZoom:u,maxZoom:d,translateExtent:c,viewport:l,onDraggingChange:e=>N.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{const{onViewportChangeStart:n,onMoveStart:r}=N.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{const{onViewportChange:n,onMove:r}=N.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{const{onViewportChangeEnd:n,onMoveEnd:r}=N.getState();r?.(e,t),n?.(t)}});const{x:e,y:t,zoom:n}=D.current.getViewport();return N.setState({panZoom:D.current,transform:[e,t,n],domNode:I.current.closest(".react-flow")}),()=>{D.current?.destroy()}}},[]),(0,p.useEffect)(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:i,panOnDrag:s,zoomActivationKeyPressed:S,preventScrolling:m,noPanClassName:w,userSelectionActive:M,noWheelClassName:g,lib:E,onTransformChange:j,connectionInProgress:_,selectionOnDrag:x,paneClickDistance:v})},[e,t,n,r,o,a,i,s,S,m,w,M,g,E,j,_,x,v]),(0,C.jsx)("div",{className:"react-flow__renderer",ref:I,style:MO,children:h})}const SO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function DO(){const{userSelectionActive:e,userSelectionRect:t}=CL(SO,SL);return e&&t?(0,C.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const jO=(e,t)=>n=>{n.target===t.current&&e?.(n)},kO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function CO({isSelecting:e,selectionKeyPressed:t,selectionMode:n=EA.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:a,onSelectionStart:i,onSelectionEnd:s,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:m,children:h}){const g=AL(),{userSelectionActive:w,elementsSelectable:y,dragging:b,connectionInProgress:v}=CL(kO,SL),x=y&&(e||w),N=(0,p.useRef)(null),I=(0,p.useRef)(),M=(0,p.useRef)(new Set),E=(0,p.useRef)(new Set),_=(0,p.useRef)(!1),S=e=>{_.current||v?_.current=!1:(l?.(e),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1}))},D=u?e=>u(e):void 0,j=!0===r||Array.isArray(r)&&r.includes(0);return(0,C.jsxs)("div",{className:bL(["react-flow__pane",{draggable:j,dragging:b,selection:e}]),onClick:x?void 0:jO(S,N),onContextMenu:jO(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():c?.(e)},N),onWheel:jO(D,N),onPointerEnter:x?void 0:d,onPointerMove:x?e=>{const{userSelectionRect:r,transform:a,nodeLookup:s,edgeLookup:l,connectionLookup:c,triggerNodeChanges:u,triggerEdgeChanges:d,defaultEdgeOptions:f,resetSelectedElements:p}=g.getState();if(!I.current||!r)return;const{x:m,y:h}=wT(e.nativeEvent,I.current),{startX:w,startY:y}=r;if(!_.current){const n=t?0:o;if(Math.hypot(m-w,h-y)<=n)return;p(),i?.(e)}_.current=!0;const b={startX:w,startY:y,x:m<w?m:w,y:h<y?h:y,width:Math.abs(m-w),height:Math.abs(h-y)},v=M.current,x=E.current;M.current=new Set(zA(s,b,a,n===EA.Partial,!0).map(e=>e.id)),E.current=new Set;const N=f?.selectable??!0;for(const e of M.current){const t=c.get(e);if(t)for(const{edgeId:e}of t.values()){const t=l.get(e);t&&(t.selectable??N)&&E.current.add(e)}}cT(v,M.current)||u(fO(s,M.current,!0)),cT(x,E.current)||d(fO(l,E.current)),g.setState({userSelectionRect:b,userSelectionActive:!0,nodesSelectionActive:!1})}:f,onPointerUp:x?e=>{0===e.button&&(e.target?.releasePointerCapture?.(e.pointerId),!w&&e.target===N.current&&g.getState().userSelectionRect&&S?.(e),g.setState({userSelectionActive:!1,userSelectionRect:null}),_.current&&(s?.(e),g.setState({nodesSelectionActive:M.current.size>0})))}:void 0,onPointerDownCapture:x?n=>{const{domNode:r}=g.getState();if(I.current=r?.getBoundingClientRect(),!I.current)return;const o=n.target===N.current;if(!o&&n.target.closest(".nokey")||!e||!(a&&o||t)||0!==n.button||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),_.current=!1;const{x:i,y:s}=wT(n.nativeEvent,I.current);g.setState({userSelectionRect:{width:0,height:0,startX:i,startY:s,x:i,y:s}}),o||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:x?e=>{_.current&&(e.stopPropagation(),_.current=!1)}:void 0,onPointerLeave:m,ref:N,style:MO,children:[h,(0,C.jsx)(DO,{})]})}function AO({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:i,nodeLookup:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])):l?.("012",(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`)(e))}function TO({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:a,nodeClickDistance:i}){const s=AL(),[l,c]=(0,p.useState)(!1),u=(0,p.useRef)();return(0,p.useEffect)(()=>{u.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let a={x:null,y:null},i=0,s=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;return{update:function({noDragClassName:g,handleSelector:w,domNode:y,isSelectable:b,nodeId:v,nodeClickDistance:x=0}){function N({x:e,y:n}){const{nodeLookup:o,nodeExtent:i,snapGrid:l,snapToGrid:c,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let w=!1;const y=s.size>1,b=y&&i?VA(OA(s)):null,x=y&&c?function({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const a={x:n-o.distance.x,y:r-o.distance.y},i=KA(a,t);return{x:i.x-a.x,y:i.y-a.y}}({dragItems:s,snapGrid:l,x:e,y:n}):null;for(const[t,r]of s){if(!o.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};c&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:KA(a,l));let s=null;if(y&&i&&!r.extent&&b){const{positionAbsolute:e}=r.internals,t=e.x-b.x+i[0][0],n=e.x+r.measured.width-b.x2+i[1][0];s=[[t,e.y-b.y+i[0][1]],[n,e.y+r.measured.height-b.y2+i[1][1]]]}const{position:d,positionAbsolute:f}=PA({nodeId:t,nextPosition:a,nodeLookup:o,nodeExtent:s||i,nodeOrigin:u,onError:p});w=w||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m=m||w,w&&(g(s,!0),h&&(r||d||!v&&f))){const[e,t]=XT({nodeId:v,dragItems:s,nodeLookup:o});r?.(h,s,e,t),d?.(h,e,t),v||f?.(h,t)}}async function I(){if(!u)return;const{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:o}=t();if(!o)return l=!1,void cancelAnimationFrame(i);const[s,d]=YA(c,u,r);0===s&&0===d||(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&N(a)),i=requestAnimationFrame(I)}function M(r){const{nodeLookup:o,multiSelectionActive:i,nodesDraggable:l,transform:c,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:w}=t();d=!0,m&&b||i||!v||o.get(v)?.selected||w(),b&&m&&v&&e?.(v);const y=dT(r.sourceEvent,{transform:c,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=y,s=function(e,t,n,r){const o=new Map;for(const[a,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!QT(i,e))&&(i.draggable||t&&void 0===i.draggable)){const t=e.get(a);t&&o.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return o}(o,l,y,v),s.size>0&&(n||h||!v&&g)){const[e,t]=XT({nodeId:v,dragItems:s,nodeLookup:o});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),v||g?.(r.sourceEvent,t)}}f=Hj(y);const E=sk().clickDistance(x).on("start",e=>{const{domNode:n,nodeDragThreshold:r,transform:o,snapGrid:i,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,0===r&&M(e);const l=dT(e.sourceEvent,{transform:o,snapGrid:i,snapToGrid:s,containerBounds:u});a=l,c=wT(e.sourceEvent,u)}).on("drag",e=>{const{autoPanOnNodeDrag:n,transform:r,snapGrid:o,snapToGrid:i,nodeDragThreshold:f,nodeLookup:m}=t(),g=dT(e.sourceEvent,{transform:r,snapGrid:o,snapToGrid:i,containerBounds:u});if(h=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||v&&!m.has(v))&&(p=!0),!p){if(!l&&n&&d&&(l=!0,I()),!d){const t=wT(e.sourceEvent,u),n=t.x-c.x,r=t.y-c.y;Math.sqrt(n*n+r*r)>f&&M(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(c=wT(e.sourceEvent,u),N(g))}}).on("end",e=>{if(d&&!p&&(l=!1,d=!1,cancelAnimationFrame(i),s.size>0)){const{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:i}=t();if(m&&(r(s,!1),m=!1),o||a||!v&&i){const[t,r]=XT({nodeId:v,dragItems:s,nodeLookup:n,dragging:!1});o?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),v||i?.(e.sourceEvent,r)}}}).filter(e=>{const t=e.target;return!e.button&&(!g||!$T(t,`.${g}`,y))&&(!w||$T(t,w,y))});f.call(E)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{AO({id:t,store:s,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),(0,p.useEffect)(()=>{if(!t&&e.current&&u.current)return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:i}),()=>{u.current?.destroy()}},[n,r,t,a,e,o,i]),l}function LO(){const e=AL(),t=(0,p.useCallback)(t=>{const{nodeExtent:n,snapToGrid:r,snapGrid:o,nodesDraggable:a,onError:i,updateNodePositions:s,nodeLookup:l,nodeOrigin:c}=e.getState(),u=new Map,d=(e=>t=>t.selected&&(t.draggable||e&&void 0===t.draggable))(a),f=r?o[0]:5,p=r?o[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(const[,e]of l){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=KA(t,o));const{position:a,positionAbsolute:s}=PA({nodeId:e.id,nextPosition:t,nodeLookup:l,nodeExtent:n,nodeOrigin:c,onError:i});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[]);return t}const OO=(0,p.createContext)(null),zO=OO.Provider;OO.Consumer;const PO=()=>(0,p.useContext)(OO),RO=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),UO=(0,p.memo)(gO(function({type:e="source",position:t=jA.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:i,onConnect:s,children:l,className:c,onMouseDown:u,onTouchStart:d,...f},p){const m=i||null,h="target"===e,g=AL(),w=PO(),{connectOnClick:y,noPanClassName:b,rfId:v}=CL(RO,SL),{connectingFrom:x,connectingTo:N,clickConnecting:I,isPossibleEndHandle:M,connectionInProcess:E,clickConnectionInProcess:_,valid:S}=CL(((e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:a,connection:i}=r,{fromHandle:s,toHandle:l,isValid:c}=i,u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:o?.nodeId===e&&o?.id===t&&o?.type===n,isPossibleEndHandle:a===IA.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!o,valid:u&&c}})(w,m,e),SL);w||g.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");const D=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=g.getState();t(_T(o,e))}n?.(o),s?.(o)},j=e=>{if(!w)return;const t=gT(e.nativeEvent);if(o&&(t&&0===e.button||!t)){const t=g.getState();tL.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:w,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:D,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,C.jsx)("div",{"data-handleid":m,"data-nodeid":w,"data-handlepos":t,"data-id":`${v}-${w}-${m}-${e}`,className:bL(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,c,{source:!h,target:h,connectable:r,connectablestart:o,connectableend:a,clickconnecting:I,connectingfrom:x,connectingto:N,valid:S,connectionindicator:r&&(!E||M)&&(E||_?a:o)}]),onMouseDown:j,onTouchStart:j,onClick:y?t=>{const{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l,lib:c,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!w||!i&&!o)return;if(!i)return r?.(t.nativeEvent,{nodeId:w,handleId:m,handleType:e}),void g.setState({connectionClickStartHandle:{nodeId:w,type:e,id:m}});const p=pT(t.target),h=n||l,{connection:y,isValid:b}=tL.isValid(t.nativeEvent,{handle:{nodeId:w,id:m,type:e},connectionMode:s,fromNodeId:i.nodeId,fromHandleId:i.id||null,fromType:i.type,isValidConnection:h,flowId:u,doc:p,lib:c,nodeLookup:d});b&&y&&D(y);const v=structuredClone(f);delete v.inProgress,v.toPosition=v.toHandle?v.toHandle.position:null,a?.(t,v),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:l})})),BO={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},FO={input:function({data:e,isConnectable:t,sourcePosition:n=jA.Bottom}){return(0,C.jsxs)(C.Fragment,{children:[e?.label,(0,C.jsx)(UO,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=jA.Top,sourcePosition:r=jA.Bottom}){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(UO,{type:"target",position:n,isConnectable:t}),e?.label,(0,C.jsx)(UO,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=jA.Top}){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(UO,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},YO=e=>{const{width:t,height:n,x:r,y:o}=OA(e.nodeLookup,{filter:e=>!!e.selected});return{width:JA(t)?t:null,height:JA(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function ZO({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=AL(),{width:o,height:a,transformString:i,userSelectionActive:s}=CL(YO,SL),l=LO(),c=(0,p.useRef)(null);(0,p.useEffect)(()=>{n||c.current?.focus({preventScroll:!0})},[n]);const u=!s&&null!==o&&null!==a;if(TO({nodeRef:c,disabled:!u}),!u)return null;const d=e?t=>{const n=r.getState().nodes.filter(e=>e.selected);e(t,n)}:void 0;return(0,C.jsx)("div",{className:bL(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:(0,C.jsx)("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(BO,e.key)&&(e.preventDefault(),l({direction:BO[e.key],factor:e.shiftKey?4:1}))},style:{width:o,height:a}})})}const VO="undefined"!=typeof window?window:void 0,GO=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function WO({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:i,paneClickDistance:s,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:h,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:x,panOnScrollSpeed:N,panOnScrollMode:I,zoomOnDoubleClick:M,panOnDrag:E,defaultViewport:_,translateExtent:S,minZoom:D,maxZoom:j,preventScrolling:k,onSelectionContextMenu:A,noWheelClassName:T,noPanClassName:L,disableKeyboardA11y:O,onViewportChange:z,isControlledViewport:P}){const{nodesSelectionActive:R,userSelectionActive:U}=CL(GO,SL),B=oO(c,{target:VO}),F=oO(g,{target:VO}),Y=F||E,Z=F||x,V=u&&!0!==Y,G=B||U||V;return function({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=AL(),{deleteElements:r}=xO(),o=oO(e,{actInsideInputWithModifier:!1}),a=oO(t,{target:IO});(0,p.useEffect)(()=>{if(o){const{edges:e,nodes:t}=n.getState();r({nodes:t.filter(NO),edges:e.filter(NO)}),n.setState({nodesSelectionActive:!1})}},[o]),(0,p.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}({deleteKeyCode:l,multiSelectionKeyCode:h}),(0,C.jsx)(_O,{onPaneContextMenu:a,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:Z,panOnScrollSpeed:N,panOnScrollMode:I,zoomOnDoubleClick:M,panOnDrag:!B&&Y,defaultViewport:_,translateExtent:S,minZoom:D,maxZoom:j,zoomActivationKeyCode:w,preventScrolling:k,noWheelClassName:T,noPanClassName:L,onViewportChange:z,isControlledViewport:P,paneClickDistance:s,selectionOnDrag:V,children:(0,C.jsxs)(CO,{onSelectionStart:f,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:i,panOnDrag:Y,isSelecting:!!G,selectionMode:d,selectionKeyPressed:B,paneClickDistance:s,selectionOnDrag:V,children:[e,R&&(0,C.jsx)(ZO,{onSelectionContextMenu:A,noPanClassName:L,disableKeyboardA11y:O})]})})}WO.displayName="FlowRenderer";const HO=(0,p.memo)(WO);const QO=e=>e.updateNodeInternals;var $O=(0,p.memo)(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:a,onDoubleClick:i,nodesDraggable:s,elementsSelectable:l,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:m,disableKeyboardA11y:h,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:v,internals:x,isParent:N}=CL(t=>{const n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},SL);let I=v.type||"default",M=w?.[I]||FO[I];void 0===M&&(b?.("003",(e=>`Node type "${e}" not found. Using fallback type "default".`)(I)),I="default",M=w?.default||FO.default);const E=!!(v.draggable||s&&void 0===v.draggable),_=!!(v.selectable||l&&void 0===v.selectable),S=!!(v.connectable||c&&void 0===v.connectable),D=!!(v.focusable||u&&void 0===v.focusable),j=AL(),k=sT(v),A=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=AL(),a=(0,p.useRef)(null),i=(0,p.useRef)(null),s=(0,p.useRef)(e.sourcePosition),l=(0,p.useRef)(e.targetPosition),c=(0,p.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,p.useEffect)(()=>{!a.current||e.hidden||u&&i.current===a.current||(i.current&&r?.unobserve(i.current),r?.observe(a.current),i.current=a.current)},[u,e.hidden]),(0,p.useEffect)(()=>()=>{i.current&&(r?.unobserve(i.current),i.current=null)},[]),(0,p.useEffect)(()=>{if(a.current){const n=c.current!==t,r=s.current!==e.sourcePosition,i=l.current!==e.targetPosition;(n||r||i)&&(c.current=t,s.current=e.sourcePosition,l.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}({node:v,nodeType:I,hasDimensions:k,resizeObserver:d}),T=TO({nodeRef:A,disabled:v.hidden||!E,noDragClassName:f,handleSelector:v.dragHandle,nodeId:e,isSelectable:_,nodeClickDistance:y}),L=LO();if(v.hidden)return null;const O=iT(v),z=function(e){return void 0===e.internals.handleBounds?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}(v),P=_||E||t||n||r||o,R=n?e=>n(e,{...x.userNode}):void 0,U=r?e=>r(e,{...x.userNode}):void 0,B=o?e=>o(e,{...x.userNode}):void 0,F=a?e=>a(e,{...x.userNode}):void 0,Y=i?e=>i(e,{...x.userNode}):void 0;return(0,C.jsx)("div",{className:bL(["react-flow__node",`react-flow__node-${I}`,{[m]:E},v.className,{selected:v.selected,selectable:_,parent:N,draggable:E,dragging:T}]),ref:A,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:k?"visible":"hidden",...v.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:U,onMouseLeave:B,onContextMenu:F,onClick:n=>{const{selectNodesOnDrag:r,nodeDragThreshold:o}=j.getState();_&&(!r||!E||o>0)&&AO({id:e,store:j,nodeRef:A}),t&&t(n,{...x.userNode})},onDoubleClick:Y,onKeyDown:D?t=>{if(!hT(t.nativeEvent)&&!h)if(xA.includes(t.key)&&_){const n="Escape"===t.key;AO({id:e,store:j,unselect:n,nodeRef:A})}else if(E&&v.selected&&Object.prototype.hasOwnProperty.call(BO,t.key)){t.preventDefault();const{ariaLabelConfig:e}=j.getState();j.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),L({direction:BO[t.key],factor:t.shiftKey?4:1})}}:void 0,tabIndex:D?0:void 0,onFocus:D?()=>{if(h||!A.current?.matches(":focus-visible"))return;const{transform:t,width:n,height:r,autoPanOnNodeFocus:o,setCenter:a}=j.getState();o&&(zA(new Map([[e,v]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(v.position.x+O.width/2,v.position.y+O.height/2,{zoom:t[2]}))}:void 0,role:v.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":h?void 0:`${OL}-${g}`,"aria-label":v.ariaLabel,...v.domAttributes,children:(0,C.jsx)(zO,{value:e,children:(0,C.jsx)(M,{id:e,data:v.data,type:I,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:v.selected??!1,selectable:_,draggable:E,deletable:v.deletable??!0,isConnectable:S,sourcePosition:v.sourcePosition,targetPosition:v.targetPosition,dragging:T,dragHandle:v.dragHandle,zIndex:x.z,parentId:v.parentId,...O})})})});const XO=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function JO(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:a}=CL(XO,SL),i=function(e){const t=CL((0,p.useCallback)((e=>t=>e?zA(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys()))(e),[e]),SL);return t}(e.onlyRenderVisibleElements),s=function(){const e=CL(QO),[t]=(0,p.useState)(()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver(t=>{const n=new Map;t.forEach(e=>{const t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,p.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,C.jsx)("div",{className:"react-flow__nodes",style:MO,children:i.map(i=>(0,C.jsx)($O,{id:i,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:a},i))})}JO.displayName="NodeRenderer";const qO=(0,p.memo)(JO),KO={[DA.Arrow]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return(0,C.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[DA.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,C.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},ez=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:i,orient:s="auto-start-reverse"})=>{const l=function(e){const t=AL();return(0,p.useMemo)(()=>Object.prototype.hasOwnProperty.call(KO,e)?KO[e]:(t.getState().onError?.("009",(e=>`Marker type "${e}" doesn't exist.`)(e)),null),[e])}(t);return l?(0,C.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:s,refX:"0",refY:"0",children:(0,C.jsx)(l,{color:n,strokeWidth:i})}):null},tz=({defaultColor:e,rfId:t})=>{const n=CL(e=>e.edges),r=CL(e=>e.defaultEdgeOptions),o=(0,p.useMemo)(()=>{const o=function(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const a=new Set;return e.reduce((e,i)=>([i.markerStart||r,i.markerEnd||o].forEach(r=>{if(r&&"object"==typeof r){const o=zT(r,t);a.has(o)||(e.push({id:o,color:r.color||n,...r}),a.add(o))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd});return o},[n,r,t,e]);return o.length?(0,C.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,C.jsx)("defs",{children:o.map(e=>(0,C.jsx)(ez,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};tz.displayName="MarkerDefinitions";var nz=(0,p.memo)(tz);function rz({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:i=[2,4],labelBgBorderRadius:s=2,children:l,className:c,...u}){const[d,f]=(0,p.useState)({x:1,y:0,width:0,height:0}),m=bL(["react-flow__edge-textwrapper",c]),h=(0,p.useRef)(null);return(0,p.useEffect)(()=>{if(h.current){const e=h.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,C.jsxs)("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:m,visibility:d.width?"visible":"hidden",...u,children:[o&&(0,C.jsx)("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:a,rx:s,ry:s}),(0,C.jsx)("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:h,style:r,children:n}),l]}):null}rz.displayName="EdgeText";const oz=(0,p.memo)(rz);function az({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:i,labelBgPadding:s,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("path",{...u,d:e,fill:"none",className:bL(["react-flow__edge-path",u.className])}),c?(0,C.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&JA(t)&&JA(n)?(0,C.jsx)(oz,{x:t,y:n,label:r,labelStyle:o,labelShowBg:a,labelBgStyle:i,labelBgPadding:s,labelBgBorderRadius:l}):null]})}function iz({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===jA.Left||e===jA.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function sz({sourceX:e,sourceY:t,sourcePosition:n=jA.Bottom,targetX:r,targetY:o,targetPosition:a=jA.Top}){const[i,s]=iz({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=iz({pos:a,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=bT({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${r},${o}`,u,d,f,p]}function lz(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:i,targetPosition:s,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:w})=>{const[y,b,v]=sz({sourceX:n,sourceY:r,sourcePosition:i,targetX:o,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,C.jsx)(az,{id:x,path:y,labelX:b,labelY:v,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:w})})}const cz=lz({isInternal:!1}),uz=lz({isInternal:!0});function dz(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=jA.Bottom,targetPosition:m=jA.Top,markerEnd:h,markerStart:g,pathOptions:w,interactionWidth:y})=>{const[b,v,x]=CT({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:a,targetPosition:m,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),N=e.isInternal?void 0:t;return(0,C.jsx)(az,{id:N,path:b,labelX:v,labelY:x,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:y})})}cz.displayName="SimpleBezierEdge",uz.displayName="SimpleBezierEdgeInternal";const fz=dz({isInternal:!1}),pz=dz({isInternal:!0});function mz(e){return(0,p.memo)(({id:t,...n})=>{const r=e.isInternal?void 0:t;return(0,C.jsx)(fz,{...n,id:r,pathOptions:(0,p.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}fz.displayName="SmoothStepEdge",pz.displayName="SmoothStepEdgeInternal";const hz=mz({isInternal:!1}),gz=mz({isInternal:!0});function wz(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{const[g,w,y]=ST({sourceX:n,sourceY:r,targetX:o,targetY:a}),b=e.isInternal?void 0:t;return(0,C.jsx)(az,{id:b,path:g,labelX:w,labelY:y,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}hz.displayName="StepEdge",gz.displayName="StepEdgeInternal";const yz=wz({isInternal:!1}),bz=wz({isInternal:!0});function vz(e){return(0,p.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:i=jA.Bottom,targetPosition:s=jA.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:w,interactionWidth:y})=>{const[b,v,x]=NT({sourceX:n,sourceY:r,sourcePosition:i,targetX:o,targetY:a,targetPosition:s,curvature:w?.curvature}),N=e.isInternal?void 0:t;return(0,C.jsx)(az,{id:N,path:b,labelX:v,labelY:x,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:y})})}yz.displayName="StraightEdge",bz.displayName="StraightEdgeInternal";const xz=vz({isInternal:!1}),Nz=vz({isInternal:!0});xz.displayName="BezierEdge",Nz.displayName="BezierEdgeInternal";const Iz={default:Nz,straight:bz,step:gz,smoothstep:pz,simplebezier:uz},Mz={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Ez=(e,t,n)=>n===jA.Left?e-t:n===jA.Right?e+t:e,_z=(e,t,n)=>n===jA.Top?e-t:n===jA.Bottom?e+t:e,Sz="react-flow__edgeupdater";function Dz({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:a,onMouseOut:i,type:s}){return(0,C.jsx)("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:i,className:bL([Sz,`${Sz}-${s}`]),cx:Ez(t,r,e),cy:_z(n,r,e),r,stroke:"transparent",fill:"transparent"})}function jz({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:a,targetY:i,sourcePosition:s,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const m=AL(),h=(e,t)=>{if(0!==e.button)return;const{autoPanOnConnect:r,domNode:o,connectionMode:a,connectionRadius:i,lib:s,onConnectStart:l,cancelConnection:p,nodeLookup:h,rfId:g,panBy:w,updateConnection:y}=m.getState(),b="target"===t.type;tL.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:i,domNode:o,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:b,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:w,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>c?.(n,e),onConnectStart:(r,o)=>{f(!0),u?.(e,n,t.type),l?.(r,o)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:y,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=()=>p(!0),w=()=>p(!1);return(0,C.jsxs)(C.Fragment,{children:[(!0===e||"source"===e)&&(0,C.jsx)(Dz,{position:s,centerX:r,centerY:o,radius:t,onMouseDown:e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:g,onMouseOut:w,type:"source"}),(!0===e||"target"===e)&&(0,C.jsx)(Dz,{position:l,centerX:a,centerY:i,radius:t,onMouseDown:e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:g,onMouseOut:w,type:"target"})]})}var kz=(0,p.memo)(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:a,onContextMenu:i,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:m,rfId:h,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let v=CL(t=>t.edgeLookup.get(e));const x=CL(e=>e.defaultEdgeOptions);v=x?{...x,...v}:v;let N=v.type||"default",I=g?.[N]||Iz[N];void 0===I&&(y?.("011",(e=>`Edge type "${e}" not found. Using fallback type "default".`)(N)),N="default",I=g?.default||Iz.default);const M=!!(v.focusable||t&&void 0===v.focusable),E=void 0!==d&&(v.reconnectable||n&&void 0===v.reconnectable),_=!!(v.selectable||r&&void 0===v.selectable),S=(0,p.useRef)(null),[D,j]=(0,p.useState)(!1),[k,A]=(0,p.useState)(!1),T=AL(),{zIndex:L,sourceX:O,sourceY:z,targetX:P,targetY:R,sourcePosition:U,targetPosition:B}=CL((0,p.useCallback)(t=>{const n=t.nodeLookup.get(v.source),r=t.nodeLookup.get(v.target);if(!n||!r)return{zIndex:v.zIndex,...Mz};const o=function(e){const{sourceNode:t,targetNode:n}=e;if(!AT(t)||!AT(n))return null;const r=t.internals.handleBounds||TT(t.handles),o=n.internals.handleBounds||TT(n.handles),a=OT(r?.source??[],e.sourceHandle),i=OT(e.connectionMode===IA.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!a||!i)return e.onError?.("008",((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`)(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const s=a?.position||jA.Bottom,l=i?.position||jA.Top,c=LT(t,a,s),u=LT(n,i,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:l}}({id:e,sourceNode:n,targetNode:r,sourceHandle:v.sourceHandle||null,targetHandle:v.targetHandle||null,connectionMode:t.connectionMode,onError:y}),a=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:a="basic"}){return"manual"===a?r:(o&&n?r+1e3:r)+Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0)}({selected:v.selected,zIndex:v.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{zIndex:a,...o||Mz}},[v.source,v.target,v.sourceHandle,v.targetHandle,v.selected,v.zIndex]),SL),F=(0,p.useMemo)(()=>v.markerStart?`url('#${zT(v.markerStart,h)}')`:void 0,[v.markerStart,h]),Y=(0,p.useMemo)(()=>v.markerEnd?`url('#${zT(v.markerEnd,h)}')`:void 0,[v.markerEnd,h]);if(v.hidden||null===O||null===z||null===P||null===R)return null;const Z=a?e=>{a(e,{...v})}:void 0,V=i?e=>{i(e,{...v})}:void 0,G=s?e=>{s(e,{...v})}:void 0,W=l?e=>{l(e,{...v})}:void 0,H=c?e=>{c(e,{...v})}:void 0;return(0,C.jsx)("svg",{style:{zIndex:L},children:(0,C.jsxs)("g",{className:bL(["react-flow__edge",`react-flow__edge-${N}`,v.className,w,{selected:v.selected,animated:v.animated,inactive:!_&&!o,updating:D,selectable:_}]),onClick:t=>{const{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=T.getState();_&&(T.setState({nodesSelectionActive:!1}),v.selected&&a?(r({nodes:[],edges:[v]}),S.current?.blur()):n([e])),o&&o(t,v)},onDoubleClick:Z,onContextMenu:V,onMouseEnter:G,onMouseMove:W,onMouseLeave:H,onKeyDown:M?t=>{if(!b&&xA.includes(t.key)&&_){const{unselectNodesAndEdges:n,addSelectedEdges:r}=T.getState();"Escape"===t.key?(S.current?.blur(),n({edges:[v]})):r([e])}}:void 0,tabIndex:M?0:void 0,role:v.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===v.ariaLabel?void 0:v.ariaLabel||`Edge from ${v.source} to ${v.target}`,"aria-describedby":M?`${zL}-${h}`:void 0,ref:S,...v.domAttributes,children:[!k&&(0,C.jsx)(I,{id:e,source:v.source,target:v.target,type:v.type,selected:v.selected,animated:v.animated,selectable:_,deletable:v.deletable??!0,label:v.label,labelStyle:v.labelStyle,labelShowBg:v.labelShowBg,labelBgStyle:v.labelBgStyle,labelBgPadding:v.labelBgPadding,labelBgBorderRadius:v.labelBgBorderRadius,sourceX:O,sourceY:z,targetX:P,targetY:R,sourcePosition:U,targetPosition:B,data:v.data,style:v.style,sourceHandleId:v.sourceHandle,targetHandleId:v.targetHandle,markerStart:F,markerEnd:Y,pathOptions:"pathOptions"in v?v.pathOptions:void 0,interactionWidth:v.interactionWidth}),E&&(0,C.jsx)(jz,{edge:v,isReconnectable:E,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:m,sourceX:O,sourceY:z,targetX:P,targetY:R,sourcePosition:U,targetPosition:B,setUpdateHover:j,setReconnecting:A})]})})});const Cz=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Az({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:a,onEdgeContextMenu:i,onEdgeMouseEnter:s,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:v}=CL(Cz,SL),x=function(e){const t=CL((0,p.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);const n=[];if(t.width&&t.height)for(const e of t.edges){const r=t.nodeLookup.get(e.source),o=t.nodeLookup.get(e.target);r&&o&&MT({sourceNode:r,targetNode:o,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),SL);return t}(t);return(0,C.jsxs)("div",{className:"react-flow__edges",children:[(0,C.jsx)(nz,{defaultColor:e,rfId:n}),x.map(e=>(0,C.jsx)(kz,{id:e,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:o,onReconnect:a,onContextMenu:i,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,rfId:n,onError:v,edgeTypes:r,disableKeyboardA11y:g},e))]})}Az.displayName="EdgeRenderer";const Tz=(0,p.memo)(Az),Lz=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Oz({children:e}){const t=CL(Lz);return(0,C.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}const zz=e=>e.panZoom?.syncViewport;function Pz(e){return e.connection.inProgress?{...e.connection,to:eT(e.connection.to,e.transform)}:{...e.connection}}const Rz=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Uz({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:a,height:i,isValid:s,inProgress:l}=CL(Rz,SL);return a&&o&&l?(0,C.jsx)("svg",{style:e,width:a,height:i,className:"react-flow__connectionline react-flow__container",children:(0,C.jsx)("g",{className:bL(["react-flow__connection",CA(s)]),children:(0,C.jsx)(Bz,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}const Bz=({style:e,type:t=SA.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:a,fromNode:i,fromHandle:s,fromPosition:l,to:c,toNode:u,toHandle:d,toPosition:f,pointer:p}=function(e){const t=function(e){if(e){const t=t=>{const n=Pz(t);return e(n)};return t}return Pz}(e);return CL(t,SL)}();if(!o)return;if(n)return(0,C.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:s,fromX:a.x,fromY:a.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:f,connectionStatus:CA(r),toNode:u,toHandle:d,pointer:p});let m="";const h={sourceX:a.x,sourceY:a.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case SA.Bezier:[m]=NT(h);break;case SA.SimpleBezier:[m]=sz(h);break;case SA.Step:[m]=CT({...h,borderRadius:0});break;case SA.SmoothStep:[m]=CT(h);break;default:[m]=ST(h)}return(0,C.jsx)("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};Bz.displayName="ConnectionLine";const Fz={};function Yz(e=Fz){(0,p.useRef)(e),AL(),(0,p.useEffect)(()=>{},[e])}function Zz({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:i,onNodeMouseEnter:s,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:m,connectionLineType:h,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:v,selectionMode:x,multiSelectionKeyCode:N,panActivationKeyCode:I,zoomActivationKeyCode:M,deleteKeyCode:E,onlyRenderVisibleElements:_,elementsSelectable:S,defaultViewport:D,translateExtent:j,minZoom:k,maxZoom:A,preventScrolling:T,defaultMarkerColor:L,zoomOnScroll:O,zoomOnPinch:z,panOnScroll:P,panOnScrollSpeed:R,panOnScrollMode:U,zoomOnDoubleClick:B,panOnDrag:F,onPaneClick:Y,onPaneMouseEnter:Z,onPaneMouseMove:V,onPaneMouseLeave:G,onPaneScroll:W,onPaneContextMenu:H,paneClickDistance:Q,nodeClickDistance:$,onEdgeContextMenu:X,onEdgeMouseEnter:J,onEdgeMouseMove:q,onEdgeMouseLeave:K,reconnectRadius:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,noDragClassName:oe,noWheelClassName:ae,noPanClassName:ie,disableKeyboardA11y:se,nodeExtent:le,rfId:ce,viewport:ue,onViewportChange:de}){return Yz(e),Yz(t),AL(),(0,p.useRef)(!1),(0,p.useEffect)(()=>{},[]),function(e){const t=xO(),n=(0,p.useRef)(!1);(0,p.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(n),function(e){const t=CL(zz),n=AL();(0,p.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t])}(ue),(0,C.jsx)(HO,{onPaneClick:Y,onPaneMouseEnter:Z,onPaneMouseMove:V,onPaneMouseLeave:G,onPaneContextMenu:H,onPaneScroll:W,paneClickDistance:Q,deleteKeyCode:E,selectionKeyCode:b,selectionOnDrag:v,selectionMode:x,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:N,panActivationKeyCode:I,zoomActivationKeyCode:M,elementsSelectable:S,zoomOnScroll:O,zoomOnPinch:z,zoomOnDoubleClick:B,panOnScroll:P,panOnScrollSpeed:R,panOnScrollMode:U,panOnDrag:F,defaultViewport:D,translateExtent:j,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:T,noDragClassName:oe,noWheelClassName:ae,noPanClassName:ie,disableKeyboardA11y:se,onViewportChange:de,isControlledViewport:!!ue,children:(0,C.jsxs)(Oz,{children:[(0,C.jsx)(Tz,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:i,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,onlyRenderVisibleElements:_,onEdgeContextMenu:X,onEdgeMouseEnter:J,onEdgeMouseMove:q,onEdgeMouseLeave:K,reconnectRadius:ee,defaultMarkerColor:L,noPanClassName:ie,disableKeyboardA11y:se,rfId:ce}),(0,C.jsx)(Uz,{style:g,type:h,component:w,containerStyle:y}),(0,C.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,C.jsx)(qO,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:$,onlyRenderVisibleElements:_,noPanClassName:ie,noDragClassName:oe,disableKeyboardA11y:se,nodeExtent:le,rfId:ce}),(0,C.jsx)("div",{className:"react-flow__viewport-portal"})]})})}Zz.displayName="GraphView";const Vz=(0,p.memo)(Zz),Gz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:i,fitViewOptions:s,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f="basic"}={})=>{const p=new Map,m=new Map,h=new Map,g=new Map,w=r??t??[],y=n??e??[],b=u??[0,0],v=d??vA;HT(h,g,w);const{nodesInitialized:x}=YT(y,p,m,{nodeOrigin:b,nodeExtent:v,zIndexMode:f});let N=[0,0,1];if(i&&o&&a){const e=OA(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),{x:t,y:n,zoom:r}=rT(e,o,a,l,c,s?.padding??.1);N=[t,n,r]}return{rfId:"1",width:o??0,height:a??0,transform:N,nodes:y,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:w,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:l,maxZoom:c,translateExtent:vA,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:IA.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:s,fitViewResolver:null,connection:{..._A},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:qA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:NA,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Wz=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:i,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>((e,t)=>e?_L(e,t):_L)((p,m)=>{async function h(){const{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:o,height:a,minZoom:i,maxZoom:s}=m();t&&(await async function({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:a},i){if(0===e.size)return Promise.resolve(!0);const s=function(e,t){const n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{!e.measured.width||!e.measured.height||!t?.includeHiddenNodes&&e.hidden||r&&!r.has(e.id)||n.set(e.id,e)}),n}(e,i),l=OA(s),c=rT(l,t,n,i?.minZoom??o,i?.maxZoom??a,i?.padding??.1);return await r.setViewport(c,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)}({nodes:e,width:o,height:a,panZoom:t,minZoom:i,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...Gz({nodes:e,edges:t,width:o,height:a,fitView:i,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{const{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:o,fitViewQueued:a,zIndexMode:i,nodesSelectionActive:s}=m(),{nodesInitialized:l,hasSelectedNodes:c}=YT(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:o,checkEquality:!0,zIndexMode:i}),u=s&&c;a&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:u})},setEdges:e=>{const{connectionLookup:t,edgeLookup:n}=m();HT(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){const{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){const{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{const{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:o,nodeOrigin:a,nodeExtent:i,debug:s,fitViewQueued:l,zIndexMode:c}=m(),{changes:u,updatedInternals:d}=function(e,t,n,r,o,a,i){const s=r?.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const r of e.values()){const e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),l=!0;continue}const s=fT(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){const p=r.nodeElement.getBoundingClientRect(),m=aT(e.extent)?e.extent:a;let{positionAbsolute:h}=e.internals;e.parentId&&"parent"===e.extent?h=BA(h,s,t.get(e.parentId)):m&&(h=UA(h,m,s));const g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:yT("source",r.nodeElement,p,d,e.id),target:yT("target",r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&ZT(g,t,n,{nodeOrigin:o,zIndexMode:i}),l=!0,u&&(c.push({id:e.id,type:"dimensions",dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:WA(g,o)}))}}if(f.length>0){const e=GT(f,t,n,o);c.push(...e)}return{changes:c,updatedInternals:l}}(e,n,r,o,a,i,c);d&&(function(e,t,n){const r=UT(PT,n);for(const n of e.values())if(n.parentId)ZT(n,e,t,r);else{const e=LA(n,r.nodeOrigin),t=aT(n.extent)?n.extent:r.nodeExtent,o=UA(e,t,iT(n));n.internals.positionAbsolute=o}}(n,r,{nodeOrigin:a,nodeExtent:i,zIndexMode:c}),l?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log("React Flow: trigger node changes",u),t?.(u)))},updateNodePositions:(e,t=!1)=>{const n=[];let r=[];const{nodeLookup:o,triggerNodeChanges:a,connection:i,updateConnection:s,onNodesChangeMiddlewareMap:l}=m();for(const[a,l]of e){const e=o.get(a),c=!!(e?.expandParent&&e?.parentId&&l?.position),u={id:a,type:"position",position:c?{x:Math.max(0,l.position.x),y:Math.max(0,l.position.y)}:l.position,dragging:t};if(e&&i.inProgress&&i.fromNode.id===e.id){const t=LT(e,i.fromHandle,jA.Left,!0);s({...i,from:t})}c&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...l.internals.positionAbsolute,width:l.measured.width??0,height:l.measured.height??0}}),r.push(u)}if(n.length>0){const{parentLookup:e,nodeOrigin:t}=m(),a=GT(n,o,e,t);r.push(...a)}for(const e of l.values())r=e(r);a(r)},triggerNodeChanges:e=>{const{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:o,debug:a}=m();e?.length&&(o&&n(cO(e,r)),a&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{const{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:o,debug:a}=m();e?.length&&(o&&n(uO(e,r)),a&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:a}=m();t?o(e.map(e=>dO(e,!0))):(o(fO(r,new Set([...e]),!0)),a(fO(n)))},addSelectedEdges:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:a}=m();t?a(e.map(e=>dO(e,!0))):(a(fO(n,new Set([...e]))),o(fO(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{const{edges:n,nodes:r,nodeLookup:o,triggerNodeChanges:a,triggerEdgeChanges:i}=m(),s=e||r,l=t||n,c=[];for(const e of s){if(!e.selected)continue;const t=o.get(e.id);t&&(t.selected=!1),c.push(dO(e.id,!1))}const u=[];for(const e of l)e.selected&&u.push(dO(e.id,!1));a(c),i(u)},setMinZoom:e=>{const{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{const{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{const{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:o}=m();if(!o)return;const a=t.reduce((e,t)=>t.selected?[...e,dO(t.id,!1)]:e,[]),i=e.reduce((e,t)=>t.selected?[...e,dO(t.id,!1)]:e,[]);n(a),r(i)},setNodeExtent:e=>{const{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:o,elevateNodesOnSelect:a,nodeExtent:i,zIndexMode:s}=m();e[0][0]===i[0][0]&&e[0][1]===i[0][1]&&e[1][0]===i[1][0]&&e[1][1]===i[1][1]||(YT(t,n,r,{nodeOrigin:o,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{const{transform:t,width:n,height:r,panZoom:o,translateExtent:a}=m();return async function({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,a]],r),s=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(s)}({delta:e,panZoom:o,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{const{width:r,height:o,maxZoom:a,panZoom:i}=m();if(!i)return Promise.resolve(!1);const s=void 0!==n?.zoom?n.zoom:a;return await i.setViewport({x:r/2-e*s,y:o/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{..._A}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...Gz()})}},Object.is);function Hz({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:a,initialMinZoom:i,initialMaxZoom:s,initialFitViewOptions:l,fitView:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:m}){const[h]=(0,p.useState)(()=>Wz({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:a,fitView:c,minZoom:i,maxZoom:s,fitViewOptions:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,C.jsx)(jL,{value:h,children:(0,C.jsx)(bO,{children:m})})}function Qz({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:a,height:i,fitView:s,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:m}){return(0,p.useContext)(DL)?(0,C.jsx)(C.Fragment,{children:e}):(0,C.jsx)(Hz,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:a,initialHeight:i,fitView:s,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:m,children:e})}const $z={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var Xz=gO(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:a,edgeTypes:i,onNodeClick:s,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:m,onConnectStart:h,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:x,onNodeContextMenu:N,onNodeDoubleClick:I,onNodeDragStart:M,onNodeDrag:E,onNodeDragStop:_,onNodesDelete:S,onEdgesDelete:D,onDelete:j,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:T,onSelectionDragStop:L,onSelectionContextMenu:O,onSelectionStart:z,onSelectionEnd:P,onBeforeDelete:R,connectionMode:U,connectionLineType:B=SA.Bezier,connectionLineStyle:F,connectionLineComponent:Y,connectionLineContainerStyle:Z,deleteKeyCode:V="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:W=!1,selectionMode:H=EA.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:$=(oT()?"Meta":"Control"),zoomActivationKeyCode:X=(oT()?"Meta":"Control"),snapToGrid:J,snapGrid:q,onlyRenderVisibleElements:K=!1,selectNodesOnDrag:ee,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:re,nodesFocusable:oe,nodeOrigin:ae=XL,edgesFocusable:ie,edgesReconnectable:se,elementsSelectable:le=!0,defaultViewport:ce=JL,minZoom:ue=.5,maxZoom:de=2,translateExtent:fe=vA,preventScrolling:pe=!0,nodeExtent:me,defaultMarkerColor:he="#b1b1b7",zoomOnScroll:ge=!0,zoomOnPinch:we=!0,panOnScroll:ye=!1,panOnScrollSpeed:be=.5,panOnScrollMode:ve=MA.Free,zoomOnDoubleClick:xe=!0,panOnDrag:Ne=!0,onPaneClick:Ie,onPaneMouseEnter:Me,onPaneMouseMove:Ee,onPaneMouseLeave:_e,onPaneScroll:Se,onPaneContextMenu:De,paneClickDistance:je=1,nodeClickDistance:ke=0,children:Ce,onReconnect:Ae,onReconnectStart:Te,onReconnectEnd:Le,onEdgeContextMenu:Oe,onEdgeDoubleClick:ze,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Ue,reconnectRadius:Be=10,onNodesChange:Fe,onEdgesChange:Ye,noDragClassName:Ze="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:Ge="nopan",fitView:We,fitViewOptions:He,connectOnClick:Qe,attributionPosition:$e,proOptions:Xe,defaultEdgeOptions:Je,elevateNodesOnSelect:qe=!0,elevateEdgesOnSelect:Ke=!1,disableKeyboardA11y:et=!1,autoPanOnConnect:tt,autoPanOnNodeDrag:nt,autoPanSpeed:rt,connectionRadius:ot,isValidConnection:at,onError:it,style:st,id:lt,nodeDragThreshold:ct,connectionDragThreshold:ut,viewport:dt,onViewportChange:ft,width:pt,height:mt,colorMode:ht="light",debug:gt,onScroll:wt,ariaLabelConfig:yt,zIndexMode:bt="basic",...vt},xt){const Nt=lt||"1",It=function(e){const[t,n]=(0,p.useState)("system"===e?null:e);return(0,p.useEffect)(()=>{if("system"!==e)return void n(e);const t=nO(),r=()=>n(t?.matches?"dark":"light");return r(),t?.addEventListener("change",r),()=>{t?.removeEventListener("change",r)}},[e]),null!==t?t:nO()?.matches?"dark":"light"}(ht),Mt=(0,p.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),wt?.(e)},[wt]);return(0,C.jsx)("div",{"data-testid":"rf__wrapper",...vt,onScroll:Mt,style:{...st,...$z},ref:xt,className:bL(["react-flow",o,It]),id:lt,role:"application",children:(0,C.jsxs)(Qz,{nodes:e,edges:t,width:pt,height:mt,fitView:We,fitViewOptions:He,minZoom:ue,maxZoom:de,nodeOrigin:ae,nodeExtent:me,zIndexMode:bt,children:[(0,C.jsx)(tO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:h,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:re,nodesFocusable:oe,edgesFocusable:ie,edgesReconnectable:se,elementsSelectable:le,elevateNodesOnSelect:qe,elevateEdgesOnSelect:Ke,minZoom:ue,maxZoom:de,nodeExtent:me,onNodesChange:Fe,onEdgesChange:Ye,snapToGrid:J,snapGrid:q,connectionMode:U,translateExtent:fe,connectOnClick:Qe,defaultEdgeOptions:Je,fitView:We,fitViewOptions:He,onNodesDelete:S,onEdgesDelete:D,onDelete:j,onNodeDragStart:M,onNodeDrag:E,onNodeDragStop:_,onSelectionDrag:T,onSelectionDragStart:A,onSelectionDragStop:L,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Ge,nodeOrigin:ae,rfId:Nt,autoPanOnConnect:tt,autoPanOnNodeDrag:nt,autoPanSpeed:rt,onError:it,connectionRadius:ot,isValidConnection:at,selectNodesOnDrag:ee,nodeDragThreshold:ct,connectionDragThreshold:ut,onBeforeDelete:R,debug:gt,ariaLabelConfig:yt,zIndexMode:bt}),(0,C.jsx)(Vz,{onInit:c,onNodeClick:s,onEdgeClick:l,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:x,onNodeContextMenu:N,onNodeDoubleClick:I,nodeTypes:a,edgeTypes:i,connectionLineType:B,connectionLineStyle:F,connectionLineComponent:Y,connectionLineContainerStyle:Z,selectionKeyCode:G,selectionOnDrag:W,selectionMode:H,deleteKeyCode:V,multiSelectionKeyCode:$,panActivationKeyCode:Q,zoomActivationKeyCode:X,onlyRenderVisibleElements:K,defaultViewport:ce,translateExtent:fe,minZoom:ue,maxZoom:de,preventScrolling:pe,zoomOnScroll:ge,zoomOnPinch:we,zoomOnDoubleClick:xe,panOnScroll:ye,panOnScrollSpeed:be,panOnScrollMode:ve,panOnDrag:Ne,onPaneClick:Ie,onPaneMouseEnter:Me,onPaneMouseMove:Ee,onPaneMouseLeave:_e,onPaneScroll:Se,onPaneContextMenu:De,paneClickDistance:je,nodeClickDistance:ke,onSelectionContextMenu:O,onSelectionStart:z,onSelectionEnd:P,onReconnect:Ae,onReconnectStart:Te,onReconnectEnd:Le,onEdgeContextMenu:Oe,onEdgeDoubleClick:ze,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Ue,reconnectRadius:Be,defaultMarkerColor:he,noDragClassName:Ze,noWheelClassName:Ve,noPanClassName:Ge,rfId:Nt,disableKeyboardA11y:et,nodeExtent:me,viewport:dt,onViewportChange:ft}),(0,C.jsx)(QL,{onSelectionChange:k}),Ce,(0,C.jsx)(YL,{proOptions:Xe,position:$e}),(0,C.jsx)(BL,{rfId:Nt,disableKeyboardA11y:et})]})})});const Jz=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function qz({children:e}){const t=CL(Jz);return t?(0,dn.createPortal)(e,t):null}const Kz=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function eP({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,C.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:bL(["react-flow__background-pattern",n,r])})}function tP({radius:e,className:t}){return(0,C.jsx)("circle",{cx:e,cy:e,r:e,className:bL(["react-flow__background-pattern","dots",t])})}var nP;!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(nP||(nP={}));const rP={[nP.Dots]:1,[nP.Lines]:1,[nP.Cross]:6},oP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function aP({id:e,variant:t=nP.Dots,gap:n=20,size:r,lineWidth:o=1,offset:a=0,color:i,bgColor:s,style:l,className:c,patternClassName:u}){const d=(0,p.useRef)(null),{transform:f,patternId:m}=CL(oP,SL),h=r||rP[t],g=t===nP.Dots,w=t===nP.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*f[2]||1,y[1]*f[2]||1],v=h*f[2],x=Array.isArray(a)?a:[a,a],N=w?[v,v]:b,I=[x[0]*f[2]||1+N[0]/2,x[1]*f[2]||1+N[1]/2],M=`${m}${e||""}`;return(0,C.jsxs)("svg",{className:bL(["react-flow__background",c]),style:{...l,...MO,"--xy-background-color-props":s,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[(0,C.jsx)("pattern",{id:M,x:f[0]%b[0],y:f[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${I[0]},-${I[1]})`,children:g?(0,C.jsx)(tP,{radius:v/2,className:u}):(0,C.jsx)(eP,{dimensions:N,lineWidth:o,variant:t,className:u})}),(0,C.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}aP.displayName="Background";const iP=(0,p.memo)(aP);function sP(){return(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,C.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function lP(){return(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,C.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function cP(){return(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,C.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function uP(){return(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,C.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function dP(){return(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,C.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function fP({children:e,className:t,...n}){return(0,C.jsx)("button",{type:"button",className:bL(["react-flow__controls-button",t]),...n,children:e})}const pP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function mP({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:i,onFitView:s,onInteractiveChange:l,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":p}){const m=AL(),{isInteractive:h,minZoomReached:g,maxZoomReached:w,ariaLabelConfig:y}=CL(pP,SL),{zoomIn:b,zoomOut:v,fitView:x}=xO(),N="horizontal"===f?"horizontal":"vertical";return(0,C.jsxs)(FL,{className:bL(["react-flow__controls",N,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(fP,{onClick:()=>{b(),a?.()},className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:w,children:(0,C.jsx)(sP,{})}),(0,C.jsx)(fP,{onClick:()=>{v(),i?.()},className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:g,children:(0,C.jsx)(lP,{})})]}),n&&(0,C.jsx)(fP,{className:"react-flow__controls-fitview",onClick:()=>{x(o),s?.()},title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:(0,C.jsx)(cP,{})}),r&&(0,C.jsx)(fP,{className:"react-flow__controls-interactive",onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),l?.(!h)},title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:h?(0,C.jsx)(dP,{}):(0,C.jsx)(uP,{})}),u]})}mP.displayName="Controls",(0,p.memo)(mP);const hP=(0,p.memo)(function({id:e,x:t,y:n,width:r,height:o,style:a,color:i,strokeColor:s,strokeWidth:l,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){const{background:m,backgroundColor:h}=a||{},g=i||m||h;return(0,C.jsx)("rect",{className:bL(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:o,style:{fill:g,stroke:s,strokeWidth:l},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}),gP=e=>e.nodes.map(e=>e.id),wP=e=>e instanceof Function?e:()=>e,yP=(0,p.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:i,NodeComponent:s,onClick:l}){const{node:c,x:u,y:d,width:f,height:p}=CL(t=>{const n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};const r=n.internals.userNode,{x:o,y:a}=n.internals.positionAbsolute,{width:i,height:s}=iT(r);return{node:r,x:o,y:a,width:i,height:s}},SL);return c&&!c.hidden&&sT(c)?(0,C.jsx)(s,{x:u,y:d,width:f,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:o,strokeColor:n(c),strokeWidth:a,shapeRendering:i,onClick:l,id:c.id}):null});var bP=(0,p.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:a=hP,onClick:i}){const s=CL(gP,SL),l=wP(t),c=wP(e),u=wP(n),d="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,C.jsx)(C.Fragment,{children:s.map(e=>(0,C.jsx)(yP,{id:e,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:a,onClick:i,shapeRendering:d},e))})});const vP=e=>!e.hidden,xP=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?QA(OA(e.nodeLookup,{filter:vP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}};function NP({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:i,nodeComponent:s,bgColor:l,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:m,onNodeClick:h,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:v=1,offsetScale:x=5}){const N=AL(),I=(0,p.useRef)(null),{boundingRect:M,viewBB:E,rfId:_,panZoom:S,translateExtent:D,flowWidth:j,flowHeight:k,ariaLabelConfig:A}=CL(xP,SL),T=e?.width??200,L=e?.height??150,O=M.width/T,z=M.height/L,P=Math.max(O,z),R=P*T,U=P*L,B=x*P,F=M.x-(R-M.width)/2-B,Y=M.y-(U-M.height)/2-B,Z=R+2*B,V=U+2*B,G=`react-flow__minimap-desc-${_}`,W=(0,p.useRef)(0),H=(0,p.useRef)();W.current=P,(0,p.useEffect)(()=>{if(I.current&&S)return H.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=Hj(e);return{update:function({translateExtent:e,width:a,height:i,zoomStep:s=1,pannable:l=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0];const f=mA().on("start",e=>{"mousedown"!==e.sourceEvent.type&&"touchstart"!==e.sourceEvent.type||(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",l?o=>{const s=n();if("mousemove"!==o.sourceEvent.type&&"touchmove"!==o.sourceEvent.type||!t)return;const l=[o.sourceEvent.clientX??o.sourceEvent.touches[0].clientX,o.sourceEvent.clientY??o.sourceEvent.touches[0].clientY],c=[l[0]-d[0],l[1]-d[1]];d=l;const f=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-c[0]*f,y:s[1]-c[1]*f},m=[[0,0],[a,i]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on("zoom.wheel",c?e=>{if("wheel"!==e.sourceEvent.type||!t)return;const r=n(),o=e.sourceEvent.ctrlKey&&oT()?10:1,a=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,i=r[2]*Math.pow(2,a*o);t.scaleTo(i)}:null);o.call(f,{})},destroy:function(){o.on("zoom",null)},pointer:Qj}}({domNode:I.current,panZoom:S,getTransform:()=>N.getState().transform,getViewScale:()=>W.current}),()=>{H.current?.destroy()}},[S]),(0,p.useEffect)(()=>{H.current?.update({translateExtent:D,width:j,height:k,inversePan:b,pannable:g,zoomStep:v,zoomable:w})},[g,w,b,v,D,j,k]);const Q=m?e=>{const[t,n]=H.current?.pointer(e)||[0,0];m(e,{x:t,y:n})}:void 0,$=h?(0,p.useCallback)((e,t)=>{const n=N.getState().nodeLookup.get(t).internals.userNode;h(e,n)},[]):void 0,X=y??A["minimap.ariaLabel"];return(0,C.jsx)(FL,{position:f,style:{...e,"--xy-minimap-background-color-props":"string"==typeof l?l:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof d?d*P:void 0,"--xy-minimap-node-background-color-props":"string"==typeof r?r:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof i?i:void 0},className:bL(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,C.jsxs)("svg",{width:T,height:L,viewBox:`${F} ${Y} ${Z} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:I,onClick:Q,children:[X&&(0,C.jsx)("title",{id:G,children:X}),(0,C.jsx)(bP,{onClick:$,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:s}),(0,C.jsx)("path",{className:"react-flow__minimap-mask",d:`M${F-B},${Y-B}h${Z+2*B}v${V+2*B}h${-Z-2*B}z\n M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}NP.displayName="MiniMap";const IP=(0,p.memo)(NP),MP={[uL.Line]:"right",[uL.Handle]:"bottom-right"};(0,p.memo)(function({nodeId:e,position:t,variant:n=uL.Handle,className:r,style:o,children:a,color:i,minWidth:s=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:m=!0,shouldResize:h,onResizeStart:g,onResize:w,onResizeEnd:y}){const b=PO(),v="string"==typeof e?e:b,x=AL(),N=(0,p.useRef)(null),I=n===uL.Handle,M=CL((0,p.useCallback)((E=I&&m,e=>E?`${Math.max(1/e.transform[2],1)}`:void 0),[I,m]),SL);var E;const _=(0,p.useRef)(null),S=t??MP[n];(0,p.useEffect)(()=>{if(N.current&&v)return _.current||(_.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const a=Hj(e);let i={controlDirection:dL("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:s,keepAspectRatio:l,resizeDirection:c,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m,h={...gL},g={...wL};i={boundaries:s,resizeDirection:c,keepAspectRatio:l,controlDirection:dL(e)};let w,y,b,v=null,x=[],N=!1;const I=sk().on("start",e=>{const{nodeLookup:r,transform:o,snapGrid:a,snapToGrid:i,nodeOrigin:s,paneDomNode:l}=n();if(m=r.get(t),!m)return;v=l?.getBoundingClientRect()??null;const{xSnapped:c,ySnapped:d}=dT(e.sourceEvent,{transform:o,snapGrid:a,snapToGrid:i,containerBounds:v});h={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},g={...h,pointerX:c,pointerY:d,aspectRatio:h.width/h.height},w=void 0,m.parentId&&("parent"===m.extent||m.expandParent)&&(w=r.get(m.parentId),y=w&&"parent"===m.extent?function(e){return[[0,0],[e.measured.width,e.measured.height]]}(w):void 0),x=[],b=void 0;for(const[e,n]of r)if(n.parentId===t&&(x.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const e=yL(n,m,n.origin??s);b=b?[[Math.min(e[0][0],b[0][0]),Math.min(e[0][1],b[0][1])],[Math.max(e[1][0],b[1][0]),Math.max(e[1][1],b[1][1])]]:e}u?.(e,{...h})}).on("drag",e=>{const{transform:t,snapGrid:o,snapToGrid:a,nodeOrigin:s}=n(),l=dT(e.sourceEvent,{transform:t,snapGrid:o,snapToGrid:a,containerBounds:v}),c=[];if(!m)return;const{x:u,y:f,width:I,height:M}=h,E={},_=m.origin??s,{width:S,height:D,x:j,y:k}=function(e,t,n,r,o,a,i,s){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:w,maxHeight:y}=r,{x:b,y:v,width:x,height:N,aspectRatio:I}=e;let M=Math.floor(u?p-e.pointerX:0),E=Math.floor(d?m-e.pointerY:0);const _=x+(l?-M:M),S=N+(c?-E:E),D=-a[0]*x,j=-a[1]*N;let k=mL(_,h,g),C=mL(S,w,y);if(i){let e=0,t=0;l&&M<0?e=fL(b+M+D,i[0][0]):!l&&M>0&&(e=pL(b+_+D,i[1][0])),c&&E<0?t=fL(v+E+j,i[0][1]):!c&&E>0&&(t=pL(v+S+j,i[1][1])),k=Math.max(k,e),C=Math.max(C,t)}if(s){let e=0,t=0;l&&M>0?e=pL(b+M,s[0][0]):!l&&M<0&&(e=fL(b+_,s[1][0])),c&&E>0?t=pL(v+E,s[0][1]):!c&&E<0&&(t=fL(v+S,s[1][1])),k=Math.max(k,e),C=Math.max(C,t)}if(o){if(u){const e=mL(_/I,w,y)*I;if(k=Math.max(k,e),i){let e=0;e=!l&&!c||l&&!c&&f?pL(v+j+_/I,i[1][1])*I:fL(v+j+(l?M:-M)/I,i[0][1])*I,k=Math.max(k,e)}if(s){let e=0;e=!l&&!c||l&&!c&&f?fL(v+_/I,s[1][1])*I:pL(v+(l?M:-M)/I,s[0][1])*I,k=Math.max(k,e)}}if(d){const e=mL(S*I,h,g)/I;if(C=Math.max(C,e),i){let e=0;e=!l&&!c||c&&!l&&f?pL(b+S*I+D,i[1][0])/I:fL(b+(c?E:-E)*I+D,i[0][0])/I,C=Math.max(C,e)}if(s){let e=0;e=!l&&!c||c&&!l&&f?fL(b+S*I,s[1][0])/I:pL(b+(c?E:-E)*I,s[0][0])/I,C=Math.max(C,e)}}}E+=E<0?C:-C,M+=M<0?k:-k,o&&(f?_>S*I?E=(hL(l,c)?-M:M)/I:M=(hL(l,c)?-E:E)*I:u?(E=M/I,c=l):(M=E*I,l=c));const A=l?b+M:b,T=c?v+E:v;return{width:x+(l?-M:M),height:N+(c?-E:E),x:a[0]*M*(l?-1:1)+A,y:a[1]*E*(c?-1:1)+T}}(g,i.controlDirection,l,i.boundaries,i.keepAspectRatio,_,y,b),C=S!==I,A=D!==M,T=j!==u&&C,L=k!==f&&A;if(!(T||L||C||A))return;if((T||L||1===_[0]||1===_[1])&&(E.x=T?j:h.x,E.y=L?k:h.y,h.x=E.x,h.y=E.y,x.length>0)){const e=j-u,t=k-f;for(const n of x)n.position={x:n.position.x-e+_[0]*(S-I),y:n.position.y-t+_[1]*(D-M)},c.push(n)}if((C||A)&&(E.width=!C||i.resizeDirection&&"horizontal"!==i.resizeDirection?h.width:S,E.height=!A||i.resizeDirection&&"vertical"!==i.resizeDirection?h.height:D,h.width=E.width,h.height=E.height),w&&m.expandParent){const e=_[0]*(E.width??0);E.x&&E.x<e&&(h.x=e,g.x=g.x-(E.x-e));const t=_[1]*(E.height??0);E.y&&E.y<t&&(h.y=t,g.y=g.y-(E.y-t))}const O=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:a}){const i=e-t,s=n-r,l=[i>0?1:i<0?-1:0,s>0?1:s<0?-1:0];return i&&o&&(l[0]=-1*l[0]),s&&a&&(l[1]=-1*l[1]),l}({width:h.width,prevWidth:I,height:h.height,prevHeight:M,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),z={...h,direction:O},P=p?.(e,z);!1!==P&&(N=!0,d?.(e,z),r(E,c))}).on("end",e=>{N&&(f?.(e,{...h}),o?.({...h}),N=!1)});a.call(I)},destroy:function(){a.on(".drag",null)}}}({domNode:N.current,nodeId:v,getStoreItems:()=>{const{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,paneDomNode:a}},onChange:(e,t)=>{const{triggerNodeChanges:n,nodeLookup:r,parentLookup:o,nodeOrigin:a}=x.getState(),i=[],s={x:e.x,y:e.y},l=r.get(v);if(l&&l.expandParent&&l.parentId){const t=l.origin??a,n=e.width??l.measured.width??0,c=e.height??l.measured.height??0,u=GT([{id:l.id,parentId:l.parentId,rect:{width:n,height:c,...lT({x:e.x??l.position.x,y:e.y??l.position.y},{width:n,height:c},l.parentId,r,t)}}],r,o,a);i.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==s.x&&void 0!==s.y){const e={id:v,type:"position",position:{...s}};i.push(e)}if(void 0!==e.width&&void 0!==e.height){const t={id:v,type:"dimensions",resizing:!0,setAttributes:!f||("horizontal"===f?"width":"height"),dimensions:{width:e.width,height:e.height}};i.push(t)}for(const e of t){const t={...e,type:"position"};i.push(t)}n(i)},onEnd:({width:e,height:t})=>{const n={id:v,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}})),_.current.update({controlPosition:S,boundaries:{minWidth:s,minHeight:l,maxWidth:c,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:h}),()=>{_.current?.destroy()}},[S,s,l,c,u,d,g,w,y,h]);const D=S.split("-");return(0,C.jsx)("div",{className:bL(["react-flow__resize-control","nodrag",...D,n,r]),ref:N,style:{...o,scale:M,...i&&{[I?"backgroundColor":"borderColor"]:i}},children:a})});const EP=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o="start"===e?.position,a="end"===e?.position,{position:s,id:l}="start"==(o?"start":"end")?n?{position:jA.Bottom,id:"bottom"}:r?{position:jA.Right,id:"right"}:{position:jA.Left,id:"left"}:n?{position:jA.Top,id:"top"}:r?{position:jA.Left,id:"left"}:{position:jA.Right,id:"right"};return(0,i.createElement)(i.Fragment,null,a&&(0,i.createElement)(UO,{type:"target",position:s,id:l,style:{background:"#555",border:"2px dotted #555",transition:"all 0.3s ease"},className:`react-flow__handle wcf-handle-${l}`,isConnectable:t}),(0,i.createElement)("div",{className:"wcf-custom-label-node--wrapper bg-primary-50 py-1 px-3 border border-primary-300 rounded-md text-primary-500 text-sm font-medium","aria-label":e.label},e.label),o&&(0,i.createElement)(UO,{type:"source",position:s,id:l,style:{border:"2px dotted #555",transition:"all 0.3s ease"},className:`react-flow__handle wcf-handle-${l}`,isConnectable:t}))});function _P({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const SP=p.forwardRef(_P),DP=(0,i.memo)(({data:e,isConnectable:t})=>{const n="LR"===e.direction?"target":"source",r="LR"===e.direction?"source":"target",o=(Array.isArray(e?.conditions)?e.conditions.length:0)+(e?.defaultStep?1:0),a=o?(0,j.sprintf)(/* translators: %d: number of dynamic-offer conditions on this checkout */ /* translators: %d: number of dynamic-offer conditions on this checkout */
27 +(0,j._n)("%d condition","%d conditions",o,"cartflows"),o):"";return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:n,position:jA.Left,style:{background:"#555"},isConnectable:t,className:"react-flow__handle wcf-handle-left"}),(0,i.createElement)("div",{className:"wcf-custom-node-wrapper wcf-conditional-node",style:{width:"80px",margin:"auto",height:"80px",display:"flex",alignItems:"center",justifyContent:"center",transform:"rotate(45deg)"}},(0,i.createElement)("div",{className:"wcf-custom-node-design"},(0,i.createElement)(_,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.checkoutId}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.checkoutId}`},title:"Dynamic Offers",rel:"noreferrer",className:"wcf-custom-node-content bg-white border border-gray-200 shadow-md",style:{width:"80px",margin:"auto",height:"80px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},(0,i.createElement)(SP,{className:"w-8 h-8 !fill-[none] stroke-2 text-gray-500",style:{transform:"rotate(-45deg)"}})))),(0,i.createElement)("div",{className:"wcf-custom-node-label",style:{fontSize:"11px",fontWeight:"600",marginTop:"8px",textAlign:"center"}},e.label||(0,j.__)("Dynamic Offers","cartflows")),a&&(0,i.createElement)("div",{className:"wcf-conditional-node__summary",style:{fontSize:"10px",color:"#6B7280",marginTop:"2px",textAlign:"center"}},a),(0,i.createElement)(UO,{type:r,position:jA.Right,style:{background:"#555"},isConnectable:t,className:"react-flow__handle wcf-handle-right"}))}),jP="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOEgwVjEwWiIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQiIHI9IjQiIGZpbGw9IiNGRjNCMzAiLz48Y2lyY2xlIGN4PSIyNyIgY3k9IjE0IiByPSI0IiBmaWxsPSIjRkMwIi8+PGNpcmNsZSBjeD0iNDAiIGN5PSIxNCIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjY0IiB5PSIxMCIgd2lkdGg9IjEwNyIgaGVpZ2h0PSI3IiByeD0iMSIgZmlsbD0iI2ZmZiIvPjxyZWN0IHg9IjIzIiB5PSIyMjAiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTY3LjIwNiAyMzMuNWgyLjc5NmMxLjQ3IDAgMi4yNTMtLjc2NyAyLjI1My0xLjgwOSAwLS45NjgtLjY5My0xLjU1My0xLjQzOC0xLjU4OHYtLjA2NGMuNjgtLjE1NCAxLjE4My0uNjM2IDEuMTgzLTEuNDA3IDAtLjk4MS0uNzI5LTEuNjc3LTIuMTc0LTEuNjc3aC0yLjYydjYuNTQ1Wm0xLjM4My0xLjEzMXYtMS43MzloMS4xNmMuNjY1IDAgMS4wNzguMzgzIDEuMDc4LjkyNCAwIC40OTItLjMzNi44MTUtMS4xMS44MTVINjguNTlabTAtMi42NzV2LTEuNjIxaDEuMDUyYy42MTQgMCAuOTYyLjMxNy45NjIuNzkgMCAuNTE3LS40MjIuODMxLS45ODguODMxSDY4LjU5Wm03LjY5IDEuNzE2Yy4wMDIuNjU4LS40NDggMS4wMDMtLjkzNyAxLjAwMy0uNTE1IDAtLjg0Ny0uMzYxLS44NS0uOTM5di0yLjg4M0g3My4xM3YzLjEyNmMuMDAzIDEuMTQ3LjY3NSAxLjg0NyAxLjY2MiAxLjg0Ny43MzkgMCAxLjI2OS0uMzggMS40OS0uOTU2aC4wNXYuODkyaDEuMzA4di00LjkwOWgtMS4zNjJ2Mi44MTlabTMuMjkgMy45MzFjMS4wMTQgMCAxLjU1LS41MTggMS44MjgtMS4zMWwxLjkwOS01LjQzNC0xLjQ0Mi0uMDA2LTEuMDI2IDMuNjA1aC0uMDVsLTEuMDE3LTMuNjA1aC0xLjQzMmwxLjc2MSA1LjA1LS4wOC4yMDdjLS4xNzkuNDYxLS41Mi40ODMtMSAuMzM2bC0uMzA3IDEuMDE2Yy4xOTUuMDgzLjUxMS4xNDEuODU2LjE0MVptMTIuMDE3LTguMzg2aC0xLjM3OHY0LjExNmgtLjA1N2wtMi44MjYtNC4xMTZoLTEuMjE0djYuNTQ1aDEuMzg0di00LjEyaC4wNDhsMi44NDcgNC4xMmgxLjE5NnYtNi41NDVabTMuMzM1IDYuNjQxYzEuNDkgMCAyLjQxNy0xLjAyIDIuNDE3LTIuNTMxIDAtMS41MjItLjkyNy0yLjUzOC0yLjQxNi0yLjUzOC0xLjQ5IDAtMi40MTcgMS4wMTYtMi40MTcgMi41MzggMCAxLjUxMS45MjcgMi41MzEgMi40MTYgMi41MzFabS4wMDctMS4wNTVjLS42ODcgMC0xLjAzOS0uNjI5LTEuMDM5LTEuNDg2IDAtLjg1Ni4zNTItMS40ODkgMS4wMzktMS40ODkuNjc0IDAgMS4wMjYuNjMzIDEuMDI2IDEuNDg5IDAgLjg1Ny0uMzUyIDEuNDg2LTEuMDI2IDEuNDg2Wm00LjE0Ljk1OWgxLjQzOWwuODQzLTMuMDg3aC4wNjFsLjg0NCAzLjA4N2gxLjQ0MWwxLjMzMy00LjkwOWgtMS4zNzRsLS43NDggMy4yNzloLS4wNDJsLS44MDUtMy4yNzloLTEuMzUybC0uNzkzIDMuMjk4aC0uMDQ0bC0uNzYxLTMuMjk4aC0xLjM3OGwxLjMzNiA0LjkwOVptOS4wNzEtMi42MjRjMCAxLjU4OC40MTggMi45MDggMS4yOTEgNC4wNDZoMS4zMDFjLS42NjgtLjg0NC0xLjE3Ni0yLjUzMS0xLjE3Ni00LjA0NiAwLTEuNTEyLjUwOC0zLjE5OSAxLjE3Ni00LjA0M2gtMS4zMDFjLS44NzMgMS4xMzgtMS4yOTEgMi40NTUtMS4yOTEgNC4wNDNabTkuMTgzLTEuNjNjLS4xODMtMS41MTItMS4zMjctMi4zODEtMi44NDItMi4zODEtMS43MjkgMC0zLjA0OSAxLjIyMS0zLjA0OSAzLjM2MiAwIDIuMTM1IDEuMjk4IDMuMzYyIDMuMDQ5IDMuMzYyIDEuNjc4IDAgMi42OTEtMS4xMTUgMi44NDItMi4zMmwtMS40LS4wMDZjLS4xMzEuNy0uNjgxIDEuMTAyLTEuNDE5IDEuMTAyLS45OTQgMC0xLjY2OS0uNzM4LTEuNjY5LTIuMTM4IDAtMS4zNjEuNjY1LTIuMTM4IDEuNjc4LTIuMTM4Ljc1OCAwIDEuMzA0LjQzOCAxLjQxIDEuMTU3aDEuNFptLjc0My0xLjE1aDIuMDA0djUuNDA0aDEuMzY4di01LjQwNGgyLjAwM3YtMS4xNDFoLTUuMzc1djEuMTQxWm02LjU4IDUuNDA0LjQ4Ni0xLjQ5M2gyLjM2MmwuNDg2IDEuNDkzaDEuNDgzbC0yLjI1Ny02LjU0NWgtMS43ODNsLTIuMjYgNi41NDVoMS40ODNabS44MzgtMi41NzMuODA1LTIuNDc3aC4wNTFsLjgwNiAyLjQ3N2gtMS42NjJabTcuMDM2LS43YzAtMS41ODgtLjQxOS0yLjkwOC0xLjI5MS00LjA0NmgtMS4zMDFjLjY2OC44NDQgMS4xNzYgMi41MzEgMS4xNzYgNC4wNDYgMCAxLjUxMi0uNTA4IDMuMTk5LTEuMTc2IDQuMDQzaDEuMzAxYy44NzItMS4xMzggMS4yOTEtMi40NTQgMS4yOTEtNC4wNDNaIiBmaWxsPSIjZmZmIi8+PHJlY3QgeD0iNjUiIHk9IjE2NCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iNzUiIHk9IjU3IiB3aWR0aD0iNTAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSI1MCIgeT0iNDMiIHdpZHRoPSIxMDAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiMyMjcxQjEiLz48cmVjdCB4PSIyMy43NSIgeT0iNzYuNzUiIHdpZHRoPSIxNTIuNSIgaGVpZ2h0PSI2MS41IiByeD0iMS4yNSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxwYXRoIGQ9Im05NS44NzcgMTEzLjQ4MyAxOS4xMTMtMTkuMzg0IDI4LjM0OSAzMi4xNTFINTguODc2bDI0LjUzLTIzLjM1MSAxMS40MjcgMTAuNjA3LjUzMy40OTUuNTEtLjUxOFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIxLjUiLz48cGF0aCBkPSJNMTAxLjI1IDk1YzAgMi45NjItMi4xODcgNS4yNS00Ljc1IDUuMjVzLTQuNzUtMi4yODgtNC43NS01LjI1IDIuMTg3LTUuMjUgNC43NS01LjI1IDQuNzUgMi4yODggNC43NSA1LjI1WiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxwYXRoIGQ9Im0xNjYuNzI3IDExMS4wNiAzLjA1My0zLjA2LTMuMDUzLTMuMDYuOTQtLjk0IDQgNC00IDQtLjk0LS45NFpNMzQuMjcyIDExMS4wNiAzMS4yMTkgMTA4bDMuMDUzLTMuMDYtLjk0LS45NC00IDQgNCA0IC45NC0uOTRaIiBmaWxsPSIjMjI3MUIxIi8+PGNpcmNsZSBjeD0iOTEuNSIgY3k9IjE0Ny41IiByPSIxLjUiIGZpbGw9IiMyMjcxQjEiLz48Y2lyY2xlIGN4PSI5OS41IiBjeT0iMTQ3LjUiIHI9IjEuNSIgZmlsbD0iIzIyNzFCMSIvPjxjaXJjbGUgY3g9IjEwNy41IiBjeT0iMTQ3LjUiIHI9IjEuNSIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjIzIiB5PSIxNzgiIHdpZHRoPSIxNTQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIyMyIgeT0iMTkyIiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMjMiIHk9IjIwNiIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjwvc3ZnPg==";function kP({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const CP=p.forwardRef(kP);function AP({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"}))}const TP=p.forwardRef(AP);function LP({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.51-5.511-3.181"}))}const OP=p.forwardRef(LP);function zP({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z"}))}const PP=p.forwardRef(zP);function RP({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"}))}const UP=p.forwardRef(RP),BP=To("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),FP=To("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]),YP=To("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),ZP=To("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]),VP=To("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),GP=To("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]),WP=To("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),HP=To("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),QP=To("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),$P=e=>{const t=Number(e)||0;return 0===t?"—":Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`},XP=({bump:e,settingsUrl:t})=>{const n=!e.revenue&&!e.conversions;return(0,i.createElement)(_,{to:{pathname:"admin.php",search:t},className:"wcf-bump-row bg-background-secondary border border-solid border-border-subtle rounded-md px-3 py-2 no-underline hover:bg-background-tertiary",title:e.title},(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)("span",{className:"wcf-bump-row__icon bg-primary-25 p-1 rounded border border-solid border-primary-300 inline-flex items-center justify-center shrink-0","aria-label":(0,j.__)("Order bump","cartflows")},(0,i.createElement)(Dg,{className:"w-3 h-3 stroke-2 text-primary-500"})),(0,i.createElement)(vh,{as:"span",size:14,color:n?"tertiary":"primary",className:"wcf-bump-row__title truncate flex-1 text-left"},e.title),(0,i.createElement)(vh,{as:"span",size:12,color:n?"tertiary":"secondary",className:"tabular-nums w-10 text-right"},(e=>{const t=parseInt(e,10)||0;return 0===t?"—":String(t)})(e.conversions)),(0,i.createElement)(vh,{as:"span",size:14,weight:n?400:600,color:n?"tertiary":"primary",className:"tabular-nums w-14 text-right"},$P(e.revenue)),(0,i.createElement)(pN,{className:"w-3 h-3 stroke-2 text-text-tertiary shrink-0"})))},JP=({stepId:e,flowId:t,flowType:n,bumps:r=[],compact:o=!1})=>{const[a,s]=(0,i.useState)(!1);if(!Array.isArray(r)||0===r.length)return null;const l=r.reduce((e,t)=>e+(Number(t.revenue)||0),0),c="storeCheckout"===n?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps`;return o?(0,i.createElement)(_,{to:{pathname:"admin.php",search:c},className:"wcf-bumps-section wcf-bumps-section--compact px-3 py-2 border-0 border-t border-b border-solid border-border-subtle no-underline hover:bg-background-secondary"},(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",justify:"between"},(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)(Dg,{className:"w-3.5 h-3.5 stroke-2 text-text-primary"}),(0,i.createElement)(vh,{as:"span",size:12,weight:500,color:"primary"},(0,j.__)("Order Bumps","cartflows")),(0,i.createElement)(vh,{as:"span",size:12,color:"secondary",className:"tabular-nums"},"(",r.length,")")),(0,i.createElement)(vh,{as:"span",size:12,color:"secondary",className:"tabular-nums"},$P(l)))):(0,i.createElement)(ph,{containerType:"flex",direction:"column",className:"wcf-bumps-section px-4 py-3 border-0 border-t border-b border-solid border-border-subtle "+(a?"":"!gap-0")},(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",justify:"between",className:a?"mb-2":""},(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)(Dg,{className:"w-4 h-4 stroke-2 text-text-primary"}),(0,i.createElement)(vh,{as:"span",size:14,weight:500,color:"primary"},(0,j.__)("Order Bumps","cartflows")),(0,i.createElement)(vh,{as:"span",size:12,color:"secondary",className:"tabular-nums"},"(",r.length,")")),(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)(vh,{as:"span",size:12,color:"tertiary"},(0,j.__)("Total","cartflows")),(0,i.createElement)(vh,{as:"span",size:12,weight:500,color:"primary",className:"tabular-nums"},$P(l)),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",type:"button",onClick:()=>s(e=>!e),"aria-expanded":a,"aria-label":a?(0,j.__)("Collapse order bumps","cartflows"):(0,j.__)("Expand order bumps","cartflows"),icon:(0,i.createElement)(Fp,{className:"stroke-2 transition-transform duration-300 ease-in-out "+(a?"rotate-180":"")}),className:"wcf-bumps-section__toggle !p-0.5 text-text-tertiary hover:text-text-primary"}))),(0,i.createElement)("div",{className:"wcf-bumps-section__body grid transition-[grid-template-rows] duration-300 ease-in-out "+(a?"grid-rows-[1fr]":"grid-rows-[0fr]"),"aria-hidden":!a},(0,i.createElement)("div",{className:"overflow-hidden min-h-0"},(0,i.createElement)(ph,{containerType:"flex",direction:"column",gap:"xs"},r.map(e=>(0,i.createElement)(XP,{key:e.id,bump:e,settingsUrl:c}))),(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",justify:"end",gap:"sm",className:"pt-1.5 mt-0.5"},(0,i.createElement)(vh,{as:"span",size:12,color:"tertiary",className:"uppercase tracking-wide w-10 text-right"},(0,j.__)("Sales","cartflows")),(0,i.createElement)(vh,{as:"span",size:12,color:"tertiary",className:"uppercase tracking-wide w-14 text-right"},(0,j.__)("Revenue","cartflows")),(0,i.createElement)("span",{className:"w-3","aria-hidden":"true"})))))},qP={cloneStepRequest(e){const t=(0,k.applyFilters)("cartflows.canvas.cloneStepRequest",null);return t&&wcfCartflowsPro()?t(e):Promise.resolve(null)},createEventHandlers(e,t,n,r,o={}){const a=(0,k.applyFilters)("cartflows.flowEditor.abActions",null),i=a?a({stepId:e?.step_id,flowId:e?.flow_id,confirm:t,setLoader:r,toast:Wm}):{},s=e=>e.preventDefault();return{clone:async function(n){if(n.preventDefault(),!wcfCartflowsPro())return null;const o=n.currentTarget.getAttribute("data-action");if(await t({title:(0,j.__)("Duplicate Step","cartflows"),description:(0,j.__)("Do you want to duplicate this step? Are you sure?","cartflows"),actionBtnText:(0,j.__)("Yes","cartflows"),cancelBtnText:(0,j.__)("No","cartflows")})){r(!0);let t=cartflows_admin.clone_step_nonce;const n=new window.FormData;"cartflows_clone_ab_test_step"===o&&(t=cartflows_admin.wcf_clone_ab_test_step_nonce,n.append("control_id",e?.control_id)),n.append("action",o),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),window.wcfAction="cloneStep",(0,Eg.$h)(Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Cloning step failed:",e),r(!1)}))}},delete:o.delete||async function(n){n.preventDefault();const o=n.currentTarget.getAttribute("data-action");if(await t({title:(0,j.__)("Delete Step","cartflows"),description:(0,j.__)("Do you want to delete this step? Are you sure?","cartflows"),actionBtnText:(0,j.__)("Yes","cartflows"),cancelBtnText:(0,j.__)("No","cartflows")})){r(!0);let t=cartflows_admin.delete_step_nonce;const n=new window.FormData;"cartflows_delete_ab_test_step"===o&&(t=cartflows_admin.wcf_delete_ab_test_step_nonce,n.append("control_id",e?.control_id)),n.append("action",o),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),window.wcfAction="deleteStep",(0,Eg.$h)(Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Delete step failed:",e),r(!1)}))}},abtest:i.abtest||s,winner:i.winner||s,archived:i.archived||s,automation:()=>{n.push({pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&automation=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&automation=${e?.step_id}`})}}},async performDelete(e,t,r,o={}){r(!0);let a=cartflows_admin.delete_step_nonce;const i=new window.FormData;"cartflows_delete_ab_test_step"===t&&(a=cartflows_admin.wcf_delete_ab_test_step_nonce,i.append("control_id",e?.control_id)),i.append("action",t),i.append("security",a),i.append("step_id",e?.step_id),i.append("post_id",e?.flow_id),Object.keys(o).length>0&&i.append("redirect_updates",JSON.stringify(o)),window.wcfAction="deleteStep";try{const e=(await Promise.resolve().then(n.t.bind(n,1455,23))).default;await e({url:cartflows_admin.ajax_url,method:"POST",body:i}),window.location.reload()}catch(e){console.error("Delete step failed:",e),r(!1)}},nodeHtml(e,t,n,r,o,a,s,l,c,u,d,f,p=[],m=!1,h=[],g="",w=!1,y=!1){const b=Bm(e?.step_type,g),v=()=>{let e=0;return c&&c.visits&&(e=c.visits.total_visits||0),e},x=()=>{let e=0;return c&&c.visits&&(e=c.visits.conversions||0),e},N=()=>c&&c?.visits?.revenue?Nh(c.visits.revenue):0,I=e?.step_type||"",M=Um(e?.step_title||"");return(0,i.createElement)("div",{className:`wcf-custom-node-wrapper${m?" wcf-custom-node-wrapper--compact":""}${w?" wcf-custom-node-wrapper--locked pointer-events-none touch-none opacity-60":""}`},(0,i.createElement)("div",{className:"wcf-custom-node-design"},(0,i.createElement)("div",{className:"wcf-node-actions absolute flex bg-white left-11 -top-16 rounded-md py-0.5 px-1.5 sm:hidden lg:hidden"},(0,i.createElement)(Wo,{content:(0,j.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,j.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(WP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:b?Fm():(0,j.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:b?"#!":r,target:b?void 0:"_blank",rel:"noreferrer","aria-label":(0,j.__)("Edit Page","cartflows"),"aria-disabled":b,tabIndex:b?-1:0,className:"wcf-canvas--edit-step p-2 block "+(b?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,i.createElement)(HP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:(0,j.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)(_,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,j.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(QP,{className:"w-5 h-5"})))),(0,i.createElement)("div",{className:"wcf-custom-node-content bg-white border border-gray-200 rounded-lg shadow-md"+(f?" opacity-50":"")},(0,i.createElement)("div",{className:"wcf-custom-node-content--header flex flex-col gap-3 border-b border-gray-200 py-4 px-5"},(0,i.createElement)("div",{className:"wcf-node-step--info-wrapper flex flex-row items-center gap-4 w-full"},(0,i.createElement)("div",{className:"wcf-node-step--icon bg-primary-25 p-2.5 rounded border border-primary-300"},(e=>{let t="";const n="w-5 h-5 stroke-2 text-primary-500";switch(e){case"landing":t=(0,i.createElement)(CP,{className:n});break;case"optin":t=(0,i.createElement)(TP,{className:n});break;case"checkout":t=(0,i.createElement)(Xg,{className:n});break;case"upsell":t=(0,i.createElement)(sm,{className:n});break;case"downsell":t=(0,i.createElement)(OP,{className:n});break;case"thankyou":t=(0,i.createElement)(PP,{className:n});break;default:t=(0,i.createElement)(UP,{className:n})}return t})(I)),(0,i.createElement)("div",{className:"w-full flex flex-col gap-1"},(0,i.createElement)("div",{className:"wcf-node-step--type flex items-center gap-2"},(0,i.createElement)("span",{className:"text-xs font-normal text-gray-400"},(E=I,{landing:(0,j.__)("Landing","cartflows"),optin:(0,j.__)("Optin","cartflows"),checkout:(0,j.__)("Checkout","cartflows"),upsell:(0,j.__)("Upsell","cartflows"),downsell:(0,j.__)("Downsell","cartflows"),thankyou:(0,j.__)("Thank You","cartflows")}[E]||E)),u&&(0,i.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-invalid-sequence-badge"},(0,i.createElement)(pg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,j.__)("Invalid Position","cartflows"))),(0,i.createElement)("div",{className:"wcf-node-step--title text-left"},(0,i.createElement)("span",{className:"font-semibold text-sm text-gray-800 hover:text-gray-800"},M)))),function(){let e=null;return d||(e=(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-no-product-badge"},(0,j.__)("No Product Assigned","cartflows"))),e}(),y&&(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-global-checkout-error-badge"},(0,j.__)("Store Checkout - Remove selected checkout product","cartflows")),f&&(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-disabled-step-badge"},(0,j.__)("Disabled","cartflows")),p&&p.length>0&&(0,i.createElement)("div",{className:"wcf-node-warnings flex flex-wrap gap-1"},p.slice(0,2).map((e,t)=>(0,i.createElement)("span",{key:t,className:`wcf-badge wcf-badge--${"error"===e.severity?"error":"warning"} wcf-warning-pill !text-[10px] !px-2 !py-px`,title:e.message},e.message)),p.length>2&&(0,i.createElement)("span",{className:"wcf-badge wcf-warning-pill-more !text-[10px] !px-2 !py-px",title:p.slice(2).map(e=>e.message).join(", ")},"+",p.length-2))),(0,i.createElement)("div",{className:"wcf-custom-node-content--stats flex text-center justify-around items-center py-4 px-5"},(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-view"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,j.__)("Views","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},v())),(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-conversation"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,j.__)("Conversions","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==I?x():"-")),(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-revenue"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,j.__)("Revenue","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==I&&"landing"!==I?N():"-"))),m&&(0,i.createElement)("div",{className:"wcf-custom-node-content--stats-compact flex items-center justify-center gap-2 py-2 px-4 border-t border-gray-200 text-xs text-gray-600"},(0,i.createElement)("span",{className:"tabular-nums"},(0,i.createElement)("span",{className:"font-semibold text-gray-800"},v())," ",(0,i.createElement)("span",{className:"text-gray-400"},(0,j.__)("views","cartflows"))),"thankyou"!==I&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"text-gray-300"},"·"),(0,i.createElement)("span",{className:"tabular-nums"},(0,i.createElement)("span",{className:"font-semibold text-gray-800"},x())," ",(0,i.createElement)("span",{className:"text-gray-400"},(0,j.__)("conv.","cartflows")))),"thankyou"!==I&&"landing"!==I&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"text-gray-300"},"·"),(0,i.createElement)("span",{className:"font-semibold text-gray-800 tabular-nums"},N()))),"checkout"===I&&Array.isArray(h)&&h.length>0&&(0,i.createElement)(JP,{stepId:e?.step_id,flowId:e?.flow_id,flowType:e?.flow_type,bumps:h,compact:m}),(0,i.createElement)("div",{className:"wcf-custom-node-content--footer flex text-center justify-around items-center border-t border-gray-200 py-4 px-5"},(0,i.createElement)(Wo,{content:(0,j.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,j.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 inline-flex items-center justify-center rounded-md"},(0,i.createElement)(WP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:b?Fm():(0,j.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:b?"#!":r,target:b?void 0:"_blank",rel:"noreferrer","aria-label":(0,j.__)("Edit Page","cartflows"),"aria-disabled":b,tabIndex:b?-1:0,className:"wcf-canvas--edit-step p-2 inline-flex items-center justify-center rounded-md "+(b?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,i.createElement)(HP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:(0,j.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)(_,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,j.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 inline-flex items-center justify-center rounded-md"},(0,i.createElement)(QP,{className:"w-5 h-5"}))),(o?Object.keys(o):[]).map(t=>{const n=o[t],r=n?.class;let a=!1,c=!1;if((!wcfCartflowsPro()&&n?.pro||"abtest"===n?.slug&&!wcfCartflowsTypePro())&&(a=!0),wcfCartflowsPro()&&n?.pro&&"Activated"!==l&&(c=!0),"automation"===n?.slug&&"downsell"!==I&&"upsell"!==I&&"checkout"!==I)return null;const u=a||c,d=u?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary cursor-pointer "+("delete"===n?.slug?"hover:bg-field-background-error hover:text-button-danger":"hover:bg-badge-hover-gray hover:text-text-primary");let f=n?.text;return a?f=(0,j.sprintf)(
28 +// translators: %s: action name (e.g. Clone, A/B Test).
29 +// translators: %s: action name (e.g. Clone, A/B Test).
30 +(0,j.__)("Upgrade to CartFlows Pro to use %s.","cartflows"),n?.text):c&&(f=(0,j.sprintf)(
31 +// translators: %s: action name (e.g. Clone, A/B Test).
32 +// translators: %s: action name (e.g. Clone, A/B Test).
33 +(0,j.__)("Activate your CartFlows license to use %s.","cartflows"),n?.text)),(0,i.createElement)(Wo,{key:n?.slug,content:f,placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n?.link,className:`wcf-step__action-btn relative p-2 inline-flex items-center justify-center rounded-md ${r} ${d}`,"aria-label":n?.text,"data-id":e?.step_id,"data-control-id":e?.step_id,onClick:e=>{a||c?e.preventDefault():"#"===n?.link&&s&&s[n?.slug]&&(e.preventDefault(),s[n?.slug](e))},"data-action":n?.ajaxcall},function(e){let t="";switch(e){case"clone":t=(0,i.createElement)(BP,{className:"h-5 w-5"});break;case"delete":t=(0,i.createElement)(Po,{className:"h-5 w-5"});break;case"abtest":t=(0,i.createElement)(FP,{className:"h-5 w-5"});break;case"archived":t=(0,i.createElement)(YP,{className:"h-5 w-5"});break;case"winner":t=(0,i.createElement)(ZP,{className:"h-5 w-5"});break;case"automation":t=(0,i.createElement)(VP,{className:"h-5 w-5"});break;default:t=(0,i.createElement)(GP,{className:"h-5 w-5"})}return t}(n?.slug),u&&(0,i.createElement)(Mg,{className:"absolute -top-1 -right-1 w-4 h-4 text-brand-600 fill-brand-600","aria-label":(0,j.__)("Pro feature","cartflows")})))})))));var E}},KP=qP,eR=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o=r?"target":"source",a=r?"source":"target",[,s]=(0,i.useState)(!1),c=dg(),u=(0,_g.W6)(),[{license_status:d}]=l(),f=KP.createEventHandlers(e,c,u,s);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:o,position:jA.Left,id:"left",style:{background:"#555",border:"2px dotted #555",transition:"all 0.3s ease",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),(0,i.createElement)(UO,{type:"target",position:jA.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t&&n}),KP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},jP,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,f,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,void 0,void 0,e.is_locked),(0,i.createElement)("div",{className:"wcf-custom-node-label",title:e.label},e?.label),(0,i.createElement)(UO,{type:a,position:jA.Right,id:"right",style:{border:"2px dotted #555",transition:"all 0.3s ease",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,i.createElement)(UO,{type:"source",position:jA.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),tR="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOEgwVjEwWiIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjY0IiB5PSIxMCIgd2lkdGg9IjEwNyIgaGVpZ2h0PSI3IiByeD0iMSIgZmlsbD0iI2ZmZiIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQiIHI9IjQiIGZpbGw9IiNGRjNCMzAiLz48Y2lyY2xlIGN4PSIyNyIgY3k9IjE0IiByPSI0IiBmaWxsPSIjRkMwIi8+PGNpcmNsZSBjeD0iNDAiIGN5PSIxNCIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjIzIiB5PSIyMTkiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTgxLjY4NiAyMzIuNWgxLjM4M3YtMi4xMjJoMS4xNjRjMS41MDUgMCAyLjM4LS44OTggMi4zOC0yLjIwNSAwLTEuMzAxLS44NTktMi4yMTgtMi4zNDUtMi4yMThoLTIuNTgydjYuNTQ1Wm0xLjM4My0zLjIzMXYtMi4xODNoLjkzNGMuNzk5IDAgMS4xODUuNDM1IDEuMTg1IDEuMDg3IDAgLjY0OC0uMzg2IDEuMDk2LTEuMTc5IDEuMDk2aC0uOTRabTUuNjg2IDMuMzI0Yy43MjYgMCAxLjE5Ni0uMzE3IDEuNDM1LS43NzRoLjAzOXYuNjgxaDEuMjl2LTMuMzExYzAtMS4xNy0uOTktMS42NjItMi4wODMtMS42NjItMS4xNzYgMC0xLjk1LjU2Mi0yLjEzOCAxLjQ1N2wxLjI1OS4xMDNjLjA5My0uMzI2LjM4NC0uNTY2Ljg3My0uNTY2LjQ2MyAwIC43MjguMjMzLjcyOC42MzZ2LjAxOWMwIC4zMTctLjMzNS4zNTgtMS4xODkuNDQxLS45NzEuMDktMS44NDQuNDE2LTEuODQ0IDEuNTEyIDAgLjk3MS42OTQgMS40NjQgMS42MyAxLjQ2NFptLjM5LS45NGMtLjQxOSAwLS43MTktLjE5NS0uNzE5LS41NjkgMC0uMzgzLjMxNi0uNTcyLjc5Ni0uNjM5LjI5Ny0uMDQyLjc4My0uMTEyLjk0Ni0uMjIxdi41MjFjMCAuNTE1LS40MjUuOTA4LTEuMDIzLjkwOFptNC4wOTYgMi42ODhjMS4wMTMgMCAxLjU1LS41MTggMS44MjgtMS4zMWwxLjkwOC01LjQzNC0xLjQ0MS0uMDA2LTEuMDI2IDMuNjA1aC0uMDUybC0xLjAxNi0zLjYwNUg5Mi4wMWwxLjc2MSA1LjA1LS4wOC4yMDdjLS4xNzguNDYxLS41Mi40ODMtMSAuMzM2bC0uMzA3IDEuMDE2Yy4xOTUuMDgzLjUxMi4xNDEuODU3LjE0MVptMTIuMDE2LTguMzg2aC0xLjM3N3Y0LjExNmgtLjA1OGwtMi44MjUtNC4xMTZoLTEuMjE1djYuNTQ1aDEuMzg0di00LjEyaC4wNDhsMi44NDggNC4xMmgxLjE5NXYtNi41NDVabTMuMzM2IDYuNjQxYzEuNDg5IDAgMi40MTYtMS4wMiAyLjQxNi0yLjUzMSAwLTEuNTIyLS45MjctMi41MzgtMi40MTYtMi41MzgtMS40ODkgMC0yLjQxNiAxLjAxNi0yLjQxNiAyLjUzOCAwIDEuNTExLjkyNyAyLjUzMSAyLjQxNiAyLjUzMVptLjAwNi0xLjA1NWMtLjY4NyAwLTEuMDM4LS42MjktMS4wMzgtMS40ODYgMC0uODU2LjM1MS0xLjQ4OSAxLjAzOC0xLjQ4OS42NzUgMCAxLjAyNi42MzMgMS4wMjYgMS40ODkgMCAuODU3LS4zNTEgMS40ODYtMS4wMjYgMS40ODZabTQuMTQxLjk1OWgxLjQzOGwuODQ0LTMuMDg3aC4wNmwuODQ0IDMuMDg3aDEuNDQybDEuMzMyLTQuOTA5aC0xLjM3NGwtLjc0OCAzLjI3OWgtLjA0MWwtLjgwNi0zLjI3OWgtMS4zNTJsLS43OTIgMy4yOThoLS4wNDVsLS43NjEtMy4yOThoLTEuMzc3bDEuMzM2IDQuOTA5WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0yNC40OTUgMTUxLjMzM2EuNS41IDAgMCAxIC41LS41SDE3NmEuNS41IDAgMCAxIC41LjV2NmEuNS41IDAgMCAxLS41LjVIMjQuOTk1YS41LjUgMCAwIDEtLjUtLjV2LTZaTTI0LjQ5NSAxNjguNjY3YS41LjUgMCAwIDEgLjUtLjVIMTc2YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUgyNC45OTVhLjUuNSAwIDAgMS0uNS0uNXYtNlpNMjQuNDk1IDE4NmEuNS41IDAgMCAxIC41LS41SDY4LjI1YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUgyNC45OTVhLjUuNSAwIDAgMS0uNS0uNXYtNlpNNzguMzcgMTg2YS41LjUgMCAwIDEgLjUtLjVoNDMuMjU1YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUg3OC44N2EuNS41IDAgMCAxLS41LS41di02Wk0xMzIuMjQ1IDE4NmEuNS41IDAgMCAxIC41LS41SDE3NmEuNS41IDAgMCAxIC41LjV2NmEuNS41IDAgMCAxLS41LjVoLTQzLjI1NWEuNS41IDAgMCAxLS41LS41di02WiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjQjdDRkUyIi8+PHJlY3QgeD0iMjMuNSIgeT0iMjAyLjUiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIHJ4PSIuNSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjQ0NERUVEIi8+PHJlY3QgeD0iNDMuMzkiIHk9IjIwNCIgd2lkdGg9IjEzMy42MSIgaGVpZ2h0PSIyLjY2NyIgcng9IjEiIGZpbGw9IiNCN0NGRTIiLz48ZyBjbGlwLXBhdGg9InVybCgjYSkiIGZpbGw9IiMyMjcxQjEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjQiPjxwYXRoIGQ9Im05OS4wMDUgODIuMzY4LjQ5NS40OTYuNDk1LS40OTYgMTIuNDAzLTEyLjQwN2ExLjY0OCAxLjY0OCAwIDAgMSAyLjgxMSAxLjE2NGMwIC40MzctLjE3My44NTYtLjQ4MiAxLjE2NGwtMTQuMDYzIDE0LjA2M2ExLjY0MyAxLjY0MyAwIDAgMS0yLjMyOCAwbC03LjAzMi03LjAzMWExLjY0OSAxLjY0OSAwIDAgMSAwLTIuMzMgMS42NDQgMS42NDQgMCAwIDEgMi4zMyAwbDUuMzcgNS4zNzdaIi8+PHBhdGggZD0ibTcwLjIyNiA1Mi4yMDYtLjEzMi0uNTMxaC01Ljc1YTEuNjQ0IDEuNjQ0IDAgMCAxIDAtMy4yODdINzEuMzc1YTEuNjQzIDEuNjQzIDAgMCAxIDEuNTk0IDEuMjQ1bDEuODk5IDcuNi4xMzIuNTNIMTI5Ljk2OGExLjY0MyAxLjY0MyAwIDAgMSAxLjYxNCAxLjk0NmwtNy4wMzEgMzcuNWExLjY0NSAxLjY0NSAwIDAgMS0xLjYxNCAxLjM0MUg4MC43NTFhMS42NDQgMS42NDQgMCAwIDEtMS42MTUtMS4zNDFsLTcuMDIxLTM3LjQzLS4wMDQtLjAyLS4wMDUtLjAyLTEuODgtNy41MzNabTExLjc4MSA0Mi40ODYuMTA3LjU3aDM5LjQ1OWwuMTA3LS41NyA2LjE1NS0zMi44MTMuMTU1LS44MjlINzUuNjk3bC4xNTYuODI5IDYuMTU0IDMyLjgxM1ptLTIuNzA0IDcuNzk5YTguNjc1IDguNjc1IDAgMSAxIDEyLjI2OSAxMi4yNjcgOC42NzUgOC42NzUgMCAwIDEtMTIuMjY5LTEyLjI2N1ptMzIuODEzIDBhOC42NzQgOC42NzQgMCAxIDEgMTIuMjY4IDEyLjI2NiA4LjY3NCA4LjY3NCAwIDAgMS0xMi4yNjgtMTIuMjY2Wm0tMjIuODY5IDkuOTQ0YTUuMzkgNS4zOSAwIDAgMC0zLjgxLTkuMTk4IDUuMzg5IDUuMzg5IDAgMCAwLTMuODA5IDkuMTk4IDUuMzg4IDUuMzg4IDAgMCAwIDcuNjE5IDBabTMyLjgxMyAwYTUuMzkgNS4zOSAwIDAgMC0zLjgxLTkuMTk4IDUuMzkxIDUuMzkxIDAgMCAwLTUuMzg4IDUuMzg4IDUuMzkgNS4zOSAwIDAgMCA5LjE5OCAzLjgxWiIvPjwvZz48cmVjdCB4PSI1MCIgeT0iMTMzIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg2MiA0MykiIGQ9Ik0wIDBoNzV2NzVIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=",nR=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o=r?"target":"source",a=r?"source":"target",[,s]=(0,i.useState)(!1),c=dg(),u=(0,_g.W6)(),[{license_status:d}]=l(),[{is_flow_instant_checkout:f}]=Nm(),p=KP.createEventHandlers(e,c,u,s);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:o,position:jA.Left,id:"left",style:{background:"#555",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),(0,i.createElement)(UO,{type:"target",position:jA.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t&&n}),KP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},tR,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,p,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,e.bumps,f,e.is_locked,e.has_store_checkout_product_warning),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e?.label),(0,i.createElement)(UO,{type:a,position:jA.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,i.createElement)(UO,{type:"source",position:jA.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),rR="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFRkVGRUYiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48Y2lyY2xlIGN4PSI5OS44NTIiIGN5PSI5Mi4xMDEiIHI9IjM4LjM1MiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2UtbWl0ZXJsaW1pdD0iMS44NjIiIHN0cm9rZS1kYXNoYXJyYXk9IjIgMyIvPjxjaXJjbGUgY3g9Ijk5Ljg1MiIgY3k9IjkyLjEwMSIgcj0iMzEuNTQzIiBmaWxsPSIjRjZGQUZGIi8+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBkPSJNMTE0LjUgNjMuMzQ3djEyLjEzYTEuNjUgMS42NSAwIDEgMCAzLjMwMiAwdi0xMi4xM2w0LjA4OCA0LjA4OWExLjY1MiAxLjY1MiAwIDEgMCAyLjMzNy0yLjMzN2wtNi45MDctNi45MDdhMS42NDEgMS42NDEgMCAwIDAtMS4xNjktLjQ4NSAxLjY0NCAxLjY0NCAwIDAgMC0xLjE2OC40ODVoLS4wMDFsLTYuOTA2IDYuOTA3YTEuNjUyIDEuNjUyIDAgMSAwIDIuMzM3IDIuMzM3bDQuMDg3LTQuMDlabTE0LjMyMi04LjU5OWExNy45MiAxNy45MiAwIDEgMS0yNS4zNDMgMjUuMzQxIDE3LjkyIDE3LjkyIDAgMCAxIDI1LjM0My0yNS4zNFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIvPjwvZz48ZyBjbGlwLXBhdGg9InVybCgjYikiPjxwYXRoIGQ9Ik02OC42NzUgMTE2LjAyOWEyLjUxIDIuNTEgMCAwIDEgMi41MDgtMi41MDlINzYuMmEyLjUxIDIuNTEgMCAwIDEgMi41MDkgMi41MDl2Ny41MjZhMi41MSAyLjUxIDAgMCAxLTIuNTA5IDIuNTA4aC01LjAxN2EyLjUxIDIuNTEgMCAwIDEtMi41MDgtMi41MDh2LTcuNTI2Wm0xMi41NDMtMTAuMDM0YTIuNTA3IDIuNTA3IDAgMCAxIDIuNTA4LTIuNTA5aDUuMDE3YTIuNTA3IDIuNTA3IDAgMCAxIDIuNTA5IDIuNTA5djE3LjU2YTIuNTEgMi41MSAwIDAgMS0yLjUwOSAyLjUwOGgtNS4wMTdhMi41MSAyLjUxIDAgMCAxLTIuNTA4LTIuNTA4di0xNy41NlpNOTMuNzYgOTMuNDUyYTIuNTA5IDIuNTA5IDAgMCAxIDIuNTA5LTIuNTA5aDUuMDE3YTIuNTEgMi41MSAwIDAgMSAyLjUwOSAyLjUwOXYzMC4xMDNhMi41MTIgMi41MTIgMCAwIDEtMi41MDkgMi41MDhoLTUuMDE3YTIuNTEgMi41MSAwIDAgMS0yLjUwOS0yLjUwOFY5My40NTJaIiBmaWxsPSIjMjI3MUIxIi8+PC9nPjxyZWN0IHg9Ijg4LjQ5NyIgeT0iMTA5Ljc2NSIgd2lkdGg9IjI1LjIzNSIgaGVpZ2h0PSIyNS4yMzUiIHJ4PSIxMi42MTciIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTAxLjExNCAxMTEuODY4YTEwLjUxNyAxMC41MTcgMCAwIDAtOS43MTQgNi40OTEgMTAuNTEzIDEwLjUxMyAwIDEgMCA5LjcxNC02LjQ5MVptMCAxOC45MjZhOC40MTMgOC40MTMgMCAwIDEtNy43NzEtNS4xOTIgOC40MTEgOC40MTEgMCAxIDEgNy43NzEgNS4xOTJaIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTEwMS4xMTQgMTIxLjMzMWMtMi4xMDMgMC0yLjEwMy0uNjYyLTIuMTAzLTEuMDUxIDAtLjM4OS43MzYtMS4wNTIgMi4xMDMtMS4wNTIgMS4zNjcgMCAxLjQ2MS42NzMgMS40NzIgMS4wNTJoMi4xMDNhMy4xNSAzLjE1IDAgMCAwLTIuNTI0LTMuMDI4di0xLjE3OGgtMi4xMDJ2MS4xNDZjLTIuMTAzLjM0Ny0zLjE1NSAxLjcwMy0zLjE1NSAzLjA2IDAgMS4xNzcuNTQ3IDMuMTU0IDQuMjA2IDMuMTU0IDIuMTAzIDAgMi4xMDMuNzE1IDIuMTAzIDEuMDUyIDAgLjMzNi0uNjUyIDEuMDUxLTIuMTAzIDEuMDUxLTEuOTM1IDAtMi4xMDMtLjkwNC0yLjEwMy0xLjA1MWgtMi4xMDNjMCAuOTY3LjY5NCAyLjY4MSAzLjE1NSAzLjA3djEuMTM1aDIuMTAydi0xLjEzNWMyLjEwMy0uMzU4IDMuMTU1LTEuNzE0IDMuMTU1LTMuMDcgMC0xLjE3OC0uNTQ3LTMuMTU1LTQuMjA2LTMuMTU1WiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjUwIiB5PSIxNTAiIHdpZHRoPSIxMDAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiMyMjcxQjEiLz48cmVjdCB4PSIyMyIgeT0iMTY0IiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iNzAiIHk9IjE3OCIgd2lkdGg9IjYwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iMjMiIHk9IjE5NyIgd2lkdGg9IjE1NCIgaGVpZ2h0PSIyMCIgcng9IjIiIGZpbGw9IiMyMjcxQjEiLz48cGF0aCBkPSJtNzMuNCAyMTAuNS40ODYtMS40OTNoMi4zNjJsLjQ4NiAxLjQ5M2gxLjQ4M2wtMi4yNTYtNi41NDVoLTEuNzg0bC0yLjI2IDYuNTQ1aDEuNDg0Wm0uODM4LTIuNTczLjgwNS0yLjQ3N2guMDUybC44MDUgMi40NzdoLTEuNjYyWm02LjczIDIuNjY5YzEuMzA4IDAgMi4xMy0uNzY3IDIuMTkzLTEuODk1aC0xLjI4NGMtLjA4LjUyNC0uNDI1LjgxOC0uODkyLjgxOC0uNjM2IDAtMS4wNDgtLjUzNC0xLjA0OC0xLjQ3NCAwLS45MjYuNDE1LTEuNDU3IDEuMDQ4LTEuNDU3LjQ5OCAwIC44MTguMzI5Ljg5Mi44MThoMS4yODRjLS4wNTctMS4xMzQtLjkxNy0xLjg3OS0yLjE5OC0xLjg3OS0xLjQ5IDAtMi40MSAxLjAzMi0yLjQxIDIuNTM4IDAgMS40OTIuOTA0IDIuNTMxIDIuNDE2IDIuNTMxWm01LjI4MyAwYzEuMzA3IDAgMi4xMjktLjc2NyAyLjE5My0xLjg5NWgtMS4yODVjLS4wOC41MjQtLjQyNS44MTgtLjg5Mi44MTgtLjYzNiAwLTEuMDQ4LS41MzQtMS4wNDgtMS40NzQgMC0uOTI2LjQxNS0xLjQ1NyAxLjA0OC0xLjQ1Ny40OTkgMCAuODE4LjMyOS44OTIuODE4aDEuMjg1Yy0uMDU4LTEuMTM0LS45MTgtMS44NzktMi4yLTEuODc5LTEuNDg5IDAtMi40MSAxLjAzMi0yLjQxIDIuNTM4IDAgMS40OTIuOTA1IDIuNTMxIDIuNDE3IDIuNTMxWm01LjMwMSAwYzEuMjE1IDAgMi4wMzMtLjU5MSAyLjIyNS0xLjUwMmwtMS4yNi0uMDgzYy0uMTM3LjM3NC0uNDg4LjU2OS0uOTQyLjU2OS0uNjggMC0xLjExMi0uNDUxLTEuMTEyLTEuMTgzdi0uMDAzaDMuMzQzdi0uMzc0YzAtMS42NjgtMS4wMS0yLjQ5My0yLjMwOC0yLjQ5My0xLjQ0NCAwLTIuMzggMS4wMjYtMi4zOCAyLjU0MSAwIDEuNTU2LjkyMyAyLjUyOCAyLjQzNCAyLjUyOFptLTEuMDktMy4wNDZhMS4wMzcgMS4wMzcgMCAwIDEgMS4wNTktMS4wMDdjLjU5IDAgMSAuNDIyIDEuMDAzIDEuMDA3aC0yLjA2MVptNC4yMzIgNC43OTFoMS4zNjJ2LTIuNjI3aC4wNDFjLjE4OS40MDkuNjAxLjg2NiAxLjM5NC44NjYgMS4xMTggMCAxLjk5LS44ODUgMS45OS0yLjUyOCAwLTEuNjg4LS45MS0yLjUyNS0xLjk4Ny0yLjUyNS0uODIyIDAtMS4yMTUuNDg5LTEuMzk3Ljg4OGgtLjA2di0uODI0aC0xLjM0M3Y2Ljc1Wm0xLjMzMy00LjI5NmMwLS44NzUuMzctMS40MzUgMS4wMzItMS40MzUuNjc1IDAgMS4wMzMuNTg1IDEuMDMzIDEuNDM1IDAgLjg1Ny0uMzY1IDEuNDUxLTEuMDMzIDEuNDUxLS42NTUgMC0xLjAzMi0uNTc1LTEuMDMyLTEuNDUxWm02Ljk3NC0yLjQ1NGgtLjkyNHYtMS4xNzZoLTEuMzYxdjEuMTc2aC0uNjcydjEuMDIzaC42NzJ2Mi41NTZjLS4wMDcuOTYyLjY0OCAxLjQzOSAxLjYzNiAxLjM5Ny4zNTEtLjAxMy42MDEtLjA4My43MzgtLjEyOGwtLjIxNC0xLjAxM2MtLjA2Ny4wMTMtLjIxMS4wNDUtLjMzOS4wNDUtLjI3MSAwLS40Ni0uMTAyLS40Ni0uNDh2LTIuMzc3aC45MjR2LTEuMDIzWm05LjAxIDEuNjM2YzAtMi4xNDEtMS4zMjktMy4zNjItMy4wNjUtMy4zNjItMS43NDUgMC0zLjA2NSAxLjIyMS0zLjA2NSAzLjM2MiAwIDIuMTMyIDEuMzIgMy4zNjIgMy4wNjUgMy4zNjIgMS43MzYgMCAzLjA2NS0xLjIyIDMuMDY1LTMuMzYyWm0tMS40MDMgMGMwIDEuMzg3LS42NTggMi4xMzgtMS42NjIgMi4xMzgtMS4wMDcgMC0xLjY2Mi0uNzUxLTEuNjYyLTIuMTM4cy42NTUtMi4xMzggMS42NjItMi4xMzhjMS4wMDQgMCAxLjY2Mi43NTEgMS42NjIgMi4xMzhabTUuMDQzLTEuNjM2aC0uOTc1di0uMzI5YzAtLjMzMy4xMzQtLjUyOC41MzMtLjUyOC4xNjMgMCAuMzMuMDM2LjQzOC4wNzFsLjI0LTEuMDIzYTMuNTg5IDMuNTg5IDAgMCAwLS45NjItLjEzNGMtLjkyNCAwLTEuNjExLjUyMS0xLjYxMSAxLjU4OHYuMzU1aC0uNjkzdjEuMDIzaC42OTN2My44ODZoMS4zNjJ2LTMuODg2aC45NzV2LTEuMDIzWm0zLjQ3MSAwaC0uOTc1di0uMzI5YzAtLjMzMy4xMzUtLjUyOC41MzQtLjUyOC4xNjMgMCAuMzI5LjAzNi40MzguMDcxbC4yNC0xLjAyM2EzLjYwMyAzLjYwMyAwIDAgMC0uOTYyLS4xMzRjLS45MjQgMC0xLjYxMS41MjEtMS42MTEgMS41ODh2LjM1NWgtLjY5NHYxLjAyM2guNjk0djMuODg2aDEuMzYxdi0zLjg4NmguOTc1di0xLjAyM1ptMi44OTMgNS4wMDVjMS4yMTUgMCAyLjAzMy0uNTkxIDIuMjI1LTEuNTAybC0xLjI1OS0uMDgzYy0uMTM4LjM3NC0uNDg5LjU2OS0uOTQzLjU2OS0uNjgxIDAtMS4xMTItLjQ1MS0xLjExMi0xLjE4M3YtLjAwM2gzLjM0M3YtLjM3NGMwLTEuNjY4LTEuMDEtMi40OTMtMi4zMDgtMi40OTMtMS40NDUgMC0yLjM4MSAxLjAyNi0yLjM4MSAyLjU0MSAwIDEuNTU2LjkyNCAyLjUyOCAyLjQzNSAyLjUyOFptLTEuMDg5LTMuMDQ2YTEuMDM2IDEuMDM2IDAgMCAxIDEuMDU3LTEuMDA3Yy41OTIgMCAxLjAwMS40MjIgMS4wMDQgMS4wMDdoLTIuMDYxWm00LjIzMSAyLjk1aDEuMzYydi0yLjc3N2MwLS42MDQuNDQxLTEuMDIgMS4wNDItMS4wMi4xODggMCAuNDQ3LjAzMi41NzUuMDc0di0xLjIwOGEyLjAzMyAyLjAzMyAwIDAgMC0uNDI4LS4wNDhjLS41NSAwLTEuMDAxLjMxOS0xLjE4LjkyNmgtLjA1MXYtLjg1NmgtMS4zMnY0LjkwOVoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNNzkuOTIxIDIzMy41aDEuMDc2di0xLjgwNWguNzg2bC45NjQgMS44MDVoMS4xODlsLTEuMDgyLTEuOTc5Yy41OC0uMjQ4LjktLjc1My45LTEuNDQ5IDAtMS4wMTItLjY2OS0xLjY2My0xLjgyNS0xLjY2M2gtMi4wMDh2NS4wOTFabTEuMDc2LTIuNjd2LTEuNTQxaC43MjZjLjYyMiAwIC45MjIuMjc2LjkyMi43ODMgMCAuNTA1LS4zLjc1OC0uOTE3Ljc1OGgtLjczWm01LjE3NiAyLjc0NWMuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45NzktLjA2NGMtLjEwNy4yOS0uMzguNDQyLS43MzMuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTkgMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjMtLjc4M2MuNDYgMCAuNzc4LjMyOC43OC43ODNoLTEuNjAzWm0zLjI5LTEuNTI0djMuOTljMCAuMjg4LS4xMi40MzItLjQ2MS40MzItLjA0NSAwLS4wODUgMC0uMTQtLjAwNXYuODI4Yy4wNzcuMDAyLjE0LjAwNS4yMTQuMDA1LjkgMCAxLjQ0Ny0uMzU4IDEuNDQ3LTEuMjQzdi00LjAwN2gtMS4wNlptLjUyOC0uNDkyYy4zMTYgMCAuNTc0LS4yNDEuNTc0LS41MzcgMC0uMjk0LS4yNTgtLjUzNS0uNTc0LS41MzUtLjMxMyAwLS41NzIuMjQxLS41NzIuNTM1IDAgLjI5Ni4yNTkuNTM3LjU3Mi41MzdabTMuMTIgNC4zODVjLjk0NSAwIDEuNTgxLS40NiAxLjczLTEuMTY5bC0uOTgtLjA2NGMtLjEwNi4yOS0uMzguNDQyLS43MzIuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTggMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjItLjc4M2MuNDYgMCAuNzc4LjMyOC43OC43ODNoLTEuNjAzWm01LjAxNiAyLjM2OWMxLjAxNyAwIDEuNjU1LS41OTcgMS43MDUtMS40NzVoLTFjLS4wNjEuNDA4LS4zMy42MzctLjY5My42MzctLjQ5NCAwLS44MTUtLjQxNS0uODE1LTEuMTQ2IDAtLjcyMS4zMjMtMS4xMzQuODE1LTEuMTM0LjM4OCAwIC42MzcuMjU2LjY5NC42MzdoMWMtLjA0Ni0uODgzLS43MTQtMS40NjItMS43MTEtMS40NjItMS4xNTkgMC0xLjg3NC44MDMtMS44NzQgMS45NzQgMCAxLjE2MS43MDMgMS45NjkgMS44NzkgMS45NjlabTQuNDE0LTMuODkzaC0uNzE4di0uOTE1aC0xLjA2di45MTVoLS41MjF2Ljc5NWguNTIydjEuOTg5Yy0uMDA1Ljc0OC41MDQgMS4xMTkgMS4yNzIgMS4wODYuMjc0LS4wMS40NjgtLjA2NC41NzUtLjA5OWwtLjE2Ny0uNzg4Yy0uMDUyLjAxLS4xNjQuMDM1LS4yNjMuMDM1LS4yMTIgMC0uMzU4LS4wOC0uMzU4LS4zNzN2LTEuODVoLjcxOHYtLjc5NVptNy4wMDggMS4yNzNjMC0xLjY2Ni0xLjAzNC0yLjYxNi0yLjM4NC0yLjYxNi0xLjM1NyAwLTIuMzg0Ljk1LTIuMzg0IDIuNjE2IDAgMS42NTggMS4wMjcgMi42MTUgMi4zODQgMi42MTUgMS4zNSAwIDIuMzg0LS45NSAyLjM4NC0yLjYxNVptLTEuMDkxIDBjMCAxLjA3OC0uNTEyIDEuNjYzLTEuMjkzIDEuNjYzLS43ODMgMC0xLjI5Mi0uNTg1LTEuMjkyLTEuNjYzIDAtMS4wNzkuNTA5LTEuNjYzIDEuMjkyLTEuNjYzLjc4MSAwIDEuMjkzLjU4NCAxLjI5MyAxLjY2M1ptMy45MjItMS4yNzNoLS43NTh2LS4yNTZjMC0uMjU5LjEwNC0uNDEuNDE1LS40MS4xMjcgMCAuMjU2LjAyNy4zNC4wNTRsLjE4Ny0uNzk1YTIuNzc4IDIuNzc4IDAgMCAwLS43NDgtLjEwNWMtLjcxOSAwLTEuMjUzLjQwNi0xLjI1MyAxLjIzNnYuMjc2aC0uNTR2Ljc5NWguNTR2My4wMjNoMS4wNTl2LTMuMDIzaC43NTh2LS43OTVabTIuNyAwaC0uNzU4di0uMjU2YzAtLjI1OS4xMDQtLjQxLjQxNS0uNDEuMTI3IDAgLjI1Ni4wMjcuMzQxLjA1NGwuMTg2LS43OTVhMi43NzggMi43NzggMCAwIDAtLjc0OC0uMTA1Yy0uNzE5IDAtMS4yNTMuNDA2LTEuMjUzIDEuMjM2di4yNzZoLS41NHYuNzk1aC41NHYzLjAyM2gxLjA1OXYtMy4wMjNoLjc1OHYtLjc5NVptMi4yNSAzLjg5M2MuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45NzktLjA2NGMtLjEwNy4yOS0uMzguNDQyLS43MzMuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTggMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjItLjc4M2MuNDYgMCAuNzc4LjMyOC43ODEuNzgzaC0xLjYwM1ptMy4yOTEgMi4yOTRoMS4wNTl2LTIuMTZjMC0uNDcuMzQzLS43OTMuODEtLjc5My4xNDcgMCAuMzQ4LjAyNS40NDguMDU3di0uOTRhMS42MjcgMS42MjcgMCAwIDAtLjMzNC0uMDM3Yy0uNDI3IDAtLjc3OC4yNDktLjkxNy43MjFoLS4wNHYtLjY2NmgtMS4wMjZ2My44MThaIiBmaWxsPSIjQTFBMUExIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5Ny43MzMgNDkpIiBkPSJNMCAwaDM2LjgzN3YzNi44MzdIMHoiLz48L2NsaXBQYXRoPjxjbGlwUGF0aCBpZD0iYiI+PHBhdGggZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjguMzA5IDg5LjU3OCkiIGQ9Ik0wIDBoMzcuODUydjM3Ljg1MkgweiIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==",oR="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFRkVGRUYiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48cmVjdCB4PSI1MCIgeT0iMTUxIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iMjMiIHk9IjE2NSIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjcwIiB5PSIxNzgiIHdpZHRoPSI2MCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjIzIiB5PSIxOTciIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0ibTczLjQgMjEwIC40ODYtMS40OTNoMi4zNjJsLjQ4NiAxLjQ5M2gxLjQ4M2wtMi4yNTYtNi41NDVoLTEuNzg0TDcxLjkxNyAyMTBoMS40ODRabS44MzgtMi41NzMuODA1LTIuNDc3aC4wNTJsLjgwNSAyLjQ3N2gtMS42NjJabTYuNzMgMi42NjljMS4zMDggMCAyLjEzLS43NjcgMi4xOTMtMS44OTVoLTEuMjg0Yy0uMDguNTI0LS40MjUuODE4LS44OTIuODE4LS42MzYgMC0xLjA0OC0uNTM0LTEuMDQ4LTEuNDc0IDAtLjkyNi40MTUtMS40NTcgMS4wNDgtMS40NTcuNDk4IDAgLjgxOC4zMjkuODkyLjgxOGgxLjI4NGMtLjA1Ny0xLjEzNC0uOTE3LTEuODc5LTIuMTk4LTEuODc5LTEuNDkgMC0yLjQxIDEuMDMyLTIuNDEgMi41MzggMCAxLjQ5Mi45MDQgMi41MzEgMi40MTYgMi41MzFabTUuMjgzIDBjMS4zMDcgMCAyLjEyOS0uNzY3IDIuMTkzLTEuODk1aC0xLjI4NWMtLjA4LjUyNC0uNDI1LjgxOC0uODkyLjgxOC0uNjM2IDAtMS4wNDgtLjUzNC0xLjA0OC0xLjQ3NCAwLS45MjYuNDE1LTEuNDU3IDEuMDQ4LTEuNDU3LjQ5OSAwIC44MTguMzI5Ljg5Mi44MThoMS4yODVjLS4wNTgtMS4xMzQtLjkxOC0xLjg3OS0yLjItMS44NzktMS40ODkgMC0yLjQxIDEuMDMyLTIuNDEgMi41MzggMCAxLjQ5Mi45MDUgMi41MzEgMi40MTcgMi41MzFabTUuMzAxIDBjMS4yMTUgMCAyLjAzMy0uNTkxIDIuMjI1LTEuNTAybC0xLjI2LS4wODNjLS4xMzcuMzc0LS40ODguNTY5LS45NDIuNTY5LS42OCAwLTEuMTEyLS40NTEtMS4xMTItMS4xODN2LS4wMDNoMy4zNDN2LS4zNzRjMC0xLjY2OC0xLjAxLTIuNDkzLTIuMzA4LTIuNDkzLTEuNDQ0IDAtMi4zOCAxLjAyNi0yLjM4IDIuNTQxIDAgMS41NTYuOTIzIDIuNTI4IDIuNDM0IDIuNTI4Wm0tMS4wOS0zLjA0NmExLjAzNyAxLjAzNyAwIDAgMSAxLjA1OS0xLjAwN2MuNTkgMCAxIC40MjIgMS4wMDMgMS4wMDdoLTIuMDYxWm00LjIzMiA0Ljc5MWgxLjM2MnYtMi42MjdoLjA0MWMuMTg5LjQwOS42MDEuODY2IDEuMzk0Ljg2NiAxLjExOCAwIDEuOTktLjg4NSAxLjk5LTIuNTI4IDAtMS42ODgtLjkxLTIuNTI1LTEuOTg3LTIuNTI1LS44MjIgMC0xLjIxNS40ODktMS4zOTcuODg4aC0uMDZ2LS44MjRoLTEuMzQzdjYuNzVabTEuMzMzLTQuMjk2YzAtLjg3NS4zNy0xLjQzNSAxLjAzMi0xLjQzNS42NzUgMCAxLjAzMy41ODUgMS4wMzMgMS40MzUgMCAuODU3LS4zNjUgMS40NTEtMS4wMzMgMS40NTEtLjY1NSAwLTEuMDMyLS41NzUtMS4wMzItMS40NTFabTYuOTc0LTIuNDU0aC0uOTI0di0xLjE3NmgtMS4zNjF2MS4xNzZoLS42NzJ2MS4wMjNoLjY3MnYyLjU1NmMtLjAwNy45NjIuNjQ4IDEuNDM5IDEuNjM2IDEuMzk3LjM1MS0uMDEzLjYwMS0uMDgzLjczOC0uMTI4bC0uMjE0LTEuMDEzYy0uMDY3LjAxMy0uMjExLjA0NS0uMzM5LjA0NS0uMjcxIDAtLjQ2LS4xMDItLjQ2LS40OHYtMi4zNzdoLjkyNHYtMS4wMjNabTkuMDEgMS42MzZjMC0yLjE0MS0xLjMyOS0zLjM2Mi0zLjA2NS0zLjM2Mi0xLjc0NSAwLTMuMDY1IDEuMjIxLTMuMDY1IDMuMzYyIDAgMi4xMzIgMS4zMiAzLjM2MiAzLjA2NSAzLjM2MiAxLjczNiAwIDMuMDY1LTEuMjIgMy4wNjUtMy4zNjJabS0xLjQwMyAwYzAgMS4zODctLjY1OCAyLjEzOC0xLjY2MiAyLjEzOC0xLjAwNyAwLTEuNjYyLS43NTEtMS42NjItMi4xMzhzLjY1NS0yLjEzOCAxLjY2Mi0yLjEzOGMxLjAwNCAwIDEuNjYyLjc1MSAxLjY2MiAyLjEzOFptNS4wNDMtMS42MzZoLS45NzV2LS4zMjljMC0uMzMzLjEzNC0uNTI4LjUzMy0uNTI4LjE2MyAwIC4zMy4wMzYuNDM4LjA3MWwuMjQtMS4wMjNhMy41ODkgMy41ODkgMCAwIDAtLjk2Mi0uMTM0Yy0uOTI0IDAtMS42MTEuNTIxLTEuNjExIDEuNTg4di4zNTVoLS42OTN2MS4wMjNoLjY5M1YyMTBoMS4zNjJ2LTMuODg2aC45NzV2LTEuMDIzWm0zLjQ3MSAwaC0uOTc1di0uMzI5YzAtLjMzMy4xMzUtLjUyOC41MzQtLjUyOC4xNjMgMCAuMzI5LjAzNi40MzguMDcxbC4yNC0xLjAyM2EzLjYwMyAzLjYwMyAwIDAgMC0uOTYyLS4xMzRjLS45MjQgMC0xLjYxMS41MjEtMS42MTEgMS41ODh2LjM1NWgtLjY5NHYxLjAyM2guNjk0VjIxMGgxLjM2MXYtMy44ODZoLjk3NXYtMS4wMjNabTIuODkzIDUuMDA1YzEuMjE1IDAgMi4wMzMtLjU5MSAyLjIyNS0xLjUwMmwtMS4yNTktLjA4M2MtLjEzOC4zNzQtLjQ4OS41NjktLjk0My41NjktLjY4MSAwLTEuMTEyLS40NTEtMS4xMTItMS4xODN2LS4wMDNoMy4zNDN2LS4zNzRjMC0xLjY2OC0xLjAxLTIuNDkzLTIuMzA4LTIuNDkzLTEuNDQ1IDAtMi4zODEgMS4wMjYtMi4zODEgMi41NDEgMCAxLjU1Ni45MjQgMi41MjggMi40MzUgMi41MjhabS0xLjA4OS0zLjA0NmExLjAzNiAxLjAzNiAwIDAgMSAxLjA1Ny0xLjAwN2MuNTkyIDAgMS4wMDEuNDIyIDEuMDA0IDEuMDA3aC0yLjA2MVptNC4yMzEgMi45NWgxLjM2MnYtMi43NzdjMC0uNjA0LjQ0MS0xLjAyIDEuMDQyLTEuMDIuMTg4IDAgLjQ0Ny4wMzIuNTc1LjA3NHYtMS4yMDhhMi4wMzMgMi4wMzMgMCAwIDAtLjQyOC0uMDQ4Yy0uNTUgMC0xLjAwMS4zMTktMS4xOC45MjZoLS4wNTF2LS44NTZoLTEuMzJWMjEwWiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik03OS45MjEgMjMzLjVoMS4wNzZ2LTEuODA1aC43ODZsLjk2NCAxLjgwNWgxLjE4OWwtMS4wODItMS45NzljLjU4LS4yNDguOS0uNzUzLjktMS40NDkgMC0xLjAxMi0uNjY5LTEuNjYzLTEuODI1LTEuNjYzaC0yLjAwOHY1LjA5MVptMS4wNzYtMi42N3YtMS41NDFoLjcyNmMuNjIyIDAgLjkyMi4yNzYuOTIyLjc4MyAwIC41MDUtLjMuNzU4LS45MTcuNzU4aC0uNzNabTUuMTc2IDIuNzQ1Yy45NDUgMCAxLjU4MS0uNDYgMS43My0xLjE2OWwtLjk3OS0uMDY0Yy0uMTA3LjI5LS4zOC40NDItLjczMy40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOSAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMy0uNzgzYy40NiAwIC43NzguMzI4Ljc4Ljc4M2gtMS42MDNabTMuMjktMS41MjR2My45OWMwIC4yODgtLjEyLjQzMi0uNDYxLjQzMi0uMDQ1IDAtLjA4NSAwLS4xNC0uMDA1di44MjhjLjA3Ny4wMDIuMTQuMDA1LjIxNC4wMDUuOSAwIDEuNDQ3LS4zNTggMS40NDctMS4yNDN2LTQuMDA3aC0xLjA2Wm0uNTI4LS40OTJjLjMxNiAwIC41NzQtLjI0MS41NzQtLjUzNyAwLS4yOTQtLjI1OC0uNTM1LS41NzQtLjUzNS0uMzEzIDAtLjU3Mi4yNDEtLjU3Mi41MzUgMCAuMjk2LjI1OS41MzcuNTcyLjUzN1ptMy4xMiA0LjM4NWMuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45OC0uMDY0Yy0uMTA2LjI5LS4zOC40NDItLjczMi40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOCAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMi0uNzgzYy40NiAwIC43NzguMzI4Ljc4Ljc4M2gtMS42MDNabTUuMDE2IDIuMzY5YzEuMDE3IDAgMS42NTUtLjU5NyAxLjcwNS0xLjQ3NWgtMWMtLjA2MS40MDgtLjMzLjYzNy0uNjkzLjYzNy0uNDk0IDAtLjgxNS0uNDE1LS44MTUtMS4xNDYgMC0uNzIxLjMyMy0xLjEzNC44MTUtMS4xMzQuMzg4IDAgLjYzNy4yNTYuNjk0LjYzN2gxYy0uMDQ2LS44ODMtLjcxNC0xLjQ2Mi0xLjcxMS0xLjQ2Mi0xLjE1OSAwLTEuODc0LjgwMy0xLjg3NCAxLjk3NCAwIDEuMTYxLjcwMyAxLjk2OSAxLjg3OSAxLjk2OVptNC40MTQtMy44OTNoLS43MTh2LS45MTVoLTEuMDZ2LjkxNWgtLjUyMXYuNzk1aC41MjJ2MS45ODljLS4wMDUuNzQ4LjUwNCAxLjExOSAxLjI3MiAxLjA4Ni4yNzQtLjAxLjQ2OC0uMDY0LjU3NS0uMDk5bC0uMTY3LS43ODhjLS4wNTIuMDEtLjE2NC4wMzUtLjI2My4wMzUtLjIxMiAwLS4zNTgtLjA4LS4zNTgtLjM3M3YtMS44NWguNzE4di0uNzk1Wm03LjAwOCAxLjI3M2MwLTEuNjY2LTEuMDM0LTIuNjE2LTIuMzg0LTIuNjE2LTEuMzU3IDAtMi4zODQuOTUtMi4zODQgMi42MTYgMCAxLjY1OCAxLjAyNyAyLjYxNSAyLjM4NCAyLjYxNSAxLjM1IDAgMi4zODQtLjk1IDIuMzg0LTIuNjE1Wm0tMS4wOTEgMGMwIDEuMDc4LS41MTIgMS42NjMtMS4yOTMgMS42NjMtLjc4MyAwLTEuMjkyLS41ODUtMS4yOTItMS42NjMgMC0xLjA3OS41MDktMS42NjMgMS4yOTItMS42NjMuNzgxIDAgMS4yOTMuNTg0IDEuMjkzIDEuNjYzWm0zLjkyMi0xLjI3M2gtLjc1OHYtLjI1NmMwLS4yNTkuMTA0LS40MS40MTUtLjQxLjEyNyAwIC4yNTYuMDI3LjM0LjA1NGwuMTg3LS43OTVhMi43NzggMi43NzggMCAwIDAtLjc0OC0uMTA1Yy0uNzE5IDAtMS4yNTMuNDA2LTEuMjUzIDEuMjM2di4yNzZoLS41NHYuNzk1aC41NHYzLjAyM2gxLjA1OXYtMy4wMjNoLjc1OHYtLjc5NVptMi43IDBoLS43NTh2LS4yNTZjMC0uMjU5LjEwNC0uNDEuNDE1LS40MS4xMjcgMCAuMjU2LjAyNy4zNDEuMDU0bC4xODYtLjc5NWEyLjc3OCAyLjc3OCAwIDAgMC0uNzQ4LS4xMDVjLS43MTkgMC0xLjI1My40MDYtMS4yNTMgMS4yMzZ2LjI3NmgtLjU0di43OTVoLjU0djMuMDIzaDEuMDU5di0zLjAyM2guNzU4di0uNzk1Wm0yLjI1IDMuODkzYy45NDUgMCAxLjU4MS0uNDYgMS43My0xLjE2OWwtLjk3OS0uMDY0Yy0uMTA3LjI5LS4zOC40NDItLjczMy40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOCAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMi0uNzgzYy40NiAwIC43NzguMzI4Ljc4MS43ODNoLTEuNjAzWm0zLjI5MSAyLjI5NGgxLjA1OXYtMi4xNmMwLS40Ny4zNDMtLjc5My44MS0uNzkzLjE0NyAwIC4zNDguMDI1LjQ0OC4wNTd2LS45NGExLjYyNyAxLjYyNyAwIDAgMC0uMzM0LS4wMzdjLS40MjcgMC0uNzc4LjI0OS0uOTE3LjcyMWgtLjA0di0uNjY2aC0xLjAyNnYzLjgxOFoiIGZpbGw9IiNBMUExQTEiLz48Y2lyY2xlIGN4PSIxMDQuNTQyIiBjeT0iOTAuNTk1IiByPSIzOC43ODYiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEuODYyIiBzdHJva2UtZGFzaGFycmF5PSIyIDMiLz48Y2lyY2xlIGN4PSIxMDQuNTQxIiBjeT0iOTAuNTk1IiByPSIzMS45MDUiIGZpbGw9IiNGNkZBRkYiLz48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxwYXRoIGQ9Im0xMjcuMjU1IDY1LjQ3NC0zLjgwMiAzLjgwNFY1Ny40OGExLjg2MyAxLjg2MyAwIDAgMC0zLjE4Mi0xLjMxOGMtLjM1LjM1LS41NDcuODIzLS41NDcgMS4zMTh2MTEuOGwtMy44MDItMy44MDVhMS44NjUgMS44NjUgMCAxIDAtMi42MzkgMi42MzlsNi45ODYgNi45ODVhMS44NjUgMS44NjUgMCAwIDAgMi42NCAwbDYuOTg1LTYuOTg1YTEuODY2IDEuODY2IDAgMSAwLTIuNjM5LTIuNjM5Wm0xMi4yNjMuMTU1YTE3LjkzIDE3LjkzIDAgMCAxLTM1Ljg1OSAwIDE3LjkyNyAxNy45MjcgMCAwIDEgMTcuOTMtMTcuOTI5IDE3LjkzIDE3LjkzIDAgMCAxIDE3LjkyOSAxNy45M1oiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIxLjQiLz48L2c+PHBhdGggZD0iTTEwNy4xNDUgMTEyLjA2NnYuMDAxYzAgLjk2Ni4zODQgMS44OTMgMS4wNjggMi41NzdsMjAuMjY1IDIwLjI2NWEzLjY0NiAzLjY0NiAwIDAgMCA1LjE1NCAwbDEzLjI3Ny0xMy4yNzdhMy42NDYgMy42NDYgMCAwIDAgMC01LjE1NGwtMjAuMjY1LTIwLjI2NWEzLjY0NyAzLjY0NyAwIDAgMC0yLjU3Ny0xLjA2OEgxMTAuNzlhMy42NDIgMy42NDIgMCAwIDAtMy42NDUgMy42NDV2MTMuMjc2Wm0xNC40NzUtNi4wMzhhMy41OTIgMy41OTIgMCAxIDEtNy4xODUgMCAzLjU5MiAzLjU5MiAwIDAgMSA3LjE4NSAwWiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxyZWN0IHg9IjU1IiB5PSI4OC41MjciIHdpZHRoPSIzNi4zODkiIGhlaWdodD0iMzYuMzg5IiByeD0iMTguMTk0IiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTczLjE5NCA5MS41NmExNS4xNjIgMTUuMTYyIDAgMSAwIDAgMzAuMzI0IDE1LjE2MiAxNS4xNjIgMCAwIDAgMC0zMC4zMjRabTAgMjcuMjkxYTEyLjEyOCAxMi4xMjggMCAwIDEtOC41NzctMjAuNzA2IDEyLjEzIDEyLjEzIDAgMSAxIDguNTc3IDIwLjcwNloiIGZpbGw9IiMyMjcxQjEiLz48cGF0aCBkPSJNNzMuMTk0IDEwNS4yMDZjLTMuMDMyIDAtMy4wMzItLjk1Ni0zLjAzMi0xLjUxNyAwLS41NjEgMS4wNjEtMS41MTYgMy4wMzItMS41MTZzMi4xMDguOTcxIDIuMTIzIDEuNTE2aDMuMDMzYTQuNTQ1IDQuNTQ1IDAgMCAwLTMuNjQtNC4zNjZ2LTEuNjk4aC0zLjAzMnYxLjY1MmMtMy4wMzIuNS00LjU0OCAyLjQ1Ni00LjU0OCA0LjQxMiAwIDEuNjk4Ljc4OCA0LjU0OSA2LjA2NCA0LjU0OSAzLjAzMyAwIDMuMDMzIDEuMDMxIDMuMDMzIDEuNTE2IDAgLjQ4NS0uOTQgMS41MTYtMy4wMzMgMS41MTYtMi43OSAwLTMuMDMyLTEuMzA0LTMuMDMyLTEuNTE2SDY3LjEzYzAgMS4zOTUgMSAzLjg2NiA0LjU0OCA0LjQyN3YxLjYzOGgzLjAzM3YtMS42MzhjMy4wMzItLjUxNSA0LjU0OC0yLjQ3MSA0LjU0OC00LjQyNyAwLTEuNjk4LS43ODgtNC41NDgtNi4wNjUtNC41NDhaIiBmaWxsPSIjMjI3MUIxIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMDIuOTU5IDQ3KSIgZD0iTTAgMGgzNy4yNTl2MzcuMjU5SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+";function aR(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function iR(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add(()=>e.removeEventListener(n,r,o))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return aR(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=iR();return e(t),this.add(()=>t.dispose())},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function sR(){let[e]=(0,p.useState)(iR);return(0,p.useEffect)(()=>()=>e.dispose(),[e]),e}var lR=Object.defineProperty,cR=(e,t,n)=>(((e,t,n)=>{t in e?lR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let uR=new class{constructor(){cR(this,"current",this.detect()),cR(this,"handoffState","pending"),cR(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},dR=(e,t)=>{uR.isServer?(0,p.useEffect)(e,t):(0,p.useLayoutEffect)(e,t)};function fR(e){let t=(0,p.useRef)(e);return dR(()=>{t.current=e},[e]),t}let pR=function(e){let t=fR(e);return p.useCallback((...e)=>t.current(...e),[t])};function mR(){let e=(0,p.useRef)(!1);return dR(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function hR(){let e=function(){let e="undefined"==typeof document;return"useSyncExternalStore"in m&&(e=>e.useSyncExternalStore)(m)(()=>()=>{},()=>!1,()=>!e)}(),[t,n]=p.useState(uR.isHandoffComplete);return t&&!1===uR.isHandoffComplete&&n(!1),p.useEffect(()=>{!0!==t&&n(!0)},[t]),p.useEffect(()=>uR.handoff(),[]),!e&&t}let gR=Symbol();function wR(...e){let t=(0,p.useRef)(e);(0,p.useEffect)(()=>{t.current=e},[e]);let n=pR(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||(null==e?void 0:e[gR]))?void 0:n}var yR,bR;"undefined"!=typeof process&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&"test"===(null==(yR=null==process?void 0:process.env)?void 0:yR.NODE_ENV)&&void 0===(null==(bR=null==Element?void 0:Element.prototype)?void 0:bR.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join("\n")),[]});var vR=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(vR||{});function xR(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}let NR=(0,p.createContext)(null);NR.displayName="OpenClosedContext";var IR=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(IR||{});function MR(){return(0,p.useContext)(NR)}function ER({value:e,children:t}){return p.createElement(NR.Provider,{value:e},t)}function _R({children:e}){return p.createElement(NR.Provider,{value:null},e)}function SR(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}function DR(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,DR),r}var jR=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(jR||{}),kR=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(kR||{});function CR(){let e=function(){let e=(0,p.useRef)([]),t=(0,p.useCallback)(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>null==e))return e.current=n,t}}();return(0,p.useCallback)(t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:a=!0,name:i,mergeRefs:s}){s=null!=s?s:TR;let l=LR(t,e);if(a)return AR(l,n,r,i,s);let c=null!=o?o:0;if(2&c){let{static:e=!1,...t}=l;if(e)return AR(t,n,r,i,s)}if(1&c){let{unmount:e=!0,...t}=l;return DR(e?0:1,{0:()=>null,1:()=>AR({...t,hidden:!0,style:{display:"none"}},n,r,i,s)})}return AR(l,n,r,i,s)}({mergeRefs:e,...t}),[e])}function AR(e,t={},n,r,o){let{as:a=n,children:i,refName:s="ref",...l}=PR(e,["unmount","static"]),c=void 0!==e.ref?{[s]:e.ref}:{},u="function"==typeof i?i(t):i;"className"in l&&l.className&&"function"==typeof l.className&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let d={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){d["data-headlessui-state"]=n.join(" ");for(let e of n)d[`data-${e}`]=""}}if(UR(a)&&(Object.keys(zR(l)).length>0||Object.keys(zR(d)).length>0)){if(!(!(0,p.isValidElement)(u)||Array.isArray(u)&&u.length>1||function(e){return UR(e.type)}(u))){let e=u.props,t=null==e?void 0:e.className,n="function"==typeof t?(...e)=>SR(t(...e),l.className):SR(t,l.className),r=n?{className:n}:{},a=LR(u.props,zR(PR(l,["ref"])));for(let e in d)e in a&&delete d[e];return(0,p.cloneElement)(u,Object.assign({},a,d,c,{ref:o(RR(u),c.ref)},r))}if(Object.keys(zR(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(zR(l)).concat(Object.keys(zR(d))).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"))}return(0,p.createElement)(a,Object.assign({},PR(l,["ref"]),!UR(a)&&c,!UR(a)&&d),u)}function TR(...e){return e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function LR(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function OR(e){var t;return Object.assign((0,p.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function zR(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function PR(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function RR(e){return p.version.split(".")[0]>="19"?e.props.ref:e.ref}function UR(e){return e===p.Fragment||e===Symbol.for("react.fragment")}function BR(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!UR(null!=(t=e.as)?t:WR)||1===p.Children.count(e.children)}let FR=(0,p.createContext)(null);FR.displayName="TransitionContext";var YR=(e=>(e.Visible="visible",e.Hidden="hidden",e))(YR||{});let ZR=(0,p.createContext)(null);function VR(e){return"children"in e?VR(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function GR(e,t){let n=fR(e),r=(0,p.useRef)([]),o=mR(),a=sR(),i=pR((e,t=kR.Hidden)=>{let i=r.current.findIndex(({el:t})=>t===e);-1!==i&&(DR(t,{[kR.Unmount](){r.current.splice(i,1)},[kR.Hidden](){r.current[i].state="hidden"}}),a.microTask(()=>{var e;!VR(r)&&o.current&&(null==(e=n.current)||e.call(n))}))}),s=pR(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>i(e,kR.Unmount)}),l=(0,p.useRef)([]),c=(0,p.useRef)(Promise.resolve()),u=(0,p.useRef)({enter:[],leave:[]}),d=pR((e,n,r)=>{l.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),null==t||t.chains.current[n].push([e,new Promise(e=>{l.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(u.current[n].map(([e,t])=>t)).then(()=>e())})]),"enter"===n?c.current=c.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),f=pR((e,t,n)=>{Promise.all(u.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=l.current.shift())||e()}).then(()=>n(t))});return(0,p.useMemo)(()=>({children:r,register:s,unregister:i,onStart:d,onStop:f,wait:c,chains:u}),[s,i,r,d,f,u,c])}ZR.displayName="NestingContext";let WR=p.Fragment,HR=jR.RenderStrategy,QR=OR(function(e,t){let{show:n,appear:r=!1,unmount:o=!0,...a}=e,i=(0,p.useRef)(null),s=wR(...BR(e)?[i,t]:null===t?[]:[t]);hR();let l=MR();if(void 0===n&&null!==l&&(n=(l&IR.Open)===IR.Open),void 0===n)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=(0,p.useState)(n?"visible":"hidden"),d=GR(()=>{n||u("hidden")}),[f,m]=(0,p.useState)(!0),h=(0,p.useRef)([n]);dR(()=>{!1!==f&&h.current[h.current.length-1]!==n&&(h.current.push(n),m(!1))},[h,n]);let g=(0,p.useMemo)(()=>({show:n,appear:r,initial:f}),[n,r,f]);dR(()=>{n?u("visible"):!VR(d)&&null!==i.current&&u("hidden")},[n,d]);let w={unmount:o},y=pR(()=>{var t;f&&m(!1),null==(t=e.beforeEnter)||t.call(e)}),b=pR(()=>{var t;f&&m(!1),null==(t=e.beforeLeave)||t.call(e)}),v=CR();return p.createElement(ZR.Provider,{value:d},p.createElement(FR.Provider,{value:g},v({ourProps:{...w,as:p.Fragment,children:p.createElement($R,{ref:s,...w,...a,beforeEnter:y,beforeLeave:b})},theirProps:{},defaultTag:p.Fragment,features:HR,visible:"visible"===c,name:"Transition"})))}),$R=OR(function(e,t){var n,r;let{transition:o=!0,beforeEnter:a,afterEnter:i,beforeLeave:s,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:f,leave:m,leaveFrom:h,leaveTo:g,...w}=e,[y,b]=(0,p.useState)(null),v=(0,p.useRef)(null),x=BR(e),N=wR(...x?[v,t,b]:null===t?[]:[t]),I=null==(n=w.unmount)||n?kR.Unmount:kR.Hidden,{show:M,appear:E,initial:_}=function(){let e=(0,p.useContext)(FR);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[S,D]=(0,p.useState)(M?"visible":"hidden"),j=function(){let e=(0,p.useContext)(ZR);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:k,unregister:C}=j;dR(()=>k(v),[k,v]),dR(()=>{if(I===kR.Hidden&&v.current)return M&&"visible"!==S?void D("visible"):DR(S,{hidden:()=>C(v),visible:()=>k(v)})},[S,v,k,C,M,I]);let A=hR();dR(()=>{if(x&&A&&"visible"===S&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,S,A,x]);let T=_&&!E,L=E&&M&&_,O=(0,p.useRef)(!1),z=GR(()=>{O.current||(D("hidden"),C(v))},j),P=pR(e=>{O.current=!0;let t=e?"enter":"leave";z.onStart(v,t,e=>{"enter"===e?null==a||a():"leave"===e&&(null==s||s())})}),R=pR(e=>{let t=e?"enter":"leave";O.current=!1,z.onStop(v,t,e=>{"enter"===e?null==i||i():"leave"===e&&(null==l||l())}),"leave"===t&&!VR(z)&&(D("hidden"),C(v))});(0,p.useEffect)(()=>{x&&o||(P(M),R(M))},[M,x,o]);let U=!(!o||!x||!A||T),[,B]=function(e,t,n,r){let[o,a]=(0,p.useState)(n),{hasFlag:i,addFlag:s,removeFlag:l}=function(e=0){let[t,n]=(0,p.useState)(e),r=(0,p.useCallback)(e=>n(e),[]),o=(0,p.useCallback)(e=>n(t=>t|e),[]),a=(0,p.useCallback)(e=>(t&e)===e,[t]),i=(0,p.useCallback)(e=>n(t=>t&~e),[]),s=(0,p.useCallback)(e=>n(t=>t^e),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:a,removeFlag:i,toggleFlag:s}}(e&&o?3:0),c=(0,p.useRef)(!1),u=(0,p.useRef)(!1),d=sR();return dR(()=>{var o;if(e)return n&&a(!0),t?(null==(o=null==r?void 0:r.start)||o.call(r,n),function(e,{prepare:t,run:n,done:r,inFlight:o}){let a=iR();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:o}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(function(e,t){var n,r;let o=iR();if(!e)return o.dispose;let a=!1;o.add(()=>{a=!0});let i=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter(e=>e instanceof CSSTransition))?r:[];return 0===i.length?(t(),o.dispose):(Promise.allSettled(i.map(e=>e.finished)).then(()=>{a||t()}),o.dispose)}(e,r))})}),a.dispose}(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(s(3),l(4)):(s(4),l(2)))},run(){u.current?n?(l(3),s(4)):(l(4),s(3)):n?l(1):s(1)},done(){var e;u.current&&function(e){var t,n;return(null!=(n=null==(t=e.getAnimations)?void 0:t.call(e))?n:[]).some(e=>e instanceof CSSTransition&&"finished"!==e.playState)}(t)||(c.current=!1,l(7),n||a(!1),null==(e=null==r?void 0:r.end)||e.call(r,n))}})):void(n&&s(3))},[e,n,t,d]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}(U,y,M,{start:P,end:R}),F=zR({ref:N,className:(null==(r=SR(w.className,L&&c,L&&u,B.enter&&c,B.enter&&B.closed&&u,B.enter&&!B.closed&&d,B.leave&&m,B.leave&&!B.closed&&h,B.leave&&B.closed&&g,!B.transition&&M&&f))?void 0:r.trim())||void 0,...xR(B)}),Y=0;"visible"===S&&(Y|=IR.Open),"hidden"===S&&(Y|=IR.Closed),M&&"hidden"===S&&(Y|=IR.Opening),!M&&"visible"===S&&(Y|=IR.Closing);let Z=CR();return p.createElement(ZR.Provider,{value:z},p.createElement(ER,{value:Y},Z({ourProps:F,theirProps:w,defaultTag:WR,features:HR,visible:"visible"===S,name:"Transition.Child"})))}),XR=OR(function(e,t){let n=null!==(0,p.useContext)(FR),r=null!==MR();return p.createElement(p.Fragment,null,!n&&r?p.createElement(QR,{ref:t,...e}):p.createElement($R,{ref:t,...e}))}),JR=Object.assign(QR,{Child:XR,Root:QR});var qR=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(qR||{});function KR(e,t,n,r){let o=fR(n);(0,p.useEffect)(()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}class eU extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}}var tU,nU,rU,oU=Object.defineProperty,aU=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},iU=(e,t,n)=>(aU(e,t,"read from private field"),n?n.call(e):t.get(e)),sU=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},lU=(e,t,n,r)=>(aU(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class cU{constructor(e){sU(this,tU,{}),sU(this,nU,new eU(()=>new Set)),sU(this,rU,new Set),((e,t,n)=>{((e,t,n)=>{t in e?oU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n)})(this,"disposables",iR()),lU(this,tU,e),uR.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return iU(this,tU)}subscribe(e,t){if(uR.isServer)return()=>{};let n={selector:e,callback:t,current:e(iU(this,tU))};return iU(this,rU).add(n),this.disposables.add(()=>{iU(this,rU).delete(n)})}on(e,t){return uR.isServer?()=>{}:(iU(this,nU).get(e).add(t),this.disposables.add(()=>{iU(this,nU).get(e).delete(t)}))}send(e){let t=this.reduce(iU(this,tU),e);if(t!==iU(this,tU)){lU(this,tU,t);for(let e of iU(this,rU)){let t=e.selector(iU(this,tU));uU(e.current,t)||(e.current=t,e.callback(t))}for(let t of iU(this,nU).get(e.type))t(iU(this,tU),e)}}}function uU(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&dU(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&dU(e.entries(),t.entries()):!(!fU(e)||!fU(t))&&dU(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function dU(e,t){for(;;){let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}}function fU(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}tU=new WeakMap,nU=new WeakMap,rU=new WeakMap;var pU=Object.defineProperty,mU=(e,t,n)=>(((e,t,n)=>{t in e?pU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),hU=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(hU||{});let gU={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(-1!==o){let t=e.stack.slice();return t.splice(o,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(-1===r)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}};class wU extends cU{constructor(){super(...arguments),mU(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),mU(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new wU({stack:[]})}reduce(e,t){return DR(t.type,gU,e,t)}}const yU=new eU(()=>wU.new());var bU=n(8418);function vU(e,t,n=uU){return(0,bU.useSyncExternalStoreWithSelector)(pR(t=>e.subscribe(xU,t)),pR(()=>e.state),pR(()=>e.state),pR(t),n)}function xU(e){return e}function NU(e,t){let n=(0,p.useId)(),r=yU.get(t),[o,a]=vU(r,(0,p.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return dR(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),!!e&&(!a||o)}function IU(e){var t;return uR.isServer?null:null==e?document:null!=(t=null==e?void 0:e.ownerDocument)?t:document}function MU(e){var t,n;return uR.isServer?null:null==e?document:null!=(n=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))?n:document}function EU(e){var t,n;return null!=(n=null==(t=MU(e))?void 0:t.activeElement)?n:null}let _U=new Map,SU=new Map;function DU(e){var t;let n=null!=(t=SU.get(e))?t:0;return SU.set(e,n+1),0!==n||(_U.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>function(e){var t;let n=null!=(t=SU.get(e))?t:1;if(1===n?SU.delete(e):SU.set(e,n-1),1!==n)return;let r=_U.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,_U.delete(e))}(e)}function jU(e){return function(e){return"object"==typeof e&&null!==e&&"nodeType"in e}(e)&&"tagName"in e}function kU(e){return jU(e)&&"accessKey"in e}function CU(e){return jU(e)&&"tabIndex"in e}let AU=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),TU=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var LU=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(LU||{}),OU=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(OU||{}),zU=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(zU||{});var PU=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(PU||{});var RU=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(RU||{});function UU(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let BU=["textarea","input"].join(",");function FU(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let a=Array.isArray(e)?e.length>0?MU(e[0]):document:MU(e),i=Array.isArray(e)?n?function(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let a=r.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(TU)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e):function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(AU)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e);o.length>0&&i.length>1&&(i=i.filter(e=>!o.some(t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))),r=null!=r?r:null==a?void 0:a.activeElement;let s,l=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,i.indexOf(r))-1;if(4&t)return Math.max(0,i.indexOf(r))+1;if(8&t)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=32&t?{preventScroll:!0}:{},d=0,f=i.length;do{if(d>=f||d+f<=0)return 0;let e=c+d;if(16&t)e=(e+f)%f;else{if(e<0)return 3;if(e>=f)return 1}s=i[e],null==s||s.focus(u),d+=l}while(s!==EU(s));return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,BU))&&n}(s)&&s.select(),2}function YU(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ZU(){return YU()||/Android/gi.test(window.navigator.userAgent)}function VU(e,t,n,r){let o=fR(n);(0,p.useEffect)(()=>{if(e)return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r);function n(e){o.current(e)}},[e,t,r])}function GU(e,t,n,r){let o=fR(n);(0,p.useEffect)(()=>{if(e)return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r);function n(e){o.current(e)}},[e,t,r])}function WU(e,t,n){let r=fR(n),o=(0,p.useCallback)(function(e,n){if(e.defaultPrevented)return;let o=n(e);if(null===o||!o.getRootNode().contains(o)||!o.isConnected)return;let a=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of a)if(null!==t&&(t.contains(o)||e.composed&&e.composedPath().includes(t)))return;return!function(e,t=0){var n;return e!==(null==(n=IU(e))?void 0:n.body)&&DR(t,{0:()=>e.matches(AU),1(){let t=e;for(;null!==t;){if(t.matches(AU))return!0;t=t.parentElement}return!1}})}(o,PU.Loose)&&-1!==o.tabIndex&&e.preventDefault(),r.current(e,o)},[r,t]),a=(0,p.useRef)(null);VU(e,"pointerdown",e=>{var t,n;ZU()||(a.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),VU(e,"pointerup",e=>{if(ZU()||!a.current)return;let t=a.current;return a.current=null,o(e,()=>t)},!0);let i=(0,p.useRef)({x:0,y:0});VU(e,"touchstart",e=>{i.current.x=e.touches[0].clientX,i.current.y=e.touches[0].clientY},!0),VU(e,"touchend",e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-i.current.x)>=30||Math.abs(n-i.current.y)>=30))return o(e,()=>CU(e.target)?e.target:null)},!0),GU(e,"blur",e=>o(e,()=>function(e){return kU(e)&&"IFRAME"===e.nodeName}(window.document.activeElement)?window.document.activeElement:null),!0)}function HU(...e){return(0,p.useMemo)(()=>IU(...e),[...e])}var QU=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(QU||{});let $U=OR(function(e,t){var n;let{features:r=1,...o}=e,a={ref:t,"aria-hidden":!(2&~r)||(null!=(n=o["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}};return CR()({ourProps:a,theirProps:o,slot:{},defaultTag:"span",name:"Hidden"})}),XU=(0,p.createContext)(null);function JU({children:e,node:t}){let[n,r]=(0,p.useState)(null),o=qU(null!=t?t:n);return p.createElement(XU.Provider,{value:o},e,null===o&&p.createElement($U,{features:QU.Hidden,ref:e=>{var t,n;if(e)for(let o of null!=(n=null==(t=IU(e))?void 0:t.querySelectorAll("html > *, body > *"))?n:[])if(o!==document.body&&o!==document.head&&jU(o)&&null!=o&&o.contains(e)){r(o);break}}}))}function qU(e=null){var t;return null!=(t=(0,p.useContext)(XU))?t:e}function KU(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=null!=(n=t.defaultView)?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-o);n.style(r,"paddingRight",`${a}px`)}}}function eB(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let tB=function(e,t){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let a=t[e].call(n,...o);a&&(n=a,r.forEach(e=>e()))}}}(0,{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:iR(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=eB(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=eB(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta:()=>e.computedMeta},n=[YU()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=iR();n.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>n.dispose()))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,a=null;t.addEventListener(e,"click",t=>{if(CU(t.target))try{let n=t.target.closest("a");if(!n)return;let{hash:o}=new URL(n.href),i=e.querySelector(o);CU(i)&&!r(i)&&(a=i)}catch{}},!0),t.group(n=>{t.addEventListener(e,"touchstart",e=>{if(n.dispose(),CU(e.target)&&function(e){return jU(e)&&"style"in e}(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,"overscrollBehavior","contain")}else n.style(e.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",e=>{if(CU(e.target)){if(function(e){return kU(e)&&"INPUT"===e.nodeName}(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;o!==t&&window.scrollTo(0,o),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{},KU(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];n.forEach(({before:e})=>null==e?void 0:e(t)),n.forEach(({after:e})=>null==e?void 0:e(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function nB(e){return(0,p.useMemo)(()=>e,Object.values(e))}tB.subscribe(()=>{let e=tB.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&tB.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&tB.dispatch("TEARDOWN",n)}});let rB=(0,p.createContext)(()=>{});function oB({value:e,children:t}){return p.createElement(rB.Provider,{value:e},t)}let aB=(0,p.createContext)(!1);function iB(e){return p.createElement(aB.Provider,{value:e.force},e.children)}let sB=(0,p.createContext)(void 0),lB=(0,p.createContext)(null);function cB(){let e=(0,p.useContext)(lB);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,cB),e}return e}lB.displayName="DescriptionContext";let uB=OR(function(e,t){let n=(0,p.useId)(),r=(0,p.useContext)(sB),{id:o=`headlessui-description-${n}`,...a}=e,i=cB(),s=wR(t);dR(()=>i.register(o),[o,i.register]);let l=nB({...i.slot,disabled:r||!1}),c={ref:s,...i.props,id:o};return CR()({ourProps:c,theirProps:a,slot:l,defaultTag:"p",name:i.name||"Description"})}),dB=Object.assign(uB,{});function fB(e){let t=pR(e),n=(0,p.useRef)(!1);(0,p.useEffect)(()=>(n.current=!1,()=>{n.current=!0,aR(()=>{n.current&&t()})}),[t])}var pB=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(pB||{});function mB(e,t){let n=(0,p.useRef)([]),r=pR(e);(0,p.useEffect)(()=>{let e=[...n.current];for(let[o,a]of t.entries())if(n.current[o]!==a){let o=r(t,e);return n.current=t,o}},[r,...t])}let hB=[];function gB(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)jU(n.current)&&t.add(n.current);return t}!function(){function e(){"loading"!==document.readyState&&((()=>{function e(e){if(!CU(e.target)||e.target===document.body||hB[0]===e.target)return;let t=e.target;t=t.closest(AU),hB.unshift(null!=t?t:e.target),hB=hB.filter(e=>null!=e&&e.isConnected),hB.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",e))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",e),e())}();var wB=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(wB||{});let yB=OR(function(e,t){let n=(0,p.useRef)(null),r=wR(n,t),{initialFocus:o,initialFocusFallback:a,containers:i,features:s=15,...l}=e;hR()||(s=0);let c=HU(n.current);!function(e,{ownerDocument:t}){let n=!!(8&e),r=function(e=!0){let t=(0,p.useRef)(hB.slice());return mB(([e],[n])=>{!0===n&&!1===e&&aR(()=>{t.current.splice(0)}),!1===n&&!0===e&&(t.current=hB.slice())},[e,hB,t]),pR(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(n);mB(()=>{n||function(e){return EU(e)===e}(null==t?void 0:t.body)&&UU(r())},[n]),fB(()=>{n&&UU(r())})}(s,{ownerDocument:c});let u=function(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:o}){let a=(0,p.useRef)(null),i=NU(!!(1&e),"focus-trap#initial-focus"),s=mR();return mB(()=>{if(0===e)return;if(!i)return void(null!=o&&o.current&&UU(o.current));let l=n.current;l&&aR(()=>{if(!s.current)return;let n=null==t?void 0:t.activeElement;if(null!=r&&r.current){if((null==r?void 0:r.current)===n)return void(a.current=n)}else if(l.contains(n))return void(a.current=n);if(null!=r&&r.current)UU(r.current);else{if(16&e){if(FU(l,LU.First|LU.AutoFocus)!==OU.Error)return}else if(FU(l,LU.First)!==OU.Error)return;if(null!=o&&o.current&&(UU(o.current),(null==t?void 0:t.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=null==t?void 0:t.activeElement})},[o,i,e]),a}(s,{ownerDocument:c,container:n,initialFocus:o,initialFocusFallback:a});!function(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:o}){let a=mR(),i=!!(4&e);KR(null==t?void 0:t.defaultView,"focus",e=>{if(!i||!a.current)return;let t=gB(r);kU(n.current)&&t.add(n.current);let s=o.current;if(!s)return;let l=e.target;kU(l)?vB(t,l)?(o.current=l,UU(l)):(e.preventDefault(),e.stopPropagation(),UU(s)):UU(o.current)},!0)}(s,{ownerDocument:c,container:n,containers:i,previousActiveElement:u});let d=function(){let e=(0,p.useRef)(0);return GU(!0,"keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}(),f=pR(e=>{if(!kU(n.current))return;let t=n.current;DR(d.current,{[pB.Forwards]:()=>{FU(t,LU.First,{skipElements:[e.relatedTarget,a]})},[pB.Backwards]:()=>{FU(t,LU.Last,{skipElements:[e.relatedTarget,a]})}})}),m=NU(!!(2&s),"focus-trap#tab-lock"),h=sR(),g=(0,p.useRef)(!1),w={ref:r,onKeyDown(e){"Tab"==e.key&&(g.current=!0,h.requestAnimationFrame(()=>{g.current=!1}))},onBlur(e){if(!(4&s))return;let t=gB(i);kU(n.current)&&t.add(n.current);let r=e.relatedTarget;CU(r)&&"true"!==r.dataset.headlessuiFocusGuard&&(vB(t,r)||(g.current?FU(n.current,DR(d.current,{[pB.Forwards]:()=>LU.Next,[pB.Backwards]:()=>LU.Previous})|LU.WrapAround,{relativeTo:e.target}):CU(e.target)&&UU(e.target)))}},y=CR();return p.createElement(p.Fragment,null,m&&p.createElement($U,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:QU.Focusable}),y({ourProps:w,theirProps:l,defaultTag:"div",name:"FocusTrap"}),m&&p.createElement($U,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:QU.Focusable}))}),bB=Object.assign(yB,{features:wB});function vB(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let xB=p.Fragment,NB=OR(function(e,t){let{ownerDocument:n=null,...r}=e,o=(0,p.useRef)(null),a=wR(function(e,t=!0){return Object.assign(e,{[gR]:t})}(e=>{o.current=e}),t),i=HU(o.current),s=function(e){let t=(0,p.useContext)(aB),n=(0,p.useContext)(MB),[r,o]=(0,p.useState)(()=>{var r;if(!t&&null!==n)return null!=(r=n.current)?r:null;if(uR.isServer)return null;let o=null==e?void 0:e.getElementById("headlessui-portal-root");if(o)return o;if(null===e)return null;let a=e.createElement("div");return a.setAttribute("id","headlessui-portal-root"),e.body.appendChild(a)});return(0,p.useEffect)(()=>{null!==r&&(null!=e&&e.body.contains(r)||null==e||e.body.appendChild(r))},[r,e]),(0,p.useEffect)(()=>{t||null!==n&&o(n.current)},[n,o,t]),r}(null!=n?n:i),l=(0,p.useContext)(EB),c=sR(),u=CR();return fB(()=>{var e;s&&s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s))}),s?(0,dn.createPortal)(p.createElement("div",{"data-headlessui-portal":"",ref:e=>{c.dispose(),l&&e&&c.add(l.register(e))}},u({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:xB,name:"Portal"})),s):null}),IB=p.Fragment,MB=(0,p.createContext)(null),EB=(0,p.createContext)(null),_B=OR(function(e,t){let n=wR(t),{enabled:r=!0,ownerDocument:o,...a}=e,i=CR();return r?p.createElement(NB,{...a,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:xB,name:"Portal"})}),SB=OR(function(e,t){let{target:n,...r}=e,o={ref:wR(t)},a=CR();return p.createElement(MB.Provider,{value:n},a({ourProps:o,theirProps:r,defaultTag:IB,name:"Popover.Group"}))}),DB=Object.assign(_B,{Group:SB});var jB=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(jB||{}),kB=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(kB||{});let CB={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},AB=(0,p.createContext)(null);function TB(e){let t=(0,p.useContext)(AB);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,TB),t}return t}function LB(e,t){return DR(t.type,CB,e,t)}AB.displayName="DialogContext";let OB=OR(function(e,t){let n=(0,p.useId)(),{id:r=`headlessui-dialog-${n}`,open:o,onClose:a,initialFocus:i,role:s="dialog",autoFocus:l=!0,__demoMode:c=!1,unmount:u=!1,...d}=e,f=(0,p.useRef)(!1);s="dialog"===s||"alertdialog"===s?s:(f.current||(f.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let m=MR();void 0===o&&null!==m&&(o=(m&IR.Open)===IR.Open);let h=(0,p.useRef)(null),g=wR(h,t),w=HU(h.current),y=o?0:1,[b,v]=(0,p.useReducer)(LB,{titleId:null,descriptionId:null,panelRef:(0,p.createRef)()}),x=pR(()=>a(!1)),N=pR(e=>v({type:0,id:e})),I=!!hR()&&0===y,[M,E]=function(){let e=(0,p.useContext)(EB),t=(0,p.useRef)([]),n=pR(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=pR(n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)}),o=(0,p.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,p.useMemo)(()=>function({children:e}){return p.createElement(EB.Provider,{value:o},e)},[o])]}(),_={get current(){var e;return null!=(e=b.panelRef.current)?e:h.current}},S=qU(),{resolveContainers:D}=function({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=pR(()=>{var r,o;let a=IU(n),i=[];for(let t of e)null!==t&&(jU(t)?i.push(t):"current"in t&&jU(t.current)&&i.push(t.current));if(null!=t&&t.current)for(let e of t.current)i.push(e);for(let e of null!=(r=null==a?void 0:a.querySelectorAll("html > *, body > *"))?r:[])e!==document.body&&e!==document.head&&jU(e)&&"headlessui-portal-root"!==e.id&&(n&&(e.contains(n)||e.contains(null==(o=null==n?void 0:n.getRootNode())?void 0:o.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:pR(e=>r().some(t=>t.contains(e)))}}({mainTreeNode:S,portals:M,defaultContainers:[_]}),j=null!==m&&(m&IR.Closing)===IR.Closing;!function(e,{allowed:t,disallowed:n}={}){let r=NU(e,"inert-others");dR(()=>{var e,o;if(!r)return;let a=iR();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&a.add(DU(t));let i=null!=(o=null==t?void 0:t())?o:[];for(let e of i){if(!e)continue;let t=IU(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)i.some(t=>e.contains(t))||a.add(DU(e));n=n.parentElement}}return a.dispose},[r,t,n])}(!c&&!j&&I,{allowed:pR(()=>{var e,t;return[null!=(t=null==(e=h.current)?void 0:e.closest("[data-headlessui-portal]"))?t:null]}),disallowed:pR(()=>{var e;return[null!=(e=null==S?void 0:S.closest("body > *:not(#headlessui-portal-root)"))?e:null]})});let k=yU.get(null);dR(()=>{if(I)return k.actions.push(r),()=>k.actions.pop(r)},[k,r,I]);let C=vU(k,(0,p.useCallback)(e=>k.selectors.isTop(e,r),[k,r]));WU(C,D,e=>{e.preventDefault(),x()}),function(e,t=("undefined"!=typeof document?document.defaultView:null),n){let r=NU(e,"escape");KR(t,"keydown",e=>{r&&(e.defaultPrevented||e.key===qR.Escape&&n(e))})}(C,null==w?void 0:w.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),x()}),function(e,t,n=()=>[document.body]){!function(e,t,n=()=>({containers:[]})){let r=function(e){return(0,p.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}(tB),o=t?r.get(t):void 0,a=!!o&&o.count>0;dR(()=>{if(t&&e)return tB.dispatch("PUSH",t,n),()=>tB.dispatch("POP",t,n)},[e,t])}(NU(e,"scroll-lock"),t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}})}(!c&&!j&&I,w,D),function(e,t,n){let r=fR(e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()});(0,p.useEffect)(()=>{if(!e)return;let n=null===t?null:kU(t)?t:t.current;if(!n)return;let o=iR();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(()=>r.current(n));e.observe(n),o.add(()=>e.disconnect())}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),o.add(()=>e.disconnect())}return()=>o.dispose()},[t,r,e])}(I,h,x);let[A,T]=function(){let[e,t]=(0,p.useState)([]);return[e.length>0?e.join(" "):void 0,(0,p.useMemo)(()=>function(e){let n=pR(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),r=(0,p.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return p.createElement(lB.Provider,{value:r},e.children)},[t])]}(),L=(0,p.useMemo)(()=>[{dialogState:y,close:x,setTitleId:N,unmount:u},b],[y,x,N,u,b]),O=nB({open:0===y}),z={ref:g,id:r,role:s,tabIndex:-1,"aria-modal":c?void 0:0===y||void 0,"aria-labelledby":b.titleId,"aria-describedby":A,unmount:u},P=!function(){var e;let[t]=(0,p.useState)(()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null),[n,r]=(0,p.useState)(null!=(e=null==t?void 0:t.matches)&&e);return dR(()=>{if(t)return t.addEventListener("change",e),()=>t.removeEventListener("change",e);function e(e){r(e.matches)}},[t]),n}(),R=wB.None;I&&!c&&(R|=wB.RestoreFocus,R|=wB.TabLock,l&&(R|=wB.AutoFocus),P&&(R|=wB.InitialFocus));let U=CR();return p.createElement(_R,null,p.createElement(iB,{force:!0},p.createElement(DB,null,p.createElement(AB.Provider,{value:L},p.createElement(SB,{target:h},p.createElement(iB,{force:!1},p.createElement(T,{slot:O},p.createElement(E,null,p.createElement(bB,{initialFocus:i,initialFocusFallback:h,containers:D,features:R},p.createElement(oB,{value:x},U({ourProps:z,theirProps:d,slot:O,defaultTag:zB,features:PB,visible:0===y,name:"Dialog"})))))))))))}),zB="div",PB=jR.RenderStrategy|jR.Static,RB=OR(function(e,t){let{transition:n=!1,open:r,...o}=e,a=MR(),i=e.hasOwnProperty("open")||null!==a,s=e.hasOwnProperty("onClose");if(!i&&!s)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!i)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!s)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&"boolean"!=typeof e.open)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if("function"!=typeof e.onClose)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return void 0===r&&!n||o.static?p.createElement(JU,null,p.createElement(OB,{ref:t,open:r,...o})):p.createElement(JU,null,p.createElement(JR,{show:r,transition:n,unmount:o.unmount},p.createElement(OB,{ref:t,...o})))}),UB=OR(function(e,t){let n=(0,p.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:o=!1,...a}=e,[{dialogState:i,unmount:s},l]=TB("Dialog.Panel"),c=wR(t,l.panelRef),u=nB({open:0===i}),d=pR(e=>{e.stopPropagation()}),f={ref:c,id:r,onClick:d},m=o?XR:p.Fragment,h=o?{unmount:s}:{},g=CR();return p.createElement(m,{...h},g({ourProps:f,theirProps:a,slot:u,defaultTag:"div",name:"Dialog.Panel"}))}),BB=(OR(function(e,t){let{transition:n=!1,...r}=e,[{dialogState:o,unmount:a}]=TB("Dialog.Backdrop"),i=nB({open:0===o}),s={ref:t,"aria-hidden":!0},l=n?XR:p.Fragment,c=n?{unmount:a}:{},u=CR();return p.createElement(l,{...c},u({ourProps:s,theirProps:r,slot:i,defaultTag:"div",name:"Dialog.Backdrop"}))}),OR(function(e,t){let n=(0,p.useId)(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:a,setTitleId:i}]=TB("Dialog.Title"),s=wR(t);(0,p.useEffect)(()=>(i(r),()=>i(null)),[r,i]);let l=nB({open:0===a}),c={ref:s,id:r};return CR()({ourProps:c,theirProps:o,slot:l,defaultTag:"h2",name:"Dialog.Title"})})),FB=Object.assign(RB,{Panel:UB,Title:BB,Description:dB});function YB({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const ZB=p.forwardRef(YB),VB=({sourceStep:e,availableSteps:t,acceptRedirect:n,setAcceptRedirect:r,rejectRedirect:o,setRejectRedirect:a})=>(0,i.createElement)("div",{className:"border border-gray-200 rounded-lg p-4 mb-4"},(0,i.createElement)("div",{className:"font-medium text-gray-800 mb-3"},e.title," (",e.type,")",e.isVariation&&(0,i.createElement)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded"},(0,j.__)("A/B Variation","cartflows"))),(0,i.createElement)("div",{className:"mb-3"},(0,i.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,j.__)("Accept (Yes) - redirect to:","cartflows")),(0,i.createElement)("select",{className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:ring focus:ring-primary-100 focus:border-primary-500 focus:outline-none",value:n,onChange:e=>r(e.target.value)},t.map(e=>(0,i.createElement)("option",{key:`accept-${e.id}`,value:e.id},e.title)))),(0,i.createElement)("div",null,(0,i.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,j.__)("Reject (No) - redirect to:","cartflows")),(0,i.createElement)("select",{className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:ring focus:ring-primary-100 focus:border-primary-500 focus:outline-none",value:o,onChange:e=>a(e.target.value)},t.map(e=>(0,i.createElement)("option",{key:`reject-${e.id}`,value:e.id},e.title))))),GB=({isOpen:e,onClose:t,onConfirm:n,stepToDelete:r,flowSteps:o})=>{const a=(0,i.useRef)(null),[s,l]=(0,i.useState)({}),c=(0,i.useMemo)(()=>{if(!o||!r)return[];const e=[],t=parseInt(r.step_id,10);return o.forEach(n=>{if("upsell"===n.type||"downsell"===n.type){const r=parseInt(n.offer_yes_step_id,10)===t,o=parseInt(n.offer_no_step_id,10)===t;(r||o)&&e.push({id:n.id,title:n.title,type:n.type,currentAccept:n.offer_yes_step_id,currentReject:n.offer_no_step_id,acceptPointsToDeleted:r,rejectPointsToDeleted:o,isVariation:!1,controlStepId:n.id});const a=n["ab-test-variations"];Array.isArray(a)&&a.length>0&&a.forEach(r=>{const o=parseInt(r.offer_yes_step_id,10)===t,a=parseInt(r.offer_no_step_id,10)===t;if(o||a){const t=r.title||`${n.title} - Variation`;e.push({id:r.id,title:t,type:n.type,currentAccept:r.offer_yes_step_id,currentReject:r.offer_no_step_id,acceptPointsToDeleted:o,rejectPointsToDeleted:a,isVariation:!0,controlStepId:n.id})}})}}),e},[o,r]),u=(e,t)=>{if(!o||!r)return[];const n=t||e,a=o.findIndex(e=>parseInt(e.id,10)===parseInt(n,10));if(-1===a)return[];const i=parseInt(r.step_id,10);return o.slice(a+1).filter(e=>parseInt(e.id,10)!==i&&"checkout"!==e.type)};(0,i.useEffect)(()=>{if(c.length>0){const e={};c.forEach(t=>{const n=u(t.id,t.controlStepId),r=n.length>0?n[0].id:"";e[t.id]={accept:t.acceptPointsToDeleted?r:t.currentAccept,reject:t.rejectPointsToDeleted?r:t.currentReject}}),l(e)}},[e,o,r]);const d=(e,t,n)=>{l(r=>({...r,[e]:{...r[e],[t]:n}}))};return e?(0,i.createPortal)((0,i.createElement)(JR.Root,{show:e,as:i.Fragment},(0,i.createElement)(FB,{as:"div",className:"relative z-[99999] wcf-confirm-popup",initialFocus:a,onClose:()=>{}},(0,i.createElement)(JR.Child,{as:i.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,i.createElement)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})),(0,i.createElement)("div",{className:"fixed inset-0 z-10 overflow-y-auto"},(0,i.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0"},(0,i.createElement)(JR.Child,{as:i.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,i.createElement)(FB.Panel,{className:"wcf-confirm-popup-wrapper relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"},(0,i.createElement)("div",{className:"absolute top-0 right-0 hidden pt-4 pr-4 sm:block"},(0,i.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none",onClick:t},(0,i.createElement)("span",{className:"sr-only"},"Close"),(0,i.createElement)(ZB,{className:"h-6 w-6","aria-hidden":"true"}))),(0,i.createElement)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},(0,i.createElement)("div",{className:"sm:flex sm:items-start"},(0,i.createElement)("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"},(0,i.createElement)(c_,{className:"h-6 w-6 text-red-600","aria-hidden":"true"})),(0,i.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},(0,i.createElement)(FB.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900 capitalize"},(0,j.__)("Delete Step","cartflows")),(0,i.createElement)("div",{className:"mt-2"},(0,i.createElement)("p",{className:"text-sm text-gray-500"},(0,j.__)("Are you sure you want to delete this step?","cartflows"))))),c.length>0&&(0,i.createElement)("div",{className:"mt-4"},(0,i.createElement)("p",{className:"text-sm font-medium text-gray-700 mb-3"},(0,j.__)("The following steps have edges pointing to this step. Please select where they should redirect after deletion:","cartflows")),c.map(e=>{const t=u(e.id,e.controlStepId),n=s[e.id]||{};return(0,i.createElement)(VB,{key:e.id,sourceStep:e,availableSteps:t,acceptRedirect:n.accept||"",setAcceptRedirect:t=>d(e.id,"accept",t),rejectRedirect:n.reject||"",setRejectRedirect:t=>d(e.id,"reject",t)})}))),(0,i.createElement)("div",{className:"flex bg-gray-50 px-4 py-3 flex-col-reverse sm:flex-row gap-3 sm:justify-end sm:px-6"},(0,i.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:t,ref:a},(0,j.__)("Cancel","cartflows")),(0,i.createElement)("button",{type:"button",className:"wcf-button wcf-primary-button",onClick:()=>{n(s)}},(0,j.__)("Delete","cartflows"))))))))),document.body):null},WB=(0,i.memo)(({data:e,isConnectable:t})=>{const n="upsell"===e.step_type?rR:oR,r="vertical"===e?.axis,o="LR"===e.direction?"target":"source",a="LR"===e.direction?"source":"target",[,s]=(0,i.useState)(!1),[c,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)("cartflows_delete_step"),p=dg(),m=(0,_g.W6)(),[{license_status:h}]=l(),[{steps:g,is_flow_instant_checkout:w}]=Nm(),y=KP.createEventHandlers(e,p,m,s,{delete:e=>{e.preventDefault();const t=e.currentTarget.getAttribute("data-action")||"cartflows_delete_step";f(t),u(!0)}});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:"target",position:jA.Top,id:"top",style:{background:"#555",visibility:r?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),"LR"===e.direction&&!r&&(0,i.createElement)(UO,{type:o,position:jA.Left,id:"left",style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),"RL"===e.direction&&!r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:o,position:jA.Left,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,i.createElement)(UO,{type:o,position:jA.Left,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})),KP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},n,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,y,h,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,[],w,e.is_locked),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e?.label),"LR"===e.direction&&!r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:a,position:jA.Right,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,i.createElement)(UO,{type:a,position:jA.Right,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})),"RL"===e.direction&&!r&&(0,i.createElement)(UO,{type:a,position:jA.Right,style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:"source",position:jA.Bottom,id:"a",style:{left:80,background:"#16A34A"},className:"react-flow__handle wcf-handle-bottom-accept",isConnectable:t}),(0,i.createElement)(UO,{type:"source",position:jA.Bottom,id:"b",style:{left:"auto",right:80,background:"#DC2626"},className:"react-flow__handle wcf-handle-bottom-reject",isConnectable:t})),(0,i.createElement)(GB,{isOpen:c,onClose:()=>u(!1),onConfirm:async t=>{u(!1),await KP.performDelete(e,d,s,t)},stepToDelete:e,flowSteps:g}))}),HB="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTI2LjU4MyA3OS4wMDhWODEuNWEyNy4wOCAyNy4wOCAwIDAgMS0xOS40MDQgMjUuOTU2IDI3LjA4MyAyNy4wODMgMCAxIDEgMy4zNDQtNTAuNzEiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNMTI2LjU4MyA1OS44MzMgOTkuNSA4Ni45NDNsLTguMTI1LTguMTI0IiBzdHJva2U9IiMyMjcxQjEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHJlY3QgeD0iODMiIHk9IjE0MyIgd2lkdGg9IjM1IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iNzgiIHk9IjEyOSIgd2lkdGg9IjQ1IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iMjMiIHk9IjE1NyIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjIzIiB5PSIxNzEiIHdpZHRoPSIxNTQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIyMyIgeT0iMTg1IiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMjMiIHk9IjE5OSIgd2lkdGg9IjkyLjQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSI3MiIgeT0iMjIzIiB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iOTQiIHk9IjIyMyIgd2lkdGg9IjEyIiBoZWlnaHQ9IjEyIiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjExNiIgeT0iMjIzIiB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PC9zdmc+",QB=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o=r?"target":"source",a=r?"source":"target",[,s]=(0,i.useState)(!1),c=dg(),u=(0,_g.W6)(),[{license_status:d}]=l(),[{is_flow_instant_checkout:f}]=Nm(),p=KP.createEventHandlers(e,c,u,s);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:"target",position:jA.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),(0,i.createElement)(UO,{type:o,position:jA.Left,id:"left",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),KP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},HB,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,p,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,[],f,e.is_locked),(0,i.createElement)(UO,{type:a,position:jA.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,i.createElement)(UO,{type:"source",position:jA.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e?.label))}),$B="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iMSIgd2lkdGg9IjE5OSIgaGVpZ2h0PSIyNTgiIHJ4PSI5LjUiIGZpbGw9IiNmZmYiIHN0cm9rZT0iI0VBRUFFQSIvPjxwYXRoIGQ9Ik0wIDEwLjVDMCA0Ljk3NyA0LjQ3Ny41IDEwIC41aDE4MGM1LjUyMyAwIDEwIDQuNDc3IDEwIDEwdjE4SDB2LTE4WiIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iI0ZGM0IzMCIvPjxjaXJjbGUgY3g9IjI3IiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iI0ZDMCIvPjxjaXJjbGUgY3g9IjQwIiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjY0IiB5PSIxMC41IiB3aWR0aD0iMTA3IiBoZWlnaHQ9IjciIHJ4PSIxIiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbD0iI0Y2RkFGRiIgZD0iTTExMyA0OWg2NHY5MmgtNjR6Ii8+PHJlY3QgeD0iMTI1IiB5PSI2NCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTEyMC41IDc5YS41LjUgMCAwIDEgLjUtLjVoNDhhLjUuNSAwIDAgMSAuNS41djRhLjUuNSAwIDAgMS0uNS41aC00OGEuNS41IDAgMCAxLS41LS41di00Wk0xMjAuNSA5MGEuNS41IDAgMCAxIC41LS41aDQ4YS41LjUgMCAwIDEgLjUuNXY0YS41LjUgMCAwIDEtLjUuNWgtNDhhLjUuNSAwIDAgMS0uNS0uNXYtNFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iI0I3Q0ZFMiIvPjxyZWN0IHg9IjEyMC41IiB5PSIxMDMuNSIgd2lkdGg9IjQiIGhlaWdodD0iNCIgcng9Ii41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNDQ0RFRUQiLz48cmVjdCB4PSIxMzAiIHk9IjEwNCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjMiIHJ4PSIxIiBmaWxsPSIjQ0NERUVEIi8+PHJlY3QgeD0iMTIwIiB5PSIxMTgiIHdpZHRoPSI1MCIgaGVpZ2h0PSI3IiByeD0iMiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjIzIiB5PSI2MCIgd2lkdGg9IjgwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHBhdGggZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjRTZFQUVEIiBzdHJva2Utd2lkdGg9IjEuNSIgZD0iTTIzLjc1IDc0Ljc1aDc4LjV2NDMuNWgtNzguNXoiLz48cGF0aCBkPSJNNjMgODguMjVhOC43NSA4Ljc1IDAgMSAwIC4wMDEgMTcuNTAxQTguNzUgOC43NSAwIDAgMCA2MyA4OC4yNVptMCAxNi4wMTZhNy4yNjcgNy4yNjcgMCAwIDEgMC0xNC41MzIgNy4yNjcgNy4yNjcgMCAwIDEgMCAxNC41MzJaIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0ibTY3LjA1IDk2Ljc0OC01Ljc4Mi00LjJhLjMxLjMxIDAgMCAwLS40OTUuMjUzdjguMzk4YzAgLjI1Ni4yOS40MDEuNDk1LjI1Mmw1Ljc4My00LjE5OWEuMzEyLjMxMiAwIDAgMCAuMDk1LS4zOTMuMzEyLjMxMiAwIDAgMC0uMDk1LS4xMTFabS01LjAzIDIuNjE3di00LjczTDY1LjI3NSA5N2wtMy4yNTYgMi4zNjVaIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iNTAiIHk9IjE1NiIgd2lkdGg9IjEwMCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjI1IiBjeT0iMTc1IiByPSIyIiBmaWxsPSIjMjI3MUIxIi8+PGNpcmNsZSBjeD0iMjUiIGN5PSIxODkiIHI9IjIiIGZpbGw9IiMyMjcxQjEiLz48Y2lyY2xlIGN4PSIyNSIgY3k9IjIwMyIgcj0iMiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjM1IiB5PSIxNzMiIHdpZHRoPSIxNDIiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIzNSIgeT0iMTg3IiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMzUiIHk9IjIwMSIgd2lkdGg9IjEyMCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjIzIiB5PSIyMTkiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTk0LjQ0MiAyMjkuMjI3YzAtMi4xNDEtMS4zMy0zLjM2Mi0zLjA2NS0zLjM2Mi0xLjc0NSAwLTMuMDY1IDEuMjIxLTMuMDY1IDMuMzYyIDAgMi4xMzIgMS4zMiAzLjM2MiAzLjA2NSAzLjM2MiAxLjczNSAwIDMuMDY1LTEuMjIgMy4wNjUtMy4zNjJabS0xLjQwMyAwYzAgMS4zODctLjY1OSAyLjEzOC0xLjY2MiAyLjEzOC0xLjAwNyAwLTEuNjYyLS43NTEtMS42NjItMi4xMzhzLjY1NS0yLjEzOCAxLjY2Mi0yLjEzOGMxLjAwMyAwIDEuNjYyLjc1MSAxLjY2MiAyLjEzOFptMi40MDIgNS4xMTRoMS4zNjJ2LTIuNjI3aC4wNDFjLjE4OS40MDkuNjAxLjg2NiAxLjM5NC44NjYgMS4xMTggMCAxLjk5MS0uODg1IDEuOTkxLTIuNTI4IDAtMS42ODgtLjkxMS0yLjUyNS0xLjk4OC0yLjUyNS0uODIxIDAtMS4yMTUuNDg5LTEuMzk3Ljg4OGgtLjA2di0uODI0SDk1LjQ0djYuNzVabTEuMzMzLTQuMjk2YzAtLjg3NS4zNy0xLjQzNSAxLjAzMi0xLjQzNS42NzUgMCAxLjAzMy41ODUgMS4wMzMgMS40MzUgMCAuODU3LS4zNjUgMS40NTEtMS4wMzMgMS40NTEtLjY1NSAwLTEuMDMyLS41NzUtMS4wMzItMS40NTFabTYuOTc0LTIuNDU0aC0uOTI0di0xLjE3NmgtMS4zNjF2MS4xNzZoLS42NzJ2MS4wMjNoLjY3MnYyLjU1NmMtLjAwNy45NjIuNjQ4IDEuNDM5IDEuNjM2IDEuMzk3LjM1Mi0uMDEzLjYwMS0uMDgzLjczOC0uMTI4bC0uMjE0LTEuMDEzYy0uMDY3LjAxMy0uMjExLjA0NS0uMzM5LjA0NS0uMjcxIDAtLjQ2LS4xMDItLjQ2LS40OHYtMi4zNzdoLjkyNHYtMS4wMjNabS44ODcgNC45MDloMS4zNjF2LTQuOTA5aC0xLjM2MXY0LjkwOVptLjY4NC01LjU0MmMuNDA1IDAgLjczOC0uMzEuNzM4LS42OSAwLS4zNzctLjMzMy0uNjg3LS43MzgtLjY4Ny0uNDAzIDAtLjczNi4zMS0uNzM2LjY4NyAwIC4zOC4zMzMuNjkuNzM2LjY5Wm0zLjEyOSAyLjcwNGMuMDAzLS42MzMuMzgxLTEuMDA0LjkzLTEuMDA0LjU0NyAwIC44NzYuMzU4Ljg3My45NTl2Mi44ODNoMS4zNjF2LTMuMTI2YzAtMS4xNDQtLjY3MS0xLjg0Ny0xLjY5NC0xLjg0Ny0uNzI4IDAtMS4yNTYuMzU4LTEuNDc2LjkzaC0uMDU4di0uODY2aC0xLjI5N3Y0LjkwOWgxLjM2MXYtMi44MzhaIiBmaWxsPSIjZmZmIi8+PC9zdmc+",XB=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,o=r?"target":"source",a=r?"source":"target",[,s]=(0,i.useState)(!1),c=dg(),u=(0,_g.W6)(),[{license_status:d}]=l(),f=KP.createEventHandlers(e,c,u,s);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:"target",position:jA.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),(0,i.createElement)(UO,{type:o,position:jA.Left,id:"left",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),KP.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},$B,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,f,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,void 0,void 0,e.is_locked),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e?.label),(0,i.createElement)(UO,{type:a,position:jA.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,i.createElement)(UO,{type:"source",position:jA.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),JB={createEventHandlers(e,t,n,r){const o=(0,k.applyFilters)("cartflows.canvas.abNodeActions",null);if(o)return o({data:e,confirm:t,setLoader:r,toast:Wm});const a=e=>e.preventDefault();return{clone:a,delete:a,winner:a,archived:a}},nodeHtml(e,t,n,r,o,a,s,l,c,u,d,f,p,m,h,g,w,y=!1,b=""){const v=Bm(e?.step_type,b),x=e?.step_type||"",N=Um(e?.step_title||"");return(0,i.createElement)("div",{className:"wcf-custom-node-wrapper wcf-ab-test-variation"+(y?" wcf-custom-node-wrapper--compact":"")},(0,i.createElement)("div",{className:"wcf-custom-node-design"},(0,i.createElement)("div",{className:"wcf-node-actions absolute flex bg-white left-11 -top-16 rounded-md py-0.5 px-1.5 sm:hidden lg:hidden"},(0,i.createElement)(Wo,{content:(0,j.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,j.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(WP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:v?Fm():(0,j.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:v?"#!":r,target:v?void 0:"_blank",rel:"noreferrer","aria-label":(0,j.__)("Edit Page","cartflows"),"aria-disabled":v,tabIndex:v?-1:0,className:"wcf-canvas--edit-step p-2 block "+(v?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,i.createElement)(HP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:(0,j.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)(_,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,j.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(QP,{className:"w-5 h-5"})))),(0,i.createElement)("div",{className:"wcf-custom-node-content bg-white border border-gray-200 rounded-lg shadow-md"+(p?" opacity-50":"")},(0,i.createElement)("div",{className:"wcf-custom-node-content--header flex flex-col gap-3 border-b border-gray-200 py-4 px-5"},(0,i.createElement)("div",{className:"wcf-node-step--info-wrapper flex flex-row items-center gap-4 w-full"},(0,i.createElement)("div",{className:"wcf-node-step--icon bg-primary-25 p-2.5 rounded border border-primary-300"},(e=>{let t="";const n="w-5 h-5 stroke-2 text-primary-500";switch(e){case"landing":t=(0,i.createElement)(CP,{className:n});break;case"optin":t=(0,i.createElement)(TP,{className:n});break;case"checkout":t=(0,i.createElement)(Xg,{className:n});break;case"upsell":t=(0,i.createElement)(sm,{className:n});break;case"downsell":t=(0,i.createElement)(OP,{className:n});break;case"thankyou":t=(0,i.createElement)(PP,{className:n});break;default:t=(0,i.createElement)(UP,{className:n})}return t})(x)),(0,i.createElement)("div",{className:"w-full flex flex-col gap-1"},(0,i.createElement)("div",{className:"wcf-node-step--type flex items-center gap-2"},(0,i.createElement)("span",{className:"text-xs font-normal text-gray-400 capitalize"},x),function(){let t="";return t=e.control_id===e.step_id?(0,i.createElement)("span",{className:"wcf-step-badge bg-primary-500 text-white text-xs px-2.5 py-1 rounded-full"},(0,j.__)("Control","cartflows")):(0,i.createElement)("span",{className:"wcf-step-badge bg-gray-800 text-white text-xs px-2.5 py-1 rounded-full"},(0,j.sprintf)(/* translators: %d is replaced with the count */ /* translators: %d is replaced with the count */
34 +(0,j.__)("Variation-%d","cartflows"),u)),t}(),f&&(0,i.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-invalid-sequence-badge"},(0,i.createElement)(pg,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,j.__)("Invalid Position","cartflows"))),(0,i.createElement)("div",{className:"wcf-node-step--title text-left"},(0,i.createElement)("span",{className:"font-semibold text-sm text-gray-800 hover:text-gray-800"},N)))),function(){let e=null;return d||(e=(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-no-product-badge"},(0,j.__)("No Product Assigned","cartflows"))),e}(),p&&(0,i.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-disabled-step-badge"},(0,j.__)("Disabled","cartflows"))),(0,i.createElement)("div",{className:"wcf-custom-node-content--stats flex text-center justify-around items-center py-4 px-5"},(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-view"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,j.__)("Views","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},(()=>{let e=0;return l&&l.total_visits&&(e=l.total_visits||0),e})())),(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-conversation"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,j.__)("Conversions","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==x?(()=>{let e=0;return l&&l?.conversions&&(e=l.conversions||0),e})():"-")),(0,i.createElement)("div",{className:"wcf-step--stats-content--stat-revenue"},(0,i.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,j.__)("Revenue","cartflows")),(0,i.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==x&&"landing"!==x?l&&l?.visits?.revenue?Nh(l.visits.revenue):0:"-"))),(0,i.createElement)("div",{className:"wcf-custom-node-content--footer flex text-center justify-around items-center border-t border-gray-200 py-4 px-5"},(0,i.createElement)(Wo,{content:(0,j.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,j.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(WP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:v?Fm():(0,j.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:v?"#!":r,target:v?void 0:"_blank",rel:"noreferrer","aria-label":(0,j.__)("Edit Page","cartflows"),"aria-disabled":v,tabIndex:v?-1:0,className:"wcf-canvas--edit-step p-2 block "+(v?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,i.createElement)(HP,{className:"w-5 h-5"}))),(0,i.createElement)(Wo,{content:(0,j.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)(_,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,j.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,i.createElement)(QP,{className:"w-5 h-5"}))),(o?Object.keys(o):[]).map(t=>{const n=o[t],r=n?.class;let l=!1,c=!1;!wcfCartflowsPro()&&n?.pro&&(l=!0),wcfCartflowsPro()&&n?.pro&&"Activated"!==s&&(c=!0);let u="";u=l||c?"wcf-pro text-text-disabled cursor-not-allowed":"text-text-tertiary";let d=n?.text;return l?d=(0,j.sprintf)(
35 +// translators: %s: action name (e.g. Clone, A/B Test).
36 +// translators: %s: action name (e.g. Clone, A/B Test).
37 +(0,j.__)("Upgrade to CartFlows Pro to use %s.","cartflows"),n?.text):c&&(d=(0,j.sprintf)(
38 +// translators: %s: action name (e.g. Clone, A/B Test).
39 +// translators: %s: action name (e.g. Clone, A/B Test).
40 +(0,j.__)("Activate your CartFlows license to use %s.","cartflows"),n?.text)),(0,i.createElement)(Wo,{key:n?.slug,content:d,placement:"top",boundary:"viewport",arrow:!0},(0,i.createElement)("a",{href:n?.link,className:`wcf-step__action-btn relative ${r} ${u} p-2 text-sm flex gap-1.5 ${"delete"===n?.slug?"hover:bg-field-background-error hover:text-button-danger":"hover:bg-badge-hover-gray hover:text-text-primary"}`,"aria-label":n?.text,"data-id":e?.step_id,"data-control-id":e?.control_id,onClick:e=>{l||c?e.preventDefault():"#"===n?.link&&a&&a[n?.slug]&&(e.preventDefault(),a[n?.slug](e))},"data-action":n?.ajaxcall},(0,i.createElement)("div",{className:"flex items-center gap-1.5"},function(e){let t="";switch(e){case"clone":t=(0,i.createElement)(BP,{className:"h-5 w-5"});break;case"delete":t=(0,i.createElement)(Po,{className:"h-5 w-5"});break;case"archived":t=(0,i.createElement)(YP,{className:"h-5 w-5"});break;case"winner":t=(0,i.createElement)(ZP,{className:"h-5 w-5"});break;default:t=(0,i.createElement)(GP,{className:"h-5 w-5"})}return t}(n?.slug),(l||c)&&(0,i.createElement)(Mg,{className:"absolute -top-1 -right-1 w-4 h-4 text-brand-600 fill-brand-600","aria-label":(0,j.__)("Pro feature","cartflows")}))))})))))}},qB=JB,KB=(0,i.memo)(({data:e,isConnectable:t})=>{let n=jP;switch(e.step_type){case"landing":default:n=jP;break;case"checkout":n=tR;break;case"upsell":n=rR;break;case"downsell":n=oR;break;case"optin":n=$B;break;case"thankyou":n=HB}const r="upsell"===e.step_type||"downsell"===e.step_type,o="vertical"===e?.axis,a="LR"===e.direction?"target":"source",s="LR"===e.direction?"source":"target",[,c]=(0,i.useState)(!1),u=dg(),d=(0,_g.W6)(),[{license_status:f}]=l(),[{is_flow_instant_checkout:p}]=Nm(),m=qB.createEventHandlers(e,u,d,c);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:"target",position:jA.Top,id:"top",style:{visibility:o?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),r&&"RL"===e.direction?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:a,position:jA.Left,className:"react-flow__handle-left-a wcf-handle-left",id:"a",style:{top:50},isConnectable:t}),(0,i.createElement)(UO,{type:a,position:jA.Left,className:"react-flow__handle-left-b wcf-handle-left",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})):(0,i.createElement)(UO,{type:a,position:jA.Left,id:"left",style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),qB.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type,control_id:e?.control_id},n,e.viewPageLink,e.editPage,e.menu_actions,m,f,e.analytics,e.traffic,e.var_badge_count,e.is_product_assigned,e.isInvalidPosition,e?.step_disabled,e?.offer_no_next_step,e?.offer_no_step_id,e?.offer_yes_next_step,e?.offer_yes_step_id,e?.compact,p),(0,i.createElement)("div",{className:"wcf-custom-node-label"},e.label),r&&"LR"===e.direction?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(UO,{type:s,position:jA.Right,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,i.createElement)(UO,{type:s,position:jA.Right,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})):(0,i.createElement)(UO,{type:s,position:jA.Right,className:"react-flow__handle wcf-handle-right",id:"right",isConnectable:t}))}),eF=To("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),tF=(0,p.forwardRef)(({variant:e="primary",size:t="md",border:n="subtle",src:r,alt:o,children:a,className:i,...s},l)=>{const[c,u]=(0,p.useState)(!1),d={white:"text-text-primary bg-background-primary",gray:"text-text-primary bg-background-secondary",primary:"text-text-on-color bg-background-brand","primary-light":"text-text-primary bg-brand-background-50",dark:"text-text-on-color bg-button-secondary"}[e],f={xxs:"size-5 [&>svg]:size-3 text-xs",xs:"size-6 [&>svg]:size-4 text-sm",sm:"size-8 [&>svg]:size-5 text-base",md:"size-10 [&>svg]:size-6 text-lg",lg:"size-12 [&>svg]:size-12 text-lg"}[t],m={none:"",subtle:"ring-1 ring-border-transparent-subtle",ring:"ring ring-border-subtle"}[r&&"none"===n?"subtle":n],h=r?"object-cover object-center":"",g=!r||c,w=g?"div":"img";return(0,p.useEffect)(()=>{u(!1)},[r]),(0,C.jsx)(w,{ref:l,className:Se("rounded-full overflow-hidden flex items-center justify-center",g&&d,f,m,h,i),...g?{children:(()=>{if(r&&c){if(o&&"string"==typeof o)return o?.[0]?.toUpperCase();if(a&&"string"==typeof a)return a?.[0]?.toUpperCase();if(!a&&!o)return(0,C.jsx)(eF,{})}return a?"string"==typeof a?a?.[0]?.toUpperCase():a:null})()}:{src:r,alt:o,onError:()=>{u(!0)}},...s})}),nF=To("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),rF=To("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),oF=To("CircleArrowDown",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]),aF=To("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]),iF=To("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),sF=To("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),lF=To("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),cF=({open:e,setOpen:t,variations:n,type:r,flowId:o,controlId:a})=>{const s=dg(),l=n.filter(e=>"1"!==e.hide),c=l.filter(e=>e.deleted).length;return(0,i.createElement)(Jh,{open:e,setOpen:t,design:"footer-divided",exitOnClickOutside:!1,exitOnEsc:!1,className:"!z-[999998]"},(0,i.createElement)(Jh.Portal,null,(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Panel,{className:"w-[640px] max-w-[92vw]"},(0,i.createElement)(Jh.Header,{className:"flex items-start justify-between"},(0,i.createElement)("div",{className:"space-y-1"},(0,i.createElement)(Jh.Title,null,(0,j.__)("Archived Variations","cartflows")),(0,i.createElement)(Jh.Description,null,(0,j.__)("Restore a variation back into the test, or delete it permanently.","cartflows"))),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)(Jh.Body,null,(0,i.createElement)(ph,{containerType:"flex",direction:"column",gap:"xs"},l.map(e=>(0,i.createElement)(ph,{key:e.id,containerType:"flex",direction:"row",align:"center",justify:"between",gap:"md",className:"py-3 border-0 border-t border-solid border-border-subtle first:border-t-0"},(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",gap:"sm"},(0,i.createElement)(tF,{variant:"primary-light",size:"sm",className:"!rounded-md !text-brand-500 ring-1 ring-brand-200 !p-1"},(e=>({landing:(0,i.createElement)(nF,{className:"w-5 h-5"}),checkout:(0,i.createElement)(rF,{className:"w-5 h-5"}),upsell:(0,i.createElement)(GP,{className:"w-5 h-5"}),downsell:(0,i.createElement)(oF,{className:"w-5 h-5"}),thankyou:(0,i.createElement)(aF,{className:"w-5 h-5"}),optin:(0,i.createElement)(iF,{className:"w-5 h-5"})}[e]||(0,i.createElement)(nF,{className:"w-5 h-5"})))(r)),(0,i.createElement)(ph,{containerType:"flex",direction:"column",className:"!gap-1"},(0,i.createElement)(ph,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,i.createElement)(vh,{size:12,weight:400,color:"tertiary",className:"capitalize"},"thankyou"===r?(0,j.__)("Thank You","cartflows"):r),(0,i.createElement)(Qo,{size:"xs",type:"pill",variant:e.deleted?"red":"inverse",className:"!font-normal text-[0.5rem]",label:(e.deleted?(0,j.__)("Deleted On: ","cartflows"):(0,j.__)("Archived On: ","cartflows"))+e.date})),(0,i.createElement)(vh,{size:14,weight:400,color:"primary"},e.title))),(0,i.createElement)(ph,{containerType:"flex",direction:"row",gap:"xs"},Object.values(e.actions||{}).map(t=>{const n="delete"===t.slug||"deleteArch"===t.slug?"text-text-secondary hover:bg-field-background-error hover:text-button-danger":"text-text-secondary hover:bg-badge-hover-gray hover:text-text-primary";return(0,i.createElement)(Ro,{key:t.slug,variant:"ghost",size:"xs",icon:(r=t.slug,{restore:(0,i.createElement)(sF,{className:"w-4 h-4"}),delete:(0,i.createElement)(Po,{className:"w-4 h-4"}),hide:(0,i.createElement)(lF,{className:"w-4 h-4"}),deleteArch:(0,i.createElement)(Po,{className:"w-4 h-4"})}[r]),iconPosition:"left",onClick:()=>((e,t)=>{const n=(0,k.applyFilters)("cartflows.canvas.archivedVariationActions",{})[e];n&&n({confirm:s,toast:Wm,stepId:t.id,flowId:o,controlId:a})})(t.slug,e),className:`${n} !rounded-md`},t.text);var r})))))),(0,i.createElement)(Jh.Footer,{className:"justify-between items-center border-0 border-t border-solid border-border-subtle"},(0,i.createElement)(vh,{size:12,color:"tertiary"},l.length," ",(0,j.__)("archived","cartflows"),c>0&&` · ${c} ${(0,j.__)("deleted","cartflows")}`),(0,i.createElement)(Ro,{variant:"outline",size:"sm",onClick:()=>t(!1)},(0,j.__)("Close","cartflows"))))))},uF=({variations:e=[],type:t,flowId:n,controlId:r})=>{const o=e.filter(e=>"1"!==e.hide).length,[a,s]=(0,i.useState)(!1);return 0===o?null:(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)(YP,{className:"w-3.5 h-3.5"}),iconPosition:"left",onClick:()=>s(!0),className:"bg-background-primary border border-solid border-border-subtle shadow-sm rounded-full"},(0,i.createElement)("span",{className:"inline-flex items-center gap-1"},(0,j.__)("Archived","cartflows"),(0,i.createElement)(Qo,{size:"xxs",type:"rounded",variant:"inverse",label:String(o),className:"inline-flex"}))),(0,i.createElement)(cF,{open:a,setOpen:s,variations:e,type:t,flowId:n,controlId:r}))},dF=(0,i.memo)(({data:e,isConnectable:t})=>{const{step:n,flow_id:r,isDynamicOfferGroup:o,isOfferABTestGroup:a}=e,s=(0,k.applyFilters)("cartflows.flowEditor.abTestHead",null);if(o)return(0,i.createElement)("div",{className:"dynamic-offer-group-container",style:{width:"100%",height:"100%",position:"relative"}});if(a){if(!n)return null;const e=n["ab-test-variations"]||[],t=n["ab-test-start"]||!1;return(0,i.createElement)("div",{className:"offer-ab-test-group-container"},s&&(0,i.createElement)("div",{className:"ab-test-group-header absolute w-3/4 mx-auto top-[-30px] left-0 right-0 z-10"},(0,i.createElement)(s,{flow_id:r,control_id:n.id,step_id:n.id,abvariations:e,ab_test_start:t,compact:!0})))}if(!n)return null;const l=n["ab-test-variations"]||[],c=n["ab-test-start"]||!1;return(0,i.createElement)("div",{className:"ab-test-group-container"},(0,i.createElement)(UO,{type:"target",position:jA.Top,id:"top",style:{background:"#555",width:"10px",height:"10px",top:"-5px",left:"50%"},isConnectable:t}),(0,i.createElement)(UO,{type:"target",position:jA.Left,id:"left",style:{background:"#555",width:"10px",height:"10px",left:"-5px",top:"50%"},isConnectable:t}),s&&(0,i.createElement)("div",{className:"ab-test-group-header absolute w-3/4 mx-auto top-[-30px] left-0 right-0 z-10"},(0,i.createElement)(s,{flow_id:r,control_id:n.id,step_id:n.id,abvariations:l,ab_test_start:c,compact:!0})),(0,i.createElement)("div",{className:"absolute -bottom-[14px] right-3 z-10"},(0,i.createElement)(uF,{variations:n["ab-test-archived-variations"]||[],type:n.type,flowId:r,controlId:n.id})),(0,i.createElement)(UO,{type:"source",position:jA.Right,id:"right",style:{background:"#555",width:"10px",height:"10px",right:"-5px",top:"50%"},isConnectable:t}),(0,i.createElement)(UO,{type:"source",position:jA.Bottom,id:"bottom",style:{background:"#555",width:"10px",height:"10px",bottom:"-5px",left:"50%"},isConnectable:t}))});dF.displayName="ABTestGroupNode";const fF=dF;var pF=n(6246),mF=n.n(pF);const hF=class{static validateConnection(e,t,n,r){const o=[];if(this.isOfferStep(e.type)&&("landing"!==t.type&&"checkout"!==t.type||o.push({code:"INVALID_OFFER_TARGET",message:`${this.getStepTypeLabel(e.type)} cannot connect to ${this.getStepTypeLabel(t.type)}`,severity:"error"})),e.id===t.id&&o.push({code:"SELF_REFERENCE",message:"Step cannot connect to itself",severity:"error"}),this.isOfferStep(e.type)&&r.steps){const t=r.steps.some(e=>"checkout"===e.type);if(t&&r.stepOrder){const n=this.extractStepId(e.id),a=r.stepOrder.indexOf(n),i=r.stepOrder.findIndex(e=>"checkout"===r.steps.find(t=>t.id===e)?.type);t&&-1!==a&&-1!==i&&a<i&&o.push({code:"OFFER_BEFORE_CHECKOUT",message:"Offer step should come after Checkout",severity:"warning"})}}if("landing"===e.type&&r.stepOrder){const t=this.extractStepId(e.id);0!==r.stepOrder.indexOf(t)&&o.push({code:"LANDING_NOT_FIRST",message:"Landing page should be the first step",severity:"warning"})}const a={isValid:0===o.filter(e=>"error"===e.severity).length,errors:o,warnings:o.filter(e=>"warning"===e.severity)};return console.log("[ValidationHelper] Validation complete:",{isValid:a.isValid,errorCount:o.length,hardErrors:o.filter(e=>"error"===e.severity).length,warnings:o.filter(e=>"warning"===e.severity).length}),a}static validateStepOrder(e,t,n){const r=[];if("storeCheckout"===n){const n=t.find(e=>"checkout"===e.type);n&&0!==e.indexOf(n.id)&&r.push({code:"STORE_CHECKOUT_POSITION",stepId:n.id,message:"Store checkout must be the first step",severity:"error"})}const o=e.findIndex(e=>"checkout"===t.find(t=>t.id===e)?.type);-1!==o&&e.forEach((e,n)=>{const a=t.find(t=>t.id===e);this.isOfferStep(a?.type)&&n<o&&r.push({code:"OFFER_BEFORE_CHECKOUT",stepId:e,message:"Offer step should come after Checkout",severity:"warning"})});const a=e.findIndex(e=>"landing"===t.find(t=>t.id===e)?.type);if(-1!==a&&0!==a){const e=t.find(e=>"landing"===e.type);r.push({code:"LANDING_NOT_FIRST",stepId:e?.id,message:"Landing page should be the first step",severity:"warning"})}const i=e.findIndex(e=>"thankyou"===t.find(t=>t.id===e)?.type);if(-1!==i&&i!==e.length-1){const n=e.slice(i+1).some(e=>{const n=t.find(t=>t.id===e);return n&&!this.isOfferStep(n.type)});if(n){const e=t.find(e=>"thankyou"===e.type);r.push({code:"THANKYOU_NOT_LAST",stepId:e?.id,message:"Thank You page should typically be the last step (or followed only by offers)",severity:"warning"})}}return{isValid:0===r.filter(e=>"error"===e.severity).length,errors:r,warnings:r.filter(e=>"warning"===e.severity)}}static isOfferStep(e){return"upsell"===e||"downsell"===e}static getStepTypeLabel(e){return{landing:"Landing Page",checkout:"Checkout",upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You",optin:"Opt-in"}[e]||e}static extractStepId(e){if(!e)return null;if("wcf_start_node"===e||"wcf_end_node"===e)return null;const t=e.match(/wcf_node_edge_(\d+)/);return t?parseInt(t[1],10):e}static validateStepPosition(e,t,n,r,o){const a=this.validateStepOrder(n,r,o).errors.filter(t=>t.stepId===e.id);return a.length>0?{isValid:0===a.filter(e=>"error"===e.severity).length,errors:a,warnings:a.filter(e=>"warning"===e.severity)}:{isValid:!0,errors:[],warnings:[]}}},gF=class{static hasValidRuleValue(e){return!(!e||!e.value||Array.isArray(e.value)&&(0===e.value.length||e.value.every(e=>""===e||"string"==typeof e&&""===e.trim()))||"string"==typeof e.value&&""===e.value.trim())}static hasValidRules(e){return!!(e&&e.rules&&Array.isArray(e.rules))&&e.rules.some(e=>this.hasValidRuleValue(e))}static hasDynamicOffers(e){return!(!e||"checkout"!==e.type&&"store-checkout"!==e.type)&&(!(!e.conditions||!Array.isArray(e.conditions)||0===e.conditions.length)&&this.getValidTargetSteps(e.conditions,e.default_step).length>0)}static getValidTargetSteps(e,t){const n=[];if(e&&Array.isArray(e)&&e.forEach(e=>{if(e.step_id&&this.hasValidRules(e)){const t=parseInt(e.step_id,10);isNaN(t)||n.push(t)}}),t){const e=parseInt(t,10);isNaN(e)||n.push(e)}return n}static getUniqueTargetSteps(e,t){const n=new Set;if(e&&Array.isArray(e)&&e.forEach(e=>{if(e.step_id){const t=parseInt(e.step_id,10);isNaN(t)||n.add(t)}}),t){const e=parseInt(t,10);isNaN(e)||n.add(e)}return Array.from(n)}static removeConditionsForStep(e,t){return e&&Array.isArray(e)?e.filter(e=>parseInt(e.step_id,10)!==t):[]}static updateDefaultStep(e,t,n){return parseInt(e,10)!==parseInt(t,10)?e:n.length>0&&void 0!==n[0].step_id&&null!==n[0].step_id?n[0].step_id:""}static buildRulesFormData(e,t,n,r){const o=new window.FormData;return o.append("action","cartflows_save_meta_settings"),o.append("security",cartflows_admin.save_meta_settings_nonce),o.append("post_id",t),o.append("step_id",e),o.append("wcf-checkout-rules-option","yes"),n.forEach((e,t)=>{o.append(`wcf-checkout-rules[${t}][group_id]`,e.group_id),o.append(`wcf-checkout-rules[${t}][step_id]`,e.step_id),e?.rules&&Array.isArray(e?.rules)&&e.rules.forEach((e,n)=>{var r,a,i,s;o.append(`wcf-checkout-rules[${t}][rules][${n}][rule_id]`,null!==(r=e?.rule_id)&&void 0!==r?r:""),o.append(`wcf-checkout-rules[${t}][rules][${n}][condition]`,null!==(a=e?.condition)&&void 0!==a?a:""),o.append(`wcf-checkout-rules[${t}][rules][${n}][operator]`,null!==(i=e?.operator)&&void 0!==i?i:""),Array.isArray(e.value)?e.value.forEach(e=>{o.append(`wcf-checkout-rules[${t}][rules][${n}][value][]`,null!=e?e:"")}):o.append(`wcf-checkout-rules[${t}][rules][${n}][value]`,null!==(s=e.value)&&void 0!==s?s:"")})}),o.append("wcf-checkout-rules-default-step",r||""),o}static isConditionalEdge(e){return e&&e.source&&e.source.startsWith("conditional-")}static extractCheckoutId(e){if(!e||!e.startsWith("conditional-"))return null;const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}static extractStepId(e,t=null){if(!e)return null;if(e.includes("ab-group-")){const t=e.match(/(?:offer-)?ab-group-(\d+)/);if(t){const e=parseInt(t[1],10);return isNaN(e)?null:e}return null}if(e.includes("wcf_node_edge_")){const n=parseInt(e.replace("wcf_node_edge_",""),10);if(isNaN(n))return null;if(t&&Array.isArray(t))for(const e of t)if(e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].some(e=>e.id===n))return e.id;return n}return null}},wF=["upsell","downsell"],yF=(e,t=[])=>{const n=[];if(!e||!e.type)return n;if(wF.includes(e.type)){const r=new Set(t.map(e=>parseInt(e.id,10))),o=parseInt(e.offer_yes_step_id,10)||0,a=parseInt(e.offer_no_step_id,10)||0;o&&!r.has(o)&&n.push({kind:"broken-redirect",severity:"error",message:(0,j.__)("Accept target step is missing","cartflows")}),a&&!r.has(a)&&n.push({kind:"broken-redirect",severity:"error",message:(0,j.__)("Reject target step is missing","cartflows")})}return n},bF=550,vF=350,xF=-200,NF=300,IF=-50,MF=class{constructor(e,t,n="horizontal"){this.steps=e,this.flowType=t,this.axis=n,this.offerSteps=["upsell","downsell"],this.positions=new Map,this.incomingAcceptEdges=new Map,this.incomingRejectEdges=new Map,this.conditionalTargets=new Map,this.dynamicOfferTargetSteps=new Set,this.stepIndexMap=new Map,this.steps.forEach((e,t)=>{this.stepIndexMap.set(e.id,t)})}calculate(){return this.identifyDynamicOfferTargets(),this.buildIncomingEdgesMap(),this.calculatePositions(),this.positions}identifyDynamicOfferTargets(){this.steps.forEach(e=>{if(gF.hasDynamicOffers(e)){const t=gF.getUniqueTargetSteps(e.conditions,e.default_step),n=this.calculateConditionalFan(t);t.forEach((t,r)=>{this.dynamicOfferTargetSteps.add(t),this.conditionalTargets.set(t,{yOffset:n[r],sourceCheckoutId:e.id})})}})}buildIncomingEdgesMap(){this.steps.forEach(e=>{this.incomingAcceptEdges.set(e.id,[]),this.incomingRejectEdges.set(e.id,[])}),this.steps.forEach((e,t)=>{if(!this.offerSteps.includes(e.type))return;const n=this.hasABTestVariations(e),r=n?e["ab-test-variations"].length:1;if(n){const n=new Set;e["ab-test-variations"].forEach((o,a)=>{const i=o.offer_yes_step_id,s=o.offer_no_step_id;if(i){const n=this.incomingAcceptEdges.get(i);n&&n.push({offerId:e.id,offerIndex:t,hasABTest:!0,variationCount:r,variationIndex:a})}if(s&&!n.has(s)){n.add(s);const o=this.incomingRejectEdges.get(s);o&&o.push({offerId:e.id,offerIndex:t,hasABTest:!0,variationCount:r})}})}else{const n=e.offer_yes_step_id,r=e.offer_no_step_id;if(n){const r=this.incomingAcceptEdges.get(n);r&&r.push({offerId:e.id,offerIndex:t,hasABTest:!1,variationCount:1})}if(r){const n=this.incomingRejectEdges.get(r);n&&n.push({offerId:e.id,offerIndex:t,hasABTest:!1,variationCount:1})}}})}calculatePositions(){this.steps.forEach((e,t)=>{const n=this.calculateYPosition(e,t),r=this.calculateXPositionForStep(e,t),o=gF.hasDynamicOffers(e),a="upsell"===e.type||"downsell"===e.type,i="checkout"===e.type&&Array.isArray(e.bumps)?e.bumps.length:0;this.positions.set(e.id,{x:r,y:n,hasDynamicOffers:o,hasABTest:this.hasABTestVariations(e),isOfferStep:a,bumpCount:i})}),this.adjustXPositionsForIncomingEdges()}bumpStride(e,t){return e&&t?150+50*(t-1):0}calculateXPositionForStep(e,t){if(0===t)return 250;const n="vertical"===this.axis,r=n?380:bF,o=[...this.incomingAcceptEdges.get(e.id)||[],...this.incomingRejectEdges.get(e.id)||[]];if(o.length>0){let e=0,t=!1;if(o.forEach(n=>{const r=this.positions.get(n.offerId);r&&r.x>e&&(e=r.x,t=r.hasDynamicOffers)}),e>0)return e+(t?r+vF:r)}const a=this.steps[t-1],i=this.positions.get(a.id);if(i){let e=r;return i.hasDynamicOffers&&(e+=vF),i.hasABTest&&!i.isOfferStep&&(n?e=700:e+=150),e+=this.bumpStride(n,i.bumpCount),i.x+e}return 250+t*r}adjustXPositionsForIncomingEdges(){let e=!0,t=0;for(;e&&t<10;)e=!1,t++,this.steps.forEach(t=>{const n=this.positions.get(t.id);if(!n)return;const r=[...this.incomingAcceptEdges.get(t.id)||[],...this.incomingRejectEdges.get(t.id)||[]];if(0===r.length)return;let o=0,a=!1;r.forEach(e=>{const t=this.positions.get(e.offerId);t&&t.x>o&&(o=t.x,a=t.hasDynamicOffers)});const i="vertical"===this.axis?380:bF,s=o+(a?i+vF:i);s>n.x&&(n.x=s,this.positions.set(t.id,n),e=!0)})}calculateYPosition(e,t){if(0===t)return 0;if(this.dynamicOfferTargetSteps.has(e.id)){const e=this.steps[t-1],n=this.positions.get(e.id);return(n?n.y:0)+200}const n=this.incomingAcceptEdges.get(e.id)||[],r=this.incomingRejectEdges.get(e.id)||[];if(n.length>0&&r.length>0){const t=new Set(r.map(e=>e.offerId)),o=new Set(n.map(e=>e.offerId));if([...t].some(e=>!o.has(e))){const e=r.filter(e=>!o.has(e.offerId)),t=this.findEarliestSource(e);return this.calculateRejectYPosition(t)}const a=this.findEarliestSource(n),i=this.positions.get(a.offerId);let s=i?i.y:0;return s=this.applyABTestAcceptOffset(e,s),s}if(n.length>0){const t=this.findEarliestSource(n);let r=this.calculateAcceptYPosition(t);return r=this.applyABTestAcceptOffset(e,r),r}if(r.length>0){const e=this.findEarliestSource(r);return this.calculateRejectYPosition(e)}const o=this.steps[t-1],a=this.positions.get(o.id);return a?a.y:0}calculateRejectYPosition(e){const t=this.positions.get(e.offerId);if(!t)return 200;if(e.hasABTest&&e.variationCount>1){const n=this.calculateABGroupHeight(e.variationCount);return t.y+IF+n}return t.y+200}calculateAcceptYPosition(e){const t=this.positions.get(e.offerId);return t?e.hasABTest&&e.variationCount>1&&void 0!==e.variationIndex?t.y+IF+50-e.variationIndex*NF+150:t.y+xF:xF}applyABTestAcceptOffset(e,t){if(this.hasABTestVariations(e)){const n=this.calculateABGroupHeight(e["ab-test-variations"].length);return t+xF-n/3}return t}calculateABGroupHeight(e){return e*NF+50}findEarliestSource(e){return 0===e.length?null:e.reduce((e,t)=>t.offerIndex<e.offerIndex||t.offerIndex===e.offerIndex&&void 0!==t.variationIndex&&void 0!==e.variationIndex&&t.variationIndex<e.variationIndex?t:e,e[0])}calculateConditionalFan(e){const t=e.length;if(0===t)return[];if(1===t)return[0];const n=0-250*(t-1)/2;return e.map((e,t)=>n+250*t)}hasABTestVariations(e){return e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}getMaxX(){let e=0;return this.positions.forEach(t=>{t.x>e&&(e=t.x)}),e}getPosition(e){return this.positions.get(e)||null}isConditionalTarget(e){return this.conditionalTargets.has(e)}isDynamicOfferTarget(e){return this.dynamicOfferTargetSteps.has(e)}static calculateABGroupDimensions(e){return{width:450,height:e*NF+50}}static calculateABVariationPosition(e){return{x:25,y:50+e*NF}}static getABGroupYOffset(){return IF}},EF={getInvalidStepIds(e){const t=new Set;if(!Array.isArray(e))return t;const n="undefined"!=typeof cartflows_admin&&cartflows_admin.old_global_checkout?parseInt(cartflows_admin.old_global_checkout,10):null;let r=!1;return e.forEach(e=>{e&&"object"==typeof e&&("landing"!==e.type?"checkout"===e.type&&(n?parseInt(e.id,10)!==n&&t.add(e.id):r?t.add(e.id):r=!0):t.add(e.id))}),t},filterMenuActions(e,t,n){if(!e||"object"!=typeof e)return e;const r={...e};return"checkout"===t?.type&&(delete r.clone,n||delete r.delete),n&&(delete r.clone,delete r.abtest),r}},_F=class{constructor(e,t,n,r,o="LR",a="horizontal",i=!1){this.steps=e,this.flowType=t,this.flowId=n,this.flowAnalytics=r,this.direction=o,this.axis=a,this.compact=i,this.offerSteps=["upsell","downsell"],this.nonOfferSteps=["landing","checkout","thankyou","optin"],this.storeCheckoutInvalidIds="storeCheckout"===t?EF.getInvalidStepIds(e):new Set,this.positionCalculator=new MF(e,t,a),this.calculatedPositions=null}initializePositions(){this.calculatedPositions=this.positionCalculator.calculate()}getStepPosition(e,t=0,n=0){if(this.calculatedPositions&&this.calculatedPositions.has(e)){const t=this.calculatedPositions.get(e);return{x:t.x,y:t.y}}return{x:t,y:n}}generateNodeId(e){return`wcf_node_edge_${e}`}getStepAnalytics(e){return this.flowAnalytics&&this.flowAnalytics.all_steps&&this.flowAnalytics.all_steps.find(t=>t.id===e)||null}isInvalidPosition(e){if(this.storeCheckoutInvalidIds.has(e.id))return!0;if(!this.offerSteps.includes(e.type))return!1;if(!e.offer_yes_step_id||!e.offer_no_step_id)return!0;const t=this.steps.map(e=>e.id),n=t.indexOf(e.id);return!hF.validateStepPosition(e,n,t,this.steps,this.flowType).isValid}createStartNode(){return{id:"wcf_start_node",type:"label",data:{position:"start",label:(0,j.__)("Start","cartflows"),direction:this.direction,axis:this.axis,compact:this.compact},position:{x:50,y:103}}}createEndNode(e){return{id:"wcf_end_node",type:"label",data:{position:"end",label:(0,j.__)("End","cartflows"),direction:this.direction,axis:this.axis,compact:this.compact},position:{x:e,y:103}}}hasABTestVariations(e){return e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}createRegularStepNode(e,t,n,r){const o=this.offerSteps.includes(e.type)?"offer":e.type,a=this.getStepAnalytics(e.id),i=this.isInvalidPosition(e),s="storeCheckout"===this.flowType&&this.storeCheckoutInvalidIds.has(e.id),l="storeCheckout"===this.flowType&&"checkout"===e.type&&!0===e.is_product_assigned;let c=e.is_product_assigned;(["landing","thankyou"].includes(e.type)||"storeCheckout"===this.flowType&&"checkout"===e.type)&&(c=!0);const u=e.actions?.view?.link||"",d=e.page_builder_edit?e.page_builder_edit.replace(/&amp;/g,"&"):"",f=e.actions?.edit?.link||"",p="storeCheckout"===this.flowType?EF.filterMenuActions(e.menu_actions,e,this.storeCheckoutInvalidIds.has(e.id)):e.menu_actions;return{id:this.generateNodeId(e.id),type:o,data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:e.type,control_id:e.id,editPage:d,editSettings:f,viewPageLink:u,index:t,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:p,ab_test_variations:e["ab-test-variations"],analytics:a,is_product_assigned:c,isInvalidPosition:i,is_locked:s,has_store_checkout_product_warning:l,warnings:yF(e,this.steps),step_disabled:e.step_disabled||!1,bumps:"checkout"===e.type&&e.bumps||[]},position:{x:n,y:r}}}createOfferABTestVariationNode(e,t,n,r){const o=this.getStepAnalytics(t.id),a=t.actions?.edit?.link||"";let i=e.is_product_assigned;(["landing","thankyou"].includes(t.type)||"storeCheckout"===this.flowType&&"checkout"===t.type)&&(i=!0);const s={id:t.id,type:t.type,offer_yes_step_id:e.offer_yes_step_id,offer_no_step_id:e.offer_no_step_id},l=this.isInvalidPosition(s),c=MF.calculateABVariationPosition(r);return{id:this.generateNodeId(e.id),type:"abtest",data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:t.type,control_id:t.id,editPage:e.actions?.edit?.link?e.actions.edit.link.replace(/&amp;/g,"&"):"",editSettings:a,viewPageLink:e.actions?.view?.link||"",index:n,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:e.menu_actions,analytics:o?o["visits-ab"][e.id]:null,traffic:e.traffic,var_badge_count:r,offer_yes_next_step:e.offer_yes_next_step,offer_no_next_step:e.offer_no_next_step,offer_yes_step_id:e.offer_yes_step_id,offer_no_step_id:e.offer_no_step_id,is_product_assigned:i,isInvalidPosition:l,isABTestVariation:!0,isGrouped:!0,step_disabled:e.step_disabled||!1},parentId:`offer-ab-group-${t.id}`,extent:"parent",connectable:!0,draggable:!1,position:c}}createABTestGroupNode(e,t,n){const r=e["ab-test-variations"],{width:o,height:a}=MF.calculateABGroupDimensions(r.length),i="vertical"===this.axis?-25:IF,s=this.flowId;return{id:`ab-group-${e.id}`,type:"group",data:{step:e,flow_id:s,label:e.title},position:{x:t,y:n+i},style:{width:o,height:a,backgroundColor:"transparent",border:"2px dashed #000000",borderRadius:"8px"}}}createOfferABTestGroupNode(e,t,n){const r=e["ab-test-variations"],{width:o,height:a}=MF.calculateABGroupDimensions(r.length),i=this.flowId;return{id:`offer-ab-group-${e.id}`,type:"group",data:{step:e,flow_id:i,label:e.title,isOfferABTestGroup:!0},position:{x:t,y:n+IF},style:{width:o,height:a,backgroundColor:"transparent",border:"2px dashed #000000",borderRadius:"8px"}}}createGroupedABTestVariationNode(e,t,n,r,o,a){const i=this.getStepAnalytics(t.id),s=t.actions?.edit?.link||"";let l=e.is_product_assigned;(["landing","thankyou"].includes(t.type)||"storeCheckout"===this.flowType&&"checkout"===t.type)&&(l=!0),t.type;const c=MF.calculateABVariationPosition(r);return{id:this.generateNodeId(e.id),type:"abtest",data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:t.type,control_id:t.id,editPage:e.actions?.edit?.link?e.actions.edit.link.replace(/&amp;/g,"&"):"",editSettings:s,viewPageLink:e.actions?.view?.link||"",index:n,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:e.menu_actions,analytics:i?i["visits-ab"][e.id]:null,traffic:e.traffic,var_badge_count:r,is_product_assigned:l,isInvalidPosition:!1,isABTestVariation:!0,isGrouped:!0,step_disabled:e.step_disabled||!1},parentId:`ab-group-${t.id}`,extent:"parent",connectable:!1,draggable:!1,position:c}}createConditionalNode(e,t,n){return{id:`conditional-${e.id}`,type:"conditional",position:{x:t,y:n},data:{checkoutId:e.id,conditions:e.conditions,defaultStep:e.default_step,editSettings:e.actions?.edit?.link||"",direction:this.direction,axis:this.axis,compact:this.compact,flow_type:this.flowType,flow_id:this.flowId,label:"Dynamic Offers"},style:{visibility:"visible"}}}buildNodes(){const e=[];this.initializePositions();let t=250;e.push(this.createStartNode()),this.steps.forEach((n,r)=>{if(!wcfCartflowsTypePlusPro()&&this.offerSteps.includes(n.type))return;const o=this.getStepPosition(n.id,t,0),a=o.x,i=o.y;if(gF.hasDynamicOffers(n)){if(this.hasABTestVariations(n)){const t=n["ab-test-variations"],o=this.createABTestGroupNode(n,a,i);e.push(o),t.forEach((t,o)=>{const s=this.createGroupedABTestVariationNode(t,n,r,o,a,i);e.push(s)})}else{const t=this.createRegularStepNode(n,r,a,i);e.push(t)}const o=a+bF,s=this.createConditionalNode(n,o,i);return e.push(s),void(t=o+vF)}if(this.hasABTestVariations(n)){const t=n["ab-test-variations"];if(this.offerSteps.includes(n.type)){const o=this.createOfferABTestGroupNode(n,a,i);e.push(o),t.forEach((t,o)=>{MF.calculateABVariationPosition(o);const a=this.createOfferABTestVariationNode(t,n,r,o);e.push(a)})}else{const o=this.createABTestGroupNode(n,a,i);e.push(o),t.forEach((t,o)=>{const s=this.createGroupedABTestVariationNode(t,n,r,o,a,i);e.push(s)})}}else{const t=this.createRegularStepNode(n,r,a,i);e.push(t)}t=a+bF});const n=this.positionCalculator.getMaxX(),r=Math.max(n+bF,t);return e.push(this.createEndNode(r)),e}},SF=class{constructor(e,t,n=!1,r="custom",o="horizontal"){this.steps=e,this.flowType=t,this.isAnimated=n,this.edgeType=r,this.axis=o,this.offerSteps=["upsell","downsell"]}targetHandleId(e="incoming"){return"vertical"===this.axis?"conditional"===e?"left":"top":"conditional"===e?"top":"left"}sourceHandleId(){return"vertical"===this.axis?"bottom":"right"}generateNodeId(e){return`wcf_node_edge_${e}`}hasABTestVariations(e){return e&&e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}getAllVariationIds(e){return this.hasABTestVariations(e)?e["ab-test-variations"].map(e=>e.id):[e.id]}isOfferStep(e){return e&&this.offerSteps.includes(e.type)}getTargetNodeIds(e){if(!this.hasABTestVariations(e))return[`wcf_node_edge_${e.id}`];if(this.isOfferStep(e)){return e["ab-test-variations"].map(e=>`wcf_node_edge_${e.id}`)}return[`ab-group-${e.id}`]}findStep(e){return this.steps.find(t=>t.id===e)}createStartEdges(){const e=[];if(0===this.steps.length)return e;const t=this.steps[0];return this.getTargetNodeIds(t).forEach(t=>{e.push({id:`wcf_start_node-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:"wcf_start_node",sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),e}createEndEdges(){const e=[];if(0===this.steps.length)return e;const t=this.steps[this.steps.length-1];return this.getTargetNodeIds(t).forEach(t=>{e.push({id:`${t}-wcf_end_node-edge`,animated:this.isAnimated,source:t,sourceHandle:this.sourceHandleId(),target:"wcf_end_node",targetHandle:this.targetHandleId(),type:this.edgeType,deletable:!0,focusable:!0,selectable:!0})}),e}createOfferEdges(e,t,n,r=null){const o=[],a=(r?"a"===n?r.offer_yes_step_id:r.offer_no_step_id:null)||t;if(!a)return o;const i=this.findStep(a);if(!i)return o;const s=this.getTargetNodeIds(i),l="a"===n,c=l?"accept":"reject",u={label:l?(0,j.__)("Accept","cartflows"):(0,j.__)("Reject","cartflows"),labelBgStyle:{fill:l?"#F0FDF4":"#FEF2F2",border:l?"#BBF7D0":"#FECACA"},labelStyle:{fill:l?"#16A34A":"#DC2626",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]};return s.forEach(t=>{o.push({id:`${e}-${t}-edge-${n}`,type:this.edgeType,animated:this.isAnimated,source:this.generateNodeId(e),sourceHandle:n,target:t,targetHandle:this.targetHandleId(),...u,data:{kind:c},deletable:!0,focusable:!0,selectable:!0})}),o}createCheckoutToConditionalEdge(e,t){const n=this.hasABTestVariations(e)?`ab-group-${e.id}`:`wcf_node_edge_${e.id}`;return{id:`${n}-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:n,sourceHandle:this.sourceHandleId(),target:t,deletable:!1,focusable:!0,selectable:!0}}getConditionalEdgeLabel(e,t){if(t.default_step&&parseInt(t.default_step,10)===parseInt(e,10))return{label:(0,j.__)("Default","cartflows"),kind:"default"};if(t.conditions&&Array.isArray(t.conditions))for(let n=0;n<t.conditions.length;n++){const r=t.conditions[n];if(r.step_id&&parseInt(r.step_id,10)===parseInt(e,10))return{label:(0,j.sprintf)(/* translators: %d is replaced with the condition number */ /* translators: %d is replaced with the condition number */
41 +(0,j.__)("Condition %d","cartflows"),n+1),kind:"condition"}}return{label:(0,j.__)("Condition","cartflows"),kind:"condition"}}createConditionalEdges(e,t){const n=[];return gF.getUniqueTargetSteps(e.conditions,e.default_step).forEach((r,o)=>{const a=this.findStep(r);if(!a)return void console.warn(`[EdgeBuilder] Target step ${r} not found`);const{label:i,kind:s}=this.getConditionalEdgeLabel(r,e),l={label:i,labelBgStyle:{fill:"#FDE68A",border:"1px solid #d1d5db"},labelStyle:{fill:"#D97706",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]},c=this.hasABTestVariations(a);this.offerSteps.includes(a.type)&&c?a["ab-test-variations"].forEach(e=>{const r=`wcf_node_edge_${e.id}`,o={id:`${t}-${r}-edge`,type:this.edgeType,animated:this.isAnimated,source:t,target:r,targetHandle:this.targetHandleId("conditional"),...l,deletable:!0,focusable:!0,selectable:!0,data:{kind:s,offerControlId:a.id}};n.push(o)}):this.getTargetNodeIds(a).forEach(e=>{const r={id:`${t}-${e}-edge`,type:this.edgeType,animated:this.isAnimated,source:t,target:e,targetHandle:this.targetHandleId("conditional"),...l,deletable:!0,focusable:!0,selectable:!0,data:{kind:s,controlId:a.id}};n.push(r)})}),n}createRegularEdges(e,t){const n=[],r=this.findStep(t);return r?(this.getTargetNodeIds(r).forEach(t=>{n.push({id:`${e}-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:this.generateNodeId(e),sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),n):n}createRegularEdgesFromGroup(e,t){const n=[],r=this.findStep(t);if(!r)return n;const o=this.getTargetNodeIds(r),a=`ab-group-${e}`;return o.forEach(t=>{n.push({id:`${e}-${t}-edge-group`,type:this.edgeType,animated:this.isAnimated,source:a,sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),n}createSequentialEdges(e,t,n){const r=[];if(!t)return r;if(gF.hasDynamicOffers(e))return r;const o=this.hasABTestVariations(e),a=this.offerSteps.includes(e.type);return o&&!a?(r.push(...this.createRegularEdgesFromGroup(e.id,t.id)),r):(this.getAllVariationIds(e).forEach(n=>{const i=o?e["ab-test-variations"].find(e=>e.id===n):null;if(a){const t=i?i.offer_yes_step_id:e.offer_yes_step_id,o=i?i.offer_no_step_id:e.offer_no_step_id;t&&r.push(...this.createOfferEdges(n,t,"a",i)),o&&r.push(...this.createOfferEdges(n,o,"b",i))}else r.push(...this.createRegularEdges(n,t.id))}),r)}buildEdges(){const e=[],t=new Set;this.steps.forEach(e=>{gF.hasDynamicOffers(e)&&gF.getUniqueTargetSteps(e.conditions,e.default_step).forEach(e=>t.add(e))});const n=this.createStartEdges();e.push(...n),this.steps.forEach((n,r)=>{if(!wcfCartflowsTypePlusPro()&&this.offerSteps.includes(n.type))return;if(t.has(n.id)){if(this.offerSteps.includes(n.type))if(this.hasABTestVariations(n))this.getAllVariationIds(n).forEach(t=>{const r=n["ab-test-variations"].find(e=>e.id===t);if(r){const n=r.offer_yes_step_id,o=r.offer_no_step_id;if(n){const o=this.createOfferEdges(t,n,"a",r);e.push(...o)}if(o){const n=this.createOfferEdges(t,o,"b",r);e.push(...n)}}});else{const t=n.offer_yes_step_id,r=n.offer_no_step_id;if(t){const r=this.createOfferEdges(n.id,t,"a",null);e.push(...r)}if(r){const t=this.createOfferEdges(n.id,r,"b",null);e.push(...t)}}return}const o=this.steps[r+1]||null,a=this.createSequentialEdges(n,o,r);e.push(...a)}),this.steps.forEach(t=>{if(!gF.hasDynamicOffers(t))return;const n=`conditional-${t.id}`,r=this.createCheckoutToConditionalEdge(t,n);e.push(r);const o=this.createConditionalEdges(t,n);e.push(...o)});const r=this.createEndEdges();return e.push(...r),e}},DF=class{constructor(e,t,n,r,o="LR",a="horizontal",i=!1){this.steps=e,this.direction=o,this.axis=a,this.compact=i,this.nodeBuilder=new _F(e,t,n,r,o,a,i),this.edgeBuilder=new SF(e,t,!1,"custom",a)}build(){const e=this.nodeBuilder.buildNodes(),t=this.edgeBuilder.buildEdges();return"vertical"===this.axis?{nodes:this.transpose(e),edges:t}:{nodes:e,edges:t}}transpose(e){return e.map(e=>e.parentId?e:{...e,position:{x:e.position.y,y:e.position.x}})}tidy(e,t){const n="vertical"===this.axis,r=new(mF().graphlib.Graph);let o="LR";n?o="TB":"RL"===this.direction&&(o="RL"),r.setGraph({rankdir:o,ranksep:150,nodesep:120,marginx:50,marginy:50}),r.setDefaultEdgeLabel(()=>({}));const a=new Set(e.filter(e=>e.parentId).map(e=>e.id)),i=this.compact?250:400,s=e=>"group"===e.type?e.style?.width||e.measured?.width||i:e.width||e.measured?.width||("label"===e.type?50:i),l=n?230:300,c=e=>{if("group"===e.type)return e.style?.height||e.measured?.height||300;const t=Array.isArray(e.data?.bumps)?e.data.bumps.length:0,r=n&&t?150+50*(t-1):0;return e.height||e.measured?.height||("label"===e.type?30:l+r)};return e.forEach(e=>{a.has(e.id)||r.setNode(e.id,{width:s(e),height:c(e)})}),t.forEach(e=>{a.has(e.source)||a.has(e.target)||r.setEdge(e.source,e.target)}),mF().layout(r),e.map(e=>{if(a.has(e.id))return e;const t=r.node(e.id);return t?{...e,position:n?{x:e.position.x,y:t.y-t.height/2}:{x:t.x-t.width/2,y:e.position.y}}:e})}static structuralKey(e,t,n="horizontal",r=!1){return e.map(e=>`${e.id}:${e.type}:${e.title}`).join("|")+`:${t}:${n}:${r?"c":"d"}`}},jF=class{constructor(e,t,n,r,o,a,i,s,l,c){this.steps=e,this.flowType=t,this.flowId=n,this.nodes=r,this.edges=o,this.setEdges=a,this.setReorderError=i,this.dispatch=s,this.renderCb=c,this.setSettingsStatus=l,this.offerSteps=["upsell","downsell"],this.edgeType="custom"}extractStepId(e){if(!e)return null;if("wcf_start_node"===e)return"START";if("wcf_end_node"===e)return"END";const t=e.match(/ab-group-(\d+)/);if(t)return parseInt(t[1],10);const n=e.match(/wcf_node_edge_(\d+)/);return n?parseInt(n[1],10):null}generateNodeId(e){return`wcf_node_edge_${e}`}findStep(e){return this.steps.find(t=>t.id===e)}getControlId(e){if("wcf_start_node"===e||"wcf_end_node"===e)return this.extractStepId(e);const t=this.nodes.find(t=>t.id===e);return t?"group"===t.type?this.extractStepId(e):t.data&&t.data.control_id?t.data.control_id:this.extractStepId(e):this.extractStepId(e)}hasABTestVariations(e){return e&&e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}isOfferStep(e){return e&&this.offerSteps.includes(e.type)}getTargetNodeId(e){return this.hasABTestVariations(e)?this.isOfferStep(e)?null:`ab-group-${e.id}`:`wcf_node_edge_${e.id}`}getAllTargetNodeIds(e){return this.hasABTestVariations(e)?this.isOfferStep(e)?e["ab-test-variations"].map(e=>`wcf_node_edge_${e.id}`):[`ab-group-${e.id}`]:[`wcf_node_edge_${e.id}`]}updateOfferRedirection(e,t,n){const r=new window.FormData;return r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",this.flowId),r.append("step_id",e),"a"===t?r.append("wcf-yes-next-step",n):"b"===t&&r.append("wcf-no-next-step",n),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>(e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb()),e)).catch(e=>{throw console.error("[ConnectionHandler] AJAX error:",e),e})}updateStepConnection(e,t){const n=new window.FormData;return n.append("action","cartflows_save_meta_settings"),n.append("security",cartflows_admin.save_meta_settings_nonce),n.append("post_id",this.flowId),n.append("step_id",e),n.append("wcf-next-step-id","END"===t?"":t),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>(e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb()),e)).catch(e=>{throw console.error("[ConnectionHandler] Non-offer connection AJAX error:",e),e})}validateConnection(e,t,n){const r=[],o=this.getControlId(e.id),a=this.getControlId(t.id);if("START"===o||"END"===a)return{isValid:!0,errors:[],warnings:[]};const i=this.findStep(o),s=this.findStep(a);if(!i||!s)return r.push((0,j.__)("Invalid step connection.","cartflows")),{isValid:!1,errors:r};if(o===a)return r.push((0,j.__)("Step cannot connect to itself.","cartflows")),{isValid:!1,errors:r};if(this.offerSteps.includes(i.type)){if(["landing","checkout"].includes(s.type))return r.push((0,j.__)("Offer steps can only connect to other Offer steps, Optin, or Thank You page.","cartflows")),{isValid:!1,errors:r};if(!["upsell","downsell","optin","thankyou"].includes(s.type))return r.push((0,j.__)("Offer steps can only connect to other Offer steps, Optin, or Thank You page.","cartflows")),{isValid:!1,errors:r}}const l=this.steps.map(e=>e.id);return hF.validateConnection({...e,type:i.type,id:`wcf_node_edge_${o}`},{...t,type:s.type,id:`wcf_node_edge_${a}`},n,{steps:this.steps,stepOrder:l})}createEdgeData(e,t,n){let r={...e,animated:!1,type:this.edgeType,deletable:!0,focusable:!0,selectable:!0};return n&&e.sourceHandle&&("a"===e.sourceHandle?r={...r,label:(0,j.__)("Accept","cartflows"),labelBgStyle:{fill:"#BBF7D0",border:"1px solid #d1d5db"},labelStyle:{fill:"#16A34A",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]}:"b"===e.sourceHandle&&(r={...r,label:(0,j.__)("Reject","cartflows"),labelBgStyle:{fill:"#FEF2F2",border:"1px solid #d1d5db"},labelStyle:{fill:"#DC2626",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]})),r}handleConnect(e){const t=this.nodes.find(t=>t.id===e.source),n=this.nodes.find(t=>t.id===e.target);if(!t||!n)return void console.error("[ConnectionHandler] Source or target node not found");const r=this.getControlId(e.source),o=this.getControlId(e.target),a="START"===r,i="END"===o,s=a?null:this.findStep(r),l=i?null:this.findStep(o);if(!(a||i||s&&l))return console.error("[ConnectionHandler] Source or target step not found"),void console.error("[ConnectionHandler] Available steps:",this.steps.map(e=>e.id));const c=this.validateConnection(t,n,e.sourceHandle);if(!c.isValid)return console.error("[ConnectionHandler] Connection validation failed:",c.errors),this.setReorderError(c.errors[0]),void setTimeout(()=>{this.setReorderError(null)},4e3);const u=s&&this.offerSteps.includes(s.type),d=e.sourceHandle,f=this.createEdgeData(e,s,u),p=i?[e.target]:this.getAllTargetNodeIds(l),m=this.extractStepId(e.source);if(p.length>1){const e=[];p.forEach((t,n)=>{const r={...f,id:`${m}-${t}-edge${d?"-"+d:""}-${n}`,target:t};e.push(r)}),this.setEdges(t=>[...t,...e])}else{f.target=p[0];const e=_T(f,this.edges);this.setEdges(e)}u&&d?(0,Eg.$h)(this.updateOfferRedirection(m,d,o)):!a&&s&&(0,Eg.$h)(this.updateStepConnection(m,o))}},kF=class{constructor(e,t,n,r,o){this.steps=e,this.dispatch=t,this.flowId=n,this.setSettingsStatus=r,this.renderCb=o}async handleDeletion(e){if(!gF.isConditionalEdge(e))return!1;const t=gF.extractCheckoutId(e.source),n=gF.extractStepId(e.target,this.steps);if(!t||!n)return!1;const r=this.steps.find(e=>e.id===t);if(!r||!r.conditions)return console.warn("[ConditionalEdgeHandler] Checkout step or conditions not found"),!1;const o=gF.removeConditionsForStep(r.conditions,n),a=gF.updateDefaultStep(r.default_step,n,o);return await this.saveRules(t,o,a),!0}async saveRules(e,t,n){const r=gF.buildRulesFormData(e,this.flowId,t,n);try{const e=await(0,Eg.$h)(Ep()({url:cartflows_admin.ajax_url,method:"POST",body:r}));e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb())}catch(e){console.error("[ConditionalEdgeHandler] Failed to save rules:",e)}}hasConditionalRules(e){const t=this.steps.find(t=>t.id===e);return gF.hasDynamicOffers(t)}},CF=class{constructor(e,t,n,r,o,a,i,s){this.edges=e,this.setEdges=t,this.onEdgesChangeInternal=n,this.steps=r,this.dispatch=o,this.flowId=a,this.setSettingsStatus=i,this.renderCb=s,this.conditionalHandler=new kF(r,o,a,i,s)}findRelatedEdges(e){const t=this.edges.find(t=>t.id===e);if(!t)return[];if(t.source&&t.source.startsWith("conditional-")&&t.target){const n=gF.extractStepId(t.target,this.steps);if(n){const r=this.steps.find(e=>e.id===n);if(r&&r["ab-test-variations"]&&Array.isArray(r["ab-test-variations"])&&r["ab-test-variations"].length>1){const r=this.edges.filter(r=>!(r.id===e||r.source!==t.source||!r.target)&&gF.extractStepId(r.target,this.steps)===n);return r}}}return t.data&&t.data.offerControlId?this.edges.filter(n=>n.id!==e&&n.data&&n.data.offerControlId===t.data.offerControlId):t.sourceHandle?this.edges.filter(n=>n.id!==e&&n.source===t.source&&n.sourceHandle===t.sourceHandle):[]}async handleEdgeChanges(e){const t=e.filter(e=>"remove"===e.type);if(t.length>0){const n=[];for(const e of t){const t=this.edges.find(t=>t.id===e.id);if(!t)continue;if(await this.conditionalHandler.handleDeletion(t))return;const r=this.findRelatedEdges(e.id);for(const e of r)n.push({type:"remove",id:e.id})}n.length>0&&(e=[...e,...n])}this.onEdgesChangeInternal(e)}},AF=()=>{const e=(0,d.useHistory)(),[{flow_type:t,flow_id:n}]=Nm(),r="storeCheckout"===t,[o,a]=(0,i.useState)(null),s=async({key:e,flowName:t,instantLayout:n})=>{if(!o){a(e);try{const e=await(({flowName:e,instantLayout:t})=>{const n=new window.FormData;return n.append("action","cartflows_create_flow"),n.append("security",cartflows_admin.create_flow_nonce),n.append("flow_name",e),n.append("creation_method","scratch"),n.append("instant_layout",t?"true":"false"),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n})})({flowName:t,instantLayout:n});if(!e?.success)return Wm.error((0,j.__)("Failed to create funnel.","cartflows")),void a(null);Wm.success((0,j.__)("Funnel created.","cartflows")),window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e.data.flow_id}`}catch(e){Wm.error((0,j.__)("Failed to create funnel.","cartflows")),a(null)}}},l=[{key:"template",icon:Mh,title:(0,j.__)("Use a template","cartflows"),description:(0,j.__)("Start with a proven layout from our template library.","cartflows"),cta:(0,j.__)("Browse templates","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:"?page=cartflows&path=library"})}},{key:"quick-checkout",icon:Xg,title:(0,j.__)("Quick checkout","cartflows"),description:(0,j.__)("Spin up a checkout funnel with Instant Layout enabled.","cartflows"),cta:(0,j.__)("Create checkout funnel","cartflows"),onClick:()=>s({key:"quick-checkout",flowName:(0,j.__)("Quick Checkout Funnel","cartflows"),instantLayout:!0})},{key:"scratch",icon:Kx,title:(0,j.__)("Build from scratch","cartflows"),description:(0,j.__)("Start with an empty funnel and add steps yourself.","cartflows"),cta:(0,j.__)("Create blank funnel","cartflows"),onClick:()=>s({key:"scratch",flowName:(0,j.__)("New Funnel","cartflows"),instantLayout:!1})}],c=[{key:"store-template",icon:Mh,title:(0,j.__)("Use a Store Checkout template","cartflows"),description:(0,j.__)("Start from a ready-made Store Checkout layout.","cartflows"),cta:(0,j.__)("Browse templates","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:"?page=cartflows&path=store-checkout-library"})}},{key:"store-add-step",icon:Kx,title:(0,j.__)("Add a step","cartflows"),description:(0,j.__)("Pick a step type to add to this Store Checkout.","cartflows"),cta:(0,j.__)("Add step","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&tab=library`})}}],u=r?c:l,f=r?(0,j.__)("Start building your Store Checkout","cartflows"):(0,j.__)("Create your first funnel","cartflows"),p=r?(0,j.__)("Pick a starting point for this Store Checkout — you can always change things later.","cartflows"):(0,j.__)("Pick how you’d like to begin — you can always change things later.","cartflows"),m=`grid grid-cols-1 ${2===u.length?"md:grid-cols-2":"md:grid-cols-3"} gap-4`;return(0,i.createElement)(ph,{align:"center",justify:"center",className:"wcf-canvas-empty-state w-full h-full bg-background-secondary"},(0,i.createElement)(ph,{direction:"column",gap:"lg",className:"wcf-canvas-empty-state__panel max-w-4xl w-full mx-auto px-6 py-10"},(0,i.createElement)(ph,{direction:"column",align:"center",gap:"xs",className:"text-center"},(0,i.createElement)(v_,{tag:"h2",size:"md",title:f}),(0,i.createElement)(vh,{size:16,color:"secondary"},p)),(0,i.createElement)("div",{className:m},u.map(e=>{const t=e.icon,n=o===e.key;return(0,i.createElement)(ph,{key:e.key,direction:"column",align:"start",gap:"sm",className:"wcf-canvas-empty-state__card p-5 bg-background-primary rounded-lg border-0.5 border-solid border-border-subtle shadow-sm"},(0,i.createElement)(ph,{align:"center",justify:"center",className:"wcf-canvas-empty-state__icon w-10 h-10 rounded-md bg-primary-50 text-primary-500"},(0,i.createElement)(t,{className:"w-5 h-5 stroke-2"})),(0,i.createElement)(v_,{tag:"h3",size:"sm",title:e.title}),(0,i.createElement)(vh,{size:14,color:"secondary",className:"flex-1"},e.description),(0,i.createElement)(Ro,{variant:"secondary",size:"sm",loading:n,disabled:!!o&&!n,onClick:e.onClick},e.cta))}))))},TF=[{label:(0,j.__)("Open shortcuts panel","cartflows"),keys:["mod","/"]},{label:(0,j.__)("Open shortcuts panel (alt)","cartflows"),keys:["?"]},{label:(0,j.__)("Exit fullscreen","cartflows"),keys:["Esc"]},{label:(0,j.__)("Fit canvas to view","cartflows"),keys:["F"]},{label:(0,j.__)("Tidy layout","cartflows"),keys:["T"]},{label:(0,j.__)("Toggle vertical / horizontal layout","cartflows"),keys:["V"]},{label:(0,j.__)("Toggle minimap","cartflows"),keys:["M"]},{label:(0,j.__)("Toggle compact / detailed cards","cartflows"),keys:["C"]},{label:(0,j.__)("Zoom in","cartflows"),keys:["+"]},{label:(0,j.__)("Zoom out","cartflows"),keys:["−"]},{label:(0,j.__)("Duplicate selected step","cartflows"),keys:["mod","D"]},{label:(0,j.__)("Delete selected node","cartflows"),keys:["Backspace"]}],LF=({children:e})=>(0,i.createElement)("kbd",{className:"inline-flex items-center justify-center min-w-[1.75rem] h-7 px-2 text-xs font-medium text-text-primary bg-background-secondary border border-solid border-border-subtle rounded shadow-sm"},e),OF=({open:e,onClose:t})=>{const n="undefined"!=typeof navigator&&/mac|iphone|ipad|ipod/i.test(navigator.platform||"")?"⌘":"Ctrl";return(0,i.createElement)(Jh,{open:!!e,setOpen:e=>{e||t?.()},exitOnEsc:!0,exitOnClickOutside:!0,scrollLock:!0},(0,i.createElement)(Jh.Portal,null,(0,i.createElement)(Jh.Panel,{className:"max-w-xl gap-0"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Header,{className:"flex items-center justify-between px-6 pt-5 pb-0"},(0,i.createElement)(Jh.Title,null,(0,j.__)("Keyboard shortcuts","cartflows")),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)(Jh.Body,{className:"px-6 py-4"},(0,i.createElement)(ph,{direction:"column",gap:"sm",className:"m-0 p-0"},TF.map((e,t)=>(0,i.createElement)(ph,{key:t,align:"center",justify:"between",gap:"md"},(0,i.createElement)(vh,{size:14,color:"primary"},e.label),(0,i.createElement)(ph,{align:"center",gap:"xs"},e.keys.map((e,t)=>(0,i.createElement)(i.Fragment,{key:t},t>0&&(0,i.createElement)(vh,{size:12,color:"tertiary"},"+"),(0,i.createElement)(LF,null,"mod"===e?n:e)))))))))))},zF="wcf_canvas_axis",PF="wcf_canvas_minimap",RF="wcf_canvas_compact",UF=()=>"vertical"===window.localStorage.getItem(zF)?"vertical":"horizontal",BF=()=>{const e=window.localStorage.getItem(PF);return null===e||"true"===e},FF=()=>{const e=window.localStorage.getItem(RF);return null===e?null:"true"===e},YF={custom:function(e){const{id:t,sourceX:n,sourceY:r,targetX:o,targetY:a,sourcePosition:s,targetPosition:l,style:c={},label:u,labelStyle:f,labelBgStyle:p,data:m,markerEnd:h}=e,g=m?.edgeStyle||"smoothstep",[w,y,b]="bezier"===g?NT({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:l}):CT({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:l}),v=!!u,x=m?.kind;let N=24;"accept"===x||"reject"===x?N=80:("condition"===x||"default"===x)&&(N=110);const[{flow_id:I,flow_type:M}]=Nm(),E=(0,d.useHistory)(),_=e=>{if(!e)return null;if("wcf_start_node"===e||"start"===e||"wcf_end_node"===e||"end"===e)return e;if(e.includes("wcf_node_edge_")){const t=parseInt(e.replace("wcf_node_edge_",""),10);return isNaN(t)?null:t}if(e.startsWith("conditional-")){const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}if(e.startsWith("ab-group-")){const t=parseInt(e.replace("ab-group-",""),10);return isNaN(t)?null:t}return null},S=!("wcf_end_node"===e.target||"end"===e.target||e.target&&e.target.startsWith("conditional-"));return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(az,{id:t,path:w,style:c,markerEnd:h,interactionWidth:20}),(0,i.createElement)(qz,null,(0,i.createElement)("div",{className:"nodrag nopan wcf-edge-add-button flex items-center justify-center gap-1",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${y}px, ${b}px)`,pointerEvents:"all",width:N,height:v?32:24,backgroundColor:p?.fill,borderRadius:"14px",border:p?.border,padding:v?"4px 6px":"0",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"}},v&&(0,i.createElement)("span",{style:{color:f?.fill,fontWeight:f?.fontWeight,fontSize:f?.fontSize,lineHeight:1,paddingLeft:"4px"}},u),S&&(0,i.createElement)("button",{onClick:t=>{t.stopPropagation();const n=_(e.source),r=_(e.target),o=e.sourceHandle?e.sourceHandle:"accept"===x?"a":"reject"===x?"b":null;if(null!==n&&null!==r){const e={sourceStepId:n,targetStepId:r,sourceHandle:o};window.sessionStorage.setItem("wcf_edge_insertion_context",JSON.stringify(e))}const a="storeCheckout"===M?"admin.php?page=cartflows&path=store-checkout":"admin.php?page=cartflows&path=flows",i=`&action=wcf-edit-flow&flow_id=${I}&tab=library`;E.push({pathname:a,search:i})},className:"flex items-center justify-center hover:opacity-80 transition-opacity cursor-pointer",style:{width:v?"20px":"24px",height:v?"20px":"24px",backgroundColor:v?"white":"#f3f4f6",borderRadius:"50%",border:v?"none":"1px solid #4b5563",padding:0},title:"Add new step"},(0,i.createElement)(Kx,{className:"text-primary-600",style:{width:v?"14px":"16px",height:v?"14px":"16px"}})))))}},ZF={label:EP,conditional:DP,landing:eR,checkout:nR,offer:WB,thankyou:QB,optin:XB,abtest:KB,group:fF},VF={x:0,y:150,zoom:.75},GF=[10,10],WF={padding:.2,duration:400,minZoom:.3},HF=({x:e,y:t,width:n,height:r,color:o,strokeColor:a,strokeWidth:s,borderRadius:l})=>{const c=e+n/2,u=t+r/2;return(0,i.createElement)("rect",{x:c-160,y:u-120,width:320,height:240,fill:o,stroke:a,strokeWidth:s,rx:l,ry:l})};function QF({renderCb:e}){const[{steps:t,flow_type:n,flow_id:r,flow_analytics:o,emptySteps:a},s]=Nm(),[{},c]=l(),u=(0,i.useMemo)(()=>wcfCartflowsPro()?t:t.filter(e=>"upsell"!==e.type&&"downsell"!==e.type),[t]),[d,f]=(0,i.useState)(""),[m,h]=(0,i.useState)(!1),[g,w]=(0,i.useState)(null),[y,b]=(0,i.useState)("smoothstep"),[v,x]=(0,i.useState)(!0),N=(0,i.useMemo)(()=>({deletable:!0,focusable:!0,selectable:!0,style:{stroke:"#4B5563",strokeWidth:1},markerEnd:{type:DA.ArrowClosed,width:40,height:40,color:"#f06434"},data:{edgeStyle:y}}),[y]),I=""!==d?"wcf-fullscreen":"",M=cartflows_admin.is_rtl?"RL":"LR",E={direction:"initial"},[_,S,D]=function(){const[e,t]=(0,p.useState)([]),n=(0,p.useCallback)(e=>t(t=>cO(e,t)),[]);return[e,t,n]}(),[k,C,A]=function(){const[e,t]=(0,p.useState)([]),n=(0,p.useCallback)(e=>t(t=>uO(e,t)),[]);return[e,t,n]}(),{axis:T,setAxis:L,toggleAxis:O,showMinimap:z,setShowMinimap:P,compact:R,toggleCompact:U}=(({autoCompact:e=!1}={})=>{const[t,n]=(0,i.useState)(UF),[r,o]=(0,i.useState)(BF),[a,s]=(0,i.useState)(FF),l=(0,i.useCallback)(e=>{const t="vertical"===e?"vertical":"horizontal";window.localStorage.setItem(zF,t),n(t)},[]),c=(0,i.useCallback)(()=>{l("horizontal"===UF()?"vertical":"horizontal")},[l]),u=(0,i.useCallback)(e=>{const t=!!e;window.localStorage.setItem(PF,String(t)),o(t)},[]),d=(0,i.useCallback)(e=>{const t=!!e;window.localStorage.setItem(RF,String(t)),s(t)},[]),f=(0,i.useCallback)(()=>{d(!(null===a?e:a))},[a,e,d]);return{axis:t,setAxis:l,toggleAxis:c,showMinimap:r,setShowMinimap:u,compact:null===a?e:a,setCompact:d,toggleCompact:f}})({autoCompact:u.length>12}),[B,F]=(0,i.useState)(0),Y=(0,i.useRef)(T),Z=(0,i.useRef)(R),{fitView:V,zoomIn:G,zoomOut:W,setCenter:H,getViewport:Q}=xO(),{zoom:$}=CL(Kz,SL),X=oO("Escape"),[J,q]=(0,i.useState)(!1),[K,ee]=(0,i.useState)(0),te=()=>{c({status:"SAVED"}),F(e=>e+1),e(),setTimeout(()=>V(WF),50)};(0,i.useEffect)(()=>{const e=new DF(u,n,r,o,M,T,R),t=e.build(),a=B>0?e.tidy(t.nodes,t.edges):t.nodes,i=t.edges.map(e=>({...e,data:{...e.data,edgeStyle:y}})),s=Y.current!==T;Y.current=T;const l=Z.current!==R;Z.current=R;const c=B>0||s||l;S(e=>{if(c)return a;const t=new Map(e.map(e=>[e.id,e.position]));return a.map(e=>e.id.startsWith("wcf_node_edge_")&&t.has(e.id)?{...e,position:t.get(e.id)}:e)}),C(i)},[u,n,r,o,M,T,R,B,S,C]);const ne=(0,i.useCallback)(t=>{new jF(u,n,r,_,k,C,w,s,c,e).handleConnect(t)},[u,n,r,_,k,C,s,c,e]),re=(0,i.useCallback)(t=>{new CF(k,C,A,u,s,r,c,e).handleEdgeChanges(t)},[k,C,A,u,s,r,c,e]);(0,i.useEffect)(()=>{C(e=>e.map(e=>({...e,data:{...e.data,edgeStyle:y}})))},[y,C]),(0,i.useEffect)(()=>(document.body.classList.add("wcf-flow-overview-screen"),()=>document.body.classList.remove("wcf-flow-overview-screen")),[]),(0,i.useEffect)(()=>{X&&"fullscreen"===d&&(f(""),V(WF))},[X,d,V]),(0,i.useEffect)(()=>{const e=e=>{const t=e.key,n=e.target?.tagName;if("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n&&!e.target?.isContentEditable){if(e.metaKey||e.ctrlKey)return"d"===t.toLowerCase()?(e.preventDefault(),void ee(e=>e+1)):"/"===t?(e.preventDefault(),void q(e=>!e)):void 0;if(e.altKey||e.shiftKey)"?"===t&&(e.preventDefault(),q(e=>!e));else switch(t.toLowerCase()){case"f":e.preventDefault(),V(WF);break;case"t":e.preventDefault(),te();break;case"v":e.preventDefault(),O(),setTimeout(()=>V(WF),50);break;case"m":e.preventDefault(),P(!z);break;case"c":e.preventDefault(),U(),setTimeout(()=>V(WF),50);break;case"+":case"=":e.preventDefault(),G({duration:200});break;case"-":e.preventDefault(),W({duration:200})}}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[V,G,W,O,U,z,P]),(0,i.useEffect)(()=>{if(!K)return;const e=_.find(e=>e.selected&&e.id?.startsWith("wcf_node_edge_"));if(!e)return;const t=e.data?.step_id;if(!t)return;const n=!!e.data?.isABTestVariation;KP.cloneStepRequest({stepId:t,flowId:e.data?.flow_id||r,action:n?"cartflows_clone_ab_test_step":"cartflows_clone_step",controlId:e.data?.control_id}).then(e=>{!1!==e?.success&&window.location.reload()})},[K,_,r]);const oe=()=>{f("fullscreen"),h(!0),setTimeout(()=>{h(!1)},3e3),V(WF)},ae=()=>{f(""),V(WF)};return u.length<=0?(0,i.createElement)("div",{className:`wcf-steps-chart wcf-steps-chart--empty flex w-full h-screen items-center justify-center ${I}`,style:E},a?(0,i.createElement)(AF,null):(0,i.createElement)(zw,{variant:"primary",size:"lg"})):(0,i.createElement)("div",{className:`wcf-steps-chart flex justify-center mx-auto h-screen w-full ${I}`,style:E},_.length>0&&(0,i.createElement)(Xz,{minZoom:.3,maxZoom:1,nodes:_,edges:k,edgeTypes:YF,colorMode:"light",onNodesChange:D,onEdgesChange:re,onConnect:ne,nodeTypes:ZF,snapToGrid:!0,snapGrid:GF,defaultViewport:VF,onInit:e=>{e.fitView(WF)},zoomOnScroll:!1,panOnScroll:!0,panOnScrollMode:"free",elementsSelectable:v,preventScrolling:!1,nodesDraggable:v,nodesConnectable:v,edgesFocusable:!0,reconnectRadius:20,elevateEdgesOnSelect:!0,edgesUpdatable:!1,deleteKeyCode:"Backspace",defaultEdgeOptions:N},(0,i.createElement)(iP,{variant:"dots",gap:16,size:1,color:"#d1d5db"}),z&&(0,i.createElement)(IP,{pannable:!0,zoomable:!0,position:cartflows_admin.is_rtl?"bottom-left":"bottom-right",bgColor:"#ffffff",nodeColor:"#ffedd5",nodeStrokeColor:"#fdba74",nodeStrokeWidth:1,nodeBorderRadius:3,nodeComponent:HF,maskColor:"rgba(240, 100, 52, 0.04)",maskStrokeColor:"#fdba74",maskStrokeWidth:.5,onClick:(e,t)=>{H(t.x,t.y,{zoom:Q().zoom,duration:400})},style:{width:160,height:100,border:"1px solid #ffedd5",borderRadius:"6px",boxShadow:"0 2px 8px rgba(240, 100, 52, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04)"}}),(0,i.createElement)(FL,{position:"top-right",className:"flex flex-col items-end gap-2"},(0,i.createElement)("div",{className:"inline-flex items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Vertical Layout","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(vD,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,j.__)("Vertical Layout","cartflows"),onClick:()=>{"vertical"!==T&&(L("vertical"),setTimeout(()=>V(WF),50))}})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Horizontal Layout","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(xD,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,j.__)("Horizontal Layout","cartflows"),onClick:()=>{"horizontal"!==T&&(L("horizontal"),setTimeout(()=>V(WF),50))}}))),(0,i.createElement)("div",{className:"inline-flex flex-col items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:v?(0,j.__)("Lock Interaction","cartflows"):(0,j.__)("Unlock Interaction","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hidden hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:v?(0,i.createElement)(ND,{className:"!fill-[none] stroke-[1.5]"}):(0,i.createElement)(ID,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":v?(0,j.__)("Lock Interaction","cartflows"):(0,j.__)("Unlock Interaction","cartflows"),onClick:()=>x(!v)})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:"smoothstep"===y?(0,j.__)("Switch to Wavy Edges","cartflows"):(0,j.__)("Switch to Smooth Edges","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:"smoothstep"===y?(0,i.createElement)(MD,{className:"!fill-[none] stroke-[1.5]"}):(0,i.createElement)(ED,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,j.__)("Edge Style","cartflows"),onClick:()=>{b(e=>"smoothstep"===e?"bezier":"smoothstep")}})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Tidy Layout","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(_D,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,j.__)("Tidy Layout","cartflows"),onClick:te})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Fit View","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hidden hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(SD,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,j.__)("Fit View","cartflows"),onClick:()=>V(WF)})),(()=>{const e="fullscreen"===d;return(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:e?(0,j.__)("Exit Full Screen","cartflows"):(0,j.__)("Full Screen","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:e?(0,i.createElement)(yD,{className:"!fill-[none] stroke-[1.5]"}):(0,i.createElement)(bD,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":e?(0,j.__)("Exit Full Screen","cartflows"):(0,j.__)("Full Screen","cartflows"),onClick:e?ae:oe}))})(),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Keyboard Shortcuts (?)","cartflows"),placement:"left"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(DD,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,j.__)("Keyboard Shortcuts","cartflows"),onClick:()=>q(!0)})))),(0,i.createElement)(FL,{position:"bottom-left"},(0,i.createElement)("div",{className:"inline-flex items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",onClick:()=>V(WF)},(0,j.__)("Fit","cartflows")),(0,i.createElement)("div",{className:"w-px h-4 bg-border-subtle","aria-hidden":"true"}),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(uw,{className:"stroke-[1.5]"}),"aria-label":(0,j.__)("Zoom Out","cartflows"),onClick:()=>W({duration:200})}),(0,i.createElement)(vh,{size:12,weight:600,className:"tabular-nums min-w-[44px] text-center"},Math.round(100*$),"%"),(0,i.createElement)(Ro,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,i.createElement)(ey,{className:"stroke-[1.5]"}),"aria-label":(0,j.__)("Zoom In","cartflows"),onClick:()=>G({duration:200})}))),m&&(0,i.createElement)(FL,{position:"top-center",className:"wcf-steps-chart__exit-screen-msg"},(0,j.__)("Press ESC to exit full screen.","cartflows")),g&&(0,i.createElement)(FL,{position:"top-center",className:"wcf-steps-chart__error-msg"},g)),(0,i.createElement)(OF,{open:J,onClose:()=>q(!1)}))}const $F=function(e){return(0,i.createElement)(Hz,null,(0,i.createElement)(QF,e))},XF=function({renderCb:e}){return(0,i.createElement)("div",{className:"wcf-steps-page-wrapper border-t border-border-subtle -mt-px"},(0,i.createElement)($F,{renderCb:e}))};function JF({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75v6.75m0 0-3-3m3 3 3-3m-8.25 6a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const qF=p.forwardRef(JF);function KF({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"}))}const eY=p.forwardRef(KF);function tY({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const nY=p.forwardRef(tY),rY=e=>{var t;const{steps:n}=e,[r,o]=(0,i.useState)(""),[a,s]=(0,i.useState)(""),[{flow_id:l,flow_title:c,flow_type:u},f]=Nm(),p=(0,d.useHistory)(),m=null!==(t=new URLSearchParams((0,d.useLocation)()?.search).get("automation"))&&void 0!==t?t:"";(0,i.useEffect)(()=>{const e=n.find(e=>e.id===parseInt(m));e&&(o(e.title),s(e.type))},[m,n]);return(0,i.useEffect)(()=>{r&&(()=>{const e=new window.FormData;e.append("action","cartflows_get_suretriggers_data"),e.append("security",cartflows_admin.get_suretriggers_data_nonce),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e&&e?.success&&e?.data?.connected&&(e=>{if(e&&c){let t=[];switch(a){case"upsell":t=["cartflows_upsell_offer_accepted","cartflows_upsell_offer_rejected","cartflows_upsell_offer_skipped"];break;case"checkout":t=["wcf_order_bump_item_added","wcf_order_bump_item_removed","wcf_pre_checkout_offer_item_added","wcf_order_bump_item_replaced"];break;case"downsell":t=["cartflows_downsell_offer_accepted","cartflows_downsell_offer_rejected","cartflows_downsell_offer_skipped"]}e.embedded_identifier=m,t&&t.length>0&&(e.allowed_events={CartFlows:{triggers:t}}),e.selected_options={funnel_id:{value:l,label:c},funnel_step_id:{value:m,label:r}},f({type:"SET_SURETRIGGERS_CONFIG",config:e})}})(e?.data?.data)})})()},[r]),(0,i.createElement)(bS,{open:""!==m,setOpen:e=>{e||p.push("storeCheckout"===u?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${l}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${l}`)},position:"right",exitOnClickOutside:!0,exitOnEsc:!1,className:"wcf-funnel-step-setting--slide-out"},(0,i.createElement)(bS.Panel,{className:"pointer-events-auto w-screen max-w-4.5xl relative top-1"},(0,i.createElement)(bS.Backdrop,null),(0,i.createElement)("div",{className:"wcf-slide-out-panel--close bg-background-primary absolute -left-10"},(0,i.createElement)(_,{key:"close",to:{pathname:"admin.php",search:"storeCheckout"===u?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${l}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${l}`},className:"flex justify-center items-center p-2.5 text-text-tertiary hover:text-text-secondary outline-none focus:outline-none shadow-none focus:shadow-none"},(0,i.createElement)("button",{type:"button",onClick:()=>{o("")}},(0,i.createElement)(ZB,{className:"w-5 h-5","aria-hidden":"true"})))),(0,i.createElement)(bS.Body,{className:"wcf-slide-out-panel--content-body flex h-full flex-col overflow-y-scroll bg-background-primary shadow-xl !p-0"},!1,(0,i.createElement)("form",null,(0,i.createElement)(bS.Header,{className:"wcf-slide-out-panel--header flex justify-between px-6 py-5 !space-y-0"},(0,i.createElement)("div",{className:"wcf-slide-out-panel--step-title"},(0,i.createElement)(bS.Title,{className:"text-lg font-medium text-text-primary"},(0,j.__)("Automation for","cartflows"),":"," ",r))),(0,i.createElement)("div",{className:"wcf-slide-out-panel--settings flex-1 p-8 border-t border-border-subtle px-6"},(0,i.createElement)("div",{id:"suretriggers-iframe-wrapper",style:{width:"100%",height:"80vh"}}))))))},oY=function({flowId:e,flowType:t,showConnectorLines:n=!0,tooltipPlacement:r="right"}){const o="storeCheckout"===t?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e}&tab=library`;return(0,i.createElement)("div",{className:"wcf-add-step-connector flex flex-col items-center"},n&&(0,i.createElement)("div",{className:"w-px h-4 bg-background-secondary"}),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Add New Step","cartflows"),placement:r},(0,i.createElement)(_,{to:{pathname:"admin.php",search:o},className:"wcf-add--new-step-connector inline-flex items-center justify-center w-7 h-7 rounded-full border border-solid border-border-subtle bg-background-primary hover:shadow-md hover:bg-background-secondary no-underline"},(0,i.createElement)(Kx,{className:"w-3.5 h-3.5 stroke-2 text-text-secondary","aria-hidden":"true"}))),n&&(0,i.createElement)("div",{className:"w-px h-4 bg-background-secondary"}))},aY=To("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),iY=function({fromDate:e,toDate:t,onBack:n,onDateChange:r,showDateFilter:o=!0}){return(0,i.createElement)(ph,{containerType:"flex",justify:"between",align:"center",gap:"none",className:"mt-0 mb-6 cursor-pointer"},(0,i.createElement)(ph,{containerType:"flex",align:"center",gap:"sm"},(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Back to Steps","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",onClick:n,className:"text-text-secondary hover:text-text-primary"},(0,i.createElement)(aY,{className:"w-5 h-5 !cursor-pointer",strokeWidth:2}))),(0,i.createElement)(v_,{tag:"h3",size:"sm",title:(0,j.__)("Analytics","cartflows")})),o&&(0,i.createElement)(DE,{value:{startDate:e,endDate:t},onChangeCB:r,fieldParentWrapperClass:""}))},sY=To("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),lY=To("CircleDollarSign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]),cY=To("Banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]]),uY=To("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]),dY=To("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),fY=function({label:e,tooltip:t,value:n,icon:r}){return(0,i.createElement)("div",{className:"bg-[rgba(254, 248, 245, 0.35)] border border-solid border-brand-100 rounded-lg p-5 flex flex-col justify-between gap-3"},(0,i.createElement)("div",{className:"flex items-center justify-between"},(0,i.createElement)("div",{className:"flex items-center gap-1"},(0,i.createElement)(vh,{as:"span",size:14,weight:400,color:"primary"},e),t&&(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:t,placement:"top"},(0,i.createElement)(Lo,{className:"w-3.5 h-3.5 text-text-tertiary cursor-help flex-shrink-0",strokeWidth:2}))),(0,i.createElement)("div",{className:"flex items-center p-2 rounded-lg bg-brand-25 border border-solid border-brand-100"},r)),(0,i.createElement)(vh,{as:"div",size:24,weight:600,color:"primary"},null!=n?n:0))},pY={className:"w-5 h-5 text-brand-500",strokeWidth:1.5},mY=e=>e?Nh(e.toString()):0,hY=function({revenue:e,totalVisitors:t,loading:n}){var r;const o=[[(0,j.__)("Total Visitors","cartflows"),(0,j.__)("Sum of all step views in this funnel.","cartflows"),t,sY],[(0,j.__)("Total Orders","cartflows"),(0,j.__)("Total number of orders.","cartflows"),null!==(r=e?.order_count)&&void 0!==r?r:0,rF],[(0,j.__)("Total Revenue","cartflows"),(0,j.__)("Grand total of all orders.","cartflows"),mY(e?.gross_sale),lY],[(0,j.__)("Average Order Value","cartflows"),(0,j.__)("Average total of every order.","cartflows"),mY(e?.avg_order_value),cY],[(0,j.__)("Bump Offer Revenue","cartflows"),(0,j.__)("Grand total of all order bumps.","cartflows"),mY(e?.bump_offer),uY],[(0,j.__)("Offers Revenue","cartflows"),(0,j.__)("Total upsell/downsell revenue.","cartflows"),mY(e?.upsell_revenue),rF],[(0,j.__)("Revenue Per Visit","cartflows"),(0,j.__)("Revenue per visit.","cartflows"),mY(e?.revenue_per_visit),Bg],[(0,j.__)("RPUV","cartflows"),(0,j.__)("Revenue per unique visitor.","cartflows"),mY(e?.revenue_per_unique_visits),dY]];return(0,i.createElement)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6"+(n?" opacity-50 pointer-events-none":"")},o.map(([e,t,n,r])=>(0,i.createElement)(fY,{key:e,label:e,tooltip:t,value:n,icon:(0,i.createElement)(r,pY)})))},gY=(0,p.createContext)(void 0),wY=()=>{const e=(0,p.useContext)(gY);if(!e)throw new Error("Table components must be used within Table component");return e},yY=({children:e,className:t,checkboxSelection:n=!1,...r})=>{const o={checkboxSelection:n},a=p.Children.toArray(e).find(e=>p.isValidElement(e)&&e.type===MY),i=p.Children.toArray(e).filter(e=>p.isValidElement(e)&&e.type!==MY);return(0,C.jsx)(gY.Provider,{value:o,children:(0,C.jsxs)("div",{className:"flow-root border-0.5 border-solid border-border-subtle rounded-md divide-y-0.5 divide-x-0 divide-solid divide-border-subtle overflow-hidden",children:[(0,C.jsx)("div",{className:"overflow-x-auto w-full",children:(0,C.jsx)("div",{className:"relative",children:(0,C.jsx)("table",{className:Se("table-fixed min-w-full border-collapse border-spacing-0",t),...r,children:i})})}),a]})})},bY=({children:e,className:t,selected:n,onChangeSelection:r,indeterminate:o,disabled:a,...i})=>{const{checkboxSelection:s}=wY();return(0,C.jsx)("thead",{className:Se("bg-background-secondary border-x-0 border-t-0 border-b-0.5 border-solid border-border-subtle",t),...i,children:(0,C.jsxs)("tr",{children:[s&&(0,C.jsx)("th",{scope:"col",className:"relative px-5.5 w-11 overflow-hidden",children:(0,C.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,C.jsx)(dw,{size:"sm",checked:n,indeterminate:o,disabled:a,onChange:e=>{"function"==typeof r&&r(e)},"aria-label":n?"Deselect all":"Select all"})})}),e]})})},vY=({children:e,className:t,...n})=>(0,C.jsx)("th",{scope:"col",className:Se("p-3 text-left text-sm font-medium leading-5 text-text-primary",t),...n,children:e}),xY=({children:e,className:t,...n})=>(0,C.jsx)("tbody",{className:Se("bg-background-primary divide-y-0.5 divide-x-0 divide-solid divide-border-subtle",t),...n,children:e}),NY=({children:e,selected:t,value:n,className:r,onChangeSelection:o,...a})=>{const{checkboxSelection:i}=wY();return(0,C.jsxs)("tr",{className:Se("hover:bg-background-secondary",t&&"bg-background-secondary",r),...a,children:[i&&(0,C.jsx)("td",{className:"relative px-5.5 w-11 overflow-hidden",children:(0,C.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,C.jsx)(dw,{size:"sm",checked:t,onChange:e=>{"function"==typeof o&&o(e,n)},"aria-label":"Select row"})})}),e]})},IY=({children:e,className:t,...n})=>(0,C.jsx)("td",{className:Se("px-3 py-3.5 text-sm font-normal leading-5 text-text-secondary",t),...n,children:e}),MY=({children:e,className:t,...n})=>{const{checkboxSelection:r}=wY();return(0,C.jsx)("div",{className:Se("px-3 py-3",r&&"px-4",t),...n,children:e})};yY.displayName="Table",bY.displayName="Table.Head",vY.displayName="Table.HeadCell",xY.displayName="Table.Body",NY.displayName="Table.Row",IY.displayName="Table.Cell",MY.displayName="Table.Footer",yY.Head=bY,yY.HeadCell=vY,yY.Body=xY,yY.Row=NY,yY.Cell=IY,yY.Footer=MY;const EY=["thankyou","optin","landing"],_Y=(e,t,n)=>{var r;if(!e||EY.includes(t))return"-";const o=null!==(r=e.revenue)&&void 0!==r?r:0;return n?`${window?.cartflows_admin?.woo_currency||""}${o}`:Nh(String(o))},SY=(e,t,n=!1)=>{var r,o,a,i;if(!e)return["-","-","-","-","-"];const s="thankyou"===t;return[null!==(r=e.total_visits)&&void 0!==r?r:0,null!==(o=e.unique_visits)&&void 0!==o?o:0,s?"-":null!==(a=e.conversions)&&void 0!==a?a:0,s?"-":`${null!==(i=e.conversion_rate)&&void 0!==i?i:0} %`,_Y(e,t,n)]},DY=[(0,j.__)("Step","cartflows"),(0,j.__)("Total Visits","cartflows"),(0,j.__)("Unique Visits","cartflows"),(0,j.__)("Conversions","cartflows"),(0,j.__)("Conversion rate","cartflows"),(0,j.__)("Revenue","cartflows")],jY=({children:e})=>(0,i.createElement)(vh,{as:"span",size:14,weight:500,color:"primary"},e),kY=({cells:e,rowKey:t})=>e.map((e,n)=>(0,i.createElement)(yY.Cell,{key:`${t}-c-${n}`},e)),CY=({rowKey:e,label:t,cells:n,rowClass:r=""})=>(0,i.createElement)(yY.Row,{className:r},(0,i.createElement)(yY.Cell,null,t),(0,i.createElement)(kY,{cells:n,rowKey:e})),AY=({rowKey:e,data:t})=>{var n;return(0,i.createElement)(CY,{rowKey:e,label:(0,i.createElement)(jY,null,null!==(n=t.visits?.title)&&void 0!==n?n:""),cells:SY(t.visits,t.type)})},TY=({rowKey:e,data:t,isExpanded:n,onToggle:r})=>{var o;const a=n?Fp:pN;return(0,i.createElement)(CY,{rowKey:e,label:(0,i.createElement)("button",{type:"button",className:"flex items-center gap-2 bg-transparent border-0 p-0 cursor-pointer",onClick:r,"aria-expanded":n,"aria-label":n?(0,j.__)("Collapse variations","cartflows"):(0,j.__)("Expand variations","cartflows")},(0,i.createElement)(a,{className:"w-4 h-4 text-text-tertiary",strokeWidth:2}),(0,i.createElement)(jY,null,null!==(o=t.visits?.title)&&void 0!==o?o:"")),cells:SY(t.visits,t.type)})},LY=({rowKey:e,data:t,stepId:n,variation:r,vIdx:o})=>{const a=((e,t,n)=>{const r=String(e)===String(t);return{isControl:r,label:r?(0,j.__)("Control","cartflows"):(0,j.sprintf)(/* translators: %d: variation index */ /* translators: %d: variation index */
42 +(0,j.__)("Variation-%d","cartflows"),n),variant:r?"red":"neutral"}})(n,t.id,o);return(0,i.createElement)(CY,{rowKey:e,rowClass:"bg-background-secondary",label:(0,i.createElement)("div",{className:"flex items-center gap-2 pl-6"},(0,i.createElement)(jY,null,r?.title||"-"),(0,i.createElement)(Qo,{label:a.label,size:"xs",variant:a.variant,type:"rounded",disableHover:!0})),cells:SY(r,t.type,!0)})},OY=({rowKey:e,data:t,variation:n})=>(0,i.createElement)(CY,{rowKey:e,rowClass:"bg-background-secondary",label:(0,i.createElement)("div",{className:"flex items-center gap-2 pl-6"},(0,i.createElement)(jY,null,n?.title||"-"),n?.archived_date&&(0,i.createElement)(Qo,{label:n.archived_date,size:"xs",variant:"inverse",type:"rounded",disableHover:!0})),cells:SY(n,t.type,!0)}),zY=()=>(0,i.createElement)(yY.Row,null,(0,i.createElement)(yY.Cell,null,(0,i.createElement)(vh,{as:"span",size:14,color:"secondary"},(0,j.__)("No analytics data available yet.","cartflows"))),Array(DY.length-1).fill("-").map((e,t)=>(0,i.createElement)(yY.Cell,{key:t},e))),PY=function({allSteps:e}){const[t,n]=function(){const[e,t]=(0,i.useState)(()=>new Set),n=(0,i.useCallback)(e=>{t(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return[e,n]}(),r=e?.length?e.flatMap((e,r)=>((e,t,n,r)=>{const o=e.id||`step-${t}`,{variations:a,archived:s,isAbStep:l}=(e=>{const t=e?.["visits-ab"]?Object.entries(e["visits-ab"]):[],n=e?.["visits-ab-archived"]?Object.entries(e["visits-ab-archived"]):[];return{variations:t,archived:n,isAbStep:t.length>0||n.length>0}})(e);if(!l)return[(0,i.createElement)(AY,{key:o,rowKey:o,data:e})];const c=n.has(o),u=[(0,i.createElement)(TY,{key:o,rowKey:o,data:e,isExpanded:c,onToggle:()=>r(o)})];return c?(a.forEach(([t,n],r)=>{const a=`${o}-ab-${t}`;u.push((0,i.createElement)(LY,{key:a,rowKey:a,data:e,stepId:t,variation:n,vIdx:r}))}),s.forEach(([t,n])=>{const r=`${o}-arc-${t}`;u.push((0,i.createElement)(OY,{key:r,rowKey:r,data:e,variation:n}))}),u):u})(e,r,t,n)):(0,i.createElement)(zY,null);return(0,i.createElement)("div",{className:"bg-background-primary border border-border-subtle rounded-lg overflow-hidden mb-6"},(0,i.createElement)(yY,null,(0,i.createElement)(yY.Head,null,DY.map(e=>(0,i.createElement)(yY.HeadCell,{key:e},e))),(0,i.createElement)(yY.Body,null,r)))},RY=({title:e="",description:t=(0,j.__)("Upgrade your plan anytime and get more detailed analytics data.","cartflows"),containerClass:n="",innerContainerClass:r=""})=>{const o=(0,k.applyFilters)("cartflows.upgradeNotice.content",{title:e,description:t,ctaLabel:(0,j.__)("Upgrade to PRO","cartflows"),ctaHref:getUpgradeToProUrl()});return(0,i.createElement)("div",{className:`wcf-upgrade-to-pro-notice-container ${n}`},(0,i.createElement)("div",{className:`wcf-upgrade-to-pro-notice-inner-container ${r} `},(0,i.createElement)("div",{className:"flex justify-center mb-5"},(0,i.createElement)(Ap,null)),(0,i.createElement)(v_,{size:"md",tag:"h3",title:o.title,className:"mb-1 justify-center"}),(0,i.createElement)(vh,{size:14,color:"secondary",className:"mb-5 text-center"},o.description),(0,i.createElement)("div",{className:"flex justify-center"},(0,i.createElement)(Ro,{tag:"a",href:o.ctaHref,variant:"primary",size:"md",target:"_blank",rel:"noreferrer",icon:(0,i.createElement)(kp,null),iconPosition:"right",className:"no-underline"},o.ctaLabel))))},UY=()=>"undefined"!=typeof cartflows_admin&&cartflows_admin?.woo_currency||"$",BY=()=>{const e=UY();return{order_count:"1,284",gross_sale:`${e}48,240`,avg_order_value:`${e}37.56`,bump_offer:`${e}6,820`,upsell_revenue:`${e}9,410`,revenue_per_visit:`${e}3.86`,revenue_per_unique_visits:`${e}6.12`}},FY=()=>{const e=UY();return[{id:"dummy-landing",type:"landing",visits:{title:(0,j.__)("Landing Page","cartflows"),total_visits:"4,120",unique_visits:"3,540",conversions:"2,180",conversion_rate:"52.9",revenue:"-"}},{id:"dummy-checkout",type:"checkout",visits:{title:(0,j.__)("Checkout","cartflows"),total_visits:"2,180",unique_visits:"1,960",conversions:"1,284",conversion_rate:"58.9",revenue:`${e}48,240`}},{id:"dummy-thankyou",type:"thankyou",visits:{title:(0,j.__)("Thank You","cartflows"),total_visits:"1,284",unique_visits:"1,190",conversions:"-",conversion_rate:"-",revenue:"-"}}]},YY=function(){return(0,i.createElement)("div",{className:"relative overflow-hidden rounded-lg"},(0,i.createElement)("div",{className:"blur-[3px] pointer-events-none select-none","aria-hidden":"true"},(0,i.createElement)(hY,{revenue:BY(),totalVisitors:"12,485",loading:!1}),(0,i.createElement)(PY,{allSteps:FY()})),(0,i.createElement)("div",{className:"absolute inset-0 z-10 bg-background-primary/40 pointer-events-none flex items-center justify-center px-4"},(0,i.createElement)(RY,{title:(0,j.__)("Track Every Step's Performance","cartflows"),description:(0,j.__)("Know exactly which steps convert and which lose customers. Upgrade to CartFlows Pro for views, conversions, and revenue per step.","cartflows"),containerClass:"pointer-events-auto",innerContainerClass:"border border-border-subtle shadow-lg p-8 rounded-lg max-w-md w-full text-center bg-background-primary"})))},ZY=function({onBack:e}){const[{flow_analytics:t,flow_id:n},r]=Nm(),o=(0,k.applyFilters)("cartflows.flowEditor.stepsAnalytics",null);return(0,i.createElement)("div",{className:"wcf-steps-analytics relative bg-background-primary p-6 shadow-sm border border-border-subtle border-solid rounded-lg"},o?(0,i.createElement)(o,{onBack:e,flowId:n,flowAnalytics:t,onAnalyticsChange:e=>r({type:"SET_FLOW_ANALYTICS",flow_analytics:e})}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(iY,{onBack:e,showDateFilter:!1}),(0,i.createElement)(YY,null)))},VY=To("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),GY=function(){const[{flow_analytics:e}]=Nm(),[{license_status:t}]=l(),[n,r]=(0,i.useState)(!1);if(e)return null;const o="function"==typeof wcfCartflowsPro&&wcfCartflowsPro()&&"Activated"!==t;let a,s,c,u;return o?(a=(0,j.__)("Activate your license to unlock analytics","cartflows"),s=(0,j.__)("Your CartFlows Pro license isn't active yet. Activate it to see views, conversions, and revenue per step.","cartflows"),c=(0,j.__)("Activate License","cartflows"),u=cartflows_admin?.license_popup_url):(a=(0,j.__)("See Every Step's Performance:","cartflows"),s=(0,j.__)("Know exactly which steps win and which lose. Upgrade to Pro and track views, conversions, and revenue per step.","cartflows"),c=(0,j.__)("Upgrade to Pro","cartflows"),u=getUpgradeToProUrl()),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-pro-nudge--notice flex justify-center mb-5"},(0,i.createElement)("div",{className:"wcf-pro-nudge--notice-columns flex items-center justify-between w-full border border-brand-200 border-solid p-3 rounded-lg bg-brand-25 gap-3"},(0,i.createElement)("div",{className:"wcf-pro-nudge--notice-column-left flex items-center gap-3 min-w-0"},(0,i.createElement)("div",{className:"flex p-1 border border-solid border-brand-200 rounded-md"},(0,i.createElement)(VY,{className:"text-brand-500 h-4 w-4"})),(0,i.createElement)("div",{className:"flex min-w-0"},(0,i.createElement)("span",{className:"text-text-primary text-sm font-semibold mr-0.5"},a),(0,i.createElement)(vh,{as:"span",size:14,color:"secondary",className:"truncate"},s),o?(0,i.createElement)(Ro,{tag:"a",href:u,target:"_blank",rel:"noreferrer",variant:"link",size:"sm",icon:(0,i.createElement)(kp,null),iconPosition:"right",className:"no-underline !text-sm focus:outline-none focus:ring-0"},c):(0,i.createElement)(Ro,{variant:"link",size:"sm",icon:(0,i.createElement)(kp,null),iconPosition:"right",className:"no-underline !text-sm focus:outline-none focus:ring-0",onClick:()=>r(!0)},c))))),(0,i.createElement)(Fg,{feature:"analytics",open:n,setOpen:r}))};function WY({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const HY=p.forwardRef(WY),QY=function(e){const{type:t}=e,[{flow_id:n,title:r,steps:o,global_checkout:a,status:s},l]=Nm(),[c,u]=(0,i.useState)(!1),d=(0,j.__)("Save","cartflows"),[f,p]=(0,i.useState)({saveBtnString:d,saveBtnProcess:!1}),{saveBtnString:m,saveBtnProcess:h}=f,g=!!Number.isInteger(a),w=Number.isInteger(a)?"disable":"enable",[y,b]=((0,j.__)("Disable Store Checkout","cartflows"),(0,j.__)("Enable Store Checkout","cartflows"),(0,i.useState)(s||"draft")),[v,x]=(0,i.useState)(g),[N,I]=(0,i.useState)(!1),[M,E]=(0,i.useState)(w),_=(0,i.createRef)(),S=dg();let D="";if("storeCheckout"===t)for(let e=0;e<o.length;e++)if("checkout"===o[e].type){D=o[e].id;break}(0,i.useEffect)(()=>{b(s||"draft")},[s]),(0,i.useEffect)(()=>{c&&_.current?.focus()},[c]);const k=function(e){e.preventDefault(),u(!0)},C=function(e){e.preventDefault(),p({saveBtnString:(0,j.__)("Saving…","cartflows"),saveBtnProcess:"processing"});const t=_.current.value,r=new window.FormData;r.append("action","cartflows_update_flow_title"),r.append("security",cartflows_admin.update_flow_title_nonce),r.append("flow_id",n),r.append("new_flow_title",t),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{l({type:"SET_FLOW_TITLE",title:t}),p({saveBtnString:(0,j.__)("Saved","cartflows"),saveBtnProcess:"saved"}),Wm.success((0,j.__)("Funnel title updated successfully!","cartflows")),setTimeout(()=>{p({saveBtnString:d,saveBtnProcess:!1}),u(!1)},3e3)})},A=function(e){e.preventDefault(),u(!1)};if(!1===r)return(0,i.createElement)("div",{className:"wcf-edit-flow__title-wrap animate-pulse"},(0,i.createElement)("div",{className:"wcf-flows-header--title wcf-step__title--editable flex gap-2.5 items-center"},(0,i.createElement)("span",{className:"h-3 w-full bg-background-secondary rounded-md px-10 block"})));const T=[{value:"draft",label:(0,j.__)("Draft","cartflows")},{value:"publish",label:(0,j.__)("Publish","cartflows")}];return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-edit-flow__title-wrap w-full"},(0,i.createElement)("div",{className:"wcf-flows-header--title wcf-step__title--editable flex gap-2.5 items-center"},function(){let e=r;""===r&&(e=(0,j.__)("(no title)","cartflows"));let t=Ym(e,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),n=(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Edit Title","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"ghost",size:"md",className:"wcf-flows-header__title--edit",onClick:k,icon:(0,i.createElement)(nD,{className:"w-5.5 h-5.5 stroke-1","aria-hidden":"true"})}));if(c){t=(0,i.createElement)(Qw,{ref:_,id:"new-flow-title",defaultValue:r,autoComplete:"off",size:"sm",className:"wcf-flow-title-input [&>input]:!py-1.5"});let e=null;"processing"===h?e=(0,i.createElement)(zw,{variant:"primary",size:"sm"}):"saved"===h&&(e=(0,i.createElement)(HY,{className:"w-4 h-4 stroke-2"})),n=(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"primary",size:"sm",className:"!py-1.5",onClick:C,disabled:"processing"===h,icon:e,iconPosition:"left"},m),(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"!py-1.5",onClick:A},(0,j.__)("Cancel","cartflows")))}return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"wcf-flows-header__title--text text-text-primary text-lg sm:text-2xl font-semibold",title:e},t),(0,i.createElement)("span",{className:"wcf-flows-header__title--buttons flex gap-3"},n))}(),"flows"===t&&!c&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"divider h-5 w-px bg-background-secondary"}),(0,i.createElement)("div",{className:"wcf-status-toggle inline-flex items-center border border-solid border-border-subtle p-1 rounded-3xl"},T.map(e=>(0,i.createElement)("button",{key:`status-${e.value}`,type:"button",className:"wcf-status-toggle__btn inline-flex items-center gap-1 px-3 py-1 text-sm cursor-pointer border-0 "+(e.value===y?"font-medium text-text-primary bg-background-primary rounded-3xl shadow-sm":"font-normal text-text-secondary bg-transparent hover:text-text-primary"),onClick:t=>{e.value!==y&&async function(e){e.preventDefault();let t=!1,r="";switch(y){case"draft":case"private":t=await S({title:"Publish Funnel",description:(0,j.__)("Do you really want to publish this funnel?","cartflows"),actionBtnText:(0,j.__)("Publish","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")}),r="publish",window.wcfAction="restoreFlow";break;case"publish":t=await S({title:(0,j.__)("Draft Funnel","cartflows"),description:(0,j.__)("Do you really want to draft this funnel?","cartflows"),actionBtnText:(0,j.__)("Switch to Draft","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")}),r="draft",window.wcfAction="draftFlow"}if(!t)return;const o=new window.FormData;o.append("action","cartflows_update_status"),o.append("security",cartflows_admin.update_status_nonce),o.append("flow_id",n),o.append("new_status",r),(0,Eg.$h)(Ep()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(e=>{e.success&&(b(r),Wm.success("publish"===r?(0,j.__)("Funnel published!","cartflows"):(0,j.__)("Funnel moved to draft!","cartflows")))}))}(t)}},e.value===y&&(0,i.createElement)(HY,{className:"w-4 h-4 stroke-2"}),e.label)))),"storeCheckout"===t&&!c&&(0,i.createElement)("div",{className:"wcf-store-checkout_status--container flex items-center gap-4"},(0,i.createElement)("span",{className:"divider w-px h-5 bg-background-secondary"}),(0,i.createElement)(yw,{value:v,onChange:()=>(()=>{const e=new window.FormData;I(!0),e.append("action","cartflows_update_store_checkout_status"),e.append("security",cartflows_admin.update_store_checkout_status_nonce),e.append("checkout_id",D),e.append("enable_store_checkout",!v),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&(x(!v),I(!1),l({type:"SET_GLOBAL_CHECKOUT",global_checkout:e.data.checkout_id}),"enable"===M?(E("disable"),Wm.success((0,j.__)("Store Checkout enabled!","cartflows"))):(E("enable"),Wm.success((0,j.__)("Store Checkout disabled!","cartflows"))))})})(),size:"sm",label:{heading:(0,j.__)("Enable Store Checkout","cartflows")}}),N&&(0,i.createElement)(zw,{variant:"primary",size:"sm"})))))};function $Y({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"}))}const XY=p.forwardRef($Y);function JY({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"}))}const qY=p.forwardRef(JY);function KY({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z"}))}const eZ=p.forwardRef(KY);function tZ({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"}))}const nZ=p.forwardRef(tZ),rZ=function(){return(0,i.createElement)("div",{className:"wcf-flow-settings-view flex gap-6 items-start w-full"},(0,i.createElement)("div",{className:"wcf-flow-settings--sidebar h-full min-h-screen flex flex-col w-auto sticky top-0 lg:top-4 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-16 lg:after:w-[254px] after:h-screen after:bg-background-primary after:-z-10"},(0,i.createElement)("div",{className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow bg-background-primary border-0 border-r border-solid border-border-subtle"},(0,i.createElement)("div",{className:"flex flex-col gap-0.5 pt-2"},["w-28","w-24","w-20"].map((e,t)=>(0,i.createElement)("div",{key:t,className:"flex items-center gap-2.5 px-3 py-2 lg:justify-start justify-center"},(0,i.createElement)(Gg,{className:"w-5 h-5 rounded"}),(0,i.createElement)(Gg,{className:`h-3 ${e} lg:block hidden`})))))),(0,i.createElement)("div",{className:"min-w-0 max-w-3xl p-8 mx-auto w-full flex flex-col gap-3"},(0,i.createElement)("div",{className:"flex items-center gap-2 py-1"},(0,i.createElement)(Gg,{className:"w-14 h-2.5"}),(0,i.createElement)(Gg,{className:"w-2 h-2.5"}),(0,i.createElement)(Gg,{className:"w-20 h-2.5"}),(0,i.createElement)(Gg,{className:"w-2 h-2.5"}),(0,i.createElement)(Gg,{className:"w-28 h-2.5"})),(0,i.createElement)("div",{className:"flex justify-between items-center h-10"},(0,i.createElement)("div",{className:"flex items-center gap-2.5"},(0,i.createElement)(Gg,{className:"w-5 h-5 rounded"}),(0,i.createElement)(Gg,{className:"w-40 h-5"})),(0,i.createElement)(Gg,{className:"w-28 h-9 rounded-lg"})),(0,i.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm overflow-hidden mb-8 p-6 flex flex-col gap-5"},(0,i.createElement)(Gg,{className:"w-32 h-4"}),["w-28","w-36","w-24","w-32"].map((e,t)=>(0,i.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,i.createElement)(Gg,{className:`${e} h-3.5`}),(0,i.createElement)(Gg,{className:"w-full h-10 rounded-md"}))))))},oZ=function({menuItems:e,currentTab:t,onTabChange:n}){return(0,i.createElement)("div",{className:"wcf-flow-settings--sidebar h-full min-h-screen flex flex-col w-auto sticky top-0 lg:top-4 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-16 lg:after:w-[254px] after:h-screen after:bg-background-primary after:-z-10"},(0,i.createElement)(YS,{borderOn:!0,className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow"},(0,i.createElement)(YS.Body,{className:"!p-0"},(0,i.createElement)(YS.Item,null,(0,i.createElement)(Vp,{className:"w-full p-0 bg-transparent",size:"md"},(0,i.createElement)("ul",{className:"m-0 p-0 list-none flex flex-col"},e.map(e=>{const r=e.icon;return(0,i.createElement)(Vp.Item,{key:e.slug,active:t===e.slug,onClick:()=>n(e.slug),className:"lg:justify-start justify-center hover:!bg-brand-25 hover:[&>svg]:!text-brand-600 "+(t===e.slug?"!bg-brand-25 !text-text-primary [&>svg]:!text-brand-600":"")},(0,i.createElement)(r,{className:"w-5 h-5"}),(0,i.createElement)("span",{className:"flex-1 lg:block hidden"},e.name))})))))))},aZ=function(){const[{license_status:e}]=l(),[t,n]=(0,i.useState)(!1);return wcfCartflowsTypePro()&&"Activated"===e?(0,i.createElement)(Rg,{title:(0,j.__)("Update CartFlows Pro to use Instant Checkout","cartflows"),description:(0,j.__)("Instant Checkout is included in your plan. Update CartFlows Pro to the latest version to turn it on.","cartflows")}):wcfCartflowsTypePro()&&"Activated"!==e||"inactive"===cartflows_admin.cf_pro_status&&"pro"===wcfInactivepluginType()?(0,i.createElement)(Rg,{title:(0,j.__)("Activate CartFlows Pro to use Instant Checkout","cartflows"),description:(0,j.__)("Your settings are saved. Activate CartFlows Pro and its license to bring the Buy Now popup back to your product pages.","cartflows")}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Rg,{title:(0,j.__)("Let Shoppers Buy in One Click from the Product Page","cartflows"),description:(0,j.__)("Instant Checkout adds a Buy Now button that opens your funnel checkout in a popup. Available on CartFlows Pro.","cartflows"),buttonText:(0,j.__)("Upgrade to Pro","cartflows"),onButtonClick:()=>n(!0)}),(0,i.createElement)(Fg,{feature:"instant-checkout",open:t,setOpen:n}))},iZ=function({sectionObject:e,flowType:t,buttonRef:n,backUrl:r}){const[{title:o}]=Nm(),a=!!e?.is_locked,s="?page=cartflows&path="+("storeCheckout"===t?"store-checkout":"flows");return(0,i.createElement)(ph,{containerType:"flex",direction:"column",gap:"sm",className:"wcf-flow-settings--content min-w-0 max-w-3xl p-8 mx-auto w-full"},(0,i.createElement)(sD,{size:"sm"},(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Link,{href:`${cartflows_admin.admin_base_url}admin.php${s}`,className:"font-normal"},(0,j.__)("Funnels","cartflows"))),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)(nY,{className:"w-3 h-3 stroke-2"})),(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Link,{as:_,to:{pathname:"admin.php",search:r},className:"font-normal"},o||(0,j.__)("(no title)","cartflows"))),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)(nY,{className:"w-3 h-3 stroke-2"})),(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Page,null,(0,j.__)("Funnel Settings","cartflows")))),(0,i.createElement)("div",{className:"flex justify-between items-center h-10"},(0,i.createElement)("div",{className:"flex items-center gap-2.5"},(0,i.createElement)(_,{to:{pathname:"admin.php",search:r},className:"text-icon-secondary hover:text-icon-primary no-underline shrink-0 transition-colors","aria-label":(0,j.__)("Back to funnel","cartflows")},(0,i.createElement)(GS,{className:"w-5 h-5 flex stroke-1"})),(0,i.createElement)(QY,null)),!a&&(0,i.createElement)(ny,{id:"wcf-save-flow-settings",ref:n})),(0,i.createElement)(ph,{containerType:"flex",direction:"column",className:"!gap-5 bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm mb-8 p-6"},e?.title&&(0,i.createElement)(v_,{title:e.title,tag:"h5",size:"xs",className:"text-text-primary"}),a?(0,i.createElement)(aZ,null):(0,i.createElement)(WS,{section:e})))},sZ={instant_layout:XY,instant_checkout:qY,funnel_advanced_options:eZ,general:nZ},lZ=function(e){var t;const[{flow_id:n,flow_settings:r,flow_type:o}]=Nm(),[,a]=l(),s=(0,i.useRef)(null),c=dg(),[u,d]=(0,i.useState)(null),f=!r||void 0===r.settings,p=(0,i.useMemo)(()=>r?.settings?Object.entries(r.settings).sort(([,e],[,t])=>e.priority-t.priority).map(([e,t])=>({id:e,name:t.title,slug:t.slug,icon:sZ[t.slug]||nZ})):[],[r]),m=null!==(t=null!=u?u:p[0]?.slug)&&void 0!==t?t:"",h=r?.settings?Object.entries(r.settings).find(([,e])=>e.slug===m):null,g=h?h[1]:null,w="storeCheckout"===o?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${n}`;return f?(0,i.createElement)(rZ,null):(0,i.createElement)("form",{className:"wcf-flow-settings-view flex gap-6 items-start w-full",onSubmit:t=>{t.preventDefault();const r=new window.FormData(t.target);r.append("action","cartflows_save_flow_meta_settings"),r.append("security",cartflows_admin.save_flow_meta_settings_nonce),r.append("flow_id",n),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{a({status:"SAVED"}),e.renderCb()})}},(0,i.createElement)(oZ,{menuItems:p,currentTab:m,onTabChange:async e=>{e!==m&&(await(async()=>!!window.wcfUnsavedChanges&&await c({title:"Save Changes",description:"You have made changes. Do you want to save the changes?",actionBtnText:"Yes",cancelBtnText:"No"}))()&&s.current?.click(),d(e),window.wcfUnsavedChanges=!1)}}),(0,i.createElement)(iZ,{currentTab:m,sectionObject:g,flowType:o,buttonRef:s,backUrl:w}))},cZ=function(){var e;const[{flow_id:t,steps:n,emptySteps:r,flow_type:o,is_flow_instant_checkout:a,flow_link:s,options:c,title:u},f]=Nm(),p=new URLSearchParams((0,d.useLocation)()?.search),m=null!==(e=p.get("step_id"))&&void 0!==e?e:"",h="true"===p.get("flow_settings"),g=dg(),[{canvasMode:y},b]=l(),[v,x]=(0,i.useState)(!1),[N,I]=(0,i.useState)(!1),[M,E]=(0,i.useState)("no"),[S,D]=(0,i.useState)(!1),[k,C]=(0,i.useState)(null),A=(0,i.useRef)(n);(0,i.useEffect)(()=>{A.current=n},[n]);const[T,L]=(0,i.useState)("yes"!==cartflows_admin?.instant_checkout_notice_status);let O=!0;n.length>0&&(O=!1);const z=function(){x(!v)};(0,i.useEffect)(()=>{let e=!0;return(async()=>{Ep()({path:`/cartflows/v1/admin/flow-data/${t}`}).then(t=>{e&&f({type:"SET_FLOW_DATA",data:t})})})(),()=>{e=!1}},[v]);const P=()=>{const e=t,n=[];A.current.map(e=>(n.push(e.id),""));const r=new window.FormData;r.append("action","cartflows_reorder_flow_steps"),r.append("security",cartflows_admin.reorder_flow_steps_nonce),r.append("step_ids",n),r.append("post_id",e),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>{f({type:"SET_STEPS",steps:e.steps}),Wm.success((0,j.__)("Steps reordered successfully!","cartflows"))})};(0,i.useEffect)(()=>{E(c&&c["wcf-testing"]?c["wcf-testing"]:"no")},[c]),(0,i.useEffect)(()=>{"yes"===a&&L(!1)},[a]);let R=!1,U=!1;const B=[],F=[];if(m)return(0,i.createElement)(ph,{align:"start",className:"wcf-step-settings-view--wrapper -m-8",containerType:"flex"},(0,i.createElement)(wD,{renderCb:z}));if(h)return(0,i.createElement)(ph,{align:"start",className:"wcf-flow-settings-view--wrapper -m-8",containerType:"flex"},(0,i.createElement)(lZ,{renderCb:z}));const Y="storeCheckout"===o,Z=Y?"?page=cartflows&path=store-checkout":"?page=cartflows&path=flows",V=Y?(0,j.__)("Store Checkout","cartflows"):(0,j.__)("Funnels","cartflows");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-steps-page-wrapper border-t border-border-subtle -mt-px"},(0,i.createElement)("div",{className:"wcf-page-header mb-4"},(0,i.createElement)(sD,{size:"sm"},(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Link,{href:`${cartflows_admin.admin_base_url}admin.php${Z}`,className:"font-normal"},V)),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)(nY,{className:"w-3 h-3 stroke-2"})),N?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Link,{as:"button",type:"button",onClick:()=>I(!1),className:"font-normal cursor-pointer bg-transparent border-0 p-0"},u||(0,j.__)("(no title)","cartflows"))),(0,i.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,i.createElement)(nY,{className:"w-3 h-3 stroke-2"})),(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Page,null,(0,j.__)("Analytics","cartflows")))):(0,i.createElement)(sD.Item,null,(0,i.createElement)(sD.Page,null,u||(0,j.__)("(no title)","cartflows")))),(0,i.createElement)("div",{className:"wcf-flow-header flex gap-3 xl:gap-0 justify-between flex-col xl:flex-row w-full mt-4"},(0,i.createElement)(QY,{type:o}),(0,i.createElement)("div",{className:"wcf-flow-header--actions w-full flex gap-3 items-center xl:justify-end"},(0,i.createElement)("div",{className:"wcf-flow-header--action-canvas-mode flex items-center gap-2"},(0,i.createElement)("span",{className:"text-sm font-medium text-text-secondary"},(0,j.__)("Canvas Mode","cartflows")),(0,i.createElement)(yw,{name:"wcf-enable-canvas-mode",size:"sm",value:y,onChange:e=>{e&&N&&I(!1),b({status:"UPDATE_CANVAS_MODE",canvasMode:e}),e?localStorage.setItem("wcf_canvas_mode_enabled","true"):localStorage.removeItem("wcf_canvas_mode_enabled")}})),(0,i.createElement)("div",{className:"wcf-flow-header--action-mode-select flex items-center gap-2 w-44"},S&&(0,i.createElement)(Dp,{className:"w-4 h-4 stroke-2 animate-spin text-brand-500"}),(0,i.createElement)(Gw,{size:"md",value:M,onChange:e=>(e=>{D(!0);const n=new window.FormData;n.append("action","cartflows_save_flow_meta_settings"),n.append("security",cartflows_admin.save_flow_meta_settings_nonce),n.append("flow_id",t),n.append("wcf-testing",e),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{f({type:"UPDATE_OPTIONS",options:{...c,"wcf-testing":e}}),D(!1),window.onbeforeunload=null,Wm.success("yes"===e?(0,j.__)("Sandbox mode enabled!","cartflows"):(0,j.__)("Sandbox mode disabled!","cartflows"))}).catch(()=>{D(!1),Wm.error((0,j.__)("Failed to update sandbox mode.","cartflows"))})})(e)},(0,i.createElement)(Gw.Button,{placeholder:(0,j.__)("Select Mode","cartflows"),className:"gap-1",render:()=>"yes"===M?(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(Xx,{className:"h-4 w-4 text-amber-500"}),(0,j.__)("Sandbox Mode","cartflows")):(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(hg,{className:"h-4 w-4 text-support-success"}),(0,j.__)("Live Mode","cartflows"))}),(0,i.createElement)(Gw.Options,null,(0,i.createElement)(Gw.Option,{value:"no"},(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(hg,{className:"h-4 w-4 text-support-success"}),(0,j.__)("Live Mode","cartflows"))),(0,i.createElement)(Gw.Option,{value:"yes"},(0,i.createElement)("span",{className:"flex items-center gap-2"},(0,i.createElement)(Xx,{className:"h-4 w-4 text-amber-500"}),(0,j.__)("Sandbox Mode","cartflows")))))),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Funnel Settings","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"p-2.5",tag:_,to:{pathname:"admin.php",search:`?page=cartflows&path=${"storeCheckout"===o?"store-checkout":"flows"}&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`},icon:(0,i.createElement)(Ig,null)})),(0,i.createElement)(Wo,{arrow:!0,variant:"dark",content:(0,j.__)("Export Funnel","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"p-2.5",onClick:e=>{e.preventDefault();const n=new window.FormData;n.append("action","cartflows_export_flow"),n.append("security",cartflows_admin.export_flow_nonce),n.append("flow_id",t),window.wcfAction="exportFlow",(0,Eg.$h)(Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>{if(e.success){const n=e.data.flow_name||`flow-${t}.json`,r=JSON.stringify(e.data.flows),o=new Blob([r],{type:"application/json"});if(document.documentMode)window.navigator.msSaveOrOpenBlob(o,n);else{const e=document.createElement("a");e.href=URL.createObjectURL(o),e.download=n,e.click()}Wm.success((0,j.__)("Funnel exported successfully!","cartflows"))}else Wm.error((0,j.__)("Failed to export funnel.","cartflows"))}).catch(()=>{Wm.error((0,j.__)("Failed to export funnel.","cartflows"))}))},icon:(0,i.createElement)(qF,null)})),"storeCheckout"===o&&(0,i.createElement)(Wo,{arrow:!0,content:(0,j.__)("Delete Store Checkout","cartflows"),placement:"top"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",className:"p-2.5",onClick:async e=>{if(e.preventDefault(),!await g({title:(0,j.__)("Delete Store Checkout","cartflows"),description:(0,j.sprintf)(/* translators: %s new line break */ /* translators: %s new line break */
43 +(0,j.__)("Do you really want to delete store checkout?%1$1sNOTE: This action cannot be reversed.","cartflows"),"\r\n"),actionBtnText:(0,j.__)("Delete","cartflows"),cancelBtnText:(0,j.__)("Cancel","cartflows")}))return;const n=new window.FormData;n.append("action","cartflows_delete_flow"),n.append("security",cartflows_admin.delete_flow_nonce),n.append("flow_id",t),window.wcfAction="deleteFlow",(0,Eg.$h)(Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{Wm.success((0,j.__)("Store checkout deleted successfully!","cartflows")),f({type:"SET_FLOWS",flows:null}),window.location.replace(cartflows_admin.admin_base_url+"admin.php?page=cartflows&path=store-checkout")}))},icon:(0,i.createElement)(_h,null)}))))),N?(0,i.createElement)(ZY,{onBack:()=>I(!1)}):(0,i.createElement)(i.Fragment,null,T&&(0,i.createElement)("div",{className:"wcf-instant-checkout--notice flex justify-center mb-5"},(0,i.createElement)("div",{className:"wcf-instant-checkout--notice-columns flex items-center justify-between w-full border border-brand-200 p-3 rounded-lg bg-background-primary"},(0,i.createElement)("div",{className:"wcf-instant-checkout--notice-column-left flex items-center gap-3"},(0,i.createElement)(Xg,{className:"h-5 w-5 text-brand-500 hover:text-brand-600","aria-hidden":"true"}),(0,i.createElement)("span",{className:"text-text-primary text-sm font-medium"},(0,j.__)("Create a distraction free, high-converting checkout experience without needing a page builder.","cartflows"))),(0,i.createElement)("div",{className:"wcf-instant-checkout--notice-column-right flex items-center gap-4"},(0,i.createElement)(_,{to:{pathname:"admin.php",search:"storeCheckout"===o?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`},className:"text-brand-600 text-xs font-medium cursor-pointer no-underline"},(0,j.__)("Enable Instant Layout","cartflows")),(0,i.createElement)(ZB,{className:"h-5 w-5 hover:text-brand-600 cursor-pointer","aria-hidden":"true",onClick:e=>{e.preventDefault(),(()=>{const e=new window.FormData;e.append("action","cartflows_hide_instant_checkout_notice"),e.append("security",cartflows_admin.hide_instant_checkout_notice_nonce),e.append("flow_id",t),L(!1),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e?.status&&L(!1)})})()}})))),(0,i.createElement)("div",{className:"wcf-steps-header flex justify-center mb-5 "+(y?"hidden":"")},(0,i.createElement)("div",{className:"flex justify-between items-center w-full gap-2"},(0,i.createElement)(v_,{tag:"h3",size:"sm",title:(0,j.__)("Funnel Steps","cartflows")}),(0,i.createElement)("div",{className:"wcf-steps-header--actions flex items-center gap-3"},(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:()=>I(!0),icon:(0,i.createElement)(eY,{className:"!w-4 !h-4 stroke-1"}),className:"text-sm font-normal",iconPosition:"left"},(0,j.__)("View Analytics","cartflows")),(0,i.createElement)(Ro,{variant:"outline",size:"md",tag:"a",href:s,target:"_blank",rel:"noreferrer",icon:(0,i.createElement)(bg,{className:"!w-4 !h-4 stroke-1"}),className:"text-sm font-normal no-underline",iconPosition:"left"},(0,j.__)("View Funnel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"md",tag:_,to:{pathname:"admin.php",search:"storeCheckout"===o?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library`},className:"text-sm font-normal no-underline",icon:(0,i.createElement)(Kx,{className:"!w-4 !h-4 stroke-2"}),iconPosition:"left"},(0,j.__)("Add New Step","cartflows"))))),y?(0,i.createElement)(XF,{renderCb:z}):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(GY,null),(0,i.createElement)("div",{className:"wcf-list-steps flex justify-center mb-4"},r&&function(){if(0===n.length)return(0,i.createElement)("div",{className:"wcf-analytics-no-step-notice text-center mb-8 bg-background-primary p-20 rounded-xl w-full"},(0,i.createElement)("svg",{className:"mx-auto h-12 w-12 text-text-secondary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},(0,i.createElement)("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})),(0,i.createElement)("h3",{className:"mt-2 text-sm font-semibold text-text-primary"},(0,j.__)("No Steps Added.","cartflows")),(0,i.createElement)("p",{className:"mt-1 text-sm text-text-secondary"},(0,j.__)("Seems like there are no steps created or added in this flow","cartflows")),(0,i.createElement)("div",{className:"mt-6"},(0,i.createElement)(Ro,{variant:"primary",size:"sm",tag:_,to:{pathname:"admin.php",search:"storeCheckout"===o?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library`},icon:(0,i.createElement)(Kx,{className:"w-4 h-4 stroke-2"}),iconPosition:"left"},(0,j.__)("Add New Step","cartflows"))))}(),!r&&O&&(0,i.createElement)(Wg,null),!O&&(0,i.createElement)("div",{className:"w-full"},"storeCheckout"===o?(n.length>0&&n.map((e,t)=>{if("checkout"===e.type){if(!cartflows_admin.old_global_checkout)return R=t,"";if(e.id===parseInt(cartflows_admin.old_global_checkout))return R=t,"";B.push(e)}else"landing"===e.type?B.push(e):F.push(e);return""}),F.length>0&&(U=!0),(0,i.createElement)(i.Fragment,null,!r&&!O&&(0,i.createElement)(i.Fragment,null,B.map(e=>(0,i.createElement)(Vg,(0,w.A)({},e,{key:e.id,invalid:!0,setUpgradePopupFeature:C}))),(0,i.createElement)(Vg,(0,w.A)({},n[R],{key:n[R].id,setUpgradePopupFeature:C})),U&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(oY,{flowId:t,flowType:o}),(0,i.createElement)(Im.ReactSortable,{list:F,setList:e=>{const t=A.current.filter(e=>"checkout"===e.type||"landing"===e.type);A.current=[...t,...e],f({type:"SET_STORE_STEPS",steps:e})},onEnd:P,swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-step-wrap",filter:".wcf-step__col-actions, .wcf-step__title-text, .wcf-ab-test-popup-content, .wcf-steps-action-buttons, .wcf-archived-wrapper, .wcf-add-step-connector",preventOnFilter:!1},F.map((e,n)=>"checkout"!==e.type?(0,i.createElement)("div",{key:e.id},(0,i.createElement)(Vg,(0,w.A)({},e,{setUpgradePopupFeature:C})),n<F.length-1&&(0,i.createElement)(oY,{flowId:t,flowType:o})):(0,i.createElement)(i.Fragment,null))))))):(0,i.createElement)(i.Fragment,null,!r&&!O&&(0,i.createElement)(Im.ReactSortable,{list:n,setList:e=>{A.current=e,f({type:"SET_STEPS",steps:e})},onEnd:P,swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-step-wrap",filter:".wcf-step__col-actions, .wcf-step__title-text, .wcf-ab-test-popup-content, .wcf-add-step-connector",preventOnFilter:!1},n.map((e,r)=>(0,i.createElement)("div",{key:e.id},(0,i.createElement)(Vg,(0,w.A)({},e,{setUpgradePopupFeature:C})),r<n.length-1&&(0,i.createElement)(oY,{flowId:t,flowType:o}))))))),(0,i.createElement)("div",{className:"wcf-step-footer flex justify-center pt-2 pb-4"},(0,i.createElement)(oY,{flowId:t,flowType:o,showConnectorLines:!1,tooltipPlacement:"top"}))))),(0,i.createElement)(rY,{renderCb:z,steps:n}),(0,i.createElement)(Fg,{feature:k,open:!!k,setOpen:e=>{e||C(null)}}))},uZ=cartflows_admin.default_page_builder,dZ=cartflows_admin.required_plugins,fZ=cartflows_admin.required_plugins[uZ],pZ={};pZ[uZ]=Object.values(cartflows_admin.flows_and_steps);const mZ={};mZ[uZ]=Object.values(cartflows_admin.store_checkout_flows_and_steps);const hZ={default_page_builder:uZ,page_builder_group_data:dZ,page_builder_group:fZ,preview:{},woocommerce_status:cartflows_admin.woocommerce_status,requiredPluginsData:cartflows_admin.required_plugins_data,missingPlugins:cartflows_admin.is_any_required_plugins_missing,flow_count:4,cf_pro_status:cartflows_admin.cf_pro_status,all_flows:{...pZ},store_checkout_flows:{...mZ},all_step_templates:(()=>{const e=[],t=cartflows_admin.flows_and_steps;return t&&t.forEach(t=>{t.steps.forEach(n=>{n.template_ID=t.ID,n.template_type=t.type,e.push(n)})}),e})(),currentFlowSteps:Object.values(cartflows_admin.currentFlowSteps).length?cartflows_admin.currentFlowSteps["wcf-steps"]:[],flowsCount:(()=>{if(!Object.values(cartflows_admin.flows_count).length)return 0;let e=0;for(status in cartflows_admin.flows_count)"publish"===status&&(e+=parseInt(cartflows_admin.flows_count[status]));return e})(),currentFlowId:cartflows_admin.flow_id,selectedStep:"",license_status:cartflows_admin.license_status,stepTypes:{landing:"Landing",checkout:"Checkout",upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You",optin:"Optin"},storeStepTypes:{upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You"}},gZ={getCount:({age:e})=>e,getAllFlows:({all_flows:e})=>e,getStoreCheckoutFlows:({store_checkout_flows:e})=>e,getFlowsList:({all_flows:e},t)=>e[t]?e[t]:[],getStoreCheckoutFlowsList:({store_checkout_flows:e},t)=>e[t]?e[t]:[],getAllStepTemplates:({all_step_templates:e})=>e,isLimitReached:({cf_pro_status:e,flow_count:t})=>("not-installed"===e||"inactive"===e)&&t>=3,getFlowsCount:({})=>0,getcurrentFlowId:({currentFlowId:e})=>e,getLicenseStatus:({license_status:e})=>e,getselectedStepTitle:({stepTypes:e,selectedStep:t})=>e[t]||"",getselectedStep:({selectedStep:e})=>e,getstepTypes:({stepTypes:e})=>e,getStoreStepTypes:({storeStepTypes:e})=>e,getcurrentFlowSteps:({currentFlowSteps:e})=>e,getMissingPlugins:({missingPlugins:e})=>e,getPreview:({preview:e})=>e,getWooCommerceStatus:({woocommerce_status:e})=>e,getDefaultPageBuilder:({default_page_builder:e})=>e,getPageBuilderGroup:({page_builder_group:e})=>e,getFlowCount:({flow_count:e})=>e,getCFProStatus:({cf_pro_status:e})=>e,getCurrentPageBuilderData:({page_builder_group_data:e},t)=>e[t],getRequiredPluginsData:({requiredPluginsData:e})=>e},wZ={updateWooCommerceStatus:e=>({type:"UPDATE_WOOCOMMERCE_STATUS",woocommerce_status:e}),updateCFProStatus:e=>({type:"UPDATE_CF_PRO_STATUS",cf_pro_status:e}),setMissingPlugins:e=>({type:"SET_MISSING_PLUGINS",missingPlugins:e}),setPreview:e=>({type:"SET_PREVIEW",preview:e}),setSelectedStep:e=>({type:"SET_SELECTED_STEP",selectedStep:e}),setRequiredPlugins:(e,t)=>({type:"SET_REQUIRED_PLUGINS",page_builder:e,value:t}),setAllFlows:(e,t)=>({type:"SET_ALL_FLOWS",flows:e,page_builder:t})},{registerStore:yZ}=wp.data;function bZ({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}yZ("wcf/importer",{reducer:(e=hZ,t)=>"SET_MISSING_PLUGINS"===t.type?(console.log("SET_MISSING_PLUGINS",t),{...e,missingPlugins:t.missingPlugins}):"UPDATE_WOOCOMMERCE_STATUS"===t.type?(console.log("UPDATE_WOOCOMMERCE_STATUS",t),{...e,woocommerce_status:t.woocommerce_status}):"UPDATE_CF_PRO_STATUS"===t.type?(console.log("UPDATE_CF_PRO_STATUS",t),{...e,cf_pro_status:t.cf_pro_status}):"SET_SELECTED_STEP"===t.type?(console.log("SET_SELECTED_STEP",t),{...e,selectedStep:t.selectedStep}):"SET_PREVIEW"===t.type?(console.log("SET_PREVIEW",t),{...e,preview:t.preview}):"SET_REQUIRED_PLUGINS"===t.type?(e.requiredPluginsData[t.page_builder]=t.value,{...e}):"SET_ALL_FLOWS"===t.type?(e.all_flows[t.page_builder]=t.flows,{...e}):e,actions:wZ,selectors:gZ});const vZ=p.forwardRef(bZ),xZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getstepTypes:t}=e("wcf/importer");return{stepTypes:t()}}),(0,Cg.withDispatch)(e=>{const{setSelectedStep:t}=e("wcf/importer");return{setSelectedStep(e){t(e)}}}))(({stepTypes:e,setSelectedStep:t})=>(0,i.createElement)("div",{className:"wcf-create-step__dropdown-list wcf-select-option w-full text-left"},(0,i.createElement)(Gw,{onChange:e=>{t(e)},size:"md"},(0,i.createElement)(Gw.Button,{placeholder:(0,j.__)("Select Step Type","cartflows"),render:t=>t?e[t]||t:""}),(0,i.createElement)(Gw.Options,null,Object.keys(e).map(t=>(0,i.createElement)(Gw.Option,{value:t,key:t},e[t]))))));function NZ({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const IZ=p.forwardRef(NZ),MZ=(0,kg.compose)((0,Cg.withDispatch)(e=>{const{updateWooCommerceStatus:t}=e("wcf/importer");return{updateWooCommerceStatus(e){t(e)}}}))(({title:e,updateWooCommerceStatus:t})=>{const n=e||(0,j.__)("Activate WooCommerce","cartflows"),[r,o]=(0,i.useState)({isProcessing:!1,buttonText:n}),{isProcessing:a,buttonText:s}=r;return(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(Ro,{className:"wcf-button wcf-primary-button",variant:"primary",size:"md",loading:a,disabled:a,onClick:()=>{o({isProcessing:!0,buttonText:(0,j.__)("Activating WooCommerce..","cartflows")}),_p({slug:"woocommerce",init:"woocommerce/woocommerce.php",name:"WooCommerce"},!1).then(()=>{o({isProcessing:!1,buttonText:(0,j.__)("Successfully Activated!","cartflows")}),setTimeout(()=>{t("active")},3e3)}).catch(e=>{console.log(e),o({isProcessing:!1,buttonText:(0,j.__)("Failed! Activation!","cartflows")})})}},s)))}),EZ=(0,kg.compose)((0,Cg.withDispatch)(e=>{const{updateWooCommerceStatus:t}=e("wcf/importer");return{updateWooCommerceStatus(e){t(e)}}}))(({updateWooCommerceStatus:e})=>{const t=(0,j.__)("Install WooCommerce","cartflows"),[n,r]=(0,i.useState)({isProcessing:!1,buttonText:t}),{isProcessing:o,buttonText:a}=n;return(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(Ro,{className:"wcf-button wcf-primary-button",variant:"primary",size:"md",loading:o,disabled:o,onClick:()=>{var n;r({isProcessing:!0,buttonText:(0,j.__)("Installing WooCommerce..","cartflows")}),(n={slug:"woocommerce",init:"woocommerce/woocommerce.php",name:"woocommerce"},new Promise((e,t)=>{console.log("plugin.slug",n.slug),wp.updates.queue.push({action:"install-plugin",data:{slug:n.slug,init:n.init,name:n.name,success(t){console.log("Installed Successfully! Activating plugin ",n.slug),e(t,n)},error(e){t(e,n)}}}),wp.updates.queueChecker()})).then(()=>{r({isProcessing:!1,buttonText:(0,j.__)("Successfully Installed!","cartflows")}),e("inactive")}).catch(e=>{console.log(e),r({isProcessing:!1,buttonText:(0,j.__)("Installation Failed!","cartflows")}),setTimeout(()=>{r({isProcessing:!1,buttonText:t})},3e3)})}},a)))}),_Z=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:o,getcurrentFlowSteps:a,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:o(),currentFlowSteps:a(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:o,woocommerce_status:a,stepTypes:s,license_status:l,setInputFieldVisibility:c,setErrorDesc:u,offerYesStepId:d="",offerNoStepId:f=""})=>{const p=e.type||"",m=e.title||s[p]||"",[h,g]=(0,i.useState)((0,j.__)("Import Step","cartflows")),[w,y]=(0,i.useState)(!1);if(""===e.type)return(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:!0},h);if(1<=(r?r.filter(e=>p===e.type):[]).length&&!wcfCartflowsPro())return c("hidden"),u((0,j.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===o?(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Higher Plan","cartflows"),desc:(0,j.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")}):(u((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
44 +(0,j.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,{description:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
45 +(0,j.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===p||"downsell"===p){if(c("hidden"),!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(u((0,j.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
46 +(0,j.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),p,cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,{description:(0,j.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
47 +(0,j.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),p,cartflows_admin.cf_pro_type_inactive)})):(u((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
48 +(0,j.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),p)),(0,i.createElement)(Tg,{desc:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
49 +(0,j.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),p),title:"Get CartFlows Higher Plan"}));if("Activated"!==l)return u((0,j.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
50 +(0,j.__)("Add %1$s step to your flow by activating CartFlows license.","cartflows"),p)),c("hidden"),(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(zg,{title:"Activate License"})))}if("pro"===e.template_type){if(!wcfCartflowsTypePro())return"inactive"===o&&"pro"===wcfInactivepluginType()?(c("hidden"),u((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
51 +(0,j.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,{description:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
52 +(0,j.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)})):(c("hidden"),u((0,j.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")),(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Pro","cartflows"),desc:(0,j.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")}));if(wcfCartflowsTypePro()&&"Activated"!==l)return c("hidden"),u((0,j.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
53 +(0,j.__)("Add %1$s step to your flows by activating license.","cartflows"),p)),(0,i.createElement)(zg,{title:"Activate License"})}return"landing"!==p&&"active"!==a?(c("hidden"),u((0,j.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),"inactive"===a?(0,i.createElement)(MZ,{title:`Activate WooCommerce to Import ${m}`,description:(0,j.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,i.createElement)(EZ,null)):(c(""),(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:w,disabled:w,icon:(0,i.createElement)(IZ,{className:"h-4 w-4 stroke-2"}),iconPosition:"left",onClick:()=>{((e,t,n,r,o,a,i,s="",l="")=>{if(console.log(e,t,n),a)return;n("Importing Step.."),o(!0);const c=new window.FormData;c.append("action","cartflows_import_step"),c.append("security",cartflows_admin.import_step_nonce),c.append("remote_flow_id",e.template_ID),c.append("flow_id",t),c.append("step",JSON.stringify(e)),c.append("step_name",r),s&&c.append("offer_yes_step_id",s),l&&c.append("offer_no_step_id",l);const u=window.sessionStorage.getItem("wcf_edge_insertion_context");if(u)try{const e=JSON.parse(u);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?c.append("is_start_edge","true"):c.append("edge_source_step_id",e.sourceStepId),c.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&c.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}Ep()({url:cartflows_admin.ajax_url,method:"POST",body:c}).then(e=>{if(e.success)n((0,j.__)("Imported! Redirecting…","cartflows")),o(!1),Wm.success((0,j.__)("Step imported successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}`},3e3);else{let t=e.data.message;e.data.error_code&&404===e.data.error_code&&(t+=(0,j.__)(" Please sync the library and try importing the template again.","cartflows")),i(Nh(t)),n((0,j.__)("Import Failed! Try again.","cartflows")),Wm.error((0,j.__)("Failed to import step.","cartflows")),setTimeout(()=>{n((0,j.__)("Import Step","cartflows"))},3e3),o(!1)}}).finally(()=>{window.sessionStorage.removeItem("wcf_edge_insertion_context")})})(e,n,g,t,y,w,u,d,f)}},h))}),SZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getcurrentFlowId:t,getselectedStep:n,getselectedStepTitle:r}=e("wcf/importer");return{currentFlowId:t(),selectedStep:n(),selectedStepTitle:r()}}))(({currentFlowId:e,selectedStep:t,selectedStepTitle:n,stepName:r,offerYesStepId:o="",offerNoStepId:a=""})=>{const[s,l]=(0,i.useState)({isProcessing:!1,buttonText:(0,j.__)("Create Step","cartflows")}),{isProcessing:c,buttonText:u}=s;return(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:c,disabled:c,onClick:i=>{i.preventDefault(),c||(l({isProcessing:!0,buttonText:(0,j.__)("Creating Step..","cartflows")}),((e,t,n,r,o,a="",i="")=>{console.log(e,t,n);const s=new window.FormData;s.append("action","cartflows_create_step"),s.append("flow_id",e),s.append("step_type",t),s.append("step_title",n),s.append("security",cartflows_admin.create_step_nonce),s.append("step_name",o),a&&s.append("offer_yes_step_id",a),i&&s.append("offer_no_step_id",i);const l=window.sessionStorage.getItem("wcf_edge_insertion_context");if(l)try{const e=JSON.parse(l);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?s.append("is_start_edge","true"):s.append("edge_source_step_id",e.sourceStepId),s.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&s.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}Ep()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then(t=>{console.log(t),window.sessionStorage.removeItem("wcf_edge_insertion_context"),t.success?(r({isProcessing:!1,buttonText:(0,j.__)("Step Created! Redirecting…","cartflows")}),Wm.success((0,j.__)("Step created successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e}`},3e3)):(r({isProcessing:!1,buttonText:(0,j.__)("Failed to Create Step!","cartflows")}),Wm.error((0,j.__)("Failed to create step.","cartflows")))})})(e,t,n,l,r,o,a))}},u)}),DZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getFlowsCount:t,getselectedStep:n,getstepTypes:r,getcurrentFlowSteps:o,getCFProStatus:a,getWooCommerceStatus:i,getLicenseStatus:s}=e("wcf/importer");return{flowsCount:t(),selectedStep:n(),stepTypes:r(),currentFlowSteps:o(),cf_pro_status:a(),woocommerce_status:i(),license_status:s()}}))(({selectedStep:e,currentFlowSteps:t,cf_pro_status:n,woocommerce_status:r,license_status:o,stepName:a,setInputFieldVisibility:s,setErrorDesc:l,offerYesStepId:c="",offerNoStepId:u=""})=>{if(""===e)return(0,i.createElement)("button",{className:"wcf-button wcf-primary-button",disabled:!0},(0,j.__)("Create Step","cartflows"));if(1<=(t?t.filter(t=>e===t.type):[]).length&&!wcfCartflowsPro())return s("hidden"),l((0,j.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===n?(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Higher Plan","cartflows")}):(l((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
54 +(0,j.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,{description:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
55 +(0,j.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===e||"downsell"===e){if(!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(s("hidden"),l((0,j.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
56 +(0,j.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),e,cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,null)):(s("hidden"),l((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
57 +(0,j.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),e)),(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Higher Plan","cartflows")}));if(wcfCartflowsTypePlusPro()&&"Activated"!==o)return s("hidden"),l((0,j.__)("Activate license for adding more steps and other features.","cartflows")),(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(zg,{title:(0,j.__)("Activate License","cartflows")})))}return"landing"!==e&&"active"!==r?(s("hidden"),l((0,j.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),"inactive"===r?(0,i.createElement)(MZ,null):(0,i.createElement)(EZ,null)):(s(""),l(""),(0,i.createElement)(SZ,{stepName:a,offerYesStepId:c,offerNoStepId:u}))}),jZ=({stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r="",offerNoStepId:o=""})=>(0,i.createElement)("div",{className:"wcf-create-step__button-wrap"},(0,i.createElement)(DZ,{stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r,offerNoStepId:o})),kZ=e=>{if(!e||!Array.isArray(e))return[];const t=window.sessionStorage.getItem("wcf_edge_insertion_context");let n=-1;if(t)try{const r=JSON.parse(t).sourceStepId;if("wcf_start_node"===r||"start"===r)return e.filter(e=>"checkout"!==e.type);r&&(n=e.findIndex(e=>e.id===r||e.id===parseInt(r,10)))}catch(e){window.sessionStorage.removeItem("wcf_edge_insertion_context")}return-1===n?e.filter(e=>"checkout"!==e.type):e.slice(n+1).filter(e=>"checkout"!==e.type)},CZ=({offerYesStepId:e,setOfferYesStepId:t,offerNoStepId:n,setOfferNoStepId:r,availableSteps:o=null})=>{const{currentFlowSteps:a}=(0,Cg.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps()})),s=null!==o?o:kZ(a);return 0===s.length?null:(0,i.createElement)("div",{className:"mt-5 space-y-4"},(0,i.createElement)("div",{className:"text-sm font-medium text-gray-700 mb-2"},(0,j.__)("Conditional Redirect Settings","cartflows")),(0,i.createElement)("div",null,(0,i.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,j.__)("On Accept (Yes), go to:","cartflows")),(0,i.createElement)("select",{className:"w-full input-field !px-3 !py-2 text-sm font-normal !rounded-md text-gray-600 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:e,onChange:e=>t(e.target.value)},(0,i.createElement)("option",{value:""},(0,j.__)("Default (Auto)","cartflows")),s.map(e=>(0,i.createElement)("option",{key:e.id,value:e.id},e.title)))),(0,i.createElement)("div",null,(0,i.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,j.__)("On Reject (No), go to:","cartflows")),(0,i.createElement)("select",{className:"w-full input-field !px-3 !py-2 text-sm font-normal !rounded-md text-gray-600 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:n,onChange:e=>r(e.target.value)},(0,i.createElement)("option",{value:""},(0,j.__)("Default (Auto)","cartflows")),s.map(e=>(0,i.createElement)("option",{key:e.id,value:e.id},e.title)))))},AZ=({visibility:e,setVisibility:t,item:n,type:r,stepName:o,setStepName:a})=>{const s="show"===e,[l,c]=(0,i.useState)(""),[u,d]=(0,i.useState)(""),[f,p]=(0,i.useState)(0),[m,h]=(0,i.useState)(""),[g,w]=(0,i.useState)(""),{currentFlowSteps:y,selectedStep:b}=(0,Cg.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps(),selectedStep:e("wcf/importer").getselectedStep()})),v="ready-templates"===r?n&&("upsell"===n.type||"downsell"===n.type):"upsell"===b||"downsell"===b,x=kZ(y);return(0,i.createElement)(Jh,{open:s,setOpen:e=>{e||t("hide")},exitOnClickOutside:!1},(0,i.createElement)(Jh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(Jh.Title,null,"hidden"===l?(0,j.__)("Upgrade Required","cartflows"):(0,j.__)("Name Your Step","cartflows")),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)(Jh.Body,null,(0,i.createElement)("div",{className:`${l}`},(0,i.createElement)("div",{className:"flex justify-between py-2"},(0,i.createElement)("label",{className:"flex gap-1 text-sm font-normal text-text-primary"},(0,j.__)("Step Name","cartflows")),(0,i.createElement)("span",{className:"text-xs font-normal "+(40===f?"text-brand-500":"text-field-placeholder")},f,"/40")),(0,i.createElement)(Qw,{type:"text",value:o,onChange:e=>{e.length<=40&&(p(e.length),a(e))},placeholder:(0,j.__)("Enter Step Name","cartflows"),size:"md"})),"hidden"!==l&&v&&x.length>0&&(0,i.createElement)(CZ,{offerYesStepId:m,setOfferYesStepId:h,offerNoStepId:g,setOfferNoStepId:w,availableSteps:x}),""!==u&&(0,i.createElement)("p",{className:"text-sm font-regular text-text-secondary mt-3 m-0"},u)),(0,i.createElement)(Jh.Footer,{className:"flex gap-3 justify-end"},"ready-templates"===r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:()=>t("hide")},(0,j.__)("Cancel","cartflows")),(0,i.createElement)(_Z,{currentStep:n,stepName:o,setInputFieldVisibility:c,setErrorDesc:d,offerYesStepId:m,offerNoStepId:g})),"create-your-own"===r&&(0,i.createElement)(jZ,{stepName:o,setInputFieldVisibility:c,setErrorDesc:d,offerYesStepId:m,offerNoStepId:g}))))},TZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,i.useState)("hide"),[r,o]=(0,i.useState)("");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(AZ,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:o}),(0,i.createElement)("div",{className:"wcf-step-library--item wcf-step-library--item__start-scratch h-full bg-background-primary rounded-lg shadow-md relative p-5 box-border"},(0,i.createElement)("div",{className:"wcf-step-library--item--scratch-select text-center w-full h-full min-h-[340px] flex flex-col gap-4 items-center justify-center"},(0,i.createElement)("h3",{className:"text-base text-text-primary text-center font-medium m-0"},(0,j.__)("Select Step Type","cartflows")),(0,i.createElement)(xZ,null),(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:""===e,icon:(0,i.createElement)(Kx,{className:"h-18 w-18 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,j.__)("Create Step","cartflows")),(0,i.createElement)("div",{className:"wcf-learn-how"},(0,i.createElement)("a",{href:getKbDocUrl(`${cartflows_admin.cf_domain_url}docs/cartflows-step-types/`),target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-sm text-text-tertiary hover:text-brand-500"},(0,i.createElement)(Og,{className:"w-18 h-18 stroke-1"}),(0,j.__)("Learn How","cartflows")))),(0,i.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle absolute bottom-0 left-0 w-full"},(0,i.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,j.__)("Create from Scratch","cartflows")))))});function LZ({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25"}))}const OZ=p.forwardRef(LZ),zZ=function({item:e}){const[t,n]=(0,i.useState)("hide"),[r,o]=(0,i.useState)("");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(AZ,{visibility:t,setVisibility:n,type:"ready-templates",stepName:r,setStepName:o,item:e}),(0,i.createElement)("div",{key:e.id,className:"wcf-template-item self-start group relative cursor-pointer transition ease-in-out delay-150 rounded-lg shadow-md"},"pro"===e.template_type?(0,i.createElement)("div",{className:"z-10 absolute top-5 right-5"},(0,i.createElement)(Ap,null)):"",(0,i.createElement)("div",{className:"wcf-item__inner bg-background-primary border border-border-subtle"},(0,i.createElement)("div",{className:"wcf-item__thumbnail-wrap relative"},(0,i.createElement)("div",{className:"wcf-item__thumbnail overflow-hidden "+("upsell"===e.type||"downsell"===e.type?"max-h-[345px] min-h-[345px]":"min-h-[400px] max-h-[400px]")},(0,i.createElement)("img",{className:"wcf-item__thumbnail-image w-full",src:e.featured_image_url,alt:(0,j.__)("Step thumbnail image","cartflows")})),(0,i.createElement)("div",{className:"wcf-item__view invisible group-hover:visible absolute backdrop-brightness-50 top-0 w-full h-full transition ease-in-out delay-150"},(0,i.createElement)("div",{className:"mx-auto my-0 text-center flex flex-col gap-4 relative top-[35%]"},(0,i.createElement)("span",{className:"wcf-step-preview-wrap"},(0,i.createElement)(Ro,{tag:"a",variant:"outline",size:"sm",href:e.link,target:"_blank",rel:"noreferrer",className:"mx-auto !w-fit no-underline !bg-background-primary/10 !border-white/30 !text-text-on-color hover:!bg-background-primary/20",icon:(0,i.createElement)(Og,{className:"w-4 h-4 stroke-2"})},(0,j.__)("Preview","cartflows"))),(0,i.createElement)("span",{className:"wcf-item__btn",onClick:()=>{n("hide"===t?"show":"hide")}},(0,i.createElement)(Ro,{variant:"primary",size:"sm",className:"mx-auto !w-fit",icon:(0,i.createElement)(OZ,{className:"w-4 h-4 stroke-2"})},(0,j.__)("Import","cartflows")))))),(0,i.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle"},(0,i.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},e.title)))))},PZ=()=>(0,i.createElement)("div",{className:"wcf-step-library-importer wcf-step-library--other"},(0,i.createElement)("div",{className:"wcf-step-library-importer__list bg-background-primary px-10 py-14 border border-solid border-border-subtle rounded-md shadow-sm"},(0,i.createElement)("div",{className:"wcf-item flex gap-6 items-center justify-center"},(0,i.createElement)("div",{className:"wcf-start-from-scratch w-80"},(0,i.createElement)(TZ,null)),(0,i.createElement)("div",{className:"wcf_item__info flex flex-col gap-3 justify-center max-w-sm"},(0,i.createElement)("h3",{className:"wcf_item__info--title text-xl text-text-primary font-semibold m-0"},(0,j.__)("No Results Found.","cartflows")),(0,i.createElement)("span",{className:"wcf_item__info--desc text-base text-text-secondary font-normal"},(0,j.__)("Don't see a step that you would like to import?","cartflows")),(0,i.createElement)("a",{className:"wcf_item__info--doc text-sm text-text-secondary font-normal hover:text-brand-300 flex gap-1",href:getUtmUrl("https://cartflows.com/funnel-suggestions/",{utm_campaign:"suggestions"}),target:"_blank",rel:"noreferrer"},(0,j.__)("Please suggest us ","cartflows"),(0,i.createElement)(Og,{className:"w-5 h-5 stroke-1 text-text-tertiary hover:text-brand-300"})))))),RZ=function(e){const{templates:t,currentStep:n,setcurrentStepCB:r,allowedStepTypes:o}=e,a=t,{step_types:s}=(0,Cg.useSelect)(e=>({step_types:e("wcf/importer").getstepTypes()})),l=Object.entries(s),c=e=>!o||o.hasOwnProperty(e);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-remote-steps-filters flex gap-4 items-center p-8 mb-8 -m-8 bg-background-primary"},(0,i.createElement)("div",{className:"wcf-categories w-full"},(0,i.createElement)("div",{className:"wcf-step-type-filter--links sm:block lg:block hidden"},(0,i.createElement)(G_.Group,{activeItem:n,variant:"rounded",size:"sm",width:"auto",className:"!bg-transparent !p-0 !ring-0 !gap-4",onChange:({value:e})=>{c(e.slug)&&r(e.slug)}},l.map(([e,t])=>{const r=e===n;return(0,i.createElement)(G_.Tab,{key:e,slug:e,text:t,disabled:!c(e),className:"step-type-filter-item !px-1 !py-1 !font-medium "+(r?"!bg-transparent !shadow-none !text-brand-500":"")})}))),(0,i.createElement)("div",{className:"sm:hidden lg:hidden block"},(0,i.createElement)(Gw,{value:n,onChange:e=>{c(e)&&r(e)},size:"sm"},(0,i.createElement)(Gw.Button,null),(0,i.createElement)(Gw.Options,null,l.map(e=>{const t=e[0],n=e[1],r=c(t);return(0,i.createElement)(Gw.Option,{key:t,value:t,disabled:!r},n,r?"":" (Not allowed)")})))))),0===a.length?(0,i.createElement)(PZ,null):(0,i.createElement)("div",{className:"wcf-step-importer__list wcf-items-list wcf-row wcf-step-row grid grid-cols-1 sm:grid-cols-4 gap-6 p-6 bg-background-primary shadow-sm rounded-md"},(0,i.createElement)("div",{className:"wcf-start-from-scratch"},(0,i.createElement)(TZ,null)),a.map(e=>(0,i.createElement)(zZ,{item:e,key:e.id}))))},UZ=(0,i.memo)(e=>{const t=(0,j.__)("Sync Library","cartflows"),{template:n}=e,r=n||"",[o,a]=(0,i.useState)({isProcessing:!1,buttonText:t}),{isProcessing:s,buttonText:l}=o,c=async(e,t)=>{const n=new window.FormData;n.append("action","cartflows_import_sites"),n.append("page_no",e),n.append("template",r),n.append("security",cartflows_admin.import_sites_nonce),await Ep()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(n=>{n.success&&(a({isProcessing:!0,buttonText:(0,j.sprintf)(/* translators: %d is replaced with the condition number */ /* translators: %d is replaced with the condition number */
58 +(0,j.__)("Importing page %d","cartflows"),e)}),e===t&&(async()=>{const e=new window.FormData;e.append("action","cartflows_update_library_complete"),e.append("template",r),e.append("security",cartflows_admin.update_library_complete_nonce),a({isProcessing:!0,buttonText:(0,j.__)("Sync Complete","cartflows")}),await Ep()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&a({isProcessing:!1,buttonText:(0,j.__)("Sync Complete","cartflows")})}).catch(()=>{})})())}).catch(()=>{})};return(0,i.createElement)(Ro,{variant:"outline",size:"md",loading:s,icon:(0,i.createElement)(Dp,{className:"w-4 h-4 stroke-1 "+(s?"animate-spin":"")}),className:"wcf-sync whitespace-nowrap sm:whitespace-normal",onClick:e=>{e.preventDefault(),a({isProcessing:!0,buttonText:(0,j.__)("Syncing Library…","cartflows")}),(async()=>{try{const e=new window.FormData;e.append("action","cartflows_sync_library"),e.append("template",r),e.append("security",cartflows_admin.sync_library_nonce),await Ep()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&("updated"===e.data?(a({isProcessing:!1,buttonText:(0,j.__)("Library Synced","cartflows")}),setTimeout(()=>{a({isProcessing:!1,buttonText:t})},5e3)):(async()=>{const e=new window.FormData;e.append("action","cartflows_request_count"),e.append("template",r),e.append("security",cartflows_admin.request_count_nonce),await Ep()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(async e=>{if(e.success){a({isProcessing:!0,buttonText:"Importing Pages.."});const t=e.data.count;for(let e=1;e<=t;e++)c(e,t)}else a({isProcessing:!1,buttonText:t})}).catch(()=>{})})())}).catch(()=>{})}catch(e){}})()}},l)}),BZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,i.useState)("hide"),[r,o]=(0,i.useState)(""),[{page_builder:a}]=Nm();return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(AZ,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:o}),(0,i.createElement)("div",{className:"wcf-step-library--item__start-scratch flex gap-6 mx-auto max-w-4xl px-10 py-14"},(0,i.createElement)("div",{className:"wcf-step-library--item__card relative bg-gray-25 p-5 flex flex-col gap-4 border border-border-subtle rounded-md items-center justify-center h-72 w-2/3"},(0,i.createElement)(v_,{title:(0,j.__)("Create from Scratch","cartflows"),description:(0,j.__)("Select a step type to get started.","cartflows"),tag:"h3",size:"xs",className:"text-center text-base [&>p]:text-text-secondary"}),(0,i.createElement)("div",{className:"w-full"},(0,i.createElement)(xZ,null)),(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:""===e,icon:(0,i.createElement)(Kx,{className:"h-5 w-5 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,j.__)("Create Step","cartflows"))),(0,i.createElement)("div",{className:"wcf-step-library--item__info flex flex-col gap-6 justify-center w-3/4"},(0,i.createElement)("h3",{className:"text-xl text-text-primary font-semibold m-0"},"bricks-builder"===a&&(0,j.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===a&&(0,j.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,i.createElement)("span",{className:"text-base text-text-secondary font-normal mt-2"},"bricks-builder"===a&&(0,j.__)("Are you using Bricks Builder? No worries. CartFlows works well with Bricks Builder. Right now we do not have ready templates for Bricks Builder but we are planning to add it very soon.","cartflows"),"other"===a&&(0,j.__)("Are you using any other page builder? No worries. CartFlows works well with every other page builder. Right now we do not have ready templates for every page builder but we are planning to add it very soon.","cartflows")),(0,i.createElement)("span",{className:"mt-2"},(0,i.createElement)("a",{className:"text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:getKbDocUrl("https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/"),target:"_blank",rel:"noreferrer"},(0,j.__)("Learn How","cartflows"),(0,i.createElement)(Og,{className:"w-4 h-4 stroke-1"}))))))}),FZ=class{constructor(){this.offerSteps=["upsell","downsell"],this.allStepTypes=["landing","optin","checkout","upsell","downsell","thankyou"]}isOfferStep(e){return this.offerSteps.includes(e)}isStartNode(e){return"wcf_start_node"===e||"start"===e}isEndNode(e){return"wcf_end_node"===e||"end"===e}extractStepIdFromNodeId(e){if(!e||this.isStartNode(e)||this.isEndNode(e))return e;if("string"==typeof e&&e.includes("wcf_node_edge_")){const t=parseInt(e.replace("wcf_node_edge_",""),10);return isNaN(t)?null:t}if("string"==typeof e&&e.startsWith("conditional-")){const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}if("string"==typeof e&&e.startsWith("ab-group-")){const t=parseInt(e.replace("ab-group-",""),10);return isNaN(t)?null:t}return"number"==typeof e?e:null}findStepById(e,t){if(!t||!Array.isArray(t))return null;const n=this.extractStepIdFromNodeId(e);if(!n||this.isStartNode(n)||this.isEndNode(n))return null;const r=t.find(e=>e.id===n);if(r)return r;for(const e of t)if(e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])){if(e["ab-test-variations"].find(e=>e.id===n))return{...e,_variationId:n,_isVariation:!0}}return null}getStepType(e,t){if(this.isStartNode(e))return"start";if(this.isEndNode(e))return"end";const n=this.findStepById(e,t);return n?n.type:null}hasOptinBeforeCheckout(e){if(!e||!Array.isArray(e))return!1;let t=!1;for(let n=e.length-1;n>=0;n--){const r=e[n];if("checkout"===r.type&&(t=!0),t&&"optin"===r.type)return!0}return!1}hasCheckoutBefore(e,t){if(!t||!Array.isArray(t))return!1;for(let n=0;n<e;n++)if("checkout"===t[n].type)return!0;return!1}getStepIndex(e,t){if(!t||!Array.isArray(t))return-1;const n=this.extractStepIdFromNodeId(e);return!n||this.isStartNode(n)||this.isEndNode(n)?-1:t.findIndex(e=>e.id===n)}getAllowedStepTypes(e,t,n){const r=this.getStepType(e,n),o=this.getStepType(t,n);return"start"===r?"optin"===o?["landing","checkout"]:"checkout"===o||"landing"===o?this.hasOptinBeforeCheckout(n)?["landing"]:["landing","optin"]:["landing","optin","checkout"]:"end"===o?["thankyou"]:"checkout"===o?"checkout"===r?[]:this.hasOptinBeforeCheckout(n)?["landing"]:["landing","optin"]:"checkout"===r?"checkout"===o?[]:["upsell","downsell"]:this.isOfferStep(r)?this.isOfferStep(o)?["upsell","downsell"]:["upsell","downsell","optin"]:"landing"===r?"checkout"===o?this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]:"optin"===o?["landing"]:this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]:"optin"===r?"checkout"===o?["landing","checkout"]:"landing"===o?["landing"]:["landing","checkout"]:"thankyou"===r?[]:this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]}getAllowedStepTypesObject(e,t,n,r){const o=this.getAllowedStepTypes(e,t,n),a={};return o.forEach(e=>{r&&r[e]&&(a[e]=r[e])}),a}},YZ=function(){const e=(0,d.useHistory)(),[{page_builder:t,flow_id:n,flow_type:r}]=Nm(),[o,a]=(0,i.useState)("landing"),[s,l]=(0,i.useState)(""),[c,u]=(0,i.useState)(null),{all_step_templates:f,stepTypes:p,currentFlowSteps:m}=(0,Cg.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates(),stepTypes:e("wcf/importer").getstepTypes(),currentFlowSteps:e("wcf/importer").getcurrentFlowSteps()})),h=[];f.forEach(e=>{o===e.type&&h.push(e)});const[g,w]=(0,i.useState)(h);return(0,i.useEffect)(()=>{if("flows"!==r)return void u(null);const e=window.sessionStorage.getItem("wcf_edge_insertion_context");if(e)try{const t=JSON.parse(e);if(t.sourceStepId&&t.targetStepId){const e=(new FZ).getAllowedStepTypesObject(t.sourceStepId,t.targetStepId,m,p);u(e);const n=Object.keys(e);n.length>0&&!e.hasOwnProperty(o)&&a(n[0])}}catch(e){console.error("[Library] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}else u(null)},[r,m,p]),(0,i.useEffect)(()=>()=>{window.sessionStorage.getItem("wcf_edge_insertion_context")&&window.sessionStorage.removeItem("wcf_edge_insertion_context")},[]),(0,i.useEffect)(()=>{w(h)},[o]),(0,i.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,i.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},(0,i.createElement)("h3",{className:"text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs","aria-label":(0,j.__)("Back to Flow","cartflows"),icon:(0,i.createElement)(GS,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{n?e.push(`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${n}`):e.push("admin.php?page=cartflows&path=flows")}}),(0,j.__)("Steps Library","cartflows")),"other"!==t&&"bricks-builder"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"gap-4 flex justify-between items-center"},(0,i.createElement)("div",{className:"wcf-search-steps--form w-56"},(0,i.createElement)(Qw,{type:"text",value:s,onChange:function(e){if(l(e),e&&e.length>=3){const t=e.toLowerCase(),n=h.filter(function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)});w(n)}else w(h)},placeholder:(0,j.__)("Search Steps","cartflows"),size:"md",prefix:(0,i.createElement)(vZ,{className:"size-4 text-field-placeholder"}),suffix:s.length>=3?(0,i.createElement)(ZB,{className:"size-4 cursor-pointer text-field-placeholder pointer-events-auto",onClick:()=>{l(""),w(h)}}):null})),(0,i.createElement)("span",{className:"divider w-px bg-background-secondary h-7"}),(0,i.createElement)(UZ,null)))),(0,i.createElement)("div",{className:"wcf-step-library__body"},(0,i.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&"bricks-builder"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-ready-templates"},(0,i.createElement)(RZ,{templates:g,currentStep:o,setcurrentStepCB:a,allowedStepTypes:c}))),("other"===t||"bricks-builder"===t)&&(0,i.createElement)("div",{className:"wcf-start-from-scratch current flex items-center justify-center min-h-[500px]"},(0,i.createElement)(BZ,null)))))},ZZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getDefaultPageBuilder:t}=e("wcf/importer");return{default_page_builder:t()}}))(({default_page_builder:e})=>{const[{flow_id:t}]=Nm();return"library"===new URLSearchParams((0,d.useLocation)().search).get("tab")?(0,i.createElement)(YZ,null):(0,i.createElement)("div",{className:"wcf-flow-library wcf-flex"},"bricks-builder"!==e&&"other"!==e?(0,i.createElement)(_,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library&sub=library`},className:"wcf-flow-library__item wcf-flow-library__item--readymade"},"Import from Library"):"",(0,i.createElement)(TZ,{page_builder:e}))}),VZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getStoreStepTypes:t}=e("wcf/importer");return{stepTypes:t()}}),(0,Cg.withDispatch)(e=>{const{setSelectedStep:t}=e("wcf/importer");return{setSelectedStep(e){t(e)}}}))(({stepTypes:e,setSelectedStep:t})=>(0,i.createElement)("div",{className:"wcf-create-step__dropdown-list wcf-select-option w-full text-left"},(0,i.createElement)(Gw,{onChange:e=>{t(e)},size:"md"},(0,i.createElement)(Gw.Button,{placeholder:(0,j.__)("Select Step Type","cartflows"),render:t=>t?e[t]||t:""}),(0,i.createElement)(Gw.Options,null,Object.keys(e).map(t=>(0,i.createElement)(Gw.Option,{value:t,key:t},e[t])))))),GZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:o,getcurrentFlowSteps:a,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:o(),currentFlowSteps:a(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:o,woocommerce_status:a,stepTypes:s,license_status:l,setInputFieldVisibility:c,setErrorDesc:u})=>{const d=e.type||"",f=e.title||s[d]||"",[p,m]=(0,i.useState)("Import Step"),[h,g]=(0,i.useState)(!1),[w,y]=(0,i.useState)({cta:"",error_msg:""}),{cta:b}=w;if(b)return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:b}}));if(""===e.type)return(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:!0},p);const v=r?r.filter(e=>d===e.type):[];if(console.log("selectedExistSteps.length",v.length),1<=v.length&&!wcfCartflowsPro())return c("hidden"),u((0,j.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===o?(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Higher plan","cartflows")}):(u((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
59 +(0,j.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,null));if("upsell"===d||"downsell"===d){if(c("hidden"),!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(u((0,j.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
60 +(0,j.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),d,cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,null)):(u((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
61 +(0,j.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),d)),(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Higher Plan","cartflows")}));if("Activated"!==l)return c("hidden"),u((0,j.__)("Activate license for adding more flows and other features.","cartflows")),(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(zg,{title:`Activate License and ${p}`})))}return"pro"!==e.template_type||wcfCartflowsTypePro()?"landing"!==d&&"active"!==a?(c("hidden"),"inactive"===a?(u((0,j.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),(0,i.createElement)(MZ,{title:`Activate WooCommerce to Import ${f}`})):(0,i.createElement)(EZ,null)):(c(""),(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:h,disabled:h,icon:(0,i.createElement)(IZ,{className:"h-4 w-4 stroke-2"}),iconPosition:"left",onClick:()=>{((e,t,n,r,o,a,i,s)=>{if(console.log(e,t,n),a)return;n((0,j.__)("Importing Step..","cartflows")),o(!0);const l=new window.FormData;l.append("action","cartflows_import_step"),l.append("security",cartflows_admin.import_step_nonce),l.append("remote_flow_id",e.template_ID),l.append("flow_id",t),l.append("step",JSON.stringify(e)),l.append("step_name",r);const c=window.sessionStorage.getItem("wcf_edge_insertion_context");if(c)try{const e=JSON.parse(c);e.sourceStepId&&e.targetStepId&&(l.append("edge_source_step_id",e.sourceStepId),l.append("edge_target_step_id",e.targetStepId))}catch(e){window.sessionStorage.removeItem("wcf_edge_insertion_context")}Ep()({url:cartflows_admin.ajax_url,method:"POST",body:l}).then(e=>{if(e.success)o(!1),n((0,j.__)("Imported! Redirecting…","cartflows")),Wm.success((0,j.__)("Step imported successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}`},3e3);else if("call_to_action"in e.data)i({cta:e.data.call_to_action}),s(e.data.message);else{let t=e.data.message;e.data.error_code&&404===e.data.error_code&&(t+=(0,j.__)(" Please sync the library and try importing the template again.","cartflows")),s(Nh(t)),n((0,j.__)("Import Failed! Try again.","cartflows")),Wm.error((0,j.__)("Failed to import step.","cartflows")),setTimeout(()=>{n((0,j.__)("Import Step","cartflows"))},3e3),o(!1)}}).finally(()=>{window.sessionStorage.removeItem("wcf_edge_insertion_context")})})(e,n,m,t,g,h,y,u)}},p)):(c("hidden"),"inactive"===o&&"pro"===wcfInactivepluginType()?(c("hidden"),u((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
62 +(0,j.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,null)):(c("hidden"),u((0,j.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")),(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Pro","cartflows")})))}),WZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getcurrentFlowId:t,getselectedStep:n,getselectedStepTitle:r}=e("wcf/importer");return{currentFlowId:t(),selectedStep:n(),selectedStepTitle:r()}}))(({currentFlowId:e,selectedStep:t,selectedStepTitle:n,stepName:r,offerYesStepId:o="",offerNoStepId:a=""})=>{const[s,l]=(0,i.useState)({isProcessing:!1,buttonText:"Create Step"}),{isProcessing:c,buttonText:u}=s;return(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:c,disabled:c,onClick:i=>{i.preventDefault(),c||(l({isProcessing:!0,buttonText:(0,j.__)("Creating Step..","cartflows")}),((e,t,n,r,o,a="",i="")=>{console.log(e,t,n);const s=new window.FormData;s.append("action","cartflows_create_step"),s.append("flow_id",e),s.append("step_type",t),s.append("step_title",n),s.append("security",cartflows_admin.create_step_nonce),s.append("step_name",o),a&&s.append("offer_yes_step_id",a),i&&s.append("offer_no_step_id",i);const l=window.sessionStorage.getItem("wcf_edge_insertion_context");if(l)try{const e=JSON.parse(l);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?s.append("is_start_edge","true"):s.append("edge_source_step_id",e.sourceStepId),s.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&s.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}Ep()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then(t=>{console.log(t),window.sessionStorage.removeItem("wcf_edge_insertion_context"),t.success?(r({isProcessing:!1,buttonText:(0,j.__)("Step Created! Redirecting…","cartflows")}),Wm.success((0,j.__)("Step created successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e}`},3e3)):(r({isProcessing:!1,buttonText:(0,j.__)("Failed to Create Step!","cartflows")}),Wm.error((0,j.__)("Failed to create step.","cartflows")))})})(e,t,n,l,r,o,a))}},u)}),HZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getFlowsCount:t,getselectedStep:n,getstepTypes:r,getcurrentFlowSteps:o,getCFProStatus:a,getWooCommerceStatus:i,getLicenseStatus:s}=e("wcf/importer");return{flowsCount:t(),selectedStep:n(),stepTypes:r(),currentFlowSteps:o(),cf_pro_status:a(),woocommerce_status:i(),license_status:s()}}))(({selectedStep:e,currentFlowSteps:t,cf_pro_status:n,woocommerce_status:r,license_status:o,stepName:a,setInputFieldVisibility:s,setErrorDesc:l,offerYesStepId:c="",offerNoStepId:u=""})=>{if(""===e)return(0,i.createElement)("button",{className:"wcf-button wcf-primary-button",disabled:!0},(0,j.__)("Create Step","cartflows"));if(1<=(t?t.filter(t=>e===t.type):[]).length&&!wcfCartflowsPro())return s("hidden"),l((0,j.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===n?(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Higher Plan","cartflows")}):(l((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
63 +(0,j.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,{description:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
64 +(0,j.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===e||"downsell"===e){if(!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(s("hidden"),l((0,j.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */
65 +(0,j.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),e,cartflows_admin.cf_pro_type_inactive)),(0,i.createElement)(Ag,null)):(s("hidden"),l((0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
66 +(0,j.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),e)),(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Higher Plan","cartflows")}));if(wcfCartflowsTypePlusPro()&&"Activated"!==o)return s("hidden"),l((0,j.__)("Activate license for adding more steps and other features.","cartflows")),(0,i.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,i.createElement)("div",{className:"wcf-flow-import__button"},(0,i.createElement)(zg,{title:(0,j.__)("Activate License","cartflows")})))}return"landing"!==e&&"active"!==r?(s("hidden"),"inactive"===r?(l((0,j.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),(0,i.createElement)(MZ,null)):(0,i.createElement)(EZ,null)):(s(""),l(""),(0,i.createElement)(WZ,{stepName:a,offerYesStepId:c,offerNoStepId:u}))}),QZ=({stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r="",offerNoStepId:o=""})=>(0,i.createElement)("div",{className:"wcf-create-step__button-wrap"},(0,i.createElement)(HZ,{stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r,offerNoStepId:o})),$Z=({visibility:e,setVisibility:t,item:n,type:r,stepName:o,setStepName:a})=>{const s="show"===e,[l,c]=(0,i.useState)(""),[u,d]=(0,i.useState)(""),[f,p]=(0,i.useState)(0),[m,h]=(0,i.useState)(""),[g,w]=(0,i.useState)(""),{currentFlowSteps:y,selectedStep:b}=(0,Cg.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps(),selectedStep:e("wcf/importer").getselectedStep()})),v="ready-templates"===r?n&&("upsell"===n.type||"downsell"===n.type):"upsell"===b||"downsell"===b,x=kZ(y);return(0,i.createElement)(Jh,{open:s,setOpen:e=>{e||t("hide")},exitOnClickOutside:!1},(0,i.createElement)(Jh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(Jh.Title,null,"hidden"===l?(0,j.__)("Upgrade Required","cartflows"):(0,j.__)("Name Your Step","cartflows")),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)(Jh.Body,null,(0,i.createElement)("div",{className:`${l}`},(0,i.createElement)("div",{className:"flex justify-between py-2"},(0,i.createElement)("label",{className:"flex gap-1 text-sm font-normal text-text-primary"},(0,j.__)("Step Name","cartflows")),(0,i.createElement)("span",{className:"text-xs font-normal "+(40===f?"text-brand-500":"text-field-placeholder")},f,"/40")),(0,i.createElement)(Qw,{type:"text",value:o,onChange:e=>{e.length<=40&&(p(e.length),a(e))},placeholder:(0,j.__)("Enter Step Name","cartflows"),size:"md"})),"hidden"!==l&&v&&x.length>0&&(0,i.createElement)(CZ,{offerYesStepId:m,setOfferYesStepId:h,offerNoStepId:g,setOfferNoStepId:w,availableSteps:x}),""!==u&&(0,i.createElement)("p",{className:"text-sm font-regular text-text-secondary mt-3 m-0"},u)),(0,i.createElement)(Jh.Footer,{className:"flex gap-3 justify-end"},"ready-templates"===r&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:()=>t("hide")},(0,j.__)("Cancel","cartflows")),(0,i.createElement)(GZ,{currentStep:n,stepName:o,setInputFieldVisibility:c,setErrorDesc:d,offerYesStepId:m,offerNoStepId:g})),"create-your-own"===r&&(0,i.createElement)(QZ,{stepName:o,setInputFieldVisibility:c,setErrorDesc:d,offerYesStepId:m,offerNoStepId:g}))))},XZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,i.useState)("hide"),[r,o]=(0,i.useState)("");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)($Z,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:o}),(0,i.createElement)("div",{className:"wcf-step-library--item wcf-step-library--item__start-scratch h-full bg-background-primary rounded-lg shadow-md relative p-5 box-border"},(0,i.createElement)("div",{className:"wcf-step-library--item--scratch-select text-center w-full h-full min-h-[340px] flex flex-col gap-4 items-center justify-center"},(0,i.createElement)("h3",{className:"text-base text-text-primary text-center font-medium m-0"},(0,j.__)("Select Step Type","cartflows")),(0,i.createElement)(VZ,null),(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:""===e,icon:(0,i.createElement)(Kx,{className:"h-18 w-18 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,j.__)("Create Step","cartflows")),(0,i.createElement)("div",{className:"wcf-learn-how"},(0,i.createElement)("a",{href:getKbDocUrl(`${cartflows_admin.cf_domain_url}docs/cartflows-step-types/`),target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-sm text-text-tertiary hover:text-brand-500"},(0,i.createElement)(Og,{className:"w-18 h-18 stroke-1"}),(0,j.__)("Learn More","cartflows")))),(0,i.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle absolute bottom-0 left-0 w-full"},(0,i.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,j.__)("Create from Scratch","cartflows")))))}),JZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r()}}))(({visibility:e,setVisibility:t,errorMessage:n,title:r})=>{const o=r||(0,j.__)("Error","cartflows");return(0,i.createPortal)((0,i.createElement)("div",{className:`wcf-name-your-flow ${e}`},(0,i.createElement)(Jh,{open:"show"===e,setOpen:e=>{e||t("hide")},exitOnClickOutside:!0},(0,i.createElement)(Jh.Panel,{className:"sm:max-w-lg w-full"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(Jh.Title,{className:"wcf-name-your-flow--title"},o),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)(Jh.Body,null,(0,i.createElement)("div",{className:"wcf-name-your-flow__body"},(0,i.createElement)("p",null,n))),(0,i.createElement)(Jh.Footer,{className:"wcf-name-your-flow--footer bg-brand-25 flex justify-end gap-4"},(0,i.createElement)(Ro,{variant:"outline",size:"md",className:"no-underline text-center",onClick:()=>t("hide")},(0,j.__)("Close","cartflows")))))),document.getElementById("wcf-json-importer"))}),qZ=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:o,getcurrentFlowSteps:a,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:o(),currentFlowSteps:a(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:o,woocommerce_status:a,stepTypes:s,license_status:l,setInputFieldVisibility:c,step_id:u})=>{const d=e.type||"",f=e.title||s[d]||"",[p,m]=(0,i.useState)("Choose"),[h,g]=(0,i.useState)(!1),[w,y]=(0,i.useState)("hide"),[b,v]=(0,i.useState)("");if(""===e.type)return(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:!0},p);const x=r?r.filter(e=>d===e.type):[];if(console.log("selectedExistSteps.length",x.length),("upsell"===d||"downsell"===d)&&!wcfCartflowsPro()){if(c("hidden"),!wcfCartflowsTypePlusPro())return"not-installed"!==o||"pro"===cartflows_admin.cf_pro_type&&"plus"===cartflows_admin.cf_pro_type?(0,i.createElement)(Ag,{description:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
67 +(0,j.__)("Add unlimited income boosting one-click upsells to your flows by activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}):(0,i.createElement)(Tg,{desc:(0,j.__)("Add unlimited income boosting one-click upsells to your flows when you upgrade to our CartFlows Plus or Pro plan today.","cartflows"),title:"Get CartFlows Higher plan"});if("Activated"!==l)return c("hidden"),(0,i.createElement)(zg,{title:`Activate License and ${p}`})}return"pro"!==e.template_type||wcfCartflowsTypePro()?"landing"!==d&&"active"!==a?(c("hidden"),"inactive"===a?(0,i.createElement)(MZ,{title:`Activate WooCommerce to Import ${f}`,description:(0,j.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,i.createElement)(EZ,null)):(c(""),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ro,{variant:"primary",size:"md",loading:h,disabled:h,onClick:()=>{((e,t,n,r,o,a,i,s,l)=>{if(a)return;n("Changing Template.."),o(!0);const c=new window.FormData;c.append("action","cartflows_update_step"),c.append("security",cartflows_admin.update_step_nonce),c.append("remote_flow_id",e.template_ID),c.append("flow_id",t),c.append("step_id",i),c.append("step",JSON.stringify(e)),c.append("step_name",r),Ep()({url:cartflows_admin.ajax_url,method:"POST",body:c}).then(e=>{console.log(e),e.success?(o(!1),n("Changed! Redirecting..."),Wm.success((0,j.__)("Template changed successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}`},3e3)):"call_to_action"in e.data&&(n("Choose"),l(e.data.call_to_action),s("show"))})})(e,n,m,t,g,h,u,y,v)}},p),(0,i.createElement)(JZ,{visibility:w,setVisibility:y,errorMessage:b}))):(c("hidden"),"not-installed"===o||"pro"!==cartflows_admin.cf_pro_type?(c("hidden"),(0,i.createElement)(Tg,{title:(0,j.__)("Get CartFlows Pro","cartflows"),desc:(0,j.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")})):(c("hidden"),(0,i.createElement)(Ag,{description:(0,j.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
68 +(0,j.__)("Access all of our pro templates by activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)})))}),KZ=function({item:e,mode:t,step_id:n}){void 0===t&&(t="");const[r,o]=(0,i.useState)("hide"),[a,s]=(0,i.useState)("");return(0,i.createElement)(i.Fragment,null,(0,i.createElement)($Z,{visibility:r,setVisibility:o,type:"ready-templates",stepName:a,setStepName:s,item:e}),(0,i.createElement)("div",{key:e.id,className:"wcf-template-item self-start group cursor-pointer relative transition ease-in-out delay-150 rounded-lg shadow-md"},"pro"===e.template_type?(0,i.createElement)("div",{className:"z-10 absolute top-5 right-5"},(0,i.createElement)(Ap,null)):"",(0,i.createElement)("div",{className:"wcf-item__inner bg-background-primary border border-border-subtle"},(0,i.createElement)("div",{className:"wcf-item__thumbnail-wrap relative"},(0,i.createElement)("div",{className:"wcf-item__thumbnail overflow-hidden "+("upsell"===e.type||"downsell"===e.type?"max-h-[345px] min-h-[345px]":"min-h-[400px] max-h-[400px]")},(0,i.createElement)("img",{className:"wcf-item__thumbnail-image w-full",src:e.featured_image_url,alt:(0,j.__)("Step thumbnail image","cartflows")})),(0,i.createElement)("div",{className:"wcf-item__view invisible group-hover:visible absolute backdrop-brightness-50 top-0 w-full h-full transition ease-in-out delay-150"},"default"===t&&(0,i.createElement)("div",{className:"mx-auto my-0 text-center flex flex-col gap-4 relative top-[35%]"},(0,i.createElement)("span",{className:"wcf-step-preview-wrap"},(0,i.createElement)(Ro,{tag:"a",variant:"outline",size:"sm",href:e.link,target:"_blank",rel:"noreferrer",className:"mx-auto !w-fit no-underline !bg-background-primary/10 !border-white/30 !text-text-on-color hover:!bg-background-primary/20",icon:(0,i.createElement)(Og,{className:"w-4 h-4 stroke-2"})},(0,j.__)("Preview","cartflows"))),(0,i.createElement)("span",{className:"wcf-item__btn",onClick:()=>{o("hide"===r?"show":"hide")}},(0,i.createElement)(Ro,{variant:"primary",size:"sm",className:"mx-auto !w-fit",icon:(0,i.createElement)(OZ,{className:"w-4 h-4 stroke-2"})},(0,j.__)("Import","cartflows")))),"dynamic"===t&&(0,i.createElement)("div",{className:"mx-auto my-0 text-center relative top-1/2"},(0,i.createElement)(qZ,{currentStep:e,stepName:"StepName",setInputFieldVisibility:o,step_id:n})))),(0,i.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle"},(0,i.createElement)("span",{className:"wcf-item__heading block text-base text-text-primary font-medium p-4 text-center"},e.title)))))},eV=()=>(0,i.createElement)("div",{className:"wcf-step-library-importer wcf-step-library--other"},(0,i.createElement)("div",{className:"wcf-step-library-importer__list bg-background-primary px-10 py-14 border border-solid border-border-subtle rounded-md shadow-sm"},(0,i.createElement)("div",{className:"wcf-item flex gap-6 items-center justify-center"},(0,i.createElement)("div",{className:"wcf-start-from-scratch w-80"},(0,i.createElement)(XZ,null)),(0,i.createElement)("div",{className:"wcf_item__info flex flex-col gap-3 justify-center max-w-sm"},(0,i.createElement)("h3",{className:"wcf_item__info--title text-xl text-text-primary font-semibold m-0"},(0,j.__)("No Results Found.","cartflows")),(0,i.createElement)("span",{className:"wcf_item__info--desc text-base text-text-secondary font-normal"},(0,j.__)("Don't see a step that you would like to import?","cartflows")),(0,i.createElement)("a",{className:"wcf_item__info--doc text-sm text-text-secondary font-normal hover:text-brand-300 flex gap-1",href:getUtmUrl("https://cartflows.com/funnel-suggestions/",{utm_campaign:"suggestions"}),target:"_blank",rel:"noreferrer"},(0,j.__)("Please suggest us ","cartflows"),(0,i.createElement)(Og,{className:"w-5 h-5 stroke-1 text-text-tertiary hover:text-brand-300"})))))),tV=function(e){const{templates:t,currentStep:n,required_step_type:r,currentStepId:o,setcurrentStepCB:a}=e,s=t,{step_types:l}=(0,Cg.useSelect)(e=>({step_types:e("wcf/importer").getStoreStepTypes()})),c=void 0===r?"default":"dynamic",u=void 0===r?l:r;let d=0;void 0!==o&&(d=o);const f=Object.entries(u);return(0,i.createElement)(i.Fragment,null,"default"===c&&(0,i.createElement)("div",{className:"wcf-remote-steps-filters flex gap-4 items-center p-8 mb-8 -m-8 bg-background-primary"},(0,i.createElement)("div",{className:"wcf-categories w-full"},(0,i.createElement)("div",{className:"wcf-step-type-filter--links sm:block lg:block hidden"},(0,i.createElement)(G_.Group,{activeItem:n,variant:"rounded",size:"sm",width:"auto",className:"!bg-transparent !p-0 !ring-0 !gap-4",onChange:({value:e})=>{a(e.slug)}},f.map(([e,t])=>{const r=e===n;return(0,i.createElement)(G_.Tab,{key:e,slug:e,text:t,className:"step-type-filter-item !px-1 !py-1 !font-medium "+(r?"!bg-transparent !shadow-none !text-brand-500":"")})}))),(0,i.createElement)("div",{className:"sm:hidden lg:hidden block"},(0,i.createElement)(Gw,{value:n,onChange:e=>{a(e)},size:"sm"},(0,i.createElement)(Gw.Button,null),(0,i.createElement)(Gw.Options,null,f.map(e=>(0,i.createElement)(Gw.Option,{key:e[0],value:e[0]},e[1]))))))),0===s.length?(0,i.createElement)(eV,null):(0,i.createElement)("div",{className:"wcf-step-importer__list wcf-items-list wcf-row wcf-step-row grid grid-cols-1 sm:grid-cols-4 gap-6 p-6 bg-background-primary shadow-sm rounded-md"},(0,i.createElement)("div",{className:"wcf-start-from-scratch"},(0,i.createElement)(XZ,null)),s.map(e=>(0,i.createElement)(KZ,{item:e,key:e.id,mode:c,step_id:d}))))},nV=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,i.useState)("hide"),[r,o]=(0,i.useState)(""),[{page_builder:a}]=Nm();return(0,i.createElement)(i.Fragment,null,(0,i.createElement)($Z,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:o}),(0,i.createElement)("div",{className:"wcf-step-library--item__start-scratch flex gap-6 mx-auto max-w-4xl px-10 py-14"},(0,i.createElement)("div",{className:"wcf-step-library--item__card relative bg-gray-25 p-5 flex flex-col gap-4 border border-border-subtle rounded-md items-center justify-center h-72 w-2/3"},(0,i.createElement)(v_,{title:(0,j.__)("Create from Scratch","cartflows"),description:(0,j.__)("Select a step type to get started.","cartflows"),tag:"h3",size:"xs",className:"text-center text-base [&>p]:text-text-secondary"}),(0,i.createElement)("div",{className:"w-full"},(0,i.createElement)(VZ,null)),(0,i.createElement)(Ro,{variant:"primary",size:"md",disabled:""===e,icon:(0,i.createElement)(Kx,{className:"h-5 w-5 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,j.__)("Create Step","cartflows"))),(0,i.createElement)("div",{className:"wcf-step-library--item__info flex flex-col gap-6 justify-center w-3/4"},(0,i.createElement)("h3",{className:"text-xl text-text-primary font-semibold m-0"},"bricks-builder"===a&&(0,j.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===a&&(0,j.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,i.createElement)("span",{className:"text-base text-text-secondary font-normal mt-2"},"bricks-builder"===a&&(0,j.__)("Are you using Bricks Builder? No worries. CartFlows works well with Bricks Builder. Right now we do not have ready templates for Bricks Builder but we are planning to add it very soon.","cartflows"),"other"===a&&(0,j.__)("Are you using any other page builder? No worries. CartFlows works well with every other page builder. Right now we do not have ready templates for every page builder but we are planning to add it very soon.","cartflows")),(0,i.createElement)("span",{className:"mt-2"},(0,i.createElement)("a",{className:"text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:getKbDocUrl("https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/"),target:"_blank",rel:"noreferrer"},(0,j.__)("Learn How","cartflows"),(0,i.createElement)(Og,{className:"w-4 h-4 stroke-1"}))))))}),rV=function(){const e=(0,d.useHistory)(),[{page_builder:t,flow_id:n}]=Nm(),[r,o]=(0,i.useState)("upsell"),[a,s]=(0,i.useState)(""),{all_step_templates:l}=(0,Cg.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates()})),c=[];l.forEach(e=>{r===e.type&&c.push(e)});const[u,f]=(0,i.useState)(c);return(0,i.useEffect)(()=>{f(c)},[r]),(0,i.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,i.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},(0,i.createElement)("h3",{className:"text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs","aria-label":(0,j.__)("Back to Store Checkout","cartflows"),icon:(0,i.createElement)(GS,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{n?e.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`):e.push("admin.php?page=cartflows&path=store-checkout")}}),(0,j.__)("Steps Library","cartflows")),"other"!==t&&"bricks-builder"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"gap-4 flex justify-between items-center"},(0,i.createElement)("div",{className:"wcf-search-steps--form w-56"},(0,i.createElement)(Qw,{type:"text",value:a,onChange:function(e){if(s(e),e&&e.length>=3){const t=e.toLowerCase(),n=c.filter(function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)});f(n)}else f(c)},placeholder:(0,j.__)("Search Steps","cartflows"),size:"md",prefix:(0,i.createElement)(vZ,{className:"size-4 text-field-placeholder"}),suffix:a.length>=3?(0,i.createElement)(ZB,{className:"size-4 cursor-pointer text-field-placeholder pointer-events-auto",onClick:()=>{s(""),f(c)}}):null})),(0,i.createElement)("span",{className:"divider w-px bg-background-secondary h-7"}),(0,i.createElement)(UZ,{template:"store-checkout"})))),(0,i.createElement)("div",{className:"wcf-step-library__body"},(0,i.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&"bricks-builder"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-ready-templates"},(0,i.createElement)(tV,{templates:u,currentStep:r,setcurrentStepCB:o}))),("other"===t||"bricks-builder"===t)&&(0,i.createElement)("div",{className:"wcf-start-from-scratch current flex items-center justify-center min-h-[500px]"},(0,i.createElement)(nV,null)))))},oV=(0,kg.compose)((0,Cg.withSelect)(e=>{const{getDefaultPageBuilder:t}=e("wcf/importer");return{default_page_builder:t()}}))(({default_page_builder:e})=>{const[{flow_id:t}]=Nm();return"library"===new URLSearchParams((0,d.useLocation)().search).get("tab")?(0,i.createElement)(rV,null):(0,i.createElement)("div",{className:"wcf-flow-library wcf-flex"},"other"!==e?(0,i.createElement)(_,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&action=wcf-edit-flow&flow_id=${t}&tab=library&sub=library`},className:"wcf-flow-library__item wcf-flow-library__item--readymade"},"Import from Library"):"",(0,i.createElement)(XZ,null))}),aV=function(){const[{step_data:e,page_builder:t,flow_id:n,step_id:r}]=Nm(),o=(0,d.useHistory)(),a={[e.type]:""},[s,l]=(0,i.useState)(e.type),{all_step_templates:c}=(0,Cg.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates()})),u=[];c.forEach(t=>{e.type===t.type&&u.push(t)});const f=async function(){r?o.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&step_id=${r}`):o.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`)};return 0===Object.keys(e).length&&f(),(0,i.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,i.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},"other"!==t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("h3",{className:"flex items-center gap-2 text-2xl font-semibold text-text-primary m-0"},(0,i.createElement)(Ro,{variant:"ghost",size:"xs",icon:(0,i.createElement)(GS,{className:"w-6 h-6 stroke-1"}),onClick:f}),(0,j.sprintf)(/* translators: %s is replaced with the step title */ /* translators: %s is replaced with the step title */
69 +(0,j.__)("Templates for %s","cartflows"),e.title)),(0,i.createElement)("div",{className:"wcf-step-library__step-actions"},(0,i.createElement)("div",{className:"wcf-tab-wrapper"},(0,i.createElement)("div",{className:"wcf-get-started-steps"}))))),(0,i.createElement)("div",{className:"wcf-step-library__body"},(0,i.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&e&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-ready-templates current"},(0,i.createElement)(tV,{templates:u,currentStep:s,required_step_type:a,currentStepId:e.id,setcurrentStepCB:l}))),"other"===t&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wcf-start-from-scratch current"},(0,i.createElement)(XZ,null))))))};function iV({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const sV=p.forwardRef(iV);function lV({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{fillRule:"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const cV=p.forwardRef(lV);function uV({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const dV=p.forwardRef(uV),fV=({slides:e})=>{const[t,n]=(0,i.useState)(0),[r,o]=(0,i.useState)(!1);return(0,i.createElement)("div",{className:"slider-container mb-2"},(0,i.createElement)("div",{className:"slide-wrapper gap-2 border border-solid border-yellow-400 rounded-lg bg-alert-background-warning p-3"},(0,i.createElement)("div",{className:"slide flex items-center gap-2 "+(r?"fade-out":"fade-in")},(0,i.createElement)("div",{className:"wcf-payment-gateway-notice--icon flex"},(0,i.createElement)(sV,{className:"h-5 w-5 text-support-warning","aria-hidden":"true"})),(0,i.createElement)("div",{dangerouslySetInnerHTML:{__html:e[t]}})),e.length>1&&(0,i.createElement)("div",{className:"slider-dots"},(0,i.createElement)("button",{onClick:()=>{r||(o(!0),setTimeout(()=>{n(0===t?e.length-1:t-1),o(!1)},400))},className:"slider-button "+(0===t?"disabled":""),disabled:0===t},(0,i.createElement)(cV,{className:"h-8 w-8","aria-hidden":"true"})),(0,i.createElement)("button",{onClick:()=>{r||(o(!0),setTimeout(()=>{n(t===e.length-1?0:t+1),o(!1)},400))},className:"slider-button "+(t===e.length-1?"disabled":""),disabled:t===e.length-1},(0,i.createElement)(dV,{className:"h-8 w-8","aria-hidden":"true"})))))},pV=function(){const e=new URLSearchParams((0,d.useLocation)().search),[{flow_type:t}]=Nm(),n=e.get("tab"),r=!!e.get("step_id"),o="true"===e.get("flow_settings"),a=cartflows_admin.cartflows_admin_notices,s=a.length>0&&!r&&!o;return(0,i.createElement)(i.Fragment,null,s&&(0,i.createElement)("div",{className:"wcf-notices-wrapper"},(0,i.createElement)(fV,{slides:a})),function(){let e="";switch(n){case"library":e="flows"===t?(0,i.createElement)(ZZ,null):(0,i.createElement)(oV,null);break;case"update-template":e=(0,i.createElement)(aV,null);break;default:e=(0,i.createElement)(cZ,null)}return e}())},mV=function(){const[e]=Nm();return function(){const[{options:e},t]=Nm(),n=function(n){const{name:r,value:o}=n.detail;if(r&&r.includes("[")){const n=r.split("["),a=[];for(let e=1;e<n.length;e++)a.push(n[e].split("]")[0]);const i=r.substr(0,r.indexOf("["));if("wcf-checkout-custom-fields"===i)return"";const s=e[i];if(!s||"object"!=typeof s)return;switch(a.length){case 2:s[a[0]][a[1]]=o;break;case 4:s[a[0]][a[1]][a[2]][a[3]]=o}t({type:"SET_OPTION",name:i,value:s})}void 0!==e[r]&&(window.wcfUnsavedChanges=!0,t({type:"SET_OPTION",name:r,value:o})),"wcf-pre-checkout-offer-product"===r&&(t({type:"SET_OPTION",name:"wcf-pre-checkout-offer-desc",value:o?.product_desc||""}),t({type:"SET_OPTION",name:"wcf-pre-checkout-offer-product-title",value:o?.product_name||""}))},r=[{type:"select"},{type:"select2"},{type:"checkbox"},{type:"text"},{type:"datetime"},{type:"textarea"},{type:"code"},{type:"number"},{type:"radio"},{type:"color"},{type:"font"},{type:"product"},{type:"coupon"},{type:"image-selector"},{type:"toggle"},{type:"selectioncard"},{type:"select-with-logo"}];(0,i.useEffect)(()=>(e&&r.map(function(e){return document.addEventListener(`wcf:${e.type}:change`,n),""}),()=>{r.map(function(e){return document.removeEventListener(`wcf:${e.type}:change`,n),""})}),[e])}(),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(pV,null))},hV=function(e){const t=new URLSearchParams((0,d.useLocation)()?.search).get("flow_id");return"flows"===e.flowType?(gm.flow_id=t,gm.flow_type="flows"):(gm.flow_id=cartflows_admin.global_checkout_id,gm.flow_type="storeCheckout"),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(xm,{reducer:bm,initialState:gm},(0,i.createElement)(mV,{type:e.flowType})))},gV=function(){const e=new URLSearchParams((0,d.useLocation)().search),t=e.get("action"),n=e.get("path");let r="flows";return"store-checkout"===n&&(r="storeCheckout"),wcfWpNavMenuChange(n),(0,i.createElement)(i.Fragment,null,function(){let e="";return e="wcf-edit-flow"===t?(0,i.createElement)(hV,{flowType:r}):(0,i.createElement)("h1",null,"404 Not Found."),e}())};function wV({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z"}))}const yV=p.forwardRef(wV);function bV({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m.75 12 3 3m0 0 3-3m-3 3v-6m-1.5-9H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const vV=p.forwardRef(bV);function xV({title:e,titleId:t,...n},r){return p.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?p.createElement("title",{id:t},e):null,p.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}const NV=p.forwardRef(xV),IV={"top-left":"top-0 bottom-0 start-0 justify-start items-start","top-right":"top-0 bottom-0 end-0 justify-start items-end","bottom-left":"top-0 bottom-0 start-0 justify-end items-start","bottom-right":"top-0 bottom-0 end-0 justify-end items-end"},MV={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},EV="bg-background-inverse border-background-inverse",_V={light:"text-icon-secondary",dark:"text-icon-inverse"};let SV=!1;const DV=({toastItem:e,title:t="",content:n="",autoDismiss:r=!0,dismissAfter:o=5e3,theme:a="light",design:i="stack",icon:s,variant:l="neutral",removeToast:c})=>{const u=(0,p.useRef)(0),d=(0,p.useRef)(0),f=(0,p.useRef)(),m=(e,t=o)=>{if(r&&!(o<0))return u.current=(new Date).getTime(),setTimeout(()=>{"function"==typeof c&&c(e.id)},t)};(0,p.useEffect)(()=>{const t=o;return f.current=m(e,t),()=>{clearTimeout(f.current)}},[]),(0,p.useEffect)(()=>{!e?.dismiss||"function"!=typeof c||c(e.id)},[e]);const h=()=>{"function"==typeof c&&e?.action?.onClick?.(()=>c(e.id))};let g=null;return"stack"===i&&(g=(0,C.jsx)("div",{className:Se("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===a?EV:MV?.[l],"w-[22.5rem]"),onMouseEnter:()=>{clearTimeout(f.current),d.current=(new Date).getTime()},onMouseLeave:()=>{f.current=m(e,o-(d.current-u.current))},children:"custom"!==e.type?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Fo({variant:l,icon:s,theme:a})}),(0,C.jsxs)("div",{className:"flex flex-col items-start justify-start gap-0.5 me-6",children:[Zo({title:t,theme:a}),Vo({content:n,theme:a}),e?.action?.label&&"function"==typeof e?.action?.onClick&&(0,C.jsx)("div",{className:"mt-2.5",children:Yo({actionLabel:e?.action?.label,actionType:e?.action?.type??"button",onAction:h,theme:a})})]}),(0,C.jsx)("div",{className:"absolute end-4 top-4 [&_svg]:size-5",children:(0,C.jsx)("button",{className:Se("inline-flex bg-transparent m-0 p-0 border-none focus:outline-none focus-visible:ring-2 focus-visible:ring-toggle-on focus-visible:ring-offset-2 active:outline-none cursor-pointer rounded",_V[a]??_V.light),"aria-label":"Dismiss notification",onClick:t=>{t.preventDefault(),t.stopPropagation(),"function"==typeof c&&c(e.id)},children:(0,C.jsx)(Ho,{"aria-hidden":"true"})})})]}):e?.jsx?.({close:()=>c(e.id),action:e?.action?{...e?.action,onClick:h}:null})})),"inline"===i&&(g=(0,C.jsxs)("div",{className:Se("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===a?EV:MV?.[l],"lg:w-[47.5rem] w-full"),children:[(0,C.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Fo({variant:l,icon:s,theme:a})}),(0,C.jsxs)("div",{className:"flex items-start justify-start gap-1 me-10 [&>span:first-child]:shrink-0",children:[Zo({title:t,theme:a}),Vo({content:n,theme:a})]}),(0,C.jsx)("div",{className:"absolute end-3 top-3 [&_svg]:size-5",children:(0,C.jsx)("button",{className:Se("bg-transparent m-0 p-0 border-none focus:outline-none focus-visible:ring-2 focus-visible:ring-toggle-on focus-visible:ring-offset-2 active:outline-none cursor-pointer rounded",_V[a]??_V.light),"aria-label":"Dismiss notification",onClick:()=>c(e.id),children:(0,C.jsx)(Ho,{"aria-hidden":"true"})})})]})),g},jV=(e=>(0,p.memo)(t=>{const n=t.singleTon;return SV&&n?null:(SV=!0,(0,C.jsx)(e,{...t}))}))(({position:e="top-right",design:t="stack",theme:n="light",className:r="",autoDismiss:o=!0,dismissAfter:a=5e3})=>{const[i,s]=(0,p.useState)([]);(0,p.useEffect)(()=>{Gm.subscribe(e=>{e?.dismiss?s(t=>t.map(t=>t.id===e.id?{...t,dismiss:!0}:t)):setTimeout(()=>{(0,dn.flushSync)(()=>s(t=>-1!==t.findIndex(t=>t.id===e.id)?t.map(t=>t.id===e.id?{...t,...e}:t):[...t,e]))})})},[]);const l=e=>{s(t=>t.filter(t=>t.id!==e))};return(0,C.jsx)("ul",{"aria-live":"polite","aria-label":"Notifications",className:Se("fui-toast-container fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",IV[e]??IV["top-right"],r),children:(0,C.jsx)(Bp,{initial:!1,children:i.map(e=>(0,C.jsx)(Xf.li,{initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:`toast-${e.id}`,children:(0,C.jsx)(DV,{toastItem:e,title:e.title,content:e?.description,icon:e?.icon??void 0,design:e?.design??t,autoDismiss:e?.autoDismiss??o,dismissAfter:e?.dismissAfter??a,removeToast:l,variant:e.type,theme:e?.theme??n})},e.id))})})});class kV extends i.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,i.createElement)("div",{className:"wcf-error-boundary flex items-center justify-center min-h-[60vh]"},(0,i.createElement)("div",{className:"w-full max-w-md rounded-xl border border-border-subtle bg-background-primary shadow-md text-center overflow-hidden"},(0,i.createElement)("div",{className:"h-1 bg-gradient-to-r from-orange-400 via-red-400 to-orange-400"}),(0,i.createElement)("div",{className:"px-8 pt-8 pb-8"},(0,i.createElement)("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-alert-background-danger ring-8 ring-alert-background-danger/50"},(0,i.createElement)(c_,{className:"h-7 w-7 text-support-error"})),(0,i.createElement)(v_,{size:"md",tag:"h2",className:"mb-2"},(0,j.__)("Something went wrong","cartflows")),(0,i.createElement)(vh,{size:"sm",color:"tertiary",className:"mb-6 max-w-xs mx-auto"},(0,j.__)("An unexpected error occurred while loading this section. Refreshing the page should fix the issue.","cartflows")),(0,i.createElement)("div",{className:"flex items-center justify-center gap-3"},(0,i.createElement)(Ro,{variant:"outline",size:"sm",onClick:()=>window.history.back()},(0,j.__)("Go Back","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"sm",icon:(0,i.createElement)(Dp,{className:"h-4 w-4"}),onClick:()=>window.location.reload()},(0,j.__)("Refresh Page","cartflows")))))):this.props.children}}const CV=kV,AV="/cartflows/v1/ai/auth",TV=!(!window.cartflows_admin||!cartflows_admin.ai_connected),LV=To("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]),OV=({open:e,setOpen:t,connect:n})=>{const[r,o]=(0,i.useState)(!1);return(0,i.createElement)(Jh,{open:e,setOpen:t,exitOnClickOutside:!0},(0,i.createElement)(Jh.Panel,{className:"sm:max-w-md w-full"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Header,{className:"flex items-center justify-between !space-y-0"},(0,i.createElement)(Jh.Title,{className:"flex items-center gap-2"},(0,i.createElement)(LV,{className:"size-5 text-brand-600"}),(0,j.__)("Connect to CartFlows AI","cartflows")),(0,i.createElement)(Jh.CloseButton,null)),(0,i.createElement)(Jh.Body,null,(0,i.createElement)(vh,{as:"p",size:14,weight:400,color:"secondary"},(0,j.__)("Connect your site to CartFlows AI to unlock AI-powered content generation and suggestions.","cartflows"))),(0,i.createElement)(Jh.Footer,{className:"flex gap-3 justify-end"},(0,i.createElement)(Ro,{variant:"outline",size:"md",onClick:()=>t(!1)},(0,j.__)("Cancel","cartflows")),(0,i.createElement)(Ro,{variant:"primary",size:"md",onClick:async()=>{r||(o(!0),await n(),o(!1))},loading:r,disabled:r},(0,j.__)("Connect","cartflows")))))},zV=!(!window.cartflows_admin||!cartflows_admin.can_manage_ai_auth),PV=(0,i.createContext)({isConnected:!1,isLoading:!1,connect:()=>{},ensureConnected:()=>!1});window.cartflows=window.cartflows||{},window.cartflows.aiContext=PV;(0,i.createRoot)(document.getElementById("wcf-editor-app")).render((0,i.createElement)(({reducer:e,initialState:t,children:n})=>(window.cartflows.settingsContext=s,(0,i.createElement)(s.Provider,{value:(0,i.useReducer)(e,t)},n)),{initialState:u,reducer:(e,t)=>{switch(t.status){case"SAVED":return window.wcfUnsavedChanges=!1,{...e,settingsProcess:"saved"};case"PROCESSING":return{...e,settingsProcess:"processing"};case"RESET":return{...e,settingsProcess:!1};case"UNSAVED_CHANGES":return"change"===t.trigger?{...e,unsavedChanges:!0}:{...e,unsavedChanges:!1};case"UPDATE_LICENSE_STATUS":return{...e,license_status:t.license_status};case"UPDATE_CANVAS_MODE":return{...e,canvasMode:t.canvasMode};default:return e}}},(0,i.createElement)(function({children:e}){const[t,n]=(0,i.useState)({isOpen:!1}),[r,o]=(0,i.useState)(!1),a=(0,i.useRef)(),s=(0,i.useRef)(),l=(0,i.useCallback)(e=>new Promise(t=>{n({...e,isOpen:!0}),s.current=e.onConfirm,a.current=r=>{t(r),n({...e,isOpen:!1})}}),[n]);return(0,i.createElement)(ug.Provider,{value:l},e,(0,i.createElement)(cg,(0,w.A)({isOpen:t.isOpen,isLoading:r},t,{onClose:()=>a.current(!1),onConfirm:()=>(async()=>{try{o(!0),s.current&&await s.current(),a.current&&a.current(!0)}catch(e){a.current&&a.current(!1)}finally{o(!1)}})()})))},null,(0,i.createElement)(CV,null,(0,i.createElement)(({children:e})=>{window.cartflows.aiContext=PV;const{isConnected:t,isLoading:n,connect:r}=(()=>{const[e,t]=(0,i.useState)(TV),[n,r]=(0,i.useState)(!1),o=(0,i.useCallback)(async()=>{const e=new URLSearchParams(window.location.search),n=e.get("access_key");if(n){r(!0);try{const e=await Ep()({path:AV,method:"POST",data:{accessKey:n}});e?.success?(t(!0),Wm.success(e?.data?.message||(0,j.__)("Connected to CartFlows AI.","cartflows"))):Wm.error(e?.data?.message||(0,j.__)("Could not connect to CartFlows AI. Please try again.","cartflows"))}catch(e){Wm.error(e?.message||(0,j.__)("Could not connect to CartFlows AI. Please try again.","cartflows"))}finally{e.delete("access_key");const t=e.toString(),n=window.location.pathname+(t?`?${t}`:"")+window.location.hash;window.history.replaceState(null,"",n),r(!1)}}},[]);(0,i.useEffect)(()=>{o()},[o]);const a=(0,i.useCallback)(async()=>{const e=window.location.href;try{const n=await Ep()({path:`${AV}?redirect_back=${encodeURIComponent(e)}`}),r=n?.data?.auth_url;if(r)return void(window.location.href=r);if(n?.success)return void t(!0);Wm.error(n?.data?.message||(0,j.__)("Could not start the connection. Please try again.","cartflows"))}catch(e){Wm.error(e?.message||(0,j.__)("Could not start the connection. Please try again.","cartflows"))}},[]);return{isConnected:e,isLoading:n,connect:a}})(),[o,a]=(0,i.useState)(!1),s=(0,i.useCallback)(()=>!(n||!t&&(zV?(a(!0),1):(Wm.error((0,j.__)("Ask a site administrator to connect CartFlows AI.","cartflows")),1))),[t,n]),l=(0,i.useMemo)(()=>({isConnected:t,isLoading:n,connect:r,ensureConnected:s}),[t,n,r,s]);return(0,i.createElement)(PV.Provider,{value:l},e,(0,i.createElement)(OV,{open:o,setOpen:a,connect:r}))},null,(0,i.createElement)(function(){return(0,i.createElement)(v,null,(0,i.createElement)(hm,null),(0,i.createElement)("div",{className:"wcf-app-content-wrapper wcf-app-wrapper--editor-app p-8"},(0,i.createElement)(d.Switch,null,(0,i.createElement)(d.Route,{path:"/"},(0,i.createElement)(gV,null)))))},null))),(0,i.createElement)(function(){const{promiseInProgress:e}=(0,Eg.H8)();let t=(0,j.__)("Please wait…","cartflows"),n="";if(e)switch(window.wcfAction){case"cloneFlow":t=(0,j.__)("Please wait. Duplicating funnel…","cartflows"),n=(0,i.createElement)(Mh,{className:"w-18 h-18 text-brand-500"});break;case"draftFlow":t=(0,j.__)("Please wait. Drafting funnel…","cartflows"),n=(0,i.createElement)(cm,{className:"w-18 h-18 text-brand-500"});break;case"deleteFlow":t=(0,j.__)("Please wait. Deleting funnel…","cartflows"),n=(0,i.createElement)(_h,{className:"w-18 h-18 text-brand-500"});break;case"restoreFlow":t=(0,j.__)("Please wait. Restoring funnel…","cartflows"),n=(0,i.createElement)(yV,{className:"w-18 h-18 text-brand-500"});break;case"exportFlow":t=(0,j.__)("Please wait. Exporting…","cartflows"),n=(0,i.createElement)(vV,{className:"w-18 h-18 text-brand-500"});break;case"cloneStep":t=(0,j.__)("Please wait. Duplicating step…","cartflows"),n=(0,i.createElement)(Mh,{className:"w-18 h-18 text-brand-500"});break;case"deleteStep":t=(0,j.__)("Please wait. Deleting step…","cartflows"),n=(0,i.createElement)(_h,{className:"w-18 h-18 text-brand-500"});break;case"abtestStep":t=(0,j.__)("Please wait. Creating variation…","cartflows"),n=(0,i.createElement)(Mh,{className:"w-18 h-18 text-brand-500"});break;case"archiveStep":t=(0,j.__)("Please wait. Archiving variation…","cartflows"),n=(0,i.createElement)(NV,{className:"w-18 h-18 text-brand-500"});break;case"winnerStep":t=(0,j.__)("Please wait. Declaring winner…","cartflows"),n=(0,i.createElement)(yV,{className:"w-18 h-18 text-brand-500"});break;default:t=(0,j.__)("Please wait…","cartflows"),n=""}return(0,i.createElement)(Jh,{open:!!e,setOpen:()=>{},exitOnClickOutside:!1,exitOnEsc:!1},(0,i.createElement)(Jh.Panel,{className:"sm:max-w-sm w-full"},(0,i.createElement)(Jh.Backdrop,null),(0,i.createElement)(Jh.Body,{className:"flex flex-col items-center py-6"},(0,i.createElement)("div",{className:"relative"},(0,i.createElement)("div",{className:"w-16 h-16 border-brand-200 border-2 rounded-full"}),(0,i.createElement)("div",{className:"w-16 h-16 border-brand-500 border-t-2 animate-spin rounded-full absolute left-0 top-0"}),(0,i.createElement)("div",{className:"w-16 h-16 absolute left-0 top-0 flex justify-center items-center"},n)),(0,i.createElement)("p",{className:"mt-5 text-sm font-normal text-text-secondary text-center m-0"},t))))},null),(0,i.createElement)(jV,{position:"top-right",design:"stack",theme:"light",autoDismiss:!0,dismissAfter:3e3,className:"z-999999"}))))},5146(){window.wcfWpNavMenuChange=function(e){const t=cartflows_admin.admin_base_slug;let n="";"store-checkout"===e&&""!==cartflows_admin.global_checkout_id?n="admin.php?page="+t+"&path=store-checkout&action=wcf-edit-flow&flow_id="+encodeURIComponent(cartflows_admin.global_checkout_id):("store-checkout-library"===e&&(e="store-checkout"),n=e?"admin.php?page="+t+"&path="+encodeURIComponent(e):"admin.php?page="+t);const r=`.wp-submenu-wrap li > a[href$="${n}"]`,o=document.querySelectorAll(r);Array.from(document.getElementsByClassName("current")).forEach(function(e){e.parentElement.classList.contains("wp-submenu")&&e.classList.remove("current")}),Array.from(o).forEach(function(e){e.parentElement.classList.add("current")})},window.wcfUnsavedChanges=!1,window.onbeforeunload=function(){if(wcfUnsavedChanges)return"Unsaved Changes"},window.wcfCartflowsPro=function(){return!!cartflows_admin.is_pro},window.wcfCartflowsTypePro=function(){return!(!cartflows_admin.is_pro||"pro"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypePlus=function(){return!(!cartflows_admin.is_pro||"plus"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypeStarter=function(){return!(!cartflows_admin.is_pro||"starter"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypePlusPro=function(){return wcfCartflowsTypePlus()||wcfCartflowsTypePro()},window.wcfInactiveProPlus=function(){const e=cartflows_admin.cf_pro_type_inactive;return!("inactive"!==cartflows_admin.cf_pro_status||!["CartFlows Pro","CartFlows Plus"].includes(e))},window.wcfInactivepluginType=function(){let e="";switch(cartflows_admin.cf_pro_type_inactive){case"CartFlows Pro":e="pro";break;case"CartFlows Plus":e="plus";break;case"CartFlows Starter":e="starter"}return e},window.getUtmUrl=function(e,t={}){const n=cartflows_admin?.utm_defaults||{source:"dashboard",medium:"free-cartflows"},r=new URL(e);return r.searchParams.has("utm_source")||r.searchParams.set("utm_source",n.source),r.searchParams.has("utm_medium")||r.searchParams.set("utm_medium",n.medium),Object.entries(t||{}).forEach(([e,t])=>{null!=t&&""!==t&&r.searchParams.set(e,t)}),r.toString()},window.getKbDocUrl=function(e,t={}){return window.getUtmUrl(e,{utm_campaign:"docs",...t||{}})},window.getUpgradeToProUrl=function(e={}){const t=cartflows_admin?.cf_upgrade_to_pro_url||(cartflows_admin?.cf_domain_url||"https://cartflows.com/")+"pricing/";return window.getUtmUrl(t,{utm_campaign:"go-pro",...e||{}})},window.setSureTriggersConfig=function(e){window?.SureTriggers.init(e)}},6246(e,t,n){e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822(e,t,n){"use strict";var r=n(6857),o=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?o(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},o={};return r.forEach(e.nodes(),function a(i){r.has(o,i)||(o[i]=!0,n[i]=!0,r.forEach(e.outEdges(i),function(e){r.has(n,e.w)?t.push(e):a(e.w)}),delete n[i])}),t}(e);r.forEach(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))})},undo:function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}},135(e,t,n){var r=n(6857),o=n(3988);function a(e,t,n,r,a,i){var s={width:0,height:0,rank:i,borderType:t},l=a[t][i-1],c=o.addDummyNode(e,"border",s,n);a[t][i]=c,e.setParent(c,r),l&&e.setEdge(l,c,{weight:1})}e.exports=function(e){r.forEach(e.children(),function t(n){var o=e.children(n),i=e.node(n);if(o.length&&r.forEach(o,t),r.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,l=i.maxRank+1;s<l;++s)a(e,"borderLeft","_bl",n,i,s),a(e,"borderRight","_br",n,i,s)}})}},4850(e,t,n){"use strict";var r=n(6857);function o(e){r.forEach(e.nodes(),function(t){a(e.node(t))}),r.forEach(e.edges(),function(t){a(e.edge(t))})}function a(e){var t=e.width;e.width=e.height,e.height=t}function i(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||o(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),function(t){i(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.forEach(n.points,i),r.has(n,"y")&&i(n)})}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),function(t){s(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)})}(e),o(e))}}},9859(e){function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909(e,t,n){var r=n(6857),o=n(3988),a=n(8191).Graph;e.exports={debugOrdering:function(e){var t=o.buildLayerMatrix(e),n=new a({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)}),r.forEach(e.edges(),function(e){n.setEdge(e.v,e.w,{},e.name)}),r.forEach(t,function(e,t){var o="layer"+t;n.setNode(o,{rank:"same"}),r.reduce(e,function(e,t){return n.setEdge(e,t,{style:"invis"}),t})}),n}}},8191(e,t,n){var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031(e,t,n){var r=n(6857),o=n(8191).Graph,a=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new o,i=0,s=0;r.forEach(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),r.forEach(e.edges(),function(e){var r=n.edge(e.v,e.w)||0,o=t(e),a=r+o;n.setEdge(e.v,e.w,a),s=Math.max(s,n.node(e.v).out+=o),i=Math.max(i,n.node(e.w).in+=o)});var c=r.range(s+i+3).map(function(){return new a}),u=i+1;return r.forEach(n.nodes(),function(e){l(c,u,n.node(e))}),{graph:n,buckets:c,zeroIdx:u}}(e,t||i),c=function(e,t,n){for(var r,o=[],a=t[t.length-1],i=t[0];e.nodeCount();){for(;r=i.dequeue();)s(e,t,n,r);for(;r=a.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){o=o.concat(s(e,t,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,function(t){return e.outEdges(t.v,t.w)}),!0)};var i=r.constant(1);function s(e,t,n,o,a){var i=a?[]:void 0;return r.forEach(e.inEdges(o.v),function(r){var o=e.edge(r),s=e.node(r.v);a&&i.push({v:r.v,w:r.w}),s.out-=o,l(t,n,s)}),r.forEach(e.outEdges(o.v),function(r){var o=e.edge(r),a=r.w,i=e.node(a);i.in-=o,l(t,n,i)}),e.removeNode(o.v),i}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202(e,t,n){"use strict";var r=n(6857),o=n(6822),a=n(8209),i=n(9361),s=n(3988).normalizeRanks,l=n(2948),c=n(3988).removeEmptyRanks,u=n(6353),d=n(135),f=n(4850),p=n(1453),m=n(3776),h=n(3988),g=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?h.time:h.notime;n("layout",function(){var t=n(" buildLayoutGraph",function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=_(e.graph());return t.setGraph(r.merge({},y,E(n,w),r.pick(n,b))),r.forEach(e.nodes(),function(n){var o=_(e.node(n));t.setNode(n,r.defaults(E(o,v),x)),t.setParent(n,e.parent(n))}),r.forEach(e.edges(),function(n){var o=_(e.edge(n));t.setEdge(n,r.merge({},I,E(o,N),r.pick(o,M)))}),t}(e)});n(" runLayout",function(){!function(e,t){t(" makeSpaceForEdgeLabels",function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}(e)}),t(" removeSelfEdges",function(){!function(e){r.forEach(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)}),t(" acyclic",function(){o.run(e)}),t(" nestingGraph.run",function(){u.run(e)}),t(" rank",function(){i(h.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),o={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};h.addDummyNode(e,"edge-proxy",o,"_ep")}})}(e)}),t(" removeEmptyRanks",function(){c(e)}),t(" nestingGraph.cleanup",function(){u.cleanup(e)}),t(" normalizeRanks",function(){s(e)}),t(" assignRankMinMax",function(){!function(e){var t=0;r.forEach(e.nodes(),function(n){var o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=r.max(t,o.maxRank))}),e.graph().maxRank=t}(e)}),t(" removeEdgeLabelProxies",function(){!function(e){r.forEach(e.nodes(),function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}(e)}),t(" normalize.run",function(){a.run(e)}),t(" parentDummyChains",function(){l(e)}),t(" addBorderSegments",function(){d(e)}),t(" order",function(){p(e)}),t(" insertSelfEdges",function(){!function(e){var t=h.buildLayerMatrix(e);r.forEach(t,function(t){var n=0;r.forEach(t,function(t,o){var a=e.node(t);a.order=o+n,r.forEach(a.selfEdges,function(t){h.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:a.rank,order:o+ ++n,e:t.e,label:t.label},"_se")}),delete a.selfEdges})})}(e)}),t(" adjustCoordinateSystem",function(){f.adjust(e)}),t(" position",function(){m(e)}),t(" positionSelfEdges",function(){!function(e){r.forEach(e.nodes(),function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),o=r.x+r.width/2,a=r.y,i=n.x-o,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:o+2*i/3,y:a-s},{x:o+5*i/6,y:a-s},{x:o+i,y:a},{x:o+5*i/6,y:a+s},{x:o+2*i/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}(e)}),t(" removeBorderNodes",function(){!function(e){r.forEach(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),o=e.node(n.borderTop),a=e.node(n.borderBottom),i=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-i.x),n.height=Math.abs(a.y-o.y),n.x=i.x+n.width/2,n.y=o.y+n.height/2}}),r.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)}),t(" normalize.undo",function(){a.undo(e)}),t(" fixupEdgeLabelCoords",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}(e)}),t(" undoCoordinateSystem",function(){f.undo(e)}),t(" translateGraph",function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,a=0,i=e.graph(),s=i.marginx||0,l=i.marginy||0;function c(e){var r=e.x,i=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),o=Math.min(o,i-l/2),a=Math.max(a,i+l/2)}r.forEach(e.nodes(),function(t){c(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.has(n,"x")&&c(n)}),t-=s,o-=l,r.forEach(e.nodes(),function(n){var r=e.node(n);r.x-=t,r.y-=o}),r.forEach(e.edges(),function(n){var a=e.edge(n);r.forEach(a.points,function(e){e.x-=t,e.y-=o}),r.has(a,"x")&&(a.x-=t),r.has(a,"y")&&(a.y-=o)}),i.width=n-t+s,i.height=a-o+l}(e)}),t(" assignNodeIntersects",function(){!function(e){r.forEach(e.edges(),function(t){var n,r,o=e.edge(t),a=e.node(t.v),i=e.node(t.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=i,r=a),o.points.unshift(h.intersectRect(a,n)),o.points.push(h.intersectRect(i,r))})}(e)}),t(" reversePoints",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}(e)}),t(" acyclic.undo",function(){o.undo(e)})}(t,n)}),n(" updateInputGraph",function(){!function(e,t){r.forEach(e.nodes(),function(n){var r=e.node(n),o=t.node(n);r&&(r.x=o.x,r.y=o.y,t.children(n).length&&(r.width=o.width,r.height=o.height))}),r.forEach(e.edges(),function(n){var o=e.edge(n),a=t.edge(n);o.points=a.points,r.has(a,"x")&&(o.x=a.x,o.y=a.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)})})};var w=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],v=["width","height"],x={width:0,height:0},N=["minlen","weight","width","height","labeloffset"],I={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M=["labelpos"];function E(e,t){return r.mapValues(r.pick(e,t),Number)}function _(e){var t={};return r.forEach(e,function(e,n){t[n.toLowerCase()]=e}),t}},6857(e,t,n){var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(7373),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353(e,t,n){var r=n(6857),o=n(3988);function a(e,t,n,i,s,l,c){var u=e.children(c);if(u.length){var d=o.addBorderNode(e,"_bt"),f=o.addBorderNode(e,"_bb"),p=e.node(c);e.setParent(d,c),p.borderTop=d,e.setParent(f,c),p.borderBottom=f,r.forEach(u,function(r){a(e,t,n,i,s,l,r);var o=e.node(r),u=o.borderTop?o.borderTop:r,p=o.borderBottom?o.borderBottom:r,m=o.borderTop?i:2*i,h=u!==p?1:s-l[c]+1;e.setEdge(d,u,{weight:m,minlen:h,nestingEdge:!0}),e.setEdge(p,f,{weight:m,minlen:h,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,d,{weight:0,minlen:s+l[c]})}else c!==t&&e.setEdge(t,c,{weight:0,minlen:n})}e.exports={run:function(e){var t=o.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(o,a){var i=e.children(o);i&&i.length&&r.forEach(i,function(e){n(e,a+1)}),t[o]=a}return r.forEach(e.children(),function(e){n(e,1)}),t}(e),i=r.max(r.values(n))-1,s=2*i+1;e.graph().nestingRoot=t,r.forEach(e.edges(),function(t){e.edge(t).minlen*=s});var l=function(e){return r.reduce(e.edges(),function(t,n){return t+e.edge(n).weight},0)}(e)+1;r.forEach(e.children(),function(r){a(e,t,s,l,i,n,r)}),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}}},8209(e,t,n){"use strict";var r=n(6857),o=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),function(t){!function(e,t){var n,r,a,i=t.v,s=e.node(i).rank,l=t.w,c=e.node(l).rank,u=t.name,d=e.edge(t),f=d.labelRank;if(c!==s+1){for(e.removeEdge(t),a=0,++s;s<c;++a,++s)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},n=o.addDummyNode(e,"edge",r,"_d"),s===f&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(i,n,{weight:d.weight},u),0===a&&e.graph().dummyChains.push(n),i=n;e.setEdge(i,l,{weight:d.weight},u)}}(e,t)})},undo:function(e){r.forEach(e.graph().dummyChains,function(t){var n,r=e.node(t),o=r.edgeLabel;for(e.setEdge(r.edgeObj,o);r.dummy;)n=e.successors(t)[0],e.removeNode(t),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),t=n,r=e.node(t)})}}},4384(e,t,n){var r=n(6857);e.exports=function(e,t,n){var o,a={};r.forEach(n,function(n){for(var r,i,s=e.parent(n);s;){if((r=e.parent(s))?(i=a[r],a[r]=s):(i=o,o=s),i&&i!==s)return void t.setEdge(i,s);s=r}})}},3860(e,t,n){var r=n(6857);e.exports=function(e,t){return r.map(t,function(t){var n=e.inEdges(t);if(n.length){var o=r.reduce(n,function(t,n){var r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}return{v:t}})}},7860(e,t,n){var r=n(6857),o=n(8191).Graph;e.exports=function(e,t,n){var a=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),i=new o({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(function(t){return e.node(t)});return r.forEach(e.nodes(),function(o){var s=e.node(o),l=e.parent(o);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(i.setNode(o),i.setParent(o,l||a),r.forEach(e[n](o),function(t){var n=t.v===o?t.w:t.v,a=i.edge(n,o),s=r.isUndefined(a)?0:a.weight;i.setEdge(n,o,{weight:e.edge(t).weight+s})}),r.has(s,"minRank")&&i.setNode(o,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),i}},6639(e,t,n){"use strict";var r=n(6857);function o(e,t,n){for(var o=r.zipObject(n,r.map(n,function(e,t){return t})),a=r.flatten(r.map(t,function(t){return r.sortBy(r.map(e.outEdges(t),function(t){return{pos:o[t.w],weight:e.edge(t).weight}}),"pos")}),!0),i=1;i<n.length;)i<<=1;var s=2*i-1;i-=1;var l=r.map(new Array(s),function(){return 0}),c=0;return r.forEach(a.forEach(function(e){var t=e.pos+i;l[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;c+=e.weight*n})),c}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=o(e,t[r-1],t[r]);return n}},1453(e,t,n){"use strict";var r=n(6857),o=n(8918),a=n(6639),i=n(4520),s=n(7860),l=n(4384),c=n(8191).Graph,u=n(3988);function d(e,t,n){return r.map(t,function(t){return s(e,t,n)})}function f(e,t){var n=new c;r.forEach(e,function(e){var o=e.graph().root,a=i(e,o,n,t);r.forEach(a.vs,function(t,n){e.node(t).order=n}),l(e,n,a.vs)})}function p(e,t){r.forEach(t,function(t){r.forEach(t,function(t,n){e.node(t).order=n})})}e.exports=function(e){var t=u.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),i=d(e,r.range(t-1,-1,-1),"outEdges"),s=o(e);p(e,s);for(var l,c=Number.POSITIVE_INFINITY,m=0,h=0;h<4;++m,++h){f(m%2?n:i,m%4>=2),s=u.buildLayerMatrix(e);var g=a(e,s);g<c&&(h=0,l=r.cloneDeep(s),c=g)}p(e,l)}},8918(e,t,n){"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),function(t){return!e.children(t).length}),o=r.max(r.map(n,function(t){return e.node(t).rank})),a=r.map(r.range(o+1),function(){return[]}),i=r.sortBy(n,function(t){return e.node(t).rank});return r.forEach(i,function n(o){if(!r.has(t,o)){t[o]=!0;var i=e.node(o);a[i.rank].push(o),r.forEach(e.successors(o),n)}}),a}},4959(e,t,n){"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,function(e,t){var o=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(o.barycenter=e.barycenter,o.weight=e.weight)}),r.forEach(t.edges(),function(e){var t=n[e.v],o=n[e.w];r.isUndefined(t)||r.isUndefined(o)||(o.indegree++,t.out.push(n[e.w]))}),function(e){var t=[];function n(e){return function(t){var n,o,a,i;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(o=t,a=0,i=0,(n=e).weight&&(a+=n.barycenter*n.weight,i+=n.weight),o.weight&&(a+=o.barycenter*o.weight,i+=o.weight),n.vs=o.vs.concat(n.vs),n.barycenter=a/i,n.weight=i,n.i=Math.min(o.i,n.i),o.merged=!0)}}function o(t){return function(n){n.in.push(t),0===--n.indegree&&e.push(n)}}for(;e.length;){var a=e.pop();t.push(a),r.forEach(a.in.reverse(),n(a)),r.forEach(a.out,o(a))}return r.map(r.filter(t,function(e){return!e.merged}),function(e){return r.pick(e,["vs","i","barycenter","weight"])})}(r.filter(n,function(e){return!e.indegree}))}},4520(e,t,n){var r=n(6857),o=n(3860),a=n(4959),i=n(5169);e.exports=function e(t,n,s,l){var c=t.children(n),u=t.node(n),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(c=r.filter(c,function(e){return e!==d&&e!==f}));var m=o(t,c);r.forEach(m,function(n){if(t.children(n.v).length){var o=e(t,n.v,s,l);p[n.v]=o,r.has(o,"barycenter")&&(a=n,i=o,r.isUndefined(a.barycenter)?(a.barycenter=i.barycenter,a.weight=i.weight):(a.barycenter=(a.barycenter*a.weight+i.barycenter*i.weight)/(a.weight+i.weight),a.weight+=i.weight))}var a,i});var h=a(m,s);!function(e,t){r.forEach(e,function(e){e.vs=r.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}(h,p);var g=i(h,l);if(d&&(g.vs=r.flatten([d,g.vs,f],!0),t.predecessors(d).length)){var w=t.node(t.predecessors(d)[0]),y=t.node(t.predecessors(f)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+w.order+y.order)/(g.weight+2),g.weight+=2}return g}},5169(e,t,n){var r=n(6857),o=n(3988);function a(e,t,n){for(var o;t.length&&(o=r.last(t)).i<=n;)t.pop(),e.push(o.vs),n++;return n}e.exports=function(e,t){var n,i=o.partition(e,function(e){return r.has(e,"barycenter")}),s=i.lhs,l=r.sortBy(i.rhs,function(e){return-e.i}),c=[],u=0,d=0,f=0;s.sort((n=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i})),f=a(c,l,f),r.forEach(s,function(e){f+=e.vs.length,c.push(e.vs),u+=e.barycenter*e.weight,d+=e.weight,f=a(c,l,f)});var p={vs:r.flatten(c,!0)};return d&&(p.barycenter=u/d,p.weight=d),p}},2948(e,t,n){var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),function o(a){var i=n;r.forEach(e.children(a),o),t[a]={low:i,lim:n++}}),t}(e);r.forEach(e.graph().dummyChains,function(n){for(var r=e.node(n),o=r.edgeObj,a=function(e,t,n,r){var o,a,i=[],s=[],l=Math.min(t[n].low,t[r].low),c=Math.max(t[n].lim,t[r].lim);o=n;do{o=e.parent(o),i.push(o)}while(o&&(t[o].low>l||c>t[o].lim));for(a=o,o=r;(o=e.parent(o))!==a;)s.push(o);return{path:i.concat(s.reverse()),lca:a}}(e,t,o.v,o.w),i=a.path,s=a.lca,l=0,c=i[l],u=!0;n!==o.w;){if(r=e.node(n),u){for(;(c=i[l])!==s&&e.node(c).maxRank<r.rank;)l++;c===s&&(u=!1)}if(!u){for(;l<i.length-1&&e.node(c=i[l+1]).minRank<=r.rank;)l++;c=i[l]}e.setParent(n,c),n=e.successors(n)[0]}})}},9741(e,t,n){"use strict";var r=n(6857),o=n(8191).Graph,a=n(3988);function i(e,t){var n={};return r.reduce(t,function(t,o){var a=0,i=0,s=t.length,c=r.last(o);return r.forEach(o,function(t,u){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),function(t){return e.node(t).dummy})}(e,t),f=d?e.node(d).order:s;(d||t===c)&&(r.forEach(o.slice(i,u+1),function(t){r.forEach(e.predecessors(t),function(r){var o=e.node(r),i=o.order;!(i<a||f<i)||o.dummy&&e.node(t).dummy||l(n,r,t)})}),i=u+1,a=f)}),o}),n}function s(e,t){var n={};function o(t,o,a,i,s){var c;r.forEach(r.range(o,a),function(o){c=t[o],e.node(c).dummy&&r.forEach(e.predecessors(c),function(t){var r=e.node(t);r.dummy&&(r.order<i||r.order>s)&&l(n,t,c)})})}return r.reduce(t,function(t,n){var a,i=-1,s=0;return r.forEach(n,function(r,l){if("border"===e.node(r).dummy){var c=e.predecessors(r);c.length&&(a=e.node(c[0]).order,o(n,s,l,i,a),s=l,i=a)}o(n,s,n.length,a,t.length)}),n}),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var o=e[t];o||(e[t]=o={}),o[n]=!0}function c(e,t,n){if(t>n){var o=t;t=n,n=o}return r.has(e[t],n)}function u(e,t,n,o){var a={},i={},s={};return r.forEach(t,function(e){r.forEach(e,function(e,t){a[e]=e,i[e]=e,s[e]=t})}),r.forEach(t,function(e){var t=-1;r.forEach(e,function(e){var l=o(e);if(l.length){l=r.sortBy(l,function(e){return s[e]});for(var u=(l.length-1)/2,d=Math.floor(u),f=Math.ceil(u);d<=f;++d){var p=l[d];i[e]===e&&t<s[p]&&!c(n,e,p)&&(i[p]=e,i[e]=a[e]=a[p],t=s[p])}}})}),{root:a,align:i}}function d(e,t,n,a,i){var s={},l=function(e,t,n,a){var i=new o,s=e.graph(),l=function(e,t,n){return function(o,a,i){var s,l=o.node(a),c=o.node(i),u=0;if(u+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2}if(s&&(u+=n?s:-s),s=0,u+=(l.dummy?t:e)/2,u+=(c.dummy?t:e)/2,u+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(u+=n?s:-s),s=0,u}}(s.nodesep,s.edgesep,a);return r.forEach(t,function(t){var o;r.forEach(t,function(t){var r=n[t];if(i.setNode(r),o){var a=n[o],s=i.edge(a,r);i.setEdge(a,r,Math.max(l(e,t,o),s||0))}o=t})}),i}(e,t,n,i),c=i?"borderLeft":"borderRight";function u(e,t){for(var n=l.nodes(),r=n.pop(),o={};r;)o[r]?e(r):(o[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return u(function(e){s[e]=l.inEdges(e).reduce(function(e,t){return Math.max(e,s[t.v]+l.edge(t))},0)},l.predecessors.bind(l)),u(function(t){var n=l.outEdges(t).reduce(function(e,t){return Math.min(e,s[t.w]-l.edge(t))},Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[t]=Math.max(s[t],n))},l.successors.bind(l)),r.forEach(a,function(e){s[e]=s[n[e]]}),s}function f(e,t){return r.minBy(r.values(t),function(t){var n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return r.forIn(t,function(t,r){var a=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+a,n),o=Math.min(t-a,o)}),n-o})}function p(e,t){var n=r.values(t),o=r.min(n),a=r.max(n);r.forEach(["u","d"],function(n){r.forEach(["l","r"],function(i){var s,l=n+i,c=e[l];if(c!==t){var u=r.values(c);(s="l"===i?o-r.min(u):a-r.max(u))&&(e[l]=r.mapValues(c,function(e){return e+s}))}})})}function m(e,t){return r.mapValues(e.ul,function(n,o){if(t)return e[t.toLowerCase()][o];var a=r.sortBy(r.map(e,o));return(a[1]+a[2])/2})}e.exports={positionX:function(e){var t,n=a.buildLayerMatrix(e),o=r.merge(i(e,n),s(e,n)),l={};r.forEach(["u","d"],function(a){t="u"===a?n:r.values(n).reverse(),r.forEach(["l","r"],function(n){"r"===n&&(t=r.map(t,function(e){return r.values(e).reverse()}));var i=("u"===a?e.predecessors:e.successors).bind(e),s=u(0,t,o,i),c=d(e,t,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,function(e){return-e})),l[a+n]=c})});var c=f(e,l);return p(l,c),m(l,e.graph().align)},findType1Conflicts:i,findType2Conflicts:s,addConflict:l,hasConflict:c,verticalAlignment:u,horizontalCompaction:d,alignCoordinates:p,findSmallestWidthAlignment:f,balance:m}},3776(e,t,n){"use strict";var r=n(6857),o=n(3988),a=n(9741).positionX;e.exports=function(e){(function(e){var t=o.buildLayerMatrix(e),n=e.graph().ranksep,a=0;r.forEach(t,function(t){var o=r.max(r.map(t,function(t){return e.node(t).height}));r.forEach(t,function(t){e.node(t).y=a+o/2}),a+=o+n})})(e=o.asNonCompoundGraph(e)),r.forEach(a(e),function(t,n){e.node(n).x=t})}},8481(e,t,n){"use strict";var r=n(6857),o=n(8191).Graph,a=n(8073).slack;function i(e,t){return r.forEach(e.nodes(),function n(o){r.forEach(t.nodeEdges(o),function(r){var i=r.v,s=o===i?r.w:i;e.hasNode(s)||a(t,r)||(e.setNode(s,{}),e.setEdge(o,s,{}),n(s))})}),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return a(t,n)})}function l(e,t,n){r.forEach(e.nodes(),function(e){t.node(e).rank+=n})}e.exports=function(e){var t,n,r=new o({directed:!1}),c=e.nodes()[0],u=e.nodeCount();for(r.setNode(c,{});i(r,e)<u;)t=s(r,e),n=r.hasNode(t.v)?a(e,t):-a(e,t),l(r,e,n);return r}},9361(e,t,n){"use strict";var r=n(8073).longestPath,o=n(8481),a=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){a(e)}(e);break;case"tight-tree":!function(e){r(e),o(e)}(e);break;case"longest-path":i(e)}};var i=r},6860(e,t,n){"use strict";var r=n(6857),o=n(8481),a=n(8073).slack,i=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,c=n(3988).simplify;function u(e){e=c(e),i(e);var t,n=o(e);for(p(n),d(n,e);t=h(n);)w(n,e,t,g(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=f(e,t,n)}(e,t,n)})}function f(e,t,n){var o=e.node(n).parent,a=!0,i=t.edge(n,o),s=0;return i||(a=!1,i=t.edge(o,n)),s=i.weight,r.forEach(t.nodeEdges(n),function(r){var i,l,c=r.v===n,u=c?r.w:r.v;if(u!==o){var d=c===a,f=t.edge(r).weight;if(s+=d?f:-f,i=n,l=u,e.hasEdge(i,l)){var p=e.edge(n,u).cutvalue;s+=d?-p:p}}}),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),m(e,{},1,t)}function m(e,t,n,o,a){var i=n,s=e.node(o);return t[o]=!0,r.forEach(e.neighbors(o),function(a){r.has(t,a)||(n=m(e,t,n,a,o))}),s.low=i,s.lim=n++,a?s.parent=a:delete s.parent,n}function h(e){return r.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function g(e,t,n){var o=n.v,i=n.w;t.hasEdge(o,i)||(o=n.w,i=n.v);var s=e.node(o),l=e.node(i),c=s,u=!1;s.lim>l.lim&&(c=l,u=!0);var d=r.filter(t.edges(),function(t){return u===y(0,e.node(t.v),c)&&u!==y(0,e.node(t.w),c)});return r.minBy(d,function(e){return a(t,e)})}function w(e,t,n,o){var a=n.v,i=n.w;e.removeEdge(a,i),e.setEdge(o.v,o.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),function(e){return!t.node(e).parent}),o=s(e,n);o=o.slice(1),r.forEach(o,function(n){var r=e.node(n).parent,o=t.edge(n,r),a=!1;o||(o=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?o.minlen:-o.minlen)})}(e,t)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=u,u.initLowLimValues=p,u.initCutValues=d,u.calcCutValue=f,u.leaveEdge=h,u.enterEdge=g,u.exchangeEdges=w},8073(e,t,n){"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),function n(o){var a=e.node(o);if(r.has(t,o))return a.rank;t[o]=!0;var i=r.min(r.map(e.outEdges(o),function(t){return n(t.w)-e.edge(t).minlen}));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),a.rank=i})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988(e,t,n){"use strict";var r=n(6857),o=n(8191).Graph;function a(e,t,n,o){var a;do{a=r.uniqueId(o)}while(e.hasNode(a));return n.dummy=t,e.setNode(a,n),a}function i(e){return r.max(r.map(e.nodes(),function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n}))}e.exports={addDummyNode:a,simplify:function(e){var t=(new o).setGraph(e.graph());return r.forEach(e.nodes(),function(n){t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t},asNonCompoundGraph:function(e){var t=new o({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t},successorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.outEdges(t),function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.inEdges(t),function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,o=e.x,a=e.y,i=t.x-o,s=t.y-a,l=e.width/2,c=e.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(i)*c?(s<0&&(c=-c),n=c*i/s,r=c):(i<0&&(l=-l),n=l,r=l*s/i),{x:o+n,y:a+r}},buildLayerMatrix:function(e){var t=r.map(r.range(i(e)+1),function(){return[]});return r.forEach(e.nodes(),function(n){var o=e.node(n),a=o.rank;r.isUndefined(a)||(t[a][o.order]=n)}),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank}));r.forEach(e.nodes(),function(n){var o=e.node(n);r.has(o,"rank")&&(o.rank-=t)})},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank})),n=[];r.forEach(e.nodes(),function(r){var o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)});var o=0,a=e.graph().nodeRankFactor;r.forEach(n,function(t,n){r.isUndefined(t)&&n%a!==0?--o:o&&r.forEach(t,function(t){e.node(t).rank+=o})})},addBorderNode:function(e,t,n,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),a(e,"border",o,t)},maxRank:i,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038(e){e.exports="0.8.5"},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},1141(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 a=n(5413),i=n(6957);o(n(6957),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=s),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:s,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new i.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?a.ElementType.Tag:void 0,r=new i.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===a.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new i.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===a.ElementType.Comment)this.lastNode.data+=e;else{var t=new i.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new i.Text(""),t=new i.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 i.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=l,t.default=l},6957(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 __)}),a=this&&this.__assign||function(){return a=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},a.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 i=n(5413),s=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),N(this,e)},e}();t.Node=s;var l=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}(s);t.DataNode=l;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Text,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(l);t.Text=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Comment,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(l);t.Comment=u;var d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=i.ElementType.Directive,r}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(l);t.ProcessingInstruction=d;var f=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}(s);t.NodeWithChildren=f;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(f);t.CDATA=p;var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(f);t.Document=m;var h=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?i.ElementType.Script:"style"===t?i.ElementType.Style:i.ElementType.Tag);var a=e.call(this,r)||this;return a.name=t,a.attribs=n,a.type=o,a}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}(f);function g(e){return(0,i.isTag)(e)}function w(e){return e.type===i.ElementType.CDATA}function y(e){return e.type===i.ElementType.Text}function b(e){return e.type===i.ElementType.Comment}function v(e){return e.type===i.ElementType.Directive}function x(e){return e.type===i.ElementType.Root}function N(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?I(e.children):[],o=new h(e.name,a({},e.attribs),r);r.forEach(function(e){return e.parent=o}),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=a({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=a({},e["x-attribsPrefix"])),n=o}else if(w(e)){r=t?I(e.children):[];var i=new p(r);r.forEach(function(e){return e.parent=i}),n=i}else if(x(e)){r=t?I(e.children):[];var s=new m(r);r.forEach(function(e){return e.parent=s}),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else{if(!v(e))throw new Error("Not implemented yet: ".concat(e.type));var l=new d(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function I(e){for(var t=e.map(function(e){return N(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=h,t.isTag=g,t.isCDATA=w,t.isText=y,t.isComment=b,t.isDirective=v,t.isDocument=x,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=N},8362(e,t,n){var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619(e,t,n){var r=n(117);e.exports=function(e){var t,n={},o=[];function a(o){r.has(n,o)||(n[o]=!0,t.push(o),r.each(e.successors(o),a),r.each(e.predecessors(o),a))}return r.each(e.nodes(),function(e){t=[],a(e),t.length&&o.push(t)}),o}},9276(e,t,n){var r=n(117);function o(e,t,n,a,i,s){r.has(a,t)||(a[t]=!0,n||s.push(t),r.each(i(t),function(t){o(e,t,n,a,i,s)}),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var a=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],s={};return r.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);o(e,t,"post"===n,s,a,i)}),i}},4919(e,t,n){var r=n(8905),o=n(117);e.exports=function(e,t,n){return o.transform(e.nodes(),function(o,a){o[a]=r(e,a,t,n)},{})}},8905(e,t,n){var r=n(117),o=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var a,i,s={},l=new o,c=function(e){var t=e.v!==a?e.v:e.w,r=s[t],o=n(e),c=i.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<r.distance&&(r.distance=c,r.predecessor=a,l.decrease(t,c))};for(e.nodes().forEach(function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},l.add(e,n)});l.size()>0&&(a=l.removeMin(),(i=s[a]).distance!==Number.POSITIVE_INFINITY);)r(a).forEach(c);return s}(e,String(t),n||a,r||function(t){return e.outEdges(t)})};var a=r.constant(1)},6678(e,t,n){var r=n(117),o=n(6291);e.exports=function(e){return r.filter(o(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},3590(e,t,n){var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},o=e.nodes();return o.forEach(function(e){r[e]={},r[e][e]={distance:0},o.forEach(function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})}),n(e).forEach(function(n){var o=n.v===e?n.w:n.v,a=t(n);r[e][o]={distance:a,predecessor:e}})}),o.forEach(function(e){var t=r[e];o.forEach(function(n){var a=r[n];o.forEach(function(n){var r=a[e],o=t[n],i=a[n],s=r.distance+o.distance;s<i.distance&&(i.distance=s,i.predecessor=o.predecessor)})})}),r}(e,t||o,n||function(t){return e.outEdges(t)})};var o=r.constant(1)},1667(e,t,n){e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(7507)}},498(e,t,n){var r=n(7507);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045(e,t,n){var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016(e,t,n){var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423(e,t,n){var r=n(117),o=n(6454),a=n(1737);e.exports=function(e,t){var n,i=new o,s={},l=new a;function c(e){var r=e.v===n?e.w:e.v,o=l.priority(r);if(void 0!==o){var a=t(e);a<o&&(s[r]=n,l.decrease(r,a))}}if(0===e.nodeCount())return i;r.each(e.nodes(),function(e){l.add(e,Number.POSITIVE_INFINITY),i.setNode(e)}),l.decrease(e.nodes()[0],0);for(var u=!1;l.size()>0;){if(n=l.removeMin(),r.has(s,n))i.setEdge(n,s[n]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(n).forEach(c)}return i}},6291(e,t,n){var r=n(117);e.exports=function(e){var t=0,n=[],o={},a=[];function i(s){var l=o[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(e){r.has(o,e)?o[e].onStack&&(l.lowlink=Math.min(l.lowlink,o[e].index)):(i(e),l.lowlink=Math.min(l.lowlink,o[e].lowlink))}),l.lowlink===l.index){var c,u=[];do{c=n.pop(),o[c].onStack=!1,u.push(c)}while(s!==c);a.push(u)}}return e.nodes().forEach(function(e){r.has(o,e)||i(e)}),a}},7507(e,t,n){var r=n(117);function o(e){var t={},n={},o=[];if(r.each(e.sinks(),function i(s){if(r.has(n,s))throw new a;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),i),delete n[s],o.push(s))}),r.size(t)!==e.nodeCount())throw new a;return o}function a(){}e.exports=o,o.CycleException=a,a.prototype=new Error},1737(e,t,n){var r=n(117);function o(){this._arr=[],this._keyIndices={}}e.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map(function(e){return e.key})},o.prototype.has=function(e){return r.has(this._keyIndices,e)},o.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var o=this._arr,a=o.length;return n[e]=a,o.push({key:e,priority:t}),this._decrease(a),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},o.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},o.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))},o.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},o.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,o=n[e],a=n[t];n[e]=a,n[t]=o,r[a.key]=e,r[o.key]=t}},6454(e,t,n){"use strict";var r=n(117);e.exports=a;var o="\0";function a(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function i(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function l(e,t,n,o){var a=""+t,i=""+n;if(!e&&a>i){var s=a;a=i,i=s}return a+""+i+""+(r.isUndefined(o)?"\0":o)}function c(e,t){return l(e,t.v,t.w,t.name)}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(e){return this._label=e,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return r.keys(this._nodes)},a.prototype.sources=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._in[t])})},a.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._out[t])})},a.prototype.setNodes=function(e,t){var n=arguments,o=this;return r.each(e,function(e){n.length>1?o.setNode(e,t):o.setNode(e)}),this},a.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},a.prototype.node=function(e){return this._nodes[e]},a.prototype.hasNode=function(e){return r.has(this._nodes,e)},a.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},a.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},a.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},a.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},a.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},a.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},a.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},a.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},a.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},a.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),r.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var o={};function a(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(o[e]=r,r):r in o?o[r]:a(r)}return this._isCompound&&r.each(t.nodes(),function(e){t.setParent(e,a(e))}),t},a.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return r.values(this._edgeObjs)},a.prototype.setPath=function(e,t){var n=this,o=arguments;return r.reduce(e,function(e,r){return o.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r}),this},a.prototype.setEdge=function(){var e,t,n,o,a=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(o=arguments[1],a=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var c=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,c))return a&&(this._edgeLabels[c]=o),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=a?o:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var o=""+t,a=""+n;if(!e&&o>a){var i=o;o=a,a=i}var s={v:o,w:a};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[c]=u,i(this._preds[t],e),i(this._sucs[e],t),this._in[t][c]=u,this._out[e][c]=u,this._edgeCount++,this},a.prototype.edge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},a.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,o)},a.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),o=this._edgeObjs[r];return o&&(e=o.v,t=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},a.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=r.values(n);return t?r.filter(o,function(e){return e.v===t}):o}},a.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=r.values(n);return t?r.filter(o,function(e){return e.w===t}):o}},a.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166(e,t,n){e.exports={Graph:n(6454),version:n(4458)}},7494(e,t,n){var r=n(117),o=n(6454);function a(e){return r.map(e.nodes(),function(t){var n=e.node(t),o=e.parent(t),a={v:t};return r.isUndefined(n)||(a.value=n),r.isUndefined(o)||(a.parent=o),a})}function i(e){return r.map(e.edges(),function(t){var n=e.edge(t),o={v:t.v,w:t.w};return r.isUndefined(t.name)||(o.name=t.name),r.isUndefined(n)||(o.value=n),o})}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:a(e),edges:i(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new o(e.options).setGraph(e.value);return r.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),r.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}},117(e,t,n){var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458(e){e.exports="2.1.8"},4499(e,t,n){"use strict";n.r(t),n.d(t,{createBrowserHistory:()=>x,createHashHistory:()=>S,createLocation:()=>p,createMemoryHistory:()=>j,createPath:()=>f,locationsAreEqual:()=>m,parsePath:()=>d});var r=n(8168),o=n(4307),a=n(8783),i=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function l(e){return"/"===e.charAt(0)?e.substr(1):e}function c(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function u(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function d(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}function f(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function p(e,t,n,a){var i;"string"==typeof e?(i=d(e)).state=t:(void 0===(i=(0,r.A)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),a?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,o.A)(i.pathname,a.pathname)):i.pathname=a.pathname:i.pathname||(i.pathname="/"),i}function m(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&(0,a.A)(e.state,t.state)}function h(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach(function(e){return e.apply(void 0,n)})}}}var g=!("undefined"==typeof window||!window.document||!window.document.createElement);function w(e,t){t(window.confirm(e))}var y="popstate",b="hashchange";function v(){try{return window.history.state||{}}catch(e){return{}}}function x(e){void 0===e&&(e={}),g||(0,i.A)(!1);var t,n=window.history,o=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),l=e,d=l.forceRefresh,m=void 0!==d&&d,x=l.getUserConfirmation,N=void 0===x?w:x,I=l.keyLength,M=void 0===I?6:I,E=e.basename?u(s(e.basename)):"";function _(e){var t=e||{},n=t.key,r=t.state,o=window.location,a=o.pathname+o.search+o.hash;return E&&(a=c(a,E)),p(a,r,n)}function S(){return Math.random().toString(36).substr(2,M)}var D=h();function j(e){(0,r.A)(F,e),F.length=n.length,D.notifyListeners(F.location,F.action)}function k(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||T(_(e.state))}function C(){T(_(v()))}var A=!1;function T(e){A?(A=!1,j()):D.confirmTransitionTo(e,"POP",N,function(t){t?j({action:"POP",location:e}):function(e){var t=F.location,n=O.indexOf(t.key);-1===n&&(n=0);var r=O.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(A=!0,P(o))}(e)})}var L=_(v()),O=[L.key];function z(e){return E+f(e)}function P(e){n.go(e)}var R=0;function U(e){1===(R+=e)&&1===e?(window.addEventListener(y,k),a&&window.addEventListener(b,C)):0===R&&(window.removeEventListener(y,k),a&&window.removeEventListener(b,C))}var B=!1,F={length:n.length,action:"POP",location:L,createHref:z,push:function(e,t){var r="PUSH",a=p(e,t,S(),F.location);D.confirmTransitionTo(a,r,N,function(e){if(e){var t=z(a),i=a.key,s=a.state;if(o)if(n.pushState({key:i,state:s},null,t),m)window.location.href=t;else{var l=O.indexOf(F.location.key),c=O.slice(0,l+1);c.push(a.key),O=c,j({action:r,location:a})}else window.location.href=t}})},replace:function(e,t){var r="REPLACE",a=p(e,t,S(),F.location);D.confirmTransitionTo(a,r,N,function(e){if(e){var t=z(a),i=a.key,s=a.state;if(o)if(n.replaceState({key:i,state:s},null,t),m)window.location.replace(t);else{var l=O.indexOf(F.location.key);-1!==l&&(O[l]=a.key),j({action:r,location:a})}else window.location.replace(t)}})},go:P,goBack:function(){P(-1)},goForward:function(){P(1)},block:function(e){void 0===e&&(e=!1);var t=D.setPrompt(e);return B||(U(1),B=!0),function(){return B&&(B=!1,U(-1)),t()}},listen:function(e){var t=D.appendListener(e);return U(1),function(){U(-1),t()}}};return F}var N="hashchange",I={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+l(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:l,decodePath:s},slash:{encodePath:s,decodePath:s}};function M(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function E(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function _(e){window.location.replace(M(window.location.href)+"#"+e)}function S(e){void 0===e&&(e={}),g||(0,i.A)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),o=n.getUserConfirmation,a=void 0===o?w:o,l=n.hashType,d=void 0===l?"slash":l,m=e.basename?u(s(e.basename)):"",y=I[d],b=y.encodePath,v=y.decodePath;function x(){var e=v(E());return m&&(e=c(e,m)),p(e)}var S=h();function D(e){(0,r.A)(B,e),B.length=t.length,S.notifyListeners(B.location,B.action)}var j=!1,k=null;function C(){var e,t,n=E(),r=b(n);if(n!==r)_(r);else{var o=x(),i=B.location;if(!j&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(k===f(o))return;k=null,function(e){if(j)j=!1,D();else{S.confirmTransitionTo(e,"POP",a,function(t){t?D({action:"POP",location:e}):function(e){var t=B.location,n=O.lastIndexOf(f(t));-1===n&&(n=0);var r=O.lastIndexOf(f(e));-1===r&&(r=0);var o=n-r;o&&(j=!0,z(o))}(e)})}}(o)}}var A=E(),T=b(A);A!==T&&_(T);var L=x(),O=[f(L)];function z(e){t.go(e)}var P=0;function R(e){1===(P+=e)&&1===e?window.addEventListener(N,C):0===P&&window.removeEventListener(N,C)}var U=!1,B={length:t.length,action:"POP",location:L,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=M(window.location.href)),n+"#"+b(m+f(e))},push:function(e,t){var n="PUSH",r=p(e,void 0,void 0,B.location);S.confirmTransitionTo(r,n,a,function(e){if(e){var t=f(r),o=b(m+t);if(E()!==o){k=t,function(e){window.location.hash=e}(o);var a=O.lastIndexOf(f(B.location)),i=O.slice(0,a+1);i.push(t),O=i,D({action:n,location:r})}else D()}})},replace:function(e,t){var n="REPLACE",r=p(e,void 0,void 0,B.location);S.confirmTransitionTo(r,n,a,function(e){if(e){var t=f(r),o=b(m+t);E()!==o&&(k=t,_(o));var a=O.indexOf(f(B.location));-1!==a&&(O[a]=t),D({action:n,location:r})}})},go:z,goBack:function(){z(-1)},goForward:function(){z(1)},block:function(e){void 0===e&&(e=!1);var t=S.setPrompt(e);return U||(R(1),U=!0),function(){return U&&(U=!1,R(-1)),t()}},listen:function(e){var t=S.appendListener(e);return R(1),function(){R(-1),t()}}};return B}function D(e,t,n){return Math.min(Math.max(e,t),n)}function j(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,o=t.initialEntries,a=void 0===o?["/"]:o,i=t.initialIndex,s=void 0===i?0:i,l=t.keyLength,c=void 0===l?6:l,u=h();function d(e){(0,r.A)(v,e),v.length=v.entries.length,u.notifyListeners(v.location,v.action)}function m(){return Math.random().toString(36).substr(2,c)}var g=D(s,0,a.length-1),w=a.map(function(e){return p(e,void 0,"string"==typeof e?m():e.key||m())}),y=f;function b(e){var t=D(v.index+e,0,v.entries.length-1),r=v.entries[t];u.confirmTransitionTo(r,"POP",n,function(e){e?d({action:"POP",location:r,index:t}):d()})}var v={length:w.length,action:"POP",location:w[g],index:g,entries:w,createHref:y,push:function(e,t){var r="PUSH",o=p(e,t,m(),v.location);u.confirmTransitionTo(o,r,n,function(e){if(e){var t=v.index+1,n=v.entries.slice(0);n.length>t?n.splice(t,n.length-t,o):n.push(o),d({action:r,location:o,index:t,entries:n})}})},replace:function(e,t){var r="REPLACE",o=p(e,t,m(),v.location);u.confirmTransitionTo(o,r,n,function(e){e&&(v.entries[v.index]=o,d({action:r,location:o}))})},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=v.index+e;return t>=0&&t<v.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return v}},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},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=p(n);o&&o!==m&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),h=l(n),g=0;g<i.length;++g){var w=i[g];if(!(a[w]||r&&r[w]||h&&h[w]||s&&s[w])){var y=f(n,w);try{c(t,w,y)}catch(e){}}}}return t}},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,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,w=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,v=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case s:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case l:return e;default:return t}}case o:return t}}}function N(e){return x(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=a,t.Lazy=g,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return N(e)||x(e)===u},t.isConcurrentMode=N,t.isContextConsumer=function(e){return x(e)===c},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===f},t.isFragment=function(e){return x(e)===a},t.isLazy=function(e){return x(e)===g},t.isMemo=function(e){return x(e)===h},t.isPortal=function(e){return x(e)===o},t.isProfiler=function(e){return x(e)===s},t.isStrictMode=function(e){return x(e)===i},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===s||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===v||e.$$typeof===w)},t.typeOf=x},3404(e,t,n){"use strict";e.exports=n(3072)},5270(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=t.CARRIAGE_RETURN_PLACEHOLDER=t.CARRIAGE_RETURN_REGEX=t.CARRIAGE_RETURN=t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,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"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{}),t.CARRIAGE_RETURN="\r",t.CARRIAGE_RETURN_REGEX=new RegExp(t.CARRIAGE_RETURN,"g"),t.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(),"__"),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(t.CARRIAGE_RETURN_PLACEHOLDER,"g")},5496(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n,u,d,f,m;e=(0,r.escapeSpecialCharacters)(e);var g=s.exec(e),w=null===(t=null==g?void 0:g[1])||void 0===t?void 0:t.toLowerCase();switch(w){case o:var y=c(e);return(0,r.hasOpenTag)(e,a)||null===(n=null==(v=y.querySelector(a))?void 0:v.parentNode)||void 0===n||n.removeChild(v),(0,r.hasOpenTag)(e,i)||null===(u=null==(v=y.querySelector(i))?void 0:v.parentNode)||void 0===u||u.removeChild(v),y.querySelectorAll(o);case a:case i:var b=l(e).querySelectorAll(w);return(0,r.hasOpenTag)(e,i)&&(0,r.hasOpenTag)(e,a)?null!==(f=null===(d=b[0].parentNode)||void 0===d?void 0:d.childNodes)&&void 0!==f?f:h():b;default:return p?p(e):null!==(m=null==(v=l(e,i).querySelector(i))?void 0:v.childNodes)&&void 0!==m?m:h();var v}};var r=n(7731),o="html",a="head",i="body",s=/<([a-zA-Z]+[0-9]?)/,l=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var d=new u;l=c=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),d.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var f=document.implementation.createHTMLDocument();l=function(e,t){if(t){var n=f.documentElement.querySelector(t);return n&&(n.innerHTML=e),f}return f.documentElement.innerHTML=e,f}}var p,m="object"==typeof document&&document.createElement("template");m&&m.content&&(p=function(e){return m.innerHTML=e,m.content.childNodes});var h=function(){return document.createDocumentFragment().childNodes}},2471(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.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t=i.exec(e),n=t?t[1]:void 0;return(0,a.formatDOM)((0,o.default)(e),null,n)};var o=r(n(5496)),a=n(7731),i=/<(![a-zA-Z\s]+)>/},7731(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatAttributes=a,t.hasOpenTag=function(e,t){var n="<"+t,r=e.toLowerCase().indexOf(n);if(-1===r)return!1;var o=e[r+n.length];return">"===o||" "===o||"\t"===o||"\n"===o||"\r"===o||"/"===o},t.escapeSpecialCharacters=function(e){return e.replace(o.CARRIAGE_RETURN_REGEX,o.CARRIAGE_RETURN_PLACEHOLDER)},t.revertEscapedCharacters=s,t.formatDOM=function e(t,n,o){var l,c,u,d;void 0===n&&(n=null);for(var f,p=[],m=0,h=t.length;m<h;m++){var g=t[m];switch(g.nodeType){case 1:var w=i(g.nodeName);(f=new r.Element(w,a(g.attributes))).children=e("template"===w?g.content.childNodes:g.childNodes,f);break;case 3:f=new r.Text(s(null!==(l=g.nodeValue)&&void 0!==l?l:""));break;case 8:f=new r.Comment(null!==(c=g.nodeValue)&&void 0!==c?c:"");break;default:continue}var y=null!==(u=p[m-1])&&void 0!==u?u:null;y&&(y.next=f),f.parent=n,f.prev=y,f.next=null,p.push(f)}return o&&((f=new r.ProcessingInstruction(o.substring(0,o.indexOf(" ")).toLowerCase(),o)).next=null!==(d=p[0])&&void 0!==d?d:null,f.parent=n,p.unshift(f),p[1]&&(p[1].prev=p[0])),p};var r=n(1141),o=n(5270);function a(e){for(var t={},n=0,r=e.length;n<r;n++){var o=e[n];t[o.name]=o.value}return t}function i(e){return function(e){return o.CASE_SENSITIVE_TAG_NAMES_MAP[e]}(e=e.toLowerCase())||e}function s(e){return e.replace(o.CARRIAGE_RETURN_PLACEHOLDER_REGEX,o.CARRIAGE_RETURN)}},840(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&s[e.type]);for(var u in e){var d=e[u];if((0,r.isCustomAttribute)(u))n[u]=d;else{var f=u.toLowerCase(),p=l(f);if(p){var m=(0,r.getPropertyInfo)(p);switch(a.includes(p)&&i.includes(t)&&!c&&(p=l("default"+f)),n[p]=d,null==m?void 0:m.type){case r.BOOLEAN:n[p]=!0;break;case r.OVERLOADED_BOOLEAN:""===d&&(n[p]=!0)}}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,o.setStyleProp)(e.style,n),n};var r=n(4210),o=n(4958),a=["checked","value"],i=["input","select","textarea"],s={reset:!0,submit:!0};function l(e){return r.possibleStandardNames[e]}},308(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.default=function e(t,n){var r,o,c,u,d;void 0===n&&(n={});for(var f=[],p="function"==typeof n.replace,m=null!==(r=n.transform)&&void 0!==r?r:i.returnFirstArg,h=null!==(o=n.library)&&void 0!==o?o:s,g=h.cloneElement,w=h.createElement,y=h.isValidElement,b=t.length,v=0;v<b;v++){var x=t[v];if(p){var N=null===(c=n.replace)||void 0===c?void 0:c.call(n,x,v);if(y(N)){b>1&&(N=g(N,{key:null!==(u=N.key)&&void 0!==u?u:v})),f.push(m(N,x,v));continue}}if("text"!==x.type){var I=x,M={};l(I)?((0,i.setStyleProp)(I.attribs.style,I.attribs),M=I.attribs):I.attribs&&(M=(0,a.default)(I.attribs,I.name));var E=void 0;switch(x.type){case"script":case"style":x.children[0]&&(M.dangerouslySetInnerHTML={__html:x.children[0].data});break;case"tag":"textarea"===x.name&&x.children[0]?M.defaultValue=x.children[0].data:(null===(d=x.children)||void 0===d?void 0:d.length)&&(E=e(x.children,n));break;default:continue}b>1&&(M.key=v),f.push(m(w(x.name,M,E),x,v))}else{var _=!x.data.trim().length;if(_&&x.parent&&!(0,i.canTextBeChildOfNode)(x.parent))continue;if(n.trim&&_)continue;f.push(m(x.data,x,v))}}return 1===f.length?f[0]:f};var o=n(1609),a=r(n(840)),i=n(4958),s={cloneElement:o.cloneElement,createElement:o.createElement,isValidElement:o.isValidElement};function l(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,i.isCustomComponent)(e.name,e.attribs)}},442(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.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){var n;if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,i.default)((0,o.default)(e,null!==(n=null==t?void 0:t.htmlparser2)&&void 0!==n?n:l),t):[]};var o=r(n(2471));t.htmlToDOM=o.default;var a=r(n(840));t.attributesToProps=a.default;var i=r(n(308));t.domToReact=i.default;var s=n(1141);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return s.Text}});var l={lowerCaseAttributeNames:!1}},4958(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.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){return e.includes("-")?!i.has(e):Boolean(t&&"string"==typeof t.is)},t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,a.default)(e,s)}catch(e){t.style={}}else t.style={}};var o=n(1609),a=r(n(5229)),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),s={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(o.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)},t.returnFirstArg=function(e){return e}},5077(e){"use strict";var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function m(){var e={line:d,column:f};return function(t){return t.position=new h(e),y(),t}}function h(e){this.start=e,this.end={line:d,column:f},this.source=l.source}function g(t){var n=new Error(l.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=f,n.source=e,!l.silent)throw n}function w(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function y(){w(r)}function b(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=m();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 g("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function x(){var e=m(),n=w(o);if(n){if(v(),!w(a))return g("property missing ':'");var r=w(i),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return w(s),l}}return h.prototype.content=e,y(),function(){var e,t=[];for(b(t);e=x();)!1!==e&&(t.push(e),b(t));return t}()}},5580(e,t,n){var r=n(6110)(n(9325),"DataView");e.exports=r},1549(e,t,n){var r=n(2032),o=n(3862),a=n(6721),i=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=i,l.prototype.set=s,e.exports=l},79(e,t,n){var r=n(3702),o=n(80),a=n(4739),i=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=i,l.prototype.set=s,e.exports=l},8223(e,t,n){var r=n(6110)(n(9325),"Map");e.exports=r},3661(e,t,n){var r=n(3040),o=n(7670),a=n(289),i=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=i,l.prototype.set=s,e.exports=l},2804(e,t,n){var r=n(6110)(n(9325),"Promise");e.exports=r},6545(e,t,n){var r=n(6110)(n(9325),"Set");e.exports=r},8859(e,t,n){var r=n(3661),o=n(1380),a=n(1459);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},7217(e,t,n){var r=n(79),o=n(1420),a=n(938),i=n(3605),s=n(9817),l=n(945);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=s,c.prototype.set=l,e.exports=c},1873(e,t,n){var r=n(9325).Symbol;e.exports=r},7828(e,t,n){var r=n(9325).Uint8Array;e.exports=r},8303(e,t,n){var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},9770(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},5325(e,t,n){var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},695(e,t,n){var r=n(8096),o=n(2428),a=n(6449),i=n(3656),s=n(361),l=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),u=!n&&o(e),d=!n&&!u&&i(e),f=!n&&!u&&!d&&l(e),p=n||u||d||f,m=p?r(e.length,String):[],h=m.length;for(var g in e)!t&&!c.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,h))||m.push(g);return m}},4932(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},4528(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},882(e){e.exports=function(e,t,n,r){var o=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++o]);++o<a;)n=t(n,e[o],o,e);return n}},4248(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},9811(e,t,n){var r=n(7237)("length");e.exports=r},7805(e,t,n){var r=n(3360),o=n(5288);e.exports=function(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547(e,t,n){var r=n(3360),o=n(5288),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var i=e[t];a.call(e,t)&&o(i,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025(e,t,n){var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733(e,t,n){var r=n(1791),o=n(5950);e.exports=function(e,t){return e&&r(t,o(t),e)}},3838(e,t,n){var r=n(1791),o=n(7241);e.exports=function(e,t){return e&&r(t,o(t),e)}},3360(e,t,n){var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999(e,t,n){var r=n(7217),o=n(3729),a=n(6547),i=n(4733),s=n(3838),l=n(3290),c=n(3007),u=n(2271),d=n(8948),f=n(2),p=n(3349),m=n(5861),h=n(6189),g=n(7199),w=n(5529),y=n(6449),b=n(3656),v=n(7730),x=n(3805),N=n(8440),I=n(5950),M=n(7241),E="[object Arguments]",_="[object Function]",S="[object Object]",D={};D[E]=D["[object Array]"]=D["[object ArrayBuffer]"]=D["[object DataView]"]=D["[object Boolean]"]=D["[object Date]"]=D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Map]"]=D["[object Number]"]=D[S]=D["[object RegExp]"]=D["[object Set]"]=D["[object String]"]=D["[object Symbol]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D["[object Error]"]=D[_]=D["[object WeakMap]"]=!1,e.exports=function e(t,n,j,k,C,A){var T,L=1&n,O=2&n,z=4&n;if(j&&(T=C?j(t,k,C,A):j(t)),void 0!==T)return T;if(!x(t))return t;var P=y(t);if(P){if(T=h(t),!L)return c(t,T)}else{var R=m(t),U=R==_||"[object GeneratorFunction]"==R;if(b(t))return l(t,L);if(R==S||R==E||U&&!C){if(T=O||U?{}:w(t),!L)return O?d(t,s(T,t)):u(t,i(T,t))}else{if(!D[R])return C?t:{};T=g(t,R,L)}}A||(A=new r);var B=A.get(t);if(B)return B;A.set(t,T),N(t)?t.forEach(function(r){T.add(e(r,n,j,r,t,A))}):v(t)&&t.forEach(function(r,o){T.set(o,e(r,n,j,o,t,A))});var F=P?void 0:(z?O?p:f:O?M:I)(t);return o(F||t,function(r,o){F&&(r=t[o=r]),a(T,o,e(r,n,j,o,t,A))}),T}},9344(e,t,n){var r=n(3805),o=Object.create,a=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=a},909(e,t,n){var r=n(641),o=n(8329)(r);e.exports=o},3599(e,t,n){var r=n(4394);e.exports=function(e,t,n){for(var o=-1,a=e.length;++o<a;){var i=e[o],s=t(i);if(null!=s&&(void 0===l?s==s&&!r(s):n(s,l)))var l=s,c=i}return c}},6574(e,t,n){var r=n(909);e.exports=function(e,t){var n=[];return r(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}},2523(e){e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1}},3120(e,t,n){var r=n(4528),o=n(5891);e.exports=function e(t,n,a,i,s){var l=-1,c=t.length;for(a||(a=o),s||(s=[]);++l<c;){var u=t[l];n>0&&a(u)?n>1?e(u,n-1,a,i,s):r(s,u):i||(s[s.length]=u)}return s}},6649(e,t,n){var r=n(3221)();e.exports=r},641(e,t,n){var r=n(6649),o=n(5950);e.exports=function(e,t){return e&&r(e,t,o)}},7422(e,t,n){var r=n(1769),o=n(7797);e.exports=function(e,t){for(var n=0,a=(t=r(t,e)).length;null!=e&&n<a;)e=e[o(t[n++])];return n&&n==a?e:void 0}},2199(e,t,n){var r=n(4528),o=n(6449);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},2552(e,t,n){var r=n(1873),o=n(659),a=n(9350),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},3335(e){e.exports=function(e,t){return e>t}},426(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},6131(e,t,n){var r=n(2523),o=n(5463),a=n(6959);e.exports=function(e,t,n){return t==t?a(e,t,n):r(e,o,n)}},7534(e,t,n){var r=n(2552),o=n(346);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},270(e,t,n){var r=n(7068),o=n(346);e.exports=function e(t,n,a,i,s){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,a,i,e,s))}},7068(e,t,n){var r=n(7217),o=n(5911),a=n(1986),i=n(689),s=n(5861),l=n(6449),c=n(3656),u=n(7167),d="[object Arguments]",f="[object Array]",p="[object Object]",m=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,h,g,w){var y=l(e),b=l(t),v=y?f:s(e),x=b?f:s(t),N=(v=v==d?p:v)==p,I=(x=x==d?p:x)==p,M=v==x;if(M&&c(e)){if(!c(t))return!1;y=!0,N=!1}if(M&&!N)return w||(w=new r),y||u(e)?o(e,t,n,h,g,w):a(e,t,v,n,h,g,w);if(!(1&n)){var E=N&&m.call(e,"__wrapped__"),_=I&&m.call(t,"__wrapped__");if(E||_){var S=E?e.value():e,D=_?t.value():t;return w||(w=new r),g(S,D,n,h,w)}}return!!M&&(w||(w=new r),i(e,t,n,h,g,w))}},9172(e,t,n){var r=n(5861),o=n(346);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},1799(e,t,n){var r=n(7217),o=n(270);e.exports=function(e,t,n,a){var i=n.length,s=i,l=!a;if(null==e)return!s;for(e=Object(e);i--;){var c=n[i];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<s;){var u=(c=n[i])[0],d=e[u],f=c[1];if(l&&c[2]){if(void 0===d&&!(u in e))return!1}else{var p=new r;if(a)var m=a(d,f,u,e,t,p);if(!(void 0===m?o(f,d,3,a,p):m))return!1}}return!0}},5463(e){e.exports=function(e){return e!=e}},5083(e,t,n){var r=n(1882),o=n(7296),a=n(3805),i=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,f=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?f:s).test(i(e))}},6038(e,t,n){var r=n(5861),o=n(346);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},4901(e,t,n){var r=n(2552),o=n(294),a=n(346),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},5389(e,t,n){var r=n(3663),o=n(7978),a=n(3488),i=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):s(e)}},8984(e,t,n){var r=n(5527),o=n(3650),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903(e,t,n){var r=n(3805),o=n(5527),a=n(181),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return a(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&i.call(e,s))&&n.push(s);return n}},6176(e){e.exports=function(e,t){return e<t}},5128(e,t,n){var r=n(909),o=n(4894);e.exports=function(e,t){var n=-1,a=o(e)?Array(e.length):[];return r(e,function(e,r,o){a[++n]=t(e,r,o)}),a}},3663(e,t,n){var r=n(1799),o=n(776),a=n(7197);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978(e,t,n){var r=n(270),o=n(8156),a=n(631),i=n(8586),s=n(756),l=n(7197),c=n(7797);e.exports=function(e,t){return i(e)&&s(t)?l(c(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},5250(e,t,n){var r=n(7217),o=n(7805),a=n(6649),i=n(2824),s=n(3805),l=n(7241),c=n(4974);e.exports=function e(t,n,u,d,f){t!==n&&a(n,function(a,l){if(f||(f=new r),s(a))i(t,n,l,u,e,d,f);else{var p=d?d(c(t,l),a,l+"",t,n,f):void 0;void 0===p&&(p=a),o(t,l,p)}},l)}},2824(e,t,n){var r=n(7805),o=n(3290),a=n(1961),i=n(3007),s=n(5529),l=n(2428),c=n(6449),u=n(3693),d=n(3656),f=n(1882),p=n(3805),m=n(1331),h=n(7167),g=n(4974),w=n(9884);e.exports=function(e,t,n,y,b,v,x){var N=g(e,n),I=g(t,n),M=x.get(I);if(M)r(e,n,M);else{var E=v?v(N,I,n+"",e,t,x):void 0,_=void 0===E;if(_){var S=c(I),D=!S&&d(I),j=!S&&!D&&h(I);E=I,S||D||j?c(N)?E=N:u(N)?E=i(N):D?(_=!1,E=o(I,!0)):j?(_=!1,E=a(I,!0)):E=[]:m(I)||l(I)?(E=N,l(N)?E=w(N):p(N)&&!f(N)||(E=s(I))):_=!1}_&&(x.set(I,E),b(E,I,y,v,x),x.delete(I)),r(e,n,E)}}},6155(e,t,n){var r=n(4932),o=n(7422),a=n(5389),i=n(5128),s=n(3937),l=n(7301),c=n(3714),u=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,function(e){return d(e)?function(t){return o(t,1===e.length?e[0]:e)}:e}):[u];var f=-1;t=r(t,l(a));var p=i(e,function(e,n,o){return{criteria:r(t,function(t){return t(e)}),index:++f,value:e}});return s(p,function(e,t){return c(e,t,n)})}},6001(e,t,n){var r=n(7420),o=n(631);e.exports=function(e,t){return r(e,t,function(t,n){return o(e,n)})}},7420(e,t,n){var r=n(7422),o=n(3170),a=n(1769);e.exports=function(e,t,n){for(var i=-1,s=t.length,l={};++i<s;){var c=t[i],u=r(e,c);n(u,c)&&o(l,a(c,e),u)}return l}},7237(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255(e,t,n){var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,o,a){for(var i=-1,s=n(t((r-e)/(o||1)),0),l=Array(s);s--;)l[a?s:++i]=e,e+=o;return l}},5558(e){e.exports=function(e,t,n,r,o){return o(e,function(e,o,a){n=r?(r=!1,e):t(n,e,o,a)}),n}},9302(e,t,n){var r=n(3488),o=n(6757),a=n(2865);e.exports=function(e,t){return a(o(e,t,r),e+"")}},3170(e,t,n){var r=n(6547),o=n(1769),a=n(361),i=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!i(e))return e;for(var c=-1,u=(t=o(t,e)).length,d=u-1,f=e;null!=f&&++c<u;){var p=s(t[c]),m=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=d){var h=f[p];void 0===(m=l?l(h,p,f):void 0)&&(m=i(h)?h:a(t[c+1])?[]:{})}r(f,p,m),f=f[p]}return e}},9570(e,t,n){var r=n(7334),o=n(3243),a=n(3488),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=i},3937(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},7556(e,t,n){var r=n(1873),o=n(4932),a=n(6449),i=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128(e,t,n){var r=n(1800),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},7301(e){e.exports=function(e){return function(t){return e(t)}}},5765(e,t,n){var r=n(8859),o=n(5325),a=n(9905),i=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var c=-1,u=o,d=e.length,f=!0,p=[],m=p;if(n)f=!1,u=a;else if(d>=200){var h=t?null:s(e);if(h)return l(h);f=!1,u=i,m=new r}else m=t?[]:p;e:for(;++c<d;){var g=e[c],w=t?t(g):g;if(g=n||0!==g?g:0,f&&w==w){for(var y=m.length;y--;)if(m[y]===w)continue e;t&&m.push(w),p.push(g)}else u(m,w,n)||(m!==p&&m.push(w),p.push(g))}return p}},514(e,t,n){var r=n(4932);e.exports=function(e,t){return r(t,function(t){return e[t]})}},1234(e){e.exports=function(e,t,n){for(var r=-1,o=e.length,a=t.length,i={};++r<o;){var s=r<a?t[r]:void 0;n(i,e[r],s)}return i}},9219(e){e.exports=function(e,t){return e.has(t)}},4066(e,t,n){var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769(e,t,n){var r=n(6449),o=n(8586),a=n(1802),i=n(3222);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},9653(e,t,n){var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290(e,t,n){e=n.nmd(e);var r=n(9325),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o?r.Buffer:void 0,s=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169(e,t,n){var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201(e){var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736(e,t,n){var r=n(1873),o=r?r.prototype:void 0,a=o?o.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},1961(e,t,n){var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730(e,t,n){var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,a=e==e,i=r(e),s=void 0!==t,l=null===t,c=t==t,u=r(t);if(!l&&!u&&!i&&e>t||i&&s&&c&&!l&&!u||o&&s&&c||!n&&c||!a)return 1;if(!o&&!i&&!u&&e<t||u&&n&&a&&!o&&!i||l&&n&&a||!s&&a||!c)return-1}return 0}},3714(e,t,n){var r=n(3730);e.exports=function(e,t,n){for(var o=-1,a=e.criteria,i=t.criteria,s=a.length,l=n.length;++o<s;){var c=r(a[o],i[o]);if(c)return o>=l?c:c*("desc"==n[o]?-1:1)}return e.index-t.index}},3007(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},1791(e,t,n){var r=n(6547),o=n(3360);e.exports=function(e,t,n,a){var i=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=a?a(n[c],e[c],c,n,e):void 0;void 0===u&&(u=e[c]),i?o(n,c,u):r(n,c,u)}return n}},2271(e,t,n){var r=n(1791),o=n(4664);e.exports=function(e,t){return r(e,o(e),t)}},8948(e,t,n){var r=n(1791),o=n(6375);e.exports=function(e,t){return r(e,o(e),t)}},5481(e,t,n){var r=n(9325)["__core-js_shared__"];e.exports=r},999(e,t,n){var r=n(9302),o=n(6800);e.exports=function(e){return r(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(a--,i):void 0,s&&o(n[0],n[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++r<a;){var l=n[r];l&&e(t,l,r,i)}return t})}},8329(e,t,n){var r=n(4894);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,s=Object(n);(t?i--:++i<a)&&!1!==o(s[i],i,s););return n}}},3221(e){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),s=i.length;s--;){var l=i[e?s:++o];if(!1===n(a[l],l,a))break}return t}}},2006(e,t,n){var r=n(5389),o=n(4894),a=n(5950);e.exports=function(e){return function(t,n,i){var s=Object(t);if(!o(t)){var l=r(n,3);t=a(t),n=function(e){return l(s[e],e,s)}}var c=e(t,n,i);return c>-1?s[l?t[c]:c]:void 0}}},5508(e,t,n){var r=n(6151),o=n(6800),a=n(7400);e.exports=function(e){return function(t,n,i){return i&&"number"!=typeof i&&o(t,n,i)&&(n=i=void 0),t=a(t),void 0===n?(n=t,t=0):n=a(n),i=void 0===i?t<n?1:-1:a(i),r(t,n,i,e)}}},4517(e,t,n){var r=n(6545),o=n(3950),a=n(4247),i=r&&1/a(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=i},3243(e,t,n){var r=n(6110),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},5911(e,t,n){var r=n(8859),o=n(4248),a=n(9219);e.exports=function(e,t,n,i,s,l){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var m=-1,h=!0,g=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++m<u;){var w=e[m],y=t[m];if(i)var b=c?i(y,w,m,t,e,l):i(w,y,m,e,t,l);if(void 0!==b){if(b)continue;h=!1;break}if(g){if(!o(t,function(e,t){if(!a(g,t)&&(w===e||s(w,e,n,i,l)))return g.push(t)})){h=!1;break}}else if(w!==y&&!s(w,y,n,i,l)){h=!1;break}}return l.delete(e),l.delete(t),h}},1986(e,t,n){var r=n(1873),o=n(7828),a=n(5288),i=n(5911),s=n(317),l=n(4247),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var m=1&r;if(p||(p=l),e.size!=t.size&&!m)return!1;var h=f.get(e);if(h)return h==t;r|=2,f.set(e,t);var g=i(p(e),p(t),r,c,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},689(e,t,n){var r=n(2),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,s){var l=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!l)return!1;for(var d=u;d--;){var f=c[d];if(!(l?f in t:o.call(t,f)))return!1}var p=s.get(e),m=s.get(t);if(p&&m)return p==t&&m==e;var h=!0;s.set(e,t),s.set(t,e);for(var g=l;++d<u;){var w=e[f=c[d]],y=t[f];if(a)var b=l?a(y,w,f,t,e,s):a(w,y,f,e,t,s);if(!(void 0===b?w===y||i(w,y,n,a,s):b)){h=!1;break}g||(g="constructor"==f)}if(h&&!g){var v=e.constructor,x=t.constructor;v==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof x&&x instanceof x||(h=!1)}return s.delete(e),s.delete(t),h}},8816(e,t,n){var r=n(5970),o=n(6757),a=n(2865);e.exports=function(e){return a(o(e,void 0,r),e+"")}},4840(e){var t="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;e.exports=t},2(e,t,n){var r=n(2199),o=n(4664),a=n(5950);e.exports=function(e){return r(e,a,o)}},3349(e,t,n){var r=n(2199),o=n(6375),a=n(7241);e.exports=function(e){return r(e,a,o)}},2651(e,t,n){var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776(e,t,n){var r=n(756),o=n(5950);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},6110(e,t,n){var r=n(5083),o=n(392);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},8879(e,t,n){var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659(e,t,n){var r=n(1873),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[s]=n:delete e[s]),o}},4664(e,t,n){var r=n(9770),o=n(3345),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(e){return null==e?[]:(e=Object(e),r(i(e),function(t){return a.call(e,t)}))}:o;e.exports=s},6375(e,t,n){var r=n(4528),o=n(8879),a=n(4664),i=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,a(e)),e=o(e);return t}:i;e.exports=s},5861(e,t,n){var r=n(5580),o=n(8223),a=n(2804),i=n(6545),s=n(8303),l=n(2552),c=n(7473),u="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",m="[object DataView]",h=c(r),g=c(o),w=c(a),y=c(i),b=c(s),v=l;(r&&v(new r(new ArrayBuffer(1)))!=m||o&&v(new o)!=u||a&&v(a.resolve())!=d||i&&v(new i)!=f||s&&v(new s)!=p)&&(v=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case h:return m;case g:return u;case w:return d;case y:return f;case b:return p}return t}),e.exports=v},392(e){e.exports=function(e,t){return null==e?void 0:e[t]}},9326(e,t,n){var r=n(1769),o=n(2428),a=n(6449),i=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var c=-1,u=(t=r(t,e)).length,d=!1;++c<u;){var f=l(t[c]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&s(u)&&i(f,u)&&(a(e)||o(e))}},9698(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032(e,t,n){var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721(e,t,n){var r=n(1042),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},2749(e,t,n){var r=n(1042),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},5749(e,t,n){var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199(e,t,n){var r=n(9653),o=n(6169),a=n(3201),i=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return a(e);case"[object Symbol]":return i(e)}}},5529(e,t,n){var r=n(9344),o=n(8879),a=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:r(o(e))}},5891(e,t,n){var r=n(1873),o=n(2428),a=n(6449),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},361(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},6800(e,t,n){var r=n(5288),o=n(4894),a=n(361),i=n(3805);e.exports=function(e,t,n){if(!i(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&a(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586(e,t,n){var r=n(6449),o=n(4394),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},4218(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296(e,t,n){var r,o=n(5481),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},5527(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756(e,t,n){var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702(e){e.exports=function(){this.__data__=[],this.size=0}},80(e,t,n){var r=n(6025),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},4739(e,t,n){var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655(e,t,n){var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175(e,t,n){var r=n(6025);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},3040(e,t,n){var r=n(1549),o=n(79),a=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},7670(e,t,n){var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949(e,t,n){var r=n(2651);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},317(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},7197(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224(e,t,n){var r=n(104);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},1042(e,t,n){var r=n(6110)(Object,"create");e.exports=r},3650(e,t,n){var r=n(4335)(Object.keys,Object);e.exports=r},181(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009(e,t,n){e=n.nmd(e);var r=n(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,s=function(){try{return a&&a.require&&a.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(n){return e(t(n))}}},6757(e,t,n){var r=n(1033),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,i=-1,s=o(a.length-t,0),l=Array(s);++i<s;)l[i]=a[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=a[i];return c[t]=n(l),r(e,this,c)}}},9325(e,t,n){var r=n(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},4974(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459(e){e.exports=function(e){return this.__data__.has(e)}},4247(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},2865(e,t,n){var r=n(9570),o=n(1811)(r);e.exports=o},1811(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),a=16-(o-r);if(r=o,a>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,n){var r=n(79),o=n(8223),a=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},6959(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},1993(e,t,n){var r=n(9811),o=n(9698),a=n(7927);e.exports=function(e){return o(e)?a(e):r(e)}},1802(e,t,n){var r=n(2224),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)}),t});e.exports=i},7797(e,t,n){var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927(e){var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",a="[^"+t+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+o+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[a,i,s].join("|")+")"+c+l+")*",d="(?:"+[a+r+"?",r,i,s,n].join("|")+")",f=RegExp(o+"(?="+o+")|"+d+u,"g");e.exports=function(e){for(var t=f.lastIndex=0;f.test(e);)++t;return t}},2629(e,t,n){var r=n(9999);e.exports=function(e){return r(e,4)}},8055(e,t,n){var r=n(9999);e.exports=function(e){return r(e,5)}},7334(e){e.exports=function(e){return function(){return e}}},4684(e,t,n){var r=n(9302),o=n(5288),a=n(6800),i=n(7241),s=Object.prototype,l=s.hasOwnProperty,c=r(function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&a(t[0],t[1],c)&&(r=1);++n<r;)for(var u=t[n],d=i(u),f=-1,p=d.length;++f<p;){var m=d[f],h=e[m];(void 0===h||o(h,s[m])&&!l.call(e,m))&&(e[m]=u[m])}return e});e.exports=c},6135(e,t,n){e.exports=n(7373)},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612(e,t,n){var r=n(9770),o=n(6574),a=n(5389),i=n(6449);e.exports=function(e,t){return(i(e)?r:o)(e,a(t,3))}},7309(e,t,n){var r=n(2006)(n(4713));e.exports=r},4713(e,t,n){var r=n(2523),o=n(5389),a=n(1489),i=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:a(n);return l<0&&(l=i(s+l,0)),r(e,o(t,3),l)}},5970(e,t,n){var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},7373(e,t,n){var r=n(3729),o=n(909),a=n(4066),i=n(6449);e.exports=function(e,t){return(i(e)?r:o)(e,a(t))}},2420(e,t,n){var r=n(6649),o=n(4066),a=n(7241);e.exports=function(e,t){return null==e?e:r(e,o(t),a)}},8156(e,t,n){var r=n(7422);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},1448(e,t,n){var r=n(426),o=n(9326);e.exports=function(e,t){return null!=e&&o(e,t,r)}},631(e,t,n){var r=n(8077),o=n(9326);e.exports=function(e,t){return null!=e&&o(e,t,r)}},3488(e){e.exports=function(e){return e}},2428(e,t,n){var r=n(7534),o=n(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,n){var r=n(1882),o=n(294);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},3693(e,t,n){var r=n(4894),o=n(346);e.exports=function(e){return o(e)&&r(e)}},3656(e,t,n){e=n.nmd(e);var r=n(9325),o=n(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},2193(e,t,n){var r=n(8984),o=n(5861),a=n(2428),i=n(6449),s=n(4894),l=n(3656),c=n(5527),u=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||a(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882(e,t,n){var r=n(2552),o=n(3805);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,n){var r=n(9172),o=n(7301),a=n(6009),i=a&&a.isMap,s=i?o(i):r;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1331(e,t,n){var r=n(2552),o=n(8879),a=n(346),i=Function.prototype,s=Object.prototype,l=i.toString,c=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},8440(e,t,n){var r=n(6038),o=n(7301),a=n(6009),i=a&&a.isSet,s=i?o(i):r;e.exports=s},5015(e,t,n){var r=n(2552),o=n(6449),a=n(346);e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&"[object String]"==r(e)}},4394(e,t,n){var r=n(2552),o=n(346);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7167(e,t,n){var r=n(4901),o=n(7301),a=n(6009),i=a&&a.isTypedArray,s=i?o(i):r;e.exports=s},2216(e){e.exports=function(e){return void 0===e}},5950(e,t,n){var r=n(695),o=n(8984),a=n(4894);e.exports=function(e){return a(e)?r(e):o(e)}},7241(e,t,n){var r=n(695),o=n(2903),a=n(4894);e.exports=function(e){return a(e)?r(e,!0):o(e)}},8090(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378(e,t,n){var r=n(4932),o=n(5389),a=n(5128),i=n(6449);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},3916(e,t,n){var r=n(3360),o=n(641),a=n(5389);e.exports=function(e,t){var n={};return t=a(t,3),o(e,function(e,o,a){r(n,o,t(e,o,a))}),n}},4506(e,t,n){var r=n(3599),o=n(3335),a=n(3488);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},104(e,t,n){var r=n(3661);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},5364(e,t,n){var r=n(5250),o=n(999)(function(e,t,n){r(e,t,n)});e.exports=o},1684(e,t,n){var r=n(3599),o=n(6176),a=n(3488);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},6533(e,t,n){var r=n(3599),o=n(5389),a=n(6176);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),a):void 0}},3950(e){e.exports=function(){}},124(e,t,n){var r=n(9325);e.exports=function(){return r.Date.now()}},4383(e,t,n){var r=n(6001),o=n(8816)(function(e,t){return null==e?{}:r(e,t)});e.exports=o},583(e,t,n){var r=n(7237),o=n(7255),a=n(8586),i=n(7797);e.exports=function(e){return a(e)?r(i(e)):o(e)}},3181(e,t,n){var r=n(5508)();e.exports=r},860(e,t,n){var r=n(882),o=n(909),a=n(5389),i=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:i,c=arguments.length<3;return l(e,a(t,4),n,c,o)}},7091(e,t,n){var r=n(8984),o=n(5861),a=n(4894),i=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(a(e))return i(e)?s(e):e.length;var t=o(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031(e,t,n){var r=n(3120),o=n(6155),a=n(9302),i=n(6800),s=a(function(e,t){if(null==e)return[];var n=t.length;return n>1&&i(e,t[0],t[1])?t=[]:n>2&&i(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])});e.exports=s},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},7400(e,t,n){var r=n(9374),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489(e,t,n){var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374(e,t,n){var r=n(4128),o=n(3805),a=n(4394),i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}},9884(e,t,n){var r=n(1791),o=n(7241);e.exports=function(e){return r(e,o(e))}},3222(e,t,n){var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752(e,t,n){var r=n(3729),o=n(9344),a=n(641),i=n(5389),s=n(8879),l=n(6449),c=n(3656),u=n(1882),d=n(3805),f=n(7167);e.exports=function(e,t,n){var p=l(e),m=p||c(e)||f(e);if(t=i(t,4),null==n){var h=e&&e.constructor;n=m?p?new h:[]:d(e)&&u(h)?o(s(e)):{}}return(m?r:a)(e,function(e,r,o){return t(n,e,r,o)}),n}},299(e,t,n){var r=n(3120),o=n(9302),a=n(5765),i=n(3693),s=o(function(e){return a(r(e,1,i,!0))});e.exports=s},7200(e,t,n){var r=n(3222),o=0;e.exports=function(e){var t=++o;return r(e)+t}},5880(e,t,n){var r=n(514),o=n(5950);e.exports=function(e){return null==e?[]:r(e,o(e))}},7248(e,t,n){var r=n(6547),o=n(1234);e.exports=function(e,t){return o(e||[],t||[],r)}},2694(e,t,n){"use strict";var r=n(6925);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=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 s.name="Invariant Violation",s}}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:a,resetWarningCache:o};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4496(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultArea=void 0,t.defaultArea="default-area"},4601(e,t,n){"use strict";Object.defineProperty(t,"$h",{enumerable:!0,get:function(){return r.trackPromise}}),Object.defineProperty(t,"H8",{enumerable:!0,get:function(){return o.usePromiseTracker}});var r=n(2609),o=(n(4951),n(5398))},5590(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupConfig=t.defaultConfig=void 0;var r=n(4496),o={area:r.defaultArea,delay:0};t.defaultConfig=o,t.setupConfig=function(e){return{area:e&&e.area?e.area:r.defaultArea,delay:e&&e.delay?e.delay:0}}},9220(e,t){"use strict";function n(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 r(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)}}Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0;var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,o;return t=e,o=[{key:"emit",value:function(e){if(!e)return this;for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];var a,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}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 i,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw i}}}}(this._e(e));try{for(i.s();!(a=i.n()).done;){var s=a.value;s.apply(s.ctx,[].concat(r)),1==s.off_event&&this.off(e,s)}}catch(e){i.e(e)}finally{i.f()}return this}},{key:"on",value:function(e,t,n){return e?(t.ctx=n,this._e(e).push(t),this):this}},{key:"once",value:function(e,t,n){return e?(t.ctx=n,t.off_event=!0,this.on(e,t)):this}},{key:"off",value:function(e,t){if(!e)return this;if(!this[e])return this;var n=this._e(e);return t?(this[e]=n.filter(function(e){return e!=t}),this):(delete this[e],this)}},{key:"_e",value:function(e){return this[e]||(this[e]=[])}}],o&&r(t.prototype,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.Emitter=o},2609(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackPromise=t.promiseCounterUpdateEventId=t.manuallyResetPromiseCounter=t.manuallyIncrementPromiseCounter=t.manuallyDecrementPromiseCounter=t.getCounter=t.emitter=void 0;var r=n(9220),o=n(4496),a=new r.Emitter;t.emitter=a;var i="promise-counter-update";t.promiseCounterUpdateEventId=i;var s,l,c=(s={},(l=o.defaultArea)in s?Object.defineProperty(s,l,{value:0,enumerable:!0,configurable:!0,writable:!0}):s[l]=0,s);t.getCounter=function(e){return c[e]},t.trackPromise=function(e,t){t=t||o.defaultArea,u(t);var n=function(){return p(t)};return e.then(n,n),e};var u=function(e){d(e);var t=f(e);a.emit(i,t,e)},d=function(e){Boolean(c[e])?c[e]++:c[e]=1},f=function(e){return c[e]>0},p=function(e){c[e]>0&&m(e);var t=f(e);a.emit(i,t,e)},m=function(e){c[e]--};t.manuallyResetPromiseCounter=function(e){e=e||o.defaultArea,c[e]=0,a.emit(i,!1,e)},t.manuallyDecrementPromiseCounter=function(e){e=e||o.defaultArea,p(e)},t.manuallyIncrementPromiseCounter=function(e){e=e||o.defaultArea,u(e)}},4951(e,t,n){"use strict";function r(e){return r="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},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.promiseTrackerHoc=void 0;var o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}(n(1609)),a=n(2609),i=n(5590);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function l(){return l=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},l.apply(this,arguments)}function c(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 u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}t.promiseTrackerHoc=function(e){return function(t){!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&&u(e,t)}(g,t);var n,s,p,m,h=(p=g,m=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=f(p);if(m){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}(this,e)});function g(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),(t=h.call(this,e)).state={promiseInProgress:!1,internalPromiseInProgress:!1,config:(0,i.setupConfig)(e.config)},t.notifyPromiseInProgress=t.notifyPromiseInProgress.bind(d(t)),t.updateProgress=t.updateProgress.bind(d(t)),t.subscribeToCounterUpdate=t.subscribeToCounterUpdate.bind(d(t)),t}return n=g,(s=[{key:"notifyPromiseInProgress",value:function(){var e=this;0===this.state.config.delay?this.setState({promiseInProgress:!0}):setTimeout(function(){var t=Boolean((0,a.getCounter)(e.state.config.area)>0);e.setState({promiseInProgress:t})},this.state.config.delay)}},{key:"updateProgress",value:function(e,t){this.setState({internalPromiseInProgress:e},t),e?this.notifyPromiseInProgress():this.setState({promiseInProgress:!1})}},{key:"subscribeToCounterUpdate",value:function(){var e=this;a.emitter.on(a.promiseCounterUpdateEventId,function(t,n){e.state.config.area===n&&e.updateProgress(t)})}},{key:"componentDidMount",value:function(){this.updateProgress(Boolean((0,a.getCounter)(this.state.config.area)>0),this.subscribeToCounterUpdate)}},{key:"componentWillUnmount",value:function(){a.emitter.off(a.promiseCounterUpdateEventId)}},{key:"render",value:function(){return o.default.createElement(e,l({},this.props,{config:this.state.config,promiseInProgress:this.state.promiseInProgress}))}}])&&c(n.prototype,s),Object.defineProperty(n,"prototype",{writable:!1}),g}(o.Component)}},5398(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePromiseTracker=void 0;var r,o=(r=n(1609))&&r.__esModule?r:{default:r},a=n(2609),i=n(5590);function s(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,a=[],_n=!0,i=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);_n=!0);}catch(e){i=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(i)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(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}t.usePromiseTracker=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.defaultConfig,t=o.default.useRef(!1);o.default.useEffect(function(){return t.current=!0,function(){return t.current=!1}},[]);var n=s(o.default.useState((0,i.setupConfig)(e)),1)[0];o.default.useEffect(function(){t.current&&n&&n.area&&(0,a.getCounter)(n.area)>0&&(c(!0),f(!0))},[n]);var r=s(o.default.useState(!1),2),l=r[0],c=r[1],u=s(o.default.useState(!1),2),d=u[0],f=u[1],p=o.default.useRef(l),m=function(e,r){t.current&&n.area===r&&(c(e),p.current=e,e?n&&n.delay&&0!==n.delay?setTimeout(function(){t.current&&p.current&&f(!0)},n.delay):f(!0):f(!1))};return o.default.useEffect(function(){return p.current=l,a.emitter.on(a.promiseCounterUpdateEventId,m),function(){return a.emitter.off(a.promiseCounterUpdateEventId,m)}},[]),{promiseInProgress:d}}},4210(e,t,n){"use strict";function r(e,t,n,r,o,a,i){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=a,this.removeEmptyString=i}const o={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(e=>{o[e]=new r(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([e,t])=>{o[e]=new r(e,1,!1,t,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(e=>{o[e]=new r(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(e=>{o[e]=new r(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(e=>{o[e]=new r(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(e=>{o[e]=new r(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(e=>{o[e]=new r(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(e=>{o[e]=new r(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(e=>{o[e]=new r(e,5,!1,e.toLowerCase(),null,!1,!1)});const a=/[\-\:]([a-z])/g,i=e=>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(e=>{const t=e.replace(a,i);o[t]=new r(t,1,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(e=>{const t=e.replace(a,i);o[t]=new r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(e=>{const t=e.replace(a,i);o[t]=new r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!1,!1)}),o.xlinkHref=new r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(e=>{o[e]=new r(e,1,!1,e.toLowerCase(),null,!0,!0)});const{CAMELCASE:s,SAME:l,possibleStandardNames:c}=n(6811),u=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]*$")),d=Object.keys(c).reduce((e,t)=>{const n=c[t];return n===l?e[t]=t:n===s?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 o.hasOwnProperty(e)?o[e]:null},t.isCustomAttribute=u,t.possibleStandardNames=d},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}},9296(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=n(6347),a=r(n(1609)),i=n(4499);n(5556),n(7573);var s=r(n(7676));function l(){return(l=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}).apply(this,arguments)}function c(e,t){e.prototype=Object.create(t.prototype),u(e.prototype.constructor=e,t)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(o[n]=e[n]);return o}(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=i.createBrowserHistory(t.props),t}c(t,e),t.prototype.render=function(){return a.createElement(o.Router,{history:this.history,children:this.props.children})}})(a.Component),function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=i.createHashHistory(t.props),t}c(t,e),t.prototype.render=function(){return a.createElement(o.Router,{history:this.history,children:this.props.children})}}(a.Component);var f=function(e,t){return"function"==typeof e?e(t):e},p=function(e,t){return"string"==typeof e?i.createLocation(e,null,null,t):e},m=function(e){return e},h=a.forwardRef;void 0===h&&(h=m);var g=h(function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=d(e,["innerRef","navigate","onClick"]),s=i.target,c=l({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=m!==h&&t||n,a.createElement("a",c)}),w=h(function(e,t){var n=e.component,r=void 0===n?g:n,c=e.replace,u=e.to,w=e.innerRef,y=d(e,["component","replace","to","innerRef"]);return a.createElement(o.__RouterContext.Consumer,null,function(e){e||s(!1);var n=e.history,o=p(f(u,e.location),e.location),d=o?n.createHref(o):"",g=l({},y,{href:d,navigate:function(){var t=f(u,e.location),r=i.createPath(e.location)===i.createPath(p(t));(c||r?n.replace:n.push)(t)}});return m!==h?g.ref=t||w:g.innerRef=w,a.createElement(r,g)})}),y=function(e){return e},b=a.forwardRef;void 0===b&&(b=y);b(function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,i=e.activeClassName,c=void 0===i?"active":i,u=e.activeStyle,m=e.className,h=e.exact,g=e.isActive,v=e.location,x=e.sensitive,N=e.strict,I=e.style,M=e.to,E=e.innerRef,_=d(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return a.createElement(o.__RouterContext.Consumer,null,function(e){e||s(!1);var n=v||e.location,i=p(f(M,n),n),d=i.pathname,S=d&&d.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),D=S?o.matchPath(n.pathname,{path:S,exact:h,sensitive:x,strict:N}):null,j=!!(g?g(D,n):D),k="function"==typeof m?m(j):m,C="function"==typeof I?I(j):I;j&&(k=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return e}).join(" ")}(k,c),C=l({},C,u));var A=l({"aria-current":j&&r||null,className:k,style:C,to:i},_);return y!==b?A.ref=t||E:A.innerRef=E,a.createElement(w,A)})});Object.defineProperty(t,"W6",{enumerable:!0,get:function(){return o.useHistory}})},6347(e,t,n){"use strict";n.r(t),n.d(t,{MemoryRouter:()=>I,Prompt:()=>E,Redirect:()=>j,Route:()=>T,Router:()=>N,StaticRouter:()=>U,Switch:()=>B,__HistoryContext:()=>v,__RouterContext:()=>x,generatePath:()=>D,matchPath:()=>A,useHistory:()=>Z,useLocation:()=>V,useParams:()=>G,useRouteMatch:()=>W,withRouter:()=>F});var r=n(7387),o=n(1609),a=n.n(o),i=n(5556),s=n.n(i),l=n(4499),c=n(1561),u=n(8168),d=n(8505),f=n.n(d),p=(n(7564),n(8587)),m=n(4146),h=n.n(m),g=1073741823,w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},y=a().createContext||function(e,t){var n,o,i,l="__create-react-context-"+((w[i="__global_unique_id__"]=(w[i]||0)+1)+"__"),c=function(e){function n(){for(var t,n,r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return(t=e.call.apply(e,[this].concat(a))||this).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(e){r=r.filter(function(t){return t!==e})},get:function(){return n},set:function(e,t){n=e,r.forEach(function(e){return e(n,t)})}}),t}(0,r.A)(n,e);var o=n.prototype;return o.getChildContext=function(){var e;return(e={})[l]=this.emitter,e},o.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((a=r)===(i=o)?0!==a||1/a==1/i:a!=a&&i!=i)?n=0:(n="function"==typeof t?t(r,o):g,0!=(n|=0)&&this.emitter.set(e.value,n))}var a,i},o.render=function(){return this.props.children},n}(a().Component);c.childContextTypes=((n={})[l]=s().object.isRequired,n);var u=function(t){function n(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))||this).observedBits=void 0,e.state={value:e.getValue()},e.onUpdate=function(t,n){(0|e.observedBits)&n&&e.setState({value:e.getValue()})},e}(0,r.A)(n,t);var o=n.prototype;return o.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?g:t},o.componentDidMount=function(){this.context[l]&&this.context[l].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?g:e},o.componentWillUnmount=function(){this.context[l]&&this.context[l].off(this.onUpdate)},o.getValue=function(){return this.context[l]?this.context[l].get():e},o.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(a().Component);return u.contextTypes=((o={})[l]=s().object,o),{Provider:c,Consumer:u}},b=function(e){var t=y();return t.displayName=e,t},v=b("Router-History"),x=b("Router"),N=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen(function(e){n._pendingLocation=e})),n}(0,r.A)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen(function(t){e._isMounted&&e.setState({location:t})})),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return a().createElement(x.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a().createElement(v.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a().Component),I=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,l.createMemoryHistory)(t.props),t}return(0,r.A)(t,e),t.prototype.render=function(){return a().createElement(N,{history:this.history,children:this.props.children})},t}(a().Component),M=function(e){function t(){return e.apply(this,arguments)||this}(0,r.A)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(a().Component);function E(e){var t=e.message,n=e.when,r=void 0===n||n;return a().createElement(x.Consumer,null,function(e){if(e||(0,c.A)(!1),!r||e.staticContext)return null;var n=e.history.block;return a().createElement(M,{onMount:function(e){e.release=n(t)},onUpdate:function(e,r){r.message!==t&&(e.release(),e.release=n(t))},onUnmount:function(e){e.release()},message:t})})}var _={},S=0;function D(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(_[e])return _[e];var t=f().compile(e);return S<1e4&&(_[e]=t,S++),t}(e)(t,{pretty:!0})}function j(e){var t=e.computedMatch,n=e.to,r=e.push,o=void 0!==r&&r;return a().createElement(x.Consumer,null,function(e){e||(0,c.A)(!1);var r=e.history,i=e.staticContext,s=o?r.push:r.replace,d=(0,l.createLocation)(t?"string"==typeof n?D(n,t.params):(0,u.A)({},n,{pathname:D(n.pathname,t.params)}):n);return i?(s(d),null):a().createElement(M,{onMount:function(){s(d)},onUpdate:function(e,t){var n=(0,l.createLocation)(t.to);(0,l.locationsAreEqual)(n,(0,u.A)({},d,{key:n.key}))||s(d)},to:n})})}var k={},C=0;function A(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,a=void 0!==o&&o,i=n.strict,s=void 0!==i&&i,l=n.sensitive,c=void 0!==l&&l;return[].concat(r).reduce(function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=k[n]||(k[n]={});if(r[e])return r[e];var o=[],a={regexp:f()(e,o,t),keys:o};return C<1e4&&(r[e]=a,C++),a}(n,{end:a,strict:s,sensitive:c}),o=r.regexp,i=r.keys,l=o.exec(e);if(!l)return null;var u=l[0],d=l.slice(1),p=e===u;return a&&!p?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:p,params:i.reduce(function(e,t,n){return e[t.name]=d[n],e},{})}},null)}var T=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){var e=this;return a().createElement(x.Consumer,null,function(t){t||(0,c.A)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?A(n.pathname,e.props):t.match,o=(0,u.A)({},t,{location:n,match:r}),i=e.props,s=i.children,l=i.component,d=i.render;return Array.isArray(s)&&function(e){return 0===a().Children.count(e)}(s)&&(s=null),a().createElement(x.Provider,{value:o},o.match?s?"function"==typeof s?s(o):s:l?a().createElement(l,o):d?d(o):null:"function"==typeof s?s(o):null)})},t}(a().Component);function L(e){return"/"===e.charAt(0)?e:"/"+e}function O(e,t){if(!e)return t;var n=L(e);return 0!==t.pathname.indexOf(n)?t:(0,u.A)({},t,{pathname:t.pathname.substr(n.length)})}function z(e){return"string"==typeof e?e:(0,l.createPath)(e)}function P(e){return function(){(0,c.A)(!1)}}function R(){}var U=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).handlePush=function(e){return t.navigateTo(e,"PUSH")},t.handleReplace=function(e){return t.navigateTo(e,"REPLACE")},t.handleListen=function(){return R},t.handleBlock=function(){return R},t}(0,r.A)(t,e);var n=t.prototype;return n.navigateTo=function(e,t){var n=this.props,r=n.basename,o=void 0===r?"":r,a=n.context,i=void 0===a?{}:a;i.action=t,i.location=function(e,t){return e?(0,u.A)({},t,{pathname:L(e)+t.pathname}):t}(o,(0,l.createLocation)(e)),i.url=z(i.location)},n.render=function(){var e=this.props,t=e.basename,n=void 0===t?"":t,r=e.context,o=void 0===r?{}:r,i=e.location,s=void 0===i?"/":i,c=(0,p.A)(e,["basename","context","location"]),d={createHref:function(e){return L(n+z(e))},action:"POP",location:O(n,(0,l.createLocation)(s)),push:this.handlePush,replace:this.handleReplace,go:P(),goBack:P(),goForward:P(),listen:this.handleListen,block:this.handleBlock};return a().createElement(N,(0,u.A)({},c,{history:d,staticContext:o}))},t}(a().Component),B=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){var e=this;return a().createElement(x.Consumer,null,function(t){t||(0,c.A)(!1);var n,r,o=e.props.location||t.location;return a().Children.forEach(e.props.children,function(e){if(null==r&&a().isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?A(o.pathname,(0,u.A)({},e.props,{path:i})):t.match}}),r?a().cloneElement(n,{location:o,computedMatch:r}):null})},t}(a().Component);function F(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=(0,p.A)(t,["wrappedComponentRef"]);return a().createElement(x.Consumer,null,function(t){return t||(0,c.A)(!1),a().createElement(e,(0,u.A)({},r,t,{ref:n}))})};return n.displayName=t,n.WrappedComponent=e,h()(n,e)}var Y=a().useContext;function Z(){return Y(v)}function V(){return Y(x).location}function G(){var e=Y(x).match;return e?e.params:{}}function W(e){var t=V(),n=Y(x).match;return e?A(t.pathname,e):n}},9375(e){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},8505(e,t,n){var r=n(9375);e.exports=function e(t,n,o){return r(n)||(o=n||o,n=[]),o=o||{},t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return f(e,t)}(t,n):r(t)?function(t,n,r){for(var o=[],a=0;a<t.length;a++)o.push(e(t[a],n,r).source);return f(new RegExp("(?:"+o.join("|")+")",p(r)),n)}(t,n,o):function(e,t,n){return m(a(e,n),t,n)}(t,n,o)},e.exports.parse=a,e.exports.compile=function(e,t){return c(a(e,t),t)},e.exports.tokensToFunction=c,e.exports.tokensToRegExp=m;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function a(e,t){for(var n,r=[],a=0,s=0,l="",c=t&&t.delimiter||"/";null!=(n=o.exec(e));){var u=n[0],f=n[1],p=n.index;if(l+=e.slice(s,p),s=p+u.length,f)l+=f[1];else{var m=e[s],h=n[2],g=n[3],w=n[4],y=n[5],b=n[6],v=n[7];l&&(r.push(l),l="");var x=null!=h&&null!=m&&m!==h,N="+"===b||"*"===b,I="?"===b||"*"===b,M=h||c,E=w||y,_=h||("string"==typeof r[r.length-1]?r[r.length-1]:"");r.push({name:g||a++,prefix:h||"",delimiter:M,optional:I,repeat:N,partial:x,asterisk:!!v,pattern:E?d(E):v?".*":i(M,_)})}}return s<e.length&&(l+=e.substr(s)),l&&r.push(l),r}function i(e,t){return!t||t.indexOf(e)>-1?"[^"+u(e)+"]+?":u(t)+"|(?:(?!"+u(t)+")[^"+u(e)+"])+?"}function s(e){return encodeURI(e).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function l(e){return encodeURI(e).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function c(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"==typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",p(t)));return function(t,o){for(var a="",i=t||{},c=(o||{}).pretty?s:encodeURIComponent,u=0;u<e.length;u++){var d=e[u];if("string"!=typeof d){var f,p=i[d.name];if(null==p){if(d.optional){d.partial&&(a+=d.prefix);continue}throw new TypeError('Expected "'+d.name+'" to be defined')}if(r(p)){if(!d.repeat)throw new TypeError('Expected "'+d.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(d.optional)continue;throw new TypeError('Expected "'+d.name+'" to not be empty')}for(var m=0;m<p.length;m++){if(f=c(p[m]),!n[u].test(f))throw new TypeError('Expected all "'+d.name+'" to match "'+d.pattern+'", but received `'+JSON.stringify(f)+"`");a+=(0===m?d.prefix:d.delimiter)+f}}else{if(f=d.asterisk?l(p):c(p),!n[u].test(f))throw new TypeError('Expected "'+d.name+'" to match "'+d.pattern+'", but received "'+f+'"');a+=d.prefix+f}}else a+=d}return a}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function d(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function f(e,t){return e.keys=t,e}function p(e){return e&&e.sensitive?"":"i"}function m(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,a=!1!==n.end,i="",s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)i+=u(l);else{var c=u(l.prefix),d="(?:"+l.pattern+")";t.push(l),l.repeat&&(d+="(?:"+c+d+")*"),i+=d=l.optional?l.partial?c+"("+d+")?":"(?:"+c+"("+d+"))?":c+"("+d+")"}}var m=u(n.delimiter||"/"),h=i.slice(-m.length)===m;return o||(i=(h?i.slice(0,-m.length):i)+"(?:"+m+"(?=$))?"),i+=a?"$":o&&h?"":"(?="+m+"|$)",f(new RegExp("^"+i,p(n)),t)}},4912(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for;n&&Symbol.for("react.element"),n&&Symbol.for("react.portal"),n&&Symbol.for("react.fragment"),n&&Symbol.for("react.strict_mode"),n&&Symbol.for("react.profiler"),n&&Symbol.for("react.provider"),n&&Symbol.for("react.context"),n&&Symbol.for("react.async_mode"),n&&Symbol.for("react.concurrent_mode"),n&&Symbol.for("react.forward_ref"),n&&Symbol.for("react.suspense"),n&&Symbol.for("react.suspense_list"),n&&Symbol.for("react.memo"),n&&Symbol.for("react.lazy"),n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope")},7564(e,t,n){"use strict";n(4912)},5901(e,t,n){var r=n(246),o=n(1720),a=n(1609),i=n(2236);function s(e){return e&&e.__esModule?e.default:e}function l(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}function c(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function u(e){e.forEach(e=>c(e.element))}function d(e){e.forEach(e=>{!function(e,t,n){const r=e.children[n]||null;e.insertBefore(t,r)}(e.parentElement,e.element,e.oldIndex)})}function f(e,t){const n=h(e),r={parentElement:e.from};let o=[];switch(n){case"normal":o=[{element:e.item,newIndex:e.newIndex,oldIndex:e.oldIndex,parentElement:e.from}];break;case"swap":o=[{element:e.item,oldIndex:e.oldIndex,newIndex:e.newIndex,...r},{element:e.swapItem,oldIndex:e.newIndex,newIndex:e.oldIndex,...r}];break;case"multidrag":o=e.oldIndicies.map((t,n)=>({element:t.multiDragElement,oldIndex:t.index,newIndex:e.newIndicies[n].index,...r}))}const a=function(e,t){return e.map(e=>({...e,item:t[e.oldIndex]})).sort((e,t)=>e.oldIndex-t.oldIndex)}(o,t);return a}function p(e,t){const n=[...t];return e.concat().reverse().forEach(e=>n.splice(e.oldIndex,1)),n}function m(e,t,n,r){const o=[...t];return e.forEach(e=>{const t=r&&n&&r(e.item,n);o.splice(e.newIndex,0,t||e.item)}),o}function h(e){return e.oldIndicies&&e.oldIndicies.length>0?"multidrag":e.swapItem?"swap":"normal"}l(e.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),l(e.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),l(e.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),l(e.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),l(e.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),l(e.exports,"Options",()=>$882b6d93070905b3$re_export$Options),l(e.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),l(e.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),l(e.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),l(e.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),l(e.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),l(e.exports,"ReactSortable",()=>w);const g={dragging:null};class w extends a.Component{static defaultProps={clone:e=>e};constructor(e){super(e),this.ref=(0,a.createRef)();const t=[...e.list].map(e=>Object.assign(e,{chosen:!1,selected:!1}));e.setList(t,this.sortable,g),s(i)(!e.plugins,'\nPlugins prop is no longer supported.\nInstead, mount it with "Sortable.mount(new MultiDrag())"\nPlease read the updated README.md at https://github.com/SortableJS/react-sortablejs.\n ')}componentDidMount(){if(null===this.ref.current)return;const e=this.makeOptions();s(r).create(this.ref.current,e)}componentDidUpdate(e){e.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){const{tag:e,style:t,className:n,id:r}=this.props,o={style:t,className:n,id:r},i=e&&null!==e?e:"div";return(0,a.createElement)(i,{ref:this.ref,...o},this.getChildren())}getChildren(){const{children:e,dataIdAttr:t,selectedClass:n="sortable-selected",chosenClass:r="sortable-chosen",dragClass:i="sortable-drag",fallbackClass:l="sortable-falback",ghostClass:c="sortable-ghost",swapClass:u="sortable-swap-highlight",filter:d="sortable-filter",list:f}=this.props;if(!e||null==e)return null;const p=t||"data-id";return a.Children.map(e,(e,t)=>{if(void 0===e)return;const i=f[t]||{},{className:l}=e.props,c="string"==typeof d&&{[d.replace(".","")]:!!i.filtered},u=s(o)(l,{[n]:i.selected,[r]:i.chosen,...c});return(0,a.cloneElement)(e,{[p]:e.key,className:u})})}get sortable(){const e=this.ref.current;if(null===e)return null;const t=Object.keys(e).find(e=>e.includes("Sortable"));return t?e[t]:null}makeOptions(){const e=function(e){const{list:t,setList:n,children:r,tag:o,style:a,className:i,clone:s,onAdd:l,onChange:c,onChoose:u,onClone:d,onEnd:f,onFilter:p,onRemove:m,onSort:h,onStart:g,onUnchoose:w,onUpdate:y,onMove:b,onSpill:v,onSelect:x,onDeselect:N,...I}=e;return I}(this.props);return["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"].forEach(t=>e[t]=this.prepareOnHandlerPropAndDOM(t)),["onChange","onClone","onFilter","onSort"].forEach(t=>e[t]=this.prepareOnHandlerProp(t)),{...e,onMove:(e,t)=>{const{onMove:n}=this.props,r=e.willInsertAfter||-1;if(!n)return r;const o=n(e,t,this.sortable,g);return void 0!==o&&o}}}prepareOnHandlerPropAndDOM(e){return t=>{this.callOnHandlerProp(t,e),this[e](t)}}prepareOnHandlerProp(e){return t=>{this.callOnHandlerProp(t,e)}}callOnHandlerProp(e,t){const n=this.props[t];n&&n(e,this.sortable,g)}onAdd(e){const{list:t,setList:n,clone:r}=this.props,o=f(e,[...g.dragging.props.list]);u(o),n(m(o,t,e,r).map(e=>Object.assign(e,{selected:!1})),this.sortable,g)}onRemove(e){const{list:t,setList:n}=this.props,r=h(e),o=f(e,t);d(o);let a=[...t];if("clone"!==e.pullMode)a=p(o,a);else{let t=o;switch(r){case"multidrag":t=o.map((t,n)=>({...t,element:e.clones[n]}));break;case"normal":t=o.map(t=>({...t,element:e.clone}));break;default:s(i)(!0,`mode "${r}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${r}" plugin`)}u(t),o.forEach(t=>{const n=t.oldIndex,r=this.props.clone(t.item,e);a.splice(n,1,r)})}a=a.map(e=>Object.assign(e,{selected:!1})),n(a,this.sortable,g)}onUpdate(e){const{list:t,setList:n}=this.props,r=f(e,t);return u(r),d(r),n(function(e,t){return m(e,p(e,t))}(r,t),this.sortable,g)}onStart(){g.dragging=this}onEnd(){g.dragging=null}onChoose(e){const{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(t,{chosen:!0})),r}),this.sortable,g)}onUnchoose(e){const{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(r,{chosen:!1})),r}),this.sortable,g)}onSpill(e){const{removeOnSpill:t,revertOnSpill:n}=this.props;t&&!n&&c(e.item)}onSelect(e){const{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(t=>{const n=t.index;if(-1===n)return console.log(`"${e.type}" had indice of "${t.index}", which is probably -1 and doesn't usually happen here.`),void console.log(e);r[n].selected=!0}),n(r,this.sortable,g)}onDeselect(e){const{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(e=>{const t=e.index;-1!==t&&(r[t].selected=!0)}),n(r,this.sortable,g)}}var y,b;y=e.exports,b={},Object.keys(b).forEach(function(e){"default"===e||"__esModule"===e||y.hasOwnProperty(e)||Object.defineProperty(y,e,{enumerable:!0,get:function(){return b[e]}})})},1720(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];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var s in n)r.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},2236(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>r});function r(e,t){if(!e)throw new Error("Invariant failed")}},1020(e,t,n){"use strict";var r=n(1609),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},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)i.call(t,r)&&!l.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:s.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},4848(e,t,n){"use strict";e.exports=n(1020)},4307(e,t,n){"use strict";function r(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}n.d(t,{A:()=>a});const a=function(e,t){void 0===t&&(t="");var n,a=e&&e.split("/")||[],i=t&&t.split("/")||[],s=e&&r(e),l=t&&r(t),c=s||l;if(e&&r(e)?i=a:a.length&&(i.pop(),i=i.concat(a)),!i.length)return"/";if(i.length){var u=i[i.length-1];n="."===u||".."===u||""===u}else n=!1;for(var d=0,f=i.length;f>=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&r(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m}},246(e,t,n){"use strict";function r(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?r(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function a(e){return a="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},a(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return s=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},s.apply(this,arguments)}function l(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 c(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}n.r(t),n.d(t,{MultiDrag:()=>bt,Sortable:()=>Be,Swap:()=>lt,default:()=>Nt});var u=c(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),d=c(/Edge/i),f=c(/firefox/i),p=c(/safari/i)&&!c(/chrome/i)&&!c(/android/i),m=c(/iP(ad|od|hone)/i),h=c(/chrome/i)&&c(/android/i),g={capture:!1,passive:!1};function w(e,t,n){e.addEventListener(t,n,!u&&g)}function y(e,t,n){e.removeEventListener(t,n,!u&&g)}function b(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function v(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function x(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&b(e,t):b(e,t))||r&&e===n)return e;if(e===n)break}while(e=v(e))}return null}var N,I=/\s+/g;function M(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(I," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(I," ")}}function E(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function _(e,t){var n="";if("string"==typeof e)n=e;else do{var r=E(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function S(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,a=r.length;if(n)for(;o<a;o++)n(r[o],o);return r}return[]}function D(){return document.scrollingElement||document.documentElement}function j(e,t,n,r,o){if(e.getBoundingClientRect||e===window){var a,i,s,l,c,d,f;if(e!==window&&e.parentNode&&e!==D()?(i=(a=e.getBoundingClientRect()).top,s=a.left,l=a.bottom,c=a.right,d=a.height,f=a.width):(i=0,s=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!u))do{if(o&&o.getBoundingClientRect&&("none"!==E(o,"transform")||n&&"static"!==E(o,"position"))){var p=o.getBoundingClientRect();i-=p.top+parseInt(E(o,"border-top-width")),s-=p.left+parseInt(E(o,"border-left-width")),l=i+a.height,c=s+a.width;break}}while(o=o.parentNode);if(r&&e!==window){var m=_(o||e),h=m&&m.a,g=m&&m.d;m&&(l=(i/=g)+(d/=g),c=(s/=h)+(f/=h))}return{top:i,left:s,bottom:l,right:c,width:f,height:d}}}function k(e,t,n){for(var r=O(e,!0),o=j(e)[t];r;){var a=j(r)[n];if(!("top"===n||"left"===n?o>=a:o<=a))return r;if(r===D())break;r=O(r,!1)}return!1}function C(e,t,n,r){for(var o=0,a=0,i=e.children;a<i.length;){if("none"!==i[a].style.display&&i[a]!==Be.ghost&&(r||i[a]!==Be.dragged)&&x(i[a],n.draggable,e,!1)){if(o===t)return i[a];o++}a++}return null}function A(e,t){for(var n=e.lastElementChild;n&&(n===Be.ghost||"none"===E(n,"display")||t&&!b(n,t));)n=n.previousElementSibling;return n||null}function T(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Be.clone||t&&!b(e,t)||n++;return n}function L(e){var t=0,n=0,r=D();if(e)do{var o=_(e),a=o.a,i=o.d;t+=e.scrollLeft*a,n+=e.scrollTop*i}while(e!==r&&(e=e.parentNode));return[t,n]}function O(e,t){if(!e||!e.getBoundingClientRect)return D();var n=e,r=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=E(n);if(n.clientWidth<n.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!n.getBoundingClientRect||n===document.body)return D();if(r||t)return n;r=!0}}}while(n=n.parentNode);return D()}function z(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function P(e,t){return function(){if(!N){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),N=setTimeout(function(){N=void 0},t)}}}function R(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function U(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function B(e,t){E(e,"position","absolute"),E(e,"top",t.top),E(e,"left",t.left),E(e,"width",t.width),E(e,"height",t.height)}function F(e){E(e,"position",""),E(e,"top",""),E(e,"left",""),E(e,"width",""),E(e,"height","")}var Y="Sortable"+(new Date).getTime();var Z=[],V={initializeByDefault:!0},G={mount:function(e){for(var t in V)V.hasOwnProperty(t)&&!(t in e)&&(e[t]=V[t]);Z.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Z.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var a=e+"Global";Z.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][a]&&t[r.pluginName][a](o({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](o({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var o in Z.forEach(function(r){var o=r.pluginName;if(e.options[o]||r.initializeByDefault){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[o]=a,s(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(o)){var a=this.modifyOption(e,o,e.options[o]);void 0!==a&&(e.options[o]=a)}},getEventProperties:function(e,t){var n={};return Z.forEach(function(r){"function"==typeof r.eventProperties&&s(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return Z.forEach(function(o){e[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[t]&&(r=o.optionListeners[t].call(e[o.pluginName],n))}),r}};function W(e){var t=e.sortable,n=e.rootEl,r=e.name,a=e.targetEl,i=e.cloneEl,s=e.toEl,l=e.fromEl,c=e.oldIndex,f=e.newIndex,p=e.oldDraggableIndex,m=e.newDraggableIndex,h=e.originalEvent,g=e.putSortable,w=e.extraEventProperties;if(t=t||n&&n[Y]){var y,b=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||u||d?(y=document.createEvent("Event")).initEvent(r,!0,!0):y=new CustomEvent(r,{bubbles:!0,cancelable:!0}),y.to=s||n,y.from=l||n,y.item=a||n,y.clone=i,y.oldIndex=c,y.newIndex=f,y.oldDraggableIndex=p,y.newDraggableIndex=m,y.originalEvent=h,y.pullMode=g?g.lastPutMode:void 0;var x=o(o({},w),G.getEventProperties(r,t));for(var N in x)y[N]=x[N];n&&n.dispatchEvent(y),b[v]&&b[v].call(t,y)}}var H=["evt"],Q=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,H);G.pluginEvent.bind(Be)(e,t,o({dragEl:X,parentEl:J,ghostEl:q,rootEl:K,nextEl:ee,lastDownEl:te,cloneEl:ne,cloneHidden:re,dragStarted:ge,putSortable:ce,activeSortable:Be.active,originalEvent:r,oldIndex:oe,oldDraggableIndex:ie,newIndex:ae,newDraggableIndex:se,hideGhostForTarget:ze,unhideGhostForTarget:Pe,cloneNowHidden:function(){re=!0},cloneNowShown:function(){re=!1},dispatchSortableEvent:function(e){$({sortable:t,name:e,originalEvent:r})}},a))};function $(e){W(o({putSortable:ce,cloneEl:ne,targetEl:X,rootEl:K,oldIndex:oe,oldDraggableIndex:ie,newIndex:ae,newDraggableIndex:se},e))}var X,J,q,K,ee,te,ne,re,oe,ae,ie,se,le,ce,ue,de,fe,pe,me,he,ge,we,ye,be,ve,xe=!1,Ne=!1,Ie=[],Me=!1,Ee=!1,_e=[],Se=!1,De=[],je="undefined"!=typeof document,ke=m,Ce=d||u?"cssFloat":"float",Ae=je&&!h&&!m&&"draggable"in document.createElement("div"),Te=function(){if(je){if(u)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Le=function(e,t){var n=E(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=C(e,0,t),a=C(e,1,t),i=o&&E(o),s=a&&E(a),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+j(o).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+j(a).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!a||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return o&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=r&&"none"===n[Ce]||a&&"none"===n[Ce]&&l+c>r)?"vertical":"horizontal"},Oe=function(e){function t(e,n){return function(r,o,a,i){var s=r.options.group.name&&o.options.group.name&&r.options.group.name===o.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,o,a,i),n)(r,o,a,i);var l=(n?r:o).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==a(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},ze=function(){!Te&&q&&E(q,"display","none")},Pe=function(){!Te&&q&&E(q,"display","")};je&&document.addEventListener("click",function(e){if(Ne)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ne=!1,!1},!0);var Re=function(e){if(X){e=e.touches?e.touches[0]:e;var t=(o=e.clientX,a=e.clientY,Ie.some(function(e){var t=e[Y].options.emptyInsertThreshold;if(t&&!A(e)){var n=j(e),r=o>=n.left-t&&o<=n.right+t,s=a>=n.top-t&&a<=n.bottom+t;return r&&s?i=e:void 0}}),i);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Y]._onDragOver(n)}}var o,a,i},Ue=function(e){X&&X.parentNode[Y]._isOutsideThisEl(e.target)};function Be(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[Y]=this;var n,r,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Le(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Be.supportPointer&&"PointerEvent"in window&&!p,emptyInsertThreshold:5};for(var i in G.initializePlugins(this,e,a),a)!(i in t)&&(t[i]=a[i]);for(var l in Oe(t),this)"_"===l.charAt(0)&&"function"==typeof this[l]&&(this[l]=this[l].bind(this));this.nativeDraggable=!t.forceFallback&&Ae,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?w(e,"pointerdown",this._onTapStart):(w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),Ie.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(e){if("none"!==E(e,"display")&&e!==Be.ghost){r.push({target:e,rect:j(e)});var t=o({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=_(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}})},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n);return-1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var o=!1,a=0;r.forEach(function(e){var n=0,r=e.target,i=r.fromRect,s=j(r),l=r.prevFromRect,c=r.prevToRect,u=e.rect,d=_(r,!0);d&&(s.top-=d.f,s.left-=d.e),r.toRect=s,r.thisAnimationDuration&&z(l,s)&&!z(i,s)&&(u.top-s.top)/(u.left-s.left)===(i.top-s.top)/(i.left-s.left)&&(n=function(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}(u,l,c,t.options)),z(s,i)||(r.prevFromRect=i,r.prevToRect=s,n||(n=t.options.animation),t.animate(r,u,s,n)),n&&(o=!0,a=Math.max(a,n),clearTimeout(r.animationResetTimer),r.animationResetTimer=setTimeout(function(){r.animationTime=0,r.prevFromRect=null,r.fromRect=null,r.prevToRect=null,r.thisAnimationDuration=null},n),r.thisAnimationDuration=n)}),clearTimeout(n),o?n=setTimeout(function(){"function"==typeof e&&e()},a):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,r){if(r){E(e,"transition",""),E(e,"transform","");var o=_(this.el),a=o&&o.a,i=o&&o.d,s=(t.left-n.left)/(a||1),l=(t.top-n.top)/(i||1);e.animatingX=!!s,e.animatingY=!!l,E(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),E(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),E(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){E(e,"transition",""),E(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}))}function Fe(e,t,n,r,o,a,i,s){var l,c,f=e[Y],p=f.options.onMove;return!window.CustomEvent||u||d?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=o||t,l.relatedRect=a||j(t),l.willInsertAfter=s,l.originalEvent=i,e.dispatchEvent(l),p&&(c=p.call(f,l,i)),c}function Ye(e){e.draggable=!1}function Ze(){Se=!1}function Ve(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function Ge(e){return setTimeout(e,0)}function We(e){return clearTimeout(e)}Be.prototype={constructor:Be,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(we=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,X):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,o=r.preventOnFilter,a=e.type,i=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(i||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=r.filter;if(function(e){De.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&De.push(r)}}(n),!X&&!(/mousedown|pointerdown/.test(a)&&0!==e.button||r.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!p||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=x(s,r.draggable,n,!1))&&s.animated||te===s)){if(oe=T(s),ie=T(s,r.draggable),"function"==typeof c){if(c.call(this,e,s,this))return $({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Q("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(r){if(r=x(l,r.trim(),n,!1))return $({sortable:t,rootEl:r,name:"filter",targetEl:s,fromEl:n,toEl:n}),Q("filter",t,{evt:e}),!0})))return void(o&&e.cancelable&&e.preventDefault());r.handle&&!x(l,r.handle,n,!1)||this._prepareDragStart(e,i,s)}}},_prepareDragStart:function(e,t,n){var r,o=this,a=o.el,i=o.options,s=a.ownerDocument;if(n&&!X&&n.parentNode===a){var l=j(n);if(K=a,J=(X=n).parentNode,ee=X.nextSibling,te=n,le=i.group,Be.dragged=X,ue={target:X,clientX:(t||e).clientX,clientY:(t||e).clientY},me=ue.clientX-l.left,he=ue.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,X.style["will-change"]="all",r=function(){Q("delayEnded",o,{evt:e}),Be.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!f&&o.nativeDraggable&&(X.draggable=!0),o._triggerDragStart(e,t),$({sortable:o,name:"choose",originalEvent:e}),M(X,i.chosenClass,!0))},i.ignore.split(",").forEach(function(e){S(X,e.trim(),Ye)}),w(s,"dragover",Re),w(s,"mousemove",Re),w(s,"touchmove",Re),w(s,"mouseup",o._onDrop),w(s,"touchend",o._onDrop),w(s,"touchcancel",o._onDrop),f&&this.nativeDraggable&&(this.options.touchStartThreshold=4,X.draggable=!0),Q("delayStart",this,{evt:e}),!i.delay||i.delayOnTouchOnly&&!t||this.nativeDraggable&&(d||u))r();else{if(Be.eventCanceled)return void this._onDrop();w(s,"mouseup",o._disableDelayedDrag),w(s,"touchend",o._disableDelayedDrag),w(s,"touchcancel",o._disableDelayedDrag),w(s,"mousemove",o._delayedDragTouchMoveHandler),w(s,"touchmove",o._delayedDragTouchMoveHandler),i.supportPointer&&w(s,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,i.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){X&&Ye(X),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._disableDelayedDrag),y(e,"touchend",this._disableDelayedDrag),y(e,"touchcancel",this._disableDelayedDrag),y(e,"mousemove",this._delayedDragTouchMoveHandler),y(e,"touchmove",this._delayedDragTouchMoveHandler),y(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):w(document,t?"touchmove":"mousemove",this._onTouchMove):(w(X,"dragend",this),w(K,"dragstart",this._onDragStart));try{document.selection?Ge(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(xe=!1,K&&X){Q("dragStarted",this,{evt:t}),this.nativeDraggable&&w(document,"dragover",Ue);var n=this.options;!e&&M(X,n.dragClass,!1),M(X,n.ghostClass,!0),Be.active=this,e&&this._appendGhost(),$({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(de){this._lastX=de.clientX,this._lastY=de.clientY,ze();for(var e=document.elementFromPoint(de.clientX,de.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(de.clientX,de.clientY))!==t;)t=e;if(X.parentNode[Y]._isOutsideThisEl(e),t)do{if(t[Y]&&t[Y]._onDragOver({clientX:de.clientX,clientY:de.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Pe()}},_onTouchMove:function(e){if(ue){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,a=q&&_(q,!0),i=q&&a&&a.a,s=q&&a&&a.d,l=ke&&ve&&L(ve),c=(o.clientX-ue.clientX+r.x)/(i||1)+(l?l[0]-_e[0]:0)/(i||1),u=(o.clientY-ue.clientY+r.y)/(s||1)+(l?l[1]-_e[1]:0)/(s||1);if(!Be.active&&!xe){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(q){a?(a.e+=c-(fe||0),a.f+=u-(pe||0)):a={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");E(q,"webkitTransform",d),E(q,"mozTransform",d),E(q,"msTransform",d),E(q,"transform",d),fe=c,pe=u,de=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!q){var e=this.options.fallbackOnBody?document.body:K,t=j(X,!0,ke,!0,e),n=this.options;if(ke){for(ve=e;"static"===E(ve,"position")&&"none"===E(ve,"transform")&&ve!==document;)ve=ve.parentNode;ve!==document.body&&ve!==document.documentElement?(ve===document&&(ve=D()),t.top+=ve.scrollTop,t.left+=ve.scrollLeft):ve=D(),_e=L(ve)}M(q=X.cloneNode(!0),n.ghostClass,!1),M(q,n.fallbackClass,!0),M(q,n.dragClass,!0),E(q,"transition",""),E(q,"transform",""),E(q,"box-sizing","border-box"),E(q,"margin",0),E(q,"top",t.top),E(q,"left",t.left),E(q,"width",t.width),E(q,"height",t.height),E(q,"opacity","0.8"),E(q,"position",ke?"absolute":"fixed"),E(q,"zIndex","100000"),E(q,"pointerEvents","none"),Be.ghost=q,e.appendChild(q),E(q,"transform-origin",me/parseInt(q.style.width)*100+"% "+he/parseInt(q.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,o=n.options;Q("dragStart",this,{evt:e}),Be.eventCanceled?this._onDrop():(Q("setupClone",this),Be.eventCanceled||((ne=U(X)).draggable=!1,ne.style["will-change"]="",this._hideClone(),M(ne,this.options.chosenClass,!1),Be.clone=ne),n.cloneId=Ge(function(){Q("clone",n),Be.eventCanceled||(n.options.removeCloneOnHide||K.insertBefore(ne,X),n._hideClone(),$({sortable:n,name:"clone"}))}),!t&&M(X,o.dragClass,!0),t?(Ne=!0,n._loopId=setInterval(n._emulateDragOver,50)):(y(document,"mouseup",n._onDrop),y(document,"touchend",n._onDrop),y(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(n,r,X)),w(document,"drop",n),E(X,"transform","translateZ(0)")),xe=!0,n._dragStartId=Ge(n._dragStarted.bind(n,t,e)),w(document,"selectstart",n),ge=!0,p&&E(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,r,a,i=this.el,s=e.target,l=this.options,c=l.group,u=Be.active,d=le===c,f=l.sort,p=ce||u,m=this,h=!1;if(!Se){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=x(s,l.draggable,i,!0),U("dragOver"),Be.eventCanceled)return h;if(X.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||m._ignoreWhileAnimating===s)return F(!1);if(Ne=!1,u&&!l.disabled&&(d?f||(r=J!==K):ce===this||(this.lastPutMode=le.checkPull(this,u,X,e))&&c.checkPut(this,u,X,e))){if(a="vertical"===this._getDirection(e,s),t=j(X),U("dragOverValid"),Be.eventCanceled)return h;if(r)return J=K,B(),this._hideClone(),U("revert"),Be.eventCanceled||(ee?K.insertBefore(X,ee):K.appendChild(X)),F(!0);var g=A(i,l.draggable);if(!g||function(e,t,n){var r=j(A(n.el,n.options.draggable));return t?e.clientX>r.right+10||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+10}(e,a,this)&&!g.animated){if(g===X)return F(!1);if(g&&i===e.target&&(s=g),s&&(n=j(s)),!1!==Fe(K,i,X,t,s,n,e,!!s))return B(),i.appendChild(X),J=i,Z(),F(!0)}else if(g&&function(e,t,n){var r=j(C(n.el,0,n.options,!0));return t?e.clientX<r.left-10||e.clientY<r.top&&e.clientX<r.right:e.clientY<r.top-10||e.clientY<r.bottom&&e.clientX<r.left}(e,a,this)){var w=C(i,0,l,!0);if(w===X)return F(!1);if(n=j(s=w),!1!==Fe(K,i,X,t,s,n,e,!1))return B(),i.insertBefore(X,w),J=i,Z(),F(!0)}else if(s.parentNode===i){n=j(s);var y,b,v,N=X.parentNode!==i,I=!function(e,t,n){var r=n?e.left:e.top,o=n?e.right:e.bottom,a=n?e.width:e.height,i=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return r===i||o===s||r+a/2===i+l/2}(X.animated&&X.toRect||t,s.animated&&s.toRect||n,a),_=a?"top":"left",S=k(s,"top","top")||k(X,"top","top"),D=S?S.scrollTop:void 0;if(we!==s&&(b=n[_],Me=!1,Ee=!I&&l.invertSwap||N),y=function(e,t,n,r,o,a,i,s){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!i)if(s&&be<c*o){if(!Me&&(1===ye?l>u+c*a/2:l<d-c*a/2)&&(Me=!0),Me)f=!0;else if(1===ye?l<u+be:l>d-be)return-ye}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return function(e){return T(X)<T(e)?1:-1}(t);return(f=f||i)&&(l<u+c*a/2||l>d-c*a/2)?l>u+c/2?1:-1:0}(e,s,n,a,I?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Ee,we===s),0!==y){var L=T(X);do{L-=y,v=J.children[L]}while(v&&("none"===E(v,"display")||v===q))}if(0===y||v===s)return F(!1);we=s,ye=y;var O=s.nextElementSibling,z=!1,P=Fe(K,i,X,t,s,n,e,z=1===y);if(!1!==P)return 1!==P&&-1!==P||(z=1===P),Se=!0,setTimeout(Ze,30),B(),z&&!O?i.appendChild(X):s.parentNode.insertBefore(X,z?O:s),S&&R(S,0,D-S.scrollTop),J=X.parentNode,void 0===b||Ee||(be=Math.abs(b-j(s)[_])),Z(),F(!0)}if(i.contains(X))return F(!1)}return!1}function U(l,c){Q(l,m,o({evt:e,isOwner:d,axis:a?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:f,fromSortable:p,target:s,completed:F,onMove:function(n,r){return Fe(K,i,X,t,n,j(n),e,r)},changed:Z},c))}function B(){U("dragOverAnimationCapture"),m.captureAnimationState(),m!==p&&p.captureAnimationState()}function F(t){return U("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(m),m!==p&&(M(X,ce?ce.options.ghostClass:u.options.ghostClass,!1),M(X,l.ghostClass,!0)),ce!==m&&m!==Be.active?ce=m:m===Be.active&&ce&&(ce=null),p===m&&(m._ignoreWhileAnimating=s),m.animateAll(function(){U("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(s===X&&!X.animated||s===i&&!s.animated)&&(we=null),l.dragoverBubble||e.rootEl||s===document||(X.parentNode[Y]._isOutsideThisEl(e.target),!t&&Re(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),h=!0}function Z(){ae=T(X),se=T(X,l.draggable),$({sortable:m,name:"change",toEl:i,newIndex:ae,newDraggableIndex:se,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){y(document,"mousemove",this._onTouchMove),y(document,"touchmove",this._onTouchMove),y(document,"pointermove",this._onTouchMove),y(document,"dragover",Re),y(document,"mousemove",Re),y(document,"touchmove",Re)},_offUpEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._onDrop),y(e,"touchend",this._onDrop),y(e,"pointerup",this._onDrop),y(e,"touchcancel",this._onDrop),y(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ae=T(X),se=T(X,n.draggable),Q("drop",this,{evt:e}),J=X&&X.parentNode,ae=T(X),se=T(X,n.draggable),Be.eventCanceled||(xe=!1,Ee=!1,Me=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),We(this.cloneId),We(this._dragStartId),this.nativeDraggable&&(y(document,"drop",this),y(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),p&&E(document.body,"user-select",""),E(X,"transform",""),e&&(ge&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),q&&q.parentNode&&q.parentNode.removeChild(q),(K===J||ce&&"clone"!==ce.lastPutMode)&&ne&&ne.parentNode&&ne.parentNode.removeChild(ne),X&&(this.nativeDraggable&&y(X,"dragend",this),Ye(X),X.style["will-change"]="",ge&&!xe&&M(X,ce?ce.options.ghostClass:this.options.ghostClass,!1),M(X,this.options.chosenClass,!1),$({sortable:this,name:"unchoose",toEl:J,newIndex:null,newDraggableIndex:null,originalEvent:e}),K!==J?(ae>=0&&($({rootEl:J,name:"add",toEl:J,fromEl:K,originalEvent:e}),$({sortable:this,name:"remove",toEl:J,originalEvent:e}),$({rootEl:J,name:"sort",toEl:J,fromEl:K,originalEvent:e}),$({sortable:this,name:"sort",toEl:J,originalEvent:e})),ce&&ce.save()):ae!==oe&&ae>=0&&($({sortable:this,name:"update",toEl:J,originalEvent:e}),$({sortable:this,name:"sort",toEl:J,originalEvent:e})),Be.active&&(null!=ae&&-1!==ae||(ae=oe,se=ie),$({sortable:this,name:"end",toEl:J,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Q("nulling",this),K=X=J=q=ee=ne=te=re=ue=de=ge=ae=se=oe=ie=we=ye=ce=le=Be.dragged=Be.ghost=Be.clone=Be.active=null,De.forEach(function(e){e.checked=!0}),De.length=fe=pe=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":X&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,o=n.length,a=this.options;r<o;r++)x(e=n[r],a.draggable,this.el,!1)&&t.push(e.getAttribute(a.dataIdAttr)||Ve(e));return t},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var o=r.children[t];x(o,this.options.draggable,r,!1)&&(n[e]=o)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return x(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=G.modifyOption(this,e,t);n[e]=void 0!==r?r:t,"group"===e&&Oe(n)},destroy:function(){Q("destroy",this);var e=this.el;e[Y]=null,y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart),y(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ie.splice(Ie.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!re){if(Q("hideClone",this),Be.eventCanceled)return;E(ne,"display","none"),this.options.removeCloneOnHide&&ne.parentNode&&ne.parentNode.removeChild(ne),re=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(re){if(Q("showClone",this),Be.eventCanceled)return;X.parentNode!=K||this.options.group.revertClone?ee?K.insertBefore(ne,ee):K.appendChild(ne):K.insertBefore(ne,X),this.options.group.revertClone&&this.animate(X,ne),E(ne,"display",""),re=!1}}else this._hideClone()}},je&&w(document,"touchmove",function(e){(Be.active||xe)&&e.cancelable&&e.preventDefault()}),Be.utils={on:w,off:y,css:E,find:S,is:function(e,t){return!!x(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:P,closest:x,toggleClass:M,clone:U,index:T,nextTick:Ge,cancelNextTick:We,detectDirection:Le,getChild:C},Be.get=function(e){return e[Y]},Be.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Be.utils=o(o({},Be.utils),e.utils)),G.mount(e)})},Be.create=function(e,t){return new Be(e,t)},Be.version="1.14.0";var He,Qe,$e,Xe,Je,qe,Ke=[],et=!1;function tt(){Ke.forEach(function(e){clearInterval(e.pid)}),Ke=[]}function nt(){clearInterval(qe)}var rt,ot=P(function(e,t,n,r){if(t.scroll){var o,a=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,c=D(),u=!1;Qe!==n&&(Qe=n,tt(),He=t.scroll,o=t.scrollFn,!0===He&&(He=O(n,!0)));var d=0,f=He;do{var p=f,m=j(p),h=m.top,g=m.bottom,w=m.left,y=m.right,b=m.width,v=m.height,x=void 0,N=void 0,I=p.scrollWidth,M=p.scrollHeight,_=E(p),S=p.scrollLeft,k=p.scrollTop;p===c?(x=b<I&&("auto"===_.overflowX||"scroll"===_.overflowX||"visible"===_.overflowX),N=v<M&&("auto"===_.overflowY||"scroll"===_.overflowY||"visible"===_.overflowY)):(x=b<I&&("auto"===_.overflowX||"scroll"===_.overflowX),N=v<M&&("auto"===_.overflowY||"scroll"===_.overflowY));var C=x&&(Math.abs(y-a)<=s&&S+b<I)-(Math.abs(w-a)<=s&&!!S),A=N&&(Math.abs(g-i)<=s&&k+v<M)-(Math.abs(h-i)<=s&&!!k);if(!Ke[d])for(var T=0;T<=d;T++)Ke[T]||(Ke[T]={});Ke[d].vx==C&&Ke[d].vy==A&&Ke[d].el===p||(Ke[d].el=p,Ke[d].vx=C,Ke[d].vy=A,clearInterval(Ke[d].pid),0==C&&0==A||(u=!0,Ke[d].pid=setInterval(function(){r&&0===this.layer&&Be.active._onTouchMove(Je);var t=Ke[this.layer].vy?Ke[this.layer].vy*l:0,n=Ke[this.layer].vx?Ke[this.layer].vx*l:0;"function"==typeof o&&"continue"!==o.call(Be.dragged.parentNode[Y],n,t,e,Je,Ke[this.layer].el)||R(Ke[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=O(f,!1)));et=u}},30),at=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,o=e.activeSortable,a=e.dispatchSortableEvent,i=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||o;i();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(c.clientX,c.clientY);s(),l&&!l.el.contains(u)&&(a("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function it(){}function st(){}function lt(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(e){var t=e.dragEl;rt=t},dragOverValid:function(e){var t=e.completed,n=e.target,r=e.onMove,o=e.activeSortable,a=e.changed,i=e.cancel;if(o.options.swap){var s=this.sortable.el,l=this.options;if(n&&n!==s){var c=rt;!1!==r(n)?(M(n,l.swapClass,!0),rt=n):rt=null,c&&c!==rt&&M(c,l.swapClass,!1)}a(),t(!0),i()}},drop:function(e){var t,n,r,o,a,i,s=e.activeSortable,l=e.putSortable,c=e.dragEl,u=l||this.sortable,d=this.options;rt&&M(rt,d.swapClass,!1),rt&&(d.swap||l&&l.options.swap)&&c!==rt&&(u.captureAnimationState(),u!==s&&s.captureAnimationState(),n=rt,a=(t=c).parentNode,i=n.parentNode,a&&i&&!a.isEqualNode(n)&&!i.isEqualNode(t)&&(r=T(t),o=T(n),a.isEqualNode(i)&&r<o&&o++,a.insertBefore(n,a.children[r]),i.insertBefore(t,i.children[o])),u.animateAll(),u!==s&&s.animateAll())},nulling:function(){rt=null}},s(e,{pluginName:"swap",eventProperties:function(){return{swapItem:rt}}})}it.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=C(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:at},s(it,{pluginName:"revertOnSpill"}),st.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:at},s(st,{pluginName:"removeOnSpill"});var ct,ut,dt,ft,pt,mt=[],ht=[],gt=!1,wt=!1,yt=!1;function bt(){function e(e){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));e.options.supportPointer?w(document,"pointerup",this._deselectMultiDrag):(w(document,"mouseup",this._deselectMultiDrag),w(document,"touchend",this._deselectMultiDrag)),w(document,"keydown",this._checkKeyDown),w(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(t,n){var r="";mt.length&&ut===e?mt.forEach(function(e,t){r+=(t?", ":"")+e.textContent}):r=n.textContent,t.setData("Text",r)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var t=e.dragEl;dt=t},delayEnded:function(){this.isMultiDrag=~mt.indexOf(dt)},setupClone:function(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var r=0;r<mt.length;r++)ht.push(U(mt[r])),ht[r].sortableIndex=mt[r].sortableIndex,ht[r].draggable=!1,ht[r].style["will-change"]="",M(ht[r],this.options.selectedClass,!1),mt[r]===dt&&M(ht[r],this.options.chosenClass,!1);t._hideClone(),n()}},clone:function(e){var t=e.sortable,n=e.rootEl,r=e.dispatchSortableEvent,o=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||mt.length&&ut===t&&(vt(!0,n),r("clone"),o()))},showClone:function(e){var t=e.cloneNowShown,n=e.rootEl,r=e.cancel;this.isMultiDrag&&(vt(!1,n),ht.forEach(function(e){E(e,"display","")}),t(),pt=!1,r())},hideClone:function(e){var t=this,n=(e.sortable,e.cloneNowHidden),r=e.cancel;this.isMultiDrag&&(ht.forEach(function(e){E(e,"display","none"),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}),n(),pt=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&ut&&ut.multiDrag._deselectMultiDrag(),mt.forEach(function(e){e.sortableIndex=T(e)}),mt=mt.sort(function(e,t){return e.sortableIndex-t.sortableIndex}),yt=!0},dragStarted:function(e){var t=this,n=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){mt.forEach(function(e){e!==dt&&E(e,"position","absolute")});var r=j(dt,!1,!0,!0);mt.forEach(function(e){e!==dt&&B(e,r)}),wt=!0,gt=!0}n.animateAll(function(){wt=!1,gt=!1,t.options.animation&&mt.forEach(function(e){F(e)}),t.options.sort&&xt()})}},dragOver:function(e){var t=e.target,n=e.completed,r=e.cancel;wt&&~mt.indexOf(t)&&(n(!1),r())},revert:function(e){var t=e.fromSortable,n=e.rootEl,r=e.sortable,o=e.dragRect;mt.length>1&&(mt.forEach(function(e){r.addAnimationState({target:e,rect:wt?j(e):o}),F(e),e.fromRect=o,t.removeAnimationState(e)}),wt=!1,function(e,t){mt.forEach(function(n,r){var o=t.children[n.sortableIndex+(e?Number(r):0)];o?t.insertBefore(n,o):t.appendChild(n)})}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,r=e.insertion,o=e.activeSortable,a=e.parentEl,i=e.putSortable,s=this.options;if(r){if(n&&o._hideClone(),gt=!1,s.animation&&mt.length>1&&(wt||!n&&!o.options.sort&&!i)){var l=j(dt,!1,!0,!0);mt.forEach(function(e){e!==dt&&(B(e,l),a.appendChild(e))}),wt=!0}if(!n)if(wt||xt(),mt.length>1){var c=pt;o._showClone(t),o.options.animation&&!pt&&c&&ht.forEach(function(e){o.addAnimationState({target:e,rect:ft}),e.fromRect=ft,e.thisAnimationDuration=null})}else o._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,r=e.activeSortable;if(mt.forEach(function(e){e.thisAnimationDuration=null}),r.options.animation&&!n&&r.multiDrag.isMultiDrag){ft=s({},t);var o=_(dt,!0);ft.top-=o.f,ft.left-=o.e}},dragOverAnimationComplete:function(){wt&&(wt=!1,xt())},drop:function(e){var t=e.originalEvent,n=e.rootEl,r=e.parentEl,o=e.sortable,a=e.dispatchSortableEvent,i=e.oldIndex,s=e.putSortable,l=s||this.sortable;if(t){var c=this.options,u=r.children;if(!yt)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),M(dt,c.selectedClass,!~mt.indexOf(dt)),~mt.indexOf(dt))mt.splice(mt.indexOf(dt),1),ct=null,W({sortable:o,rootEl:n,name:"deselect",targetEl:dt,originalEvt:t});else{if(mt.push(dt),W({sortable:o,rootEl:n,name:"select",targetEl:dt,originalEvt:t}),t.shiftKey&&ct&&o.el.contains(ct)){var d,f,p=T(ct),m=T(dt);if(~p&&~m&&p!==m)for(m>p?(f=p,d=m):(f=m,d=p+1);f<d;f++)~mt.indexOf(u[f])||(M(u[f],c.selectedClass,!0),mt.push(u[f]),W({sortable:o,rootEl:n,name:"select",targetEl:u[f],originalEvt:t}))}else ct=dt;ut=l}if(yt&&this.isMultiDrag){if(wt=!1,(r[Y].options.sort||r!==n)&&mt.length>1){var h=j(dt),g=T(dt,":not(."+this.options.selectedClass+")");if(!gt&&c.animation&&(dt.thisAnimationDuration=null),l.captureAnimationState(),!gt&&(c.animation&&(dt.fromRect=h,mt.forEach(function(e){if(e.thisAnimationDuration=null,e!==dt){var t=wt?j(e):h;e.fromRect=t,l.addAnimationState({target:e,rect:t})}})),xt(),mt.forEach(function(e){u[g]?r.insertBefore(e,u[g]):r.appendChild(e),g++}),i===T(dt))){var w=!1;mt.forEach(function(e){e.sortableIndex===T(e)||(w=!0)}),w&&a("update")}mt.forEach(function(e){F(e)}),l.animateAll()}ut=l}(n===r||s&&"clone"!==s.lastPutMode)&&ht.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},nullingGlobal:function(){this.isMultiDrag=yt=!1,ht.length=0},destroyGlobal:function(){this._deselectMultiDrag(),y(document,"pointerup",this._deselectMultiDrag),y(document,"mouseup",this._deselectMultiDrag),y(document,"touchend",this._deselectMultiDrag),y(document,"keydown",this._checkKeyDown),y(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(void 0!==yt&&yt||ut!==this.sortable||e&&x(e.target,this.options.draggable,this.sortable.el,!1)||e&&0!==e.button))for(;mt.length;){var t=mt[0];M(t,this.options.selectedClass,!1),mt.shift(),W({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},s(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[Y];t&&t.options.multiDrag&&!~mt.indexOf(e)&&(ut&&ut!==t&&(ut.multiDrag._deselectMultiDrag(),ut=t),M(e,t.options.selectedClass,!0),mt.push(e))},deselect:function(e){var t=e.parentNode[Y],n=mt.indexOf(e);t&&t.options.multiDrag&&~n&&(M(e,t.options.selectedClass,!1),mt.splice(n,1))}},eventProperties:function(){var e,t=this,n=[],r=[];return mt.forEach(function(e){var o;n.push({multiDragElement:e,index:e.sortableIndex}),o=wt&&e!==dt?-1:wt?T(e,":not(."+t.options.selectedClass+")"):T(e),r.push({multiDragElement:e,index:o})}),{items:(e=mt,function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(e,t):void 0}}(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.")}()),clones:[].concat(ht),oldIndicies:n,newIndicies:r}},optionListeners:{multiDragKey:function(e){return"ctrl"===(e=e.toLowerCase())?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function vt(e,t){ht.forEach(function(n,r){var o=t.children[n.sortableIndex+(e?Number(r):0)];o?t.insertBefore(n,o):t.appendChild(n)})}function xt(){mt.forEach(function(e){e!==dt&&e.parentNode&&e.parentNode.removeChild(e)})}Be.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):this.options.supportPointer?w(document,"pointermove",this._handleFallbackAutoScroll):t.touches?w(document,"touchmove",this._handleFallbackAutoScroll):w(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):(y(document,"pointermove",this._handleFallbackAutoScroll),y(document,"touchmove",this._handleFallbackAutoScroll),y(document,"mousemove",this._handleFallbackAutoScroll)),nt(),tt(),clearTimeout(N),N=void 0},nulling:function(){Je=Qe=He=et=qe=$e=Xe=null,Ke.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,o);if(Je=e,t||this.options.forceAutoScrollFallback||d||u||p){ot(e,this.options,a,t);var i=O(a,!0);!et||qe&&r===$e&&o===Xe||(qe&&nt(),qe=setInterval(function(){var a=O(document.elementFromPoint(r,o),!0);a!==i&&(i=a,tt()),ot(e,n.options,a,t)},10),$e=r,Xe=o)}else{if(!this.options.bubbleScroll||O(a,!0)===D())return void tt();ot(e,this.options,O(a,!1),!1)}}},s(e,{pluginName:"scroll",initializeByDefault:!0})}),Be.mount(st,it);const Nt=Be},5229(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(1133)),o=n(8917);function a(e,t){var n={};return e&&"string"==typeof e?((0,r.default)(e,function(e,r){e&&r&&(n[(0,o.camelCase)(e,t)]=r)}),n):n}a.default=a,e.exports=a},8917(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,o=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},l=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(i,l):e.replace(a,l)).replace(r,s))}},1133(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.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;const r=(0,o.default)(e),a="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;const{property:r,value:o}=e;a?t(r,o,e):o&&(n=n||{},n[r]=o)}),n};const o=r(n(5077))},7676(e){"use strict";e.exports=function(e,t){if(!e)throw new Error("Invariant failed")}},7573(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>r});const r=function(e,t){}},8493(e,t,n){"use strict";var r=n(1609),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,i=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return s(function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})},[e,n,t]),i(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},2162(e,t,n){"use strict";var r=n(1609),o=n(9888),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,s=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return s=t}return s=e}if(t=s,a(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(i=e,t):(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]);var p=i(e,d[0],d[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}},2779(e,t,n){"use strict";var r=n(1609),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useSyncExternalStore,i=r.useRef,s=r.useEffect,l=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=i(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!s){if(s=!0,a=e,e=r(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,o(a,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(a=e,t):(a=e,i=n)}var a,i,s=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),c(p),p}},9888(e,t,n){"use strict";e.exports=n(8493)},9242(e,t,n){"use strict";e.exports=n(2162)},8418(e,t,n){"use strict";e.exports=n(2779)},8783(e,t,n){"use strict";function r(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}n.d(t,{A:()=>o});const o=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});if("object"==typeof t||"object"==typeof n){var o=r(t),a=r(n);return o!==t||a!==n?e(o,a):Object.keys(Object.assign({},t,n)).every(function(r){return e(t[r],n[r])})}return!1}},1609(e){"use strict";e.exports=window.React},1455(e){"use strict";e.exports=window.wp.apiFetch},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=i(e,a(n)))}return e}function a(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=i(t,n));return t}function i(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)}()},8168(e,t,n){"use strict";function r(){return r=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},r.apply(null,arguments)}n.d(t,{A:()=>r})},7387(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(3662);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.A)(e,t)}},8587(e,t,n){"use strict";function r(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}n.d(t,{A:()=>r})},3662(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:()=>r})},1561(e,t,n){"use strict";n.d(t,{A:()=>r});function r(e,t){if(!e)throw new Error("Invariant failed")}}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return r[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=r,e=[],a.O=(t,n,r,o)=>{if(!n){var i=1/0;for(u=0;u<e.length;u++){for(var[n,r,o]=e[u],s=!0,l=0;l<n.length;l++)(!1&o||i>=o)&&Object.keys(a.O).every(e=>a.O[e](n[l]))?n.splice(l--,1):(s=!1,o<i&&(i=o));if(s){e.splice(u--,1);var c=r();void 0!==c&&(t=c)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var i={};t=t||[null,n({}),n([]),n(n)];for(var s=2&r&&e;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{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(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={174:0,306:0};a.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[i,s,l]=n,c=0;if(i.some(t=>0!==e[t])){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);if(l)var u=l(a)}for(t&&t(n);c<i.length;c++)o=i[c],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(u)},n=globalThis.webpackChunkcartflows=globalThis.webpackChunkcartflows||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=a.O(void 0,[306],()=>a(6709));i=a.O(i)})();