PluginProbe
SureDonation – Donation Forms, Fundraising Campaigns & Donor Management / 1.1.0
SureDonation – Donation Forms, Fundraising Campaigns & Donor Management v1.1.0
1.6.1 1.6.0 1.5.1 1.5.0 1.4.0 1.3.0 trunk 0.0.1 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0
← All changes | assets/build/editor/editor.js +1 -1 1.0.0 → 1.1.0 View file →
@@ -1 +1 @@
1 -(()=>{var e,t,n={6359(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1601),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,'.components-panel[data-sd-tab]{z-index:99}.components-panel[data-sd-tab]:not([data-sd-tab=advance]) .components-panel__body.block-editor-block-inspector__advanced,.components-panel[data-sd-tab]:not([data-sd-tab=advance]) .components-panel__body.editor-block-inspector__advanced.block-editor-block-inspector__advanced,.components-panel[data-sd-tab]:not([data-sd-tab=advance]) .block-editor-block-inspector>div>.components-panel__body{display:none}.components-panel[data-sd-tab] .block-editor-block-card{position:relative;z-index:1;overflow:hidden}.components-panel[data-sd-tab] .block-editor-block-card::before{content:"";position:absolute;top:0;left:-16px;right:-16px;bottom:0;background:#fff;z-index:-1}.components-panel[data-sd-tab] .components-panel__body.edit-post-settings-sidebar__panel-block .block-editor-block-card{overflow:unset}.components-panel[data-sd-tab] .components-panel__body.edit-post-settings-sidebar__panel-block .block-editor-block-card::before{top:-16px}.components-panel[data-sd-tab=advance] .block-editor-block-inspector__advanced{border-color:rgba(0,0,0,0)}[dir=rtl] .sd-inspector-tabs{direction:rtl}[dir=rtl] .sd-inspector-tabs>div:first-child.sd-active::after{border-left:1px solid #d6d9dd;border-right:0}[dir=rtl] .sd-inspector-tabs>div:last-child.sd-active::after{border-left:0;border-right:1px solid #d6d9dd}.sd-inspector-tabs{display:flex;position:relative;background:#fff;z-index:9;height:65px}.sd-inspector-tabs>div{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;background:#fff;cursor:pointer}.sd-inspector-tabs>div::after,.sd-inspector-tabs>div::before{content:"";position:absolute;display:block;top:0;left:0;width:100%}.sd-inspector-tabs>div::after{border-bottom:1px solid #d6d9dd;height:100%;z-index:1}.sd-inspector-tabs>div:first-child.sd-active::after{border-left:0;box-shadow:inset 0 -3px 0 0 #0085ba;color:#0085ba}.sd-inspector-tabs>div:last-child.sd-active::after{border-right:0;box-shadow:inset 0 -3px 0 0 #0085ba;color:#0085ba}.sd-inspector-tabs>div.sd-active::after{border-left:1px solid #d6d9dd;border-right:1px solid #d6d9dd;border-bottom:0;box-shadow:inset 0 -3px 0 0 #0085ba;color:#0085ba}.sd-inspector-tabs>div.sd-active::before{height:0;background-color:rgba(0,0,0,0);z-index:2}.sd-inspector-tabs>div h5{margin:6px 0 0;font-size:13px;font-weight:400;line-height:1.2}.sd-inspector-tabs>div h5,.sd-inspector-tabs>div svg{z-index:2;fill:#585858}.sd-inspector-tabs>div.sd-active h5{color:#0085ba}.sd-inspector-tabs>div.sd-active path{fill:#0085ba}.sd-inspector-tabs>div:hover:not(.sd-active) h5{color:#1e1e1e}.sd-inspector-tabs>div:hover:not(.sd-active) path{fill:#1e1e1e}.sd-inspector-tabs>div:focus{outline:none;box-shadow:inset 0 0 0 2px #0085ba}.components-panel .components-panel__body .sd-inspector-tabs-container{position:static !important;border-top:0 !important;top:0 !important}.sd-inspector-tabs-container{position:sticky;top:-3px;z-index:9;border-top:calc(.1em + 1px) solid #f2f4f5;direction:initial}.block-editor-block-inspector .sd-inspector-tab{padding:16px}.block-editor-block-inspector .sd-inspector-tab .components-panel__body:first-child{margin-top:0;border-top:none !important}.edit-post-settings-sidebar__panel-block .sd-inspector-tab .components-panel__body:first-child{margin-top:0;border-top:none !important}',""]);const a=i},4180(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1601),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,".sd-multi-buttons-control{margin-bottom:16px}.sd-multi-buttons-control .sd-control-label{display:block;margin-bottom:8px;font-size:11px;font-weight:500;text-transform:uppercase;color:#1e1e1e}.sd-multi-buttons-control .sd-multi-button-button-group{display:flex;width:100%}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button{flex:1;justify-content:center;height:unset;min-height:30px;padding:6px;line-height:16px;font-size:13px;font-weight:400;border:none;border-radius:0;color:#50575e;background-color:#fff;box-shadow:inset 0 0 0 1px #e6e7e9}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button:first-child{border-radius:3px 0 0 3px}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button:last-child{border-radius:0 3px 3px 0}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-primary,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=true]{color:#007cba;background-color:#dcf2ff;box-shadow:inset 0 0 0 1px #cde9f9;z-index:1}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-primary:hover,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=true]:hover{color:#007cba;background-color:#dcf2ff;box-shadow:inset 0 0 0 1px #cde9f9}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-primary:focus,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=true]:focus{box-shadow:inset 0 0 0 1px #cde9f9,0 0 0 1px #007cba}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-secondary,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=false]{color:#50575e;background-color:#fff;box-shadow:inset 0 0 0 1px #e6e7e9}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-secondary:hover,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=false]:hover{color:#1d2327;box-shadow:inset 0 0 0 1px #e6e7e9}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-secondary:focus,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=false]:focus{box-shadow:inset 0 0 0 1px #e6e7e9}.sd-multi-buttons-control .sd-help-text{margin-top:8px;font-size:12px;font-style:italic;color:#a4afb7}.sd-multi-buttons-control.sd-multi-buttons__color-scheme--secondary .sd-multi-button-button-group .sd-multi-button.is-primary,.sd-multi-buttons-control.sd-multi-buttons__color-scheme--secondary .sd-multi-button-button-group .sd-multi-button[aria-pressed=true]{background-color:#1e1e1e;border-color:#1e1e1e}.sd-multi-buttons-control.sd-multi-buttons__layout--inline{display:flex;align-items:center;gap:12px}.sd-multi-buttons-control.sd-multi-buttons__layout--inline .sd-control-label{margin-bottom:0;flex-shrink:0}.sd-multi-buttons-control.sd-multi-buttons__layout--inline .sd-multi-button-button-group{flex:1}.sd-multi-buttons-control.sd-multi-buttons__layout--compact .sd-multi-button-button-group .sd-multi-button{flex:0 0 auto;padding:0 12px}.sd-multibutton-icons .sd-multi-button-button-group .sd-multi-button{padding:0 8px}.sd-multibutton-icons .sd-multi-button-button-group .sd-multi-button svg{width:18px;height:18px}",""]);const a=i},4676(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1601),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,".sd-range-control{margin-bottom:16px}.sd-range-control .sd-range-control__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.sd-range-control .sd-range-control__header .sd-control-label{font-size:11px;font-weight:500;text-transform:uppercase;color:#1e1e1e}.sd-range-control .sd-range-control__header .sd-range-control__reset{background:none;border:none;padding:4px;cursor:pointer;color:#757575;display:flex;align-items:center;justify-content:center;border-radius:2px;transition:all .15s ease}.sd-range-control .sd-range-control__header .sd-range-control__reset:hover{color:#1e1e1e;background:#f0f0f0}.sd-range-control .sd-range-control__header .sd-range-control__reset:focus{outline:none;box-shadow:0 0 0 2px #1293b6}.sd-range-control .sd-range-control__header .sd-range-control__reset svg{fill:currentColor}.sd-range-control .sd-range-control__controls{display:flex;align-items:center;gap:12px}.sd-range-control .sd-range-control__controls .components-range-control{flex:1;margin-bottom:0}.sd-range-control .sd-range-control__controls .components-range-control .components-range-control__wrapper{margin:0}.sd-range-control .sd-range-control__controls .components-range-control .components-range-control__slider{margin:0}.sd-range-control .sd-range-control__controls .components-range-control .components-range-control__root{margin-bottom:0}.sd-range-control .sd-range-control__controls .components-number-control{width:70px;flex-shrink:0}.sd-range-control .sd-range-control__controls .components-number-control input{height:32px;text-align:center}.sd-range-control .sd-help-text{margin-top:8px;font-size:12px;font-style:italic;color:#a4afb7}",""]);const a=i},9380(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1601),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,".sd-text-control{position:relative;margin-bottom:16px}.sd-text-control .components-base-control__field{margin-bottom:0}.sd-text-control .sd-control__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.sd-text-control .sd-control__header .sd-control-label{font-size:11px;font-weight:500;text-transform:uppercase;color:#1e1e1e;line-height:1.4}.sd-text-control .components-text-control__input,.sd-text-control .components-textarea-control__input{margin-left:0;margin-right:0;color:#50575e;border-color:#e6e7e9;border-radius:4px}.sd-text-control .components-text-control__input:focus,.sd-text-control .components-textarea-control__input:focus{border-color:#959595;box-shadow:none}.sd-text-control__controls{position:relative}.sd-text-control__controls .components-base-control__label{font-size:11px;font-weight:500;text-transform:uppercase;margin-bottom:8px}.sd-text-control__controls-inline .components-base-control__field{display:flex;align-items:center}.sd-text-control__controls-inline .components-base-control__field>label{flex:50%;margin-bottom:0}.sd-text-control__controls-inline .components-base-control__field>input{flex:50%}.sd-text-control__controls-textarea{position:relative}.sd-text-control__controls-textarea textarea{color:#50575e;border-color:#e6e7e9;min-height:80px;resize:vertical}.sd-text-control__controls-textarea textarea:focus{border-color:#959595;box-shadow:none}.sd-text-control .sd-help-text{margin-top:8px;font-size:12px;font-style:italic;color:#a4afb7}.sd-text-control--full-width .sd-text-control__controls .components-base-control__label{display:none}",""]);const a=i},6314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},1601(e){"use strict";e.exports=function(e){return e[1]}},5072(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var s={},i=[],a=0;a<e.length;a++){var l=e[a],c=r.base?l[0]+r.base:l[0],d=s[c]||0,u="".concat(c," ").concat(d);s[c]=d+1;var m=n(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==m)t[m].references++,t[m].updater(p);else{var h=o(p,r);r.byIndex=a,t.splice(a,0,{identifier:u,updater:h,references:1})}i.push(u)}return i}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var s=r(e=e||[],o=o||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var l=r(e,o),c=0;c<s.length;c++){var d=n(s[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=l}}},7659(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},4868(e){"use strict";e.exports=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}},4284(e){"use strict";var t,n=(t=[],function(e,n){return t[e]=n,t.filter(Boolean).join("\n")});function r(e,t,r,o){var s;if(r)s="";else{s="",o.supports&&(s+="@supports (".concat(o.supports,") {")),o.media&&(s+="@media ".concat(o.media," {"));var i=void 0!==o.layer;i&&(s+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),s+=o.css,i&&(s+="}"),o.media&&(s+="}"),o.supports&&(s+="}")}if(e.styleSheet)e.styleSheet.cssText=n(t,s);else{var a=document.createTextNode(s),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(a,l[t]):e.appendChild(a)}}var o={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=o.singletonCounter++,n=o.singleton||(o.singleton=e.insertStyleElement(e));return{update:function(e){r(n,t,!1,e)},remove:function(e){r(n,t,!0,e)}}}},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,s(n)))}return e}function s(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)}()}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,exports:{}};return n[e](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var s=Object.create(null);o.r(s);var i={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,o.d(s,i),s},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};o.r(e),o.d(e,{addField:()=>a,initializeStore:()=>d,removeField:()=>l,resetStore:()=>u,setActiveTab:()=>s,setFieldsList:()=>i,updateField:()=>c});var t={};o.r(t),o.d(t,{getActiveTab:()=>m,getEmailFields:()=>g,getFieldByClientId:()=>h,getFieldOptions:()=>w,getFieldsByType:()=>f,getFieldsList:()=>p,getInputFields:()=>v,getMultiChoiceFields:()=>y,getNumberFields:()=>b,isStoreInitialized:()=>x});const n=window.wp.data,r={activeTab:"general",fieldsList:[],isInitialized:!1},s=e=>({type:"SET_ACTIVE_TAB",tab:e}),i=e=>({type:"SET_FIELDS_LIST",fields:e}),a=e=>({type:"ADD_FIELD",field:e}),l=e=>({type:"REMOVE_FIELD",clientId:e}),c=(e,t)=>({type:"UPDATE_FIELD",clientId:e,updates:t}),d=e=>({type:"INITIALIZE_STORE",data:e}),u=()=>({type:"RESET_STORE"}),m=e=>e.activeTab,p=e=>e.fieldsList,h=(e,t)=>e.fieldsList.find(e=>e.clientId===t),f=(e,t)=>e.fieldsList.filter(e=>e.type===t),g=e=>e.fieldsList.filter(e=>"suredonation/email"===e.type),v=e=>e.fieldsList.filter(e=>"suredonation/input"===e.type),b=e=>e.fieldsList.filter(e=>"suredonation/number"===e.type),y=e=>e.fieldsList.filter(e=>"suredonation/donation-amount"===e.type),x=e=>e.isInitialized,w=(e,t=[],n=!0)=>{const r=n?[{value:"",label:"— Select Field —"}]:[];return(t.length?e.fieldsList.filter(e=>t.includes(e.type)):e.fieldsList).forEach(e=>{r.push({value:e.clientId,label:e.label||e.slug||e.clientId})}),r},k=(0,n.createReduxStore)("suredonation/form-editor",{reducer:(e=r,t)=>{switch(t.type){case"SET_ACTIVE_TAB":return{...e,activeTab:t.tab};case"SET_FIELDS_LIST":return{...e,fieldsList:t.fields};case"ADD_FIELD":return{...e,fieldsList:[...e.fieldsList,t.field]};case"REMOVE_FIELD":return{...e,fieldsList:e.fieldsList.filter(e=>e.clientId!==t.clientId)};case"UPDATE_FIELD":return{...e,fieldsList:e.fieldsList.map(e=>e.clientId===t.clientId?{...e,...t.updates}:e)};case"INITIALIZE_STORE":return{...e,...t.data,isInitialized:!0};case"RESET_STORE":return{...r};default:return e}},actions:e,selectors:t});(0,n.register)(k);const j=window.wp.plugins,C=window.wp.editor,S=window.wp.element,E=window.wp.i18n,T=window.ReactJSXRuntime,P=({className:e="h-6 w-6"})=>(0,T.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"SureDonation",children:[(0,T.jsx)("path",{d:"M0 3.64405C0 1.6315 1.62712 0 3.63425 0H20.2517C22.2588 0 23.886 1.6315 23.886 3.64405V20.3063C23.886 22.3188 22.2588 23.9503 20.2517 23.9503H3.63425C1.62712 23.9503 0 22.3188 0 20.3063V3.64405Z",fill:"#00A2D8"}),(0,T.jsx)("path",{d:"M12.6516 5.79655C14.4525 3.99075 17.3723 3.99075 19.1734 5.79655C20.9742 7.60234 20.9742 10.5301 19.1734 12.3359L17.5686 13.9451C17.2776 14.2368 16.8057 14.2368 16.5147 13.9451C16.2237 13.6533 16.2237 13.1802 16.5147 12.8884L18.1196 11.2793C19.3385 10.0571 19.3385 8.07537 18.1196 6.85312C16.9007 5.6309 14.9243 5.63092 13.7054 6.85312L11.3607 9.20415C11.0701 9.49552 11.0701 9.96791 11.3607 10.2593C11.6513 10.5506 12.1224 10.5506 12.413 10.2593L13.4659 9.20346C13.7569 8.91169 14.2288 8.91169 14.5198 9.20346C14.8107 9.49523 14.8107 9.96828 14.5198 10.26L13.4667 11.3159C12.5942 12.1909 11.1794 12.1909 10.3069 11.3159C9.43429 10.441 9.43429 9.02249 10.3069 8.14757L10.8879 7.56486L10.1781 6.85312C8.95914 5.63089 6.98277 5.63089 5.76382 6.85312C4.54486 8.07537 4.54488 10.0571 5.76382 11.2793L12.6985 18.2326C12.9895 18.5244 12.9895 18.9974 12.6985 19.2892C12.4075 19.581 11.9358 19.581 11.6448 19.2892L4.71008 12.3359C2.90915 10.5301 2.90913 7.60233 4.71008 5.79655C6.51102 3.99075 9.43091 3.99075 11.2318 5.79655L11.9417 6.50827L12.6516 5.79655ZM11.8605 14.9781C12.1515 14.6863 12.6233 14.6863 12.9143 14.9781L14.5397 16.6079C14.8307 16.8996 14.8307 17.3727 14.5397 17.6645C14.2487 17.9562 13.7769 17.9562 13.4859 17.6645L11.8605 16.0347C11.5695 15.7429 11.5695 15.2699 11.8605 14.9781ZM13.6482 13.1856C13.9392 12.8939 14.4109 12.8939 14.7019 13.1856L16.3273 14.8154C16.6183 15.1072 16.6183 15.5802 16.3273 15.872C16.0363 16.1638 15.5645 16.1638 15.2735 15.872L13.6482 14.2422C13.3572 13.9504 13.3572 13.4774 13.6482 13.1856Z",fill:"#FFFFFF"})]}),N=()=>(0,T.jsxs)("div",{className:"block-editor-block-card",children:[(0,T.jsx)("span",{className:"block-editor-block-icon has-colors",children:(0,T.jsx)(P,{className:"sd-plugin-icon"})}),(0,T.jsxs)("div",{className:"block-editor-block-card__content",children:[(0,T.jsx)("h2",{className:"block-editor-block-card__title",children:(0,E.__)("SureDonation","suredonation")}),(0,T.jsx)("span",{className:"block-editor-block-card__description",children:(0,E.__)("Customize your donation form","suredonation")})]})]}),_=window.wp.blockEditor,R=window.wp.components;var A=o(6942),M=o.n(A),L=o(5072),I=o.n(L),D=o(4284),O=o.n(D),F=o(7659),V=o.n(F),z=o(4868),B=o.n(z),$=o(540),W=o.n($),U=o(6359),H={};U.A&&U.A.locals&&(H.locals=U.A.locals);var q,K=0,G={attributes:{id:"suredonation-editor-styles"}};G.setAttributes=B(),G.insert=V().bind(null,"head"),G.domAPI=O(),G.insertStyleElement=W(),H.use=function(e){return G.options=e||{},K++||(q=I()(U.A,G)),H},H.unuse=function(){K>0&&! --K&&(q(),q=null)};const Y=H,X="general",Z="style",J="advance",Q=e=>{(0,S.useLayoutEffect)(()=>(Y?.use(),()=>{Y?.unuse()}),[]);const t=((e=null)=>{try{const t=window.localStorage;if(e){const n=t.getItem("sdEditorState");return n?JSON.parse(n)?.[e]:null}return t}catch(e){return null}})("sdSettingState"),{defaultTab:r="general",children:o,tabs:s=["general","style","advance"],stateKey:i=null}=e,a=!!i,l=()=>i||(0,n.select)("core/block-editor").getSelectedBlock()?.name,[c,d]=(0,S.useState)(r||s[0]),u=(0,S.useRef)();let m;(0,S.useEffect)(()=>{m=u.current?.closest(".components-panel")});const p=()=>{if(a)return;const e=document.querySelector(".sd-inspector-tabs-container"),t=document.querySelector(".sd-tab-content-general"),n=document.querySelector(".sd-tab-content-style"),r=document.querySelector(".sd-tab-content-advance");if(e){const o=e.parentElement;o&&o.prepend(e,t||"",n||"",r||"")}};(0,S.useEffect)(()=>{if(p(),a)return;const e=l();return t&&t[e]&&c!==t[e]?.selectedTab?(d("general"),m&&m.setAttribute("data-sd-tab","general")):m&&m.setAttribute("data-sd-tab","general"),()=>{if(m){const e=m.querySelector(".sd-inspector-tabs-container");e&&null!==e||m.removeAttribute("data-sd-tab")}}},[]);const h=e=>{p(),d(e),!a&&m&&m.setAttribute("data-sd-tab",e);const n=l();(e=>{try{window.localStorage.setItem("sdEditorState",JSON.stringify(e))}catch(e){}})({sdSettingState:{...t,[n]:{selectedTab:e}}})};return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"sd-inspector-tabs-container",children:(0,T.jsxs)("div",{ref:u,className:M()("sd-inspector-tabs","sd-inspector-tabs-count-"+s.length,c),children:[s.indexOf(X)>-1&&(0,T.jsxs)("div",{className:M()({"sd-active":c===X}),onClick:()=>h(X),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(X)},role:"tab",tabIndex:0,"aria-selected":c===X,children:[(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"15",children:(0,T.jsx)("path",{fillRule:"nonzero",d:"M14.346 0H1.654C1.017 0 .5.517.5 1.154v12.692C.5 14.483 1.017 15 1.654 15h12.692c.637 0 1.154-.517 1.154-1.154V1.154C15.5.517 14.983 0 14.346 0zm-5.77 13.846v-5.77h5.77v5.77h-5.77z"})}),(0,T.jsx)("h5",{children:(0,E.__)("General","suredonation")})]}),s.indexOf(Z)>-1&&(0,T.jsxs)("div",{className:M()({"sd-active":c===Z}),onClick:()=>h(Z),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(Z)},role:"tab",tabIndex:0,"aria-selected":c===Z,children:[(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"21",children:(0,T.jsx)("g",{fillRule:"nonzero",children:(0,T.jsx)("path",{d:"M15.12 12.091a.814.814 0 00-.68-.378.814.814 0 00-.68.378c-.531.863-2.252 3.807-2.252 5.09 0 1.598 1.317 2.901 2.932 2.901s2.933-1.303 2.933-2.902c0-1.303-1.722-4.226-2.253-5.089zm-1.041 3.828c-.043.063-.744 1.198-.213 1.976a.52.52 0 01.064.358.409.409 0 01-.191.294.608.608 0 01-.255.084.476.476 0 01-.383-.21c-.871-1.283.149-2.902.192-2.986a.517.517 0 01.297-.21.534.534 0 01.361.063c.192.126.255.42.128.63zM13.314 10.388l1.36-.147c.446-.042.807-.337.935-.736.127-.4.042-.862-.276-1.157L7.258.294c-.255-.252-.68-.252-.957 0a.68.68 0 000 .947l.34.336-5.1 5.047C.82 7.339.5 8.348.67 9.379c.128.652.489 1.24.956 1.703l3.082 3.05c.467.462 1.062.82 1.72.946a3.134 3.134 0 002.785-.863l3.612-3.575a.74.74 0 01.489-.252zM7.576 2.502l5.759 5.7H2.073c.085-.232.212-.463.403-.653l5.1-5.047z"})})}),(0,T.jsx)("h5",{children:(0,E.__)("Style","suredonation")})]}),s.indexOf(J)>-1&&(0,T.jsxs)("div",{className:M()({"sd-active":c===J}),onClick:()=>h(J),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(J)},role:"tab",tabIndex:0,"aria-selected":c===J,children:[(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",children:(0,T.jsx)("path",{fillRule:"nonzero",d:"M15.666 6.325c-.277-.05-.572-.082-.85-.115a6.385 6.385 0 00-.571-1.389c.18-.229.343-.457.523-.686a.994.994 0 00-.098-1.291l-.997-.997a.994.994 0 00-1.291-.098c-.23.163-.458.343-.687.523a6.954 6.954 0 00-1.39-.589c-.032-.277-.08-.572-.113-.85A.987.987 0 009.21 0H7.805a1 1 0 00-.98.834c-.05.277-.082.572-.115.85-.474.13-.947.326-1.389.571-.229-.18-.457-.343-.686-.523a.994.994 0 00-1.291.098l-.997.997a.994.994 0 00-.098 1.291c.163.23.343.458.523.687a6.954 6.954 0 00-.589 1.39c-.277.032-.572.08-.85.113A.987.987 0 00.5 7.29v1.406a1 1 0 00.834.98c.277.05.572.082.85.115.13.474.326.947.571 1.389-.18.229-.343.457-.523.686a.994.994 0 00.098 1.291l.997.997a.994.994 0 001.291.098c.23-.163.458-.343.687-.523.441.245.899.442 1.39.589.032.294.08.572.113.85.066.473.49.833.981.833h1.406a1 1 0 00.98-.834c.05-.277.082-.572.115-.85.474-.13.947-.326 1.389-.571.229.18.457.343.686.523a.994.994 0 001.291-.098l.997-.997a.994.994 0 00.098-1.291 19.095 19.095 0 00-.523-.687c.245-.441.442-.899.589-1.39.277-.032.572-.08.85-.113a.987.987 0 00.833-.981V7.305a1 1 0 00-.834-.98zM8.492 11.57a3.571 3.571 0 01-3.563-3.563 3.571 3.571 0 013.563-3.563 3.571 3.571 0 013.563 3.563 3.571 3.571 0 01-3.563 3.563z"})}),(0,T.jsx)("h5",{children:(0,E.__)("Advanced","suredonation")})]})]})}),S.Children.map(o,(e,t)=>{if(!e)return e;if(!e.key)throw new Error("props.key not found in <InspectorTab />, you must use `key` prop");return(0,S.cloneElement)(e,{index:t,isActive:e.key===c})})]})},ee=({children:e,isActive:t,type:n})=>(0,T.jsx)("div",{style:{display:t?"block":"none"},className:`sd-inspector-tab sd-tab-content-${n}`,children:Array.isArray(e)?e.map(e=>e):e}),te={key:"style",type:"style"};(0,S.memo)(e=>{const{children:t,initialOpen:r=!0}=e,o=(0,S.useRef)(null),{getSelectedBlock:s}=(0,n.select)("core/block-editor"),i=s()?.name,a=((e=null)=>{try{const t=window.localStorage;if(e){const n=t.getItem("sdEditorState");return n?JSON.parse(n)?.[e]:null}return t}catch(e){return null}})("sdSettingState"),l=e?.title?e.title.toLowerCase().replace(/[^a-zA-Z ]/g,"").replace(/\s+/g,"-"):"",[c,d]=(0,S.useState)(()=>{const e=`${i}-${l}`,t=a?.panels?.[e];return void 0!==t?t:r});return(0,T.jsx)(R.PanelBody,{...e,initialOpen:c,onToggle:()=>{const e=!c;d(e);let t="general";o?.current?.parentElement?.classList.contains("sd-tab-content-general")?t="general":o?.current?.parentElement?.classList.contains("sd-tab-content-style")?t="style":o?.current?.parentElement?.classList.contains("sd-tab-content-advance")&&(t="advance");const n=`${i}-${l}`,r={...a,[i]:{...a?.[i],selectedPanel:`sd-advance-panel-body-${l}`,selectedTab:t},panels:{...a?.panels,[n]:e}};try{const e=JSON.parse(window.localStorage.getItem("sdEditorState")||"{}");window.localStorage.setItem("sdEditorState",JSON.stringify({...e,sdSettingState:r}))}catch(e){}},ref:o,className:`sd-advance-panel-body-${l}`,children:t})});var ne=o(4180),re={};ne.A&&ne.A.locals&&(re.locals=ne.A.locals);var oe,se=0,ie={attributes:{id:"suredonation-editor-styles"}};ie.setAttributes=B(),ie.insert=V().bind(null,"head"),ie.domAPI=O(),ie.insertStyleElement=W(),re.use=function(e){return ie.options=e||{},se++||(oe=I()(ne.A,ie)),re},re.unuse=function(){se>0&&! --se&&(oe(),oe=null)};var ae=o(4676),le={};ae.A&&ae.A.locals&&(le.locals=ae.A.locals);var ce,de=0,ue={attributes:{id:"suredonation-editor-styles"}};ue.setAttributes=B(),ue.insert=V().bind(null,"head"),ue.domAPI=O(),ue.insertStyleElement=W(),le.use=function(e){return ue.options=e||{},de++||(ce=I()(ae.A,ue)),le},le.unuse=function(){de>0&&! --de&&(ce(),ce=null)},R.__experimentalNumberControl;var me=o(9380),pe={};me.A&&me.A.locals&&(pe.locals=me.A.locals);var he,fe=0,ge={attributes:{id:"suredonation-editor-styles"}};ge.setAttributes=B(),ge.insert=V().bind(null,"head"),ge.domAPI=O(),ge.insertStyleElement=W(),pe.use=function(e){return ge.options=e||{},fe++||(he=I()(me.A,ge)),pe},pe.unuse=function(){fe>0&&! --fe&&(he(),he=null)};const ve="_suredonation_form_styling",be={bgType:"color",bgColor:"",bgGradient:"linear-gradient(90deg,#FFC9B2 0%,#C7CBFF 100%)",bgImage:"",bgImageId:0,bgImageSize:"cover",bgImagePosition:"center center",bgImageRepeat:"no-repeat",primaryColor:"#1293b6",textColor:"#1f2937",textOnPrimaryColor:"#ffffff",padding:{top:"",right:"",bottom:"",left:""},borderRadius:{top:"",right:"",bottom:"",left:""},fieldSpacing:"medium",buttonAlignment:"justify"},ye={small:{"--sd-row-gap-between-blocks":"16px","--sd-column-gap-between-blocks":"12px","--sd-col-gap-between-fields":"12px","--sd-input-height":"40px","--sd-input-field-padding":"10px 12px","--sd-input-field-font-size":"14px","--sd-input-field-line-height":"20px","--sd-input-field-margin-top":"4px","--sd-input-field-margin-bottom":"4px","--sd-label-font-size":"14px","--sd-label-line-height":"20px","--sd-description-font-size":"12px","--sd-description-line-height":"16px","--sd-btn-padding":"8px 14px","--sd-btn-font-size":"14px","--sd-btn-line-height":"20px","--sd-donation-amount-vertical-padding":"16px","--sd-donation-amount-internal-option-gap":"8px","--sd-donation-amount-outer-padding":"0","--sd-checkbox-size":"16px"},large:{"--sd-row-gap-between-blocks":"20px","--sd-column-gap-between-blocks":"16px","--sd-col-gap-between-fields":"16px","--sd-input-height":"48px","--sd-input-field-padding":"10px 14px","--sd-input-field-font-size":"18px","--sd-input-field-line-height":"28px","--sd-input-field-margin-top":"8px","--sd-input-field-margin-bottom":"8px","--sd-label-font-size":"18px","--sd-label-line-height":"28px","--sd-description-font-size":"16px","--sd-description-line-height":"24px","--sd-btn-padding":"10px 14px","--sd-btn-font-size":"18px","--sd-btn-line-height":"28px","--sd-donation-amount-vertical-padding":"24px","--sd-donation-amount-internal-option-gap":"12px","--sd-donation-amount-outer-padding":"4px","--sd-checkbox-size":"20px"}},xe={left:"flex-start",center:"center",right:"flex-end",justify:"stretch"},we=e=>{let t={};const n=e?.[ve];if(n)try{t=JSON.parse(n)||{}}catch(e){t={}}return{...be,...t,padding:{...be.padding,...t.padding||{}},borderRadius:{...be.borderRadius,...t.borderRadius||{}}}},ke=e=>{const t={};return Object.keys(be).forEach(n=>{const r=be[n],o=e[n];r&&"object"==typeof r?Object.keys(r).some(e=>(o?.[e]??"")!==r[e])&&(t[n]=o):o!==r&&(t[n]=o)}),t},je=e=>{let t=!1;const n=["top","right","bottom","left"].map(n=>{const r=e?.[n];if(r&&""!==String(r).trim()){t=!0;const e=String(r).trim();return/^-?\d*\.?\d+$/.test(e)?`${e}px`:e}return"0"});return t?n.join(" "):""},Ce=({label:e,value:t,onChange:n})=>(0,T.jsx)(R.BaseControl,{__nextHasNoMarginBottom:!0,className:"sd-styles-color",children:(0,T.jsxs)(R.Flex,{justify:"space-between",align:"center",children:[(0,T.jsx)(R.FlexItem,{children:(0,T.jsx)("span",{className:"sd-styles-color__label",children:e})}),(0,T.jsx)(R.FlexItem,{children:(0,T.jsx)(R.Dropdown,{popoverProps:{placement:"left-start"},renderToggle:({isOpen:n,onToggle:r})=>(0,T.jsx)(R.Button,{onClick:r,"aria-expanded":n,"aria-label":e,className:"sd-styles-color__swatch",style:{background:t||"transparent"}}),renderContent:()=>(0,T.jsxs)("div",{className:"sd-styles-color__picker",children:[(0,T.jsx)(R.ColorPicker,{color:t,onChange:n,enableAlpha:!0}),(0,T.jsx)(R.Button,{variant:"tertiary",size:"small",onClick:()=>n(""),children:(0,E.__)("Clear","suredonation")})]})})})]})}),Se=()=>{const e=(0,n.useSelect)(e=>e(C.store).getEditedPostAttribute("meta"),[]),{editPost:t}=(0,n.useDispatch)(C.store),r=(0,S.useMemo)(()=>we(e),[e]),o=e=>{const n={...r,...e};t({meta:{[ve]:JSON.stringify(ke(n))}})},s=e=>{if(null==e)return"";const t=String(e).trim();return""===t?"":/^-?\d*\.?\d+$/.test(t)?`${t}px`:t},i=e=>({top:s(e?.top),right:s(e?.right),bottom:s(e?.bottom),left:s(e?.left)}),a=e=>({top:e?.top||void 0,right:e?.right||void 0,bottom:e?.bottom||void 0,left:e?.left||void 0});return(0,T.jsx)(Q,{tabs:["style"],defaultTab:"style",stateKey:"sd-form-styles",children:(0,T.jsxs)(ee,{...te,children:[(0,T.jsxs)(R.PanelBody,{title:(0,E.__)("Colors","suredonation"),className:"sd-single-form-settings-style-section",children:[(0,T.jsx)(Ce,{label:(0,E.__)("Primary color","suredonation"),value:r.primaryColor,onChange:e=>o({primaryColor:e})}),(0,T.jsx)(Ce,{label:(0,E.__)("Text color","suredonation"),value:r.textColor,onChange:e=>o({textColor:e})}),(0,T.jsx)(Ce,{label:(0,E.__)("Text color on primary","suredonation"),value:r.textOnPrimaryColor,onChange:e=>o({textOnPrimaryColor:e})})]}),(0,T.jsxs)(R.PanelBody,{title:(0,E.__)("Background","suredonation"),initialOpen:!1,className:"sd-single-form-settings-style-section",children:[(0,T.jsx)(R.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Background type","suredonation"),value:r.bgType,options:[{label:(0,E.__)("Solid","suredonation"),value:"color"},{label:(0,E.__)("Gradient","suredonation"),value:"gradient"},{label:(0,E.__)("Image","suredonation"),value:"image"}],onChange:e=>o({bgType:e})}),"color"===r.bgType&&(0,T.jsx)(Ce,{label:(0,E.__)("Background color","suredonation"),value:r.bgColor,onChange:e=>o({bgColor:e})}),"gradient"===r.bgType&&(0,T.jsx)(R.GradientPicker,{__nextHasNoMargin:!0,value:r.bgGradient,gradients:[],onChange:e=>o({bgGradient:e||""})}),"image"===r.bgType&&(0,T.jsx)(_.MediaUploadCheck,{children:(0,T.jsx)(_.MediaUpload,{allowedTypes:["image"],value:r.bgImageId,onSelect:e=>o({bgImage:e.url,bgImageId:e.id}),render:({open:e})=>(0,T.jsxs)("div",{className:"sd-styles-image",children:[r.bgImage?(0,T.jsx)("img",{src:r.bgImage,alt:"",className:"sd-styles-image__preview"}):null,(0,T.jsxs)(R.Flex,{justify:"flex-start",children:[(0,T.jsx)(R.Button,{variant:"secondary",onClick:e,children:r.bgImage?(0,E.__)("Replace","suredonation"):(0,E.__)("Select image","suredonation")}),r.bgImage?(0,T.jsx)(R.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>o({bgImage:"",bgImageId:0}),children:(0,E.__)("Remove","suredonation")}):null]}),r.bgImage?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(R.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Size","suredonation"),value:r.bgImageSize,options:[{label:"Cover",value:"cover"},{label:"Contain",value:"contain"},{label:"Auto",value:"auto"}],onChange:e=>o({bgImageSize:e})}),(0,T.jsx)(R.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Repeat","suredonation"),value:r.bgImageRepeat,options:[{label:"No repeat",value:"no-repeat"},{label:"Repeat",value:"repeat"}],onChange:e=>o({bgImageRepeat:e})})]}):null]})})})]}),(0,T.jsxs)(R.PanelBody,{title:(0,E.__)("Layout","suredonation"),initialOpen:!1,className:"sd-single-form-settings-style-section",children:[(0,T.jsx)(R.__experimentalBoxControl,{label:(0,E.__)("Padding","suredonation"),values:a(r.padding),onChange:e=>o({padding:i(e)})}),(0,T.jsx)(R.__experimentalBoxControl,{label:(0,E.__)("Border radius","suredonation"),values:a(r.borderRadius),onChange:e=>o({borderRadius:i(e)})})]}),(0,T.jsx)(R.PanelBody,{title:(0,E.__)("Fields","suredonation"),initialOpen:!1,className:"sd-single-form-settings-style-section",children:(0,T.jsx)(R.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Field spacing","suredonation"),value:r.fieldSpacing,options:[{label:(0,E.__)("Small","suredonation"),value:"small"},{label:(0,E.__)("Medium","suredonation"),value:"medium"},{label:(0,E.__)("Large","suredonation"),value:"large"}],onChange:e=>o({fieldSpacing:e})})}),(0,T.jsx)(R.PanelBody,{title:(0,E.__)("Button","suredonation"),initialOpen:!1,className:"sd-single-form-settings-style-section",children:(0,T.jsx)(R.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Button alignment","suredonation"),value:r.buttonAlignment,options:[{label:(0,E.__)("Left","suredonation"),value:"left"},{label:(0,E.__)("Center","suredonation"),value:"center"},{label:(0,E.__)("Right","suredonation"),value:"right"},{label:(0,E.__)("Full width","suredonation"),value:"justify"}],onChange:e=>o({buttonAlignment:e})})})]})})},Ee="sd-form-style-preview",Te=()=>{const e=[],t=document.querySelector('iframe[name="editor-canvas"]');return t&&t.contentDocument&&e.push(t.contentDocument),e.push(document),e},Pe=()=>{const{meta:e,deviceType:t}=(0,n.useSelect)(e=>{const t=e(C.store);return{meta:t.getEditedPostAttribute("meta"),deviceType:"function"==typeof t.getDeviceType?t.getDeviceType():null}},[]),r=(0,S.useCallback)(()=>{const t=`.editor-styles-wrapper{${(e=>{const t={};e.primaryColor&&(t["--sd-color-scheme-primary"]=e.primaryColor),e.textColor&&(t["--sd-color-input-text"]=e.textColor,t["--sd-color-input-label"]=e.textColor),e.textOnPrimaryColor&&(t["--sd-btn-text-color"]=e.textOnPrimaryColor);const n=(e=>"gradient"===e.bgType?e.bgGradient||"":"image"===e.bgType?e.bgImage?`url('${e.bgImage}') ${e.bgImagePosition} / ${e.bgImageSize} ${e.bgImageRepeat}`:"":e.bgColor||"")(e);n&&(t["--sd-form-background"]=n);const r=je(e.padding);r&&(t["--sd-form-padding"]=r);const o=je(e.borderRadius);return o&&(t["--sd-form-border-radius"]=o),"medium"!==e.fieldSpacing&&ye[e.fieldSpacing]&&Object.assign(t,ye[e.fieldSpacing]),t["--sd-btn-align-items"]=xe[e.buttonAlignment]||"stretch",t["--sd-btn-width"]="justify"===e.buttonAlignment?"100%":"auto",Object.entries(t).map(([e,t])=>`${e}:${t}`).join(";")})(we(e))}}`;Te().forEach(e=>{if(!e||!e.head)return;let n=e.getElementById(Ee);n||(n=e.createElement("style"),n.id=Ee,e.head.appendChild(n)),n.textContent=t})},[e]);return(0,S.useEffect)(()=>{r()},[r]),(0,S.useEffect)(()=>{const e=window.requestAnimationFrame(()=>r());return()=>window.cancelAnimationFrame(e)},[t]),(0,S.useEffect)(()=>()=>{Te().forEach(e=>{const t=e&&e.getElementById(Ee);t&&t.remove()})},[]),null};(0,j.registerPlugin)("sd-form-editor",{render:()=>(0,T.jsxs)(S.Fragment,{children:[(0,T.jsx)(C.PluginDocumentSettingPanel,{name:"sd-description",className:"sd-single-form-settings-description",title:(0,E.__)("SureDonation Description","suredonation"),children:(0,T.jsx)(N,{})}),(0,T.jsx)(C.PluginDocumentSettingPanel,{name:"sd-form-styles",className:"sd-single-form-settings-styles",title:(0,E.__)("Styles","suredonation"),children:(0,T.jsx)(Se,{})}),(0,T.jsx)(Pe,{})]}),icon:null});const{select:Ne,dispatch:_e}=wp.data,Re=window.React;var Ae=o.t(Re,2);const Me=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Le=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ie={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 De=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},Oe=(0,Re.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>(0,Re.createElement)("svg",{ref:l,...Ie,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Me("lucide",o),...!s&&!De(a)&&{"aria-hidden":"true"},...a},[...i.map(([e,t])=>(0,Re.createElement)(e,t)),...Array.isArray(s)?s:[s]])),Fe=(e,t)=>{const n=(0,Re.forwardRef)(({className:n,...r},o)=>{return(0,Re.createElement)(Oe,{ref:o,iconNode:t,className:Me(`lucide-${s=Le(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var s});return n.displayName=Le(e),n},Ve=Fe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),ze=window.wp.hooks,Be=Fe("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),$e=Fe("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),We=window.wp.apiFetch;var Ue=o.n(We);const He=window.wp.url;let qe=1;const Ke=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 s="number"==typeof t?t:qe++;return this.#e.find(e=>e.id===s)&&(this.#e=this.#e.map(e=>e.id===s?(this.publish({...e,title:n,jsx:r,...o}),{...e,title:n,jsx:r,...o}):e)),this.add({id:s,title:n,jsx:r,...o}),s}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})}},Ge=Object.seal(Object.assign((e,t)=>Ke.default(e,t),{success:Ke.success.bind(Ke),error:Ke.error.bind(Ke),warning:Ke.warning.bind(Ke),info:Ke.info.bind(Ke),custom:Ke.custom.bind(Ke),dismiss:Ke.dismiss.bind(Ke),update:Ke.update.bind(Ke)},{getHistory:Ke.history.bind(Ke)})),Ye=e=>{const t=Qe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Xe(n,t)||Je(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},Xe=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Xe(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const s=e.join("-");return t.validators.find(({validator:e})=>e(s))?.classGroupId},Ze=/^\[(.+)\]$/,Je=e=>{if(Ze.test(e)){const t=Ze.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Qe=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return rt(Object.entries(e.classGroups),n).forEach(([e,n])=>{et(n,r,e,t)}),r},et=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?nt(e)?void et(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,o])=>{et(o,tt(t,e),n,r)});(""===e?t:tt(t,e)).classGroupId=n})},tt=(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},nt=e=>e.isThemeGetter,rt=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,ot=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,s)=>{n.set(o,s),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)}}},st=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],s=t.length,i=e=>{const n=[];let i,a=0,l=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===a){if(d===o&&(r||e.slice(c,c+s)===t)){n.push(e.slice(l,c)),l=c+s;continue}if("/"===d){i=c;continue}}"["===d?a++:"]"===d&&a--}const c=0===n.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:n,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return n?e=>n({className:e,parseClassName:i}):i},it=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},at=/\s+/;function lt(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=ct(e))&&(r&&(r+=" "),r+=t);return r}const ct=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ct(e[r]))&&(n&&(n+=" "),n+=t);return n};function dt(e,...t){let n,r,o,s=function(a){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:ot(e.cacheSize),parseClassName:st(e),...Ye(e)}))(l),r=n.cache.get,o=n.cache.set,s=i,i(a)};function i(e){const t=r(e);if(t)return t;const s=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(at);let a="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=n(t);let m=Boolean(u),p=r(m?d.substring(0,u):d);if(!p){if(!m){a=t+(a.length>0?" "+a:a);continue}if(p=r(d),!p){a=t+(a.length>0?" "+a:a);continue}m=!1}const h=it(l).join(":"),f=c?h+"!":h,g=f+p;if(s.includes(g))continue;s.push(g);const v=o(p,m);for(let e=0;e<v.length;++e){const t=v[e];s.push(f+t)}a=t+(a.length>0?" "+a:a)}return a})(e,n);return o(e,s),s}return function(){return s(lt.apply(null,arguments))}}const ut=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},mt=/^\[(?:([a-z-]+):)?(.+)\]$/i,pt=/^\d+\/\d+$/,ht=new Set(["px","full","screen"]),ft=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gt=/\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$/,vt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>kt(e)||ht.has(e)||pt.test(e),wt=e=>It(e,"length",Dt),kt=e=>Boolean(e)&&!Number.isNaN(Number(e)),jt=e=>It(e,"number",kt),Ct=e=>Boolean(e)&&Number.isInteger(Number(e)),St=e=>e.endsWith("%")&&kt(e.slice(0,-1)),Et=e=>mt.test(e),Tt=e=>ft.test(e),Pt=new Set(["length","size","percentage"]),Nt=e=>It(e,Pt,Ot),_t=e=>It(e,"position",Ot),Rt=new Set(["image","url"]),At=e=>It(e,Rt,Vt),Mt=e=>It(e,"",Ft),Lt=()=>!0,It=(e,t,n)=>{const r=mt.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},Dt=e=>gt.test(e)&&!vt.test(e),Ot=()=>!1,Ft=e=>bt.test(e),Vt=e=>yt.test(e),zt=(Symbol.toStringTag,()=>{const e=ut("colors"),t=ut("spacing"),n=ut("blur"),r=ut("brightness"),o=ut("borderColor"),s=ut("borderRadius"),i=ut("borderSpacing"),a=ut("borderWidth"),l=ut("contrast"),c=ut("grayscale"),d=ut("hueRotate"),u=ut("invert"),m=ut("gap"),p=ut("gradientColorStops"),h=ut("gradientColorStopPositions"),f=ut("inset"),g=ut("margin"),v=ut("opacity"),b=ut("padding"),y=ut("saturate"),x=ut("scale"),w=ut("sepia"),k=ut("skew"),j=ut("space"),C=ut("translate"),S=()=>["auto",Et,t],E=()=>[Et,t],T=()=>["",xt,wt],P=()=>["auto",kt,Et],N=()=>["","0",Et],_=()=>[kt,Et];return{cacheSize:500,separator:":",theme:{colors:[Lt],spacing:[xt,wt],blur:["none","",Tt,Et],brightness:_(),borderColor:[e],borderRadius:["none","","full",Tt,Et],borderSpacing:E(),borderWidth:T(),contrast:_(),grayscale:N(),hueRotate:_(),invert:N(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[St,wt],inset:S(),margin:S(),opacity:_(),padding:E(),saturate:_(),scale:_(),sepia:N(),skew:_(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Et]}],container:["container"],columns:[{columns:[Tt]}],"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",Et]}],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:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ct,Et]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Et]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",Ct,Et]}],"grid-cols":[{"grid-cols":[Lt]}],"col-start-end":[{col:["auto",{span:["full",Ct,Et]},Et]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Lt]}],"row-start-end":[{row:["auto",{span:[Ct,Et]},Et]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Et]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Et]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"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:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Et,t]}],"min-w":[{"min-w":[Et,t,"min","max","fit"]}],"max-w":[{"max-w":[Et,t,"none","full","min","max","fit","prose",{screen:[Tt]},Tt]}],h:[{h:[Et,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Et,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Et,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Et,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Tt,wt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jt]}],"font-family":[{font:[Lt]}],"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",Et]}],"line-clamp":[{"line-clamp":["none",kt,jt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xt,Et]}],"list-image":[{"list-image":["none",Et]}],"list-style-type":[{list:["none","disc","decimal",Et]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xt,wt]}],"underline-offset":[{"underline-offset":["auto",xt,Et]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Et]}],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",Et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",_t]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Nt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},At]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"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":[xt,Et]}],"outline-w":[{outline:[xt,wt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[xt,wt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tt,Mt]}],"shadow-color":[{shadow:[Lt]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Tt,Et]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[y]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"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",Et]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",Et]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",Et]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Ct,Et]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Et]}],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",Et]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",Et]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[xt,wt,jt]}],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"]}}}),Bt=dt(zt);function $t(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=$t(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Wt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=$t(e))&&(r&&(r+=" "),r+=t);return r}const Ut=(...e)=>Bt(Wt(...e)),Ht=(...e)=>(...t)=>e.filter(Boolean).forEach(e=>e?.(...t)),qt={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"},Kt=(0,Re.forwardRef)(({children:e=null,tag:t="label",size:n="sm",className:r="",variant:o="neutral",required:s=!1,...i},a)=>{if(!e)return null;let l="";return s&&(l="after:content-['*'] after:text-field-required after:ml-0.5"),(0,T.jsx)(t,{ref:a,className:Ut("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})});Kt.displayName="Label";const Gt=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");var Yt={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 Xt=(0,Re.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>(0,Re.createElement)("svg",{ref:l,...Yt,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Gt("lucide",o),...a},[...i.map(([e,t])=>(0,Re.createElement)(e,t)),...Array.isArray(s)?s:[s]])),Zt=(e,t)=>{const n=(0,Re.forwardRef)(({className:n,...r},o)=>{return(0,Re.createElement)(Xt,{ref:o,iconNode:t,className:Gt(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var s});return n.displayName=`${e}`,n},Jt=Zt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Qt=Zt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),en=Zt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),tn=Zt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function nn(){return"undefined"!=typeof window}function rn(e){return an(e)?(e.nodeName||"").toLowerCase():"#document"}function on(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function sn(e){var t;return null==(t=(an(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function an(e){return!!nn()&&(e instanceof Node||e instanceof on(e).Node)}function ln(e){return!!nn()&&(e instanceof Element||e instanceof on(e).Element)}function cn(e){return!!nn()&&(e instanceof HTMLElement||e instanceof on(e).HTMLElement)}function dn(e){return!(!nn()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof on(e).ShadowRoot)}function un(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=wn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function mn(e){return/^(table|td|th)$/.test(rn(e))}function pn(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const hn=/transform|translate|scale|rotate|perspective|filter/,fn=/paint|layout|strict|content/,gn=e=>!!e&&"none"!==e;let vn;function bn(e){const t=ln(e)?wn(e):e;return gn(t.transform)||gn(t.translate)||gn(t.scale)||gn(t.rotate)||gn(t.perspective)||!yn()&&(gn(t.backdropFilter)||gn(t.filter))||hn.test(t.willChange||"")||fn.test(t.contain||"")}function yn(){return null==vn&&(vn="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vn}function xn(e){return/^(html|body|#document)$/.test(rn(e))}function wn(e){return on(e).getComputedStyle(e)}function kn(e){return ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jn(e){if("html"===rn(e))return e;const t=e.assignedSlot||e.parentNode||dn(e)&&e.host||sn(e);return dn(t)?t.host:t}function Cn(e){const t=jn(e);return xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:cn(t)&&un(t)?t:Cn(t)}function Sn(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Cn(e),s=o===(null==(r=e.ownerDocument)?void 0:r.body),i=on(o);if(s){const e=En(i);return t.concat(i,i.visualViewport||[],un(o)?o:[],e&&n?Sn(e):[])}return t.concat(o,Sn(o,[],n))}function En(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tn(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 Pn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&dn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Nn(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Rn(){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 An(e){return!(0!==e.mozInputSource||!e.isTrusted)||(In()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Mn(e){return!Rn().includes("jsdom/")&&(!In()&&0===e.width&&0===e.height||In()&&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 Ln(){return/apple/i.test(navigator.vendor)}function In(){const e=/android/i;return e.test(Nn())||e.test(Rn())}function Dn(){return Nn().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function On(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Fn(e){return(null==e?void 0:e.ownerDocument)||document}function Vn(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 zn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Bn(e){return cn(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function $n(e){e.preventDefault(),e.stopPropagation()}function Wn(e){return!!e&&"combobox"===e.getAttribute("role")&&Bn(e)}const Un=Math.min,Hn=Math.max,qn=Math.round,Kn=Math.floor,Gn=e=>({x:e,y:e}),Yn={left:"right",right:"left",bottom:"top",top:"bottom"};function Xn(e,t,n){return Hn(e,Un(t,n))}function Zn(e,t){return"function"==typeof e?e(t):e}function Jn(e){return e.split("-")[0]}function Qn(e){return e.split("-")[1]}function er(e){return"x"===e?"y":"x"}function tr(e){return"y"===e?"height":"width"}function nr(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function rr(e){return er(nr(e))}function or(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const sr=["left","right"],ir=["right","left"],ar=["top","bottom"],lr=["bottom","top"];function cr(e){const t=Jn(e);return Yn[t]+e.slice(t.length)}function dr(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 ur(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 mr=["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(","),pr="undefined"==typeof Element,hr=pr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fr=!pr&&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},gr=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]"):gr(e.parentNode))},vr=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var s=o.shift();if(!gr(s,!1))if("SLOT"===s.tagName){var i=s.assignedElements(),a=i.length?i:s.children,l=vr(a,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:s,candidates:l})}else{hr.call(s,mr)&&n.filter(s)&&(t||!e.includes(s))&&r.push(s);var c=s.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(s),d=!gr(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(c&&d){var u=vr(!0===c?s.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else o.unshift.apply(o,s.children)}}return r},br=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},yr=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))&&!br(e)?0:e.tabIndex},xr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},wr=function(e){return"INPUT"===e.tagName},kr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},jr=function(e,t){return!(t.disabled||function(e){return wr(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=hr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(hr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return kr(e)}else{if("function"==typeof r){for(var s=e;e;){var i=e.parentElement,a=fr(e);if(i&&!i.shadowRoot&&!0===r(i))return kr(e);e=e.assignedSlot?e.assignedSlot:i||a===e.ownerDocument?i:a.host}e=s}if(function(e){var t,n,r,o,s=e&&fr(e),i=null===(t=s)||void 0===t?void 0:t.host,a=!1;if(s&&s!==e)for(a=!!(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));!a&&i;){var l,c,d;a=!(null===(c=i=null===(l=s=fr(i))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(i))}return a}(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!!hr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Cr=function(e,t){return!(function(e){return function(e){return wr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||fr(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)||yr(t)<0||!jr(e,t))},Sr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Er=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,s=o?e.scopeParent:e,i=function(e,t){var n=yr(e);return n<0&&t&&!br(e)?0:n}(s,o),a=o?Er(e.candidates):s;0===i?o?t.push.apply(t,a):t.push(s):n.push({documentOrder:r,tabIndex:i,item:e,isScope:o,content:a})}),n.sort(xr).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Tr=function(e,t){var n;return n=(t=t||{}).getShadowRoot?vr([e],t.includeContainer,{filter:Cr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Sr}):function(e,t,n){if(gr(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(mr));return t&&hr.call(e,mr)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Cr.bind(null,t)),Er(n)};const Pr=window.ReactDOM;function Nr(e,t,n){let{reference:r,floating:o}=e;const s=nr(t),i=rr(t),a=tr(i),l=Jn(t),c="y"===s,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Qn(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1)}return p}async function _r(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:p=0}=Zn(t,e),h=dr(p),f=a[m?"floating"===u?"reference":"floating":u],g=ur(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(f)))||n?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v="floating"===u?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),y=await(null==s.isElement?void 0:s.isElement(b))&&await(null==s.getScale?void 0:s.getScale(b))||{x:1,y:1},x=ur(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-x.top+h.top)/y.y,bottom:(x.bottom-g.bottom+h.bottom)/y.y,left:(g.left-x.left+h.left)/y.x,right:(x.right-g.right+h.right)/y.x}}const Rr=new Set(["left","top"]);function Ar(e){const t=wn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=cn(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=qn(n)!==s||qn(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Mr(e){return ln(e)?e:e.contextElement}function Lr(e){const t=Mr(e);if(!cn(t))return Gn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Ar(t);let i=(s?qn(n.width):n.width)/r,a=(s?qn(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Ir=Gn(0);function Dr(e){const t=on(e);return yn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ir}function Or(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),s=Mr(e);let i=Gn(1);t&&(r?ln(r)&&(i=Lr(r)):i=Lr(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==on(e))&&t}(s,n,r)?Dr(s):Gn(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(s){const e=on(s),t=r&&ln(r)?on(r):r;let n=e,o=En(n);for(;o&&r&&t!==n;){const e=Lr(o),t=o.getBoundingClientRect(),r=wn(o),s=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,d*=e.x,u*=e.y,l+=s,c+=i,n=on(o),o=En(n)}}return ur({width:d,height:u,x:l,y:c})}function Fr(e,t){const n=kn(e).scrollLeft;return t?t.left+n:Or(sn(e)).left+n}function Vr(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Fr(e,n),y:n.top+t.scrollTop}}function zr(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=on(e),r=sn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const e=yn();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}const c=Fr(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&&(s-=i)}else c<=25&&(s+=c);return{width:s,height:i,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=sn(e),n=kn(e),r=e.ownerDocument.body,o=Hn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Hn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Fr(e);const a=-n.scrollTop;return"rtl"===wn(r).direction&&(i+=Hn(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}(sn(e));else if(ln(t))r=function(e,t){const n=Or(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=cn(e)?Lr(e):Gn(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:o*s.x,y:r*s.y}}(t,n);else{const n=Dr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ur(r)}function Br(e,t){const n=jn(e);return!(n===t||!ln(n)||xn(n))&&("fixed"===wn(n).position||Br(n,t))}function $r(e,t,n){const r=cn(t),o=sn(t),s="fixed"===n,i=Or(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Gn(0);function c(){l.x=Fr(o)}if(r||!r&&!s)if(("body"!==rn(t)||un(o))&&(a=kn(t)),r){const e=Or(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=!o||r||s?Gn(0):Vr(o,a);return{x:i.left+a.scrollLeft-l.x-d.x,y:i.top+a.scrollTop-l.y-d.y,width:i.width,height:i.height}}function Wr(e){return"static"===wn(e).position}function Ur(e,t){if(!cn(e)||"fixed"===wn(e).position)return null;if(t)return t(e);let n=e.offsetParent;return sn(e)===n&&(n=n.ownerDocument.body),n}function Hr(e,t){const n=on(e);if(pn(e))return n;if(!cn(e)){let t=jn(e);for(;t&&!xn(t);){if(ln(t)&&!Wr(t))return t;t=jn(t)}return n}let r=Ur(e,t);for(;r&&mn(r)&&Wr(r);)r=Ur(r,t);return r&&xn(r)&&Wr(r)&&!bn(r)?n:r||function(e){let t=jn(e);for(;cn(t)&&!xn(t);){if(bn(t))return t;if(pn(t))return null;t=jn(t)}return null}(e)||n}const qr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s="fixed"===o,i=sn(r),a=!!t&&pn(t.floating);if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Gn(1);const d=Gn(0),u=cn(r);if((u||!u&&!s)&&(("body"!==rn(r)||un(i))&&(l=kn(r)),u)){const e=Or(r);c=Lr(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const m=!i||u||s?Gn(0):Vr(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-l.scrollTop*c.y+d.y+m.y}},getDocumentElement:sn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[..."clippingAncestors"===n?pn(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Sn(e,[],!1).filter(e=>ln(e)&&"body"!==rn(e)),o=null;const s="fixed"===wn(e).position;let i=s?jn(e):e;for(;ln(i)&&!xn(i);){const t=wn(i),n=bn(i);n||"fixed"!==t.position||(o=null),(s?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||un(i)&&!n&&Br(e,i))?r=r.filter(e=>e!==i):o=t,i=jn(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=zr(t,s[0],o);let a=i.top,l=i.right,c=i.bottom,d=i.left;for(let e=1;e<s.length;e++){const n=zr(t,s[e],o);a=Hn(n.top,a),l=Un(n.right,l),c=Un(n.bottom,c),d=Hn(n.left,d)}return{width:l-d,height:c-a,x:d,y:a}},getOffsetParent:Hr,getElementRects:async function(e){const t=this.getOffsetParent||Hr,n=this.getDimensions,r=await n(e.floating);return{reference:$r(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}=Ar(e);return{width:t,height:n}},getScale:Lr,isElement:ln,isRTL:function(e){return"rtl"===wn(e).direction}};function Kr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Mr(e),d=o||s?[...c?Sn(c):[],...t?Sn(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});const u=c&&a?function(e,t){let n,r=null;const o=sn(e);function s(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:m,height:p}=c;if(a||t(),!m||!p)return;const h={rootMargin:-Kn(u)+"px "+-Kn(o.clientWidth-(d+m))+"px "+-Kn(o.clientHeight-(u+p))+"px "+-Kn(d)+"px",threshold:Hn(0,Un(1,l))||1};let f=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!f)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||Kr(c,e.getBoundingClientRect())||i(),f=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),s}(c,n):null;let m,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let f=l?Or(e):null;return l&&function t(){const r=Or(e);f&&!Kr(f,r)&&n(),f=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const Yr=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=Zn(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const v=Jn(o),b=nr(a),y=Jn(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=m||(y||!f?[cr(a)]:function(e){const t=cr(e);return[or(e),t,or(t)]}(a)),k="none"!==h;!m&&k&&w.push(...function(e,t,n,r){const o=Qn(e);let s=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ir:sr:t?sr:ir;case"left":case"right":return t?ar:lr;default:return[]}}(Jn(e),"start"===n,r);return o&&(s=s.map(e=>e+"-"+o),t&&(s=s.concat(s.map(or)))),s}(a,f,h,x));const j=[a,...w],C=await l.detectOverflow(t,g),S=[];let E=(null==(r=s.flip)?void 0:r.overflows)||[];if(d&&S.push(C[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=Qn(e),o=rr(e),s=tr(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=cr(i)),[i,cr(i)]}(o,i,x);S.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:o,overflows:S}],!S.every(e=>e<=0)){var T,P;const e=((null==(T=s.flip)?void 0:T.index)||0)+1,t=j[e];if(t&&("alignment"!==u||b===nr(t)||E.every(e=>nr(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(P=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var N;const e=null==(N=E.filter(e=>{if(k){const t=nr(e.placement);return t===b||"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:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Xr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Zn(e,t)||{};if(null==c)return{};const u=dr(d),m={x:n,y:r},p=rr(o),h=tr(p),f=await i.getDimensions(c),g="y"===p,v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=s.reference[h]+s.reference[p]-m[p]-s.floating[h],w=m[p]-s.reference[p],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let j=k?k[y]:0;j&&await(null==i.isElement?void 0:i.isElement(k))||(j=a.floating[y]||s.floating[h]);const C=x/2-w/2,S=j/2-f[h]/2-1,E=Un(u[v],S),T=Un(u[b],S),P=E,N=j-f[h]-T,_=j/2-f[h]/2+C,R=Xn(P,_,N),A=!l.arrow&&null!=Qn(o)&&_!==R&&s.reference[h]/2-(_<P?E:T)-f[h]/2<0,M=A?_<P?_-P:_-N:0;return{[p]:m[p]+M,data:{[p]:R,centerOffset:_-R-M,...A&&{alignmentOffset:M}},reset:A}}}),Zr=(e,t,n)=>{const r=new Map,o={platform:qr,...n},s={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:_r},l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Nr(c,r,l),m=r,p=0;const h={};for(let n=0;n<s.length;n++){const f=s[n];if(!f)continue;const{name:g,fn:v}=f,{x:b,y,data:x,reset:w}=await v({x:d,y:u,initialPlacement:r,placement:m,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=y?y:u,h[g]={...h[g],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(m=w.placement),w.rects&&(c=!0===w.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:d,y:u}=Nr(c,m,l))),n=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:h}})(e,t,{...o,platform:s})};var Jr="undefined"!=typeof document?Re.useLayoutEffect:function(){};function Qr(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(!Qr(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||Qr(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function eo(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function to(e,t){const n=eo(e);return Math.round(t*n)/n}function no(e){const t=Re.useRef(e);return Jr(()=>{t.current=e}),t}const ro=(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:s,placement:i,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,s=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=Jn(n),a=Qn(n),l="y"===nr(n),c=Rr.has(i)?-1:1,d=s&&l?-1:1,u=Zn(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),l?{x:p*d,y:m*c}:{x:m*c,y:p*d}}(t,e);return i===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},oo=(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:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Zn(e,t),d={x:n,y:r},u=await s.detectOverflow(t,c),m=nr(Jn(o)),p=er(m);let h=d[p],f=d[m];if(i){const e="y"===p?"bottom":"right";h=Xn(h+u["y"===p?"top":"left"],h,h-u[e])}if(a){const e="y"===m?"bottom":"right";f=Xn(f+u["y"===m?"top":"left"],f,f-u[e])}const g=l.fn({...t,[p]:h,[m]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[m]:a}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},so=(e,t)=>{const n=Yr(e);return{name:n.name,fn:n.fn,options:[e,t]}},io=(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:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Zn(e,t),d=await i.detectOverflow(t,c),u=Jn(o),m=Qn(o),p="y"===nr(o),{width:h,height:f}=s.floating;let g,v;"top"===u||"bottom"===u?(g=u,v=m===(await(null==i.isRTL?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=u,g="end"===m?"top":"bottom");const b=f-d.top-d.bottom,y=h-d.left-d.right,x=Un(f-d[g],b),w=Un(h-d[v],y),k=!t.middlewareData.shift;let j=x,C=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(j=b),k&&!m){const e=Hn(d.left,0),t=Hn(d.right,0),n=Hn(d.top,0),r=Hn(d.bottom,0);p?C=h-2*(0!==e||0!==t?e+t:Hn(d.left,d.right)):j=f-2*(0!==n||0!==r?n+r:Hn(d.top,d.bottom))}await l({...t,availableWidth:C,availableHeight:j});const S=await i.getDimensions(a.floating);return h!==S.width||f!==S.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},ao=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Xr({element:n.current,padding:r}).fn(t):{}:n?Xr({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}},lo={...Ae},co=lo.useInsertionEffect||(e=>e());function uo(e){const t=Re.useRef(()=>{});return co(()=>{t.current=e}),Re.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 mo="ArrowUp",po="ArrowDown",ho="ArrowLeft",fo="ArrowRight";function go(e,t,n){return Math.floor(e/t)!==n}function vo(e,t){return t<0||t>=e.current.length}function bo(e,t){return xo(e,{disabledIndices:t})}function yo(e,t){return xo(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function xo(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:s=1}=void 0===t?{}:t;const i=e.current;let a=n;do{a+=r?-s:s}while(a>=0&&a<=i.length-1&&jo(i,a,o));return a}function wo(e,t,n,r,o){if(-1===e)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e)}}function ko(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function jo(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 Co="undefined"!=typeof document?Re.useLayoutEffect:Re.useEffect;function So(){return So=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},So.apply(this,arguments)}let Eo=!1,To=0;const Po=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+To++,No=lo.useId||function(){const[e,t]=Re.useState(()=>Eo?Po():void 0);return Co(()=>{null==e&&t(Po())},[]),Re.useEffect(()=>{Eo=!0},[]),e},_o=Re.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:s}},width:i=14,height:a=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:d,stroke:u,d:m,style:{transform:p,...h}={},...f}=e,g=No(),[v,b]=Re.useState(!1);if(Co(()=>{r&&"rtl"===wn(r).direction&&b(!0)},[r]),!r)return null;const[y,x]=n.split("-"),w="top"===y||"bottom"===y;let k=d;(w&&null!=s&&s.x||!w&&null!=s&&s.y)&&(k=null);const j=2*c,C=j/2,S=i/2*(l/-8+1),E=a/2*l/4,T=!!m,P=k&&"end"===x?"bottom":"top";let N=k&&"end"===x?"right":"left";k&&v&&(N="end"===x?"left":"right");const _=null!=(null==o?void 0:o.x)?k||o.x:"",R=null!=(null==o?void 0:o.y)?k||o.y:"",A=m||"M0,0 H"+i+" L"+(i-S)+","+(a-E)+" Q"+i/2+","+a+" "+S+","+(a-E)+" Z",M={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[y];return Re.createElement("svg",So({},f,{"aria-hidden":!0,ref:t,width:T?i:i+j,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[N]:_,[P]:R,[y]:w||T?"100%":"calc(100% - "+j/2+"px)",transform:[M,p].filter(e=>!!e).join(" "),...h}}),j>0&&Re.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:u,strokeWidth:j+(m?0:1),d:A}),Re.createElement("path",{stroke:j&&!m?f.fill:"none",d:A}),Re.createElement("clipPath",{id:g},Re.createElement("rect",{x:-C,y:C*(T?-1:1),width:i+j,height:i})))});const Ro=Re.createContext(null),Ao=Re.createContext(null),Mo=()=>{var e;return(null==(e=Re.useContext(Ro))?void 0:e.id)||null},Lo=()=>Re.useContext(Ao);function Io(e){return"data-floating-ui-"+e}function Do(e){const t=(0,Re.useRef)(e);return Co(()=>{t.current=e}),t}const Oo=Io("safe-polygon");function Fo(e,t,n){return n&&!On(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Vo=0;function zo(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Vo);const s=()=>null==e?void 0:e.focus({preventScroll:n});o?s():Vo=requestAnimationFrame(s)}function Bo(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 $o=new WeakMap,Wo=new WeakSet,Uo={},Ho=0;const qo=e=>e&&(e.host||qo(e.parentNode));function Ko(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=Fn(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=(a=t,e.map(e=>{if(a.contains(e))return e;const t=qo(e);return a.contains(t)?t:null}).filter(e=>null!=e));var a;const l=new Set,c=new Set(i),d=[];Uo[o]||(Uo[o]=new WeakMap);const u=Uo[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"!==rn(t))if(l.has(t))e(t);else{const e=s?t.getAttribute(s):null,n=null!==e&&"false"!==e,r=($o.get(t)||0)+1,i=(u.get(t)||0)+1;$o.set(t,r),u.set(t,i),d.push(t),1===r&&n&&Wo.add(t),1===i&&t.setAttribute(o,""),!n&&s&&t.setAttribute(s,"true")}})}(t),l.clear(),Ho++,()=>{d.forEach(e=>{const t=($o.get(e)||0)-1,n=(u.get(e)||0)-1;$o.set(e,t),u.set(e,n),t||(!Wo.has(e)&&s&&e.removeAttribute(s),Wo.delete(e)),n||e.removeAttribute(o)}),Ho--,Ho||($o=new WeakMap,$o=new WeakMap,Wo=new WeakSet,Uo={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Go=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Yo(e,t){const n=Tr(e,Go());"prev"===t&&n.reverse();const r=n.indexOf(Tn(Fn(e)));return n.slice(r+1)[0]}function Xo(){return Yo(document.body,"next")}function Zo(){return Yo(document.body,"prev")}function Jo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Pn(n,r)}function Qo(e){Tr(e,Go()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function es(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 ts={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 ns(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const rs=Re.forwardRef(function(e,t){const[n,r]=Re.useState();Co(()=>(Ln()&&r("button"),document.addEventListener("keydown",ns),()=>{document.removeEventListener("keydown",ns)}),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Io("focus-guard")]:"",style:ts};return Re.createElement("span",So({},e,o))}),os=Re.createContext(null),ss=Io("portal");function is(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=No(),o=as(),[s,i]=Re.useState(null),a=Re.useRef(null);return Co(()=>()=>{null==s||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),Co(()=>{if(!r)return;if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(ss,""),e.appendChild(n),a.current=n,i(n)},[t,r]),Co(()=>{if(null===n)return;if(!r)return;if(a.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!ln(e)&&(e=e.current),e=e||document.body;let s=null;t&&(s=document.createElement("div"),s.id=t,e.appendChild(s));const l=document.createElement("div");l.id=r,l.setAttribute(ss,""),e=s||e,e.appendChild(l),a.current=l,i(l)},[t,n,r,o]),s}({id:n,root:r}),[i,a]=Re.useState(null),l=Re.useRef(null),c=Re.useRef(null),d=Re.useRef(null),u=Re.useRef(null),m=null==i?void 0:i.modal,p=null==i?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!(!r&&!s);return Re.useEffect(()=>{if(s&&o&&!m)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&Jo(e)&&("focusin"===e.type?es:Qo)(s)}},[s,o,m]),Re.useEffect(()=>{s&&(p||es(s))},[p,s]),Re.createElement(os.Provider,{value:Re.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:s,setFocusManagerState:a}),[o,s])},h&&s&&Re.createElement(rs,{"data-type":"outside",ref:l,onFocus:e=>{if(Jo(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=Zo()||(null==i?void 0:i.refs.domReference.current);null==e||e.focus()}}}),h&&s&&Re.createElement("span",{"aria-owns":s.id,style:ts}),s&&Pr.createPortal(t,s),h&&s&&Re.createElement(rs,{"data-type":"outside",ref:c,onFocus:e=>{if(Jo(e,s)){var t;null==(t=u.current)||t.focus()}else{const t=Xo()||(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 as=()=>Re.useContext(os),ls="data-floating-ui-focusable";function cs(e){return e?e.hasAttribute(ls)?e:e.querySelector("["+ls+"]")||e:null}let ds=[];function us(e){ds=ds.filter(e=>e.isConnected);let t=e;if(t&&"body"!==rn(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==hr.call(e,mr)&&Cr(t,e)}(t,Go())){const e=Tr(t,Go())[0];e&&(t=e)}ds.push(t),ds.length>20&&(ds=ds.slice(-20))}}function ms(){return ds.slice().reverse().find(e=>e.isConnected)}const ps=Re.forwardRef(function(e,t){return Re.createElement("button",So({},e,{type:"button",ref:t,tabIndex:-1,style:ts}))});function hs(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:u=!0}=e,{open:m,refs:p,nodeId:h,onOpenChange:f,events:g,dataRef:v,floatingId:b,elements:{domReference:y,floating:x}}=t,w="number"==typeof i&&i<0,k=Wn(y)&&w,j="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||s,C=Do(o),S=Do(i),E=Do(a),T=Lo(),P=as(),N=Re.useRef(null),_=Re.useRef(null),R=Re.useRef(!1),A=Re.useRef(!1),M=Re.useRef(-1),L=null!=P,I=cs(x),D=uo(function(e){return void 0===e&&(e=I),e?Tr(e,Go()):[]}),O=uo(e=>{const t=D(e);return C.current.map(e=>y&&"reference"===e?y:I&&"floating"===e?I:t).filter(Boolean).flat()});function F(e){return!r&&d&&c?Re.createElement(ps,{ref:"start"===e?N:_,onClick:e=>f(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}Re.useEffect(()=>{if(r)return;if(!c)return;function e(e){if("Tab"===e.key){Pn(I,Tn(Fn(I)))&&0===D().length&&!k&&$n(e);const t=O(),n=zn(e);"reference"===C.current[0]&&n===y&&($n(e),e.shiftKey?zo(t[t.length-1]):zo(t[1])),"floating"===C.current[1]&&n===I&&e.shiftKey&&($n(e),zo(t[0]))}}const t=Fn(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,y,I,c,C,k,D,O]),Re.useEffect(()=>{if(!r&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=zn(e),n=D().indexOf(t);-1!==n&&(M.current=n)}},[r,x,D]),Re.useEffect(()=>{if(!r&&u)return x&&cn(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){A.current=!0,setTimeout(()=>{A.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(Pn(y,t)||Pn(x,t)||Pn(t,x)||Pn(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Io("focus-guard"))||T&&(Bo(T.nodesRef.current,h).find(e=>{var n,r;return Pn(null==(n=e.context)?void 0:n.elements.floating,t)||Pn(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}(T.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&&Tn(Fn(I))===Fn(I).body){cn(I)&&I.focus();const e=M.current,t=D(),n=t[e]||t[t.length-1]||I;cn(n)&&n.focus()}!k&&c||!t||!n||A.current||t===ms()||(R.current=!0,f(!1,e,"focus-out"))})}},[r,y,x,I,c,h,T,P,f,u,l,D,k]),Re.useEffect(()=>{var e;if(r)return;const t=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Io("portal")+"]"))||[]);if(x){const e=[x,...t,N.current,_.current,C.current.includes("reference")||k?y:null].filter(e=>null!=e),n=c||k?Ko(e,j,!j):Ko(e);return()=>{n()}}},[r,y,x,c,C,P,k,j]),Co(()=>{if(r||!cn(I))return;const e=Tn(Fn(I));queueMicrotask(()=>{const t=O(I),n=S.current,r=("number"==typeof n?t[n]:n.current)||I,o=Pn(I,e);w||o||!m||zo(r,{preventScroll:r===I})})},[r,m,I,w,O,S]),Co(()=>{if(r||!I)return;let e=!1;const t=Fn(I),n=Tn(t);let o=v.current.openEvent;function s(t){let{open:n,reason:r,event:s,nested:i}=t;n&&(o=s),"escape-key"===r&&p.domReference.current&&us(p.domReference.current),"hover"===r&&"mouseleave"===s.type&&(R.current=!0),"outside-press"===r&&(i?(R.current=!1,e=!0):R.current=!(An(s)||Mn(s)))}us(n),g.on("openchange",s);const i=t.createElement("span");return i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,ts),L&&y&&y.insertAdjacentElement("afterend",i),()=>{g.off("openchange",s);const n=Tn(t),r=Pn(x,n)||T&&Bo(T.nodesRef.current,h).some(e=>{var t;return Pn(null==(t=e.context)?void 0:t.elements.floating,n)});(r||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&us(p.domReference.current);const a="boolean"==typeof E.current?ms()||i:E.current.current||i;queueMicrotask(()=>{E.current&&!R.current&&cn(a)&&(a===n||n===t.body||r)&&a.focus({preventScroll:e}),i.remove()})}},[r,x,I,E,v,p,g,T,h,L,y]),Re.useEffect(()=>{queueMicrotask(()=>{R.current=!1})},[r]),Co(()=>{if(!r&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:m,onOpenChange:f,refs:p}),()=>{P.setFocusManagerState(null)}},[r,P,c,m,f,p,u]),Co(()=>{if(r)return;if(!I)return;if("function"!=typeof MutationObserver)return;if(w)return;const e=()=>{const e=I.getAttribute("tabindex"),t=D(),n=Tn(Fn(x)),r=t.indexOf(n);-1!==r&&(M.current=r),C.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,x,I,p,C,D,w]);const V=!r&&j&&(!c||!k)&&(L||c);return Re.createElement(Re.Fragment,null,V&&Re.createElement(rs,{"data-type":"inside",ref:null==P?void 0:P.beforeInsideRef,onFocus:e=>{if(c){const e=O();zo("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(R.current=!1,Jo(e,P.portalNode)){const e=Xo()||y;null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!k&&F("start"),n,F("end"),V&&Re.createElement(rs,{"data-type":"inside",ref:null==P?void 0:P.afterInsideRef,onFocus:e=>{if(c)zo(O()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(u&&(R.current=!0),Jo(e,P.portalNode)){const e=Zo()||y;null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}}))}let fs=0,gs=()=>{};const vs=Re.forwardRef(function(e,t){const{lockScroll:n=!1,...r}=e;return Co(()=>{if(n)return fs++,1===fs&&(gs=function(){const e=/iP(hone|ad|od)|iOS/.test(Nn()),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,s=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var i,a;const e=(null==(i=window.visualViewport)?void 0:i.offsetLeft)||0,n=(null==(a=window.visualViewport)?void 0:a.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(s-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,s))}}()),()=>{fs--,0===fs&&gs()}},[n]),Re.createElement("div",So({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function bs(e){return cn(e.target)&&"BUTTON"===e.target.tagName}function ys(e){return Bn(e)}function xs(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:d=!0,stickIfOpen:u=!0}=t,m=Re.useRef(),p=Re.useRef(!1),h=Re.useMemo(()=>({onPointerDown(e){m.current=e.pointerType},onMouseDown(e){const t=m.current;0===e.button&&"click"!==a&&(On(t,!0)&&c||(!n||!l||o.current.openEvent&&u&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=m.current;"mousedown"===a&&m.current?m.current=void 0:On(t,!0)&&c||(!n||!l||o.current.openEvent&&u&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){m.current=void 0,e.defaultPrevented||!d||bs(e)||(" "!==e.key||ys(s)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&r(!n||!l,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||bs(e)||ys(s)||" "===e.key&&p.current&&(p.current=!1,r(!n||!l,e.nativeEvent,"click"))}}),[o,s,a,c,d,r,n,u,l]);return Re.useMemo(()=>i?{reference:h}:{},[i,h])}const ws={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ks={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},js=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 Cs(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:m=!1,bubbles:p,capture:h}=t,f=Lo(),g=uo("function"==typeof l?l:()=>!1),v="function"==typeof l?g:l,b=Re.useRef(!1),y=Re.useRef(!1),{escapeKey:x,outsidePress:w}=js(p),{escapeKey:k,outsidePress:j}=js(h),C=Re.useRef(!1),S=uo(e=>{var t;if(!n||!i||!a||"Escape"!==e.key)return;if(C.current)return;const o=null==(t=s.current.floatingContext)?void 0:t.nodeId,l=f?Bo(f.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")}),E=uo(e=>{var t;const n=()=>{var t;S(e),null==(t=zn(e))||t.removeEventListener("keydown",n)};null==(t=zn(e))||t.addEventListener("keydown",n)}),T=uo(e=>{var t;const n=b.current;b.current=!1;const i=y.current;if(y.current=!1,"click"===c&&i)return;if(n)return;if("function"==typeof v&&!v(e))return;const a=zn(e),l="["+Io("inert")+"]",d=Fn(o.floating).querySelectorAll(l);let u=ln(a)?a:null;for(;u&&!xn(u);){const e=jn(u);if(xn(e)||!ln(e))break;u=e}if(d.length&&ln(a)&&!a.matches("html,body")&&!Pn(a,o.floating)&&Array.from(d).every(e=>!Pn(u,e)))return;if(cn(a)&&_){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===wn(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const m=null==(t=s.current.floatingContext)?void 0:t.nodeId,p=f&&Bo(f.nodesRef.current,m).some(t=>{var n;return Vn(e,null==(n=t.context)?void 0:n.elements.floating)});if(Vn(e,o.floating)||Vn(e,o.domReference)||p)return;const h=f?Bo(f.nodesRef.current,m):[];if(h.length>0){let e=!0;if(h.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),P=uo(e=>{var t;const n=()=>{var t;T(e),null==(t=zn(e))||t.removeEventListener(c,n)};null==(t=zn(e))||t.addEventListener(c,n)});Re.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),C.current=!0}function d(){e=window.setTimeout(()=>{C.current=!1},yn()?5:0)}const u=Fn(o.floating);a&&(u.addEventListener("keydown",k?E:S,k),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",d)),v&&u.addEventListener(c,j?P:T,j);let p=[];return m&&(ln(o.domReference)&&(p=Sn(o.domReference)),ln(o.floating)&&(p=p.concat(Sn(o.floating))),!ln(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(Sn(o.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{a&&(u.removeEventListener("keydown",k?E:S,k),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",d)),v&&u.removeEventListener(c,j?P:T,j),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[s,o,a,v,c,n,r,m,i,x,w,S,k,E,T,j,P]),Re.useEffect(()=>{b.current=!1},[v,c]);const N=Re.useMemo(()=>({onKeyDown:S,[ws[u]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}}),[S,r,d,u]),_=Re.useMemo(()=>({onKeyDown:S,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[ks[c]]:()=>{b.current=!0}}),[S,c]);return Re.useMemo(()=>i?{reference:N,floating:_}:{},[i,N,_])}function Ss(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=No(),s=Re.useRef({}),[i]=Re.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))||[])}}}()),a=null!=Mo(),[l,c]=Re.useState(r.reference),d=uo((e,t,r)=>{s.current.openEvent=e?t:void 0,i.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)}),u=Re.useMemo(()=>({setPositionReference:c}),[]),m=Re.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return Re.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:m,events:i,floatingId:o,refs:u}),[t,d,m,i,o,u])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=Re.useState(null),[a,l]=Re.useState(null),c=(null==o?void 0:o.domReference)||s,d=Re.useRef(null),u=Lo();Co(()=>{c&&(d.current=c)},[c]);const m=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=Re.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=Re.useState(r);Qr(m,r)||p(r);const[h,f]=Re.useState(null),[g,v]=Re.useState(null),b=Re.useCallback(e=>{e!==k.current&&(k.current=e,f(e))},[]),y=Re.useCallback(e=>{e!==j.current&&(j.current=e,v(e))},[]),x=s||h,w=i||g,k=Re.useRef(null),j=Re.useRef(null),C=Re.useRef(d),S=null!=l,E=no(l),T=no(o),P=no(c),N=Re.useCallback(()=>{if(!k.current||!j.current)return;const e={placement:t,strategy:n,middleware:m};T.current&&(e.platform=T.current),Zr(k.current,j.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};_.current&&!Qr(C.current,t)&&(C.current=t,Pr.flushSync(()=>{u(t)}))})},[m,t,n,T,P]);Jr(()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,u(e=>({...e,isPositioned:!1})))},[c]);const _=Re.useRef(!1);Jr(()=>(_.current=!0,()=>{_.current=!1}),[]),Jr(()=>{if(x&&(k.current=x),w&&(j.current=w),x&&w){if(E.current)return E.current(x,w,N);N()}},[x,w,N,E,S]);const R=Re.useMemo(()=>({reference:k,floating:j,setReference:b,setFloating:y}),[b,y]),A=Re.useMemo(()=>({reference:x,floating:w}),[x,w]),M=Re.useMemo(()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=to(A.floating,d.x),r=to(A.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...eo(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,A.floating,d.x,d.y]);return Re.useMemo(()=>({...d,update:N,refs:R,elements:A,floatingStyles:M}),[d,N,R,A,M])}({...e,elements:{...o,...a&&{reference:a}}}),p=Re.useCallback(e=>{const t=ln(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),m.refs.setReference(t)},[m.refs]),h=Re.useCallback(e=>{(ln(e)||null===e)&&(d.current=e,i(e)),(ln(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!ln(e))&&m.refs.setReference(e)},[m.refs]),f=Re.useMemo(()=>({...m.refs,setReference:h,setPositionReference:p,domReference:d}),[m.refs,h,p]),g=Re.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),v=Re.useMemo(()=>({...m,...r,refs:f,elements:g,nodeId:t}),[m,f,g,t,r]);return Co(()=>{r.dataRef.current.floatingContext=v;const e=null==u?void 0:u.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),Re.useMemo(()=>({...m,context:v,refs:f,elements:g}),[m,f,g,v])}const Es="active",Ts="selected";function Ps(e,t,n){const r=new Map,o="item"===n;let s=e;if(o&&e){const{[Es]:t,[Ts]:__,...n}=e;s=n}return{..."floating"===n&&{tabIndex:-1,[ls]:""},...s,...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,s]=t;var i;o&&[Es,Ts].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof s&&(null==(i=r.get(n))||i.push(s),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=s)}),e):e,{})}}function Ns(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=Re.useCallback(t=>Ps(t,e,"reference"),t),s=Re.useCallback(t=>Ps(t,e,"floating"),n),i=Re.useCallback(t=>Ps(t,e,"item"),r);return Re.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let _s=!1;function Rs(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function As(e,t){return Rs(t,e===mo||e===po,e===ho||e===fo)}function Ms(e,t,n){return Rs(t,e===po,n?e===ho:e===fo)||"Enter"===e||" "===e||""===e}function Ls(e,t,n){return Rs(t,n?e===fo:e===ho,e===mo)}function Is(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:s,activeIndex:i,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:d=!1,loop:u=!1,nested:m=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:f="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:v=!0,disabledIndices:b,orientation:y="vertical",cols:x=1,scrollItemIntoView:w=!0,virtualItemRef:k,itemSizes:j,dense:C=!1}=t,S=Do(cs(o.floating)),E=Mo(),T=Lo(),P=uo(a),N=Wn(o.domReference),_=Re.useRef(f),R=Re.useRef(null!=c?c:-1),A=Re.useRef(null),M=Re.useRef(!0),L=Re.useRef(P),I=Re.useRef(!!o.floating),D=Re.useRef(n),O=Re.useRef(!1),F=Re.useRef(!1),V=Do(b),z=Do(n),B=Do(w),$=Do(c),[W,U]=Re.useState(),[H,q]=Re.useState(),K=uo(function(e,t,n){function r(e){h?(U(e.id),null==T||T.events.emit("virtualfocus",e),k&&(k.current=e)):zo(e,{preventScroll:!0,sync:!(!Dn()||!Ln())&&(_s||O.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame(()=>{const s=e.current[t.current]||o;if(!s)return;o||r(s);const i=B.current;i&&Y&&(n||!M.current)&&(null==s.scrollIntoView||s.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))})});Co(()=>{document.createElement("div").focus({get preventScroll(){return _s=!0,!1}})},[]),Co(()=>{l&&(n&&o.floating?_.current&&null!=c&&(F.current=!0,R.current=c,P(c)):I.current&&(R.current=-1,L.current(null)))},[l,n,o.floating,c,P]),Co(()=>{if(l&&n&&o.floating)if(null==i){if(O.current=!1,null!=$.current)return;if(I.current&&(R.current=-1,K(s,R)),(!D.current||!I.current)&&_.current&&(null!=A.current||!0===_.current&&null==A.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(R.current=null==A.current||Ms(A.current,y,p)||m?bo(s,V.current):yo(s,V.current),A.current=null,P(R.current))};t()}}else vo(s,i)||(R.current=i,K(s,R,F.current),F.current=!1)},[l,n,o.floating,i,$,m,s,y,p,P,K,V]),Co(()=>{var e;if(!l||o.floating||!T||h||!I.current)return;const t=T.nodesRef.current,n=null==(e=t.find(e=>e.id===E))||null==(e=e.context)?void 0:e.elements.floating,r=Tn(Fn(o.floating)),s=t.some(e=>e.context&&Pn(e.context.elements.floating,r));n&&!s&&M.current&&n.focus({preventScroll:!0})},[l,o.floating,T,E,h]),Co(()=>{if(l&&T&&h&&!E)return T.events.on("virtualfocus",e),()=>{T.events.off("virtualfocus",e)};function e(e){q(e.id),k&&(k.current=e)}},[l,T,h,E,k]),Co(()=>{L.current=P,I.current=!!o.floating}),Co(()=>{n||(A.current=null)},[n]),Co(()=>{D.current=n},[n]);const G=null!=i,Y=Re.useMemo(()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&P(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...g&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;M.current&&"touch"!==t&&(R.current=-1,K(s,R),P(null),h||zo(S.current,{preventScroll:!0}))}}}},[n,S,K,g,s,P,h]),X=uo(e=>{if(M.current=!1,O.current=!0,229===e.which)return;if(!z.current&&e.currentTarget===S.current)return;if(m&&Ls(e.key,y,p))return $n(e),r(!1,e.nativeEvent,"list-navigation"),void(cn(o.domReference)&&(h?null==T||T.events.emit("virtualfocus",o.domReference):o.domReference.focus()));const t=R.current,i=bo(s,b),a=yo(s,b);if(N||("Home"===e.key&&($n(e),R.current=i,P(R.current)),"End"===e.key&&($n(e),R.current=a,P(R.current))),x>1){const t=j||Array.from({length:s.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let o=0;return e.forEach((e,s)=>{let{width:i,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<a;r++)e.push(o+n+r*t);o%t+i<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=s}),l=!0):o++}}),[...r]}(t,x,C),r=n.findIndex(e=>null!=e&&!jo(s.current,e,b)),o=n.reduce((e,t,n)=>null==t||jo(s.current,t,b)?e:n,-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,rtl:s,cols:i,disabledIndices:a,minIndex:l,maxIndex:c,prevIndex:d,stopEvent:u=!1}=t,m=d;if(n.key===mo){if(u&&$n(n),-1===d)m=c;else if(m=xo(e,{startingIndex:m,amount:i,decrement:!0,disabledIndices:a}),o&&(d-i<l||m<0)){const e=d%i,t=c%i,n=c-(t-e);m=t===e?c:t>e?n:n-i}vo(e,m)&&(m=d)}if(n.key===po&&(u&&$n(n),-1===d?m=l:(m=xo(e,{startingIndex:d,amount:i,disabledIndices:a}),o&&d+i>c&&(m=xo(e,{startingIndex:d%i-i,amount:i,disabledIndices:a}))),vo(e,m)&&(m=d)),"both"===r){const t=Kn(d/i);n.key===(s?ho:fo)&&(u&&$n(n),d%i!==i-1?(m=xo(e,{startingIndex:d,disabledIndices:a}),o&&go(m,i,t)&&(m=xo(e,{startingIndex:d-d%i-1,disabledIndices:a}))):o&&(m=xo(e,{startingIndex:d-d%i-1,disabledIndices:a})),go(m,i,t)&&(m=d)),n.key===(s?fo:ho)&&(u&&$n(n),d%i!==0?(m=xo(e,{startingIndex:d,decrement:!0,disabledIndices:a}),o&&go(m,i,t)&&(m=xo(e,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:a}))):o&&(m=xo(e,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:a})),go(m,i,t)&&(m=d));const r=Kn(c/i)===t;vo(e,m)&&(m=o&&r?n.key===(s?fo:ho)?c:xo(e,{startingIndex:d-d%i-1,disabledIndices:a}):d)}return m}({current:n.map(e=>null!=e?s.current[e]:null)},{event:e,orientation:y,loop:u,rtl:p,cols:x,disabledIndices:ko([...b||s.current.map((e,t)=>jo(s.current,t)?t:void 0),void 0],n),minIndex:r,maxIndex:o,prevIndex:wo(R.current>a?i:R.current,t,n,x,e.key===po?"bl":e.key===(p?ho:fo)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(R.current=l,P(R.current)),"both"===y)return}if(As(e.key,y)){if($n(e),n&&!h&&Tn(e.currentTarget.ownerDocument)===e.currentTarget)return R.current=Ms(e.key,y,p)?i:a,void P(R.current);Ms(e.key,y,p)?R.current=u?t>=a?d&&t!==s.current.length?-1:i:xo(s,{startingIndex:t,disabledIndices:b}):Math.min(a,xo(s,{startingIndex:t,disabledIndices:b})):R.current=u?t<=i?d&&-1!==t?s.current.length:a:xo(s,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(i,xo(s,{startingIndex:t,decrement:!0,disabledIndices:b})),vo(s,R.current)?P(null):P(R.current)}}),Z=Re.useMemo(()=>h&&n&&G&&{"aria-activedescendant":H||W},[h,n,G,H,W]),J=Re.useMemo(()=>({"aria-orientation":"both"===y?void 0:y,...!Wn(o.domReference)&&Z,onKeyDown:X,onPointerMove(){M.current=!0}}),[Z,X,o.domReference,y]),Q=Re.useMemo(()=>{function e(e){"auto"===f&&An(e.nativeEvent)&&(_.current=!0)}return{...Z,onKeyDown(e){M.current=!1;const t=e.key.startsWith("Arrow"),o=["Home","End"].includes(e.key),i=t||o,a=function(e,t,n){return Rs(t,n?e===ho:e===fo,e===po)}(e.key,y,p),l=Ls(e.key,y,p),d=As(e.key,y),u=(m?a:d)||"Enter"===e.key||""===e.key.trim();if(h&&n){const t=null==T?void 0:T.nodesRef.current.find(e=>null==e.parentId),n=T&&t?function(e,t){let n,r=-1;return function t(o,s){s>r&&(n=o,r=s),Bo(e,o).forEach(e=>{t(e.id,s+1)})}(t,0),e.find(e=>e.id===n)}(T.nodesRef.current,t.id):null;if(i&&n&&k){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(a||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:a?s.current.find(e=>(null==e?void 0:e.id)===W):null;o&&($n(e),o.dispatchEvent(t),q(void 0))}var b;if((d||o)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return $n(e),void(null==(b=n.context.elements.domReference)||b.dispatchEvent(t))}return X(e)}(n||v||!t)&&(u&&(A.current=m&&d?null:e.key),m?a&&($n(e),n?(R.current=bo(s,V.current),P(R.current)):r(!0,e.nativeEvent,"list-navigation")):d&&(null!=c&&(R.current=c),$n(e),!n&&v?r(!0,e.nativeEvent,"list-navigation"):X(e),n&&P(R.current)))},onFocus(){n&&!h&&P(null)},onPointerDown:function(e){_.current=f,"auto"===f&&Mn(e.nativeEvent)&&(_.current=!0)},onMouseDown:e,onClick:e}},[W,Z,X,V,f,s,m,P,r,n,v,y,p,c,T,h,k]);return Re.useMemo(()=>l?{reference:Q,floating:J,item:Y}:{},[l,Q,J,Y])}const Ds=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Os(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=null!=(n=Ds.get(i))?n:i,l=No(),c=null!=Mo(),d=Re.useMemo(()=>"tooltip"===a||"label"===i?{["aria-"+("label"===i?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":r?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l},..."menu"===a&&c&&{role:"menuitem"},..."select"===i&&{"aria-autocomplete":"none"},..."combobox"===i&&{"aria-autocomplete":"list"}},[a,o,c,r,l,i]),u=Re.useMemo(()=>{const e={id:o,...a&&{role:a}};return"tooltip"===a||"label"===i?e:{...e,..."menu"===a&&{"aria-labelledby":l}}},[a,o,l,i]),m=Re.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 Re.useMemo(()=>s?{reference:d,floating:u,item:m}:{},[s,d,u,m])}const Fs=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Vs(e,t){return"function"==typeof e?e(t):e}function zs(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:s,duration:i=250}=t,a=e.placement,l=a.split("-")[0],c=Re.useMemo(()=>({side:l,placement:a}),[l,a]),d="number"==typeof i,u=(d?i:i.open)||0,m=(d?i:i.close)||0,[p,h]=Re.useState(()=>({...Vs(s,c),...Vs(n,c)})),{isMounted:f,status:g}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,s=("number"==typeof o?o:o.close)||0,[i,a]=Re.useState("unmounted"),l=function(e,t){const[n,r]=Re.useState(e);return e&&!n&&r(!0),Re.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,s);return l||"close"!==i||a("unmounted"),Co(()=>{if(r){if(n){a("initial");const e=requestAnimationFrame(()=>{a("open")});return()=>{cancelAnimationFrame(e)}}a("close")}},[n,r]),{isMounted:l,status:i}}(e,{duration:i}),v=Do(n),b=Do(r),y=Do(o),x=Do(s);return Co(()=>{const e=Vs(v.current,c),t=Vs(y.current,c),n=Vs(x.current,c),r=Vs(b.current,c)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===g&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===g&&h({transitionProperty:Object.keys(r).map(Fs).join(","),transitionDuration:u+"ms",...n,...r}),"close"===g){const r=t||e;h({transitionProperty:Object.keys(r).map(Fs).join(","),transitionDuration:m+"ms",...n,...r})}},[m,y,v,b,x,u,g,c]),{isMounted:f,styles:p}}function Bs(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let e=0,i=s-1;e<s;i=e++){const[s,a]=t[e]||[0,0],[l,c]=t[i]||[0,0];a>=r!=c>=r&&n<=(l-s)*(r-a)/(c-a)+s&&(o=!o)}return o}function $s(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,a=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:d,elements:u,onClose:m,nodeId:p,tree:h}=e;return function(e){function f(){clearTimeout(o),m()}if(clearTimeout(o),!u.domReference||!u.floating||null==d||null==n||null==c)return;const{clientX:g,clientY:v}=e,b=[g,v],y=zn(e),x="mouseleave"===e.type,w=Pn(u.floating,y),k=Pn(u.domReference,y),j=u.domReference.getBoundingClientRect(),C=u.floating.getBoundingClientRect(),S=d.split("-")[0],E=n>C.right-C.width/2,T=c>C.bottom-C.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,j),N=C.width>j.width,_=C.height>j.height,R=(N?j:C).left,A=(N?j:C).right,M=(_?j:C).top,L=(_?j:C).bottom;if(w&&(s=!0,!x))return;if(k&&(s=!1),k&&!x)return void(s=!0);if(x&&ln(e.relatedTarget)&&Pn(u.floating,e.relatedTarget))return;if(h&&Bo(h.nodesRef.current,p).some(e=>{let{context:t}=e;return null==t?void 0:t.open}))return;if("top"===S&&c>=j.bottom-1||"bottom"===S&&c<=j.top+1||"left"===S&&n>=j.right-1||"right"===S&&n<=j.left+1)return f();let I=[];switch(S){case"top":I=[[R,j.top+1],[R,C.bottom-1],[A,C.bottom-1],[A,j.top+1]];break;case"bottom":I=[[R,C.top+1],[R,j.bottom-1],[A,j.bottom-1],[A,C.top+1]];break;case"left":I=[[C.right-1,L],[C.right-1,M],[j.left+1,M],[j.left+1,L]];break;case"right":I=[[j.right-1,L],[j.right-1,M],[C.left+1,M],[C.left+1,L]]}if(!Bs([g,v],I)){if(s&&!P)return f();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===a||0===r)return i=e,a=t,l=n,null;const o=e-i,s=t-a,c=Math.sqrt(o*o+s*s);return i=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return f()}Bs([g,v],function(e){let[n,r]=e;switch(S){case"top":return[[N?n+t/2:E?n+4*t:n-4*t,r+t+1],[N?n-t/2:E?n+4*t:n-4*t,r+t+1],[C.left,E||N?C.bottom-t:C.top],[C.right,E?N?C.bottom-t:C.top:C.bottom-t]];case"bottom":return[[N?n+t/2:E?n+4*t:n-4*t,r-t],[N?n-t/2:E?n+4*t:n-4*t,r-t],[C.left,E||N?C.top+t:C.bottom],[C.right,E?N?C.top+t:C.bottom:C.top+t]];case"left":{const e=[n+t+1,_?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,_?r-t/2:T?r+4*t:r-4*t];return[[T||_?C.right-t:C.left,C.top],[T?_?C.right-t:C.left:C.right-t,C.bottom],e,o]}case"right":return[[n-t,_?r+t/2:T?r+4*t:r-4*t],[n-t,_?r-t/2:T?r+4*t:r-4*t],[T||_?C.left+t:C.right,C.top],[T?_?C.left+t:C.right:C.left+t,C.bottom]]}}([n,c]))?!s&&r&&(o=window.setTimeout(f,40)):f()}}};return c.__options={blockPointerEvents:n},c}let Ws=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};const Us=Zt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Hs=Zt("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"}]]),qs=Zt("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"}]]),Ks=(0,Re.forwardRef)((e,t)=>{const{variant:n="primary",size:r="md",type:o="button",tag:s="button",className:i,children:a,disabled:l=!1,destructive:c=!1,icon:d=null,iconPosition:u="left",loading:m=!1,...p}=e,h=c&&"focus:ring-focus-error",f=m?"opacity-50 disabled:cursor-not-allowed":"",g={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],v=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 y,x=null,w="";return d&&(w="flex items-center justify-center","left"===u?y=d:x=d),(0,T.jsxs)(s,{ref:t,type:o,className:Ut(w,"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,g,v,h,f,{"cursor-default":l},i),disabled:l,"aria-disabled":l,...p,children:[(0,T.jsx)(Re.Fragment,{children:y},"left-icon"),a?(0,T.jsx)("span",{className:"px-1",children:a}):null,(0,T.jsx)(Re.Fragment,{children:x},"right-icon")]})});Ks.displayName="Button";const Gs="light",Ys="neutral",Xs=({icon:e,theme:t=Gs,variant:n=Ys})=>{const r="[&>svg]:h-5 [&>svg]:w-5",o=(({theme:e=Gs,variant:t=Ys})=>{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,Re.isValidElement)(e))return(0,Re.cloneElement)(e,{className:Ut(r,o,e?.props?.className??"")});const s={neutral:(0,T.jsx)(Us,{className:Ut(r,o)}),info:(0,T.jsx)(Us,{className:Ut(r,o)}),success:(0,T.jsx)(tn,{className:Ut(r,o)}),warning:(0,T.jsx)(Hs,{className:Ut(r,o)}),error:(0,T.jsx)(qs,{className:Ut(r,o)})};return s[n]||s.neutral},Zs=({actionType:e="button",onAction:t=()=>{},actionLabel:n="",theme:r=Gs})=>{const o="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none";let s="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===r&&(s="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),e){case"button":return(0,T.jsx)(Ks,{variant:"outline",size:"xs",onClick:t,className:Ut("rounded",o,s,"dark"===r?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white"),children:n});case"link":return(0,T.jsx)(Ks,{variant:"link",size:"xs",onClick:t,className:Ut(o,s),children:n});default:return null}},Js=({theme:e=Gs,title:t="",inline:n=!1})=>t?(0,T.jsx)("span",{className:Ut("block",{light:"text-text-primary",dark:"text-text-inverse"}[e],"text-sm leading-5 font-semibold",n?"inline":"block"),children:t}):null,Qs=({theme:e=Gs,content:t="",inline:n=!1})=>t?(0,T.jsx)("span",{className:Ut({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,ei=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},ti={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"}},ni="group-disabled:text-field-color-disabled",ri={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]"},oi={sm:"py-1.5 px-2 text-xs font-normal",md:"p-2 text-sm font-normal",lg:"p-2 text-base font-normal"},si=e=>null===e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?e.toString():Array.isArray(e)?e.map(si).join(" ").trim():(0,Re.isValidElement)(e)?e.props&&e.props.children?si(e.props.children):"":"object"==typeof e&&"textContent"in e?e.textContent?.toString().toLowerCase()||"":"object"==typeof e&&"children"in e?si(e.children):"",ii=Zt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ai=(0,Re.forwardRef)(({label:e="",size:t="sm",className:n="",type:r="pill",variant:o="neutral",icon:s=null,disabled:i=!1,onClose:a=()=>{},closable:l=!1,onMouseDown:c=()=>{},disableHover:d=!1},u)=>{const m={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="",h="group relative justify-center flex items-center cursor-pointer";const f={xxs:"[&>svg]:size-3",xs:"[&>svg]:size-3",sm:"[&>svg]:size-3",md:"[&>svg]:size-4",lg:"[&>svg]:size-5"};return i?(p=m.disabled,h+=" cursor-not-allowed disabled"):p=m[o],e?(0,T.jsxs)("span",{className:Ut("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,!d&&{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:u,children:[s?(0,T.jsx)("span",{className:Ut("justify-center flex items-center",f[t]),children:s}):null,(0,T.jsx)("span",{className:"px-1 truncate inline-block",children:e}),l&&(0,T.jsxs)("span",{className:Ut(h,f[t]),onMouseDown:c,role:"button",tabIndex:0,...!i&&{onClick:a},children:[(0,T.jsx)("span",{className:"sr-only",children:`Remove ${e}`}),(0,T.jsx)(ii,{}),(0,T.jsx)("span",{className:"absolute -inset-1"})]})]}):null});ai.displayName="Badge";const li=Zt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ci=({variant:e="primary",size:t="md",icon:n=null,className:r=""})=>{const o={primary:"text-brand-primary-600",secondary:"text-background-primary"}[e],s={sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6",xl:"[&>svg]:size-8"}[t];return(0,T.jsx)("span",{className:Ut("flex",s,o,r),children:n||(0,T.jsx)(li,{className:"animate-spin shrink-0"})})},di=(0,Re.createContext)({}),ui=()=>(0,Re.useContext)(di),mi=(0,Re.forwardRef)(({children:e,icon:t=null,placeholder:n="Select an option",optionIcon:r=null,render:o,label:s,className:i,...a},l)=>{const{sizeValue:c,getReferenceProps:d,getValues:u,selectId:m,refs:p,isOpen:h,multiple:f,combobox:g,setSelected:v,onChange:b,isControlled:y,disabled:x,by:w}=ui(),k={sm:"xs",md:"sm",lg:"md"}[c],j=(0,Re.useCallback)(()=>{if(t)return t;const e="text-field-placeholder group-disabled:text-icon-disabled";return g?(0,T.jsx)(Jt,{className:e}):(0,T.jsx)(Qt,{className:e})},[t]),C=(0,Re.useCallback)(()=>{const t=u();if(!t)return null;if(f)return t.map((e,t)=>(0,T.jsx)(ai,{className:"cursor-default",icon:r,type:"rounded",size:k,onMouseDown:S(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,...f?{onClose:S(t)}:{}};n=e(r)}return((0,Re.isValidElement)(e)||"string"==typeof e)&&"function"!=typeof o&&(n=e),(0,T.jsx)("span",{className:Ut("truncate",ti[c].displaySelected,ni),children:n})},[u,x]),S=e=>t=>{t?.preventDefault(),t?.stopPropagation();const n=[...u()??[]],r=n.findIndex(t=>null!==t&&null!==e&&"object"==typeof t?t[w]===e[w]:t===e);-1!==r&&(n.splice(r,1),y||v(n),"function"==typeof b&&b(n))};return(0,T.jsxs)("div",{className:"w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[!!s&&(0,T.jsx)("label",{className:Ut(ti[c]?.label,"text-field-label"),htmlFor:m,children:s}),(0,T.jsxs)("button",{id:m,ref:ei(p.setReference,l),className:Ut("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",ti[c].selectButton,f&&ti[c].multiSelect,"group disabled:outline-field-border-disabled [&:hover:has(:disabled)]:outline-field-border-disabled disabled:cursor-default",i),tabIndex:0,disabled:x,...a,...d(),children:[(0,T.jsxs)("div",{className:Ut("flex-1 grid items-center justify-start gap-1.5 overflow-hidden",u()&&"flex flex-wrap"),children:[C(),(f?!u()?.length:!u())&&(0,T.jsx)("div",{className:Ut("[grid-area:1/1/2/3] text-field-input px-1",ti[c].displaySelected,ni),children:n})]}),(0,T.jsx)("div",{className:Ut("flex items-center [&>svg]:shrink-0",ti[c].icon),children:j()})]})]})});function pi({label:e,children:t,className:n,...r}){const{index:o,totalGroups:s}=r,{sizeValue:i}=ui();return(0,T.jsxs)(Re.Fragment,{children:[(0,T.jsxs)("div",{className:"flex flex-col",role:"group","aria-label":e,children:[(0,T.jsx)("div",{className:Ut("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,T.jsx)("div",{className:"flex flex-col",role:"presentation","aria-labelledby":`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:t})]}),o<s&&!!(t&&Re.Children.count(t)>0)&&(0,T.jsx)("hr",{className:Ut("h-px my-2 w-full border-border-subtle border-b border-t-0 border-solid",ri[i])})]})}function hi({children:e,className:t}){const{isOpen:n,context:r,refs:o,combobox:s,floatingStyles:i,getFloatingProps:a,sizeValue:l,setSearchKeyword:c,setActiveIndex:d,setSelectedIndex:u,value:m,selected:p,getValues:h,searchKeyword:f,listContentRef:g,by:v,searchPlaceholder:b,activeIndex:y,searchFn:x,debounceDelay:w}=ui(),k=(0,Re.useMemo)(()=>{const t=h();let n=-1;if(t){let r=Re.Children.toArray(e);r.length>0&&(0,Re.isValidElement)(r[0])&&r[0].type===pi&&(r=Re.Children.toArray(e).map(e=>(0,Re.isValidElement)(e)?Re.Children.toArray(e.props.children):[]).flat()),n=r.findIndex(e=>{if(!(0,Re.isValidElement)(e))return!1;const n=e.props.value;return"object"==typeof n&&"object"==typeof t?n[v]===t[v]:n===t})}return n},[m,p,e,v]);(0,Re.useLayoutEffect)(()=>{n||(d(k),u(k))},[k,n]),(0,Re.useLayoutEffect)(()=>{n&&(s&&[-1,null].includes(y)||d(-1))},[f,n]);const j=(0,Re.useMemo)(()=>{let t=0,n=0;Re.Children.forEach(e,e=>{if((0,Re.isValidElement)(e)&&e.type===pi){let n=!1;if(f&&!x){const t=f.toLowerCase(),r=(e.props.label?.toLowerCase()||"").includes(t),o=Re.Children.toArray(e.props.children).some(e=>!!(0,Re.isValidElement)(e)&&(si(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 Re.Children.map(e,e=>{if(!(0,Re.isValidElement)(e))return null;if(e.type===pi){let t=!1;if(f&&!x){const n=f.toLowerCase();t=(e.props.label?.toLowerCase()||"").includes(n)}const s=Re.Children.map(e.props.children,e=>{if(!(0,Re.isValidElement)(e))return null;if(t){const t={...e.props,index:r++};return(0,Re.cloneElement)(e,t)}if(f&&!x){const t=si(e.props.children)?.toLowerCase(),n=f.toLowerCase();if(!t?.includes(n))return null}const n={...e.props,index:r++};return(0,Re.cloneElement)(e,n)});if(!s?.some(e=>null!==e))return null;const i={...e.props,children:s,index:o,totalGroups:n};return o++,(0,Re.cloneElement)(e,i)}if(f&&!x){const t=si(e.props?.children)?.toLowerCase(),n=f.toLowerCase();if(!t?.includes(n))return null}return(0,Re.cloneElement)(e,{...e.props,index:r++})})},[f,m,p,e,x]),C=Re.Children.count(j);(0,Re.useEffect)(()=>{g.current=[];let t=Re.Children.toArray(e);t&&(0,Re.isValidElement)(t[0])&&t[0].type===pi&&(t=Re.Children.toArray(t).map(e=>(0,Re.isValidElement)(e)?e.props.children:null).filter(Boolean)),Re.Children.forEach(t,e=>{if(!(0,Re.isValidElement)(e))return;const t=si(e.props?.children)?.toLowerCase();if(f&&!x){const e=f.toLowerCase();if(!t?.includes(e))return}g.current.push(t)})},[f,x]);const[S,E]=(0,Re.useState)(!1),P=(0,Re.useCallback)(async()=>{if(x&&"function"==typeof x&&!S){E(!0);try{await x(f)}catch(e){console.error(e)}finally{E(!1)}}},[f]),N=((e,t=500)=>{const n=(0,Re.useRef)(null);return(0,Re.useCallback)((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>e(...r),t)},[e,t])})(P,w);return(0,Re.useEffect)(()=>{"function"==typeof x&&N()},[N]),(0,T.jsx)(T.Fragment,{children:n&&(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(hs,{context:r,modal:!1,visuallyHiddenDismiss:!0,children:(0,T.jsxs)("div",{ref:o.setFloating,className:Ut("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg outline outline-1 outline-border-subtle",s&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",ti[l].dropdown,!s&&"h-auto",s?"overflow-hidden":"overflow-y-auto overflow-x-hidden",t),style:{...i,zIndex:1},...a(),children:[s&&(0,T.jsxs)("div",{className:Ut(ti[l].searchbarWrapper),children:[S?(0,T.jsx)(ci,{className:ti[l].searchbarIcon}):(0,T.jsx)(en,{className:Ut("text-icon-secondary shrink-0",ti[l].searchbarIcon)}),(0,T.jsx)("input",{className:Ut("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",ti[l].searchbar),type:"search",name:"keyword",placeholder:b,onChange:e=>c(e.target.value),value:f,autoComplete:"off"})]}),(0,T.jsxs)("div",{className:Ut("overflow-y-auto overflow-x-hidden",!s&&"w-full h-full",ti[l].dropdownItemsWrapper),children:[!!C&&j,!C&&(0,T.jsx)("div",{className:Ut("p-2 text-center font-medium text-field-placeholder",oi[l]),children:"No items found"})]})]})})})})}function fi({children:e,root:t,id:n}){return(0,T.jsx)(is,{id:n,root:t,children:e})}function gi({value:e,selected:t,children:n,className:r,...o}){const{sizeValue:s,getItemProps:i,onKeyDownItem:a,onClickItem:l,activeIndex:c,selectedIndex:d,updateListRef:u,getValues:m,by:p,multiple:h}=ui(),{index:f}=o,g=(0,Re.useRef)(f),v=(0,Re.useMemo)(()=>{if(!h)return!1;const t=m();return!!t&&t.some(t=>null!==t&&null!==e&&"object"==typeof t?t[p]===e[p]:t===e)},[e,m]),b=(0,Re.useMemo)(()=>"boolean"==typeof t?t:h?v:f===d,[v,d,t]);return(0,T.jsxs)("div",{className:Ut("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",oi[s],f===c&&"bg-button-tertiary-hover",r),ref:e=>{u(f,e)},role:"option",tabIndex:f===c?0:-1,"aria-selected":b&&f===c,...i({onClick(){l(g.current,e)},onKeyDown(t){a(t,g.current,e)}}),children:[(0,T.jsx)("span",{className:"w-full truncate",children:n}),b&&(0,T.jsx)(tn,{className:Ut("text-icon-on-color-disabled",{sm:"size-4",md:"size-4",lg:"size-5"}[s])})]})}const vi=({id:e,size:t="md",value:n,defaultValue:r,onChange:o,by:s="id",children:i,multiple:a=!1,combobox:l=!1,disabled:c=!1,searchPlaceholder:d="Search...",searchFn:u,debounceDelay:m=500})=>{const p=(0,Re.useMemo)(()=>e||`select-${Ws()}`,[e]),h=(0,Re.useMemo)(()=>typeof n<"u",[n]),[f,g]=(0,Re.useState)(r),[v,b]=(0,Re.useState)(""),y=(0,Re.useCallback)(()=>h?n:f,[h,n,f]),[x,w]=(0,Re.useState)(!1),[k,j]=(0,Re.useState)(null),[C,S]=(0,Re.useState)(null),E={sm:l?256:172,md:l?256:216,lg:l?256:216},{refs:P,floatingStyles:N,context:_}=Ss({strategy:"fixed",placement:"bottom-start",open:x,onOpenChange:w,whileElementsMounted:Gr,middleware:[ro(5),so({padding:10}),io({apply({rects:e,elements:n,availableHeight:r}){Object.assign(n.floating.style,{maxHeight:`min(${r}px, ${E[t]}px)`,maxWidth:`${e.reference.width}px`})},padding:10})]}),R=(0,Re.useRef)([]),A=(0,Re.useRef)([]),M=(0,Re.useRef)(!1),L=xs(_,{event:"mousedown"}),I=Cs(_),D=Os(_,{role:"listbox"}),O=Is(_,{listRef:R,activeIndex:k,selectedIndex:C,onNavigate:j,loop:!0}),F=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:d=null,resetMs:u=750,ignoreKeys:m=[],selectedIndex:p=null}=t,h=Re.useRef(),f=Re.useRef(""),g=Re.useRef(null!=(n=null!=p?p:i)?n:-1),v=Re.useRef(null),b=uo(a),y=uo(l),x=Do(d),w=Do(m);Co(()=>{r&&(clearTimeout(h.current),v.current=null,f.current="")},[r]),Co(()=>{var e;r&&""===f.current&&(g.current=null!=(e=null!=p?p:i)?e:-1)},[r,p,i]);const k=uo(e=>{e?o.current.typing||(o.current.typing=e,y(e)):o.current.typing&&(o.current.typing=e,y(e))}),j=uo(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=s.current;if(f.current.length>0&&" "!==f.current[0]&&(-1===t(n,n,f.current)?k(!1):" "===e.key&&$n(e)),null==n||w.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&($n(e),k(!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())})&&f.current===e.key&&(f.current="",g.current=v.current),f.current+=e.key,clearTimeout(h.current),h.current=setTimeout(()=>{f.current="",g.current=v.current,k(!1)},u);const o=g.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],f.current);-1!==i?(b(i),v.current=i):" "!==e.key&&(f.current="",k(!1))}),C=Re.useMemo(()=>({onKeyDown:j}),[j]),S=Re.useMemo(()=>({onKeyDown:j,onKeyUp(e){" "===e.key&&k(!1)}}),[j,k]);return Re.useMemo(()=>c?{reference:C,floating:S}:{},[c,C,S])}(_,{listRef:A,activeIndex:k,selectedIndex:C,onMatch:x?j:S,onTypingChange(e){M.current=e}}),{getReferenceProps:V,getFloatingProps:z,getItemProps:B}=Ns([I,D,O,L,...l?[]:[F]]),$=(e,t)=>{if(a)return((e,t)=>{const n=[...y()??[]];-1===n.findIndex(e=>null!==e&&null!==t&&"object"==typeof e?e[s]===t[s]:e===t)&&(n.push(t),h||g(n),S(e),P.reference.current.focus(),w(!1),b(""),"function"==typeof o&&o(n))})(e,t);S(e),h||g(t),P.reference.current.focus(),w(!1),b(""),"function"==typeof o&&o(t)},W=(0,Re.useCallback)((e,t)=>{R.current[e]=t},[]);return(0,T.jsx)(di.Provider,{value:{selectedIndex:C,setSelectedIndex:S,activeIndex:k,setActiveIndex:j,selected:f,setSelected:g,handleSelect:$,combobox:l,sizeValue:t,multiple:a,onChange:o,isTypingRef:M,getItemProps:B,onClickItem:(e,t)=>{$(e,t)},onKeyDownItem:(e,t,n)=>{"Enter"===e.key&&(e.preventDefault(),$(t,n))," "===e.key&&!M.current&&(e.preventDefault(),$(t,n))},getValues:y,selectId:p,getReferenceProps:V,isOpen:x,value:n,updateListRef:W,refs:P,listContentRef:A,by:s,getFloatingProps:z,floatingStyles:N,context:_,searchKeyword:v,setSearchKeyword:b,disabled:c,isControlled:h,searchPlaceholder:d,searchFn:u,debounceDelay:m},children:i})};vi.displayName="Select";const bi=Object.assign(vi,{Portal:fi,Button:mi,Options:hi,Option:gi,OptionGroup:pi});fi.displayName="Select.Portal",mi.displayName="Select.Button",hi.displayName="Select.Options",gi.displayName="Select.Option",pi.displayName="Select.OptionGroup";const yi=Zt("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"}]]),xi=(0,Re.forwardRef)(({id:e,type:t="text",defaultValue:n="",value:r,size:o="sm",className:s="",disabled:i=!1,onChange:a=()=>{},error:l=!1,onError:c=()=>{},prefix:d=null,suffix:u=null,label:m="",...p},h)=>{const f=(0,Re.useRef)(null),g=(0,Re.useMemo)(()=>e||`input-${t}-${Ws()}`,[e]),v=(0,Re.useMemo)(()=>typeof r<"u",[r]),[b,y]=(0,Re.useState)(n),[x,w]=(0,Re.useState)(null),k=(0,Re.useCallback)(()=>v?r:b,[v,r,b]),j=e=>{if(i)return;let n;"file"===t?(n=e.target.files,n&&n.length>0?w(n[0].name):w(null)):n=e.target.value,!v&&"file"!==t&&y(n),"function"==typeof a&&a(n)},C=()=>{w(null),f.current&&(f.current.value=""),a(null)},S="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",E={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"},P={xs:"text-xs font-medium",sm:"text-sm font-medium",md:"text-sm font-medium",lg:"text-base font-medium"},N={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-base"},_={sm:d?"pl-8":"",md:d?"pl-9":"",lg:d?"pl-10":""},R={sm:u?"pr-8":"",md:u?"pr-9":"",lg:u?"pr-10":""},A=i?"hover:outline-border-disabled":"hover:outline-border-strong",M="focus:outline-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",L=l?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",I=l?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",D=i?"outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",O=i?"outline-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",F="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",V=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",z={xs:"[&>svg]:size-4",sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6"},B=(0,Re.useMemo)(()=>m?(0,T.jsx)(Kt,{className:Ut(P[o]),htmlFor:g,...p?.required&&{required:!0},children:m}):null,[m,o,g]),$=x?"file:border-0 file:bg-transparent pr-10":"text-text-tertiary file:border-0 file:bg-transparent pr-10";return"file"===t?(0,T.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[B,(0,T.jsxs)("div",{className:Ut("w-full relative flex focus-within:z-10",s),children:[(0,T.jsx)("input",{ref:ei(f,h),id:g,type:"file",className:Ut(S,O,E[o],N[o],M,A,I,$),disabled:i,onChange:j,onInvalid:c,...p}),(0,T.jsx)("div",{className:Ut(V,"right-0 pr-3",z[o]),children:(0,T.jsx)(yi,{})})]})]}):(0,T.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[B,(0,T.jsxs)("div",{className:Ut("w-full relative flex focus-within:z-10",s),children:[d?(0,T.jsx)("div",{className:Ut(F,"left-0 pl-3",N[o]),children:d}):null,(0,T.jsx)("input",{ref:ei(f,h),id:g,type:t,className:Ut(S,D,E[o],N[o],_[o],R[o],M,A,L),disabled:i,onChange:j,onInvalid:c,value:k(),...p}),"file"===t?x?(0,T.jsx)("div",{className:Ut(V,"right-0 pr-3 cursor-pointer z-20 pointer-events-auto",z[o]),onClick:C,role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&C()},children:(0,T.jsx)(ii,{})}):(0,T.jsx)("div",{className:Ut(V,"right-0 pr-3",z[o]),children:(0,T.jsx)(yi,{})}):u?(0,T.jsx)("div",{className:Ut(F,"right-0 pr-3",N[o]),children:u}):null]})]})});xi.displayName="Input";const wi={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"}},ki={sm:"text-sm leading-5",md:"text-base leading-6"},ji={sm:{checkbox:"size-4",icon:"size-1.5",info:"size-4"},md:{checkbox:"size-5",icon:"size-2",info:"size-5"}},Ci={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"},Si=({variant:e="dark",placement:t="bottom",title:n="",content:r,arrow:o=!1,open:s,setOpen:i,children:a,className:l,tooltipPortalRoot:c,tooltipPortalId:d,boundary:u="clippingAncestors",strategy:m="fixed",offset:p=8,triggers:h=["hover","focus"],interactive:f=!1})=>{const g=(0,Re.useMemo)(()=>"boolean"==typeof s&&"function"==typeof i,[s,i]),[v,b]=(0,Re.useState)(!1),y=(0,Re.useRef)(null),{refs:x,floatingStyles:w,context:k}=Ss({open:g?s:v,onOpenChange:g?i:b,placement:t,strategy:m,middleware:[ro(p),so({boundary:u}),oo({boundary:u}),ao({element:y})],whileElementsMounted:Gr}),j=xs(k,{enabled:!g&&h.includes("click")}),C=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:d=!1,restMs:u=0,move:m=!0}=t,p=Lo(),h=Mo(),f=Do(c),g=Do(l),v=Do(n),b=Re.useRef(),y=Re.useRef(-1),x=Re.useRef(),w=Re.useRef(-1),k=Re.useRef(!0),j=Re.useRef(!1),C=Re.useRef(()=>{}),S=Re.useRef(!1),E=Re.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]);Re.useEffect(()=>{if(a)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(y.current),clearTimeout(w.current),k.current=!0,S.current=!1)}},[a,s]),Re.useEffect(()=>{if(!a)return;if(!f.current)return;if(!n)return;function e(e){E()&&r(!1,e,"hover")}const t=Fn(i.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[i.floating,n,r,a,f,E]);const T=Re.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Fo(g.current,"close",b.current);o&&!x.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(clearTimeout(y.current),r(!1,e,n))},[g,r]),P=uo(()=>{C.current(),x.current=void 0}),N=uo(()=>{if(j.current){const e=Fn(i.floating).body;e.style.pointerEvents="",e.removeAttribute(Oo),j.current=!1}}),_=uo(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));Re.useEffect(()=>{if(a&&ln(i.domReference)){var e;const r=i.domReference;return n&&r.addEventListener("mouseleave",l),null==(e=i.floating)||e.addEventListener("mouseleave",l),m&&r.addEventListener("mousemove",t,{once:!0}),r.addEventListener("mouseenter",t),r.addEventListener("mouseleave",s),()=>{var e;n&&r.removeEventListener("mouseleave",l),null==(e=i.floating)||e.removeEventListener("mouseleave",l),m&&r.removeEventListener("mousemove",t),r.removeEventListener("mouseenter",t),r.removeEventListener("mouseleave",s)}}function t(e){if(clearTimeout(y.current),k.current=!1,d&&!On(b.current)||u>0&&!Fo(g.current,"open"))return;const t=Fo(g.current,"open",b.current);t?y.current=window.setTimeout(()=>{v.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function s(e){if(_())return;C.current();const t=Fn(i.floating);if(clearTimeout(w.current),S.current=!1,f.current&&o.current.floatingContext){n||clearTimeout(y.current),x.current=f.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){N(),P(),_()||T(e,!0,"safe-polygon")}});const r=x.current;return t.addEventListener("mousemove",r),void(C.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!Pn(i.floating,e.relatedTarget))&&T(e)}function l(e){_()||o.current.floatingContext&&(null==f.current||f.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){N(),P(),_()||T(e)}})(e))}},[i,a,e,d,u,m,T,P,N,r,n,v,p,g,f,o,_]),Co(()=>{var e;if(a&&n&&null!=(e=f.current)&&e.__options.blockPointerEvents&&E()){j.current=!0;const e=i.floating;if(ln(i.domReference)&&e){var t;const n=Fn(i.floating).body;n.setAttribute(Oo,"");const r=i.domReference,o=null==p||null==(t=p.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=""}}}},[a,n,h,i,p,f,E]),Co(()=>{n||(b.current=void 0,S.current=!1,P(),N())},[n,P,N]),Re.useEffect(()=>()=>{P(),clearTimeout(y.current),clearTimeout(w.current),N()},[a,i.domReference,P,N]);const R=Re.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){k.current||v.current||r(!0,t,"hover")}d&&!On(b.current)||n||0===u||S.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(w.current),"touch"===b.current?o():(S.current=!0,w.current=window.setTimeout(o,u)))}}},[d,r,n,v,u]),A=Re.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(e){_()||T(e.nativeEvent,!1)}}),[T,_]);return Re.useMemo(()=>a?{reference:R,floating:A}:{},[a,R,A])}(k,{move:!1,enabled:!g&&h.includes("hover"),...f&&{handleClose:$s()}}),S=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=Re.useRef(!1),d=Re.useRef(),u=Re.useRef(!0);Re.useEffect(()=>{if(!a)return;const e=on(i.domReference);function t(){!n&&cn(i.domReference)&&i.domReference===Tn(Fn(i.domReference))&&(c.current=!0)}function r(){u.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}},[i.domReference,n,a]),Re.useEffect(()=>{if(a)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,a]),Re.useEffect(()=>()=>{clearTimeout(d.current)},[]);const m=Re.useMemo(()=>({onPointerDown(e){Mn(e.nativeEvent)||(u.current=!1)},onMouseLeave(){c.current=!1},onFocus(e){if(c.current)return;const t=zn(e.nativeEvent);if(l&&ln(t))try{if(Ln()&&Dn())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!u.current&&!Bn(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){c.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=ln(t)&&t.hasAttribute(Io("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout(()=>{var e;const a=Tn(i.domReference?i.domReference.ownerDocument:document);(t||a!==i.domReference)&&(Pn(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,a)||Pn(i.domReference,a)||o||r(!1,n,"focus"))})}}),[s,i.domReference,r,l]);return Re.useMemo(()=>a?{reference:m}:{},[a,m])}(k,{enabled:!g&&h.includes("focus")}),E=Cs(k),P=Os(k,{role:"tooltip"}),{getReferenceProps:N,getFloatingProps:_}=Ns([j,C,S,E,P]),{isMounted:R,styles:A}=zs(k,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),M={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"}[e],L="dark"===e?"text-tooltip-background-dark":"text-tooltip-background-light";return(0,T.jsxs)(Re.Fragment,{children:[(0,Re.isValidElement)(a)&&(0,T.jsx)(Re.Fragment,{children:(0,Re.cloneElement)(a,{ref:ei(a.ref,x.setReference),className:Ut(a.props.className),...N()})},"tooltip-reference"),(0,T.jsx)(is,{id:d,root:c,children:R&&(0,T.jsxs)("div",{className:Ut("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",M,"max-w-80 w-fit",l),ref:x.setFloating,style:{...w,...A},..._(),children:[(0,T.jsxs)("div",{children:[!!n&&(0,T.jsx)("span",{className:"font-semibold",children:n},"tooltip-title"),!!r&&(0,T.jsx)("div",{className:"font-normal",children:r},"tooltip-content")]}),o&&(0,T.jsx)(_o,{ref:y,context:k,className:Ut("fill-current",L)})]})})]})};Si.displayName="Tooltip";const Ei=({label:e,switchId:t,disabled:n=!1,children:r,size:o})=>{const s={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"},a={xs:"space-y-0.5",sm:"space-y-0.5",md:"space-y-1"};if((0,Re.isValidElement)(e))return(0,T.jsxs)("div",{className:Ut("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,T.jsxs)("div",{className:Ut("inline-flex",c,"gap-3"),children:[r,(()=>{const{heading:r="",description:l=""}=e||{};return(0,T.jsxs)("div",{className:Ut("space-y-0.5",a[o]),children:[r&&(0,T.jsx)(Kt,{htmlFor:t,className:Ut("m-0",s[o]),...n&&{variant:"disabled"},children:r}),l&&(0,T.jsx)(Kt,{tag:"p",variant:"help",className:Ut("text-sm font-normal leading-5 m-0",i[o]),...n&&{variant:"disabled"},children:l})]})})()]})},Ti=(0,Re.forwardRef)(({id:e,onChange:t,value:n,defaultValue:r=!1,size:o="sm",disabled:s=!1,label:i={heading:"",description:""},name:a,className:l,...c},d)=>{const u="lg"===o?"md":o,m=(0,Re.useMemo)(()=>typeof n<"u",[n]),p=(0,Re.useMemo)(()=>e||`switch-${Ws()}`,[]),[h,f]=(0,Re.useState)(r),g="primary",v=(0,Re.useCallback)(()=>m?n:h,[m,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"}},y={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,T.jsx)(Ei,{label:i,switchId:p,disabled:s,size:u,children:(0,T.jsxs)("div",{className:Ut("relative group/switch inline-block cursor-pointer rounded-full shrink-0",y[u].container,l),children:[(0,T.jsx)("input",{ref:d,id:p,type:"checkbox",className:Ut("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[g].input,s&&"bg-toggle-off-disabled disabled:border-transparent disabled:cursor-not-allowed checked:disabled:bg-toggle-on-disabled disabled:shadow-toggle-disabled",!s&&{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"}}[g].input),checked:v(),onChange:e=>{if(s)return;const n=e.target.checked;m||f(n),"function"==typeof t&&t(n)},disabled:s,name:a,...c}),(0,T.jsx)("label",{htmlFor:p,className:Ut("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",y[u].toggleDial,b[g].toggleDial,s&&"peer-disabled:cursor-not-allowed",!s&&{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"}[u])})]})})});Ti.displayName="Switch";const Pi=(0,Re.createContext)({}),Ni=()=>(0,Re.useContext)(Pi),_i=({children:e,name:t,style:n="simple",size:r="md",value:o,defaultValue:s,by:i="id",as:a="div",onChange:l,className:c,disableGroup:d=!1,vertical:u=!1,columns:m=4,multiSelection:p=!1,gapClassName:h="gap-2"})=>{const f=(0,Re.useMemo)(()=>typeof o<"u",[o]),g=(0,Re.useMemo)(()=>t||`radio-button-group-${Ws()}`,[t]);let v;v=f?o:p?s??[]:s;const[b,y]=(0,Re.useState)(v),x=(0,Re.useCallback)(e=>{if(p)y(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(f||y(e),"function"!=typeof l)return;l(e)}},[l]);c=Ut("grid grid-cols-4",qt[m],h,"tile"===n&&"gap-0",u&&"grid-cols-1",c);const w=Ut("tile"===n?"border border-border-subtle border-solid rounded-md shadow-sm":"gap-6",c),k=()=>(0,T.jsx)(Pi.Provider,{value:{name:g,value:f?o:b,by:i,onChange:x,isControlled:f,disableAll:d,style:n,columns:m,multiSelection:p,size:r},children:Re.Children.map(e,e=>(0,Re.isValidElement)(e)?e:null)});return(0,T.jsx)(T.Fragment,{children:"tile"===n?(0,T.jsx)("div",{className:w,children:k()}):(0,T.jsx)(a,{...a===Re.Fragment?{}:{className:c},children:k()})})};_i.displayName="RadioButton.Group";const Ri=(0,Re.forwardRef)(({id:e,label:t,value:n,children:r,disabled:o,icon:s=null,inlineIcon:i=!1,hideSelection:a=!1,reversePosition:l=!1,borderOn:c=!1,borderOnActive:d=!0,badgeItem:u=null,useSwitch:m=!1,info:p,minWidth:h=!0,...f},g)=>{const{buttonWrapperClasses:v,...b}=f,y=Ni(),{name:x,value:w,by:k,onChange:j,disableAll:C,checked:S,multiSelection:E,size:P="md"}=y,N="primary",_=(0,Re.useMemo)(()=>e||`radio-button-${Ws()}`,[e]),R=(0,Re.useMemo)(()=>C||o,[C,o]),A=(0,Re.useMemo)(()=>E?Array.isArray(w)&&w.includes(n):typeof S<"u"?S:typeof w==typeof n&&("string"==typeof w?w===n:Array.isArray(w)?w.includes(n):w[k]===n[k]),[w,n,S]),M=(0,Re.useCallback)(()=>(0,Re.isValidElement)(t)?t:t?.heading?(0,T.jsxs)("div",{className:Ut(!i&&{"space-y-3":"sm"===P,"space-y-4":"md"===P},l&&(m?"ml-10":"ml-4"),i&&"flex gap-2",i&&!t.description&&"items-center"),children:[s&&(0,T.jsx)(T.Fragment,{children:s}),(0,T.jsxs)("div",{className:Ut(!s||!m||s&&u?{"space-y-0.5":"sm"===P,"space-y-1":"md"===P}:"space-y-0.5"),children:[(0,T.jsx)("p",{className:Ut("text-text-primary font-medium m-0",ki[P],o&&"text-text-disabled cursor-not-allowed"),children:t.heading}),t.description&&(0,T.jsx)("p",{className:"text-text-tertiary text-sm font-normal leading-5 m-0",children:t.description})]})]}):null,[t]);if("tile"===y.style)return(0,T.jsx)(Ai,{id:e,label:t,value:n,disabled:o,size:P,children:r});const L=()=>{R||(E?m&&j(n,!A):j(n))};return(0,T.jsxs)("label",{className:Ut("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",d&&c&&A&&"outline-border-interactive",{"pl-3.5 pr-2.5 py-2.5":"sm"===P&&!(s&&m),"p-3":"sm"===P&&(s&&m||s&&u),"pl-4 pr-3 py-3":"md"===P&&!(s&&m),"p-4":"md"===P&&(s&&m||s&&u)},"pr-12",R&&"cursor-not-allowed opacity-40",v),htmlFor:_,onClick:L,children:[!!t&&(0,T.jsx)("label",{className:Ut("cursor-pointer",R&&"cursor-not-allowed"),htmlFor:_,children:M()}),!!p&&(0,T.jsx)("div",{className:"absolute mr-0.5 bottom-1.5 right-3",children:(0,T.jsx)(Si,{title:p?.heading,content:p?.description,children:(0,T.jsx)(Us,{className:Ut("text-text-primary",ji[P]?.info)})})}),(0,T.jsxs)("label",{className:Ut("absolute mr-0.5 right-3 flex items-center cursor-pointer rounded-full gap-2",l&&"left-0",R&&"cursor-not-allowed",i&&"mr-3"),onClick:L,children:[!!u&&u,!a&&(m?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(Ti,{defaultValue:!1,size:P,onChange:()=>{E?j(n,!A):j(n)},checked:A,...b,"aria-label":t?.heading??"Switch"})}):(0,T.jsxs)("span",{className:"relative p-0.5",children:[(0,T.jsx)("input",{ref:g,id:_,type:E?"checkbox":"radio",className:Ut("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",!E&&"rounded-full",wi[N].checkbox,ji[P].checkbox,R&&"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=>j(e.target.value),checked:A,disabled:R,...b}),(0,T.jsx)("span",{className:Ut("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",wi[N].icon,R&&"peer-disabled:text-border-disabled cursor-not-allowed"),children:E?(0,T.jsx)(tn,{className:"sm"===P?"size-3":"size-4"}):(0,T.jsx)("div",{className:Ut("rounded-full bg-current",ji[P]?.icon)})})]}))]})]})});Ri.displayName="RadioButton.Button";const Ai=({id:e,children:t,value:n,disabled:r,size:o="md",...s})=>{const i=Ni(),{name:a,value:l,by:c,onChange:d,disableAll:u,checked:m}=i||{},p=(0,Re.useMemo)(()=>e||`radio-button-${Ws()}`,[e]),h=(0,Re.useMemo)(()=>u||r,[u,r]),f=(0,Re.useMemo)(()=>typeof m<"u"?m:typeof l==typeof n&&("string"==typeof l?l===n:Array.isArray(l)?l.includes(n):!(!l||!c)&&l[c]===n[c]),[l,n,m,c]),g=Ut("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":"",Ci[o],"border-0 border-r border-border-subtle border-solid");return(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)("button",{type:"button",id:p,"aria-label":"Radio Button",className:Ut(g,"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",f&&"bg-button-disabled"),onClick:()=>{d&&d(n)},disabled:h,...s,children:[(0,T.jsx)("input",{type:"hidden",value:n,name:a,checked:f,onChange:e=>d?.(e.target.value)}),t]})})},Mi=Object.assign(Ri,{Group:_i,Button:Ri});function Li(...e){return M()(e)}(0,E.__)("Pending","suredonation"),(0,E.__)("Processing","suredonation"),(0,E.__)("Completed","suredonation"),(0,E.__)("Failed","suredonation"),(0,E.__)("Refunded","suredonation"),(0,E.__)("Partially Refunded","suredonation"),(0,E.__)("Cancelled","suredonation"),(0,E.__)("One Time","suredonation"),(0,E.__)("Recurring","suredonation"),(0,E.__)("Renewal","suredonation");const Ii=({className:e,cols:t,children:n})=>(0,T.jsx)(Mi.Group,{columns:t??S.Children.count(n),className:Li("gap-3 max-w-fit",e),size:"sm",children:n}),Di=({label:e,value:t,checked:n,onChange:r,className:o})=>(0,T.jsx)(Mi.Button,{borderOn:!0,borderOnActive:!0,label:{heading:e},buttonWrapperClasses:Li("py-2 pl-2.5 pr-10 max-w-fit min-w-full",n&&"outline-focus",o),onChange:r,value:t,checked:n});Di.displayName="RadioGroup.Option",Ii.Option=Di;const Oi=Ii,Fi={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"}},Vi={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"}},zi={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"}},Bi={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"}},$i={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"}},Wi={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"}},Ui={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"}},Hi={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"}},qi={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"}},Ki={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"}},Gi={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"}},Yi={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"}},Xi={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"}},Zi={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"}},Ji={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"}},Qi={sm:{0:"grow-0",1:"grow"},md:{0:"md:grow-0",1:"md:grow"},lg:{0:"lg:grow-0",1:"lg:grow"}},ea={sm:{0:"shrink-0",1:"shrink"},md:{0:"md:shrink-0",1:"md:shrink"},lg:{0:"lg:shrink-0",1:"lg:shrink"}},ta=(e,t,n,r="sm")=>{const o=[];switch(typeof e){case"object":for(const[r,s]of Object.entries(e))t[r]&&o.push(t?.[r]?.[s]??t?.[r]?.[n?.[r]]??"");break;case"string":case"number":const s=r;o.push(t?.[s]?.[e]??t?.[s]?.[n?.[s]]??"");break;default:if(void 0===e)break;o.push(t?.[r]?.[n]??"")}return o.join(" ")},na=({className:e,cols:t,gap:n,gapX:r,gapY:o,align:s,justify:i,gridFlow:a,colsSubGrid:l=!1,rowsSubGrid:c=!1,autoRows:d=!1,autoCols:u=!1,children:m,...p})=>{const h=ta(t,Fi,1),f=ta(n,Vi,"sm"),g=ta(r,zi,""),v=ta(o,Bi,""),b=ta(s,qi,""),y=ta(i,Hi,""),x=ta(a,Ui,"");return(0,T.jsx)("div",{className:Ut("grid",{"grid-cols-subgrid":l,"grid-rows-subgrid":c,"auto-cols-auto":u,"auto-rows-auto":d},h,f,g,v,b,y,x,e),...p,children:m})};na.Item=({className:e,children:t,colSpan:n,colStart:r,alignSelf:o,justifySelf:s,...i})=>{const a=ta(n,$i,0),l=ta(r,Wi,0),c=ta(o,Ki,""),d=ta(s,Gi,"");return(0,T.jsx)("div",{className:Ut(a,l,c,d,e),...i,children:t})};const ra=(0,Re.createContext)({}),oa=({containerType:e="flex",gap:t="sm",gapX:n,gapY:r,direction:o,justify:s,align:i,wrap:a,cols:l,className:c,children:d,...u})=>{if("grid"===e)return(0,T.jsx)(ra.Provider,{value:{containerType:e},children:(0,T.jsx)(na,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:d,align:i,justify:s,...u})});const m=ta(a,Xi,""),p=ta(t,Vi,"sm"),h=ta(n,zi,""),f=ta(r,Bi,""),g=ta(o,Yi,""),v=ta(s,Hi,""),b=ta(i,qi,""),y=Ut("flex",m,p,h,f,g,v,b,c);return(0,T.jsx)(ra.Provider,{value:{containerType:e,cols:l},children:"flex"===e?(0,T.jsx)("div",{className:y,children:d}):(0,T.jsx)(na,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:d,align:i,justify:s,...u})})},sa=({grow:e,shrink:t,order:n,alignSelf:r,justifySelf:o,className:s,children:i,...a})=>{const{containerType:l,cols:c}=(0,Re.useContext)(ra);if("grid"===l)return(0,T.jsx)(na.Item,{className:s,alignSelf:r,justifySelf:o,children:i,...a});const d=ta(r,Ki,""),u=ta(o,Gi,""),m=ta(e,Qi,0),p=ta(t,ea,0),h=ta(n,Ji,0),f=ta(c,Zi,1);return(0,T.jsx)("div",{className:Ut("box-border",m,p,h,d,u,f,s),children:i})};oa.Item=sa,oa.displayName="Container",sa.displayName="Container.Item";const ia=({title:e="",description:t="",icon:n=null,iconPosition:r="right",tag:o="h2",size:s="sm",className:i=""})=>{const a={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,T.jsx)(o,{className:Ut("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"}[s]),children:e});return t?(0,T.jsxs)("div",{className:i,children:[(0,T.jsxs)("div",{children:[n&&"left"===r&&(0,T.jsxs)("div",{className:Ut("flex items-center",a[s]),children:[n,l()]}),n&&"right"===r&&(0,T.jsxs)("div",{className:Ut("flex items-center",a[s]),children:[l(),n]}),!n&&l()]}),(0,T.jsx)("p",{className:Ut("text-text-secondary font-normal my-0",{xs:"text-sm",sm:"text-sm",md:"text-base",lg:"text-base"}[s]),children:t})]}):(0,T.jsxs)("div",{className:i,children:[n&&"left"===r&&(0,T.jsxs)("div",{className:Ut("flex items-center",a[s]),children:[n,l()]}),n&&"right"===r&&(0,T.jsxs)("div",{className:Ut("flex items-center",a[s]),children:[l(),n]}),!n&&l()]})},aa=Fe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),la=({children:e,title:t,className:n,onClickSave:r,onClickCancel:o,saveBtnDisabled:s=!1,isSaving:i=!1,showTitleHelpText:a=!1,titleHelpText:l=""})=>(0,T.jsxs)("div",{className:"pb-8 space-y-7",children:[(0,T.jsxs)(oa,{align:"center",justify:"between",children:[(0,T.jsxs)(oa,{className:"gap-0",direction:"column",children:[(0,T.jsx)(oa.Item,{className:"flex items-center gap-2",children:(0,T.jsx)(ia,{tag:"h4",title:t,size:"md"})}),a&&(0,T.jsx)(oa.Item,{children:(0,T.jsx)(Kt,{size:"sm",variant:"help",className:"text-text-on-button-disabled font-normal",children:l})})]}),(r||o)&&(0,T.jsxs)(oa,{align:"center",className:"gap-3",children:[r&&(0,T.jsx)(Ks,{size:"md",onClick:r,variant:"primary",disabled:s,iconPosition:"right",icon:i?(0,T.jsx)(aa,{className:"animate-spin size-4"}):null,children:i?(0,E.__)("Saving","suredonation"):(0,E.__)("Save","suredonation")}),o&&(0,T.jsx)(Ks,{size:"md",onClick:o,variant:"outline",children:(0,E.__)("Cancel","suredonation")})]})]}),(0,T.jsx)("div",{className:Li("bg-background-primary rounded-xl p-4 shadow-sm",n),children:e})]}),ca=(0,Re.createContext)({}),da=(0,Re.createContext)(null),ua="undefined"!=typeof window,ma=ua?Re.useLayoutEffect:Re.useEffect,pa=e=>e,ha=["read","resolveKeyframes","update","preRender","render","postRender"];function fa(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=ha.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const s=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(t){s.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const a=i&&r?t:n;return o&&s.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),s.delete(e)},process:e=>{i=e,r?o=!0:(r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,o&&(o=!1,l.process(e)))}};return l}(s),e),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:m}=i,p=()=>{const s=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(s-o.timestamp,40),1),o.timestamp=s,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),d.process(o),u.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))};return{schedule:ha.reduce((t,s)=>{const a=i[s];return t[s]=(t,s=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(p)),a.schedule(t,s,i)),t},{}),cancel:e=>{for(let t=0;t<ha.length;t++)i[ha[t]].cancel(e)},state:o,steps:i}}const{schedule:ga,cancel:va,state:ba,steps:ya}=fa("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:pa,!0);const xa=e=>!e.isLayoutDirty&&e.willUpdate(!1);function wa(){const e=new Set,t=new WeakMap,n=()=>e.forEach(xa);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 ka=e=>!0===e,ja=({children:e,id:t,inherit:n=!0})=>{const r=(0,Re.useContext)(ca),o=(0,Re.useContext)(da),[s,i]=function(){const e=function(){const e=(0,Re.useRef)(!1);return ma(()=>(e.current=!0,()=>{e.current=!1}),[]),e}(),[t,n]=(0,Re.useState)(0),r=(0,Re.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,Re.useCallback)(()=>ga.postRender(r),[r]),t]}(),a=(0,Re.useRef)(null),l=r.id||o;null===a.current&&((e=>ka(!0===e)||"id"===e)(n)&&l&&(t=t?l+"-"+t:l),a.current={id:t,group:ka(n)&&r.group||wa()});const c=(0,Re.useMemo)(()=>({...a.current,forceRender:s}),[i]);return(0,T.jsx)(ca.Provider,{value:c,children:e})};function Ca(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 Sa(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Ea=e=>Array.isArray(e);function Ta(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 Pa(e){return"string"==typeof e||Array.isArray(e)}function Na(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function _a(e,t,n,r){if("function"==typeof t){const[o,s]=Na(r);t=t(void 0!==n?n:e.custom,o,s)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,s]=Na(r);t=t(void 0!==n?n:e.custom,o,s)}return t}function Ra(e,t,n){const r=e.getProps();return _a(r,t,void 0!==n?n:r.custom,e)}const Aa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ma=["initial",...Aa];function La(e){let t;return()=>(void 0===t&&(t=e()),t)}const Ia=La(()=>void 0!==window.ScrollTimeline);class Da{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=>Ia()&&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 Oa extends Da{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function Fa(e,t){return e?e[t]||e.default||e:void 0}const Va=2e4;function za(e){let t=0,n=e.next(t);for(;!n.done&&t<Va;)t+=50,n=e.next(t);return t>=Va?1/0:t}function Ba(e){return"function"==typeof e}function $a(e,t){e.timeline=t,e.onfinish=null}const Wa=e=>Array.isArray(e)&&"number"==typeof e[0],Ua={linearEasing:void 0};function Ha(e,t){const n=La(e);return()=>{var e;return null!==(e=Ua[t])&&void 0!==e?e:n()}}const qa=Ha(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),Ka=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Ga=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let t=0;t<o;t++)r+=e(Ka(0,o-1,t))+", ";return`linear(${r.substring(0,r.length-2)})`};function Ya(e){return Boolean("function"==typeof e&&qa()||!e||"string"==typeof e&&(e in Za||qa())||Wa(e)||Array.isArray(e)&&e.every(Ya))}const Xa=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Za={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xa([0,.65,.55,1]),circOut:Xa([.55,0,1,.45]),backIn:Xa([.31,.01,.66,-.59]),backOut:Xa([.33,1.53,.69,.99])};function Ja(e,t){return e?"function"==typeof e&&qa()?Ga(e,t):Wa(e)?Xa(e):Array.isArray(e)?e.map(e=>Ja(e,t)||Za.easeOut):Za[e]:void 0}const Qa={x:!1,y:!1};function el(){return Qa.x||Qa.y}function tl(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 nl(e){return t=>{"touch"===t.pointerType||el()||e(t)}}const rl=(e,t)=>!!t&&(e===t||rl(e,t.parentElement)),ol=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,sl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),il=new WeakSet;function al(e){return t=>{"Enter"===t.key&&e(t)}}function ll(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function cl(e){return ol(e)&&!el()}const dl=e=>1e3*e,ul=e=>e/1e3,ml=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pl=new Set(ml),hl=new Set(["width","height","top","left","right","bottom",...ml]),fl=e=>Ea(e)?e[e.length-1]||0:e;let gl;function vl(){gl=void 0}const bl={now:()=>(void 0===gl&&bl.set(ba.isProcessing?ba.timestamp:performance.now()),gl),set:e=>{gl=e,queueMicrotask(vl)}};function yl(e,t){-1===e.indexOf(t)&&e.push(t)}function xl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class wl{constructor(){this.subscriptions=[]}add(e){return yl(this.subscriptions,e),()=>xl(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 kl(e,t){return t?e*(1e3/t):0}const jl={current:void 0};class Cl{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=bl.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){var t;this.current=e,this.updatedAt=bl.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}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 wl);const n=this.events[e].add(t);return"change"===e?()=>{n(),ga.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 jl.current&&jl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=bl.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return kl(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 Sl(e,t){return new Cl(e,t)}function El(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Sl(n))}const Tl=e=>Boolean(e&&e.getVelocity);function Pl(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Tl(r)&&r.add))return n.add(t);var r}const Nl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_l="data-"+Nl("framerAppearId");function Rl(e){return e.props[_l]}const Al=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ml(e,t,n,r){if(e===t&&n===r)return pa;return o=>0===o||1===o?o:Al(function(e,t,n,r,o){let s,i,a=0;do{i=t+(n-t)/2,s=Al(i,r,o)-e,s>0?n=i:t=i}while(Math.abs(s)>1e-7&&++a<12);return i}(o,0,1,e,n),t,r)}const Ll=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Il=e=>t=>1-e(1-t),Dl=Ml(.33,1.53,.69,.99),Ol=Il(Dl),Fl=Ll(Ol),Vl=e=>(e*=2)<1?.5*Ol(e):.5*(2-Math.pow(2,-10*(e-1))),zl=e=>1-Math.sin(Math.acos(e)),Bl=Il(zl),$l=Ll(zl),Wl=e=>/^0[^.\s]+$/u.test(e);function Ul(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||Wl(e)}const Hl=(e,t,n)=>n>t?t:n<e?e:n,ql={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Kl={...ql,transform:e=>Hl(0,1,e)},Gl={...ql,default:1},Yl=e=>Math.round(1e5*e)/1e5,Xl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Zl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Jl=(e,t)=>n=>Boolean("string"==typeof n&&Zl.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ql=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,s,i,a]=r.match(Xl);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},ec={...ql,transform:e=>Math.round((e=>Hl(0,255,e))(e))},tc={test:Jl("rgb","red"),parse:Ql("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ec.transform(e)+", "+ec.transform(t)+", "+ec.transform(n)+", "+Yl(Kl.transform(r))+")"},nc={test:Jl("#"),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:tc.transform},rc=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),oc=rc("deg"),sc=rc("%"),ic=rc("px"),ac=rc("vh"),lc=rc("vw"),cc={...sc,parse:e=>sc.parse(e)/100,transform:e=>sc.transform(100*e)},dc={test:Jl("hsl","hue"),parse:Ql("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+sc.transform(Yl(t))+", "+sc.transform(Yl(n))+", "+Yl(Kl.transform(r))+")"},uc={test:e=>tc.test(e)||nc.test(e)||dc.test(e),parse:e=>tc.test(e)?tc.parse(e):dc.test(e)?dc.parse(e):nc.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?tc.transform(e):dc.transform(e)},mc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,pc="number",hc="color",fc=/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 gc(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const i=t.replace(fc,e=>(uc.test(e)?(r.color.push(s),o.push(hc),n.push(uc.parse(e))):e.startsWith("var(")?(r.var.push(s),o.push("var"),n.push(e)):(r.number.push(s),o.push(pc),n.push(parseFloat(e))),++s,"${}")).split("${}");return{values:n,split:i,indexes:r,types:o}}function vc(e){return gc(e).values}function bc(e){const{split:t,types:n}=gc(e),r=t.length;return e=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],void 0!==e[s]){const t=n[s];o+=t===pc?Yl(e[s]):t===hc?uc.transform(e[s]):e[s]}return o}}const yc=e=>"number"==typeof e?0:e,xc={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Xl))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(mc))||void 0===n?void 0:n.length)||0)>0},parse:vc,createTransformer:bc,getAnimatableNone:function(e){const t=vc(e);return bc(e)(t.map(yc))}},wc=new Set(["brightness","contrast","saturate","opacity"]);function kc(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Xl)||[];if(!r)return e;const o=n.replace(r,"");let s=wc.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const jc=/\b([a-z-]*)\(.*?\)/gu,Cc={...xc,getAnimatableNone:e=>{const t=e.match(jc);return t?t.map(kc).join(" "):e}},Sc={borderWidth:ic,borderTopWidth:ic,borderRightWidth:ic,borderBottomWidth:ic,borderLeftWidth:ic,borderRadius:ic,radius:ic,borderTopLeftRadius:ic,borderTopRightRadius:ic,borderBottomRightRadius:ic,borderBottomLeftRadius:ic,width:ic,maxWidth:ic,height:ic,maxHeight:ic,top:ic,right:ic,bottom:ic,left:ic,padding:ic,paddingTop:ic,paddingRight:ic,paddingBottom:ic,paddingLeft:ic,margin:ic,marginTop:ic,marginRight:ic,marginBottom:ic,marginLeft:ic,backgroundPositionX:ic,backgroundPositionY:ic},Ec={rotate:oc,rotateX:oc,rotateY:oc,rotateZ:oc,scale:Gl,scaleX:Gl,scaleY:Gl,scaleZ:Gl,skew:oc,skewX:oc,skewY:oc,distance:ic,translateX:ic,translateY:ic,translateZ:ic,x:ic,y:ic,z:ic,perspective:ic,transformPerspective:ic,opacity:Kl,originX:cc,originY:cc,originZ:ic},Tc={...ql,transform:Math.round},Pc={...Sc,...Ec,zIndex:Tc,size:ic,fillOpacity:Kl,strokeOpacity:Kl,numOctaves:Tc},Nc={...Pc,color:uc,backgroundColor:uc,outlineColor:uc,fill:uc,stroke:uc,borderColor:uc,borderTopColor:uc,borderRightColor:uc,borderBottomColor:uc,borderLeftColor:uc,filter:Cc,WebkitFilter:Cc},_c=e=>Nc[e];function Rc(e,t){let n=_c(e);return n!==Cc&&(n=xc),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ac=new Set(["auto","none","0"]),Mc=e=>e===ql||e===ic,Lc=(e,t)=>parseFloat(e.split(", ")[t]),Ic=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Lc(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Lc(t[1],e):0}},Dc=new Set(["x","y","z"]),Oc=ml.filter(e=>!Dc.has(e)),Fc={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:Ic(4,13),y:Ic(5,14)};Fc.translateX=Fc.x,Fc.translateY=Fc.y;const Vc=new Set;let zc=!1,Bc=!1;function $c(){if(Bc){const e=Array.from(Vc).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 Oc.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)})}Bc=!1,zc=!1,Vc.forEach(e=>e.complete()),Vc.clear()}function Wc(){Vc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bc=!0)})}class Uc{constructor(e,t,n,r,o,s=!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=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Vc.add(this),zc||(zc=!0,ga.read(Wc),ga.resolveKeyframes($c))):(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(),s=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,s);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=s),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),Vc.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Vc.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let Hc=pa,qc=pa;const Kc=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Gc=e=>t=>"string"==typeof t&&t.startsWith(e),Yc=Gc("--"),Xc=Gc("var(--"),Zc=e=>!!Xc(e)&&Jc.test(e.split("/*")[0].trim()),Jc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ed(e,t,n=1){qc(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=Qc.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const e=s.trim();return Kc(e)?parseFloat(e):e}return Zc(o)?ed(o,t,n+1):o}const td=e=>t=>t.test(e),nd=[ql,ic,sc,oc,lc,ac,{test:e=>"auto"===e,parse:e=>e}],rd=e=>nd.find(td(e));class od extends Uc{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(),Zc(r))){const o=ed(r,t.current);void 0!==o&&(e[n]=o),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!hl.has(n)||2!==e.length)return;const[r,o]=e,s=rd(r),i=rd(o);if(s!==i)if(Mc(s)&&Mc(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++)Ul(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&&!Ac.has(t)&&gc(t).values.length&&(r=e[o]),o++}if(r&&n)for(const o of t)e[o]=Rc(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=Fc[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 s=r.length-1,i=r[s];r[s]=Fc[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 sd=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!xc.test(e)&&"0"!==e||e.startsWith("url(")));function id(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const s=e[e.length-1],i=sd(o,t),a=sd(s,t);return Hc(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!(!i||!a)&&(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||Ba(n))&&r)}const ad=e=>null!==e;function ld(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(ad),s=t&&"loop"!==n&&t%2==1?0:o.length-1;return s&&void 0!==r?r:o[s]}class cd{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=bl.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Wc(),$c()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=bl.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:s,onComplete:i,onUpdate:a,isGenerator:l}=this.options;if(!l&&!id(e,n,r,o)){if(!s)return a&&a(ld(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 dd=(e,t,n)=>e+(t-e)*n;function ud(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 md(e,t){return n=>n>0?t:e}const pd=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},hd=[nc,tc,dc];function fd(e){const t=(n=e,hd.find(e=>e.test(n)));var n;if(Hc(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===dc&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,s=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=ud(a,r,e+1/3),s=ud(a,r,e),i=ud(a,r,e-1/3)}else o=s=i=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*i),alpha:r}}(r)),r}const gd=(e,t)=>{const n=fd(e),r=fd(t);if(!n||!r)return md(e,t);const o={...n};return e=>(o.red=pd(n.red,r.red,e),o.green=pd(n.green,r.green,e),o.blue=pd(n.blue,r.blue,e),o.alpha=dd(n.alpha,r.alpha,e),tc.transform(o))},vd=(e,t)=>n=>t(e(n)),bd=(...e)=>e.reduce(vd),yd=new Set(["none","hidden"]);function xd(e,t){return n=>dd(e,t,n)}function wd(e){return"number"==typeof e?xd:"string"==typeof e?Zc(e)?md:uc.test(e)?gd:Cd:Array.isArray(e)?kd:"object"==typeof e?uc.test(e)?gd:jd:md}function kd(e,t){const n=[...e],r=n.length,o=e.map((e,n)=>wd(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function jd(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=wd(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Cd=(e,t)=>{const n=xc.createTransformer(t),r=gc(e),o=gc(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?yd.has(e)&&!o.values.length||yd.has(t)&&!r.values.length?function(e,t){return yd.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):bd(kd(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],a=e.indexes[i][o[i]],l=null!==(n=e.values[a])&&void 0!==n?n:0;r[s]=l,o[i]++}return r}(r,o),o.values),n):(Hc(!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.`),md(e,t))};function Sd(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?dd(e,t,n):wd(e)(e,t)}function Ed(e,t,n){const r=Math.max(t-5,0);return kl(n-e(r),t-r)}const Td=.01,Pd=2,Nd=.005,_d=.5;const Rd=12;function Ad(e,t){return e*Math.sqrt(1-t*t)}const Md=["duration","bounce"],Ld=["stiffness","damping","mass"];function Id(e,t){return t.some(t=>void 0!==e[t])}function Dd(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:u,velocity:m,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Id(e,Ld)&&Id(e,Md))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),o=r*r,s=2*Hl(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:1,stiffness:o,damping:s}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:r=1}){let o,s;Hc(e<=dl(10),"Spring duration must be 10 seconds or less");let i=1-t;i=Hl(.05,1,i),e=Hl(.01,10,ul(e)),i<1?(o=t=>{const r=t*i,o=r*e;return.001-(r-n)/Ad(t,i)*Math.exp(-o)},s=t=>{const r=t*i*e,s=r*n+n,a=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Ad(Math.pow(t,2),i);return(.001-o(t)>0?-1:1)*((s-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,s=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n<Rd;n++)r-=e(r)/t(r);return r}(o,s,5/e);if(e=dl(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,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:-ul(n.velocity||0)}),h=m||0,f=c/(2*Math.sqrt(l*d)),g=i-s,v=ul(Math.sqrt(l/d)),b=Math.abs(g)<5;let y;if(r||(r=b?Td:Pd),o||(o=b?Nd:_d),f<1){const e=Ad(v,f);y=t=>{const n=Math.exp(-f*v*t);return i-n*((h+f*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===f)y=e=>i-Math.exp(-v*e)*(g+(h+v*g)*e);else{const e=v*Math.sqrt(f*f-1);y=t=>{const n=Math.exp(-f*v*t),r=Math.min(e*t,300);return i-n*((h+f*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const x={calculatedDuration:p&&u||null,next:e=>{const t=y(e);if(p)a.done=e>=u;else{let n=0;f<1&&(n=0===e?dl(h):Ed(y,e,t));const s=Math.abs(n)<=r,l=Math.abs(i-t)<=o;a.done=s&&l}return a.value=a.done?i:t,a},toString:()=>{const e=Math.min(za(x),Va),t=Ga(t=>x.next(e*t).value,e,30);return e+"ms "+t}};return x}function Od({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],m={done:!1,value:u},p=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let h=n*t;const f=u+h,g=void 0===i?f:i(f);g!==f&&(h=g-u);const v=e=>-h*Math.exp(-e/r),b=e=>g+v(e),y=e=>{const t=v(e),n=b(e);m.done=Math.abs(t)<=c,m.value=m.done?g:n};let x,w;const k=e=>{var t;t=m.value,(void 0!==a&&t<a||void 0!==l&&t>l)&&(x=e,w=Dd({keyframes:[m.value,p(m.value)],velocity:Ed(b,e,m.value),damping:o,stiffness:s,restDelta:c,restSpeed:d}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,y(e),k(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&y(e),m)}}}const Fd=Ml(.42,0,1,1),Vd=Ml(0,0,.58,1),zd=Ml(.42,0,.58,1),Bd={linear:pa,easeIn:Fd,easeInOut:zd,easeOut:Vd,circIn:zl,circInOut:$l,circOut:Bl,backIn:Ol,backInOut:Fl,backOut:Dl,anticipate:Vl},$d=e=>{if(Wa(e)){qc(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Ml(t,n,r,o)}return"string"==typeof e?(qc(void 0!==Bd[e],`Invalid easing type '${e}'`),Bd[e]):e};function Wd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map($d):$d(r),s={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=Ka(0,t,r);e.push(dd(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(qc(s===t.length,"Both input and output ranges must be the same length"),1===s)return()=>t[0];if(2===s&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const r=[],o=n||Sd,s=e.length-1;for(let n=0;n<s;n++){let s=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||pa:t;s=bd(e,s)}r.push(s)}return r}(t,r,o),l=a.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=Ka(e[r],e[r+1],n);return a[r](o)};return n?t=>c(Hl(e[0],e[s-1],t)):c}(i,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map(()=>c||zd).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(s.value=a(t),s.done=t>=e,s)}}const Ud=e=>{const t=({timestamp:t})=>e(t);return{start:()=>ga.update(t,!0),stop:()=>va(t),now:()=>ba.isProcessing?ba.timestamp:bl.now()}},Hd={decay:Od,inertia:Od,tween:Wd,keyframes:Wd,spring:Dd},qd=e=>e/100;class Kd extends cd{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,s=(null==r?void 0:r.KeyframeResolver)||Uc;this.resolver=new s(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:s=0}=this.options,i=Ba(t)?t:Hd[t]||Wd;let a,l;i!==Wd&&"number"!=typeof e[0]&&(a=bd(qd,Sd(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-s})),null===c.calculatedDuration&&(c.calculatedDuration=za(c));const{calculatedDuration:d}=c,u=d+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:d,resolvedDuration:u,totalDuration:u*(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:s,mapPercentToKeyframes:i,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:d}=n;if(null===this.startTime)return o.next(0);const{delay:u,repeat:m,repeatType:p,repeatDelay:h,onUpdate:f}=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-u*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let b=this.currentTime,y=o;if(m){const e=Math.min(this.currentTime,c)/d;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,m+1),Boolean(t%2)&&("reverse"===p?(n=1-n,h&&(n-=h/d)):"mirror"===p&&(y=s)),b=Hl(0,1,n)*d}const x=v?{done:!1,value:a[0]}:y.next(b);i&&(x.value=i(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&void 0!==r&&(x.value=ld(a,this.options,r)),f&&f(x.value),k&&this.finish(),x}get duration(){const{resolved:e}=this;return e?ul(e.calculatedDuration):0}get time(){return ul(this.currentTime)}set time(e){e=dl(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=ul(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=Ud,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 Gd=new Set(["opacity","clipPath","filter","transform"]),Yd=La(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xd={anticipate:Vl,backInOut:Fl,circInOut:$l};class Zd extends cd{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new od(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:s,motionValue:i,name:a,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&qa()&&o in Xd&&(o=Xd[o]),function(e){return Ba(e.type)||"spring"===e.type||!Ya(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:a,element:l,...c}=this.options,d=function(e,t){const n=new Kd({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let s=0;for(;!r.done&&s<2e4;)r=n.sample(s),o.push(r.value),s+=10;return{times:void 0,keyframes:o,duration:s-10,ease:"linear"}}(e,c);1===(e=d.keyframes).length&&(e[1]=e[0]),n=d.duration,r=d.times,o=d.ease,s="keyframes"}const c=function(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const d=Ja(a,o);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:"reverse"===i?"alternate":"normal"})}(i.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?($a(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;i.set(ld(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:r,type:s,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return ul(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return ul(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=dl(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 pa;const{animation:n}=t;$a(n,e)}else this.pendingTimeline=e;return pa}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:s,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,d=new Kd({...c,keyframes:n,duration:r,type:o,ease:s,times:i,isGenerator:!0}),u=dl(this.time);e.setWithVelocity(d.sample(u-10).value,d.sample(u).value,10)}const{onStop:a}=this.options;a&&a(),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:s,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return Yd()&&n&&Gd.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==s&&"inertia"!==i}}const Jd={type:"spring",stiffness:500,damping:25,restSpeed:10},Qd={type:"keyframes",duration:.8},eu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tu=(e,{keyframes:t})=>t.length>2?Qd:pl.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Jd:eu,nu=(e,t,n,r={},o,s)=>i=>{const a=Fa(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=dl(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length})(a)||(d={...d,...tu(e,d)}),d.duration&&(d.duration=dl(d.duration)),d.repeatDelay&&(d.repeatDelay=dl(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(u=!0)),u&&!s&&void 0!==t.get()){const e=ld(d.keyframes,a);if(void 0!==e)return ga.update(()=>{d.onUpdate(e),d.onComplete()}),new Oa([])}return!s&&Zd.supports(d)?new Zd(d):new Kd(d)};function ru({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function ou(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(s=e.latestValues[t])&&void 0!==s?s:null),o=l[t];if(void 0===o||d&&ru(d,t))continue;const a={delay:n,...Fa(i||{},t)};let u=!1;if(window.MotionHandoffAnimation){const n=Rl(e);if(n){const e=window.MotionHandoffAnimation(n,t,ga);null!==e&&(a.startTime=e,u=!0)}}Pl(e,t),r.start(nu(t,r,o,e.shouldReduceMotion&&hl.has(t)?{type:!1}:a,e,u));const m=r.animation;m&&c.push(m)}return a&&Promise.all(c).then(()=>{ga.update(()=>{a&&function(e,t){const n=Ra(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const t in s)El(e,t,fl(s[t]))}(e,a)})}),c}function su(e,t,n={}){var r;const o=Ra(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>Promise.all(ou(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:a}=s;return function(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(iu).forEach((e,r)=>{e.notify("AnimationStart",t),i.push(su(e,t,{...s,delay:n+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+r,i,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[e,t]="beforeChildren"===l?[i,a]:[a,i];return e().then(()=>t())}return Promise.all([i(),a(n.delay)])}function iu(e,t){return e.sortNodePosition(t)}const au=Ma.length;function lu(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&lu(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<au;n++){const r=Ma[n],o=e.props[r];(Pa(o)||!1===o)&&(t[r]=o)}return t}const cu=[...Aa].reverse(),du=Aa.length;function uu(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=>su(e,t,n));r=Promise.all(o)}else if("string"==typeof t)r=su(e,t,n);else{const o="function"==typeof t?Ra(e,t,n.custom):t;r=Promise.all(ou(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=hu(),r=!0;const o=t=>(n,r)=>{var o;const s=Ra(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(s){const{transition:e,transitionEnd:t,...r}=s;n={...n,...r,...t}}return n};function s(s){const{props:i}=e,a=lu(e.parent)||{},l=[],c=new Set;let d={},u=1/0;for(let t=0;t<du;t++){const m=cu[t],p=n[m],h=void 0!==i[m]?i[m]:a[m],f=Pa(h),g=m===s?p.isActive:null;!1===g&&(u=t);let v=h===a[m]&&h!==i[m]&&f;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),p.protectedKeys={...d},!p.isActive&&null===g||!h&&!p.prevProp||Sa(h)||"boolean"==typeof h)continue;const b=mu(p.prevProp,h);let y=b||m===s&&p.isActive&&!v&&f||t>u&&f,x=!1;const w=Array.isArray(h)?h:[h];let k=w.reduce(o(m),{});!1===g&&(k={});const{prevResolvedValues:j={}}=p,C={...j,...k},S=t=>{y=!0,c.has(t)&&(x=!0,c.delete(t)),p.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in C){const t=k[e],n=j[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Ea(t)&&Ea(n)?!Ta(t,n):t!==n,r?null!=t?S(e):c.add(e):void 0!==t&&c.has(e)?S(e):p.protectedKeys[e]=!0}p.prevProp=h,p.prevResolvedValues=k,p.isActive&&(d={...d,...k}),r&&e.blockInitialAnimation&&(y=!1),y&&(!v||!b||x)&&l.push(...w.map(e=>({animation:e,options:{type:m}})))}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 m=Boolean(l.length);return!r||!1!==i.initial&&i.initial!==i.animate||e.manuallyAnimateOnMount||(m=!1),r=!1,m?t(l):Promise.resolve()}return{animateChanges:s,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=s(t);for(const e in n)n[e].protectedKeys={};return i},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=hu(),r=!0}}}function mu(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Ta(t,e)}function pu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hu(){return{animate:pu(!0),whileInView:pu(),whileHover:pu(),whileTap:pu(),whileDrag:pu(),whileFocus:pu(),exit:pu()}}class fu{constructor(e){this.isMounted=!1,this.node=e}update(){}}let gu=0;const vu={animation:{Feature:class extends fu{constructor(e){super(e),e.animationState||(e.animationState=uu(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Sa(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 fu{constructor(){super(...arguments),this.id=gu++}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 bu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function yu(e){return{point:{x:e.pageX,y:e.pageY}}}function xu(e,t,n,r){return bu(e,t,(e=>t=>ol(t)&&e(t,yu(t)))(n),r)}const wu=(e,t)=>Math.abs(e-t);class ku{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=Su(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=wu(e.x,t.x),r=wu(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}=ba;this.history.push({...r,timestamp:o});const{onStart:s,onMove:i}=this.handlers;t||(s&&s(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ju(t,this.transformPagePoint),ga.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 s=Su("pointercancel"===e.type?this.lastMoveEventInfo:ju(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,s),r&&r(e,s)},!ol(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const s=ju(yu(e),this.transformPagePoint),{point:i}=s,{timestamp:a}=ba;this.history=[{...i,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Su(s,this.history)),this.removeListeners=bd(xu(this.contextWindow,"pointermove",this.handlePointerMove),xu(this.contextWindow,"pointerup",this.handlePointerUp),xu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),va(this.updatePoint)}}function ju(e,t){return t?{point:t(e.point)}:e}function Cu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Su({point:e},t){return{point:e,delta:Cu(e,Tu(t)),offset:Cu(e,Eu(t)),velocity:Pu(t,.1)}}function Eu(e){return e[0]}function Tu(e){return e[e.length-1]}function Pu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Tu(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>dl(t)));)n--;if(!r)return{x:0,y:0};const s=ul(o.timestamp-r.timestamp);if(0===s)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Nu(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function _u(e){return e.max-e.min}function Ru(e,t,n,r=.5){e.origin=r,e.originPoint=dd(t.min,t.max,e.origin),e.scale=_u(n)/_u(t),e.translate=dd(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 Au(e,t,n,r){Ru(e.x,t.x,n.x,r?r.originX:void 0),Ru(e.y,t.y,n.y,r?r.originY:void 0)}function Mu(e,t,n){e.min=n.min+t.min,e.max=e.min+_u(t)}function Lu(e,t,n){e.min=t.min-n.min,e.max=e.min+_u(t)}function Iu(e,t,n){Lu(e.x,t.x,n.x),Lu(e.y,t.y,n.y)}function Du(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 Ou(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 Fu=.35;function Vu(e,t,n){return{min:zu(e,t),max:zu(e,n)}}function zu(e,t){return"number"==typeof e?e:e[t]||0}const Bu=()=>({x:{min:0,max:0},y:{min:0,max:0}});function $u(e){return[e("x"),e("y")]}function Wu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Uu(e){return void 0===e||1===e}function Hu({scale:e,scaleX:t,scaleY:n}){return!Uu(e)||!Uu(t)||!Uu(n)}function qu(e){return Hu(e)||Ku(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ku(e){return Gu(e.x)||Gu(e.y)}function Gu(e){return e&&"0%"!==e}function Yu(e,t,n){return n+t*(e-n)}function Xu(e,t,n,r,o){return void 0!==o&&(e=Yu(e,o,r)),Yu(e,n,r)+t}function Zu(e,t=0,n=1,r,o){e.min=Xu(e.min,t,n,r,o),e.max=Xu(e.max,t,n,r,o)}function Ju(e,{x:t,y:n}){Zu(e.x,t.translate,t.scale,t.originPoint),Zu(e.y,n.translate,n.scale,n.originPoint)}const Qu=.999999999999,em=1.0000000000001;function tm(e,t){e.min=e.min+t,e.max=e.max+t}function nm(e,t,n,r,o=.5){Zu(e,t,n,dd(e.min,e.max,o),r)}function rm(e,t){nm(e.x,t.x,t.scaleX,t.scale,t.originX),nm(e.y,t.y,t.scaleY,t.scale,t.originY)}function om(e,t){return Wu(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 sm=({current:e})=>e?e.ownerDocument.defaultView:null,im=new WeakMap;class am{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 ku(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(yu(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(s=n)||"y"===s?Qa[s]?null:(Qa[s]=!0,()=>{Qa[s]=!1}):Qa.x||Qa.y?null:(Qa.x=Qa.y=!0,()=>{Qa.x=Qa.y=!1}),!this.openDragLock))return;var s;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$u(e=>{let t=this.getAxisMotionValue(e).get()||0;if(sc.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=_u(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&ga.postRender(()=>o(e,t)),Pl(this.visualElement,"transform");const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:s}=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(),s&&s(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>$u(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:sm(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&&ga.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||!lm(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let s=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?dd(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?dd(n,e,r.max):Math.min(e,n)),e}(s,this.constraints[e],this.elastic[e])),o.set(s)}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&&Nu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Du(e.x,n,o),y:Du(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Fu){return!1===e?e=0:!0===e&&(e=Fu),{x:Vu(e,"left","right"),y:Vu(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&$u(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||!Nu(e))return!1;const n=e.current;qc(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=om(e,n),{scroll:o}=t;return o&&(tm(r.x,o.offset.x),tm(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let s=function(e,t){return{x:Ou(e.x,t.x),y:Ou(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}}(s));this.hasMutatedConstraints=!!e,e&&(s=Wu(e))}return s}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),a=this.constraints||{},l=$u(i=>{if(!lm(i,t,this.currentDirection))return;let l=a&&a[i]||{};s&&(l={min:0,max:0});const c=r?200:1e6,d=r?40:1e7,u={type:"inertia",velocity:n?e[i]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,u)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Pl(this.visualElement,e),n.start(nu(e,n,0,t,this.visualElement,!1))}stopAnimation(){$u(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){$u(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){$u(t=>{const{drag:n}=this.getProps();if(!lm(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:s}=r.layout.layoutBox[t];o.set(e[t]-dd(n,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Nu(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};$u(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=_u(e),o=_u(t);return o>r?n=Ka(t.min,t.max-r,e.min):r>o&&(n=Ka(e.min,e.max-o,t.min)),Hl(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(),$u(t=>{if(!lm(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:s}=this.constraints[t];n.set(dd(o,s,r[t]))})}addListeners(){if(!this.visualElement.current)return;im.set(this.visualElement,this);const e=xu(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();Nu(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()),ga.read(t);const o=bu(window,"resize",()=>this.scalePositionWithinConstraints()),s=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&($u(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(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:s=Fu,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:s,dragMomentum:i}}}function lm(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const cm=e=>(t,n)=>{e&&ga.postRender(()=>e(t,n))},dm=(0,Re.createContext)(null);function um(e=!0){const t=(0,Re.useContext)(dm);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=(0,Re.useId)();(0,Re.useEffect)(()=>{e&&o(s)},[e]);const i=(0,Re.useCallback)(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const mm=(0,Re.createContext)({}),pm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function hm(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const fm={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ic.test(e))return e;e=parseFloat(e)}return`${hm(e,t.target.x)}% ${hm(e,t.target.y)}%`}},gm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=xc.parse(e);if(o.length>5)return r;const s=xc.createTransformer(e),i="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const c=dd(a,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),s(o)}},vm={},{schedule:bm,cancel:ym}=fa(queueMicrotask,!1);class xm extends Re.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var s;s=km,Object.assign(vm,s),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()})),pm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,r||e.layoutDependency!==t||void 0===t?s.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?s.promote():s.relegate()||ga.postRender(()=>{const e=s.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),bm.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 wm(e){const[t,n]=um(),r=(0,Re.useContext)(ca);return(0,T.jsx)(xm,{...e,layoutGroup:r,switchLayoutGroup:(0,Re.useContext)(mm),isPresent:t,safeToRemove:n})}const km={borderRadius:{...fm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fm,borderTopRightRadius:fm,borderBottomLeftRadius:fm,borderBottomRightRadius:fm,boxShadow:gm},jm=(e,t)=>e.depth-t.depth;class Cm{constructor(){this.children=[],this.isDirty=!1}add(e){yl(this.children,e),this.isDirty=!0}remove(e){xl(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(jm),this.isDirty=!1,this.children.forEach(e)}}function Sm(e){const t=Tl(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const Em=["TopLeft","TopRight","BottomLeft","BottomRight"],Tm=Em.length,Pm=e=>"string"==typeof e?parseFloat(e):e,Nm=e=>"number"==typeof e||ic.test(e);function _m(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Rm=Mm(0,.5,Bl),Am=Mm(.5,.95,pa);function Mm(e,t,n){return r=>r<e?0:r>t?1:n(Ka(e,t,r))}function Lm(e,t){e.min=t.min,e.max=t.max}function Im(e,t){Lm(e.x,t.x),Lm(e.y,t.y)}function Dm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Om(e,t,n,r,o){return e=Yu(e-=t,1/n,r),void 0!==o&&(e=Yu(e,1/o,r)),e}function Fm(e,t,[n,r,o],s,i){!function(e,t=0,n=1,r=.5,o,s=e,i=e){if(sc.test(t)&&(t=parseFloat(t),t=dd(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let a=dd(s.min,s.max,r);e===s&&(a-=t),e.min=Om(e.min,t,n,a,o),e.max=Om(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,s,i)}const Vm=["x","scaleX","originX"],zm=["y","scaleY","originY"];function Bm(e,t,n,r){Fm(e.x,t,Vm,n?n.x:void 0,r?r.x:void 0),Fm(e.y,t,zm,n?n.y:void 0,r?r.y:void 0)}function $m(e){return 0===e.translate&&1===e.scale}function Wm(e){return $m(e.x)&&$m(e.y)}function Um(e,t){return e.min===t.min&&e.max===t.max}function Hm(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function qm(e,t){return Hm(e.x,t.x)&&Hm(e.y,t.y)}function Km(e){return _u(e.x)/_u(e.y)}function Gm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ym{constructor(){this.members=[]}add(e){yl(this.members,e),e.scheduleRender()}remove(e){if(xl(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 Xm={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Zm="undefined"!=typeof window&&void 0!==window.MotionDebug,Jm=["","X","Y","Z"],Qm={visibility:"hidden"};let ep=0;function tp(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function np(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ga,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&np(r)}function rp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=ep++,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,Zm&&(Xm.totalNodes=Xm.resolvedTargetDeltas=Xm.recalculatedProjection=0),this.nodes.forEach(ip),this.nodes.forEach(pp),this.nodes.forEach(hp),this.nodes.forEach(ap),Zm&&window.MotionDebug.record(Xm)},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 Cm)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new wl),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:s,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(s||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=bl.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(va(r),e(s-t))};return ga.read(r,!0),()=>va(r)}(r,250),pm.hasAnimatedSinceResize&&(pm.hasAnimatedSinceResize=!1,this.nodes.forEach(mp))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&i&&(o||s)&&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()||xp,{onLayoutAnimationStart:s,onLayoutAnimationComplete:a}=i.getProps(),l=!this.targetLayout||!qm(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={...Fa(o,"layout"),onPlay:s,onComplete:a};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||mp(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(fp),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&&np(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(cp);this.isUpdating||this.nodes.forEach(dp),this.isUpdating=!1,this.nodes.forEach(up),this.nodes.forEach(op),this.nodes.forEach(sp),this.clearAllSnapshots();const e=bl.now();ba.delta=Hl(0,1e3/60,e-ba.timestamp),ba.timestamp=e,ba.isProcessing=!0,ya.update.process(ba),ya.preRender.process(ba),ya.render.process(ba),ba.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(lp),this.sharedNodes.forEach(gp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ga.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ga.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&&!Wm(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,s=r!==this.prevTransformTemplateValue;e&&(t||qu(this.latestValues)||s)&&(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)),Cp((r=n).x),Cp(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(Ep)){const{scroll:e}=this.root;e&&(tm(n.x,e.offset.x),tm(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Im(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:s}=r;r!==this.root&&o&&s.layoutScroll&&(o.wasRoot&&Im(n,e),tm(n.x,o.offset.x),tm(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Im(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&&rm(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),qu(r.latestValues)&&rm(n,r.latestValues)}return qu(this.latestValues)&&rm(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Im(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!n.instance)continue;if(!qu(n.latestValues))continue;Hu(n.latestValues)&&n.updateSnapshot();const r=Bu();Im(r,n.measurePageBox()),Bm(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return qu(this.latestValues)&&Bm(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!==ba.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:s}=this.options;if(this.layout&&(o||s)){if(this.resolvedRelativeTargetAt=ba.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}},Iu(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Im(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var i,a,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,a=this.relativeTarget,l=this.relativeParent.target,Mu(i.x,a.x,l.x),Mu(i.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Im(this.target,this.layout.layoutBox),Ju(this.target,this.targetDelta)):Im(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}},Iu(this.relativeTargetOrigin,this.target,e.target),Im(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Zm&&Xm.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!Hu(this.parent.latestValues)&&!Ku(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===ba.timestamp&&(r=!1),r)return;const{layout:o,layoutId:s}=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&&!s)return;Im(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let s,i;t.x=t.y=1;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:o}=s.options;o&&o.props.style&&"contents"===o.props.style.display||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&rm(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Ju(e,i)),r&&qu(s.latestValues)&&rm(e,s.latestValues))}t.x<em&&t.x>Qu&&(t.x=1),t.y<em&&t.y>Qu&&(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?(Dm(this.prevProjectionDelta.x,this.projectionDelta.x),Dm(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Au(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===i&&this.treeScale.y===a&&Gm(this.projectionDelta.x,this.prevProjectionDelta.x)&&Gm(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Zm&&Xm.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},s={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}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,d=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(yp));let u;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;vp(s.x,e.x,n),vp(s.y,e.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Iu(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){bp(e.x,t.x,n.x,r),bp(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,i,n),u&&function(e,t){return Um(e.x,t.x)&&Um(e.y,t.y)}(this.relativeTarget,u)&&(this.isProjectionDirty=!1),u||(u={x:{min:0,max:0},y:{min:0,max:0}}),Im(u,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,s){o?(e.opacity=dd(0,void 0!==n.opacity?n.opacity:1,Rm(r)),e.opacityExit=dd(void 0!==t.opacity?t.opacity:1,0,Am(r))):s&&(e.opacity=dd(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o<Tm;o++){const s=`border${Em[o]}Radius`;let i=_m(t,s),a=_m(n,s);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||Nm(i)===Nm(a)?(e[s]=Math.max(dd(Pm(i),Pm(a),r),0),(sc.test(a)||sc.test(i))&&(e[s]+="%")):e[s]=a)}(t.rotate||n.rotate)&&(e.rotate=dd(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,d,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=ga.update(()=>{pm.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Tl(0)?0:Sl(0);return r.start(nu("",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&&Sp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=_u(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=_u(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Im(t,n),rm(t,o),Au(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Ym),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&&tp("z",e,r,this.animationValues);for(let t=0;t<Jm.length;t++)tp(`rotate${Jm[t]}`,e,r,this.animationValues),tp(`skew${Jm[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 Qm;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Sm(null==e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Sm(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!qu(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=s.animationValues||s.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(null==n?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}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:s,skewX:i,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),s&&(r+=`rotateY(${s}deg) `),i&&(r+=`skewX(${i}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(r.transform=o(i,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,s.animationValues?r.opacity=s===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=s===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in vm){if(void 0===i[e])continue;const{correct:t,applyTo:n}=vm[e],o="none"===r.transform?i[e]:t(i[e],s);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=s===this?Sm(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(cp),this.root.sharedNodes.clear()}}}function op(e){e.updateLayout()}function sp(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,s=n.source!==e.layout.source;"size"===o?$u(e=>{const r=s?n.measuredBox[e]:n.layoutBox[e],o=_u(r);r.min=t[e].min,r.max=r.min+o}):Sp(o,n.layoutBox,t)&&$u(r=>{const o=s?n.measuredBox[r]:n.layoutBox[r],i=_u(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}};Au(i,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?Au(a,e.applyTransform(r,!0),n.measuredBox):Au(a,t,n.layoutBox);const l=!Wm(i);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:s}=r;if(o&&s){const i={x:{min:0,max:0},y:{min:0,max:0}};Iu(i,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Iu(a,t,s.layoutBox),qm(i,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=i,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ip(e){Zm&&Xm.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 ap(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function lp(e){e.clearSnapshot()}function cp(e){e.clearMeasurements()}function dp(e){e.isLayoutDirty=!1}function up(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function mp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pp(e){e.resolveTargetDelta()}function hp(e){e.calcProjection()}function fp(e){e.resetSkewAndRotation()}function gp(e){e.removeLeadSnapshot()}function vp(e,t,n){e.translate=dd(t.translate,0,n),e.scale=dd(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function bp(e,t,n,r){e.min=dd(t.min,n.min,r),e.max=dd(t.max,n.max,r)}function yp(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const xp={duration:.45,ease:[.4,0,.1,1]},kp=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jp=kp("applewebkit/")&&!kp("chrome/")?Math.round:pa;function Cp(e){e.min=jp(e.min),e.max=jp(e.max)}function Sp(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Km(t),o=Km(n),!(Math.abs(r-o)<=.2));var r,o}function Ep(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const Tp=rp({attachResizeListener:(e,t)=>bu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Pp={current:void 0},Np=rp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Pp.current){const e=new Tp({});e.mount(window),e.setOptions({layoutScroll:!0}),Pp.current=e}return Pp.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),_p={pan:{Feature:class extends fu{constructor(){super(...arguments),this.removePointerDownListener=pa}onPointerDown(e){this.session=new ku(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sm(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:cm(e),onStart:cm(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&ga.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=xu(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 fu{constructor(e){super(e),this.removeGroupControls=pa,this.removeListeners=pa,this.controls=new am(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pa}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Np,MeasureLayout:wm}};function Rp(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&ga.postRender(()=>o(t,yu(t)))}function Ap(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&&ga.postRender(()=>o(t,yu(t)))}const Mp=new WeakMap,Lp=new WeakMap,Ip=e=>{const t=Mp.get(e.target);t&&t(e)},Dp=e=>{e.forEach(Ip)};const Op={some:0,all:1},Fp={inView:{Feature:class extends fu{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,s={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Op[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;Lp.has(n)||Lp.set(n,{});const r=Lp.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Dp,{root:e,...t})),r[o]}(t);return Mp.set(e,n),r.observe(e),()=>{Mp.delete(e),r.unobserve(e)}}(this.node.current,s,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(),s=t?n:r;s&&s(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 fu{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,s]=tl(e,n),i=e=>{const r=e.currentTarget;if(!cl(e)||il.has(r))return;il.add(r);const s=t(e),i=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),cl(e)&&il.has(r)&&(il.delete(r),"function"==typeof s&&s(e,{success:t}))},a=e=>{i(e,n.useGlobalTarget||rl(r,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return r.forEach(e=>{(function(e){return sl.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=al(()=>{if(il.has(n))return;ll(n,"down");const e=al(()=>{ll(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>ll(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,o),o)}),s}(e,e=>(Ap(this.node,e,"Start"),(e,{success:t})=>Ap(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends fu{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=bd(bu(this.node.current,"focus",()=>this.onFocus()),bu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends fu{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,s]=tl(e,n),i=nl(e=>{const{target:n}=e,r=t(e);if("function"!=typeof r||!n)return;const s=nl(e=>{r(e),n.removeEventListener("pointerleave",s)});n.addEventListener("pointerleave",s,o)});return r.forEach(e=>{e.addEventListener("pointerenter",i,o)}),s}(e,e=>(Rp(this.node,e,"Start"),e=>Rp(this.node,e,"End"))))}unmount(){}}}},Vp={layout:{ProjectionNode:Np,MeasureLayout:wm}},zp=(0,Re.createContext)({strict:!1}),Bp=(0,Re.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),$p=(0,Re.createContext)({});function Wp(e){return Sa(e.animate)||Ma.some(t=>Pa(e[t]))}function Up(e){return Boolean(Wp(e)||e.variants)}function Hp(e){return Array.isArray(e)?e.join(" "):e}const qp={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"]},Kp={};for(const e in qp)Kp[e]={isEnabled:t=>qp[e].some(e=>!!t[e])};const Gp=Symbol.for("motionComponentSymbol");function Yp(e,t,n){return(0,Re.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):Nu(n)&&(n.current=r))},[t])}function Xp(e,t,n,r,o){var s,i;const{visualElement:a}=(0,Re.useContext)($p),l=(0,Re.useContext)(zp),c=(0,Re.useContext)(dm),d=(0,Re.useContext)(Bp).reducedMotion,u=(0,Re.useRef)(null);r=r||l.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:d}));const m=u.current,p=(0,Re.useContext)(mm);!m||m.projection||!o||"html"!==m.type&&"svg"!==m.type||function(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Zp(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:Boolean(i)||a&&Nu(a),visualElement:e,animationType:"string"==typeof s?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(u.current,n,o,p);const h=(0,Re.useRef)(!1);(0,Re.useInsertionEffect)(()=>{m&&h.current&&m.update(n,c)});const f=n[_l],g=(0,Re.useRef)(Boolean(f)&&!(null===(s=window.MotionHandoffIsComplete)||void 0===s?void 0:s.call(window,f))&&(null===(i=window.MotionHasOptimisedAnimation)||void 0===i?void 0:i.call(window,f)));return ma(()=>{m&&(h.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),bm.render(m.render),g.current&&m.animationState&&m.animationState.animateChanges())}),(0,Re.useEffect)(()=>{m&&(!g.current&&m.animationState&&m.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,f)}),g.current=!1))}),m}function Zp(e){if(e)return!1!==e.options.allowProjection?e.projection:Zp(e.parent)}function Jp({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var s,i;function a(e,s){let i;const a={...(0,Re.useContext)(Bp),...e,layoutId:Qp(e)},{isStatic:l}=a,c=function(e){const{initial:t,animate:n}=function(e,t){if(Wp(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Pa(t)?t:void 0,animate:Pa(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,Re.useContext)($p));return(0,Re.useMemo)(()=>({initial:t,animate:n}),[Hp(t),Hp(n)])}(e),d=r(e,l);if(!l&&ua){(0,Re.useContext)(zp).strict;const e=function(e){const{drag:t,layout:n}=Kp;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}}(a);i=e.MeasureLayout,c.visualElement=Xp(o,d,a,t,e.ProjectionNode)}return(0,T.jsxs)($p.Provider,{value:c,children:[i&&c.visualElement?(0,T.jsx)(i,{visualElement:c.visualElement,...a}):null,n(o,e,Yp(d,c.visualElement,s),d,l,c.visualElement)]})}e&&function(e){for(const t in e)Kp[t]={...Kp[t],...e[t]}}(e),a.displayName=`motion.${"string"==typeof o?o:`create(${null!==(i=null!==(s=o.displayName)&&void 0!==s?s:o.name)&&void 0!==i?i:""})`}`;const l=(0,Re.forwardRef)(a);return l[Gp]=o,l}function Qp({layoutId:e}){const t=(0,Re.useContext)(ca).id;return t&&void 0!==e?t+"-"+e:e}const eh=["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 th(e){return"string"==typeof e&&!e.includes("-")&&!!(eh.indexOf(e)>-1||/[A-Z]/u.test(e))}function nh(e){const t=(0,Re.useRef)(null);return null===t.current&&(t.current=e()),t.current}const rh=e=>(t,n)=>{const r=(0,Re.useContext)($p),o=(0,Re.useContext)(dm),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,s){const i={latestValues:oh(r,o,s,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?s():nh(s)};function oh(e,t,n,r){const o={},s=r(e,{});for(const e in s)o[e]=Sm(s[e]);let{initial:i,animate:a}=e;const l=Wp(e),c=Up(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===a&&(a=t.animate));let d=!!n&&!1===n.initial;d=d||!1===i;const u=d?a:i;if(u&&"boolean"!=typeof u&&!Sa(u)){const t=Array.isArray(u)?u:[u];for(let n=0;n<t.length;n++){const r=_a(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[d?t.length-1:0]),null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const sh=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ih={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ah=ml.length;function lh(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const e in t){const n=t[e];if(pl.has(e))i=!0;else if(Yc(e))o[e]=n;else{const t=sh(n,Pc[e]);e.startsWith("origin")?(a=!0,s[e]=t):r[e]=t}}if(t.transform||(i||n?r.transform=function(e,t,n){let r="",o=!0;for(let s=0;s<ah;s++){const i=ml[s],a=e[i];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(i.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const e=sh(a,Pc[i]);l||(o=!1,r+=`${ih[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")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=s;r.transformOrigin=`${e} ${t} ${n}`}}const ch={offset:"stroke-dashoffset",array:"stroke-dasharray"},dh={offset:"strokeDashoffset",array:"strokeDasharray"};function uh(e,t,n){return"string"==typeof e?e:ic.transform(t+n*e)}function mh(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:s,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(lh(e,c,u),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:m,style:p,dimensions:h}=e;m.transform&&(h&&(p.transform=m.transform),delete m.transform),h&&(void 0!==o||void 0!==s||p.transform)&&(p.transformOrigin=function(e,t,n){return`${uh(t,e.x,e.width)} ${uh(n,e.y,e.height)}`}(h,void 0!==o?o:.5,void 0!==s?s:.5)),void 0!==t&&(m.x=t),void 0!==n&&(m.y=n),void 0!==r&&(m.scale=r),void 0!==i&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?ch:dh;e[s.offset]=ic.transform(-r);const i=ic.transform(t),a=ic.transform(n);e[s.array]=`${i} ${a}`}(m,i,a,l,!1)}const ph=e=>"string"==typeof e&&"svg"===e.toLowerCase();function hh(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 fh=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 gh(e,t,n,r){hh(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(fh.has(n)?n:Nl(n),t.attrs[n])}function vh(e,{layout:t,layoutId:n}){return pl.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!vm[e]||"opacity"===e)}function bh(e,t,n){var r;const{style:o}=e,s={};for(const i in o)(Tl(o[i])||t.style&&Tl(t.style[i])||vh(i,e)||void 0!==(null===(r=null==n?void 0:n.getValue(i))||void 0===r?void 0:r.liveStyle))&&(s[i]=o[i]);return s}function yh(e,t,n){const r=bh(e,t,n);for(const n in e)(Tl(e[n])||Tl(t[n]))&&(r[-1!==ml.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}const xh=["x","y","width","height","cx","cy","r"],wh={useVisualState:rh({scrapeMotionValuesFromProps:yh,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let s=!!e.drag;if(!s)for(const e in o)if(pl.has(e)){s=!0;break}if(!s)return;let i=!t;if(t)for(let n=0;n<xh.length;n++){const r=xh[n];e[r]!==t[r]&&(i=!0)}i&&ga.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),ga.render(()=>{mh(r,o,ph(n.tagName),e.transformTemplate),gh(n,r)})})}})},kh={useVisualState:rh({scrapeMotionValuesFromProps:bh,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function jh(e,t,n){for(const r in t)Tl(t[r])||vh(r,n)||(e[r]=t[r])}function Ch(e,t){const n={},r=function(e,t){const n={};return jh(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,Re.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return lh(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 Sh=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 Eh(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Sh.has(e)}let Th=e=>!Eh(e);try{(Ph=require("@emotion/is-prop-valid").default)&&(Th=e=>e.startsWith("on")?!Eh(e):Ph(e))}catch(e){}var Ph;function Nh(e,t,n,r){const o=(0,Re.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return mh(n,t,ph(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};jh(t,e.style,e),o.style={...t,...o.style}}return o}function _h(e=!1){return(t,n,r,{latestValues:o},s)=>{const i=(th(t)?Nh:Ch)(n,o,s,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(Th(o)||!0===n&&Eh(o)||!t&&!Eh(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l=t!==Re.Fragment?{...a,...i,ref:r}:{},{children:c}=n,d=(0,Re.useMemo)(()=>Tl(c)?c.get():c,[c]);return(0,Re.createElement)(t,{...l,children:d})}}function Rh(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Jp({...th(n)?wh:kh,preloadedFeatures:e,useRender:_h(r),createVisualElement:t,Component:n})}}const Ah={current:null},Mh={current:!1},Lh=[...nd,uc,xc],Ih=new WeakMap,Dh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Oh{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Uc,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=bl.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,ga.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=s;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},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=Wp(t),this.isVariantNode=Up(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Tl(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Ih.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)),Mh.current||function(){if(Mh.current=!0,ua)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ah.current=e.matches;e.addListener(t),t()}else Ah.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ah.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ih.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=pl.has(e),r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&ga.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o(),s&&s(),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 Kp){const t=Kp[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<Dh.length;t++){const n=Dh[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],s=n[r];if(Tl(o))e.addValue(r,o);else if(Tl(s))e.addValue(r,Sl(o,{owner:e}));else if(s!==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,Sl(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=Sl(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&&(Kc(r)||Wl(r))?r=parseFloat(r):(o=r,!Lh.find(td(o))&&xc.test(t)&&(r=Rc(e,t))),this.setBaseTarget(e,Tl(r)?r.get():r)),Tl(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=_a(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||Tl(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 wl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Fh extends Oh{constructor(){super(...arguments),this.KeyframeResolver=od}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;Tl(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class Vh extends Fh{constructor(){super(...arguments),this.type="html",this.renderInstance=hh}readValueFromInstance(e,t){if(pl.has(t)){const e=_c(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Yc(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return om(e,t)}build(e,t,n){lh(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return bh(e,t,n)}}class zh extends Fh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Bu}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(pl.has(t)){const e=_c(t);return e&&e.default||0}return t=fh.has(t)?t:Nl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return yh(e,t,n)}build(e,t,n){mh(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){gh(e,t,0,r)}mount(e){this.isSVGTag=ph(e.tagName),super.mount(e)}}const Bh=(e,t)=>th(e)?new zh(t):new Vh(t,{allowProjection:e!==Re.Fragment}),$h=Ca(Rh({...vu,...Fp,..._p,...Vp},Bh)),Wh=(0,Re.createContext)({}),Uh=()=>(0,Re.useContext)(Wh),Hh=(0,Re.createContext)(null),qh=({children:e,activeItem:t=null,onChange:n,className:r,size:o="sm",orientation:s="horizontal",variant:i="pill",iconPosition:a="left",width:l="full"})=>{const c=Ws(),d=Uh()?.activeItem||t,u=(0,Re.useCallback)((e,t)=>{n&&n({event:e,value:t})},[n]);let m,p="rounded-full",h="p-1",f="ring-1 ring-tab-border";"vertical"===s?m="gap-0.5":("rounded"===i||"pill"===i)&&("xs"===o||"sm"===o?m="gap-0.5":("md"===o||"lg"===o)&&(m="gap-1")),"rounded"===i||"vertical"===s?p="rounded-md":"underline"===i&&(p="rounded-none",h="p-0",f="border-t-0 border-r-0 border-l-0 border-b border-solid border-tab-border","xs"===o?m="gap-0":"sm"===o?m="gap-2.5":("md"===o||"lg"===o)&&(m="gap-3"));const g=Ut(`box-border [&>*]:box-border flex items-center ${"full"===l?"w-full":""} ${"vertical"===s?"flex-col":""}`,p,h,m,f,"underline"!==i?"bg-tab-background":"",r);return(0,T.jsx)("div",{className:g,children:(0,T.jsx)(Hh.Provider,{value:{activeItem:d,onChange:u,size:o,variant:i,orientation:s,iconPosition:a,width:l},children:(0,T.jsx)(ja,{id:c,children:Re.Children.map(e,e=>(0,Re.isValidElement)(e)?Re.cloneElement(e):null)})})})};qh.displayName="Tabs.Group";const Kh=(0,Re.forwardRef)(({slug:e,text:t,icon:n,className:r,disabled:o=!1,badge:s=null,...i},a)=>{const l=(0,Re.useContext)(Hh);if(!l)throw new Error("Tab should be used inside Tabs Group");const{activeItem:c,onChange:d,size:u,variant:m,orientation:p,iconPosition:h,width:f}=l,g={xs:"px-1.5 py-0.5 text-xs [&_svg]:size-3",sm:"underline"===m?"py-1.5 text-sm [&_svg]:size-4":"px-3 py-1.5 text-sm [&_svg]:size-4",md:"underline"===m?"py-2 text-base [&_svg]:size-5":"px-3.5 py-1.5 text-base [&_svg]:size-5",lg:"underline"===m?"p-2.5 text-lg [&_svg]:size-6":"px-3.5 py-1.5 text-lg [&_svg]:size-6"}[u],v=Ut("relative border-none bg-transparent text-text-secondary cursor-pointer flex items-center justify-center transition-[box-shadow,color,background-color] duration-200","full"===f?"flex-1":"","vertical"===p?"w-full justify-between":"");let b="rounded-full";"rounded"===m?b="rounded-md":"underline"===m&&(b="rounded-none");const y=Ut(v,"border-none",b,"hover:text-text-primary","focus:outline-none",g,c===e?"bg-background-primary text-text-primary shadow-sm":"",o?"text-text-disabled cursor-not-allowed hover:text-text-disabled":"",r),x=Ut("flex items-center gap-1");return(0,T.jsxs)($h.button,{ref:a,className:y,disabled:o,onClick:n=>{d(n,{slug:e,text:t})},...i,layoutRoot:!0,children:[c===e&&"underline"===m&&(0,T.jsx)($h.span,{layoutId:"underline",layoutDependency:c,className:"absolute right-0 left-0 -bottom-px h-px bg-border-interactive"}),(0,T.jsxs)("span",{className:x,children:["left"===h&&n&&(0,T.jsx)("span",{className:"mr-1 contents center-center transition duration-150",children:n}),t,"right"===h&&n&&(0,T.jsx)("span",{className:"ml-1 contents center-center transition duration-150",children:n})]}),s&&(0,Re.isValidElement)(s)&&s]})});Kh.displayName="Tabs.Tab";const Gh=({activeItem:e,children:t})=>(0,T.jsx)(Wh.Provider,{value:{activeItem:e},children:t}),Yh=({slug:e,children:t})=>{const n=Uh();if(!n)throw new Error("TabPanel should be used inside Tabs");return e===n.activeItem?(0,T.jsx)(T.Fragment,{children:t}):null};Yh.displayName="Tabs.Panel",Gh.Group=qh,Gh.Tab=Kh,Gh.Panel=Yh;class Xh extends Re.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 Zh({children:e,isPresent:t}){const n=(0,Re.useId)(),r=(0,Re.useRef)(null),o=(0,Re.useRef)({width:0,height:0,top:0,left:0}),{nonce:s}=(0,Re.useContext)(Bp);return(0,Re.useInsertionEffect)(()=>{const{width:e,height:i,top:a,left:l}=o.current;if(t||!r.current||!e||!i)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),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: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[t]),(0,T.jsx)(Xh,{isPresent:t,childRef:r,sizeRef:o,children:Re.cloneElement(e,{ref:r})})}const Jh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i})=>{const a=nh(Qh),l=(0,Re.useId)(),c=(0,Re.useCallback)(e=>{a.set(e,!0);for(const e of a.values())if(!e)return;r&&r()},[a,r]),d=(0,Re.useMemo)(()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:c,register:e=>(a.set(e,!1),()=>a.delete(e))}),s?[Math.random(),c]:[n,c]);return(0,Re.useMemo)(()=>{a.forEach((e,t)=>a.set(t,!1))},[n]),Re.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),"popLayout"===i&&(e=(0,T.jsx)(Zh,{isPresent:n,children:e})),(0,T.jsx)(dm.Provider,{value:d,children:e})};function Qh(){return new Map}const ef=e=>e.key||"";function tf(e){const t=[];return Re.Children.forEach(e,e=>{(0,Re.isValidElement)(e)&&t.push(e)}),t}const nf=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1})=>{const[a,l]=um(i),c=(0,Re.useMemo)(()=>tf(e),[e]),d=i&&!a?[]:c.map(ef),u=(0,Re.useRef)(!0),m=(0,Re.useRef)(c),p=nh(()=>new Map),[h,f]=(0,Re.useState)(c),[g,v]=(0,Re.useState)(c);ma(()=>{u.current=!1,m.current=c;for(let e=0;e<g.length;e++){const t=ef(g[e]);d.includes(t)?p.delete(t):!0!==p.get(t)&&p.set(t,!1)}},[g,d.length,d.join("-")]);const b=[];if(c!==h){let e=[...c];for(let t=0;t<g.length;t++){const n=g[t],r=ef(n);d.includes(r)||(e.splice(t,0,n),b.push(n))}return"wait"===s&&b.length&&(e=b),v(tf(e)),void f(c)}const{forceRender:y}=(0,Re.useContext)(ca);return(0,T.jsx)(T.Fragment,{children:g.map(e=>{const h=ef(e),f=!(i&&!a)&&(c===g||d.includes(h));return(0,T.jsx)(Jh,{isPresent:f,initial:!(u.current&&!n)&&void 0,custom:f?void 0:t,presenceAffectsLayout:o,mode:s,onExitComplete:f?void 0:()=>{if(!p.has(h))return;p.set(h,!0);let e=!0;p.forEach(t=>{t||(e=!1)}),e&&(null==y||y(),v(m.current),i&&(null==l||l()),r&&r())},children:e},h)})})},rf=(0,Re.createContext)({}),of=()=>(0,Re.useContext)(rf),sf=({size:e="md",children:t,className:n})=>(0,T.jsx)(rf.Provider,{value:{size:e},children:(0,T.jsx)("div",{className:Ut("flex flex-col bg-background-primary p-2",n),children:t})});sf.displayName="Menu";const af=({heading:e,arrow:t=!1,showArrowOnHover:n=!1,open:r=!0,onClick:o,children:s,className:i})=>{const[a,l]=(0,Re.useState)(r),[c,d]=(0,Re.useState)(!1),{size:u}=of(),m={sm:"text-xs",md:"text-sm"}[u??"md"],p={sm:"size-4",md:"size-5"}[u??"md"],h=()=>{l(!a),o&&o(!a)};return(0,T.jsxs)("div",{children:[!!e&&(0,T.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:Ut("text-text-primary bg-transparent cursor-pointer flex justify-between items-center gap-1",m,e?"p-1":"p-0",i),"aria-expanded":a,children:[(0,T.jsx)("span",{className:"text-text-tertiary",children:e}),t&&(0,T.jsx)($h.span,{className:"flex items-center text-border-strong",initial:"hidden",animate:n?a||c?"visible":"hidden":"visible",exit:"hidden",variants:{visible:{opacity:1},hidden:{opacity:0}},transition:{duration:.15},children:(0,T.jsx)($h.span,{className:"inline-flex p-1",variants:{open:{rotate:180},closed:{rotate:0}},animate:a?"open":"closed",transition:{duration:.15},children:(0,T.jsx)(Qt,{className:Ut("shrink-0",p)})})})]}),(0,T.jsx)(nf,{initial:!1,children:a&&(0,T.jsx)($h.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:s})})]})};af.displayName="Menu.List";const lf=({disabled:e=!1,active:t,onClick:n,children:r,className:o,...s})=>{const{size:i}=of(),a={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,T.jsx)("li",{role:"menuitem",tabIndex:e?-1:0,onClick:e?void 0:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&n?.()},className:Ut("flex p-1 gap-1 items-center bg-transparent border-none rounded text-text-secondary cursor-pointer m-0",a,"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,...s,children:r})};lf.displayName="Menu.Item";const cf=({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,T.jsx)("li",{className:"m-0 p-0 list-none",role:"separator","aria-hidden":"true",children:(0,T.jsx)("hr",{className:Ut("w-full border-0 border-t border-border-subtle",n,t)})})};cf.displayName="Menu.Separator",sf.List=af,sf.Item=lf,sf.Separator=cf;const df=(0,Re.createContext)({}),uf=()=>(0,Re.useContext)(df),mf=({placement:e="bottom",offset:t=10,boundary:n="clippingAncestors",children:r,className:o})=>{const[s,i]=(0,Re.useState)(!1),{refs:a,floatingStyles:l,context:c}=Ss({open:s,onOpenChange:i,placement:e,strategy:"fixed",middleware:[ro(t),so({boundary:n}),oo({boundary:n})],whileElementsMounted:Gr}),d=xs(c),u=Cs(c),m=Os(c,{role:"menu"}),{getReferenceProps:p,getFloatingProps:h}=Ns([d,u,m]),{isMounted:f,styles:g}=zs(c,{duration:150,initial:{opacity:0,scale:.95},open:{opacity:1,scale:1},close:{opacity:0,scale:.95}}),v=()=>i(e=>!e);return(0,T.jsx)(df.Provider,{value:{refs:a,handleClose:()=>i(!1),isMounted:f,styles:g,floatingStyles:l,getFloatingProps:h},children:(0,T.jsxs)("div",{className:Ut("relative inline-block",o),children:[Re.Children.map(r,e=>Re.isValidElement(e)&&"DropdownMenu.Trigger"===e?.type?.displayName?(0,Re.cloneElement)(e,{ref:a.setReference,onClick:v,...p()}):null),Re.Children.toArray(r).filter(e=>Re.isValidElement(e)&&["DropdownMenu.Portal","DropdownMenu.ContentWrapper"].includes(e.type.displayName||"")).map(e=>e)]})})};mf.displayName="DropdownMenu";const pf=({children:e,className:t})=>{const{refs:n,floatingStyles:r,getFloatingProps:o,isMounted:s,styles:i}=uf();return s&&(0,T.jsx)("div",{ref:n.setFloating,className:t,style:{...r,...i},...o(),children:Re.Children.map(e,e=>"DropdownMenu.Content"===e?.type?.displayName?e:null)})};pf.displayName="DropdownMenu.ContentWrapper";const hf=({children:e,root:t,id:n})=>(0,T.jsx)(is,{id:n,root:t,children:e});hf.displayName="DropdownMenu.Portal";const ff=Re.forwardRef(({children:e,className:t,...n},r)=>(0,Re.isValidElement)(e)?Re.cloneElement(e,{className:Ut(t,e.props.className),ref:r,...n}):(0,T.jsx)("div",{ref:r,className:Ut("cursor-pointer",t),role:"button",tabIndex:0,...n,children:e}));ff.displayName="DropdownMenu.Trigger";const gf=({children:e,className:t,...n})=>(0,T.jsx)("div",{className:Ut("border border-solid border-border-subtle rounded-md shadow-lg overflow-hidden",t),children:(0,T.jsx)(sf,{...n,children:e})});gf.displayName="DropdownMenu.Content";const vf=e=>(0,T.jsx)(sf.List,{...e});vf.displayName="DropdownMenu.List";const bf=({children:e,as:t=sf.Item,...n})=>{const{handleClose:r}=uf();return e?t===Re.Fragment&&(0,Re.isValidElement)(e)?(0,Re.cloneElement)(e,{onClick:Ht(e.props?.onClick,r)}):(0,T.jsx)(t,{...n,className:Ut("px-2",n.className),onClick:Ht(n.onClick,r),children:e}):null};bf.displayName="DropdownMenu.Item";const yf=e=>(0,T.jsx)(sf.Separator,{...e});yf.displayName="DropdownMenu.Separator",mf.Trigger=ff,mf.Content=gf,mf.List=vf,mf.Item=bf,mf.Separator=yf,mf.Portal=hf,mf.ContentWrapper=pf;const xf=({content:e="",handleContentChange:t,editorId:n,label:r=null,error:o=!1,onBlur:s=()=>{},onFocus:i=()=>{},required:a=!1,smartTags:l=[],smartTagGroups:c=[],height:d=300})=>{const[u,m]=(0,S.useState)(e||""),[p,h]=(0,S.useState)("visual"),f=(0,S.useRef)(null),g=(0,S.useRef)(null),v=(0,S.useRef)(e||""),b=(0,S.useRef)(t),y=(0,S.useRef)(s),x=(0,S.useRef)(i);(0,S.useEffect)(()=>{b.current=t},[t]),(0,S.useEffect)(()=>{y.current=s},[s]),(0,S.useEffect)(()=>{x.current=i},[i]),(0,S.useEffect)(()=>{const t=e||"";m(t);const r=window.tinyMCE?.get(n);r&&r.getContent()!==t&&r.setContent(t)},[e,n]);const w=(0,S.useCallback)(e=>{m(e),b.current(e)},[]);(0,S.useEffect)(()=>{const e=f.current,t=g.current,r=e=>{const t=window.tinyMCE?.get(n);if(t){const n=t.getContainer(),r=n?.closest(".sd-richtext-content-editor");if(r){const t="visual"===e?"switch-tmce":"switch-html",n=r.querySelector(`.${t}`);n&&n.click()}}},o=()=>{h("visual"),r("visual")},s=()=>{h("html"),r("html")};return e&&t&&(e.addEventListener("click",o),t.addEventListener("click",s)),(()=>{if(window.wp?.editor&&document.getElementById(n)){window.tinyMCE?.get(n)&&window.tinyMCE.execCommand("mceRemoveEditor",!0,n),window.wp.editor.initialize(n,{tinymce:{toolbar1:"formatselect bold italic bullist numlist link blockquote alignleft aligncenter alignright underline strikethrough forecolor removeformat undo redo",content_style:'\n\t\t\t\t\t\t\tbody {\n\t\t\t\t\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n\t\t\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\t\t\tline-height: 1.6;\n\t\t\t\t\t\t\t\tcolor: #333;\n\t\t\t\t\t\t\t\tpadding: 12px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t',fontsize_formats:"12px 14px 16px 18px 24px",plugins:"lists link textcolor",menubar:!1,height:d,resize:!1},quicktags:!0,mediaButtons:!1});const e=window.tinyMCE.get(n);e&&(e.setContent(v.current),e.on("change",()=>{w(e.getContent())}),e.on("blur",()=>{y.current(e.getContent())}),e.on("focus",()=>{x.current(e.getContent())}))}})(),()=>{window.tinyMCE?.get(n)&&window.tinyMCE.execCommand("mceRemoveEditor",!0,n),e?.removeEventListener("click",o),t?.removeEventListener("click",s)}},[n,d,w]);const k=e=>{const t=window.tinyMCE?.get(n);t&&t.insertContent(e)};return(0,T.jsxs)("div",{className:"sd-richtext-content-editor flex flex-col gap-1.5 "+(o?"sd-editor-error":""),"data-editor-id":n,children:[(0,T.jsxs)("div",{className:"sd-top-toolbar-content flex w-full "+(r?"justify-between":"justify-end"),children:[r&&(0,T.jsx)(Kt,{required:a,children:r}),(0,T.jsxs)("div",{className:"flex items-center gap-2 w-fit",children:[(0,T.jsxs)(Gh.Group,{variant:"rounded",size:"xs",children:[(0,T.jsx)(Gh.Tab,{className:"text-sm font-medium "+("visual"===p?"bg-background-primary text-text-primary shadow-sm":""),text:(0,E.__)("Visual","suredonation"),slug:"visual",ref:f},"visual"),(0,T.jsx)(Gh.Tab,{className:"text-sm font-medium "+("html"===p?"bg-background-primary text-text-primary shadow-sm":""),text:(0,E.__)("HTML","suredonation"),slug:"html",ref:g},"html")]}),(c.length>0||l.length>0)&&(0,T.jsxs)(mf,{placement:"bottom-end",className:"min-w-fit",children:[(0,T.jsx)(mf.Trigger,{children:(0,T.jsx)(Ks,{variant:"outline",size:"sm",icon:(0,T.jsx)(Ve,{}),iconPosition:"right",className:"min-w-fit [&_svg]:shrink-0",children:(0,E.__)("Add Tag","suredonation")})}),(0,T.jsx)(mf.Portal,{id:"suredonation-dialog-root",children:(0,T.jsx)(mf.ContentWrapper,{children:(0,T.jsx)(mf.Content,{className:"w-60 max-h-80 overflow-y-auto",children:(0,T.jsx)(mf.List,{children:c.length>0?c.map((e,t)=>(0,T.jsxs)("div",{children:[(0,T.jsx)(Kt,{variant:"help",size:"xs",className:"p-2 text-text-primary font-medium text-sm",tabIndex:-1,children:e.label}),e.tags.map(e=>(0,T.jsx)(mf.Item,{className:"text-sm font-normal text-text-secondary hover:bg-background-secondary hover:text-text-primary focus:bg-background-secondary focus:text-text-primary",onClick:()=>k(e.tag),children:e.title||e.tag},e.tag))]},e.label||t)):l.map(e=>(0,T.jsx)(mf.Item,{className:"text-sm font-normal text-text-secondary hover:bg-background-secondary hover:text-text-primary focus:bg-background-secondary focus:text-text-primary",onClick:()=>k(e.tag),children:e.title||e.tag},e.tag))})})})})]})]})]}),(0,T.jsx)("textarea",{className:"sd-tinymce-editor-textarea w-full border-none border-0 focus:border-border-subtle focus:outline-none focus:ring-0 resize-none",id:n,value:u,onChange:e=>w(e.target.value)})]})},wf=[{label:(0,E.__)("Hide Form","suredonation"),value:"hide form"},{label:(0,E.__)("Reset Form","suredonation"),value:"reset form"}],kf=[{label:(0,E.__)("Success Message","suredonation"),value:"same page"},{label:(0,E.__)("Redirect","suredonation"),value:"different page",subOptionLabel:(0,E.__)("Redirect to","suredonation"),subOptions:[{label:(0,E.__)("Page","suredonation"),value:"different page"},{label:(0,E.__)("Custom URL","suredonation"),value:"custom url"}]}],jf={confirmation_type:"same page",message:"",submission_action:"hide form",custom_url:"",page_url:""},Cf=()=>{const e=(0,n.useSelect)(e=>e(C.store).getEditedPostAttribute("meta"),[]),{editPost:t,savePost:r}=(0,n.useDispatch)(C.store),[o,s]=(0,S.useState)(jf),[i,a]=(0,S.useState)(null),[l,c]=(0,S.useState)(!1),[d,u]=(0,S.useState)(!1),[m,p]=(0,S.useState)(null),[h,f]=(0,S.useState)(!1),[g,v]=(0,S.useState)([]),b=(0,S.useRef)(""),y=(0,S.useRef)(null),x=(0,S.useRef)(null),w=(0,S.useRef)(o),k=(0,S.useCallback)(async(e="")=>{x.current?.abort(),x.current=new AbortController;try{const t=await Ue()({path:(0,He.addQueryArgs)("/wp/v2/pages",{search:e,per_page:20,status:"publish",_fields:"id,title,link"}),signal:x.current.signal});v(t.map(e=>({label:e.title.rendered,value:e.link})))}catch{}},[]),j=function(e,t,n,r){var o=this,s=(0,Re.useRef)(null),i=(0,Re.useRef)(0),a=(0,Re.useRef)(0),l=(0,Re.useRef)(null),c=(0,Re.useRef)([]),d=(0,Re.useRef)(),u=(0,Re.useRef)(),m=(0,Re.useRef)(e),p=(0,Re.useRef)(!0),h=(0,Re.useRef)(),f=(0,Re.useRef)();m.current=e;var g="undefined"!=typeof window,v=!t&&0!==t&&g;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,x=!!n.flushOnExit&&y,w="maxWait"in n,k="debounceOnServer"in n&&!!n.debounceOnServer,j=w?Math.max(+n.maxWait||0,t):null,C=(0,Re.useMemo)(function(){var e=function(e){var t=c.current,n=d.current;return c.current=d.current=null,i.current=e,a.current=a.current||e,u.current=m.current.apply(n,t)},n=function(e,t){v&&cancelAnimationFrame(l.current),l.current=v?requestAnimationFrame(e):setTimeout(e,t)},C=function(e){if(!p.current)return!1;var n=e-s.current;return!s.current||n>=t||n<0||w&&e-i.current>=j},S=function(t){return l.current=null,y&&c.current?e(t):(c.current=d.current=null,u.current)},E=function e(){var r=Date.now();if(b&&a.current===i.current&&T(),C(r))return S(r);if(p.current){var o=t-(r-s.current),l=w?Math.min(o,j-(r-i.current)):o;n(e,l)}},T=function(){r&&r({})},P=function(){if(g||k){var r,a=Date.now(),m=C(a);if(c.current=[].slice.call(arguments),d.current=o,s.current=a,x&&!h.current&&(h.current=function(){var e;"hidden"===(null==(e=globalThis.document)?void 0:e.visibilityState)&&f.current.flush()},null==(r=globalThis.document)||null==r.addEventListener||r.addEventListener("visibilitychange",h.current)),m){if(!l.current&&p.current)return i.current=s.current,n(E,t),b?e(s.current):u.current;if(w)return n(E,t),e(s.current)}return l.current||n(E,t),u.current}};return P.cancel=function(){var e=l.current;e&&(v?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,c.current=s.current=d.current=l.current=null,e&&r&&r({})},P.isPending=function(){return!!l.current},P.flush=function(){return l.current?S(Date.now()):u.current},P},[b,w,t,j,y,x,v,g,k,r]);return f.current=C,(0,Re.useEffect)(function(){return p.current=!0,function(){var e;x&&f.current.flush(),h.current&&(null==(e=globalThis.document)||null==e.removeEventListener||e.removeEventListener("visibilitychange",h.current),h.current=null),p.current=!1}},[x]),C}(k,300);(0,S.useEffect)(()=>{if(null!==y.current)return;k();const t=e?._suredonation_form_confirmation;let n=!1;if(t&&"string"==typeof t)try{const e=JSON.parse(t);if("object"==typeof e&&null!==e){const t={...jf,...e};s(t),b.current=t.message||"",a(t.message||""),y.current=JSON.stringify(t),n=!0}}catch{}return!n&&e&&(b.current=jf.message,a(jf.message),y.current=JSON.stringify(jf)),()=>{j.cancel(),x.current?.abort()}},[e]),(0,S.useEffect)(()=>{if(w.current=o,null===y.current)return;const e=JSON.stringify({...o,message:b.current});c(e!==y.current)},[o]);const P=(0,S.useCallback)(e=>{if(b.current=e,null!==y.current){const t=JSON.stringify({...w.current,message:e});c(t!==y.current)}},[]);(0,S.useEffect)(()=>{f(!1),p(null)},[o?.confirmation_type]);const N=kf.find(e=>e.value===o?.confirmation_type||e.subOptions?.some(e=>e.value===o?.confirmation_type));return(0,T.jsx)(la,{title:(0,E.__)("Form Confirmation","suredonation"),titleHelpText:(0,E.__)("Customize the confirmation message or redirect the users after submitting the form.","suredonation"),showTitleHelpText:!0,onClickSave:async()=>{const e=(()=>{if("different page"===o?.confirmation_type&&!o?.page_url)return(0,E.__)("Please select a page.","suredonation");if("custom url"===o?.confirmation_type&&!o?.custom_url)return(0,E.__)("This field is required.","suredonation");if("custom url"===o?.confirmation_type&&o?.custom_url)try{const e=new URL(o.custom_url);if("https:"!==e.protocol)return(0,E.__)("Suggestion: URL should use HTTPS","suredonation");if("localhost"!==e.hostname&&(!e.hostname.includes(".")||e.hostname.split(".").pop().length<=1))return(0,E.__)("URL is missing Top Level Domain (TLD).","suredonation")}catch{return(0,E.__)("Please enter a valid URL.","suredonation")}return""})();if(p(e),""!==e)return void f(!0);u(!0);const n={...o,message:b.current};t({meta:{_suredonation_form_confirmation:JSON.stringify(n)}});try{await r(),y.current=JSON.stringify(n),c(!1),Ge.success((0,E.__)("Confirmation settings saved.","suredonation"))}catch{Ge.error((0,E.__)("Failed to save confirmation settings.","suredonation"))}finally{u(!1)}},saveBtnDisabled:!l||d,isSaving:d,children:(0,T.jsxs)("div",{className:"space-y-6",children:[(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)(Kt,{children:(0,E.__)("Confirmation Type","suredonation")}),(0,T.jsx)("div",{children:(0,T.jsx)(Oi,{children:kf.map(e=>{const t=((e,t)=>e.value===t||e.subOptions?.some(e=>e.value===t))(e,o?.confirmation_type);return(0,T.jsx)(Oi.Option,{label:e.label,onChange:()=>s({...o,confirmation_type:e.value}),value:e.value,checked:t},e.value)})})})]}),N?.subOptionLabel&&(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)(Kt,{children:N.subOptionLabel}),(0,T.jsx)(Oi,{cols:2,children:N.subOptions?.map(e=>(0,T.jsx)(Oi.Option,{label:e.label,value:e.value,checked:o?.confirmation_type===e.value,onChange:()=>s({...o,confirmation_type:e.value})},e.value))})]}),"same page"===o?.confirmation_type&&null!==i&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{children:(0,T.jsx)(xf,{editorId:"suredonation-confirmation-message",content:i,handleContentChange:P,label:(0,E.__)("Success Message","suredonation"),height:200,smartTags:window.suredonationFormEditor?.smartTags||[]})}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)(Kt,{children:(0,E.__)("After Form Submission","suredonation")}),(0,T.jsx)(Oi,{cols:2,children:wf.map(e=>(0,T.jsx)(Oi.Option,{label:e.label,value:e.value,checked:o?.submission_action===e.value,onChange:()=>s({...o,submission_action:e.value})},e.value))})]})]}),"different page"===o?.confirmation_type&&(0,T.jsxs)("div",{className:"space-y-1.5",children:[(0,T.jsx)(Kt,{htmlFor:"select-page",children:(0,E.__)("Select Page to redirect","suredonation")}),(0,T.jsxs)(bi,{options:g,value:o?.page_url,onChange:e=>{f(!0),p(null),s({...o,page_url:e})},combobox:!0,searchFn:j,debounceDelay:0,searchPlaceholder:(0,E.__)("Search for a page","suredonation"),children:[(0,T.jsx)(bi.Button,{id:"select-page",placeholder:(0,E.__)("Select a page","suredonation"),children:g?.find(e=>e.value===o?.page_url)?.label}),(0,T.jsx)(bi.Options,{dropdownPortalId:"suredonation-dialog-root",children:g?.map(e=>(0,T.jsx)(bi.Option,{value:e.value,selected:e.value===o?.page_url,children:e.label},e.value))})]})]}),"custom url"===o?.confirmation_type&&(0,T.jsxs)("div",{className:"space-y-1.5",children:[(0,T.jsx)(Kt,{htmlFor:"custom-url-input",required:!0,children:(0,E.__)("Custom URL","suredonation")}),(0,T.jsx)(xi,{id:"custom-url-input",value:o?.custom_url||"",onChange:e=>{f(!0),s({...o,custom_url:e})},size:"md",placeholder:"https://"}),h&&m&&(0,T.jsx)(Kt,{variant:"error",size:"sm",children:m})]})]})})},Sf=Zt("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Ef=(0,Re.forwardRef)(({id:e,label:t,defaultChecked:n=!1,checked:r,onChange:o,indeterminate:s,disabled:i,size:a="md",className:l,...c},d)=>{const u=(0,Re.useMemo)(()=>e||`checkbox-${Ws()}`,[e]),m=(0,Re.useMemo)(()=>typeof r<"u",[r]),[p,h]=(0,Re.useState)(n||!1),f="primary",g={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"}},v={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,Re.useCallback)(()=>m?r:p,[m,r,p]),y=(0,Re.useCallback)(()=>(0,Re.isValidElement)(t)?t:t?.heading||t?.description?(0,T.jsxs)("div",{className:g[a].gap,children:[t?.heading&&(0,T.jsx)(Kt,{className:Ut("text-text-primary font-medium leading-4 m-0",g[a].text,g[a].gap,i&&"text-text-disabled"),htmlFor:u,children:t?.heading}),t?.description&&(0,T.jsx)(Kt,{tag:"p",className:Ut("font-normal leading-5 m-0",g[a].description,i&&"text-text-disabled"),variant:"help",children:t?.description})]}):null,[t,a,i]);return(0,T.jsxs)("div",{className:Ut("inline-flex items-center justify-center gap-2",!!t&&"items-start",i&&"cursor-not-allowed"),children:[(0,T.jsxs)("label",{className:Ut("relative flex items-center justify-center rounded-full p-0.5",!i&&"cursor-pointer"),htmlFor:u,children:[(0,T.jsx)("input",{ref:d,id:u,type:"checkbox",className:Ut("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",v[f].checkbox,g[a].checkbox,i&&"cursor-not-allowed disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled",l),checked:b(),onChange:e=>{if(i)return;const t=e.target.checked;m||h(t),"function"==typeof o&&o(t)},disabled:i,...c}),(0,T.jsx)("span",{className:Ut("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",v[f].icon,i&&"cursor-not-allowed peer-disabled:text-border-disabled"),children:s?(0,T.jsx)(Sf,{className:Ut(g[a]?.icon)}):(0,T.jsx)(tn,{className:Ut(g[a]?.icon)})})]}),!!t&&y()]})});Ef.displayName="Checkbox";const Tf=(0,Re.createContext)(void 0),Pf=()=>{const e=(0,Re.useContext)(Tf);if(!e)throw new Error("Table components must be used within Table component");return e},Nf=({children:e,className:t,checkboxSelection:n=!1,...r})=>{const o={checkboxSelection:n},s=Re.Children.toArray(e).find(e=>Re.isValidElement(e)&&e.type===If),i=Re.Children.toArray(e).filter(e=>Re.isValidElement(e)&&e.type!==If);return(0,T.jsx)(Tf.Provider,{value:o,children:(0,T.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,T.jsx)("div",{className:"overflow-x-auto w-full",children:(0,T.jsx)("div",{className:"relative",children:(0,T.jsx)("table",{className:Ut("table-fixed min-w-full border-collapse border-spacing-0",t),...r,children:i})})}),s]})})},_f=({children:e,className:t,selected:n,onChangeSelection:r,indeterminate:o,disabled:s,...i})=>{const{checkboxSelection:a}=Pf();return(0,T.jsx)("thead",{className:Ut("bg-background-secondary border-x-0 border-t-0 border-b-0.5 border-solid border-border-subtle",t),...i,children:(0,T.jsxs)("tr",{children:[a&&(0,T.jsx)("th",{scope:"col",className:"relative px-5.5 w-11 overflow-hidden",children:(0,T.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,T.jsx)(Ef,{size:"sm",checked:n,indeterminate:o,disabled:s,onChange:e=>{"function"==typeof r&&r(e)},"aria-label":n?"Deselect all":"Select all"})})}),e]})})},Rf=({children:e,className:t,...n})=>(0,T.jsx)("th",{scope:"col",className:Ut("p-3 text-left text-sm font-medium leading-5 text-text-primary",t),...n,children:e}),Af=({children:e,className:t,...n})=>(0,T.jsx)("tbody",{className:Ut("bg-background-primary divide-y-0.5 divide-x-0 divide-solid divide-border-subtle",t),...n,children:e}),Mf=({children:e,selected:t,value:n,className:r,onChangeSelection:o,...s})=>{const{checkboxSelection:i}=Pf();return(0,T.jsxs)("tr",{className:Ut("hover:bg-background-secondary",t&&"bg-background-secondary",r),...s,children:[i&&(0,T.jsx)("td",{className:"relative px-5.5 w-11 overflow-hidden",children:(0,T.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,T.jsx)(Ef,{size:"sm",checked:t,onChange:e=>{"function"==typeof o&&o(e,n)},"aria-label":"Select row"})})}),e]})},Lf=({children:e,className:t,...n})=>(0,T.jsx)("td",{className:Ut("px-3 py-3.5 text-sm font-normal leading-5 text-text-secondary",t),...n,children:e}),If=({children:e,className:t,...n})=>{const{checkboxSelection:r}=Pf();return(0,T.jsx)("div",{className:Ut("px-3 py-3",r&&"px-4",t),...n,children:e})};Nf.displayName="Table",_f.displayName="Table.Head",Rf.displayName="Table.HeadCell",Af.displayName="Table.Body",Mf.displayName="Table.Row",Lf.displayName="Table.Cell",If.displayName="Table.Footer",Nf.Head=_f,Nf.HeadCell=Rf,Nf.Body=Af,Nf.Row=Mf,Nf.Cell=Lf,Nf.Footer=If;const Df=Fe("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]]),Of=Fe("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),Ff=({label:e,id:t,value:n,onChange:r,required:o=!1,placeholder:s="",helpText:i="",smartTags:a=[],type:l="text"})=>(0,T.jsxs)("div",{className:"space-y-1.5",children:[(0,T.jsxs)("div",{className:"flex items-end gap-1.5",children:[(0,T.jsx)("div",{className:"flex-1",children:(0,T.jsx)(xi,{id:t,type:l,value:n,onChange:r,label:(0,T.jsxs)(Kt,{size:"sm",className:"[&>span]:text-field-required",children:[e,o&&(0,T.jsx)("span",{children:" *"})]}),placeholder:s,size:"md",className:"[&>input]:text-field-input"})}),a.length>0&&(0,T.jsx)("div",{className:"mt-6",children:(0,T.jsxs)(mf,{placement:"bottom-start",className:"min-w-fit",children:[(0,T.jsx)(mf.Trigger,{children:(0,T.jsx)(Ks,{variant:"outline",size:"md",icon:(0,T.jsx)(Of,{}),className:"min-w-fit [&_svg]:shrink-0","aria-label":(0,E.__)("Insert smart tag","suredonation")})}),(0,T.jsx)(mf.Portal,{id:"suredonation-dialog-root",children:(0,T.jsx)(mf.ContentWrapper,{children:(0,T.jsx)(mf.Content,{className:"w-60 max-h-80 overflow-y-auto",children:(0,T.jsx)(mf.List,{children:a.map((e,t)=>(0,T.jsxs)("div",{children:[(0,T.jsx)(Kt,{variant:"help",size:"xs",className:"p-2 text-text-primary font-medium text-sm",tabIndex:-1,children:e.label}),e.tags.map(e=>(0,T.jsx)(mf.Item,{className:"text-sm font-normal text-text-secondary hover:bg-background-secondary hover:text-text-primary focus:bg-background-secondary focus:text-text-primary",onClick:()=>{return t=e.tag,void r((n||"")+t);var t},children:e.title||e.tag},e.tag))]},e.label||t))})})})})]})})]}),i&&(0,T.jsx)(Kt,{size:"sm",variant:"help",className:"text-text-tertiary font-normal",children:i})]}),Vf={groups:window.suredonationFormEditor?.emailSmartTags||[]},zf=({data:e,onSave:t,onBack:n})=>{const{groups:r}=Vf,o={id:e.id||!1,status:void 0===e.status||e.status,trigger:e.trigger||"",name:e.name||(0,E.__)("New Notification","suredonation"),email_to:e.email_to||"",subject:e.subject||"",email_body:e.email_body||"",from_name:e.from_name||"{site_title}",from_email:e.from_email||"{admin_email}",reply_to:e.reply_to||""},[s,i]=(0,S.useState)(o),a=(0,S.useRef)(JSON.stringify(o)),l=(0,S.useMemo)(()=>s.id?JSON.stringify(s)!==a.current:!!s.email_to?.trim()&&!!s.subject?.trim(),[s]),c=(e,t)=>{i(n=>({...n,[e]:t}))};return(0,T.jsx)(la,{title:s.id?s.name:(0,E.__)("Add Notification","suredonation"),titleHelpText:(0,E.__)("Configure the email notification details.","suredonation"),showTitleHelpText:!0,onClickSave:()=>{const e=(s.email_to||"").trim(),r=(s.subject||"").trim();e&&r?t(s)&&(Ge.success((0,E.__)("Email notification saved.","suredonation")),n()):Ge.error((0,E.__)("Please provide a recipient email and subject line.","suredonation"))},onClickCancel:()=>{n()},saveBtnDisabled:!l,children:(0,T.jsxs)("div",{className:"space-y-5",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(Kt,{size:"sm",className:"mb-1.5 block",htmlFor:"sd-email-notification-name",children:(0,E.__)("Name","suredonation")}),(0,T.jsx)(xi,{id:"sd-email-notification-name",value:s.name,onChange:e=>c("name",e),placeholder:(0,E.__)("Notification name","suredonation"),size:"md"})]}),(0,T.jsx)(Ff,{label:(0,E.__)("Send Email To","suredonation"),id:"sd-email-notification-to",value:s.email_to,onChange:e=>c("email_to",e),required:!0,placeholder:(0,E.__)("e.g. {donor_email} or [email protected]","suredonation"),helpText:(0,E.__)("Use smart tags or enter email addresses. Comma-separated values accepted.","suredonation"),smartTags:r}),(0,T.jsx)(Ff,{label:(0,E.__)("Subject","suredonation"),id:"sd-email-notification-subject",value:s.subject,onChange:e=>c("subject",e),required:!0,placeholder:(0,E.__)("Email subject line…","suredonation"),smartTags:r}),(0,T.jsx)(xf,{content:s.email_body,handleContentChange:e=>c("email_body",e),editorId:`sd-email-notif-editor-${s.id||"new"}`,label:(0,E.__)("Email Message","suredonation"),smartTagGroups:r,height:250}),(0,T.jsx)(Ff,{label:(0,E.__)("From Name","suredonation"),id:"sd-email-notification-from-name",value:s.from_name,onChange:e=>c("from_name",e),smartTags:r}),(0,T.jsx)(Ff,{label:(0,E.__)("From Email","suredonation"),id:"sd-email-notification-from-email",value:s.from_email,onChange:e=>c("from_email",e),helpText:(0,E.__)("Notifications can use only one From Email so please enter a single address.","suredonation"),smartTags:r,type:"email"}),(0,T.jsx)(Ff,{label:(0,E.__)("Reply-To Email","suredonation"),id:"sd-email-notification-reply-to",value:s.reply_to,onChange:e=>c("reply_to",e),smartTags:r,type:"email"})]})})},Bf="_suredonation_form_email_notifications",$f=window.suredonationFormEditor?.defaultEmailNotifications||[],Wf=()=>{const[e,t]=(0,S.useState)(!1),[r,o]=(0,S.useState)([]),{editPost:s,savePost:i}=(0,n.useDispatch)(C.store),[a,l]=(0,S.useState)(!1),[c,d]=(0,S.useState)(!1),{sureformsMeta:u,hasSubscription:m}=(0,n.useSelect)(e=>{const t=e(C.store).getEditedPostAttribute("meta"),n=e(_.store).getBlocks(),r=e=>{for(const t of e){if("suredonation/payment"===t.name&&"subscription"===t.attributes?.paymentType)return!0;if(t.innerBlocks?.length&&r(t.innerBlocks))return!0}return!1};return{sureformsMeta:t,hasSubscription:r(n)}},[]),p=e=>e.trigger&&e.trigger.startsWith("subscription_"),h=(()=>{const e=u?.[Bf];if(e&&"string"==typeof e)try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return null})(),f=(0,S.useMemo)(()=>m?$f:$f.filter(e=>!p(e)),[m]),g=null!==h?h:f,v=m?g:g.filter(e=>!p(e));(0,S.useEffect)(()=>{null===h&&f.length>0&&(s({meta:{[Bf]:JSON.stringify(f)}}),d(!0))},[]),(0,S.useEffect)(()=>{if(!m||null===h)return;const e=h.some(e=>p(e));if(e)return;const t=$f.filter(e=>p(e));if(0===t.length)return;const n=h.reduce((e,t)=>Math.max(e,parseInt(t?.id,10)||0),0),r=t.map((e,t)=>({...e,id:n+t+1})),o=[...h,...r];s({meta:{[Bf]:JSON.stringify(o)}}),d(!0)},[m]);const b=e=>{s({meta:{[Bf]:JSON.stringify(e)}}),d(!0)};return e?(0,T.jsx)(zf,{data:r,onSave:e=>{let{email_to:t,subject:n}=e;if(t=(t||"").trim(),n=(n||"").trim(),!t||!n)return Ge.error((0,E.__)("Please provide a recipient email and subject line.","suredonation")),!1;const r=g.map(t=>t.id===e.id?e:t);return b(r),!0},onBack:()=>{t(!1)}}):(0,T.jsx)(la,{title:(0,E.__)("Email Notifications","suredonation"),titleHelpText:(0,E.__)("Configure email notifications sent after a donation is submitted through this form.","suredonation"),showTitleHelpText:!0,onClickSave:async()=>{l(!0);try{await i(),d(!1),Ge.success((0,E.__)("Email notifications saved.","suredonation"))}catch{Ge.error((0,E.__)("Failed to save email notifications.","suredonation"))}finally{l(!1)}},saveBtnDisabled:!c||a,isSaving:a,children:(0,T.jsxs)(Nf,{className:"rounded-md",children:[(0,T.jsxs)(Nf.Head,{children:[(0,T.jsx)(Nf.HeadCell,{className:"w-16",children:(0,E.__)("Status","suredonation")}),(0,T.jsx)(Nf.HeadCell,{children:(0,E.__)("Name","suredonation")}),(0,T.jsx)(Nf.HeadCell,{children:(0,E.__)("Subject","suredonation")}),(0,T.jsx)(Nf.HeadCell,{className:"w-16 text-right",children:(0,E.__)("Actions","suredonation")})]}),(0,T.jsx)(Nf.Body,{children:v.map(e=>(0,T.jsxs)(Nf.Row,{className:"hover:bg-background-secondary",children:[(0,T.jsx)(Nf.Cell,{children:(0,T.jsx)(Ti,{size:"sm",checked:e.status,onChange:()=>(e=>{const t=g.map(t=>t.id===e.id?{...t,status:!t.status}:t);b(t),Ge.success(e.status?(0,E.__)("Email notification disabled.","suredonation"):(0,E.__)("Email notification enabled.","suredonation"))})(e)})}),(0,T.jsx)(Nf.Cell,{children:e.name}),(0,T.jsx)(Nf.Cell,{children:e.subject}),(0,T.jsx)(Nf.Cell,{className:"text-right",children:(0,T.jsx)(Si,{placement:"top",tooltipPortalId:"suredonation-dialog-root",content:(0,E.__)("Edit","suredonation"),children:(0,T.jsx)(Ks,{variant:"ghost",size:"xs",className:"text-icon-secondary",onClick:()=>{return n=e,t(!0),void o(n);var n},icon:(0,T.jsx)(Df,{className:"size-4"})})})})]},e.id))})]})})},Uf=(e=!1)=>{const t=[{id:"confirmation_settings",label:(0,E.__)("Confirmation Settings","suredonation"),icon:e?(0,T.jsx)(Be,{}):(0,T.jsx)(Be,{size:18}),...e&&{component:(0,T.jsx)(Cf,{})}},{id:"email_notifications",label:(0,E.__)("Email Notifications","suredonation"),icon:e?(0,T.jsx)($e,{}):(0,T.jsx)($e,{size:18}),...e&&{component:(0,T.jsx)(Wf,{})}}];return(0,ze.applyFilters)("sd.formSettings.tabs",t)},Hf=({popoverAnchor:e,setOpenPopover:t,hidePopover:n,setHidePopover:r,onTabClick:o})=>{const s=Uf(!1).filter(e=>!e.parent);return(0,T.jsx)(R.Popover,{resize:!0,hidden:n,placement:"bottom-end",anchor:e,onFocusOutside:n=>{e?.contains(n.relatedTarget)||(n.relatedTarget?.className?.includes("media-modal")?r(!0):t(!1))},className:"suredonation-form-settings-popover",children:(0,T.jsx)("div",{className:"suredonation-form-settings-container",children:(0,T.jsx)("div",{className:"suredonation-form-settings-group",children:s.map(e=>(0,T.jsxs)("button",{className:"suredonation-form-settings-nav-item",onClick:()=>{return n=e.id,o(n),void t(!1);var n},children:[e.icon&&(0,T.jsx)("span",{className:"suredonation-form-settings-nav-item-icon",children:e.icon}),(0,T.jsx)("span",{className:"suredonation-form-settings-nav-item-label",children:e.label})]},e.id))})})})},qf=(0,Re.createContext)({}),Kf=()=>(0,Re.useContext)(qf),Gf={open:{opacity:1},exit:{opacity:0}},Yf={duration:.2},Xf=({open:e,setOpen:t,children:n,trigger:r=null,className:o,exitOnClickOutside:s=!1,exitOnEsc:i=!0,design:a="simple",scrollLock:l=!0})=>{const c=void 0!==e&&void 0!==t,[d,u]=(0,Re.useState)(!1),m=(0,Re.useRef)(null),p=(0,Re.useRef)(null),h=(0,Re.useMemo)(()=>c?e:d,[e,d]),f=(0,Re.useMemo)(()=>c?t:u,[u,t]),{refs:g,context:v}=Ss({open:h,onOpenChange:f}),b=xs(v),y=Cs(v,{enabled:s||i,escapeKey:i,outsidePress:s}),x=Os(v,{role:"dialog"}),{getFloatingProps:w}=Ns([b,y,x]),k=()=>{h||f(!0)},j=(0,Re.useCallback)(()=>(0,Re.isValidElement)(r)?(0,Re.cloneElement)(r,{onClick:Ht(k,r?.props?.onClick),ref:g.setReference,"aria-haspopup":"dialog","aria-expanded":h}):"function"==typeof r?r({onClick:k}):null,[r,k,g.setReference,h]);return(0,T.jsxs)(T.Fragment,{children:[j(),(0,T.jsx)(qf.Provider,{value:{open:h,setOpen:f,handleClose:()=>{h&&f(!1)},design:a,context:v,getFloatingProps:w,refs:g,dialogContainerRef:p,dialogRef:m,scrollLock:l,className:o},children:n})]})};Xf.displayName="Dialog";const Zf=({children:e,className:t})=>{const{open:n,handleClose:r,context:o,getFloatingProps:s,dialogRef:i,scrollLock:a,dialogContainerRef:l,className:c,refs:d}=Kf();return(0,T.jsx)(nf,{children:n&&(0,T.jsx)(vs,{ref:l,lockScroll:a,className:Ut("z-999999",c),"aria-modal":"true",children:(0,T.jsx)(hs,{context:o,...d?.reference&&{returnFocus:d.reference},children:(0,T.jsx)($h.div,{className:"fixed inset-0 overflow-y-auto",initial:"exit",animate:"open",exit:"exit",variants:Gf,role:"dialog","aria-modal":"true",transition:Yf,children:(0,T.jsx)("div",{className:"flex items-center justify-center min-h-full",children:(0,T.jsx)("div",{ref:e=>{e&&(i.current=e,o&&o.refs.setFloating(e))},...s?.(),className:Ut("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})})})})})})};Zf.displayName="Dialog.Panel";const Jf=({children:e,...t})=>(0,T.jsx)(is,{...t,children:e});Jf.displayName="Dialog.Portal";const Qf=({className:e,...t})=>{const{open:n,dialogContainerRef:r}=Kf();return r?.current?(0,T.jsx)(T.Fragment,{children:(0,Pr.createPortal)((0,T.jsx)(nf,{children:n&&(0,T.jsx)($h.div,{className:Ut("fixed inset-0 -z-10 bg-background-inverse/90",e),...t,initial:"exit",animate:"open",exit:"exit",variants:Gf,transition:Yf})}),r.current)}):null};Qf.displayName="Dialog.Backdrop";const eg=({children:e,className:t,...n})=>(0,T.jsx)("div",{className:Ut("space-y-2 px-5 pt-5 pb-1",t),...n,children:e});eg.displayName="Dialog.Header";const tg=({children:e,as:t="h3",className:n,...r})=>(0,T.jsx)(t,{className:Ut("text-base font-semibold text-text-primary m-0 p-0",n),...r,children:e});tg.displayName="Dialog.Title";const ng=({children:e,as:t="p",className:n,...r})=>(0,T.jsx)(t,{className:Ut("text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",n),...r,children:e});ng.displayName="Dialog.Description";const rg=({className:e,...t})=>(0,T.jsx)("button",{className:Ut("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,T.jsx)(ii,{className:"size-4 text-text-primary shrink-0"})}),og=({children:e,as:t=Re.Fragment,...n})=>{const{handleClose:r}=Kf();return e?t===Re.Fragment?"function"==typeof e?e({close:r}):(0,Re.cloneElement)(e,{onClick:r}):(0,T.jsx)(t,{...n,onClick:r,"aria-label":"Close dialog",children:e}):(0,T.jsx)(rg,{onClick:r,...n})};og.displayName="Dialog.CloseButton";const sg=({children:e,className:t,...n})=>(0,T.jsx)("div",{className:Ut("px-5",t),...n,children:e});sg.displayName="Dialog.Body";const ig=({children:e,className:t})=>{const{design:n,handleClose:r}=Kf();return(0,T.jsx)("div",{className:Ut("p-4 flex justify-end gap-3",{"bg-background-secondary":"footer-divided"===n},t),children:e?"function"==typeof e?e({close:r}):e:null})};ig.displayName="Dialog.Footer",Xf.Panel=Zf,Xf.Portal=Jf,Xf.Title=tg,Xf.Description=ng,Xf.CloseButton=og,Xf.Header=eg,Xf.Body=sg,Xf.Footer=ig,Xf.Backdrop=Qf;const ag={"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"},lg={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"},cg="bg-background-inverse border-background-inverse",dg={light:"text-icon-secondary",dark:"text-icon-inverse"};let ug=!1;const mg=({toastItem:e,title:t="",content:n="",autoDismiss:r=!0,dismissAfter:o=5e3,theme:s="light",design:i="stack",icon:a,variant:l="neutral",removeToast:c})=>{const d=(0,Re.useRef)(0),u=(0,Re.useRef)(0),m=(0,Re.useRef)(),p=(e,t=o)=>{if(r&&!(o<0))return d.current=(new Date).getTime(),setTimeout(()=>{"function"==typeof c&&c(e.id)},t)};(0,Re.useEffect)(()=>{const t=o;return m.current=p(e,t),()=>{clearTimeout(m.current)}},[]),(0,Re.useEffect)(()=>{!e?.dismiss||"function"!=typeof c||c(e.id)},[e]);const h=()=>{"function"==typeof c&&e?.action?.onClick?.(()=>c(e.id))};let f=null;return"stack"===i&&(f=(0,T.jsx)("div",{className:Ut("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===s?cg:lg?.[l],"w-[22.5rem]"),onMouseEnter:()=>{clearTimeout(m.current),u.current=(new Date).getTime()},onMouseLeave:()=>{m.current=p(e,o-(u.current-d.current))},children:"custom"!==e.type?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Xs({variant:l,icon:a,theme:s})}),(0,T.jsxs)("div",{className:"flex flex-col items-start justify-start gap-0.5 mr-6",children:[Js({title:t,theme:s}),Qs({content:n,theme:s}),e?.action?.label&&"function"==typeof e?.action?.onClick&&(0,T.jsx)("div",{className:"mt-2.5",children:Zs({actionLabel:e?.action?.label,actionType:e?.action?.type??"button",onAction:h,theme:s})})]}),(0,T.jsx)("div",{className:"absolute right-4 top-4 [&_svg]:size-5",children:(0,T.jsx)("button",{className:Ut("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",dg[s]??dg.light),onClick:()=>{"function"==typeof c&&c(e.id)},children:(0,T.jsx)(ii,{})})})]}):e?.jsx?.({close:()=>c(e.id),action:e?.action?{...e?.action,onClick:h}:null})})),"inline"===i&&(f=(0,T.jsxs)("div",{className:Ut("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===s?cg:lg?.[l],"lg:w-[47.5rem] w-full"),children:[(0,T.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Xs({variant:l,icon:a,theme:s})}),(0,T.jsxs)("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0",children:[Js({title:t,theme:s}),Qs({content:n,theme:s})]}),(0,T.jsx)("div",{className:"absolute right-3 top-3 [&_svg]:size-5",children:(0,T.jsx)("button",{className:Ut("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",dg[s]??dg.light),onClick:()=>c(e.id),children:(0,T.jsx)(ii,{})})})]})),f},pg=(e=>(0,Re.memo)(t=>{const n=t.singleTon;return ug&&n?null:(ug=!0,(0,T.jsx)(e,{...t}))}))(({position:e="top-right",design:t="stack",theme:n="light",className:r="",autoDismiss:o=!0,dismissAfter:s=5e3})=>{const[i,a]=(0,Re.useState)([]);(0,Re.useEffect)(()=>{Ke.subscribe(e=>{e?.dismiss?a(t=>t.map(t=>t.id===e.id?{...t,dismiss:!0}:t)):setTimeout(()=>{(0,Pr.flushSync)(()=>a(t=>-1!==t.findIndex(t=>t.id===e.id)?t.map(t=>t.id===e.id?{...t,...e}:t):[...t,e]))})})},[]);const l=e=>{a(t=>t.filter(t=>t.id!==e))};return(0,T.jsx)("ul",{className:Ut("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",ag[e]??ag["top-right"],r),children:(0,T.jsx)(nf,{initial:!1,children:i.map(e=>(0,T.jsx)($h.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,T.jsx)(mg,{toastItem:e,title:e.title,content:e?.description,icon:e?.icon??void 0,design:e?.design??t,autoDismiss:e?.autoDismiss??o,dismissAfter:e?.dismissAfter??s,removeToast:l,variant:e.type,theme:e?.theme??n})},e.id))})})}),hg=Fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),fg=({tabs:e,selectedTab:t,setSelectedTab:n})=>(0,T.jsx)("nav",{className:"shrink-0 w-[17rem] p-2 h-full bg-background-primary overflow-y-auto","aria-label":(0,E.__)("Form settings navigation","suredonation"),children:(0,T.jsx)("ul",{className:"w-full h-full bg-background-primary p-2 space-y-1 m-0",children:e.map(e=>{if(void 0!==e.parent)return null;const r=e.id===t;return(0,T.jsx)("li",{children:(0,T.jsxs)("button",{className:Li("w-full flex items-center justify-start gap-2.5 px-2 py-2 rounded-md border-0 outline-none focus:outline-none focus:ring-1 focus:ring-focus transition-[colors,box-shadow] duration-200 cursor-pointer",r?"bg-brand-background-50 text-text-primary":"bg-transparent text-text-secondary hover:bg-brand-background-50"),onClick:(o=e.id,()=>{n(o)}),"aria-current":r?"true":void 0,children:[(0,T.jsx)("span",{className:Li("[&>svg]:size-5 shrink-0 h-[20px]",r?"text-icon-interactive [&>svg]:!text-icon-interactive":"text-icon-secondary [&>svg]:!text-icon-secondary"),children:e.icon}),(0,T.jsx)("span",{className:"text-base font-normal text-left break-words whitespace-normal",children:e.label})]})},e.id);var o})})}),gg=(0,S.memo)(({open:e,setOpen:t,targetTab:r,close:o})=>{const[s,i]=(0,S.useState)(null),[a,l]=(0,S.useState)(r??"confirmation_settings");(0,S.useLayoutEffect)(()=>{let e=document.getElementById("suredonation-dialog-root");e||(e=document.createElement("div"),e.id="suredonation-dialog-root",document.body.appendChild(e)),i(e)},[]),(0,S.useLayoutEffect)(()=>{r&&e&&l(r)},[r,e]);const c=(0,n.useSelect)(e=>e("core/edit-post")?.isFeatureActive?.("fullscreenMode"),[]);(0,S.useLayoutEffect)(()=>{const e=()=>{window.requestAnimationFrame(()=>{const e=document.querySelector(".suredonation-dialog-panel");if(!e)return;const t=document.getElementById("adminmenu"),n=t?t.offsetWidth+40:0;c?(e.style.removeProperty("margin-left"),e.style.removeProperty("margin-right")):(e.style.marginLeft=`${n}px`,e.style.marginRight="40px")})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[e,c]);const d=Uf(!0);return s&&(0,S.createPortal)((0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(Xf,{design:"simple",exitOnEsc:!0,scrollLock:!0,open:e,setOpen:t,className:"[&>div>div]:h-full z-99999 border-radius-none",children:[(0,T.jsx)(Xf.Backdrop,{}),(0,T.jsx)(Xf.Panel,{className:"h-full w-full m-auto rounded-none suredonation-dialog-panel",children:(0,T.jsxs)(oa,{direction:"column",gap:"none",className:"w-full h-full divide-y divide-x-0 divide-solid divide-border-subtle",children:[(0,T.jsxs)(oa,{className:"py-3 px-4",justify:"between",children:[(0,T.jsx)(ia,{tag:"h6",title:(0,E.__)("Form Settings","suredonation"),size:"xs"}),(0,T.jsx)(Ks,{variant:"ghost",size:"sm",className:"p-1",onClick:o,icon:(0,T.jsx)(hg,{}),"aria-label":(0,E.__)("Close form settings","suredonation")})]}),(0,T.jsxs)("div",{className:"w-full h-[calc(100%-3rem)] flex justify-start items-stretch",children:[(0,T.jsx)(fg,{tabs:d,selectedTab:a,setSelectedTab:l}),(0,T.jsx)("div",{className:"p-8 w-full h-full bg-background-secondary overflow-y-auto",children:(0,T.jsx)("div",{className:"w-full mx-auto h-full max-w-[43.5rem]",children:d.find(({id:e})=>e===a)?.component})})]})]})})]}),(0,T.jsx)(pg,{position:"top-center"})]}),s)}),vg=()=>{const[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),[l,c]=(0,S.useState)(null);return(0,T.jsxs)("div",{className:"suredonation-form-settings-button-wrapper",children:[(0,T.jsxs)("button",{ref:t,className:"suredonation-form-settings-button",onClick:()=>{const e=!n;r(e),e&&s(!1)},"aria-expanded":n,"aria-haspopup":"true",children:[(0,E.__)("Form Settings","suredonation"),(0,T.jsx)("span",{className:"suredonation-form-settings-button-icon",children:(0,T.jsx)(Ve,{})})]}),n&&(0,T.jsx)(Hf,{popoverAnchor:e,setOpenPopover:r,hidePopover:o,setHidePopover:s,onTabClick:e=>{c(e),a(!0)}}),(0,T.jsx)(gg,{open:i,setOpen:a,targetTab:l,close:()=>{a(!1)}})]})},bg=window.wp.coreData,yg=()=>{const e=(0,n.useSelect)(e=>e("core/editor").getCurrentPostId(),[]),[t,r]=(0,bg.useEntityProp)("postType","suredonation_form","title",e),o=(0,S.useRef)(null);return(0,S.useEffect)(()=>{o.current&&!t&&o.current.focus()},[]),(0,T.jsx)(R.TextControl,{__next40pxDefaultSize:!0,ref:o,className:"suredonation-form-title-input",placeholder:(0,E.__)("Form Title","suredonation"),value:t||"",onChange:e=>r(e),autoComplete:"off"})},xg=()=>(0,T.jsx)(_.Inserter,{position:"bottom center",__experimentalIsQuick:!0,className:"suredonation-custom-block-inserter",renderToggle:({onToggle:e,disabled:t,isOpen:n})=>(0,T.jsx)(R.Tooltip,{text:(0,E.__)("Add Block","suredonation"),children:(0,T.jsx)(R.Button,{className:"block-editor-button-block-appender suredonation-custom-block-inserter-button",onClick:e,"aria-haspopup":"true","aria-expanded":n,disabled:t,children:(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",focusable:"false","aria-hidden":"true",children:(0,T.jsx)("path",{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})})})}),isAppender:!0});wp.domReady(()=>{(()=>{Ne("core/edit-post")?.isEditorSidebarOpened?.()||_e("core/edit-post")?.openGeneralSidebar?.("edit-post/document");const e="sd-form-editor/sd-description";Ne("core/editor")?.isEditorPanelEnabled?.(e)||_e("core/edit-post")?.toggleEditorPanelEnabled?.(e),Ne("core/editor")?.isEditorPanelOpened?.(e)||_e("core/edit-post")?.toggleEditorPanelOpened?.(e)})(),(()=>{const e=document.getElementById("editor");if(!e)return;const t=document.createElement("div");t.classList.add("suredonation-form-settings-root");const n=(0,S.createRoot)(t),r=wp.data.subscribe(function(){setTimeout(function(){if(document.querySelector(".suredonation-form-settings-root"))return void r();const o=e.querySelector(".edit-post-header__settings")||e.querySelector(".editor-header__settings");o&&(o.prepend(t),n.render((0,T.jsx)(vg,{})),r())},1)})})(),(()=>{const e=document.createElement("div");e.classList.add("suredonation-form-title-root");const t=(0,S.createRoot)(e),n=wp.data.subscribe(()=>{setTimeout(()=>{if(document.querySelector(".suredonation-form-title-root"))return void n();const r=document.querySelector(".edit-post-header__center")||document.querySelector(".editor-header__center");if(r){const o=document.querySelector(".editor-post-title__block");o&&o.remove(),r.appendChild(e),t.render((0,T.jsx)(yg,{})),n()}},1)})})(),(()=>{let e=null,t=null,n=null,r=null;const o=()=>{r&&e&&r.lastElementChild!==e&&r.appendChild(e)};wp.data.subscribe(()=>{setTimeout(()=>{const s=(()=>{let e=document.querySelector(".is-root-container.block-editor-block-list__layout");if(e)return e;const t=document.querySelector('iframe[name="editor-canvas"]'),n=t&&t.contentDocument;return n&&(e=n.querySelector(".is-root-container.block-editor-block-list__layout"),e)?e:null})();s&&(s===r&&s.contains(e)||(s=>{n&&(n.disconnect(),n=null),t&&(t.unmount(),t=null),r=s,e=s.ownerDocument.createElement("div"),e.classList.add("suredonation-custom-block-inserter-root"),t=(0,S.createRoot)(e),s.appendChild(e),t.render((0,T.jsx)(xg,{})),n=new MutationObserver(o),n.observe(s,{childList:!0})})(s))},1)})})()})})()})();
1 +(()=>{var e,t,n={6359(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1601),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,'.components-panel[data-sd-tab]{z-index:99}.components-panel[data-sd-tab]:not([data-sd-tab=advance]) .components-panel__body.block-editor-block-inspector__advanced,.components-panel[data-sd-tab]:not([data-sd-tab=advance]) .components-panel__body.editor-block-inspector__advanced.block-editor-block-inspector__advanced,.components-panel[data-sd-tab]:not([data-sd-tab=advance]) .block-editor-block-inspector>div>.components-panel__body{display:none}.components-panel[data-sd-tab] .block-editor-block-card{position:relative;z-index:1;overflow:hidden}.components-panel[data-sd-tab] .block-editor-block-card::before{content:"";position:absolute;top:0;left:-16px;right:-16px;bottom:0;background:#fff;z-index:-1}.components-panel[data-sd-tab] .components-panel__body.edit-post-settings-sidebar__panel-block .block-editor-block-card{overflow:unset}.components-panel[data-sd-tab] .components-panel__body.edit-post-settings-sidebar__panel-block .block-editor-block-card::before{top:-16px}.components-panel[data-sd-tab=advance] .block-editor-block-inspector__advanced{border-color:rgba(0,0,0,0)}[dir=rtl] .sd-inspector-tabs{direction:rtl}[dir=rtl] .sd-inspector-tabs>div:first-child.sd-active::after{border-left:1px solid #d6d9dd;border-right:0}[dir=rtl] .sd-inspector-tabs>div:last-child.sd-active::after{border-left:0;border-right:1px solid #d6d9dd}.sd-inspector-tabs{display:flex;position:relative;background:#fff;z-index:9;height:65px}.sd-inspector-tabs>div{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;background:#fff;cursor:pointer}.sd-inspector-tabs>div::after,.sd-inspector-tabs>div::before{content:"";position:absolute;display:block;top:0;left:0;width:100%}.sd-inspector-tabs>div::after{border-bottom:1px solid #d6d9dd;height:100%;z-index:1}.sd-inspector-tabs>div:first-child.sd-active::after{border-left:0;box-shadow:inset 0 -3px 0 0 #0085ba;color:#0085ba}.sd-inspector-tabs>div:last-child.sd-active::after{border-right:0;box-shadow:inset 0 -3px 0 0 #0085ba;color:#0085ba}.sd-inspector-tabs>div.sd-active::after{border-left:1px solid #d6d9dd;border-right:1px solid #d6d9dd;border-bottom:0;box-shadow:inset 0 -3px 0 0 #0085ba;color:#0085ba}.sd-inspector-tabs>div.sd-active::before{height:0;background-color:rgba(0,0,0,0);z-index:2}.sd-inspector-tabs>div h5{margin:6px 0 0;font-size:13px;font-weight:400;line-height:1.2}.sd-inspector-tabs>div h5,.sd-inspector-tabs>div svg{z-index:2;fill:#585858}.sd-inspector-tabs>div.sd-active h5{color:#0085ba}.sd-inspector-tabs>div.sd-active path{fill:#0085ba}.sd-inspector-tabs>div:hover:not(.sd-active) h5{color:#1e1e1e}.sd-inspector-tabs>div:hover:not(.sd-active) path{fill:#1e1e1e}.sd-inspector-tabs>div:focus{outline:none;box-shadow:inset 0 0 0 2px #0085ba}.components-panel .components-panel__body .sd-inspector-tabs-container{position:static !important;border-top:0 !important;top:0 !important}.sd-inspector-tabs-container{position:sticky;top:-3px;z-index:9;border-top:calc(.1em + 1px) solid #f2f4f5;direction:initial}.block-editor-block-inspector .sd-inspector-tab{padding:16px}.block-editor-block-inspector .sd-inspector-tab .components-panel__body:first-child{margin-top:0;border-top:none !important}.block-editor-block-inspector .sd-inspector-tab:empty{padding:0}.edit-post-settings-sidebar__panel-block .sd-inspector-tab .components-panel__body:first-child{margin-top:0;border-top:none !important}',""]);const a=i},4180(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1601),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,".sd-multi-buttons-control{margin-bottom:16px}.sd-multi-buttons-control .sd-control-label{display:block;margin-bottom:8px;font-size:11px;font-weight:500;text-transform:uppercase;color:#1e1e1e}.sd-multi-buttons-control .sd-multi-button-button-group{display:flex;width:100%}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button{flex:1;justify-content:center;height:unset;min-height:30px;padding:6px;line-height:16px;font-size:13px;font-weight:400;border:none;border-radius:0;color:#50575e;background-color:#fff;box-shadow:inset 0 0 0 1px #e6e7e9}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button:first-child{border-radius:3px 0 0 3px}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button:last-child{border-radius:0 3px 3px 0}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-primary,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=true]{color:#007cba;background-color:#dcf2ff;box-shadow:inset 0 0 0 1px #cde9f9;z-index:1}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-primary:hover,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=true]:hover{color:#007cba;background-color:#dcf2ff;box-shadow:inset 0 0 0 1px #cde9f9}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-primary:focus,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=true]:focus{box-shadow:inset 0 0 0 1px #cde9f9,0 0 0 1px #007cba}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-secondary,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=false]{color:#50575e;background-color:#fff;box-shadow:inset 0 0 0 1px #e6e7e9}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-secondary:hover,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=false]:hover{color:#1d2327;box-shadow:inset 0 0 0 1px #e6e7e9}.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button.is-secondary:focus,.sd-multi-buttons-control .sd-multi-button-button-group .sd-multi-button[aria-pressed=false]:focus{box-shadow:inset 0 0 0 1px #e6e7e9}.sd-multi-buttons-control .sd-help-text{margin-top:8px;font-size:12px;font-style:italic;color:#a4afb7}.sd-multi-buttons-control.sd-multi-buttons__color-scheme--secondary .sd-multi-button-button-group .sd-multi-button.is-primary,.sd-multi-buttons-control.sd-multi-buttons__color-scheme--secondary .sd-multi-button-button-group .sd-multi-button[aria-pressed=true]{background-color:#1e1e1e;border-color:#1e1e1e}.sd-multi-buttons-control.sd-multi-buttons__layout--inline{display:flex;align-items:center;gap:12px}.sd-multi-buttons-control.sd-multi-buttons__layout--inline .sd-control-label{margin-bottom:0;flex-shrink:0}.sd-multi-buttons-control.sd-multi-buttons__layout--inline .sd-multi-button-button-group{flex:1}.sd-multi-buttons-control.sd-multi-buttons__layout--compact .sd-multi-button-button-group .sd-multi-button{flex:0 0 auto;padding:0 12px}.sd-multibutton-icons .sd-multi-button-button-group .sd-multi-button{padding:0 8px}.sd-multibutton-icons .sd-multi-button-button-group .sd-multi-button svg{width:18px;height:18px}",""]);const a=i},4676(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1601),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,".sd-range-control{margin-bottom:16px}.sd-range-control .sd-range-control__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.sd-range-control .sd-range-control__header .sd-control-label{font-size:11px;font-weight:500;text-transform:uppercase;color:#1e1e1e}.sd-range-control .sd-range-control__header .sd-range-control__reset{background:none;border:none;padding:4px;cursor:pointer;color:#757575;display:flex;align-items:center;justify-content:center;border-radius:2px;transition:all .15s ease}.sd-range-control .sd-range-control__header .sd-range-control__reset:hover{color:#1e1e1e;background:#f0f0f0}.sd-range-control .sd-range-control__header .sd-range-control__reset:focus{outline:none;box-shadow:0 0 0 2px #1293b6}.sd-range-control .sd-range-control__header .sd-range-control__reset svg{fill:currentColor}.sd-range-control .sd-range-control__controls{display:flex;align-items:center;gap:12px}.sd-range-control .sd-range-control__controls .components-range-control{flex:1;margin-bottom:0}.sd-range-control .sd-range-control__controls .components-range-control .components-range-control__wrapper{margin:0}.sd-range-control .sd-range-control__controls .components-range-control .components-range-control__slider{margin:0}.sd-range-control .sd-range-control__controls .components-range-control .components-range-control__root{margin-bottom:0}.sd-range-control .sd-range-control__controls .components-number-control{width:70px;flex-shrink:0}.sd-range-control .sd-range-control__controls .components-number-control input{height:32px;text-align:center}.sd-range-control .sd-help-text{margin-top:8px;font-size:12px;font-style:italic;color:#a4afb7}",""]);const a=i},9380(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(1601),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,".sd-text-control{position:relative;margin-bottom:16px}.sd-text-control .components-base-control__field{margin-bottom:0}.sd-text-control .sd-control__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.sd-text-control .sd-control__header .sd-control-label{font-size:11px;font-weight:500;text-transform:uppercase;color:#1e1e1e;line-height:1.4}.sd-text-control .components-text-control__input,.sd-text-control .components-textarea-control__input{margin-left:0;margin-right:0;color:#50575e;border-color:#e6e7e9;border-radius:4px}.sd-text-control .components-text-control__input:focus,.sd-text-control .components-textarea-control__input:focus{border-color:#959595;box-shadow:none}.sd-text-control__controls{position:relative}.sd-text-control__controls .components-base-control__label{font-size:11px;font-weight:500;text-transform:uppercase;margin-bottom:8px}.sd-text-control__controls-inline .components-base-control__field{display:flex;align-items:center}.sd-text-control__controls-inline .components-base-control__field>label{flex:50%;margin-bottom:0}.sd-text-control__controls-inline .components-base-control__field>input{flex:50%}.sd-text-control__controls-textarea{position:relative}.sd-text-control__controls-textarea textarea{color:#50575e;border-color:#e6e7e9;min-height:80px;resize:vertical}.sd-text-control__controls-textarea textarea:focus{border-color:#959595;box-shadow:none}.sd-text-control .sd-help-text{margin-top:8px;font-size:12px;font-style:italic;color:#a4afb7}.sd-text-control--full-width .sd-text-control__controls .components-base-control__label{display:none}",""]);const a=i},6314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&i[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},1601(e){"use strict";e.exports=function(e){return e[1]}},5072(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var s={},i=[],a=0;a<e.length;a++){var l=e[a],c=r.base?l[0]+r.base:l[0],d=s[c]||0,u="".concat(c," ").concat(d);s[c]=d+1;var m=n(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==m)t[m].references++,t[m].updater(p);else{var h=o(p,r);r.byIndex=a,t.splice(a,0,{identifier:u,updater:h,references:1})}i.push(u)}return i}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var s=r(e=e||[],o=o||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var l=r(e,o),c=0;c<s.length;c++){var d=n(s[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}s=l}}},7659(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},4868(e){"use strict";e.exports=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}},4284(e){"use strict";var t,n=(t=[],function(e,n){return t[e]=n,t.filter(Boolean).join("\n")});function r(e,t,r,o){var s;if(r)s="";else{s="",o.supports&&(s+="@supports (".concat(o.supports,") {")),o.media&&(s+="@media ".concat(o.media," {"));var i=void 0!==o.layer;i&&(s+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),s+=o.css,i&&(s+="}"),o.media&&(s+="}"),o.supports&&(s+="}")}if(e.styleSheet)e.styleSheet.cssText=n(t,s);else{var a=document.createTextNode(s),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(a,l[t]):e.appendChild(a)}}var o={singleton:null,singletonCounter:0};e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=o.singletonCounter++,n=o.singleton||(o.singleton=e.insertStyleElement(e));return{update:function(e){r(n,t,!1,e)},remove:function(e){r(n,t,!0,e)}}}},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,s(n)))}return e}function s(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)}()}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,exports:{}};return n[e](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var s=Object.create(null);o.r(s);var i={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,o.d(s,i),s},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};o.r(e),o.d(e,{addField:()=>a,initializeStore:()=>d,removeField:()=>l,resetStore:()=>u,setActiveTab:()=>s,setFieldsList:()=>i,updateField:()=>c});var t={};o.r(t),o.d(t,{getActiveTab:()=>m,getEmailFields:()=>g,getFieldByClientId:()=>h,getFieldOptions:()=>w,getFieldsByType:()=>f,getFieldsList:()=>p,getInputFields:()=>v,getMultiChoiceFields:()=>y,getNumberFields:()=>b,isStoreInitialized:()=>x});const n=window.wp.data,r={activeTab:"general",fieldsList:[],isInitialized:!1},s=e=>({type:"SET_ACTIVE_TAB",tab:e}),i=e=>({type:"SET_FIELDS_LIST",fields:e}),a=e=>({type:"ADD_FIELD",field:e}),l=e=>({type:"REMOVE_FIELD",clientId:e}),c=(e,t)=>({type:"UPDATE_FIELD",clientId:e,updates:t}),d=e=>({type:"INITIALIZE_STORE",data:e}),u=()=>({type:"RESET_STORE"}),m=e=>e.activeTab,p=e=>e.fieldsList,h=(e,t)=>e.fieldsList.find(e=>e.clientId===t),f=(e,t)=>e.fieldsList.filter(e=>e.type===t),g=e=>e.fieldsList.filter(e=>"suredonation/email"===e.type),v=e=>e.fieldsList.filter(e=>"suredonation/input"===e.type),b=e=>e.fieldsList.filter(e=>"suredonation/number"===e.type),y=e=>e.fieldsList.filter(e=>"suredonation/donation-amount"===e.type),x=e=>e.isInitialized,w=(e,t=[],n=!0)=>{const r=n?[{value:"",label:"— Select Field —"}]:[];return(t.length?e.fieldsList.filter(e=>t.includes(e.type)):e.fieldsList).forEach(e=>{r.push({value:e.clientId,label:e.label||e.slug||e.clientId})}),r},k=(0,n.createReduxStore)("suredonation/form-editor",{reducer:(e=r,t)=>{switch(t.type){case"SET_ACTIVE_TAB":return{...e,activeTab:t.tab};case"SET_FIELDS_LIST":return{...e,fieldsList:t.fields};case"ADD_FIELD":return{...e,fieldsList:[...e.fieldsList,t.field]};case"REMOVE_FIELD":return{...e,fieldsList:e.fieldsList.filter(e=>e.clientId!==t.clientId)};case"UPDATE_FIELD":return{...e,fieldsList:e.fieldsList.map(e=>e.clientId===t.clientId?{...e,...t.updates}:e)};case"INITIALIZE_STORE":return{...e,...t.data,isInitialized:!0};case"RESET_STORE":return{...r};default:return e}},actions:e,selectors:t});(0,n.register)(k);const j=window.wp.plugins,C=window.wp.editor,S=window.wp.element,E=window.wp.i18n,T=window.ReactJSXRuntime,P=({className:e="h-6 w-6"})=>(0,T.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"SureDonation",children:[(0,T.jsx)("path",{d:"M0 3.64405C0 1.6315 1.62712 0 3.63425 0H20.2517C22.2588 0 23.886 1.6315 23.886 3.64405V20.3063C23.886 22.3188 22.2588 23.9503 20.2517 23.9503H3.63425C1.62712 23.9503 0 22.3188 0 20.3063V3.64405Z",fill:"#00A2D8"}),(0,T.jsx)("path",{d:"M12.6516 5.79655C14.4525 3.99075 17.3723 3.99075 19.1734 5.79655C20.9742 7.60234 20.9742 10.5301 19.1734 12.3359L17.5686 13.9451C17.2776 14.2368 16.8057 14.2368 16.5147 13.9451C16.2237 13.6533 16.2237 13.1802 16.5147 12.8884L18.1196 11.2793C19.3385 10.0571 19.3385 8.07537 18.1196 6.85312C16.9007 5.6309 14.9243 5.63092 13.7054 6.85312L11.3607 9.20415C11.0701 9.49552 11.0701 9.96791 11.3607 10.2593C11.6513 10.5506 12.1224 10.5506 12.413 10.2593L13.4659 9.20346C13.7569 8.91169 14.2288 8.91169 14.5198 9.20346C14.8107 9.49523 14.8107 9.96828 14.5198 10.26L13.4667 11.3159C12.5942 12.1909 11.1794 12.1909 10.3069 11.3159C9.43429 10.441 9.43429 9.02249 10.3069 8.14757L10.8879 7.56486L10.1781 6.85312C8.95914 5.63089 6.98277 5.63089 5.76382 6.85312C4.54486 8.07537 4.54488 10.0571 5.76382 11.2793L12.6985 18.2326C12.9895 18.5244 12.9895 18.9974 12.6985 19.2892C12.4075 19.581 11.9358 19.581 11.6448 19.2892L4.71008 12.3359C2.90915 10.5301 2.90913 7.60233 4.71008 5.79655C6.51102 3.99075 9.43091 3.99075 11.2318 5.79655L11.9417 6.50827L12.6516 5.79655ZM11.8605 14.9781C12.1515 14.6863 12.6233 14.6863 12.9143 14.9781L14.5397 16.6079C14.8307 16.8996 14.8307 17.3727 14.5397 17.6645C14.2487 17.9562 13.7769 17.9562 13.4859 17.6645L11.8605 16.0347C11.5695 15.7429 11.5695 15.2699 11.8605 14.9781ZM13.6482 13.1856C13.9392 12.8939 14.4109 12.8939 14.7019 13.1856L16.3273 14.8154C16.6183 15.1072 16.6183 15.5802 16.3273 15.872C16.0363 16.1638 15.5645 16.1638 15.2735 15.872L13.6482 14.2422C13.3572 13.9504 13.3572 13.4774 13.6482 13.1856Z",fill:"#FFFFFF"})]}),N=()=>(0,T.jsxs)("div",{className:"block-editor-block-card",children:[(0,T.jsx)("span",{className:"block-editor-block-icon has-colors",children:(0,T.jsx)(P,{className:"sd-plugin-icon"})}),(0,T.jsxs)("div",{className:"block-editor-block-card__content",children:[(0,T.jsx)("h2",{className:"block-editor-block-card__title",children:(0,E.__)("SureDonation","suredonation")}),(0,T.jsx)("span",{className:"block-editor-block-card__description",children:(0,E.__)("Customize your donation form","suredonation")})]})]}),R=window.wp.blockEditor,_=window.wp.components;var A=o(6942),M=o.n(A),L=o(5072),I=o.n(L),D=o(4284),O=o.n(D),F=o(7659),V=o.n(F),z=o(4868),B=o.n(z),$=o(540),W=o.n($),U=o(6359),H={};U.A&&U.A.locals&&(H.locals=U.A.locals);var q,K=0,G={attributes:{id:"suredonation-editor-styles"}};G.setAttributes=B(),G.insert=V().bind(null,"head"),G.domAPI=O(),G.insertStyleElement=W(),H.use=function(e){return G.options=e||{},K++||(q=I()(U.A,G)),H},H.unuse=function(){K>0&&! --K&&(q(),q=null)};const Y=H,X="general",Z="style",J="advance",Q=e=>{(0,S.useLayoutEffect)(()=>(Y?.use(),()=>{Y?.unuse()}),[]);const t=((e=null)=>{try{const t=window.localStorage;if(e){const n=t.getItem("sdEditorState");return n?JSON.parse(n)?.[e]:null}return t}catch(e){return null}})("sdSettingState"),{defaultTab:r="general",children:o,tabs:s=["general","style","advance"],stateKey:i=null}=e,a=!!i,l=()=>i||(0,n.select)("core/block-editor").getSelectedBlock()?.name,[c,d]=(0,S.useState)(r||s[0]),u=(0,S.useRef)();let m;(0,S.useEffect)(()=>{m=u.current?.closest(".components-panel")});const p=()=>{if(a)return;const e=document.querySelector(".sd-inspector-tabs-container"),t=document.querySelector(".sd-tab-content-general"),n=document.querySelector(".sd-tab-content-style"),r=document.querySelector(".sd-tab-content-advance");if(e){const o=e.parentElement;o&&o.prepend(e,t||"",n||"",r||"")}};(0,S.useEffect)(()=>{if(p(),a)return;const e=l();return t&&t[e]&&c!==t[e]?.selectedTab?(d("general"),m&&m.setAttribute("data-sd-tab","general")):m&&m.setAttribute("data-sd-tab","general"),()=>{if(m){const e=m.querySelector(".sd-inspector-tabs-container");e&&null!==e||m.removeAttribute("data-sd-tab")}}},[]);const h=e=>{p(),d(e),!a&&m&&m.setAttribute("data-sd-tab",e);const n=l();(e=>{try{window.localStorage.setItem("sdEditorState",JSON.stringify(e))}catch(e){}})({sdSettingState:{...t,[n]:{selectedTab:e}}})};return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"sd-inspector-tabs-container",children:(0,T.jsxs)("div",{ref:u,className:M()("sd-inspector-tabs","sd-inspector-tabs-count-"+s.length,c),children:[s.indexOf(X)>-1&&(0,T.jsxs)("div",{className:M()({"sd-active":c===X}),onClick:()=>h(X),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(X)},role:"tab",tabIndex:0,"aria-selected":c===X,children:[(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"15",children:(0,T.jsx)("path",{fillRule:"nonzero",d:"M14.346 0H1.654C1.017 0 .5.517.5 1.154v12.692C.5 14.483 1.017 15 1.654 15h12.692c.637 0 1.154-.517 1.154-1.154V1.154C15.5.517 14.983 0 14.346 0zm-5.77 13.846v-5.77h5.77v5.77h-5.77z"})}),(0,T.jsx)("h5",{children:(0,E.__)("General","suredonation")})]}),s.indexOf(Z)>-1&&(0,T.jsxs)("div",{className:M()({"sd-active":c===Z}),onClick:()=>h(Z),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(Z)},role:"tab",tabIndex:0,"aria-selected":c===Z,children:[(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"21",children:(0,T.jsx)("g",{fillRule:"nonzero",children:(0,T.jsx)("path",{d:"M15.12 12.091a.814.814 0 00-.68-.378.814.814 0 00-.68.378c-.531.863-2.252 3.807-2.252 5.09 0 1.598 1.317 2.901 2.932 2.901s2.933-1.303 2.933-2.902c0-1.303-1.722-4.226-2.253-5.089zm-1.041 3.828c-.043.063-.744 1.198-.213 1.976a.52.52 0 01.064.358.409.409 0 01-.191.294.608.608 0 01-.255.084.476.476 0 01-.383-.21c-.871-1.283.149-2.902.192-2.986a.517.517 0 01.297-.21.534.534 0 01.361.063c.192.126.255.42.128.63zM13.314 10.388l1.36-.147c.446-.042.807-.337.935-.736.127-.4.042-.862-.276-1.157L7.258.294c-.255-.252-.68-.252-.957 0a.68.68 0 000 .947l.34.336-5.1 5.047C.82 7.339.5 8.348.67 9.379c.128.652.489 1.24.956 1.703l3.082 3.05c.467.462 1.062.82 1.72.946a3.134 3.134 0 002.785-.863l3.612-3.575a.74.74 0 01.489-.252zM7.576 2.502l5.759 5.7H2.073c.085-.232.212-.463.403-.653l5.1-5.047z"})})}),(0,T.jsx)("h5",{children:(0,E.__)("Style","suredonation")})]}),s.indexOf(J)>-1&&(0,T.jsxs)("div",{className:M()({"sd-active":c===J}),onClick:()=>h(J),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(J)},role:"tab",tabIndex:0,"aria-selected":c===J,children:[(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",children:(0,T.jsx)("path",{fillRule:"nonzero",d:"M15.666 6.325c-.277-.05-.572-.082-.85-.115a6.385 6.385 0 00-.571-1.389c.18-.229.343-.457.523-.686a.994.994 0 00-.098-1.291l-.997-.997a.994.994 0 00-1.291-.098c-.23.163-.458.343-.687.523a6.954 6.954 0 00-1.39-.589c-.032-.277-.08-.572-.113-.85A.987.987 0 009.21 0H7.805a1 1 0 00-.98.834c-.05.277-.082.572-.115.85-.474.13-.947.326-1.389.571-.229-.18-.457-.343-.686-.523a.994.994 0 00-1.291.098l-.997.997a.994.994 0 00-.098 1.291c.163.23.343.458.523.687a6.954 6.954 0 00-.589 1.39c-.277.032-.572.08-.85.113A.987.987 0 00.5 7.29v1.406a1 1 0 00.834.98c.277.05.572.082.85.115.13.474.326.947.571 1.389-.18.229-.343.457-.523.686a.994.994 0 00.098 1.291l.997.997a.994.994 0 001.291.098c.23-.163.458-.343.687-.523.441.245.899.442 1.39.589.032.294.08.572.113.85.066.473.49.833.981.833h1.406a1 1 0 00.98-.834c.05-.277.082-.572.115-.85.474-.13.947-.326 1.389-.571.229.18.457.343.686.523a.994.994 0 001.291-.098l.997-.997a.994.994 0 00.098-1.291 19.095 19.095 0 00-.523-.687c.245-.441.442-.899.589-1.39.277-.032.572-.08.85-.113a.987.987 0 00.833-.981V7.305a1 1 0 00-.834-.98zM8.492 11.57a3.571 3.571 0 01-3.563-3.563 3.571 3.571 0 013.563-3.563 3.571 3.571 0 013.563 3.563 3.571 3.571 0 01-3.563 3.563z"})}),(0,T.jsx)("h5",{children:(0,E.__)("Advanced","suredonation")})]})]})}),S.Children.map(o,(e,t)=>{if(!e)return e;if(!e.key)throw new Error("props.key not found in <InspectorTab />, you must use `key` prop");return(0,S.cloneElement)(e,{index:t,isActive:e.key===c})})]})},ee=({children:e,isActive:t,type:n})=>(0,T.jsx)("div",{style:{display:t?"block":"none"},className:`sd-inspector-tab sd-tab-content-${n}`,children:Array.isArray(e)?e.map(e=>e):e}),te={key:"style",type:"style"};(0,S.memo)(e=>{const{children:t,initialOpen:r=!0}=e,o=(0,S.useRef)(null),{getSelectedBlock:s}=(0,n.select)("core/block-editor"),i=s()?.name,a=((e=null)=>{try{const t=window.localStorage;if(e){const n=t.getItem("sdEditorState");return n?JSON.parse(n)?.[e]:null}return t}catch(e){return null}})("sdSettingState"),l=e?.title?e.title.toLowerCase().replace(/[^a-zA-Z ]/g,"").replace(/\s+/g,"-"):"",[c,d]=(0,S.useState)(()=>{const e=`${i}-${l}`,t=a?.panels?.[e];return void 0!==t?t:r});return(0,T.jsx)(_.PanelBody,{...e,initialOpen:c,onToggle:()=>{const e=!c;d(e);let t="general";o?.current?.parentElement?.classList.contains("sd-tab-content-general")?t="general":o?.current?.parentElement?.classList.contains("sd-tab-content-style")?t="style":o?.current?.parentElement?.classList.contains("sd-tab-content-advance")&&(t="advance");const n=`${i}-${l}`,r={...a,[i]:{...a?.[i],selectedPanel:`sd-advance-panel-body-${l}`,selectedTab:t},panels:{...a?.panels,[n]:e}};try{const e=JSON.parse(window.localStorage.getItem("sdEditorState")||"{}");window.localStorage.setItem("sdEditorState",JSON.stringify({...e,sdSettingState:r}))}catch(e){}},ref:o,className:`sd-advance-panel-body-${l}`,children:t})});var ne=o(4180),re={};ne.A&&ne.A.locals&&(re.locals=ne.A.locals);var oe,se=0,ie={attributes:{id:"suredonation-editor-styles"}};ie.setAttributes=B(),ie.insert=V().bind(null,"head"),ie.domAPI=O(),ie.insertStyleElement=W(),re.use=function(e){return ie.options=e||{},se++||(oe=I()(ne.A,ie)),re},re.unuse=function(){se>0&&! --se&&(oe(),oe=null)};var ae=o(4676),le={};ae.A&&ae.A.locals&&(le.locals=ae.A.locals);var ce,de=0,ue={attributes:{id:"suredonation-editor-styles"}};ue.setAttributes=B(),ue.insert=V().bind(null,"head"),ue.domAPI=O(),ue.insertStyleElement=W(),le.use=function(e){return ue.options=e||{},de++||(ce=I()(ae.A,ue)),le},le.unuse=function(){de>0&&! --de&&(ce(),ce=null)},_.__experimentalNumberControl;var me=o(9380),pe={};me.A&&me.A.locals&&(pe.locals=me.A.locals);var he,fe=0,ge={attributes:{id:"suredonation-editor-styles"}};ge.setAttributes=B(),ge.insert=V().bind(null,"head"),ge.domAPI=O(),ge.insertStyleElement=W(),pe.use=function(e){return ge.options=e||{},fe++||(he=I()(me.A,ge)),pe},pe.unuse=function(){fe>0&&! --fe&&(he(),he=null)};const ve="_suredonation_form_styling",be={bgType:"color",bgColor:"",bgGradient:"linear-gradient(90deg,#FFC9B2 0%,#C7CBFF 100%)",bgImage:"",bgImageId:0,bgImageSize:"cover",bgImagePosition:"center center",bgImageRepeat:"no-repeat",primaryColor:"#1293b6",textColor:"#1f2937",textOnPrimaryColor:"#ffffff",padding:{top:"",right:"",bottom:"",left:""},borderRadius:{top:"",right:"",bottom:"",left:""},fieldSpacing:"medium",buttonAlignment:"justify"},ye={small:{"--sd-row-gap-between-blocks":"16px","--sd-column-gap-between-blocks":"12px","--sd-col-gap-between-fields":"12px","--sd-input-height":"40px","--sd-input-field-padding":"10px 12px","--sd-input-field-font-size":"14px","--sd-input-field-line-height":"20px","--sd-input-field-margin-top":"4px","--sd-input-field-margin-bottom":"4px","--sd-label-font-size":"14px","--sd-label-line-height":"20px","--sd-description-font-size":"12px","--sd-description-line-height":"16px","--sd-btn-padding":"8px 14px","--sd-btn-font-size":"14px","--sd-btn-line-height":"20px","--sd-donation-amount-vertical-padding":"16px","--sd-donation-amount-internal-option-gap":"8px","--sd-donation-amount-outer-padding":"0","--sd-checkbox-size":"16px"},large:{"--sd-row-gap-between-blocks":"20px","--sd-column-gap-between-blocks":"16px","--sd-col-gap-between-fields":"16px","--sd-input-height":"48px","--sd-input-field-padding":"10px 14px","--sd-input-field-font-size":"18px","--sd-input-field-line-height":"28px","--sd-input-field-margin-top":"8px","--sd-input-field-margin-bottom":"8px","--sd-label-font-size":"18px","--sd-label-line-height":"28px","--sd-description-font-size":"16px","--sd-description-line-height":"24px","--sd-btn-padding":"10px 14px","--sd-btn-font-size":"18px","--sd-btn-line-height":"28px","--sd-donation-amount-vertical-padding":"24px","--sd-donation-amount-internal-option-gap":"12px","--sd-donation-amount-outer-padding":"4px","--sd-checkbox-size":"20px"}},xe={left:"flex-start",center:"center",right:"flex-end",justify:"stretch"},we=e=>{let t={};const n=e?.[ve];if(n)try{t=JSON.parse(n)||{}}catch(e){t={}}return{...be,...t,padding:{...be.padding,...t.padding||{}},borderRadius:{...be.borderRadius,...t.borderRadius||{}}}},ke=e=>{const t={};return Object.keys(be).forEach(n=>{const r=be[n],o=e[n];r&&"object"==typeof r?Object.keys(r).some(e=>(o?.[e]??"")!==r[e])&&(t[n]=o):o!==r&&(t[n]=o)}),t},je=e=>{let t=!1;const n=["top","right","bottom","left"].map(n=>{const r=e?.[n];if(r&&""!==String(r).trim()){t=!0;const e=String(r).trim();return/^-?\d*\.?\d+$/.test(e)?`${e}px`:e}return"0"});return t?n.join(" "):""},Ce=({label:e,value:t,onChange:n,themeColors:r})=>(0,T.jsx)(_.BaseControl,{__nextHasNoMarginBottom:!0,className:"sd-styles-color",children:(0,T.jsxs)(_.Flex,{justify:"space-between",align:"center",children:[(0,T.jsx)(_.FlexItem,{children:(0,T.jsx)("span",{className:"sd-styles-color__label",children:e})}),(0,T.jsx)(_.FlexItem,{children:(0,T.jsx)(_.Dropdown,{popoverProps:{placement:"left-start"},renderToggle:({isOpen:n,onToggle:r})=>(0,T.jsx)(_.Button,{onClick:r,"aria-expanded":n,"aria-label":e,className:"sd-styles-color__swatch",style:{background:t||"transparent"}}),renderContent:()=>(0,T.jsx)("div",{className:"sd-styles-color__picker",children:(0,T.jsx)(_.ColorPalette,{colors:r,value:t,onChange:e=>n(e||""),enableAlpha:!0,__experimentalIsRenderedInSidebar:!0})})})})]})}),Se=()=>{const e=(0,n.useSelect)(e=>e(C.store).getEditedPostAttribute("meta"),[]),t=(0,n.useSelect)(e=>e(R.store).getSettings().colors||[],[]),{editPost:r}=(0,n.useDispatch)(C.store),o=(0,S.useMemo)(()=>we(e),[e]),s=e=>{const t={...o,...e};r({meta:{[ve]:JSON.stringify(ke(t))}})},i=e=>{if(null==e)return"";const t=String(e).trim();return""===t?"":/^-?\d*\.?\d+$/.test(t)?`${t}px`:t},a=e=>({top:i(e?.top),right:i(e?.right),bottom:i(e?.bottom),left:i(e?.left)}),l=e=>({top:e?.top||void 0,right:e?.right||void 0,bottom:e?.bottom||void 0,left:e?.left||void 0});return(0,T.jsx)(Q,{tabs:["style"],defaultTab:"style",stateKey:"sd-form-styles",children:(0,T.jsxs)(ee,{...te,children:[(0,T.jsxs)(_.PanelBody,{title:(0,E.__)("Colors","suredonation"),className:"sd-single-form-settings-style-section",children:[(0,T.jsx)(Ce,{label:(0,E.__)("Primary color","suredonation"),value:o.primaryColor,onChange:e=>s({primaryColor:e}),themeColors:t}),(0,T.jsx)(Ce,{label:(0,E.__)("Text color","suredonation"),value:o.textColor,onChange:e=>s({textColor:e}),themeColors:t}),(0,T.jsx)(Ce,{label:(0,E.__)("Text color on primary","suredonation"),value:o.textOnPrimaryColor,onChange:e=>s({textOnPrimaryColor:e}),themeColors:t})]}),(0,T.jsxs)(_.PanelBody,{title:(0,E.__)("Background","suredonation"),initialOpen:!1,className:"sd-single-form-settings-style-section",children:[(0,T.jsx)(_.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Background type","suredonation"),value:o.bgType,options:[{label:(0,E.__)("Solid","suredonation"),value:"color"},{label:(0,E.__)("Gradient","suredonation"),value:"gradient"},{label:(0,E.__)("Image","suredonation"),value:"image"}],onChange:e=>s({bgType:e})}),"color"===o.bgType&&(0,T.jsx)(Ce,{label:(0,E.__)("Background color","suredonation"),value:o.bgColor,onChange:e=>s({bgColor:e}),themeColors:t}),"gradient"===o.bgType&&(0,T.jsx)(_.GradientPicker,{__nextHasNoMargin:!0,value:o.bgGradient,gradients:[],onChange:e=>s({bgGradient:e||""})}),"image"===o.bgType&&(0,T.jsx)(R.MediaUploadCheck,{children:(0,T.jsx)(R.MediaUpload,{allowedTypes:["image"],value:o.bgImageId,onSelect:e=>s({bgImage:e.url,bgImageId:e.id}),render:({open:e})=>(0,T.jsxs)("div",{className:"sd-styles-image",children:[o.bgImage?(0,T.jsx)("img",{src:o.bgImage,alt:"",className:"sd-styles-image__preview"}):null,(0,T.jsxs)(_.Flex,{justify:"flex-start",children:[(0,T.jsx)(_.Button,{variant:"secondary",onClick:e,children:o.bgImage?(0,E.__)("Replace","suredonation"):(0,E.__)("Select image","suredonation")}),o.bgImage?(0,T.jsx)(_.Button,{variant:"tertiary",isDestructive:!0,onClick:()=>s({bgImage:"",bgImageId:0}),children:(0,E.__)("Remove","suredonation")}):null]}),o.bgImage?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(_.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Size","suredonation"),value:o.bgImageSize,options:[{label:"Cover",value:"cover"},{label:"Contain",value:"contain"},{label:"Auto",value:"auto"}],onChange:e=>s({bgImageSize:e})}),(0,T.jsx)(_.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Repeat","suredonation"),value:o.bgImageRepeat,options:[{label:"No repeat",value:"no-repeat"},{label:"Repeat",value:"repeat"}],onChange:e=>s({bgImageRepeat:e})})]}):null]})})})]}),(0,T.jsxs)(_.PanelBody,{title:(0,E.__)("Layout","suredonation"),initialOpen:!1,className:"sd-single-form-settings-style-section",children:[(0,T.jsx)(_.__experimentalBoxControl,{label:(0,E.__)("Padding","suredonation"),values:l(o.padding),onChange:e=>s({padding:a(e)})}),(0,T.jsx)(_.__experimentalBoxControl,{label:(0,E.__)("Border radius","suredonation"),values:l(o.borderRadius),onChange:e=>s({borderRadius:a(e)})})]}),(0,T.jsx)(_.PanelBody,{title:(0,E.__)("Fields","suredonation"),initialOpen:!1,className:"sd-single-form-settings-style-section",children:(0,T.jsx)(_.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Field spacing","suredonation"),value:o.fieldSpacing,options:[{label:(0,E.__)("Small","suredonation"),value:"small"},{label:(0,E.__)("Medium","suredonation"),value:"medium"},{label:(0,E.__)("Large","suredonation"),value:"large"}],onChange:e=>s({fieldSpacing:e})})}),(0,T.jsx)(_.PanelBody,{title:(0,E.__)("Button","suredonation"),initialOpen:!1,className:"sd-single-form-settings-style-section",children:(0,T.jsx)(_.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,E.__)("Button alignment","suredonation"),value:o.buttonAlignment,options:[{label:(0,E.__)("Left","suredonation"),value:"left"},{label:(0,E.__)("Center","suredonation"),value:"center"},{label:(0,E.__)("Right","suredonation"),value:"right"},{label:(0,E.__)("Full width","suredonation"),value:"justify"}],onChange:e=>s({buttonAlignment:e})})})]})})},Ee="sd-form-style-preview",Te=()=>{const e=[],t=document.querySelector('iframe[name="editor-canvas"]');return t&&t.contentDocument&&e.push(t.contentDocument),e.push(document),e},Pe=()=>{const{meta:e,deviceType:t}=(0,n.useSelect)(e=>{const t=e(C.store);return{meta:t.getEditedPostAttribute("meta"),deviceType:"function"==typeof t.getDeviceType?t.getDeviceType():null}},[]),r=(0,S.useCallback)(()=>{const t=`.editor-styles-wrapper{${(e=>{const t={};if(e.primaryColor){const n=e.primaryColor;t["--sd-color-scheme-primary"]=n,t["--sd-color-scheme-primary-hover"]=`hsl(from ${n} h s l / 0.9)`,t["--sd-color-input-border-hover"]=`hsl(from ${n} h s l / 0.65)`,t["--sd-color-input-border-focus-glow"]=`hsl(from ${n} h s l / 0.15)`,t["--sd-color-input-selected"]=`hsl(from ${n} h s l / 0.1)`}if(e.textColor){const n=e.textColor;t["--sd-color-input-text"]=n,t["--sd-color-input-label"]=n,t["--sd-color-input-description"]=`hsl(from ${n} h s l / 0.65)`,t["--sd-color-input-placeholder"]=`hsl(from ${n} h s l / 0.5)`,t["--sd-color-input-background"]=`hsl(from ${n} h s l / 0.02)`,t["--sd-color-input-background-hover"]=`hsl(from ${n} h s l / 0.05)`,t["--sd-color-input-border"]=`hsl(from ${n} h s l / 0.25)`,t["--sd-color-donation-amount-svg"]=`hsl(from ${n} h s l / 0.7)`,t["--sd-color-input-prefix"]=`hsl(from ${n} h s l / 0.65)`,t["--sd-disabled-color"]=`hsl(from ${n} h s l / 0.5)`,t["--sd-disabled-background-color"]=`hsl(from ${n} h s l / 0.07)`,t["--sd-disabled-border"]=`hsl(from ${n} h s l / 0.15)`}e.textOnPrimaryColor&&(t["--sd-btn-text-color"]=e.textOnPrimaryColor);const n=(e=>"gradient"===e.bgType?e.bgGradient||"":"image"===e.bgType?e.bgImage?`url('${e.bgImage}') ${e.bgImagePosition} / ${e.bgImageSize} ${e.bgImageRepeat}`:"":e.bgColor||"")(e);n&&(t["--sd-form-background"]=n);const r=je(e.padding);r&&(t["--sd-form-padding"]=r);const o=je(e.borderRadius);return o&&(t["--sd-form-border-radius"]=o),"medium"!==e.fieldSpacing&&ye[e.fieldSpacing]&&Object.assign(t,ye[e.fieldSpacing]),t["--sd-btn-align-items"]=xe[e.buttonAlignment]||"stretch",t["--sd-btn-width"]="justify"===e.buttonAlignment?"100%":"auto",Object.entries(t).map(([e,t])=>`${e}:${t}`).join(";")})(we(e))}}`;Te().forEach(e=>{if(!e||!e.head)return;let n=e.getElementById(Ee);n||(n=e.createElement("style"),n.id=Ee,e.head.appendChild(n)),n.textContent=t})},[e]);return(0,S.useEffect)(()=>{r()},[r]),(0,S.useEffect)(()=>{const e=window.requestAnimationFrame(()=>r());return()=>window.cancelAnimationFrame(e)},[t]),(0,S.useEffect)(()=>()=>{Te().forEach(e=>{const t=e&&e.getElementById(Ee);t&&t.remove()})},[]),null},Ne="sd-form-editor",Re=[`${Ne}/sd-description`,`${Ne}/sd-form-styles`];(0,j.registerPlugin)("sd-form-editor",{render:()=>{const{toggleEditorPanelOpened:e}=(0,n.useDispatch)(C.store),t=(0,n.useSelect)(e=>{const{isEditorPanelOpened:t}=e(C.store);return Re.reduce((e,n)=>(e[n]=t(n),e),{})},[]);return(0,S.useEffect)(()=>{Re.forEach(n=>{t[n]||e(n)})},[t,e]),(0,T.jsxs)(S.Fragment,{children:[(0,T.jsx)(C.PluginDocumentSettingPanel,{name:"sd-description",className:"sd-single-form-settings-description",title:(0,E.__)("SureDonation Description","suredonation"),children:(0,T.jsx)(N,{})}),(0,T.jsx)(C.PluginDocumentSettingPanel,{name:"sd-form-styles",className:"sd-single-form-settings-styles",title:(0,E.__)("Styles","suredonation"),children:(0,T.jsx)(Se,{})}),(0,T.jsx)(Pe,{})]})},icon:null});const{select:_e,dispatch:Ae}=wp.data,Me=window.React;var Le=o.t(Me,2);const Ie=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),De=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Oe={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 Fe=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},Ve=(0,Me.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>(0,Me.createElement)("svg",{ref:l,...Oe,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Ie("lucide",o),...!s&&!Fe(a)&&{"aria-hidden":"true"},...a},[...i.map(([e,t])=>(0,Me.createElement)(e,t)),...Array.isArray(s)?s:[s]])),ze=(e,t)=>{const n=(0,Me.forwardRef)(({className:n,...r},o)=>{return(0,Me.createElement)(Ve,{ref:o,iconNode:t,className:Ie(`lucide-${s=De(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var s});return n.displayName=De(e),n},Be=ze("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),$e=window.wp.hooks,We=ze("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Ue=ze("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),He=window.wp.apiFetch;var qe=o.n(He);const Ke=window.wp.url;let Ge=1;const Ye=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 s="number"==typeof t?t:Ge++;return this.#e.find(e=>e.id===s)&&(this.#e=this.#e.map(e=>e.id===s?(this.publish({...e,title:n,jsx:r,...o}),{...e,title:n,jsx:r,...o}):e)),this.add({id:s,title:n,jsx:r,...o}),s}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})}},Xe=Object.seal(Object.assign((e,t)=>Ye.default(e,t),{success:Ye.success.bind(Ye),error:Ye.error.bind(Ye),warning:Ye.warning.bind(Ye),info:Ye.info.bind(Ye),custom:Ye.custom.bind(Ye),dismiss:Ye.dismiss.bind(Ye),update:Ye.update.bind(Ye)},{getHistory:Ye.history.bind(Ye)})),Ze=e=>{const t=tt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Je(n,t)||et(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},Je=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Je(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const s=e.join("-");return t.validators.find(({validator:e})=>e(s))?.classGroupId},Qe=/^\[(.+)\]$/,et=e=>{if(Qe.test(e)){const t=Qe.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},tt=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return st(Object.entries(e.classGroups),n).forEach(([e,n])=>{nt(n,r,e,t)}),r},nt=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?ot(e)?void nt(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,o])=>{nt(o,rt(t,e),n,r)});(""===e?t:rt(t,e)).classGroupId=n})},rt=(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},ot=e=>e.isThemeGetter,st=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,it=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,s)=>{n.set(o,s),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)}}},at=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],s=t.length,i=e=>{const n=[];let i,a=0,l=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===a){if(d===o&&(r||e.slice(c,c+s)===t)){n.push(e.slice(l,c)),l=c+s;continue}if("/"===d){i=c;continue}}"["===d?a++:"]"===d&&a--}const c=0===n.length?e:e.substring(l),d=c.startsWith("!");return{modifiers:n,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return n?e=>n({className:e,parseClassName:i}):i},lt=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},ct=/\s+/;function dt(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=ut(e))&&(r&&(r+=" "),r+=t);return r}const ut=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ut(e[r]))&&(n&&(n+=" "),n+=t);return n};function mt(e,...t){let n,r,o,s=function(a){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:it(e.cacheSize),parseClassName:at(e),...Ze(e)}))(l),r=n.cache.get,o=n.cache.set,s=i,i(a)};function i(e){const t=r(e);if(t)return t;const s=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(ct);let a="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:d,maybePostfixModifierPosition:u}=n(t);let m=Boolean(u),p=r(m?d.substring(0,u):d);if(!p){if(!m){a=t+(a.length>0?" "+a:a);continue}if(p=r(d),!p){a=t+(a.length>0?" "+a:a);continue}m=!1}const h=lt(l).join(":"),f=c?h+"!":h,g=f+p;if(s.includes(g))continue;s.push(g);const v=o(p,m);for(let e=0;e<v.length;++e){const t=v[e];s.push(f+t)}a=t+(a.length>0?" "+a:a)}return a})(e,n);return o(e,s),s}return function(){return s(dt.apply(null,arguments))}}const pt=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},ht=/^\[(?:([a-z-]+):)?(.+)\]$/i,ft=/^\d+\/\d+$/,gt=new Set(["px","full","screen"]),vt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bt=/\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$/,yt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,xt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kt=e=>Ct(e)||gt.has(e)||ft.test(e),jt=e=>Ot(e,"length",Ft),Ct=e=>Boolean(e)&&!Number.isNaN(Number(e)),St=e=>Ot(e,"number",Ct),Et=e=>Boolean(e)&&Number.isInteger(Number(e)),Tt=e=>e.endsWith("%")&&Ct(e.slice(0,-1)),Pt=e=>ht.test(e),Nt=e=>vt.test(e),Rt=new Set(["length","size","percentage"]),_t=e=>Ot(e,Rt,Vt),At=e=>Ot(e,"position",Vt),Mt=new Set(["image","url"]),Lt=e=>Ot(e,Mt,Bt),It=e=>Ot(e,"",zt),Dt=()=>!0,Ot=(e,t,n)=>{const r=ht.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},Ft=e=>bt.test(e)&&!yt.test(e),Vt=()=>!1,zt=e=>xt.test(e),Bt=e=>wt.test(e),$t=(Symbol.toStringTag,()=>{const e=pt("colors"),t=pt("spacing"),n=pt("blur"),r=pt("brightness"),o=pt("borderColor"),s=pt("borderRadius"),i=pt("borderSpacing"),a=pt("borderWidth"),l=pt("contrast"),c=pt("grayscale"),d=pt("hueRotate"),u=pt("invert"),m=pt("gap"),p=pt("gradientColorStops"),h=pt("gradientColorStopPositions"),f=pt("inset"),g=pt("margin"),v=pt("opacity"),b=pt("padding"),y=pt("saturate"),x=pt("scale"),w=pt("sepia"),k=pt("skew"),j=pt("space"),C=pt("translate"),S=()=>["auto",Pt,t],E=()=>[Pt,t],T=()=>["",kt,jt],P=()=>["auto",Ct,Pt],N=()=>["","0",Pt],R=()=>[Ct,Pt];return{cacheSize:500,separator:":",theme:{colors:[Dt],spacing:[kt,jt],blur:["none","",Nt,Pt],brightness:R(),borderColor:[e],borderRadius:["none","","full",Nt,Pt],borderSpacing:E(),borderWidth:T(),contrast:R(),grayscale:N(),hueRotate:R(),invert:N(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Tt,jt],inset:S(),margin:S(),opacity:R(),padding:E(),saturate:R(),scale:R(),sepia:N(),skew:R(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Pt]}],container:["container"],columns:[{columns:[Nt]}],"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",Pt]}],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:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Et,Pt]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pt]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",Et,Pt]}],"grid-cols":[{"grid-cols":[Dt]}],"col-start-end":[{col:["auto",{span:["full",Et,Pt]},Pt]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Dt]}],"row-start-end":[{row:["auto",{span:[Et,Pt]},Pt]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pt]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"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:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],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":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pt,t]}],"min-w":[{"min-w":[Pt,t,"min","max","fit"]}],"max-w":[{"max-w":[Pt,t,"none","full","min","max","fit","prose",{screen:[Nt]},Nt]}],h:[{h:[Pt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Nt,jt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",St]}],"font-family":[{font:[Dt]}],"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",Pt]}],"line-clamp":[{"line-clamp":["none",Ct,St]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",kt,Pt]}],"list-image":[{"list-image":["none",Pt]}],"list-style-type":[{list:["none","disc","decimal",Pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",kt,jt]}],"underline-offset":[{"underline-offset":["auto",kt,Pt]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pt]}],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",Pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",At]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_t]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Lt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"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":[kt,Pt]}],"outline-w":[{outline:[kt,jt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[kt,jt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Nt,It]}],"shadow-color":[{shadow:[Dt]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Nt,Pt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[y]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"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",Pt]}],duration:[{duration:R()}],ease:[{ease:["linear","in","out","in-out",Pt]}],delay:[{delay:R()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Et,Pt]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pt]}],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",Pt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",Pt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[kt,jt,St]}],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"]}}}),Wt=mt($t);function Ut(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=Ut(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ht(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ut(e))&&(r&&(r+=" "),r+=t);return r}const qt=(...e)=>Wt(Ht(...e)),Kt=(...e)=>(...t)=>e.filter(Boolean).forEach(e=>e?.(...t)),Gt={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"},Yt=(0,Me.forwardRef)(({children:e=null,tag:t="label",size:n="sm",className:r="",variant:o="neutral",required:s=!1,...i},a)=>{if(!e)return null;let l="";return s&&(l="after:content-['*'] after:text-field-required after:ml-0.5"),(0,T.jsx)(t,{ref:a,className:qt("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})});Yt.displayName="Label";const Xt=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");var Zt={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 Jt=(0,Me.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>(0,Me.createElement)("svg",{ref:l,...Zt,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Xt("lucide",o),...a},[...i.map(([e,t])=>(0,Me.createElement)(e,t)),...Array.isArray(s)?s:[s]])),Qt=(e,t)=>{const n=(0,Me.forwardRef)(({className:n,...r},o)=>{return(0,Me.createElement)(Jt,{ref:o,iconNode:t,className:Xt(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var s});return n.displayName=`${e}`,n},en=Qt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),tn=Qt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),nn=Qt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),rn=Qt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function on(){return"undefined"!=typeof window}function sn(e){return cn(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ln(e){var t;return null==(t=(cn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function cn(e){return!!on()&&(e instanceof Node||e instanceof an(e).Node)}function dn(e){return!!on()&&(e instanceof Element||e instanceof an(e).Element)}function un(e){return!!on()&&(e instanceof HTMLElement||e instanceof an(e).HTMLElement)}function mn(e){return!(!on()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof an(e).ShadowRoot)}function pn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function hn(e){return/^(table|td|th)$/.test(sn(e))}function fn(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const gn=/transform|translate|scale|rotate|perspective|filter/,vn=/paint|layout|strict|content/,bn=e=>!!e&&"none"!==e;let yn;function xn(e){const t=dn(e)?jn(e):e;return bn(t.transform)||bn(t.translate)||bn(t.scale)||bn(t.rotate)||bn(t.perspective)||!wn()&&(bn(t.backdropFilter)||bn(t.filter))||gn.test(t.willChange||"")||vn.test(t.contain||"")}function wn(){return null==yn&&(yn="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yn}function kn(e){return/^(html|body|#document)$/.test(sn(e))}function jn(e){return an(e).getComputedStyle(e)}function Cn(e){return dn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sn(e){if("html"===sn(e))return e;const t=e.assignedSlot||e.parentNode||mn(e)&&e.host||ln(e);return mn(t)?t.host:t}function En(e){const t=Sn(e);return kn(t)?e.ownerDocument?e.ownerDocument.body:e.body:un(t)&&pn(t)?t:En(t)}function Tn(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=En(e),s=o===(null==(r=e.ownerDocument)?void 0:r.body),i=an(o);if(s){const e=Pn(i);return t.concat(i,i.visualViewport||[],pn(o)?o:[],e&&n?Tn(e):[])}return t.concat(o,Tn(o,[],n))}function Pn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nn(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 Rn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&mn(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function An(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Mn(){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 Ln(e){return!(0!==e.mozInputSource||!e.isTrusted)||(On()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function In(e){return!Mn().includes("jsdom/")&&(!On()&&0===e.width&&0===e.height||On()&&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 Dn(){return/apple/i.test(navigator.vendor)}function On(){const e=/android/i;return e.test(An())||e.test(Mn())}function Fn(){return An().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Vn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function zn(e){return(null==e?void 0:e.ownerDocument)||document}function Bn(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 $n(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Wn(e){return un(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Un(e){e.preventDefault(),e.stopPropagation()}function Hn(e){return!!e&&"combobox"===e.getAttribute("role")&&Wn(e)}const qn=Math.min,Kn=Math.max,Gn=Math.round,Yn=Math.floor,Xn=e=>({x:e,y:e}),Zn={left:"right",right:"left",bottom:"top",top:"bottom"};function Jn(e,t,n){return Kn(e,qn(t,n))}function Qn(e,t){return"function"==typeof e?e(t):e}function er(e){return e.split("-")[0]}function tr(e){return e.split("-")[1]}function nr(e){return"x"===e?"y":"x"}function rr(e){return"y"===e?"height":"width"}function or(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function sr(e){return nr(or(e))}function ir(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ar=["left","right"],lr=["right","left"],cr=["top","bottom"],dr=["bottom","top"];function ur(e){const t=er(e);return Zn[t]+e.slice(t.length)}function mr(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 pr(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 hr=["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(","),fr="undefined"==typeof Element,gr=fr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vr=!fr&&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},br=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]"):br(e.parentNode))},yr=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var s=o.shift();if(!br(s,!1))if("SLOT"===s.tagName){var i=s.assignedElements(),a=i.length?i:s.children,l=yr(a,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:s,candidates:l})}else{gr.call(s,hr)&&n.filter(s)&&(t||!e.includes(s))&&r.push(s);var c=s.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(s),d=!br(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(c&&d){var u=yr(!0===c?s.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else o.unshift.apply(o,s.children)}}return r},xr=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},wr=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))&&!xr(e)?0:e.tabIndex},kr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},jr=function(e){return"INPUT"===e.tagName},Cr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Sr=function(e,t){return!(t.disabled||function(e){return jr(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=gr.call(e,"details>summary:first-of-type")?e.parentElement:e;if(gr.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Cr(e)}else{if("function"==typeof r){for(var s=e;e;){var i=e.parentElement,a=vr(e);if(i&&!i.shadowRoot&&!0===r(i))return Cr(e);e=e.assignedSlot?e.assignedSlot:i||a===e.ownerDocument?i:a.host}e=s}if(function(e){var t,n,r,o,s=e&&vr(e),i=null===(t=s)||void 0===t?void 0:t.host,a=!1;if(s&&s!==e)for(a=!!(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));!a&&i;){var l,c,d;a=!(null===(c=i=null===(l=s=vr(i))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(i))}return a}(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!!gr.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Er=function(e,t){return!(function(e){return function(e){return jr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||vr(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)||wr(t)<0||!Sr(e,t))},Tr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Pr=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,s=o?e.scopeParent:e,i=function(e,t){var n=wr(e);return n<0&&t&&!xr(e)?0:n}(s,o),a=o?Pr(e.candidates):s;0===i?o?t.push.apply(t,a):t.push(s):n.push({documentOrder:r,tabIndex:i,item:e,isScope:o,content:a})}),n.sort(kr).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Nr=function(e,t){var n;return n=(t=t||{}).getShadowRoot?yr([e],t.includeContainer,{filter:Er.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Tr}):function(e,t,n){if(br(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(hr));return t&&gr.call(e,hr)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Er.bind(null,t)),Pr(n)};const Rr=window.ReactDOM;function _r(e,t,n){let{reference:r,floating:o}=e;const s=or(t),i=sr(t),a=rr(i),l=er(t),c="y"===s,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(tr(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1)}return p}async function Ar(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:p=0}=Qn(t,e),h=mr(p),f=a[m?"floating"===u?"reference":"floating":u],g=pr(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(f)))||n?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v="floating"===u?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(a.floating)),y=await(null==s.isElement?void 0:s.isElement(b))&&await(null==s.getScale?void 0:s.getScale(b))||{x:1,y:1},x=pr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-x.top+h.top)/y.y,bottom:(x.bottom-g.bottom+h.bottom)/y.y,left:(g.left-x.left+h.left)/y.x,right:(x.right-g.right+h.right)/y.x}}const Mr=new Set(["left","top"]);function Lr(e){const t=jn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=un(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Gn(n)!==s||Gn(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ir(e){return dn(e)?e:e.contextElement}function Dr(e){const t=Ir(e);if(!un(t))return Xn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Lr(t);let i=(s?Gn(n.width):n.width)/r,a=(s?Gn(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}const Or=Xn(0);function Fr(e){const t=an(e);return wn()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Or}function Vr(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),s=Ir(e);let i=Xn(1);t&&(r?dn(r)&&(i=Dr(r)):i=Dr(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==an(e))&&t}(s,n,r)?Fr(s):Xn(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(s){const e=an(s),t=r&&dn(r)?an(r):r;let n=e,o=Pn(n);for(;o&&r&&t!==n;){const e=Dr(o),t=o.getBoundingClientRect(),r=jn(o),s=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,d*=e.x,u*=e.y,l+=s,c+=i,n=an(o),o=Pn(n)}}return pr({width:d,height:u,x:l,y:c})}function zr(e,t){const n=Cn(e).scrollLeft;return t?t.left+n:Vr(ln(e)).left+n}function Br(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-zr(e,n),y:n.top+t.scrollTop}}function $r(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=an(e),r=ln(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const e=wn();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}const c=zr(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&&(s-=i)}else c<=25&&(s+=c);return{width:s,height:i,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=ln(e),n=Cn(e),r=e.ownerDocument.body,o=Kn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Kn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+zr(e);const a=-n.scrollTop;return"rtl"===jn(r).direction&&(i+=Kn(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}(ln(e));else if(dn(t))r=function(e,t){const n=Vr(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=un(e)?Dr(e):Xn(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:o*s.x,y:r*s.y}}(t,n);else{const n=Fr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pr(r)}function Wr(e,t){const n=Sn(e);return!(n===t||!dn(n)||kn(n))&&("fixed"===jn(n).position||Wr(n,t))}function Ur(e,t,n){const r=un(t),o=ln(t),s="fixed"===n,i=Vr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Xn(0);function c(){l.x=zr(o)}if(r||!r&&!s)if(("body"!==sn(t)||pn(o))&&(a=Cn(t)),r){const e=Vr(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=!o||r||s?Xn(0):Br(o,a);return{x:i.left+a.scrollLeft-l.x-d.x,y:i.top+a.scrollTop-l.y-d.y,width:i.width,height:i.height}}function Hr(e){return"static"===jn(e).position}function qr(e,t){if(!un(e)||"fixed"===jn(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ln(e)===n&&(n=n.ownerDocument.body),n}function Kr(e,t){const n=an(e);if(fn(e))return n;if(!un(e)){let t=Sn(e);for(;t&&!kn(t);){if(dn(t)&&!Hr(t))return t;t=Sn(t)}return n}let r=qr(e,t);for(;r&&hn(r)&&Hr(r);)r=qr(r,t);return r&&kn(r)&&Hr(r)&&!xn(r)?n:r||function(e){let t=Sn(e);for(;un(t)&&!kn(t);){if(xn(t))return t;if(fn(t))return null;t=Sn(t)}return null}(e)||n}const Gr={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s="fixed"===o,i=ln(r),a=!!t&&fn(t.floating);if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Xn(1);const d=Xn(0),u=un(r);if((u||!u&&!s)&&(("body"!==sn(r)||pn(i))&&(l=Cn(r)),u)){const e=Vr(r);c=Dr(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const m=!i||u||s?Xn(0):Br(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-l.scrollTop*c.y+d.y+m.y}},getDocumentElement:ln,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[..."clippingAncestors"===n?fn(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Tn(e,[],!1).filter(e=>dn(e)&&"body"!==sn(e)),o=null;const s="fixed"===jn(e).position;let i=s?Sn(e):e;for(;dn(i)&&!kn(i);){const t=jn(i),n=xn(i);n||"fixed"!==t.position||(o=null),(s?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||pn(i)&&!n&&Wr(e,i))?r=r.filter(e=>e!==i):o=t,i=Sn(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=$r(t,s[0],o);let a=i.top,l=i.right,c=i.bottom,d=i.left;for(let e=1;e<s.length;e++){const n=$r(t,s[e],o);a=Kn(n.top,a),l=qn(n.right,l),c=qn(n.bottom,c),d=Kn(n.left,d)}return{width:l-d,height:c-a,x:d,y:a}},getOffsetParent:Kr,getElementRects:async function(e){const t=this.getOffsetParent||Kr,n=this.getDimensions,r=await n(e.floating);return{reference:Ur(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}=Lr(e);return{width:t,height:n}},getScale:Dr,isElement:dn,isRTL:function(e){return"rtl"===jn(e).direction}};function Yr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Xr(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Ir(e),d=o||s?[...c?Tn(c):[],...t?Tn(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});const u=c&&a?function(e,t){let n,r=null;const o=ln(e);function s(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:m,height:p}=c;if(a||t(),!m||!p)return;const h={rootMargin:-Yn(u)+"px "+-Yn(o.clientWidth-(d+m))+"px "+-Yn(o.clientHeight-(u+p))+"px "+-Yn(d)+"px",threshold:Kn(0,qn(1,l))||1};let f=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!f)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||Yr(c,e.getBoundingClientRect())||i(),f=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),s}(c,n):null;let m,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let f=l?Vr(e):null;return l&&function t(){const r=Vr(e);f&&!Yr(f,r)&&n(),f=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const Zr=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=Qn(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};const v=er(o),b=or(a),y=er(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=m||(y||!f?[ur(a)]:function(e){const t=ur(e);return[ir(e),t,ir(t)]}(a)),k="none"!==h;!m&&k&&w.push(...function(e,t,n,r){const o=tr(e);let s=function(e,t,n){switch(e){case"top":case"bottom":return n?t?lr:ar:t?ar:lr;case"left":case"right":return t?cr:dr;default:return[]}}(er(e),"start"===n,r);return o&&(s=s.map(e=>e+"-"+o),t&&(s=s.concat(s.map(ir)))),s}(a,f,h,x));const j=[a,...w],C=await l.detectOverflow(t,g),S=[];let E=(null==(r=s.flip)?void 0:r.overflows)||[];if(d&&S.push(C[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=tr(e),o=sr(e),s=rr(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ur(i)),[i,ur(i)]}(o,i,x);S.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:o,overflows:S}],!S.every(e=>e<=0)){var T,P;const e=((null==(T=s.flip)?void 0:T.index)||0)+1,t=j[e];if(t&&("alignment"!==u||b===or(t)||E.every(e=>or(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(P=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var N;const e=null==(N=E.filter(e=>{if(k){const t=or(e.placement);return t===b||"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:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Jr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Qn(e,t)||{};if(null==c)return{};const u=mr(d),m={x:n,y:r},p=sr(o),h=rr(p),f=await i.getDimensions(c),g="y"===p,v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=s.reference[h]+s.reference[p]-m[p]-s.floating[h],w=m[p]-s.reference[p],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let j=k?k[y]:0;j&&await(null==i.isElement?void 0:i.isElement(k))||(j=a.floating[y]||s.floating[h]);const C=x/2-w/2,S=j/2-f[h]/2-1,E=qn(u[v],S),T=qn(u[b],S),P=E,N=j-f[h]-T,R=j/2-f[h]/2+C,_=Jn(P,R,N),A=!l.arrow&&null!=tr(o)&&R!==_&&s.reference[h]/2-(R<P?E:T)-f[h]/2<0,M=A?R<P?R-P:R-N:0;return{[p]:m[p]+M,data:{[p]:_,centerOffset:R-_-M,...A&&{alignmentOffset:M}},reset:A}}}),Qr=(e,t,n)=>{const r=new Map,o={platform:Gr,...n},s={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Ar},l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=_r(c,r,l),m=r,p=0;const h={};for(let n=0;n<s.length;n++){const f=s[n];if(!f)continue;const{name:g,fn:v}=f,{x:b,y,data:x,reset:w}=await v({x:d,y:u,initialPlacement:r,placement:m,strategy:o,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=y?y:u,h[g]={...h[g],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(m=w.placement),w.rects&&(c=!0===w.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:d,y:u}=_r(c,m,l))),n=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:h}})(e,t,{...o,platform:s})};var eo="undefined"!=typeof document?Me.useLayoutEffect:function(){};function to(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(!to(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||to(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function no(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ro(e,t){const n=no(e);return Math.round(t*n)/n}function oo(e){const t=Me.useRef(e);return eo(()=>{t.current=e}),t}const so=(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:s,placement:i,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,s=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=er(n),a=tr(n),l="y"===or(n),c=Mr.has(i)?-1:1,d=s&&l?-1:1,u=Qn(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),l?{x:p*d,y:m*c}:{x:m*c,y:p*d}}(t,e);return i===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},io=(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:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Qn(e,t),d={x:n,y:r},u=await s.detectOverflow(t,c),m=or(er(o)),p=nr(m);let h=d[p],f=d[m];if(i){const e="y"===p?"bottom":"right";h=Jn(h+u["y"===p?"top":"left"],h,h-u[e])}if(a){const e="y"===m?"bottom":"right";f=Jn(f+u["y"===m?"top":"left"],f,f-u[e])}const g=l.fn({...t,[p]:h,[m]:f});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[m]:a}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},ao=(e,t)=>{const n=Zr(e);return{name:n.name,fn:n.fn,options:[e,t]}},lo=(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:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Qn(e,t),d=await i.detectOverflow(t,c),u=er(o),m=tr(o),p="y"===or(o),{width:h,height:f}=s.floating;let g,v;"top"===u||"bottom"===u?(g=u,v=m===(await(null==i.isRTL?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=u,g="end"===m?"top":"bottom");const b=f-d.top-d.bottom,y=h-d.left-d.right,x=qn(f-d[g],b),w=qn(h-d[v],y),k=!t.middlewareData.shift;let j=x,C=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(C=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(j=b),k&&!m){const e=Kn(d.left,0),t=Kn(d.right,0),n=Kn(d.top,0),r=Kn(d.bottom,0);p?C=h-2*(0!==e||0!==t?e+t:Kn(d.left,d.right)):j=f-2*(0!==n||0!==r?n+r:Kn(d.top,d.bottom))}await l({...t,availableWidth:C,availableHeight:j});const S=await i.getDimensions(a.floating);return h!==S.width||f!==S.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},co=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Jr({element:n.current,padding:r}).fn(t):{}:n?Jr({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}},uo={...Le},mo=uo.useInsertionEffect||(e=>e());function po(e){const t=Me.useRef(()=>{});return mo(()=>{t.current=e}),Me.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 ho="ArrowUp",fo="ArrowDown",go="ArrowLeft",vo="ArrowRight";function bo(e,t,n){return Math.floor(e/t)!==n}function yo(e,t){return t<0||t>=e.current.length}function xo(e,t){return ko(e,{disabledIndices:t})}function wo(e,t){return ko(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ko(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:s=1}=void 0===t?{}:t;const i=e.current;let a=n;do{a+=r?-s:s}while(a>=0&&a<=i.length-1&&So(i,a,o));return a}function jo(e,t,n,r,o){if(-1===e)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e)}}function Co(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function So(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 Eo="undefined"!=typeof document?Me.useLayoutEffect:Me.useEffect;function To(){return To=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},To.apply(this,arguments)}let Po=!1,No=0;const Ro=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+No++,_o=uo.useId||function(){const[e,t]=Me.useState(()=>Po?Ro():void 0);return Eo(()=>{null==e&&t(Ro())},[]),Me.useEffect(()=>{Po=!0},[]),e},Ao=Me.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:s}},width:i=14,height:a=7,tipRadius:l=0,strokeWidth:c=0,staticOffset:d,stroke:u,d:m,style:{transform:p,...h}={},...f}=e,g=_o(),[v,b]=Me.useState(!1);if(Eo(()=>{r&&"rtl"===jn(r).direction&&b(!0)},[r]),!r)return null;const[y,x]=n.split("-"),w="top"===y||"bottom"===y;let k=d;(w&&null!=s&&s.x||!w&&null!=s&&s.y)&&(k=null);const j=2*c,C=j/2,S=i/2*(l/-8+1),E=a/2*l/4,T=!!m,P=k&&"end"===x?"bottom":"top";let N=k&&"end"===x?"right":"left";k&&v&&(N="end"===x?"left":"right");const R=null!=(null==o?void 0:o.x)?k||o.x:"",_=null!=(null==o?void 0:o.y)?k||o.y:"",A=m||"M0,0 H"+i+" L"+(i-S)+","+(a-E)+" Q"+i/2+","+a+" "+S+","+(a-E)+" Z",M={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[y];return Me.createElement("svg",To({},f,{"aria-hidden":!0,ref:t,width:T?i:i+j,height:i,viewBox:"0 0 "+i+" "+(a>i?a:i),style:{position:"absolute",pointerEvents:"none",[N]:R,[P]:_,[y]:w||T?"100%":"calc(100% - "+j/2+"px)",transform:[M,p].filter(e=>!!e).join(" "),...h}}),j>0&&Me.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:u,strokeWidth:j+(m?0:1),d:A}),Me.createElement("path",{stroke:j&&!m?f.fill:"none",d:A}),Me.createElement("clipPath",{id:g},Me.createElement("rect",{x:-C,y:C*(T?-1:1),width:i+j,height:i})))});const Mo=Me.createContext(null),Lo=Me.createContext(null),Io=()=>{var e;return(null==(e=Me.useContext(Mo))?void 0:e.id)||null},Do=()=>Me.useContext(Lo);function Oo(e){return"data-floating-ui-"+e}function Fo(e){const t=(0,Me.useRef)(e);return Eo(()=>{t.current=e}),t}const Vo=Oo("safe-polygon");function zo(e,t,n){return n&&!Vn(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Bo=0;function $o(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Bo);const s=()=>null==e?void 0:e.focus({preventScroll:n});o?s():Bo=requestAnimationFrame(s)}function Wo(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 Uo=new WeakMap,Ho=new WeakSet,qo={},Ko=0;const Go=e=>e&&(e.host||Go(e.parentNode));function Yo(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=zn(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=(a=t,e.map(e=>{if(a.contains(e))return e;const t=Go(e);return a.contains(t)?t:null}).filter(e=>null!=e));var a;const l=new Set,c=new Set(i),d=[];qo[o]||(qo[o]=new WeakMap);const u=qo[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"!==sn(t))if(l.has(t))e(t);else{const e=s?t.getAttribute(s):null,n=null!==e&&"false"!==e,r=(Uo.get(t)||0)+1,i=(u.get(t)||0)+1;Uo.set(t,r),u.set(t,i),d.push(t),1===r&&n&&Ho.add(t),1===i&&t.setAttribute(o,""),!n&&s&&t.setAttribute(s,"true")}})}(t),l.clear(),Ko++,()=>{d.forEach(e=>{const t=(Uo.get(e)||0)-1,n=(u.get(e)||0)-1;Uo.set(e,t),u.set(e,n),t||(!Ho.has(e)&&s&&e.removeAttribute(s),Ho.delete(e)),n||e.removeAttribute(o)}),Ko--,Ko||(Uo=new WeakMap,Uo=new WeakMap,Ho=new WeakSet,qo={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Xo=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Zo(e,t){const n=Nr(e,Xo());"prev"===t&&n.reverse();const r=n.indexOf(Nn(zn(e)));return n.slice(r+1)[0]}function Jo(){return Zo(document.body,"next")}function Qo(){return Zo(document.body,"prev")}function es(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Rn(n,r)}function ts(e){Nr(e,Xo()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function ns(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 rs={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 os(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const ss=Me.forwardRef(function(e,t){const[n,r]=Me.useState();Eo(()=>(Dn()&&r("button"),document.addEventListener("keydown",os),()=>{document.removeEventListener("keydown",os)}),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Oo("focus-guard")]:"",style:rs};return Me.createElement("span",To({},e,o))}),is=Me.createContext(null),as=Oo("portal");function ls(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=_o(),o=cs(),[s,i]=Me.useState(null),a=Me.useRef(null);return Eo(()=>()=>{null==s||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),Eo(()=>{if(!r)return;if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(as,""),e.appendChild(n),a.current=n,i(n)},[t,r]),Eo(()=>{if(null===n)return;if(!r)return;if(a.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!dn(e)&&(e=e.current),e=e||document.body;let s=null;t&&(s=document.createElement("div"),s.id=t,e.appendChild(s));const l=document.createElement("div");l.id=r,l.setAttribute(as,""),e=s||e,e.appendChild(l),a.current=l,i(l)},[t,n,r,o]),s}({id:n,root:r}),[i,a]=Me.useState(null),l=Me.useRef(null),c=Me.useRef(null),d=Me.useRef(null),u=Me.useRef(null),m=null==i?void 0:i.modal,p=null==i?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!(!r&&!s);return Me.useEffect(()=>{if(s&&o&&!m)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&es(e)&&("focusin"===e.type?ns:ts)(s)}},[s,o,m]),Me.useEffect(()=>{s&&(p||ns(s))},[p,s]),Me.createElement(is.Provider,{value:Me.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:u,portalNode:s,setFocusManagerState:a}),[o,s])},h&&s&&Me.createElement(ss,{"data-type":"outside",ref:l,onFocus:e=>{if(es(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=Qo()||(null==i?void 0:i.refs.domReference.current);null==e||e.focus()}}}),h&&s&&Me.createElement("span",{"aria-owns":s.id,style:rs}),s&&Rr.createPortal(t,s),h&&s&&Me.createElement(ss,{"data-type":"outside",ref:c,onFocus:e=>{if(es(e,s)){var t;null==(t=u.current)||t.focus()}else{const t=Jo()||(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 cs=()=>Me.useContext(is),ds="data-floating-ui-focusable";function us(e){return e?e.hasAttribute(ds)?e:e.querySelector("["+ds+"]")||e:null}let ms=[];function ps(e){ms=ms.filter(e=>e.isConnected);let t=e;if(t&&"body"!==sn(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==gr.call(e,hr)&&Er(t,e)}(t,Xo())){const e=Nr(t,Xo())[0];e&&(t=e)}ms.push(t),ms.length>20&&(ms=ms.slice(-20))}}function hs(){return ms.slice().reverse().find(e=>e.isConnected)}const fs=Me.forwardRef(function(e,t){return Me.createElement("button",To({},e,{type:"button",ref:t,tabIndex:-1,style:rs}))});function gs(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:u=!0}=e,{open:m,refs:p,nodeId:h,onOpenChange:f,events:g,dataRef:v,floatingId:b,elements:{domReference:y,floating:x}}=t,w="number"==typeof i&&i<0,k=Hn(y)&&w,j="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||s,C=Fo(o),S=Fo(i),E=Fo(a),T=Do(),P=cs(),N=Me.useRef(null),R=Me.useRef(null),_=Me.useRef(!1),A=Me.useRef(!1),M=Me.useRef(-1),L=null!=P,I=us(x),D=po(function(e){return void 0===e&&(e=I),e?Nr(e,Xo()):[]}),O=po(e=>{const t=D(e);return C.current.map(e=>y&&"reference"===e?y:I&&"floating"===e?I:t).filter(Boolean).flat()});function F(e){return!r&&d&&c?Me.createElement(fs,{ref:"start"===e?N:R,onClick:e=>f(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}Me.useEffect(()=>{if(r)return;if(!c)return;function e(e){if("Tab"===e.key){Rn(I,Nn(zn(I)))&&0===D().length&&!k&&Un(e);const t=O(),n=$n(e);"reference"===C.current[0]&&n===y&&(Un(e),e.shiftKey?$o(t[t.length-1]):$o(t[1])),"floating"===C.current[1]&&n===I&&e.shiftKey&&(Un(e),$o(t[0]))}}const t=zn(I);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,y,I,c,C,k,D,O]),Me.useEffect(()=>{if(!r&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=$n(e),n=D().indexOf(t);-1!==n&&(M.current=n)}},[r,x,D]),Me.useEffect(()=>{if(!r&&u)return x&&un(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){A.current=!0,setTimeout(()=>{A.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(Rn(y,t)||Rn(x,t)||Rn(t,x)||Rn(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Oo("focus-guard"))||T&&(Wo(T.nodesRef.current,h).find(e=>{var n,r;return Rn(null==(n=e.context)?void 0:n.elements.floating,t)||Rn(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}(T.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&&Nn(zn(I))===zn(I).body){un(I)&&I.focus();const e=M.current,t=D(),n=t[e]||t[t.length-1]||I;un(n)&&n.focus()}!k&&c||!t||!n||A.current||t===hs()||(_.current=!0,f(!1,e,"focus-out"))})}},[r,y,x,I,c,h,T,P,f,u,l,D,k]),Me.useEffect(()=>{var e;if(r)return;const t=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Oo("portal")+"]"))||[]);if(x){const e=[x,...t,N.current,R.current,C.current.includes("reference")||k?y:null].filter(e=>null!=e),n=c||k?Yo(e,j,!j):Yo(e);return()=>{n()}}},[r,y,x,c,C,P,k,j]),Eo(()=>{if(r||!un(I))return;const e=Nn(zn(I));queueMicrotask(()=>{const t=O(I),n=S.current,r=("number"==typeof n?t[n]:n.current)||I,o=Rn(I,e);w||o||!m||$o(r,{preventScroll:r===I})})},[r,m,I,w,O,S]),Eo(()=>{if(r||!I)return;let e=!1;const t=zn(I),n=Nn(t);let o=v.current.openEvent;function s(t){let{open:n,reason:r,event:s,nested:i}=t;n&&(o=s),"escape-key"===r&&p.domReference.current&&ps(p.domReference.current),"hover"===r&&"mouseleave"===s.type&&(_.current=!0),"outside-press"===r&&(i?(_.current=!1,e=!0):_.current=!(Ln(s)||In(s)))}ps(n),g.on("openchange",s);const i=t.createElement("span");return i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,rs),L&&y&&y.insertAdjacentElement("afterend",i),()=>{g.off("openchange",s);const n=Nn(t),r=Rn(x,n)||T&&Wo(T.nodesRef.current,h).some(e=>{var t;return Rn(null==(t=e.context)?void 0:t.elements.floating,n)});(r||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&ps(p.domReference.current);const a="boolean"==typeof E.current?hs()||i:E.current.current||i;queueMicrotask(()=>{E.current&&!_.current&&un(a)&&(a===n||n===t.body||r)&&a.focus({preventScroll:e}),i.remove()})}},[r,x,I,E,v,p,g,T,h,L,y]),Me.useEffect(()=>{queueMicrotask(()=>{_.current=!1})},[r]),Eo(()=>{if(!r&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:m,onOpenChange:f,refs:p}),()=>{P.setFocusManagerState(null)}},[r,P,c,m,f,p,u]),Eo(()=>{if(r)return;if(!I)return;if("function"!=typeof MutationObserver)return;if(w)return;const e=()=>{const e=I.getAttribute("tabindex"),t=D(),n=Nn(zn(x)),r=t.indexOf(n);-1!==r&&(M.current=r),C.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&I.setAttribute("tabindex","0"):"-1"!==e&&I.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(I,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,x,I,p,C,D,w]);const V=!r&&j&&(!c||!k)&&(L||c);return Me.createElement(Me.Fragment,null,V&&Me.createElement(ss,{"data-type":"inside",ref:null==P?void 0:P.beforeInsideRef,onFocus:e=>{if(c){const e=O();$o("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(_.current=!1,es(e,P.portalNode)){const e=Jo()||y;null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!k&&F("start"),n,F("end"),V&&Me.createElement(ss,{"data-type":"inside",ref:null==P?void 0:P.afterInsideRef,onFocus:e=>{if(c)$o(O()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(u&&(_.current=!0),es(e,P.portalNode)){const e=Qo()||y;null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}}))}let vs=0,bs=()=>{};const ys=Me.forwardRef(function(e,t){const{lockScroll:n=!1,...r}=e;return Eo(()=>{if(n)return vs++,1===vs&&(bs=function(){const e=/iP(hone|ad|od)|iOS/.test(An()),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,s=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var i,a;const e=(null==(i=window.visualViewport)?void 0:i.offsetLeft)||0,n=(null==(a=window.visualViewport)?void 0:a.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(s-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,s))}}()),()=>{vs--,0===vs&&bs()}},[n]),Me.createElement("div",To({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function xs(e){return un(e.target)&&"BUTTON"===e.target.tagName}function ws(e){return Wn(e)}function ks(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:d=!0,stickIfOpen:u=!0}=t,m=Me.useRef(),p=Me.useRef(!1),h=Me.useMemo(()=>({onPointerDown(e){m.current=e.pointerType},onMouseDown(e){const t=m.current;0===e.button&&"click"!==a&&(Vn(t,!0)&&c||(!n||!l||o.current.openEvent&&u&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=m.current;"mousedown"===a&&m.current?m.current=void 0:Vn(t,!0)&&c||(!n||!l||o.current.openEvent&&u&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){m.current=void 0,e.defaultPrevented||!d||xs(e)||(" "!==e.key||ws(s)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&r(!n||!l,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||xs(e)||ws(s)||" "===e.key&&p.current&&(p.current=!1,r(!n||!l,e.nativeEvent,"click"))}}),[o,s,a,c,d,r,n,u,l]);return Me.useMemo(()=>i?{reference:h}:{},[i,h])}const js={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Cs={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ss=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 Es(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:m=!1,bubbles:p,capture:h}=t,f=Do(),g=po("function"==typeof l?l:()=>!1),v="function"==typeof l?g:l,b=Me.useRef(!1),y=Me.useRef(!1),{escapeKey:x,outsidePress:w}=Ss(p),{escapeKey:k,outsidePress:j}=Ss(h),C=Me.useRef(!1),S=po(e=>{var t;if(!n||!i||!a||"Escape"!==e.key)return;if(C.current)return;const o=null==(t=s.current.floatingContext)?void 0:t.nodeId,l=f?Wo(f.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")}),E=po(e=>{var t;const n=()=>{var t;S(e),null==(t=$n(e))||t.removeEventListener("keydown",n)};null==(t=$n(e))||t.addEventListener("keydown",n)}),T=po(e=>{var t;const n=b.current;b.current=!1;const i=y.current;if(y.current=!1,"click"===c&&i)return;if(n)return;if("function"==typeof v&&!v(e))return;const a=$n(e),l="["+Oo("inert")+"]",d=zn(o.floating).querySelectorAll(l);let u=dn(a)?a:null;for(;u&&!kn(u);){const e=Sn(u);if(kn(e)||!dn(e))break;u=e}if(d.length&&dn(a)&&!a.matches("html,body")&&!Rn(a,o.floating)&&Array.from(d).every(e=>!Rn(u,e)))return;if(un(a)&&R){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===jn(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const m=null==(t=s.current.floatingContext)?void 0:t.nodeId,p=f&&Wo(f.nodesRef.current,m).some(t=>{var n;return Bn(e,null==(n=t.context)?void 0:n.elements.floating)});if(Bn(e,o.floating)||Bn(e,o.domReference)||p)return;const h=f?Wo(f.nodesRef.current,m):[];if(h.length>0){let e=!0;if(h.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),P=po(e=>{var t;const n=()=>{var t;T(e),null==(t=$n(e))||t.removeEventListener(c,n)};null==(t=$n(e))||t.addEventListener(c,n)});Me.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),C.current=!0}function d(){e=window.setTimeout(()=>{C.current=!1},wn()?5:0)}const u=zn(o.floating);a&&(u.addEventListener("keydown",k?E:S,k),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",d)),v&&u.addEventListener(c,j?P:T,j);let p=[];return m&&(dn(o.domReference)&&(p=Tn(o.domReference)),dn(o.floating)&&(p=p.concat(Tn(o.floating))),!dn(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(Tn(o.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{a&&(u.removeEventListener("keydown",k?E:S,k),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",d)),v&&u.removeEventListener(c,j?P:T,j),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[s,o,a,v,c,n,r,m,i,x,w,S,k,E,T,j,P]),Me.useEffect(()=>{b.current=!1},[v,c]);const N=Me.useMemo(()=>({onKeyDown:S,[js[u]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}}),[S,r,d,u]),R=Me.useMemo(()=>({onKeyDown:S,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[Cs[c]]:()=>{b.current=!0}}),[S,c]);return Me.useMemo(()=>i?{reference:N,floating:R}:{},[i,N,R])}function Ts(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=_o(),s=Me.useRef({}),[i]=Me.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))||[])}}}()),a=null!=Io(),[l,c]=Me.useState(r.reference),d=po((e,t,r)=>{s.current.openEvent=e?t:void 0,i.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)}),u=Me.useMemo(()=>({setPositionReference:c}),[]),m=Me.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return Me.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:m,events:i,floatingId:o,refs:u}),[t,d,m,i,o,u])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=Me.useState(null),[a,l]=Me.useState(null),c=(null==o?void 0:o.domReference)||s,d=Me.useRef(null),u=Do();Eo(()=>{c&&(d.current=c)},[c]);const m=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=Me.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=Me.useState(r);to(m,r)||p(r);const[h,f]=Me.useState(null),[g,v]=Me.useState(null),b=Me.useCallback(e=>{e!==k.current&&(k.current=e,f(e))},[]),y=Me.useCallback(e=>{e!==j.current&&(j.current=e,v(e))},[]),x=s||h,w=i||g,k=Me.useRef(null),j=Me.useRef(null),C=Me.useRef(d),S=null!=l,E=oo(l),T=oo(o),P=oo(c),N=Me.useCallback(()=>{if(!k.current||!j.current)return;const e={placement:t,strategy:n,middleware:m};T.current&&(e.platform=T.current),Qr(k.current,j.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!to(C.current,t)&&(C.current=t,Rr.flushSync(()=>{u(t)}))})},[m,t,n,T,P]);eo(()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,u(e=>({...e,isPositioned:!1})))},[c]);const R=Me.useRef(!1);eo(()=>(R.current=!0,()=>{R.current=!1}),[]),eo(()=>{if(x&&(k.current=x),w&&(j.current=w),x&&w){if(E.current)return E.current(x,w,N);N()}},[x,w,N,E,S]);const _=Me.useMemo(()=>({reference:k,floating:j,setReference:b,setFloating:y}),[b,y]),A=Me.useMemo(()=>({reference:x,floating:w}),[x,w]),M=Me.useMemo(()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=ro(A.floating,d.x),r=ro(A.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...no(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,A.floating,d.x,d.y]);return Me.useMemo(()=>({...d,update:N,refs:_,elements:A,floatingStyles:M}),[d,N,_,A,M])}({...e,elements:{...o,...a&&{reference:a}}}),p=Me.useCallback(e=>{const t=dn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),m.refs.setReference(t)},[m.refs]),h=Me.useCallback(e=>{(dn(e)||null===e)&&(d.current=e,i(e)),(dn(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!dn(e))&&m.refs.setReference(e)},[m.refs]),f=Me.useMemo(()=>({...m.refs,setReference:h,setPositionReference:p,domReference:d}),[m.refs,h,p]),g=Me.useMemo(()=>({...m.elements,domReference:c}),[m.elements,c]),v=Me.useMemo(()=>({...m,...r,refs:f,elements:g,nodeId:t}),[m,f,g,t,r]);return Eo(()=>{r.dataRef.current.floatingContext=v;const e=null==u?void 0:u.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),Me.useMemo(()=>({...m,context:v,refs:f,elements:g}),[m,f,g,v])}const Ps="active",Ns="selected";function Rs(e,t,n){const r=new Map,o="item"===n;let s=e;if(o&&e){const{[Ps]:t,[Ns]:__,...n}=e;s=n}return{..."floating"===n&&{tabIndex:-1,[ds]:""},...s,...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,s]=t;var i;o&&[Ps,Ns].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof s&&(null==(i=r.get(n))||i.push(s),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=s)}),e):e,{})}}function _s(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=Me.useCallback(t=>Rs(t,e,"reference"),t),s=Me.useCallback(t=>Rs(t,e,"floating"),n),i=Me.useCallback(t=>Rs(t,e,"item"),r);return Me.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}let As=!1;function Ms(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ls(e,t){return Ms(t,e===ho||e===fo,e===go||e===vo)}function Is(e,t,n){return Ms(t,e===fo,n?e===go:e===vo)||"Enter"===e||" "===e||""===e}function Ds(e,t,n){return Ms(t,n?e===vo:e===go,e===ho)}function Os(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:s,activeIndex:i,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:d=!1,loop:u=!1,nested:m=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:f="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:v=!0,disabledIndices:b,orientation:y="vertical",cols:x=1,scrollItemIntoView:w=!0,virtualItemRef:k,itemSizes:j,dense:C=!1}=t,S=Fo(us(o.floating)),E=Io(),T=Do(),P=po(a),N=Hn(o.domReference),R=Me.useRef(f),_=Me.useRef(null!=c?c:-1),A=Me.useRef(null),M=Me.useRef(!0),L=Me.useRef(P),I=Me.useRef(!!o.floating),D=Me.useRef(n),O=Me.useRef(!1),F=Me.useRef(!1),V=Fo(b),z=Fo(n),B=Fo(w),$=Fo(c),[W,U]=Me.useState(),[H,q]=Me.useState(),K=po(function(e,t,n){function r(e){h?(U(e.id),null==T||T.events.emit("virtualfocus",e),k&&(k.current=e)):$o(e,{preventScroll:!0,sync:!(!Fn()||!Dn())&&(As||O.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame(()=>{const s=e.current[t.current]||o;if(!s)return;o||r(s);const i=B.current;i&&Y&&(n||!M.current)&&(null==s.scrollIntoView||s.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))})});Eo(()=>{document.createElement("div").focus({get preventScroll(){return As=!0,!1}})},[]),Eo(()=>{l&&(n&&o.floating?R.current&&null!=c&&(F.current=!0,_.current=c,P(c)):I.current&&(_.current=-1,L.current(null)))},[l,n,o.floating,c,P]),Eo(()=>{if(l&&n&&o.floating)if(null==i){if(O.current=!1,null!=$.current)return;if(I.current&&(_.current=-1,K(s,_)),(!D.current||!I.current)&&R.current&&(null!=A.current||!0===R.current&&null==A.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(_.current=null==A.current||Is(A.current,y,p)||m?xo(s,V.current):wo(s,V.current),A.current=null,P(_.current))};t()}}else yo(s,i)||(_.current=i,K(s,_,F.current),F.current=!1)},[l,n,o.floating,i,$,m,s,y,p,P,K,V]),Eo(()=>{var e;if(!l||o.floating||!T||h||!I.current)return;const t=T.nodesRef.current,n=null==(e=t.find(e=>e.id===E))||null==(e=e.context)?void 0:e.elements.floating,r=Nn(zn(o.floating)),s=t.some(e=>e.context&&Rn(e.context.elements.floating,r));n&&!s&&M.current&&n.focus({preventScroll:!0})},[l,o.floating,T,E,h]),Eo(()=>{if(l&&T&&h&&!E)return T.events.on("virtualfocus",e),()=>{T.events.off("virtualfocus",e)};function e(e){q(e.id),k&&(k.current=e)}},[l,T,h,E,k]),Eo(()=>{L.current=P,I.current=!!o.floating}),Eo(()=>{n||(A.current=null)},[n]),Eo(()=>{D.current=n},[n]);const G=null!=i,Y=Me.useMemo(()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&P(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...g&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;M.current&&"touch"!==t&&(_.current=-1,K(s,_),P(null),h||$o(S.current,{preventScroll:!0}))}}}},[n,S,K,g,s,P,h]),X=po(e=>{if(M.current=!1,O.current=!0,229===e.which)return;if(!z.current&&e.currentTarget===S.current)return;if(m&&Ds(e.key,y,p))return Un(e),r(!1,e.nativeEvent,"list-navigation"),void(un(o.domReference)&&(h?null==T||T.events.emit("virtualfocus",o.domReference):o.domReference.focus()));const t=_.current,i=xo(s,b),a=wo(s,b);if(N||("Home"===e.key&&(Un(e),_.current=i,P(_.current)),"End"===e.key&&(Un(e),_.current=a,P(_.current))),x>1){const t=j||Array.from({length:s.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let o=0;return e.forEach((e,s)=>{let{width:i,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<a;r++)e.push(o+n+r*t);o%t+i<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=s}),l=!0):o++}}),[...r]}(t,x,C),r=n.findIndex(e=>null!=e&&!So(s.current,e,b)),o=n.reduce((e,t,n)=>null==t||So(s.current,t,b)?e:n,-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,rtl:s,cols:i,disabledIndices:a,minIndex:l,maxIndex:c,prevIndex:d,stopEvent:u=!1}=t,m=d;if(n.key===ho){if(u&&Un(n),-1===d)m=c;else if(m=ko(e,{startingIndex:m,amount:i,decrement:!0,disabledIndices:a}),o&&(d-i<l||m<0)){const e=d%i,t=c%i,n=c-(t-e);m=t===e?c:t>e?n:n-i}yo(e,m)&&(m=d)}if(n.key===fo&&(u&&Un(n),-1===d?m=l:(m=ko(e,{startingIndex:d,amount:i,disabledIndices:a}),o&&d+i>c&&(m=ko(e,{startingIndex:d%i-i,amount:i,disabledIndices:a}))),yo(e,m)&&(m=d)),"both"===r){const t=Yn(d/i);n.key===(s?go:vo)&&(u&&Un(n),d%i!==i-1?(m=ko(e,{startingIndex:d,disabledIndices:a}),o&&bo(m,i,t)&&(m=ko(e,{startingIndex:d-d%i-1,disabledIndices:a}))):o&&(m=ko(e,{startingIndex:d-d%i-1,disabledIndices:a})),bo(m,i,t)&&(m=d)),n.key===(s?vo:go)&&(u&&Un(n),d%i!==0?(m=ko(e,{startingIndex:d,decrement:!0,disabledIndices:a}),o&&bo(m,i,t)&&(m=ko(e,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:a}))):o&&(m=ko(e,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:a})),bo(m,i,t)&&(m=d));const r=Yn(c/i)===t;yo(e,m)&&(m=o&&r?n.key===(s?vo:go)?c:ko(e,{startingIndex:d-d%i-1,disabledIndices:a}):d)}return m}({current:n.map(e=>null!=e?s.current[e]:null)},{event:e,orientation:y,loop:u,rtl:p,cols:x,disabledIndices:Co([...b||s.current.map((e,t)=>So(s.current,t)?t:void 0),void 0],n),minIndex:r,maxIndex:o,prevIndex:jo(_.current>a?i:_.current,t,n,x,e.key===fo?"bl":e.key===(p?go:vo)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(_.current=l,P(_.current)),"both"===y)return}if(Ls(e.key,y)){if(Un(e),n&&!h&&Nn(e.currentTarget.ownerDocument)===e.currentTarget)return _.current=Is(e.key,y,p)?i:a,void P(_.current);Is(e.key,y,p)?_.current=u?t>=a?d&&t!==s.current.length?-1:i:ko(s,{startingIndex:t,disabledIndices:b}):Math.min(a,ko(s,{startingIndex:t,disabledIndices:b})):_.current=u?t<=i?d&&-1!==t?s.current.length:a:ko(s,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(i,ko(s,{startingIndex:t,decrement:!0,disabledIndices:b})),yo(s,_.current)?P(null):P(_.current)}}),Z=Me.useMemo(()=>h&&n&&G&&{"aria-activedescendant":H||W},[h,n,G,H,W]),J=Me.useMemo(()=>({"aria-orientation":"both"===y?void 0:y,...!Hn(o.domReference)&&Z,onKeyDown:X,onPointerMove(){M.current=!0}}),[Z,X,o.domReference,y]),Q=Me.useMemo(()=>{function e(e){"auto"===f&&Ln(e.nativeEvent)&&(R.current=!0)}return{...Z,onKeyDown(e){M.current=!1;const t=e.key.startsWith("Arrow"),o=["Home","End"].includes(e.key),i=t||o,a=function(e,t,n){return Ms(t,n?e===go:e===vo,e===fo)}(e.key,y,p),l=Ds(e.key,y,p),d=Ls(e.key,y),u=(m?a:d)||"Enter"===e.key||""===e.key.trim();if(h&&n){const t=null==T?void 0:T.nodesRef.current.find(e=>null==e.parentId),n=T&&t?function(e,t){let n,r=-1;return function t(o,s){s>r&&(n=o,r=s),Wo(e,o).forEach(e=>{t(e.id,s+1)})}(t,0),e.find(e=>e.id===n)}(T.nodesRef.current,t.id):null;if(i&&n&&k){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(a||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:a?s.current.find(e=>(null==e?void 0:e.id)===W):null;o&&(Un(e),o.dispatchEvent(t),q(void 0))}var b;if((d||o)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Un(e),void(null==(b=n.context.elements.domReference)||b.dispatchEvent(t))}return X(e)}(n||v||!t)&&(u&&(A.current=m&&d?null:e.key),m?a&&(Un(e),n?(_.current=xo(s,V.current),P(_.current)):r(!0,e.nativeEvent,"list-navigation")):d&&(null!=c&&(_.current=c),Un(e),!n&&v?r(!0,e.nativeEvent,"list-navigation"):X(e),n&&P(_.current)))},onFocus(){n&&!h&&P(null)},onPointerDown:function(e){R.current=f,"auto"===f&&In(e.nativeEvent)&&(R.current=!0)},onMouseDown:e,onClick:e}},[W,Z,X,V,f,s,m,P,r,n,v,y,p,c,T,h,k]);return Me.useMemo(()=>l?{reference:Q,floating:J,item:Y}:{},[l,Q,J,Y])}const Fs=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Vs(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=null!=(n=Fs.get(i))?n:i,l=_o(),c=null!=Io(),d=Me.useMemo(()=>"tooltip"===a||"label"===i?{["aria-"+("label"===i?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":r?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l},..."menu"===a&&c&&{role:"menuitem"},..."select"===i&&{"aria-autocomplete":"none"},..."combobox"===i&&{"aria-autocomplete":"list"}},[a,o,c,r,l,i]),u=Me.useMemo(()=>{const e={id:o,...a&&{role:a}};return"tooltip"===a||"label"===i?e:{...e,..."menu"===a&&{"aria-labelledby":l}}},[a,o,l,i]),m=Me.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 Me.useMemo(()=>s?{reference:d,floating:u,item:m}:{},[s,d,u,m])}const zs=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Bs(e,t){return"function"==typeof e?e(t):e}function $s(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:s,duration:i=250}=t,a=e.placement,l=a.split("-")[0],c=Me.useMemo(()=>({side:l,placement:a}),[l,a]),d="number"==typeof i,u=(d?i:i.open)||0,m=(d?i:i.close)||0,[p,h]=Me.useState(()=>({...Bs(s,c),...Bs(n,c)})),{isMounted:f,status:g}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,s=("number"==typeof o?o:o.close)||0,[i,a]=Me.useState("unmounted"),l=function(e,t){const[n,r]=Me.useState(e);return e&&!n&&r(!0),Me.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,s);return l||"close"!==i||a("unmounted"),Eo(()=>{if(r){if(n){a("initial");const e=requestAnimationFrame(()=>{a("open")});return()=>{cancelAnimationFrame(e)}}a("close")}},[n,r]),{isMounted:l,status:i}}(e,{duration:i}),v=Fo(n),b=Fo(r),y=Fo(o),x=Fo(s);return Eo(()=>{const e=Bs(v.current,c),t=Bs(y.current,c),n=Bs(x.current,c),r=Bs(b.current,c)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===g&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===g&&h({transitionProperty:Object.keys(r).map(zs).join(","),transitionDuration:u+"ms",...n,...r}),"close"===g){const r=t||e;h({transitionProperty:Object.keys(r).map(zs).join(","),transitionDuration:m+"ms",...n,...r})}},[m,y,v,b,x,u,g,c]),{isMounted:f,styles:p}}function Ws(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let e=0,i=s-1;e<s;i=e++){const[s,a]=t[e]||[0,0],[l,c]=t[i]||[0,0];a>=r!=c>=r&&n<=(l-s)*(r-a)/(c-a)+s&&(o=!o)}return o}function Us(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,a=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:d,elements:u,onClose:m,nodeId:p,tree:h}=e;return function(e){function f(){clearTimeout(o),m()}if(clearTimeout(o),!u.domReference||!u.floating||null==d||null==n||null==c)return;const{clientX:g,clientY:v}=e,b=[g,v],y=$n(e),x="mouseleave"===e.type,w=Rn(u.floating,y),k=Rn(u.domReference,y),j=u.domReference.getBoundingClientRect(),C=u.floating.getBoundingClientRect(),S=d.split("-")[0],E=n>C.right-C.width/2,T=c>C.bottom-C.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,j),N=C.width>j.width,R=C.height>j.height,_=(N?j:C).left,A=(N?j:C).right,M=(R?j:C).top,L=(R?j:C).bottom;if(w&&(s=!0,!x))return;if(k&&(s=!1),k&&!x)return void(s=!0);if(x&&dn(e.relatedTarget)&&Rn(u.floating,e.relatedTarget))return;if(h&&Wo(h.nodesRef.current,p).some(e=>{let{context:t}=e;return null==t?void 0:t.open}))return;if("top"===S&&c>=j.bottom-1||"bottom"===S&&c<=j.top+1||"left"===S&&n>=j.right-1||"right"===S&&n<=j.left+1)return f();let I=[];switch(S){case"top":I=[[_,j.top+1],[_,C.bottom-1],[A,C.bottom-1],[A,j.top+1]];break;case"bottom":I=[[_,C.top+1],[_,j.bottom-1],[A,j.bottom-1],[A,C.top+1]];break;case"left":I=[[C.right-1,L],[C.right-1,M],[j.left+1,M],[j.left+1,L]];break;case"right":I=[[j.right-1,L],[j.right-1,M],[C.left+1,M],[C.left+1,L]]}if(!Ws([g,v],I)){if(s&&!P)return f();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===a||0===r)return i=e,a=t,l=n,null;const o=e-i,s=t-a,c=Math.sqrt(o*o+s*s);return i=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return f()}Ws([g,v],function(e){let[n,r]=e;switch(S){case"top":return[[N?n+t/2:E?n+4*t:n-4*t,r+t+1],[N?n-t/2:E?n+4*t:n-4*t,r+t+1],[C.left,E||N?C.bottom-t:C.top],[C.right,E?N?C.bottom-t:C.top:C.bottom-t]];case"bottom":return[[N?n+t/2:E?n+4*t:n-4*t,r-t],[N?n-t/2:E?n+4*t:n-4*t,r-t],[C.left,E||N?C.top+t:C.bottom],[C.right,E?N?C.top+t:C.bottom:C.top+t]];case"left":{const e=[n+t+1,R?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,R?r-t/2:T?r+4*t:r-4*t];return[[T||R?C.right-t:C.left,C.top],[T?R?C.right-t:C.left:C.right-t,C.bottom],e,o]}case"right":return[[n-t,R?r+t/2:T?r+4*t:r-4*t],[n-t,R?r-t/2:T?r+4*t:r-4*t],[T||R?C.left+t:C.right,C.top],[T?R?C.left+t:C.right:C.left+t,C.bottom]]}}([n,c]))?!s&&r&&(o=window.setTimeout(f,40)):f()}}};return c.__options={blockPointerEvents:n},c}let Hs=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};const qs=Qt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Ks=Qt("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"}]]),Gs=Qt("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"}]]),Ys=(0,Me.forwardRef)((e,t)=>{const{variant:n="primary",size:r="md",type:o="button",tag:s="button",className:i,children:a,disabled:l=!1,destructive:c=!1,icon:d=null,iconPosition:u="left",loading:m=!1,...p}=e,h=c&&"focus:ring-focus-error",f=m?"opacity-50 disabled:cursor-not-allowed":"",g={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],v=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 y,x=null,w="";return d&&(w="flex items-center justify-center","left"===u?y=d:x=d),(0,T.jsxs)(s,{ref:t,type:o,className:qt(w,"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,g,v,h,f,{"cursor-default":l},i),disabled:l,"aria-disabled":l,...p,children:[(0,T.jsx)(Me.Fragment,{children:y},"left-icon"),a?(0,T.jsx)("span",{className:"px-1",children:a}):null,(0,T.jsx)(Me.Fragment,{children:x},"right-icon")]})});Ys.displayName="Button";const Xs="light",Zs="neutral",Js=({icon:e,theme:t=Xs,variant:n=Zs})=>{const r="[&>svg]:h-5 [&>svg]:w-5",o=(({theme:e=Xs,variant:t=Zs})=>{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,Me.isValidElement)(e))return(0,Me.cloneElement)(e,{className:qt(r,o,e?.props?.className??"")});const s={neutral:(0,T.jsx)(qs,{className:qt(r,o)}),info:(0,T.jsx)(qs,{className:qt(r,o)}),success:(0,T.jsx)(rn,{className:qt(r,o)}),warning:(0,T.jsx)(Ks,{className:qt(r,o)}),error:(0,T.jsx)(Gs,{className:qt(r,o)})};return s[n]||s.neutral},Qs=({actionType:e="button",onAction:t=()=>{},actionLabel:n="",theme:r=Xs})=>{const o="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none";let s="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===r&&(s="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),e){case"button":return(0,T.jsx)(Ys,{variant:"outline",size:"xs",onClick:t,className:qt("rounded",o,s,"dark"===r?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white"),children:n});case"link":return(0,T.jsx)(Ys,{variant:"link",size:"xs",onClick:t,className:qt(o,s),children:n});default:return null}},ei=({theme:e=Xs,title:t="",inline:n=!1})=>t?(0,T.jsx)("span",{className:qt("block",{light:"text-text-primary",dark:"text-text-inverse"}[e],"text-sm leading-5 font-semibold",n?"inline":"block"),children:t}):null,ti=({theme:e=Xs,content:t="",inline:n=!1})=>t?(0,T.jsx)("span",{className:qt({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,ni=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},ri={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"}},oi="group-disabled:text-field-color-disabled",si={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]"},ii={sm:"py-1.5 px-2 text-xs font-normal",md:"p-2 text-sm font-normal",lg:"p-2 text-base font-normal"},ai=e=>null===e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?e.toString():Array.isArray(e)?e.map(ai).join(" ").trim():(0,Me.isValidElement)(e)?e.props&&e.props.children?ai(e.props.children):"":"object"==typeof e&&"textContent"in e?e.textContent?.toString().toLowerCase()||"":"object"==typeof e&&"children"in e?ai(e.children):"",li=Qt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ci=(0,Me.forwardRef)(({label:e="",size:t="sm",className:n="",type:r="pill",variant:o="neutral",icon:s=null,disabled:i=!1,onClose:a=()=>{},closable:l=!1,onMouseDown:c=()=>{},disableHover:d=!1},u)=>{const m={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="",h="group relative justify-center flex items-center cursor-pointer";const f={xxs:"[&>svg]:size-3",xs:"[&>svg]:size-3",sm:"[&>svg]:size-3",md:"[&>svg]:size-4",lg:"[&>svg]:size-5"};return i?(p=m.disabled,h+=" cursor-not-allowed disabled"):p=m[o],e?(0,T.jsxs)("span",{className:qt("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,!d&&{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:u,children:[s?(0,T.jsx)("span",{className:qt("justify-center flex items-center",f[t]),children:s}):null,(0,T.jsx)("span",{className:"px-1 truncate inline-block",children:e}),l&&(0,T.jsxs)("span",{className:qt(h,f[t]),onMouseDown:c,role:"button",tabIndex:0,...!i&&{onClick:a},children:[(0,T.jsx)("span",{className:"sr-only",children:`Remove ${e}`}),(0,T.jsx)(li,{}),(0,T.jsx)("span",{className:"absolute -inset-1"})]})]}):null});ci.displayName="Badge";const di=Qt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ui=({variant:e="primary",size:t="md",icon:n=null,className:r=""})=>{const o={primary:"text-brand-primary-600",secondary:"text-background-primary"}[e],s={sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6",xl:"[&>svg]:size-8"}[t];return(0,T.jsx)("span",{className:qt("flex",s,o,r),children:n||(0,T.jsx)(di,{className:"animate-spin shrink-0"})})},mi=(0,Me.createContext)({}),pi=()=>(0,Me.useContext)(mi),hi=(0,Me.forwardRef)(({children:e,icon:t=null,placeholder:n="Select an option",optionIcon:r=null,render:o,label:s,className:i,...a},l)=>{const{sizeValue:c,getReferenceProps:d,getValues:u,selectId:m,refs:p,isOpen:h,multiple:f,combobox:g,setSelected:v,onChange:b,isControlled:y,disabled:x,by:w}=pi(),k={sm:"xs",md:"sm",lg:"md"}[c],j=(0,Me.useCallback)(()=>{if(t)return t;const e="text-field-placeholder group-disabled:text-icon-disabled";return g?(0,T.jsx)(en,{className:e}):(0,T.jsx)(tn,{className:e})},[t]),C=(0,Me.useCallback)(()=>{const t=u();if(!t)return null;if(f)return t.map((e,t)=>(0,T.jsx)(ci,{className:"cursor-default",icon:r,type:"rounded",size:k,onMouseDown:S(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,...f?{onClose:S(t)}:{}};n=e(r)}return((0,Me.isValidElement)(e)||"string"==typeof e)&&"function"!=typeof o&&(n=e),(0,T.jsx)("span",{className:qt("truncate",ri[c].displaySelected,oi),children:n})},[u,x]),S=e=>t=>{t?.preventDefault(),t?.stopPropagation();const n=[...u()??[]],r=n.findIndex(t=>null!==t&&null!==e&&"object"==typeof t?t[w]===e[w]:t===e);-1!==r&&(n.splice(r,1),y||v(n),"function"==typeof b&&b(n))};return(0,T.jsxs)("div",{className:"w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[!!s&&(0,T.jsx)("label",{className:qt(ri[c]?.label,"text-field-label"),htmlFor:m,children:s}),(0,T.jsxs)("button",{id:m,ref:ni(p.setReference,l),className:qt("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",ri[c].selectButton,f&&ri[c].multiSelect,"group disabled:outline-field-border-disabled [&:hover:has(:disabled)]:outline-field-border-disabled disabled:cursor-default",i),tabIndex:0,disabled:x,...a,...d(),children:[(0,T.jsxs)("div",{className:qt("flex-1 grid items-center justify-start gap-1.5 overflow-hidden",u()&&"flex flex-wrap"),children:[C(),(f?!u()?.length:!u())&&(0,T.jsx)("div",{className:qt("[grid-area:1/1/2/3] text-field-input px-1",ri[c].displaySelected,oi),children:n})]}),(0,T.jsx)("div",{className:qt("flex items-center [&>svg]:shrink-0",ri[c].icon),children:j()})]})]})});function fi({label:e,children:t,className:n,...r}){const{index:o,totalGroups:s}=r,{sizeValue:i}=pi();return(0,T.jsxs)(Me.Fragment,{children:[(0,T.jsxs)("div",{className:"flex flex-col",role:"group","aria-label":e,children:[(0,T.jsx)("div",{className:qt("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,T.jsx)("div",{className:"flex flex-col",role:"presentation","aria-labelledby":`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:t})]}),o<s&&!!(t&&Me.Children.count(t)>0)&&(0,T.jsx)("hr",{className:qt("h-px my-2 w-full border-border-subtle border-b border-t-0 border-solid",si[i])})]})}function gi({children:e,className:t}){const{isOpen:n,context:r,refs:o,combobox:s,floatingStyles:i,getFloatingProps:a,sizeValue:l,setSearchKeyword:c,setActiveIndex:d,setSelectedIndex:u,value:m,selected:p,getValues:h,searchKeyword:f,listContentRef:g,by:v,searchPlaceholder:b,activeIndex:y,searchFn:x,debounceDelay:w}=pi(),k=(0,Me.useMemo)(()=>{const t=h();let n=-1;if(t){let r=Me.Children.toArray(e);r.length>0&&(0,Me.isValidElement)(r[0])&&r[0].type===fi&&(r=Me.Children.toArray(e).map(e=>(0,Me.isValidElement)(e)?Me.Children.toArray(e.props.children):[]).flat()),n=r.findIndex(e=>{if(!(0,Me.isValidElement)(e))return!1;const n=e.props.value;return"object"==typeof n&&"object"==typeof t?n[v]===t[v]:n===t})}return n},[m,p,e,v]);(0,Me.useLayoutEffect)(()=>{n||(d(k),u(k))},[k,n]),(0,Me.useLayoutEffect)(()=>{n&&(s&&[-1,null].includes(y)||d(-1))},[f,n]);const j=(0,Me.useMemo)(()=>{let t=0,n=0;Me.Children.forEach(e,e=>{if((0,Me.isValidElement)(e)&&e.type===fi){let n=!1;if(f&&!x){const t=f.toLowerCase(),r=(e.props.label?.toLowerCase()||"").includes(t),o=Me.Children.toArray(e.props.children).some(e=>!!(0,Me.isValidElement)(e)&&(ai(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 Me.Children.map(e,e=>{if(!(0,Me.isValidElement)(e))return null;if(e.type===fi){let t=!1;if(f&&!x){const n=f.toLowerCase();t=(e.props.label?.toLowerCase()||"").includes(n)}const s=Me.Children.map(e.props.children,e=>{if(!(0,Me.isValidElement)(e))return null;if(t){const t={...e.props,index:r++};return(0,Me.cloneElement)(e,t)}if(f&&!x){const t=ai(e.props.children)?.toLowerCase(),n=f.toLowerCase();if(!t?.includes(n))return null}const n={...e.props,index:r++};return(0,Me.cloneElement)(e,n)});if(!s?.some(e=>null!==e))return null;const i={...e.props,children:s,index:o,totalGroups:n};return o++,(0,Me.cloneElement)(e,i)}if(f&&!x){const t=ai(e.props?.children)?.toLowerCase(),n=f.toLowerCase();if(!t?.includes(n))return null}return(0,Me.cloneElement)(e,{...e.props,index:r++})})},[f,m,p,e,x]),C=Me.Children.count(j);(0,Me.useEffect)(()=>{g.current=[];let t=Me.Children.toArray(e);t&&(0,Me.isValidElement)(t[0])&&t[0].type===fi&&(t=Me.Children.toArray(t).map(e=>(0,Me.isValidElement)(e)?e.props.children:null).filter(Boolean)),Me.Children.forEach(t,e=>{if(!(0,Me.isValidElement)(e))return;const t=ai(e.props?.children)?.toLowerCase();if(f&&!x){const e=f.toLowerCase();if(!t?.includes(e))return}g.current.push(t)})},[f,x]);const[S,E]=(0,Me.useState)(!1),P=(0,Me.useCallback)(async()=>{if(x&&"function"==typeof x&&!S){E(!0);try{await x(f)}catch(e){console.error(e)}finally{E(!1)}}},[f]),N=((e,t=500)=>{const n=(0,Me.useRef)(null);return(0,Me.useCallback)((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>e(...r),t)},[e,t])})(P,w);return(0,Me.useEffect)(()=>{"function"==typeof x&&N()},[N]),(0,T.jsx)(T.Fragment,{children:n&&(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(gs,{context:r,modal:!1,visuallyHiddenDismiss:!0,children:(0,T.jsxs)("div",{ref:o.setFloating,className:qt("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg outline outline-1 outline-border-subtle",s&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",ri[l].dropdown,!s&&"h-auto",s?"overflow-hidden":"overflow-y-auto overflow-x-hidden",t),style:{...i,zIndex:1},...a(),children:[s&&(0,T.jsxs)("div",{className:qt(ri[l].searchbarWrapper),children:[S?(0,T.jsx)(ui,{className:ri[l].searchbarIcon}):(0,T.jsx)(nn,{className:qt("text-icon-secondary shrink-0",ri[l].searchbarIcon)}),(0,T.jsx)("input",{className:qt("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",ri[l].searchbar),type:"search",name:"keyword",placeholder:b,onChange:e=>c(e.target.value),value:f,autoComplete:"off"})]}),(0,T.jsxs)("div",{className:qt("overflow-y-auto overflow-x-hidden",!s&&"w-full h-full",ri[l].dropdownItemsWrapper),children:[!!C&&j,!C&&(0,T.jsx)("div",{className:qt("p-2 text-center font-medium text-field-placeholder",ii[l]),children:"No items found"})]})]})})})})}function vi({children:e,root:t,id:n}){return(0,T.jsx)(ls,{id:n,root:t,children:e})}function bi({value:e,selected:t,children:n,className:r,...o}){const{sizeValue:s,getItemProps:i,onKeyDownItem:a,onClickItem:l,activeIndex:c,selectedIndex:d,updateListRef:u,getValues:m,by:p,multiple:h}=pi(),{index:f}=o,g=(0,Me.useRef)(f),v=(0,Me.useMemo)(()=>{if(!h)return!1;const t=m();return!!t&&t.some(t=>null!==t&&null!==e&&"object"==typeof t?t[p]===e[p]:t===e)},[e,m]),b=(0,Me.useMemo)(()=>"boolean"==typeof t?t:h?v:f===d,[v,d,t]);return(0,T.jsxs)("div",{className:qt("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",ii[s],f===c&&"bg-button-tertiary-hover",r),ref:e=>{u(f,e)},role:"option",tabIndex:f===c?0:-1,"aria-selected":b&&f===c,...i({onClick(){l(g.current,e)},onKeyDown(t){a(t,g.current,e)}}),children:[(0,T.jsx)("span",{className:"w-full truncate",children:n}),b&&(0,T.jsx)(rn,{className:qt("text-icon-on-color-disabled",{sm:"size-4",md:"size-4",lg:"size-5"}[s])})]})}const yi=({id:e,size:t="md",value:n,defaultValue:r,onChange:o,by:s="id",children:i,multiple:a=!1,combobox:l=!1,disabled:c=!1,searchPlaceholder:d="Search...",searchFn:u,debounceDelay:m=500})=>{const p=(0,Me.useMemo)(()=>e||`select-${Hs()}`,[e]),h=(0,Me.useMemo)(()=>typeof n<"u",[n]),[f,g]=(0,Me.useState)(r),[v,b]=(0,Me.useState)(""),y=(0,Me.useCallback)(()=>h?n:f,[h,n,f]),[x,w]=(0,Me.useState)(!1),[k,j]=(0,Me.useState)(null),[C,S]=(0,Me.useState)(null),E={sm:l?256:172,md:l?256:216,lg:l?256:216},{refs:P,floatingStyles:N,context:R}=Ts({strategy:"fixed",placement:"bottom-start",open:x,onOpenChange:w,whileElementsMounted:Xr,middleware:[so(5),ao({padding:10}),lo({apply({rects:e,elements:n,availableHeight:r}){Object.assign(n.floating.style,{maxHeight:`min(${r}px, ${E[t]}px)`,maxWidth:`${e.reference.width}px`})},padding:10})]}),_=(0,Me.useRef)([]),A=(0,Me.useRef)([]),M=(0,Me.useRef)(!1),L=ks(R,{event:"mousedown"}),I=Es(R),D=Vs(R,{role:"listbox"}),O=Os(R,{listRef:_,activeIndex:k,selectedIndex:C,onNavigate:j,loop:!0}),F=function(e,t){var n;const{open:r,dataRef:o}=e,{listRef:s,activeIndex:i,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:d=null,resetMs:u=750,ignoreKeys:m=[],selectedIndex:p=null}=t,h=Me.useRef(),f=Me.useRef(""),g=Me.useRef(null!=(n=null!=p?p:i)?n:-1),v=Me.useRef(null),b=po(a),y=po(l),x=Fo(d),w=Fo(m);Eo(()=>{r&&(clearTimeout(h.current),v.current=null,f.current="")},[r]),Eo(()=>{var e;r&&""===f.current&&(g.current=null!=(e=null!=p?p:i)?e:-1)},[r,p,i]);const k=po(e=>{e?o.current.typing||(o.current.typing=e,y(e)):o.current.typing&&(o.current.typing=e,y(e))}),j=po(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=s.current;if(f.current.length>0&&" "!==f.current[0]&&(-1===t(n,n,f.current)?k(!1):" "===e.key&&Un(e)),null==n||w.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Un(e),k(!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())})&&f.current===e.key&&(f.current="",g.current=v.current),f.current+=e.key,clearTimeout(h.current),h.current=setTimeout(()=>{f.current="",g.current=v.current,k(!1)},u);const o=g.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],f.current);-1!==i?(b(i),v.current=i):" "!==e.key&&(f.current="",k(!1))}),C=Me.useMemo(()=>({onKeyDown:j}),[j]),S=Me.useMemo(()=>({onKeyDown:j,onKeyUp(e){" "===e.key&&k(!1)}}),[j,k]);return Me.useMemo(()=>c?{reference:C,floating:S}:{},[c,C,S])}(R,{listRef:A,activeIndex:k,selectedIndex:C,onMatch:x?j:S,onTypingChange(e){M.current=e}}),{getReferenceProps:V,getFloatingProps:z,getItemProps:B}=_s([I,D,O,L,...l?[]:[F]]),$=(e,t)=>{if(a)return((e,t)=>{const n=[...y()??[]];-1===n.findIndex(e=>null!==e&&null!==t&&"object"==typeof e?e[s]===t[s]:e===t)&&(n.push(t),h||g(n),S(e),P.reference.current.focus(),w(!1),b(""),"function"==typeof o&&o(n))})(e,t);S(e),h||g(t),P.reference.current.focus(),w(!1),b(""),"function"==typeof o&&o(t)},W=(0,Me.useCallback)((e,t)=>{_.current[e]=t},[]);return(0,T.jsx)(mi.Provider,{value:{selectedIndex:C,setSelectedIndex:S,activeIndex:k,setActiveIndex:j,selected:f,setSelected:g,handleSelect:$,combobox:l,sizeValue:t,multiple:a,onChange:o,isTypingRef:M,getItemProps:B,onClickItem:(e,t)=>{$(e,t)},onKeyDownItem:(e,t,n)=>{"Enter"===e.key&&(e.preventDefault(),$(t,n))," "===e.key&&!M.current&&(e.preventDefault(),$(t,n))},getValues:y,selectId:p,getReferenceProps:V,isOpen:x,value:n,updateListRef:W,refs:P,listContentRef:A,by:s,getFloatingProps:z,floatingStyles:N,context:R,searchKeyword:v,setSearchKeyword:b,disabled:c,isControlled:h,searchPlaceholder:d,searchFn:u,debounceDelay:m},children:i})};yi.displayName="Select";const xi=Object.assign(yi,{Portal:vi,Button:hi,Options:gi,Option:bi,OptionGroup:fi});vi.displayName="Select.Portal",hi.displayName="Select.Button",gi.displayName="Select.Options",bi.displayName="Select.Option",fi.displayName="Select.OptionGroup";const wi=Qt("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"}]]),ki=(0,Me.forwardRef)(({id:e,type:t="text",defaultValue:n="",value:r,size:o="sm",className:s="",disabled:i=!1,onChange:a=()=>{},error:l=!1,onError:c=()=>{},prefix:d=null,suffix:u=null,label:m="",...p},h)=>{const f=(0,Me.useRef)(null),g=(0,Me.useMemo)(()=>e||`input-${t}-${Hs()}`,[e]),v=(0,Me.useMemo)(()=>typeof r<"u",[r]),[b,y]=(0,Me.useState)(n),[x,w]=(0,Me.useState)(null),k=(0,Me.useCallback)(()=>v?r:b,[v,r,b]),j=e=>{if(i)return;let n;"file"===t?(n=e.target.files,n&&n.length>0?w(n[0].name):w(null)):n=e.target.value,!v&&"file"!==t&&y(n),"function"==typeof a&&a(n)},C=()=>{w(null),f.current&&(f.current.value=""),a(null)},S="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",E={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"},P={xs:"text-xs font-medium",sm:"text-sm font-medium",md:"text-sm font-medium",lg:"text-base font-medium"},N={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-base"},R={sm:d?"pl-8":"",md:d?"pl-9":"",lg:d?"pl-10":""},_={sm:u?"pr-8":"",md:u?"pr-9":"",lg:u?"pr-10":""},A=i?"hover:outline-border-disabled":"hover:outline-border-strong",M="focus:outline-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",L=l?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",I=l?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",D=i?"outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",O=i?"outline-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",F="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",V=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",z={xs:"[&>svg]:size-4",sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6"},B=(0,Me.useMemo)(()=>m?(0,T.jsx)(Yt,{className:qt(P[o]),htmlFor:g,...p?.required&&{required:!0},children:m}):null,[m,o,g]),$=x?"file:border-0 file:bg-transparent pr-10":"text-text-tertiary file:border-0 file:bg-transparent pr-10";return"file"===t?(0,T.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[B,(0,T.jsxs)("div",{className:qt("w-full relative flex focus-within:z-10",s),children:[(0,T.jsx)("input",{ref:ni(f,h),id:g,type:"file",className:qt(S,O,E[o],N[o],M,A,I,$),disabled:i,onChange:j,onInvalid:c,...p}),(0,T.jsx)("div",{className:qt(V,"right-0 pr-3",z[o]),children:(0,T.jsx)(wi,{})})]})]}):(0,T.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[B,(0,T.jsxs)("div",{className:qt("w-full relative flex focus-within:z-10",s),children:[d?(0,T.jsx)("div",{className:qt(F,"left-0 pl-3",N[o]),children:d}):null,(0,T.jsx)("input",{ref:ni(f,h),id:g,type:t,className:qt(S,D,E[o],N[o],R[o],_[o],M,A,L),disabled:i,onChange:j,onInvalid:c,value:k(),...p}),"file"===t?x?(0,T.jsx)("div",{className:qt(V,"right-0 pr-3 cursor-pointer z-20 pointer-events-auto",z[o]),onClick:C,role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&C()},children:(0,T.jsx)(li,{})}):(0,T.jsx)("div",{className:qt(V,"right-0 pr-3",z[o]),children:(0,T.jsx)(wi,{})}):u?(0,T.jsx)("div",{className:qt(F,"right-0 pr-3",N[o]),children:u}):null]})]})});ki.displayName="Input";const ji={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"}},Ci={sm:"text-sm leading-5",md:"text-base leading-6"},Si={sm:{checkbox:"size-4",icon:"size-1.5",info:"size-4"},md:{checkbox:"size-5",icon:"size-2",info:"size-5"}},Ei={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"},Ti=({variant:e="dark",placement:t="bottom",title:n="",content:r,arrow:o=!1,open:s,setOpen:i,children:a,className:l,tooltipPortalRoot:c,tooltipPortalId:d,boundary:u="clippingAncestors",strategy:m="fixed",offset:p=8,triggers:h=["hover","focus"],interactive:f=!1})=>{const g=(0,Me.useMemo)(()=>"boolean"==typeof s&&"function"==typeof i,[s,i]),[v,b]=(0,Me.useState)(!1),y=(0,Me.useRef)(null),{refs:x,floatingStyles:w,context:k}=Ts({open:g?s:v,onOpenChange:g?i:b,placement:t,strategy:m,middleware:[so(p),ao({boundary:u}),io({boundary:u}),co({element:y})],whileElementsMounted:Xr}),j=ks(k,{enabled:!g&&h.includes("click")}),C=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:d=!1,restMs:u=0,move:m=!0}=t,p=Do(),h=Io(),f=Fo(c),g=Fo(l),v=Fo(n),b=Me.useRef(),y=Me.useRef(-1),x=Me.useRef(),w=Me.useRef(-1),k=Me.useRef(!0),j=Me.useRef(!1),C=Me.useRef(()=>{}),S=Me.useRef(!1),E=Me.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]);Me.useEffect(()=>{if(a)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(y.current),clearTimeout(w.current),k.current=!0,S.current=!1)}},[a,s]),Me.useEffect(()=>{if(!a)return;if(!f.current)return;if(!n)return;function e(e){E()&&r(!1,e,"hover")}const t=zn(i.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[i.floating,n,r,a,f,E]);const T=Me.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=zo(g.current,"close",b.current);o&&!x.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(clearTimeout(y.current),r(!1,e,n))},[g,r]),P=po(()=>{C.current(),x.current=void 0}),N=po(()=>{if(j.current){const e=zn(i.floating).body;e.style.pointerEvents="",e.removeAttribute(Vo),j.current=!1}}),R=po(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));Me.useEffect(()=>{if(a&&dn(i.domReference)){var e;const r=i.domReference;return n&&r.addEventListener("mouseleave",l),null==(e=i.floating)||e.addEventListener("mouseleave",l),m&&r.addEventListener("mousemove",t,{once:!0}),r.addEventListener("mouseenter",t),r.addEventListener("mouseleave",s),()=>{var e;n&&r.removeEventListener("mouseleave",l),null==(e=i.floating)||e.removeEventListener("mouseleave",l),m&&r.removeEventListener("mousemove",t),r.removeEventListener("mouseenter",t),r.removeEventListener("mouseleave",s)}}function t(e){if(clearTimeout(y.current),k.current=!1,d&&!Vn(b.current)||u>0&&!zo(g.current,"open"))return;const t=zo(g.current,"open",b.current);t?y.current=window.setTimeout(()=>{v.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function s(e){if(R())return;C.current();const t=zn(i.floating);if(clearTimeout(w.current),S.current=!1,f.current&&o.current.floatingContext){n||clearTimeout(y.current),x.current=f.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){N(),P(),R()||T(e,!0,"safe-polygon")}});const r=x.current;return t.addEventListener("mousemove",r),void(C.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!Rn(i.floating,e.relatedTarget))&&T(e)}function l(e){R()||o.current.floatingContext&&(null==f.current||f.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){N(),P(),R()||T(e)}})(e))}},[i,a,e,d,u,m,T,P,N,r,n,v,p,g,f,o,R]),Eo(()=>{var e;if(a&&n&&null!=(e=f.current)&&e.__options.blockPointerEvents&&E()){j.current=!0;const e=i.floating;if(dn(i.domReference)&&e){var t;const n=zn(i.floating).body;n.setAttribute(Vo,"");const r=i.domReference,o=null==p||null==(t=p.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=""}}}},[a,n,h,i,p,f,E]),Eo(()=>{n||(b.current=void 0,S.current=!1,P(),N())},[n,P,N]),Me.useEffect(()=>()=>{P(),clearTimeout(y.current),clearTimeout(w.current),N()},[a,i.domReference,P,N]);const _=Me.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){k.current||v.current||r(!0,t,"hover")}d&&!Vn(b.current)||n||0===u||S.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(w.current),"touch"===b.current?o():(S.current=!0,w.current=window.setTimeout(o,u)))}}},[d,r,n,v,u]),A=Me.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(e){R()||T(e.nativeEvent,!1)}}),[T,R]);return Me.useMemo(()=>a?{reference:_,floating:A}:{},[a,_,A])}(k,{move:!1,enabled:!g&&h.includes("hover"),...f&&{handleClose:Us()}}),S=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=Me.useRef(!1),d=Me.useRef(),u=Me.useRef(!0);Me.useEffect(()=>{if(!a)return;const e=an(i.domReference);function t(){!n&&un(i.domReference)&&i.domReference===Nn(zn(i.domReference))&&(c.current=!0)}function r(){u.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}},[i.domReference,n,a]),Me.useEffect(()=>{if(a)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,a]),Me.useEffect(()=>()=>{clearTimeout(d.current)},[]);const m=Me.useMemo(()=>({onPointerDown(e){In(e.nativeEvent)||(u.current=!1)},onMouseLeave(){c.current=!1},onFocus(e){if(c.current)return;const t=$n(e.nativeEvent);if(l&&dn(t))try{if(Dn()&&Fn())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!u.current&&!Wn(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){c.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=dn(t)&&t.hasAttribute(Oo("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout(()=>{var e;const a=Nn(i.domReference?i.domReference.ownerDocument:document);(t||a!==i.domReference)&&(Rn(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,a)||Rn(i.domReference,a)||o||r(!1,n,"focus"))})}}),[s,i.domReference,r,l]);return Me.useMemo(()=>a?{reference:m}:{},[a,m])}(k,{enabled:!g&&h.includes("focus")}),E=Es(k),P=Vs(k,{role:"tooltip"}),{getReferenceProps:N,getFloatingProps:R}=_s([j,C,S,E,P]),{isMounted:_,styles:A}=$s(k,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),M={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"}[e],L="dark"===e?"text-tooltip-background-dark":"text-tooltip-background-light";return(0,T.jsxs)(Me.Fragment,{children:[(0,Me.isValidElement)(a)&&(0,T.jsx)(Me.Fragment,{children:(0,Me.cloneElement)(a,{ref:ni(a.ref,x.setReference),className:qt(a.props.className),...N()})},"tooltip-reference"),(0,T.jsx)(ls,{id:d,root:c,children:_&&(0,T.jsxs)("div",{className:qt("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",M,"max-w-80 w-fit",l),ref:x.setFloating,style:{...w,...A},...R(),children:[(0,T.jsxs)("div",{children:[!!n&&(0,T.jsx)("span",{className:"font-semibold",children:n},"tooltip-title"),!!r&&(0,T.jsx)("div",{className:"font-normal",children:r},"tooltip-content")]}),o&&(0,T.jsx)(Ao,{ref:y,context:k,className:qt("fill-current",L)})]})})]})};Ti.displayName="Tooltip";const Pi=({label:e,switchId:t,disabled:n=!1,children:r,size:o})=>{const s={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"},a={xs:"space-y-0.5",sm:"space-y-0.5",md:"space-y-1"};if((0,Me.isValidElement)(e))return(0,T.jsxs)("div",{className:qt("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,T.jsxs)("div",{className:qt("inline-flex",c,"gap-3"),children:[r,(()=>{const{heading:r="",description:l=""}=e||{};return(0,T.jsxs)("div",{className:qt("space-y-0.5",a[o]),children:[r&&(0,T.jsx)(Yt,{htmlFor:t,className:qt("m-0",s[o]),...n&&{variant:"disabled"},children:r}),l&&(0,T.jsx)(Yt,{tag:"p",variant:"help",className:qt("text-sm font-normal leading-5 m-0",i[o]),...n&&{variant:"disabled"},children:l})]})})()]})},Ni=(0,Me.forwardRef)(({id:e,onChange:t,value:n,defaultValue:r=!1,size:o="sm",disabled:s=!1,label:i={heading:"",description:""},name:a,className:l,...c},d)=>{const u="lg"===o?"md":o,m=(0,Me.useMemo)(()=>typeof n<"u",[n]),p=(0,Me.useMemo)(()=>e||`switch-${Hs()}`,[]),[h,f]=(0,Me.useState)(r),g="primary",v=(0,Me.useCallback)(()=>m?n:h,[m,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"}},y={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,T.jsx)(Pi,{label:i,switchId:p,disabled:s,size:u,children:(0,T.jsxs)("div",{className:qt("relative group/switch inline-block cursor-pointer rounded-full shrink-0",y[u].container,l),children:[(0,T.jsx)("input",{ref:d,id:p,type:"checkbox",className:qt("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[g].input,s&&"bg-toggle-off-disabled disabled:border-transparent disabled:cursor-not-allowed checked:disabled:bg-toggle-on-disabled disabled:shadow-toggle-disabled",!s&&{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"}}[g].input),checked:v(),onChange:e=>{if(s)return;const n=e.target.checked;m||f(n),"function"==typeof t&&t(n)},disabled:s,name:a,...c}),(0,T.jsx)("label",{htmlFor:p,className:qt("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",y[u].toggleDial,b[g].toggleDial,s&&"peer-disabled:cursor-not-allowed",!s&&{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"}[u])})]})})});Ni.displayName="Switch";const Ri=(0,Me.createContext)({}),_i=()=>(0,Me.useContext)(Ri),Ai=({children:e,name:t,style:n="simple",size:r="md",value:o,defaultValue:s,by:i="id",as:a="div",onChange:l,className:c,disableGroup:d=!1,vertical:u=!1,columns:m=4,multiSelection:p=!1,gapClassName:h="gap-2"})=>{const f=(0,Me.useMemo)(()=>typeof o<"u",[o]),g=(0,Me.useMemo)(()=>t||`radio-button-group-${Hs()}`,[t]);let v;v=f?o:p?s??[]:s;const[b,y]=(0,Me.useState)(v),x=(0,Me.useCallback)(e=>{if(p)y(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(f||y(e),"function"!=typeof l)return;l(e)}},[l]);c=qt("grid grid-cols-4",Gt[m],h,"tile"===n&&"gap-0",u&&"grid-cols-1",c);const w=qt("tile"===n?"border border-border-subtle border-solid rounded-md shadow-sm":"gap-6",c),k=()=>(0,T.jsx)(Ri.Provider,{value:{name:g,value:f?o:b,by:i,onChange:x,isControlled:f,disableAll:d,style:n,columns:m,multiSelection:p,size:r},children:Me.Children.map(e,e=>(0,Me.isValidElement)(e)?e:null)});return(0,T.jsx)(T.Fragment,{children:"tile"===n?(0,T.jsx)("div",{className:w,children:k()}):(0,T.jsx)(a,{...a===Me.Fragment?{}:{className:c},children:k()})})};Ai.displayName="RadioButton.Group";const Mi=(0,Me.forwardRef)(({id:e,label:t,value:n,children:r,disabled:o,icon:s=null,inlineIcon:i=!1,hideSelection:a=!1,reversePosition:l=!1,borderOn:c=!1,borderOnActive:d=!0,badgeItem:u=null,useSwitch:m=!1,info:p,minWidth:h=!0,...f},g)=>{const{buttonWrapperClasses:v,...b}=f,y=_i(),{name:x,value:w,by:k,onChange:j,disableAll:C,checked:S,multiSelection:E,size:P="md"}=y,N="primary",R=(0,Me.useMemo)(()=>e||`radio-button-${Hs()}`,[e]),_=(0,Me.useMemo)(()=>C||o,[C,o]),A=(0,Me.useMemo)(()=>E?Array.isArray(w)&&w.includes(n):typeof S<"u"?S:typeof w==typeof n&&("string"==typeof w?w===n:Array.isArray(w)?w.includes(n):w[k]===n[k]),[w,n,S]),M=(0,Me.useCallback)(()=>(0,Me.isValidElement)(t)?t:t?.heading?(0,T.jsxs)("div",{className:qt(!i&&{"space-y-3":"sm"===P,"space-y-4":"md"===P},l&&(m?"ml-10":"ml-4"),i&&"flex gap-2",i&&!t.description&&"items-center"),children:[s&&(0,T.jsx)(T.Fragment,{children:s}),(0,T.jsxs)("div",{className:qt(!s||!m||s&&u?{"space-y-0.5":"sm"===P,"space-y-1":"md"===P}:"space-y-0.5"),children:[(0,T.jsx)("p",{className:qt("text-text-primary font-medium m-0",Ci[P],o&&"text-text-disabled cursor-not-allowed"),children:t.heading}),t.description&&(0,T.jsx)("p",{className:"text-text-tertiary text-sm font-normal leading-5 m-0",children:t.description})]})]}):null,[t]);if("tile"===y.style)return(0,T.jsx)(Li,{id:e,label:t,value:n,disabled:o,size:P,children:r});const L=()=>{_||(E?m&&j(n,!A):j(n))};return(0,T.jsxs)("label",{className:qt("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",d&&c&&A&&"outline-border-interactive",{"pl-3.5 pr-2.5 py-2.5":"sm"===P&&!(s&&m),"p-3":"sm"===P&&(s&&m||s&&u),"pl-4 pr-3 py-3":"md"===P&&!(s&&m),"p-4":"md"===P&&(s&&m||s&&u)},"pr-12",_&&"cursor-not-allowed opacity-40",v),htmlFor:R,onClick:L,children:[!!t&&(0,T.jsx)("label",{className:qt("cursor-pointer",_&&"cursor-not-allowed"),htmlFor:R,children:M()}),!!p&&(0,T.jsx)("div",{className:"absolute mr-0.5 bottom-1.5 right-3",children:(0,T.jsx)(Ti,{title:p?.heading,content:p?.description,children:(0,T.jsx)(qs,{className:qt("text-text-primary",Si[P]?.info)})})}),(0,T.jsxs)("label",{className:qt("absolute mr-0.5 right-3 flex items-center cursor-pointer rounded-full gap-2",l&&"left-0",_&&"cursor-not-allowed",i&&"mr-3"),onClick:L,children:[!!u&&u,!a&&(m?(0,T.jsx)(T.Fragment,{children:(0,T.jsx)(Ni,{defaultValue:!1,size:P,onChange:()=>{E?j(n,!A):j(n)},checked:A,...b,"aria-label":t?.heading??"Switch"})}):(0,T.jsxs)("span",{className:"relative p-0.5",children:[(0,T.jsx)("input",{ref:g,id:R,type:E?"checkbox":"radio",className:qt("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",!E&&"rounded-full",ji[N].checkbox,Si[P].checkbox,_&&"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=>j(e.target.value),checked:A,disabled:_,...b}),(0,T.jsx)("span",{className:qt("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",ji[N].icon,_&&"peer-disabled:text-border-disabled cursor-not-allowed"),children:E?(0,T.jsx)(rn,{className:"sm"===P?"size-3":"size-4"}):(0,T.jsx)("div",{className:qt("rounded-full bg-current",Si[P]?.icon)})})]}))]})]})});Mi.displayName="RadioButton.Button";const Li=({id:e,children:t,value:n,disabled:r,size:o="md",...s})=>{const i=_i(),{name:a,value:l,by:c,onChange:d,disableAll:u,checked:m}=i||{},p=(0,Me.useMemo)(()=>e||`radio-button-${Hs()}`,[e]),h=(0,Me.useMemo)(()=>u||r,[u,r]),f=(0,Me.useMemo)(()=>typeof m<"u"?m:typeof l==typeof n&&("string"==typeof l?l===n:Array.isArray(l)?l.includes(n):!(!l||!c)&&l[c]===n[c]),[l,n,m,c]),g=qt("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":"",Ei[o],"border-0 border-r border-border-subtle border-solid");return(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)("button",{type:"button",id:p,"aria-label":"Radio Button",className:qt(g,"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",f&&"bg-button-disabled"),onClick:()=>{d&&d(n)},disabled:h,...s,children:[(0,T.jsx)("input",{type:"hidden",value:n,name:a,checked:f,onChange:e=>d?.(e.target.value)}),t]})})},Ii=Object.assign(Mi,{Group:Ai,Button:Mi});function Di(...e){return M()(e)}(0,E.__)("Pending","suredonation"),(0,E.__)("Processing","suredonation"),(0,E.__)("Completed","suredonation"),(0,E.__)("Failed","suredonation"),(0,E.__)("Refunded","suredonation"),(0,E.__)("Partially Refunded","suredonation"),(0,E.__)("Cancelled","suredonation"),(0,E.__)("One Time","suredonation"),(0,E.__)("Recurring","suredonation"),(0,E.__)("Renewal","suredonation");const Oi=({className:e,cols:t,children:n})=>(0,T.jsx)(Ii.Group,{columns:t??S.Children.count(n),className:Di("gap-3 max-w-fit",e),size:"sm",children:n}),Fi=({label:e,value:t,checked:n,onChange:r,className:o})=>(0,T.jsx)(Ii.Button,{borderOn:!0,borderOnActive:!0,label:{heading:e},buttonWrapperClasses:Di("py-2 pl-2.5 pr-10 max-w-fit min-w-full",n&&"outline-focus",o),onChange:r,value:t,checked:n});Fi.displayName="RadioGroup.Option",Oi.Option=Fi;const Vi=Oi,zi={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"}},Bi={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"}},$i={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"}},Wi={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"}},Ui={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"}},Hi={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"}},qi={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"}},Ki={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"}},Gi={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"}},Yi={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"}},Xi={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"}},Zi={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"}},Ji={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"}},Qi={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"}},ea={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"}},ta={sm:{0:"grow-0",1:"grow"},md:{0:"md:grow-0",1:"md:grow"},lg:{0:"lg:grow-0",1:"lg:grow"}},na={sm:{0:"shrink-0",1:"shrink"},md:{0:"md:shrink-0",1:"md:shrink"},lg:{0:"lg:shrink-0",1:"lg:shrink"}},ra=(e,t,n,r="sm")=>{const o=[];switch(typeof e){case"object":for(const[r,s]of Object.entries(e))t[r]&&o.push(t?.[r]?.[s]??t?.[r]?.[n?.[r]]??"");break;case"string":case"number":const s=r;o.push(t?.[s]?.[e]??t?.[s]?.[n?.[s]]??"");break;default:if(void 0===e)break;o.push(t?.[r]?.[n]??"")}return o.join(" ")},oa=({className:e,cols:t,gap:n,gapX:r,gapY:o,align:s,justify:i,gridFlow:a,colsSubGrid:l=!1,rowsSubGrid:c=!1,autoRows:d=!1,autoCols:u=!1,children:m,...p})=>{const h=ra(t,zi,1),f=ra(n,Bi,"sm"),g=ra(r,$i,""),v=ra(o,Wi,""),b=ra(s,Gi,""),y=ra(i,Ki,""),x=ra(a,qi,"");return(0,T.jsx)("div",{className:qt("grid",{"grid-cols-subgrid":l,"grid-rows-subgrid":c,"auto-cols-auto":u,"auto-rows-auto":d},h,f,g,v,b,y,x,e),...p,children:m})};oa.Item=({className:e,children:t,colSpan:n,colStart:r,alignSelf:o,justifySelf:s,...i})=>{const a=ra(n,Ui,0),l=ra(r,Hi,0),c=ra(o,Yi,""),d=ra(s,Xi,"");return(0,T.jsx)("div",{className:qt(a,l,c,d,e),...i,children:t})};const sa=(0,Me.createContext)({}),ia=({containerType:e="flex",gap:t="sm",gapX:n,gapY:r,direction:o,justify:s,align:i,wrap:a,cols:l,className:c,children:d,...u})=>{if("grid"===e)return(0,T.jsx)(sa.Provider,{value:{containerType:e},children:(0,T.jsx)(oa,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:d,align:i,justify:s,...u})});const m=ra(a,Ji,""),p=ra(t,Bi,"sm"),h=ra(n,$i,""),f=ra(r,Wi,""),g=ra(o,Zi,""),v=ra(s,Ki,""),b=ra(i,Gi,""),y=qt("flex",m,p,h,f,g,v,b,c);return(0,T.jsx)(sa.Provider,{value:{containerType:e,cols:l},children:"flex"===e?(0,T.jsx)("div",{className:y,children:d}):(0,T.jsx)(oa,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:d,align:i,justify:s,...u})})},aa=({grow:e,shrink:t,order:n,alignSelf:r,justifySelf:o,className:s,children:i,...a})=>{const{containerType:l,cols:c}=(0,Me.useContext)(sa);if("grid"===l)return(0,T.jsx)(oa.Item,{className:s,alignSelf:r,justifySelf:o,children:i,...a});const d=ra(r,Yi,""),u=ra(o,Xi,""),m=ra(e,ta,0),p=ra(t,na,0),h=ra(n,ea,0),f=ra(c,Qi,1);return(0,T.jsx)("div",{className:qt("box-border",m,p,h,d,u,f,s),children:i})};ia.Item=aa,ia.displayName="Container",aa.displayName="Container.Item";const la=({title:e="",description:t="",icon:n=null,iconPosition:r="right",tag:o="h2",size:s="sm",className:i=""})=>{const a={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,T.jsx)(o,{className:qt("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"}[s]),children:e});return t?(0,T.jsxs)("div",{className:i,children:[(0,T.jsxs)("div",{children:[n&&"left"===r&&(0,T.jsxs)("div",{className:qt("flex items-center",a[s]),children:[n,l()]}),n&&"right"===r&&(0,T.jsxs)("div",{className:qt("flex items-center",a[s]),children:[l(),n]}),!n&&l()]}),(0,T.jsx)("p",{className:qt("text-text-secondary font-normal my-0",{xs:"text-sm",sm:"text-sm",md:"text-base",lg:"text-base"}[s]),children:t})]}):(0,T.jsxs)("div",{className:i,children:[n&&"left"===r&&(0,T.jsxs)("div",{className:qt("flex items-center",a[s]),children:[n,l()]}),n&&"right"===r&&(0,T.jsxs)("div",{className:qt("flex items-center",a[s]),children:[l(),n]}),!n&&l()]})},ca=ze("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),da=({children:e,title:t,className:n,onClickSave:r,onClickCancel:o,saveBtnDisabled:s=!1,isSaving:i=!1,showTitleHelpText:a=!1,titleHelpText:l=""})=>(0,T.jsxs)("div",{className:"pb-8 space-y-7",children:[(0,T.jsxs)(ia,{align:"center",justify:"between",children:[(0,T.jsxs)(ia,{className:"gap-0",direction:"column",children:[(0,T.jsx)(ia.Item,{className:"flex items-center gap-2",children:(0,T.jsx)(la,{tag:"h4",title:t,size:"md"})}),a&&(0,T.jsx)(ia.Item,{children:(0,T.jsx)(Yt,{size:"sm",variant:"help",className:"text-text-on-button-disabled font-normal",children:l})})]}),(r||o)&&(0,T.jsxs)(ia,{align:"center",className:"gap-3",children:[r&&(0,T.jsx)(Ys,{size:"md",onClick:r,variant:"primary",disabled:s,iconPosition:"right",icon:i?(0,T.jsx)(ca,{className:"animate-spin size-4"}):null,children:i?(0,E.__)("Saving","suredonation"):(0,E.__)("Save","suredonation")}),o&&(0,T.jsx)(Ys,{size:"md",onClick:o,variant:"outline",children:(0,E.__)("Cancel","suredonation")})]})]}),(0,T.jsx)("div",{className:Di("bg-background-primary rounded-xl p-4 shadow-sm",n),children:e})]}),ua=(0,Me.createContext)({}),ma=(0,Me.createContext)(null),pa="undefined"!=typeof window,ha=pa?Me.useLayoutEffect:Me.useEffect,fa=e=>e,ga=["read","resolveKeyframes","update","preRender","render","postRender"];function va(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=ga.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const s=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(t){s.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const a=i&&r?t:n;return o&&s.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),s.delete(e)},process:e=>{i=e,r?o=!0:(r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,o&&(o=!1,l.process(e)))}};return l}(s),e),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:m}=i,p=()=>{const s=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(s-o.timestamp,40),1),o.timestamp=s,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),d.process(o),u.process(o),m.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))};return{schedule:ga.reduce((t,s)=>{const a=i[s];return t[s]=(t,s=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(p)),a.schedule(t,s,i)),t},{}),cancel:e=>{for(let t=0;t<ga.length;t++)i[ga[t]].cancel(e)},state:o,steps:i}}const{schedule:ba,cancel:ya,state:xa,steps:wa}=va("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:fa,!0);const ka=e=>!e.isLayoutDirty&&e.willUpdate(!1);function ja(){const e=new Set,t=new WeakMap,n=()=>e.forEach(ka);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 Ca=e=>!0===e,Sa=({children:e,id:t,inherit:n=!0})=>{const r=(0,Me.useContext)(ua),o=(0,Me.useContext)(ma),[s,i]=function(){const e=function(){const e=(0,Me.useRef)(!1);return ha(()=>(e.current=!0,()=>{e.current=!1}),[]),e}(),[t,n]=(0,Me.useState)(0),r=(0,Me.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,Me.useCallback)(()=>ba.postRender(r),[r]),t]}(),a=(0,Me.useRef)(null),l=r.id||o;null===a.current&&((e=>Ca(!0===e)||"id"===e)(n)&&l&&(t=t?l+"-"+t:l),a.current={id:t,group:Ca(n)&&r.group||ja()});const c=(0,Me.useMemo)(()=>({...a.current,forceRender:s}),[i]);return(0,T.jsx)(ua.Provider,{value:c,children:e})};function Ea(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 Ta(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Pa=e=>Array.isArray(e);function Na(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 Ra(e){return"string"==typeof e||Array.isArray(e)}function _a(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Aa(e,t,n,r){if("function"==typeof t){const[o,s]=_a(r);t=t(void 0!==n?n:e.custom,o,s)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,s]=_a(r);t=t(void 0!==n?n:e.custom,o,s)}return t}function Ma(e,t,n){const r=e.getProps();return Aa(r,t,void 0!==n?n:r.custom,e)}const La=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ia=["initial",...La];function Da(e){let t;return()=>(void 0===t&&(t=e()),t)}const Oa=Da(()=>void 0!==window.ScrollTimeline);class Fa{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 Va extends Fa{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function za(e,t){return e?e[t]||e.default||e:void 0}const Ba=2e4;function $a(e){let t=0,n=e.next(t);for(;!n.done&&t<Ba;)t+=50,n=e.next(t);return t>=Ba?1/0:t}function Wa(e){return"function"==typeof e}function Ua(e,t){e.timeline=t,e.onfinish=null}const Ha=e=>Array.isArray(e)&&"number"==typeof e[0],qa={linearEasing:void 0};function Ka(e,t){const n=Da(e);return()=>{var e;return null!==(e=qa[t])&&void 0!==e?e:n()}}const Ga=Ka(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),Ya=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Xa=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let t=0;t<o;t++)r+=e(Ya(0,o-1,t))+", ";return`linear(${r.substring(0,r.length-2)})`};function Za(e){return Boolean("function"==typeof e&&Ga()||!e||"string"==typeof e&&(e in Qa||Ga())||Ha(e)||Array.isArray(e)&&e.every(Za))}const Ja=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Qa={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ja([0,.65,.55,1]),circOut:Ja([.55,0,1,.45]),backIn:Ja([.31,.01,.66,-.59]),backOut:Ja([.33,1.53,.69,.99])};function el(e,t){return e?"function"==typeof e&&Ga()?Xa(e,t):Ha(e)?Ja(e):Array.isArray(e)?e.map(e=>el(e,t)||Qa.easeOut):Qa[e]:void 0}const tl={x:!1,y:!1};function nl(){return tl.x||tl.y}function rl(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 ol(e){return t=>{"touch"===t.pointerType||nl()||e(t)}}const sl=(e,t)=>!!t&&(e===t||sl(e,t.parentElement)),il=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,al=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),ll=new WeakSet;function cl(e){return t=>{"Enter"===t.key&&e(t)}}function dl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function ul(e){return il(e)&&!nl()}const ml=e=>1e3*e,pl=e=>e/1e3,hl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fl=new Set(hl),gl=new Set(["width","height","top","left","right","bottom",...hl]),vl=e=>Pa(e)?e[e.length-1]||0:e;let bl;function yl(){bl=void 0}const xl={now:()=>(void 0===bl&&xl.set(xa.isProcessing?xa.timestamp:performance.now()),bl),set:e=>{bl=e,queueMicrotask(yl)}};function wl(e,t){-1===e.indexOf(t)&&e.push(t)}function kl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class jl{constructor(){this.subscriptions=[]}add(e){return wl(this.subscriptions,e),()=>kl(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 Cl(e,t){return t?e*(1e3/t):0}const Sl={current:void 0};class El{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=xl.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){var t;this.current=e,this.updatedAt=xl.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}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 jl);const n=this.events[e].add(t);return"change"===e?()=>{n(),ba.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 Sl.current&&Sl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=xl.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Cl(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 Tl(e,t){return new El(e,t)}function Pl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Tl(n))}const Nl=e=>Boolean(e&&e.getVelocity);function Rl(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Nl(r)&&r.add))return n.add(t);var r}const _l=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Al="data-"+_l("framerAppearId");function Ml(e){return e.props[Al]}const Ll=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Il(e,t,n,r){if(e===t&&n===r)return fa;return o=>0===o||1===o?o:Ll(function(e,t,n,r,o){let s,i,a=0;do{i=t+(n-t)/2,s=Ll(i,r,o)-e,s>0?n=i:t=i}while(Math.abs(s)>1e-7&&++a<12);return i}(o,0,1,e,n),t,r)}const Dl=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ol=e=>t=>1-e(1-t),Fl=Il(.33,1.53,.69,.99),Vl=Ol(Fl),zl=Dl(Vl),Bl=e=>(e*=2)<1?.5*Vl(e):.5*(2-Math.pow(2,-10*(e-1))),$l=e=>1-Math.sin(Math.acos(e)),Wl=Ol($l),Ul=Dl($l),Hl=e=>/^0[^.\s]+$/u.test(e);function ql(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||Hl(e)}const Kl=(e,t,n)=>n>t?t:n<e?e:n,Gl={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Yl={...Gl,transform:e=>Kl(0,1,e)},Xl={...Gl,default:1},Zl=e=>Math.round(1e5*e)/1e5,Jl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Ql=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ec=(e,t)=>n=>Boolean("string"==typeof n&&Ql.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),tc=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,s,i,a]=r.match(Jl);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:void 0!==a?parseFloat(a):1}},nc={...Gl,transform:e=>Math.round((e=>Kl(0,255,e))(e))},rc={test:ec("rgb","red"),parse:tc("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+nc.transform(e)+", "+nc.transform(t)+", "+nc.transform(n)+", "+Zl(Yl.transform(r))+")"},oc={test:ec("#"),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:rc.transform},sc=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ic=sc("deg"),ac=sc("%"),lc=sc("px"),cc=sc("vh"),dc=sc("vw"),uc={...ac,parse:e=>ac.parse(e)/100,transform:e=>ac.transform(100*e)},mc={test:ec("hsl","hue"),parse:tc("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ac.transform(Zl(t))+", "+ac.transform(Zl(n))+", "+Zl(Yl.transform(r))+")"},pc={test:e=>rc.test(e)||oc.test(e)||mc.test(e),parse:e=>rc.test(e)?rc.parse(e):mc.test(e)?mc.parse(e):oc.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?rc.transform(e):mc.transform(e)},hc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,fc="number",gc="color",vc=/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 bc(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const i=t.replace(vc,e=>(pc.test(e)?(r.color.push(s),o.push(gc),n.push(pc.parse(e))):e.startsWith("var(")?(r.var.push(s),o.push("var"),n.push(e)):(r.number.push(s),o.push(fc),n.push(parseFloat(e))),++s,"${}")).split("${}");return{values:n,split:i,indexes:r,types:o}}function yc(e){return bc(e).values}function xc(e){const{split:t,types:n}=bc(e),r=t.length;return e=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],void 0!==e[s]){const t=n[s];o+=t===fc?Zl(e[s]):t===gc?pc.transform(e[s]):e[s]}return o}}const wc=e=>"number"==typeof e?0:e,kc={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Jl))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(hc))||void 0===n?void 0:n.length)||0)>0},parse:yc,createTransformer:xc,getAnimatableNone:function(e){const t=yc(e);return xc(e)(t.map(wc))}},jc=new Set(["brightness","contrast","saturate","opacity"]);function Cc(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Jl)||[];if(!r)return e;const o=n.replace(r,"");let s=jc.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const Sc=/\b([a-z-]*)\(.*?\)/gu,Ec={...kc,getAnimatableNone:e=>{const t=e.match(Sc);return t?t.map(Cc).join(" "):e}},Tc={borderWidth:lc,borderTopWidth:lc,borderRightWidth:lc,borderBottomWidth:lc,borderLeftWidth:lc,borderRadius:lc,radius:lc,borderTopLeftRadius:lc,borderTopRightRadius:lc,borderBottomRightRadius:lc,borderBottomLeftRadius:lc,width:lc,maxWidth:lc,height:lc,maxHeight:lc,top:lc,right:lc,bottom:lc,left:lc,padding:lc,paddingTop:lc,paddingRight:lc,paddingBottom:lc,paddingLeft:lc,margin:lc,marginTop:lc,marginRight:lc,marginBottom:lc,marginLeft:lc,backgroundPositionX:lc,backgroundPositionY:lc},Pc={rotate:ic,rotateX:ic,rotateY:ic,rotateZ:ic,scale:Xl,scaleX:Xl,scaleY:Xl,scaleZ:Xl,skew:ic,skewX:ic,skewY:ic,distance:lc,translateX:lc,translateY:lc,translateZ:lc,x:lc,y:lc,z:lc,perspective:lc,transformPerspective:lc,opacity:Yl,originX:uc,originY:uc,originZ:lc},Nc={...Gl,transform:Math.round},Rc={...Tc,...Pc,zIndex:Nc,size:lc,fillOpacity:Yl,strokeOpacity:Yl,numOctaves:Nc},_c={...Rc,color:pc,backgroundColor:pc,outlineColor:pc,fill:pc,stroke:pc,borderColor:pc,borderTopColor:pc,borderRightColor:pc,borderBottomColor:pc,borderLeftColor:pc,filter:Ec,WebkitFilter:Ec},Ac=e=>_c[e];function Mc(e,t){let n=Ac(e);return n!==Ec&&(n=kc),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Lc=new Set(["auto","none","0"]),Ic=e=>e===Gl||e===lc,Dc=(e,t)=>parseFloat(e.split(", ")[t]),Oc=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Dc(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Dc(t[1],e):0}},Fc=new Set(["x","y","z"]),Vc=hl.filter(e=>!Fc.has(e)),zc={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:Oc(4,13),y:Oc(5,14)};zc.translateX=zc.x,zc.translateY=zc.y;const Bc=new Set;let $c=!1,Wc=!1;function Uc(){if(Wc){const e=Array.from(Bc).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 Vc.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)})}Wc=!1,$c=!1,Bc.forEach(e=>e.complete()),Bc.clear()}function Hc(){Bc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Wc=!0)})}class qc{constructor(e,t,n,r,o,s=!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=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Bc.add(this),$c||($c=!0,ba.read(Hc),ba.resolveKeyframes(Uc))):(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(),s=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,s);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=s),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),Bc.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Bc.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let Kc=fa,Gc=fa;const Yc=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Xc=e=>t=>"string"==typeof t&&t.startsWith(e),Zc=Xc("--"),Jc=Xc("var(--"),Qc=e=>!!Jc(e)&&ed.test(e.split("/*")[0].trim()),ed=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,td=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function nd(e,t,n=1){Gc(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=td.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const e=s.trim();return Yc(e)?parseFloat(e):e}return Qc(o)?nd(o,t,n+1):o}const rd=e=>t=>t.test(e),od=[Gl,lc,ac,ic,dc,cc,{test:e=>"auto"===e,parse:e=>e}],sd=e=>od.find(rd(e));class id extends qc{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(),Qc(r))){const o=nd(r,t.current);void 0!==o&&(e[n]=o),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!gl.has(n)||2!==e.length)return;const[r,o]=e,s=sd(r),i=sd(o);if(s!==i)if(Ic(s)&&Ic(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++)ql(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&&!Lc.has(t)&&bc(t).values.length&&(r=e[o]),o++}if(r&&n)for(const o of t)e[o]=Mc(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=zc[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 s=r.length-1,i=r[s];r[s]=zc[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 ad=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!kc.test(e)&&"0"!==e||e.startsWith("url(")));function ld(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const s=e[e.length-1],i=ad(o,t),a=ad(s,t);return Kc(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!(!i||!a)&&(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||Wa(n))&&r)}const cd=e=>null!==e;function dd(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(cd),s=t&&"loop"!==n&&t%2==1?0:o.length-1;return s&&void 0!==r?r:o[s]}class ud{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=xl.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Hc(),Uc()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=xl.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:s,onComplete:i,onUpdate:a,isGenerator:l}=this.options;if(!l&&!ld(e,n,r,o)){if(!s)return a&&a(dd(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 md=(e,t,n)=>e+(t-e)*n;function pd(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 hd(e,t){return n=>n>0?t:e}const fd=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},gd=[oc,rc,mc];function vd(e){const t=(n=e,gd.find(e=>e.test(n)));var n;if(Kc(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===mc&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,s=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=pd(a,r,e+1/3),s=pd(a,r,e),i=pd(a,r,e-1/3)}else o=s=i=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*i),alpha:r}}(r)),r}const bd=(e,t)=>{const n=vd(e),r=vd(t);if(!n||!r)return hd(e,t);const o={...n};return e=>(o.red=fd(n.red,r.red,e),o.green=fd(n.green,r.green,e),o.blue=fd(n.blue,r.blue,e),o.alpha=md(n.alpha,r.alpha,e),rc.transform(o))},yd=(e,t)=>n=>t(e(n)),xd=(...e)=>e.reduce(yd),wd=new Set(["none","hidden"]);function kd(e,t){return n=>md(e,t,n)}function jd(e){return"number"==typeof e?kd:"string"==typeof e?Qc(e)?hd:pc.test(e)?bd:Ed:Array.isArray(e)?Cd:"object"==typeof e?pc.test(e)?bd:Sd:hd}function Cd(e,t){const n=[...e],r=n.length,o=e.map((e,n)=>jd(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function Sd(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=jd(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Ed=(e,t)=>{const n=kc.createTransformer(t),r=bc(e),o=bc(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?wd.has(e)&&!o.values.length||wd.has(t)&&!r.values.length?function(e,t){return wd.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):xd(Cd(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],a=e.indexes[i][o[i]],l=null!==(n=e.values[a])&&void 0!==n?n:0;r[s]=l,o[i]++}return r}(r,o),o.values),n):(Kc(!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.`),hd(e,t))};function Td(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?md(e,t,n):jd(e)(e,t)}function Pd(e,t,n){const r=Math.max(t-5,0);return Cl(n-e(r),t-r)}const Nd=.01,Rd=2,_d=.005,Ad=.5;const Md=12;function Ld(e,t){return e*Math.sqrt(1-t*t)}const Id=["duration","bounce"],Dd=["stiffness","damping","mass"];function Od(e,t){return t.some(t=>void 0!==e[t])}function Fd(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:u,velocity:m,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Od(e,Dd)&&Od(e,Id))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),o=r*r,s=2*Kl(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:1,stiffness:o,damping:s}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:r=1}){let o,s;Kc(e<=ml(10),"Spring duration must be 10 seconds or less");let i=1-t;i=Kl(.05,1,i),e=Kl(.01,10,pl(e)),i<1?(o=t=>{const r=t*i,o=r*e;return.001-(r-n)/Ld(t,i)*Math.exp(-o)},s=t=>{const r=t*i*e,s=r*n+n,a=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Ld(Math.pow(t,2),i);return(.001-o(t)>0?-1:1)*((s-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,s=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n<Md;n++)r-=e(r)/t(r);return r}(o,s,5/e);if(e=ml(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,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:-pl(n.velocity||0)}),h=m||0,f=c/(2*Math.sqrt(l*d)),g=i-s,v=pl(Math.sqrt(l/d)),b=Math.abs(g)<5;let y;if(r||(r=b?Nd:Rd),o||(o=b?_d:Ad),f<1){const e=Ld(v,f);y=t=>{const n=Math.exp(-f*v*t);return i-n*((h+f*v*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===f)y=e=>i-Math.exp(-v*e)*(g+(h+v*g)*e);else{const e=v*Math.sqrt(f*f-1);y=t=>{const n=Math.exp(-f*v*t),r=Math.min(e*t,300);return i-n*((h+f*v*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const x={calculatedDuration:p&&u||null,next:e=>{const t=y(e);if(p)a.done=e>=u;else{let n=0;f<1&&(n=0===e?ml(h):Pd(y,e,t));const s=Math.abs(n)<=r,l=Math.abs(i-t)<=o;a.done=s&&l}return a.value=a.done?i:t,a},toString:()=>{const e=Math.min($a(x),Ba),t=Xa(t=>x.next(e*t).value,e,30);return e+"ms "+t}};return x}function Vd({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],m={done:!1,value:u},p=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let h=n*t;const f=u+h,g=void 0===i?f:i(f);g!==f&&(h=g-u);const v=e=>-h*Math.exp(-e/r),b=e=>g+v(e),y=e=>{const t=v(e),n=b(e);m.done=Math.abs(t)<=c,m.value=m.done?g:n};let x,w;const k=e=>{var t;t=m.value,(void 0!==a&&t<a||void 0!==l&&t>l)&&(x=e,w=Fd({keyframes:[m.value,p(m.value)],velocity:Pd(b,e,m.value),damping:o,stiffness:s,restDelta:c,restSpeed:d}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,y(e),k(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&y(e),m)}}}const zd=Il(.42,0,1,1),Bd=Il(0,0,.58,1),$d=Il(.42,0,.58,1),Wd={linear:fa,easeIn:zd,easeInOut:$d,easeOut:Bd,circIn:$l,circInOut:Ul,circOut:Wl,backIn:Vl,backInOut:zl,backOut:Fl,anticipate:Bl},Ud=e=>{if(Ha(e)){Gc(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Il(t,n,r,o)}return"string"==typeof e?(Gc(void 0!==Wd[e],`Invalid easing type '${e}'`),Wd[e]):e};function Hd({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Ud):Ud(r),s={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=Ya(0,t,r);e.push(md(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(Gc(s===t.length,"Both input and output ranges must be the same length"),1===s)return()=>t[0];if(2===s&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const r=[],o=n||Td,s=e.length-1;for(let n=0;n<s;n++){let s=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||fa:t;s=xd(e,s)}r.push(s)}return r}(t,r,o),l=a.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=Ya(e[r],e[r+1],n);return a[r](o)};return n?t=>c(Kl(e[0],e[s-1],t)):c}(i,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map(()=>c||$d).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(s.value=a(t),s.done=t>=e,s)}}const qd=e=>{const t=({timestamp:t})=>e(t);return{start:()=>ba.update(t,!0),stop:()=>ya(t),now:()=>xa.isProcessing?xa.timestamp:xl.now()}},Kd={decay:Vd,inertia:Vd,tween:Hd,keyframes:Hd,spring:Fd},Gd=e=>e/100;class Yd extends ud{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,s=(null==r?void 0:r.KeyframeResolver)||qc;this.resolver=new s(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:s=0}=this.options,i=Wa(t)?t:Kd[t]||Hd;let a,l;i!==Hd&&"number"!=typeof e[0]&&(a=xd(Gd,Td(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-s})),null===c.calculatedDuration&&(c.calculatedDuration=$a(c));const{calculatedDuration:d}=c,u=d+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:d,resolvedDuration:u,totalDuration:u*(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:s,mapPercentToKeyframes:i,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:d}=n;if(null===this.startTime)return o.next(0);const{delay:u,repeat:m,repeatType:p,repeatDelay:h,onUpdate:f}=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-u*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let b=this.currentTime,y=o;if(m){const e=Math.min(this.currentTime,c)/d;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,m+1),Boolean(t%2)&&("reverse"===p?(n=1-n,h&&(n-=h/d)):"mirror"===p&&(y=s)),b=Kl(0,1,n)*d}const x=v?{done:!1,value:a[0]}:y.next(b);i&&(x.value=i(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const k=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return k&&void 0!==r&&(x.value=dd(a,this.options,r)),f&&f(x.value),k&&this.finish(),x}get duration(){const{resolved:e}=this;return e?pl(e.calculatedDuration):0}get time(){return pl(this.currentTime)}set time(e){e=ml(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=pl(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=qd,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 Xd=new Set(["opacity","clipPath","filter","transform"]),Zd=Da(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Jd={anticipate:Bl,backInOut:zl,circInOut:Ul};class Qd extends ud{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new id(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:s,motionValue:i,name:a,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&Ga()&&o in Jd&&(o=Jd[o]),function(e){return Wa(e.type)||"spring"===e.type||!Za(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:a,element:l,...c}=this.options,d=function(e,t){const n=new Yd({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let s=0;for(;!r.done&&s<2e4;)r=n.sample(s),o.push(r.value),s+=10;return{times:void 0,keyframes:o,duration:s-10,ease:"linear"}}(e,c);1===(e=d.keyframes).length&&(e[1]=e[0]),n=d.duration,r=d.times,o=d.ease,s="keyframes"}const c=function(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const d=el(a,o);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:"reverse"===i?"alternate":"normal"})}(i.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(Ua(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;i.set(dd(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:r,type:s,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return pl(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return pl(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=ml(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 fa;const{animation:n}=t;Ua(n,e)}else this.pendingTimeline=e;return fa}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:s,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,d=new Yd({...c,keyframes:n,duration:r,type:o,ease:s,times:i,isGenerator:!0}),u=ml(this.time);e.setWithVelocity(d.sample(u-10).value,d.sample(u).value,10)}const{onStop:a}=this.options;a&&a(),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:s,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:l}=t.owner.getProps();return Zd()&&n&&Xd.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==s&&"inertia"!==i}}const eu={type:"spring",stiffness:500,damping:25,restSpeed:10},tu={type:"keyframes",duration:.8},nu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ru=(e,{keyframes:t})=>t.length>2?tu:fl.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:eu:nu,ou=(e,t,n,r={},o,s)=>i=>{const a=za(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=ml(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length})(a)||(d={...d,...ru(e,d)}),d.duration&&(d.duration=ml(d.duration)),d.repeatDelay&&(d.repeatDelay=ml(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let u=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(u=!0)),u&&!s&&void 0!==t.get()){const e=dd(d.keyframes,a);if(void 0!==e)return ba.update(()=>{d.onUpdate(e),d.onComplete()}),new Va([])}return!s&&Qd.supports(d)?new Qd(d):new Yd(d)};function su({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function iu(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(s=e.latestValues[t])&&void 0!==s?s:null),o=l[t];if(void 0===o||d&&su(d,t))continue;const a={delay:n,...za(i||{},t)};let u=!1;if(window.MotionHandoffAnimation){const n=Ml(e);if(n){const e=window.MotionHandoffAnimation(n,t,ba);null!==e&&(a.startTime=e,u=!0)}}Rl(e,t),r.start(ou(t,r,o,e.shouldReduceMotion&&gl.has(t)?{type:!1}:a,e,u));const m=r.animation;m&&c.push(m)}return a&&Promise.all(c).then(()=>{ba.update(()=>{a&&function(e,t){const n=Ma(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const t in s)Pl(e,t,vl(s[t]))}(e,a)})}),c}function au(e,t,n={}){var r;const o=Ma(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>Promise.all(iu(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:a}=s;return function(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(lu).forEach((e,r)=>{e.notify("AnimationStart",t),i.push(au(e,t,{...s,delay:n+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+r,i,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[e,t]="beforeChildren"===l?[i,a]:[a,i];return e().then(()=>t())}return Promise.all([i(),a(n.delay)])}function lu(e,t){return e.sortNodePosition(t)}const cu=Ia.length;function du(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&du(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<cu;n++){const r=Ia[n],o=e.props[r];(Ra(o)||!1===o)&&(t[r]=o)}return t}const uu=[...La].reverse(),mu=La.length;function pu(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=>au(e,t,n));r=Promise.all(o)}else if("string"==typeof t)r=au(e,t,n);else{const o="function"==typeof t?Ma(e,t,n.custom):t;r=Promise.all(iu(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=gu(),r=!0;const o=t=>(n,r)=>{var o;const s=Ma(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(s){const{transition:e,transitionEnd:t,...r}=s;n={...n,...r,...t}}return n};function s(s){const{props:i}=e,a=du(e.parent)||{},l=[],c=new Set;let d={},u=1/0;for(let t=0;t<mu;t++){const m=uu[t],p=n[m],h=void 0!==i[m]?i[m]:a[m],f=Ra(h),g=m===s?p.isActive:null;!1===g&&(u=t);let v=h===a[m]&&h!==i[m]&&f;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),p.protectedKeys={...d},!p.isActive&&null===g||!h&&!p.prevProp||Ta(h)||"boolean"==typeof h)continue;const b=hu(p.prevProp,h);let y=b||m===s&&p.isActive&&!v&&f||t>u&&f,x=!1;const w=Array.isArray(h)?h:[h];let k=w.reduce(o(m),{});!1===g&&(k={});const{prevResolvedValues:j={}}=p,C={...j,...k},S=t=>{y=!0,c.has(t)&&(x=!0,c.delete(t)),p.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in C){const t=k[e],n=j[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Pa(t)&&Pa(n)?!Na(t,n):t!==n,r?null!=t?S(e):c.add(e):void 0!==t&&c.has(e)?S(e):p.protectedKeys[e]=!0}p.prevProp=h,p.prevResolvedValues=k,p.isActive&&(d={...d,...k}),r&&e.blockInitialAnimation&&(y=!1),y&&(!v||!b||x)&&l.push(...w.map(e=>({animation:e,options:{type:m}})))}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 m=Boolean(l.length);return!r||!1!==i.initial&&i.initial!==i.animate||e.manuallyAnimateOnMount||(m=!1),r=!1,m?t(l):Promise.resolve()}return{animateChanges:s,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=s(t);for(const e in n)n[e].protectedKeys={};return i},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=gu(),r=!0}}}function hu(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Na(t,e)}function fu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gu(){return{animate:fu(!0),whileInView:fu(),whileHover:fu(),whileTap:fu(),whileDrag:fu(),whileFocus:fu(),exit:fu()}}class vu{constructor(e){this.isMounted=!1,this.node=e}update(){}}let bu=0;const yu={animation:{Feature:class extends vu{constructor(e){super(e),e.animationState||(e.animationState=pu(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ta(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 vu{constructor(){super(...arguments),this.id=bu++}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 xu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function wu(e){return{point:{x:e.pageX,y:e.pageY}}}function ku(e,t,n,r){return xu(e,t,(e=>t=>il(t)&&e(t,wu(t)))(n),r)}const ju=(e,t)=>Math.abs(e-t);class Cu{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=Tu(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=ju(e.x,t.x),r=ju(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}=xa;this.history.push({...r,timestamp:o});const{onStart:s,onMove:i}=this.handlers;t||(s&&s(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Su(t,this.transformPagePoint),ba.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 s=Tu("pointercancel"===e.type?this.lastMoveEventInfo:Su(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,s),r&&r(e,s)},!il(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const s=Su(wu(e),this.transformPagePoint),{point:i}=s,{timestamp:a}=xa;this.history=[{...i,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Tu(s,this.history)),this.removeListeners=xd(ku(this.contextWindow,"pointermove",this.handlePointerMove),ku(this.contextWindow,"pointerup",this.handlePointerUp),ku(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ya(this.updatePoint)}}function Su(e,t){return t?{point:t(e.point)}:e}function Eu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tu({point:e},t){return{point:e,delta:Eu(e,Nu(t)),offset:Eu(e,Pu(t)),velocity:Ru(t,.1)}}function Pu(e){return e[0]}function Nu(e){return e[e.length-1]}function Ru(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Nu(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>ml(t)));)n--;if(!r)return{x:0,y:0};const s=pl(o.timestamp-r.timestamp);if(0===s)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function _u(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Au(e){return e.max-e.min}function Mu(e,t,n,r=.5){e.origin=r,e.originPoint=md(t.min,t.max,e.origin),e.scale=Au(n)/Au(t),e.translate=md(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 Lu(e,t,n,r){Mu(e.x,t.x,n.x,r?r.originX:void 0),Mu(e.y,t.y,n.y,r?r.originY:void 0)}function Iu(e,t,n){e.min=n.min+t.min,e.max=e.min+Au(t)}function Du(e,t,n){e.min=t.min-n.min,e.max=e.min+Au(t)}function Ou(e,t,n){Du(e.x,t.x,n.x),Du(e.y,t.y,n.y)}function Fu(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 Vu(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 zu=.35;function Bu(e,t,n){return{min:$u(e,t),max:$u(e,n)}}function $u(e,t){return"number"==typeof e?e:e[t]||0}const Wu=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Uu(e){return[e("x"),e("y")]}function Hu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function qu(e){return void 0===e||1===e}function Ku({scale:e,scaleX:t,scaleY:n}){return!qu(e)||!qu(t)||!qu(n)}function Gu(e){return Ku(e)||Yu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yu(e){return Xu(e.x)||Xu(e.y)}function Xu(e){return e&&"0%"!==e}function Zu(e,t,n){return n+t*(e-n)}function Ju(e,t,n,r,o){return void 0!==o&&(e=Zu(e,o,r)),Zu(e,n,r)+t}function Qu(e,t=0,n=1,r,o){e.min=Ju(e.min,t,n,r,o),e.max=Ju(e.max,t,n,r,o)}function em(e,{x:t,y:n}){Qu(e.x,t.translate,t.scale,t.originPoint),Qu(e.y,n.translate,n.scale,n.originPoint)}const tm=.999999999999,nm=1.0000000000001;function rm(e,t){e.min=e.min+t,e.max=e.max+t}function om(e,t,n,r,o=.5){Qu(e,t,n,md(e.min,e.max,o),r)}function sm(e,t){om(e.x,t.x,t.scaleX,t.scale,t.originX),om(e.y,t.y,t.scaleY,t.scale,t.originY)}function im(e,t){return Hu(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 am=({current:e})=>e?e.ownerDocument.defaultView:null,lm=new WeakMap;class cm{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 Cu(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(wu(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(s=n)||"y"===s?tl[s]?null:(tl[s]=!0,()=>{tl[s]=!1}):tl.x||tl.y?null:(tl.x=tl.y=!0,()=>{tl.x=tl.y=!1}),!this.openDragLock))return;var s;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Uu(e=>{let t=this.getAxisMotionValue(e).get()||0;if(ac.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=Au(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&ba.postRender(()=>o(e,t)),Rl(this.visualElement,"transform");const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:s}=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(),s&&s(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Uu(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:am(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&&ba.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||!dm(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let s=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?md(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?md(n,e,r.max):Math.min(e,n)),e}(s,this.constraints[e],this.elastic[e])),o.set(s)}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&&_u(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Fu(e.x,n,o),y:Fu(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=zu){return!1===e?e=0:!0===e&&(e=zu),{x:Bu(e,"left","right"),y:Bu(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Uu(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||!_u(e))return!1;const n=e.current;Gc(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=im(e,n),{scroll:o}=t;return o&&(rm(r.x,o.offset.x),rm(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let s=function(e,t){return{x:Vu(e.x,t.x),y:Vu(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}}(s));this.hasMutatedConstraints=!!e,e&&(s=Hu(e))}return s}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),a=this.constraints||{},l=Uu(i=>{if(!dm(i,t,this.currentDirection))return;let l=a&&a[i]||{};s&&(l={min:0,max:0});const c=r?200:1e6,d=r?40:1e7,u={type:"inertia",velocity:n?e[i]:0,bounceStiffness:c,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,u)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return Rl(this.visualElement,e),n.start(ou(e,n,0,t,this.visualElement,!1))}stopAnimation(){Uu(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Uu(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){Uu(t=>{const{drag:n}=this.getProps();if(!dm(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:s}=r.layout.layoutBox[t];o.set(e[t]-md(n,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!_u(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Uu(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=Au(e),o=Au(t);return o>r?n=Ya(t.min,t.max-r,e.min):r>o&&(n=Ya(e.min,e.max-o,t.min)),Kl(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(),Uu(t=>{if(!dm(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:s}=this.constraints[t];n.set(md(o,s,r[t]))})}addListeners(){if(!this.visualElement.current)return;lm.set(this.visualElement,this);const e=ku(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();_u(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()),ba.read(t);const o=xu(window,"resize",()=>this.scalePositionWithinConstraints()),s=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Uu(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(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:s=zu,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:s,dragMomentum:i}}}function dm(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const um=e=>(t,n)=>{e&&ba.postRender(()=>e(t,n))},mm=(0,Me.createContext)(null);function pm(e=!0){const t=(0,Me.useContext)(mm);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=(0,Me.useId)();(0,Me.useEffect)(()=>{e&&o(s)},[e]);const i=(0,Me.useCallback)(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const hm=(0,Me.createContext)({}),fm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function gm(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vm={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!lc.test(e))return e;e=parseFloat(e)}return`${gm(e,t.target.x)}% ${gm(e,t.target.y)}%`}},bm={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=kc.parse(e);if(o.length>5)return r;const s=kc.createTransformer(e),i="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const c=md(a,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),s(o)}},ym={},{schedule:xm,cancel:wm}=va(queueMicrotask,!1);class km extends Me.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var s;s=Cm,Object.assign(ym,s),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()})),fm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,s=n.projection;return s?(s.isPresent=o,r||e.layoutDependency!==t||void 0===t?s.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?s.promote():s.relegate()||ba.postRender(()=>{const e=s.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),xm.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 jm(e){const[t,n]=pm(),r=(0,Me.useContext)(ua);return(0,T.jsx)(km,{...e,layoutGroup:r,switchLayoutGroup:(0,Me.useContext)(hm),isPresent:t,safeToRemove:n})}const Cm={borderRadius:{...vm,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vm,borderTopRightRadius:vm,borderBottomLeftRadius:vm,borderBottomRightRadius:vm,boxShadow:bm},Sm=(e,t)=>e.depth-t.depth;class Em{constructor(){this.children=[],this.isDirty=!1}add(e){wl(this.children,e),this.isDirty=!0}remove(e){kl(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Sm),this.isDirty=!1,this.children.forEach(e)}}function Tm(e){const t=Nl(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const Pm=["TopLeft","TopRight","BottomLeft","BottomRight"],Nm=Pm.length,Rm=e=>"string"==typeof e?parseFloat(e):e,_m=e=>"number"==typeof e||lc.test(e);function Am(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Mm=Im(0,.5,Wl),Lm=Im(.5,.95,fa);function Im(e,t,n){return r=>r<e?0:r>t?1:n(Ya(e,t,r))}function Dm(e,t){e.min=t.min,e.max=t.max}function Om(e,t){Dm(e.x,t.x),Dm(e.y,t.y)}function Fm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Vm(e,t,n,r,o){return e=Zu(e-=t,1/n,r),void 0!==o&&(e=Zu(e,1/o,r)),e}function zm(e,t,[n,r,o],s,i){!function(e,t=0,n=1,r=.5,o,s=e,i=e){if(ac.test(t)&&(t=parseFloat(t),t=md(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let a=md(s.min,s.max,r);e===s&&(a-=t),e.min=Vm(e.min,t,n,a,o),e.max=Vm(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,s,i)}const Bm=["x","scaleX","originX"],$m=["y","scaleY","originY"];function Wm(e,t,n,r){zm(e.x,t,Bm,n?n.x:void 0,r?r.x:void 0),zm(e.y,t,$m,n?n.y:void 0,r?r.y:void 0)}function Um(e){return 0===e.translate&&1===e.scale}function Hm(e){return Um(e.x)&&Um(e.y)}function qm(e,t){return e.min===t.min&&e.max===t.max}function Km(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gm(e,t){return Km(e.x,t.x)&&Km(e.y,t.y)}function Ym(e){return Au(e.x)/Au(e.y)}function Xm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Zm{constructor(){this.members=[]}add(e){wl(this.members,e),e.scheduleRender()}remove(e){if(kl(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 Jm={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Qm="undefined"!=typeof window&&void 0!==window.MotionDebug,ep=["","X","Y","Z"],tp={visibility:"hidden"};let np=0;function rp(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function op(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ml(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ba,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&op(r)}function sp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=np++,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,Qm&&(Jm.totalNodes=Jm.resolvedTargetDeltas=Jm.recalculatedProjection=0),this.nodes.forEach(lp),this.nodes.forEach(fp),this.nodes.forEach(gp),this.nodes.forEach(cp),Qm&&window.MotionDebug.record(Jm)},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 Em)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new jl),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:s,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(s||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=xl.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(ya(r),e(s-t))};return ba.read(r,!0),()=>ya(r)}(r,250),fm.hasAnimatedSinceResize&&(fm.hasAnimatedSinceResize=!1,this.nodes.forEach(hp))})}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&i&&(o||s)&&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()||jp,{onLayoutAnimationStart:s,onLayoutAnimationComplete:a}=i.getProps(),l=!this.targetLayout||!Gm(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={...za(o,"layout"),onPlay:s,onComplete:a};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||hp(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,ya(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(vp),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&&op(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(up);this.isUpdating||this.nodes.forEach(mp),this.isUpdating=!1,this.nodes.forEach(pp),this.nodes.forEach(ip),this.nodes.forEach(ap),this.clearAllSnapshots();const e=xl.now();xa.delta=Kl(0,1e3/60,e-xa.timestamp),xa.timestamp=e,xa.isProcessing=!0,wa.update.process(xa),wa.preRender.process(xa),wa.render.process(xa),xa.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(dp),this.sharedNodes.forEach(bp)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ba.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ba.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&&!Hm(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,s=r!==this.prevTransformTemplateValue;e&&(t||Gu(this.latestValues)||s)&&(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)),Ep((r=n).x),Ep(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(Pp)){const{scroll:e}=this.root;e&&(rm(n.x,e.offset.x),rm(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Om(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:s}=r;r!==this.root&&o&&s.layoutScroll&&(o.wasRoot&&Om(n,e),rm(n.x,o.offset.x),rm(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Om(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&&sm(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),Gu(r.latestValues)&&sm(n,r.latestValues)}return Gu(this.latestValues)&&sm(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Om(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!n.instance)continue;if(!Gu(n.latestValues))continue;Ku(n.latestValues)&&n.updateSnapshot();const r=Wu();Om(r,n.measurePageBox()),Wm(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return Gu(this.latestValues)&&Wm(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!==xa.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:s}=this.options;if(this.layout&&(o||s)){if(this.resolvedRelativeTargetAt=xa.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}},Ou(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Om(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var i,a,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,a=this.relativeTarget,l=this.relativeParent.target,Iu(i.x,a.x,l.x),Iu(i.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Om(this.target,this.layout.layoutBox),em(this.target,this.targetDelta)):Om(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}},Ou(this.relativeTargetOrigin,this.target,e.target),Om(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Qm&&Jm.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!Ku(this.parent.latestValues)&&!Yu(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===xa.timestamp&&(r=!1),r)return;const{layout:o,layoutId:s}=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&&!s)return;Om(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let s,i;t.x=t.y=1;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:o}=s.options;o&&o.props.style&&"contents"===o.props.style.display||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&sm(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,em(e,i)),r&&Gu(s.latestValues)&&sm(e,s.latestValues))}t.x<nm&&t.x>tm&&(t.x=1),t.y<nm&&t.y>tm&&(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?(Fm(this.prevProjectionDelta.x,this.projectionDelta.x),Fm(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Lu(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===i&&this.treeScale.y===a&&Xm(this.projectionDelta.x,this.prevProjectionDelta.x)&&Xm(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Qm&&Jm.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},s={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}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,d=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(kp));let u;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;yp(s.x,e.x,n),yp(s.y,e.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ou(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){xp(e.x,t.x,n.x,r),xp(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,i,n),u&&function(e,t){return qm(e.x,t.x)&&qm(e.y,t.y)}(this.relativeTarget,u)&&(this.isProjectionDirty=!1),u||(u={x:{min:0,max:0},y:{min:0,max:0}}),Om(u,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,s){o?(e.opacity=md(0,void 0!==n.opacity?n.opacity:1,Mm(r)),e.opacityExit=md(void 0!==t.opacity?t.opacity:1,0,Lm(r))):s&&(e.opacity=md(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o<Nm;o++){const s=`border${Pm[o]}Radius`;let i=Am(t,s),a=Am(n,s);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||_m(i)===_m(a)?(e[s]=Math.max(md(Rm(i),Rm(a),r),0),(ac.test(a)||ac.test(i))&&(e[s]+="%")):e[s]=a)}(t.rotate||n.rotate)&&(e.rotate=md(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,d,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&&(ya(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ba.update(()=>{fm.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Nl(0)?0:Tl(0);return r.start(ou("",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&&Tp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Au(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Au(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Om(t,n),sm(t,o),Lu(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Zm),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&&rp("z",e,r,this.animationValues);for(let t=0;t<ep.length;t++)rp(`rotate${ep[t]}`,e,r,this.animationValues),rp(`skew${ep[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 tp;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Tm(null==e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Tm(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!Gu(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=s.animationValues||s.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(null==n?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}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:s,skewX:i,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),s&&(r+=`rotateY(${s}deg) `),i&&(r+=`skewX(${i}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(r.transform=o(i,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,s.animationValues?r.opacity=s===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=s===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in ym){if(void 0===i[e])continue;const{correct:t,applyTo:n}=ym[e],o="none"===r.transform?i[e]:t(i[e],s);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=s===this?Tm(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(up),this.root.sharedNodes.clear()}}}function ip(e){e.updateLayout()}function ap(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,s=n.source!==e.layout.source;"size"===o?Uu(e=>{const r=s?n.measuredBox[e]:n.layoutBox[e],o=Au(r);r.min=t[e].min,r.max=r.min+o}):Tp(o,n.layoutBox,t)&&Uu(r=>{const o=s?n.measuredBox[r]:n.layoutBox[r],i=Au(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}};Lu(i,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?Lu(a,e.applyTransform(r,!0),n.measuredBox):Lu(a,t,n.layoutBox);const l=!Hm(i);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:s}=r;if(o&&s){const i={x:{min:0,max:0},y:{min:0,max:0}};Ou(i,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ou(a,t,s.layoutBox),Gm(i,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=i,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function lp(e){Qm&&Jm.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 cp(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function dp(e){e.clearSnapshot()}function up(e){e.clearMeasurements()}function mp(e){e.isLayoutDirty=!1}function pp(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function hp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function fp(e){e.resolveTargetDelta()}function gp(e){e.calcProjection()}function vp(e){e.resetSkewAndRotation()}function bp(e){e.removeLeadSnapshot()}function yp(e,t,n){e.translate=md(t.translate,0,n),e.scale=md(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xp(e,t,n,r){e.min=md(t.min,n.min,r),e.max=md(t.max,n.max,r)}function kp(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const jp={duration:.45,ease:[.4,0,.1,1]},Cp=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Sp=Cp("applewebkit/")&&!Cp("chrome/")?Math.round:fa;function Ep(e){e.min=Sp(e.min),e.max=Sp(e.max)}function Tp(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Ym(t),o=Ym(n),!(Math.abs(r-o)<=.2));var r,o}function Pp(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const Np=sp({attachResizeListener:(e,t)=>xu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Rp={current:void 0},_p=sp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rp.current){const e=new Np({});e.mount(window),e.setOptions({layoutScroll:!0}),Rp.current=e}return Rp.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Ap={pan:{Feature:class extends vu{constructor(){super(...arguments),this.removePointerDownListener=fa}onPointerDown(e){this.session=new Cu(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:am(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:um(e),onStart:um(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&ba.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=ku(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 vu{constructor(e){super(e),this.removeGroupControls=fa,this.removeListeners=fa,this.controls=new cm(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fa}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:_p,MeasureLayout:jm}};function Mp(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&ba.postRender(()=>o(t,wu(t)))}function Lp(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&&ba.postRender(()=>o(t,wu(t)))}const Ip=new WeakMap,Dp=new WeakMap,Op=e=>{const t=Ip.get(e.target);t&&t(e)},Fp=e=>{e.forEach(Op)};const Vp={some:0,all:1},zp={inView:{Feature:class extends vu{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,s={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Vp[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;Dp.has(n)||Dp.set(n,{});const r=Dp.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Fp,{root:e,...t})),r[o]}(t);return Ip.set(e,n),r.observe(e),()=>{Ip.delete(e),r.unobserve(e)}}(this.node.current,s,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(),s=t?n:r;s&&s(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 vu{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,s]=rl(e,n),i=e=>{const r=e.currentTarget;if(!ul(e)||ll.has(r))return;ll.add(r);const s=t(e),i=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ul(e)&&ll.has(r)&&(ll.delete(r),"function"==typeof s&&s(e,{success:t}))},a=e=>{i(e,n.useGlobalTarget||sl(r,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return r.forEach(e=>{(function(e){return al.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=cl(()=>{if(ll.has(n))return;dl(n,"down");const e=cl(()=>{dl(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>dl(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,o),o)}),s}(e,e=>(Lp(this.node,e,"Start"),(e,{success:t})=>Lp(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends vu{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=xd(xu(this.node.current,"focus",()=>this.onFocus()),xu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends vu{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,s]=rl(e,n),i=ol(e=>{const{target:n}=e,r=t(e);if("function"!=typeof r||!n)return;const s=ol(e=>{r(e),n.removeEventListener("pointerleave",s)});n.addEventListener("pointerleave",s,o)});return r.forEach(e=>{e.addEventListener("pointerenter",i,o)}),s}(e,e=>(Mp(this.node,e,"Start"),e=>Mp(this.node,e,"End"))))}unmount(){}}}},Bp={layout:{ProjectionNode:_p,MeasureLayout:jm}},$p=(0,Me.createContext)({strict:!1}),Wp=(0,Me.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Up=(0,Me.createContext)({});function Hp(e){return Ta(e.animate)||Ia.some(t=>Ra(e[t]))}function qp(e){return Boolean(Hp(e)||e.variants)}function Kp(e){return Array.isArray(e)?e.join(" "):e}const Gp={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"]},Yp={};for(const e in Gp)Yp[e]={isEnabled:t=>Gp[e].some(e=>!!t[e])};const Xp=Symbol.for("motionComponentSymbol");function Zp(e,t,n){return(0,Me.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):_u(n)&&(n.current=r))},[t])}function Jp(e,t,n,r,o){var s,i;const{visualElement:a}=(0,Me.useContext)(Up),l=(0,Me.useContext)($p),c=(0,Me.useContext)(mm),d=(0,Me.useContext)(Wp).reducedMotion,u=(0,Me.useRef)(null);r=r||l.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:d}));const m=u.current,p=(0,Me.useContext)(hm);!m||m.projection||!o||"html"!==m.type&&"svg"!==m.type||function(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Qp(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:Boolean(i)||a&&_u(a),visualElement:e,animationType:"string"==typeof s?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(u.current,n,o,p);const h=(0,Me.useRef)(!1);(0,Me.useInsertionEffect)(()=>{m&&h.current&&m.update(n,c)});const f=n[Al],g=(0,Me.useRef)(Boolean(f)&&!(null===(s=window.MotionHandoffIsComplete)||void 0===s?void 0:s.call(window,f))&&(null===(i=window.MotionHasOptimisedAnimation)||void 0===i?void 0:i.call(window,f)));return ha(()=>{m&&(h.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),xm.render(m.render),g.current&&m.animationState&&m.animationState.animateChanges())}),(0,Me.useEffect)(()=>{m&&(!g.current&&m.animationState&&m.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,f)}),g.current=!1))}),m}function Qp(e){if(e)return!1!==e.options.allowProjection?e.projection:Qp(e.parent)}function eh({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var s,i;function a(e,s){let i;const a={...(0,Me.useContext)(Wp),...e,layoutId:th(e)},{isStatic:l}=a,c=function(e){const{initial:t,animate:n}=function(e,t){if(Hp(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Ra(t)?t:void 0,animate:Ra(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,Me.useContext)(Up));return(0,Me.useMemo)(()=>({initial:t,animate:n}),[Kp(t),Kp(n)])}(e),d=r(e,l);if(!l&&pa){(0,Me.useContext)($p).strict;const e=function(e){const{drag:t,layout:n}=Yp;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}}(a);i=e.MeasureLayout,c.visualElement=Jp(o,d,a,t,e.ProjectionNode)}return(0,T.jsxs)(Up.Provider,{value:c,children:[i&&c.visualElement?(0,T.jsx)(i,{visualElement:c.visualElement,...a}):null,n(o,e,Zp(d,c.visualElement,s),d,l,c.visualElement)]})}e&&function(e){for(const t in e)Yp[t]={...Yp[t],...e[t]}}(e),a.displayName=`motion.${"string"==typeof o?o:`create(${null!==(i=null!==(s=o.displayName)&&void 0!==s?s:o.name)&&void 0!==i?i:""})`}`;const l=(0,Me.forwardRef)(a);return l[Xp]=o,l}function th({layoutId:e}){const t=(0,Me.useContext)(ua).id;return t&&void 0!==e?t+"-"+e:e}const nh=["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 rh(e){return"string"==typeof e&&!e.includes("-")&&!!(nh.indexOf(e)>-1||/[A-Z]/u.test(e))}function oh(e){const t=(0,Me.useRef)(null);return null===t.current&&(t.current=e()),t.current}const sh=e=>(t,n)=>{const r=(0,Me.useContext)(Up),o=(0,Me.useContext)(mm),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,s){const i={latestValues:ih(r,o,s,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?s():oh(s)};function ih(e,t,n,r){const o={},s=r(e,{});for(const e in s)o[e]=Tm(s[e]);let{initial:i,animate:a}=e;const l=Hp(e),c=qp(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===a&&(a=t.animate));let d=!!n&&!1===n.initial;d=d||!1===i;const u=d?a:i;if(u&&"boolean"!=typeof u&&!Ta(u)){const t=Array.isArray(u)?u:[u];for(let n=0;n<t.length;n++){const r=Aa(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[d?t.length-1:0]),null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const ah=(e,t)=>t&&"number"==typeof e?t.transform(e):e,lh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ch=hl.length;function dh(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const e in t){const n=t[e];if(fl.has(e))i=!0;else if(Zc(e))o[e]=n;else{const t=ah(n,Rc[e]);e.startsWith("origin")?(a=!0,s[e]=t):r[e]=t}}if(t.transform||(i||n?r.transform=function(e,t,n){let r="",o=!0;for(let s=0;s<ch;s++){const i=hl[s],a=e[i];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(i.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const e=ah(a,Rc[i]);l||(o=!1,r+=`${lh[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")),a){const{originX:e="50%",originY:t="50%",originZ:n=0}=s;r.transformOrigin=`${e} ${t} ${n}`}}const uh={offset:"stroke-dashoffset",array:"stroke-dasharray"},mh={offset:"strokeDashoffset",array:"strokeDasharray"};function ph(e,t,n){return"string"==typeof e?e:lc.transform(t+n*e)}function hh(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:s,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(dh(e,c,u),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:m,style:p,dimensions:h}=e;m.transform&&(h&&(p.transform=m.transform),delete m.transform),h&&(void 0!==o||void 0!==s||p.transform)&&(p.transformOrigin=function(e,t,n){return`${ph(t,e.x,e.width)} ${ph(n,e.y,e.height)}`}(h,void 0!==o?o:.5,void 0!==s?s:.5)),void 0!==t&&(m.x=t),void 0!==n&&(m.y=n),void 0!==r&&(m.scale=r),void 0!==i&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?uh:mh;e[s.offset]=lc.transform(-r);const i=lc.transform(t),a=lc.transform(n);e[s.array]=`${i} ${a}`}(m,i,a,l,!1)}const fh=e=>"string"==typeof e&&"svg"===e.toLowerCase();function gh(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 vh=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 bh(e,t,n,r){gh(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(vh.has(n)?n:_l(n),t.attrs[n])}function yh(e,{layout:t,layoutId:n}){return fl.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!ym[e]||"opacity"===e)}function xh(e,t,n){var r;const{style:o}=e,s={};for(const i in o)(Nl(o[i])||t.style&&Nl(t.style[i])||yh(i,e)||void 0!==(null===(r=null==n?void 0:n.getValue(i))||void 0===r?void 0:r.liveStyle))&&(s[i]=o[i]);return s}function wh(e,t,n){const r=xh(e,t,n);for(const n in e)(Nl(e[n])||Nl(t[n]))&&(r[-1!==hl.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}const kh=["x","y","width","height","cx","cy","r"],jh={useVisualState:sh({scrapeMotionValuesFromProps:wh,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let s=!!e.drag;if(!s)for(const e in o)if(fl.has(e)){s=!0;break}if(!s)return;let i=!t;if(t)for(let n=0;n<kh.length;n++){const r=kh[n];e[r]!==t[r]&&(i=!0)}i&&ba.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),ba.render(()=>{hh(r,o,fh(n.tagName),e.transformTemplate),bh(n,r)})})}})},Ch={useVisualState:sh({scrapeMotionValuesFromProps:xh,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function Sh(e,t,n){for(const r in t)Nl(t[r])||yh(r,n)||(e[r]=t[r])}function Eh(e,t){const n={},r=function(e,t){const n={};return Sh(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,Me.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return dh(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 Th=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 Ph(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Th.has(e)}let Nh=e=>!Ph(e);try{(Rh=require("@emotion/is-prop-valid").default)&&(Nh=e=>e.startsWith("on")?!Ph(e):Rh(e))}catch(e){}var Rh;function _h(e,t,n,r){const o=(0,Me.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return hh(n,t,fh(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};Sh(t,e.style,e),o.style={...t,...o.style}}return o}function Ah(e=!1){return(t,n,r,{latestValues:o},s)=>{const i=(rh(t)?_h:Eh)(n,o,s,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(Nh(o)||!0===n&&Ph(o)||!t&&!Ph(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l=t!==Me.Fragment?{...a,...i,ref:r}:{},{children:c}=n,d=(0,Me.useMemo)(()=>Nl(c)?c.get():c,[c]);return(0,Me.createElement)(t,{...l,children:d})}}function Mh(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return eh({...rh(n)?jh:Ch,preloadedFeatures:e,useRender:Ah(r),createVisualElement:t,Component:n})}}const Lh={current:null},Ih={current:!1},Dh=[...od,pc,kc],Oh=new WeakMap,Fh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Vh{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qc,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=xl.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,ba.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:c}=s;this.onUpdate=c,this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},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=Hp(t),this.isVariantNode=qp(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Nl(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Oh.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)),Ih.current||function(){if(Ih.current=!0,pa)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Lh.current=e.matches;e.addListener(t),t()}else Lh.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Lh.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Oh.delete(this.current),this.projection&&this.projection.unmount(),ya(this.notifyUpdate),ya(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=fl.has(e),r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&ba.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o(),s&&s(),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 Yp){const t=Yp[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<Fh.length;t++){const n=Fh[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],s=n[r];if(Nl(o))e.addValue(r,o);else if(Nl(s))e.addValue(r,Tl(o,{owner:e}));else if(s!==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,Tl(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=Tl(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&&(Yc(r)||Hl(r))?r=parseFloat(r):(o=r,!Dh.find(rd(o))&&kc.test(t)&&(r=Mc(e,t))),this.setBaseTarget(e,Nl(r)?r.get():r)),Nl(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=Aa(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||Nl(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 jl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class zh extends Vh{constructor(){super(...arguments),this.KeyframeResolver=id}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;Nl(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class Bh extends zh{constructor(){super(...arguments),this.type="html",this.renderInstance=gh}readValueFromInstance(e,t){if(fl.has(t)){const e=Ac(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(Zc(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return im(e,t)}build(e,t,n){dh(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return xh(e,t,n)}}class $h extends zh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wu}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(fl.has(t)){const e=Ac(t);return e&&e.default||0}return t=vh.has(t)?t:_l(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return wh(e,t,n)}build(e,t,n){hh(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){bh(e,t,0,r)}mount(e){this.isSVGTag=fh(e.tagName),super.mount(e)}}const Wh=(e,t)=>rh(e)?new $h(t):new Bh(t,{allowProjection:e!==Me.Fragment}),Uh=Ea(Mh({...yu,...zp,...Ap,...Bp},Wh)),Hh=(0,Me.createContext)({}),qh=()=>(0,Me.useContext)(Hh),Kh=(0,Me.createContext)(null),Gh=({children:e,activeItem:t=null,onChange:n,className:r,size:o="sm",orientation:s="horizontal",variant:i="pill",iconPosition:a="left",width:l="full"})=>{const c=Hs(),d=qh()?.activeItem||t,u=(0,Me.useCallback)((e,t)=>{n&&n({event:e,value:t})},[n]);let m,p="rounded-full",h="p-1",f="ring-1 ring-tab-border";"vertical"===s?m="gap-0.5":("rounded"===i||"pill"===i)&&("xs"===o||"sm"===o?m="gap-0.5":("md"===o||"lg"===o)&&(m="gap-1")),"rounded"===i||"vertical"===s?p="rounded-md":"underline"===i&&(p="rounded-none",h="p-0",f="border-t-0 border-r-0 border-l-0 border-b border-solid border-tab-border","xs"===o?m="gap-0":"sm"===o?m="gap-2.5":("md"===o||"lg"===o)&&(m="gap-3"));const g=qt(`box-border [&>*]:box-border flex items-center ${"full"===l?"w-full":""} ${"vertical"===s?"flex-col":""}`,p,h,m,f,"underline"!==i?"bg-tab-background":"",r);return(0,T.jsx)("div",{className:g,children:(0,T.jsx)(Kh.Provider,{value:{activeItem:d,onChange:u,size:o,variant:i,orientation:s,iconPosition:a,width:l},children:(0,T.jsx)(Sa,{id:c,children:Me.Children.map(e,e=>(0,Me.isValidElement)(e)?Me.cloneElement(e):null)})})})};Gh.displayName="Tabs.Group";const Yh=(0,Me.forwardRef)(({slug:e,text:t,icon:n,className:r,disabled:o=!1,badge:s=null,...i},a)=>{const l=(0,Me.useContext)(Kh);if(!l)throw new Error("Tab should be used inside Tabs Group");const{activeItem:c,onChange:d,size:u,variant:m,orientation:p,iconPosition:h,width:f}=l,g={xs:"px-1.5 py-0.5 text-xs [&_svg]:size-3",sm:"underline"===m?"py-1.5 text-sm [&_svg]:size-4":"px-3 py-1.5 text-sm [&_svg]:size-4",md:"underline"===m?"py-2 text-base [&_svg]:size-5":"px-3.5 py-1.5 text-base [&_svg]:size-5",lg:"underline"===m?"p-2.5 text-lg [&_svg]:size-6":"px-3.5 py-1.5 text-lg [&_svg]:size-6"}[u],v=qt("relative border-none bg-transparent text-text-secondary cursor-pointer flex items-center justify-center transition-[box-shadow,color,background-color] duration-200","full"===f?"flex-1":"","vertical"===p?"w-full justify-between":"");let b="rounded-full";"rounded"===m?b="rounded-md":"underline"===m&&(b="rounded-none");const y=qt(v,"border-none",b,"hover:text-text-primary","focus:outline-none",g,c===e?"bg-background-primary text-text-primary shadow-sm":"",o?"text-text-disabled cursor-not-allowed hover:text-text-disabled":"",r),x=qt("flex items-center gap-1");return(0,T.jsxs)(Uh.button,{ref:a,className:y,disabled:o,onClick:n=>{d(n,{slug:e,text:t})},...i,layoutRoot:!0,children:[c===e&&"underline"===m&&(0,T.jsx)(Uh.span,{layoutId:"underline",layoutDependency:c,className:"absolute right-0 left-0 -bottom-px h-px bg-border-interactive"}),(0,T.jsxs)("span",{className:x,children:["left"===h&&n&&(0,T.jsx)("span",{className:"mr-1 contents center-center transition duration-150",children:n}),t,"right"===h&&n&&(0,T.jsx)("span",{className:"ml-1 contents center-center transition duration-150",children:n})]}),s&&(0,Me.isValidElement)(s)&&s]})});Yh.displayName="Tabs.Tab";const Xh=({activeItem:e,children:t})=>(0,T.jsx)(Hh.Provider,{value:{activeItem:e},children:t}),Zh=({slug:e,children:t})=>{const n=qh();if(!n)throw new Error("TabPanel should be used inside Tabs");return e===n.activeItem?(0,T.jsx)(T.Fragment,{children:t}):null};Zh.displayName="Tabs.Panel",Xh.Group=Gh,Xh.Tab=Yh,Xh.Panel=Zh;class Jh extends Me.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 Qh({children:e,isPresent:t}){const n=(0,Me.useId)(),r=(0,Me.useRef)(null),o=(0,Me.useRef)({width:0,height:0,top:0,left:0}),{nonce:s}=(0,Me.useContext)(Wp);return(0,Me.useInsertionEffect)(()=>{const{width:e,height:i,top:a,left:l}=o.current;if(t||!r.current||!e||!i)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),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: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[t]),(0,T.jsx)(Jh,{isPresent:t,childRef:r,sizeRef:o,children:Me.cloneElement(e,{ref:r})})}const ef=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i})=>{const a=oh(tf),l=(0,Me.useId)(),c=(0,Me.useCallback)(e=>{a.set(e,!0);for(const e of a.values())if(!e)return;r&&r()},[a,r]),d=(0,Me.useMemo)(()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:c,register:e=>(a.set(e,!1),()=>a.delete(e))}),s?[Math.random(),c]:[n,c]);return(0,Me.useMemo)(()=>{a.forEach((e,t)=>a.set(t,!1))},[n]),Me.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),"popLayout"===i&&(e=(0,T.jsx)(Qh,{isPresent:n,children:e})),(0,T.jsx)(mm.Provider,{value:d,children:e})};function tf(){return new Map}const nf=e=>e.key||"";function rf(e){const t=[];return Me.Children.forEach(e,e=>{(0,Me.isValidElement)(e)&&t.push(e)}),t}const of=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1})=>{const[a,l]=pm(i),c=(0,Me.useMemo)(()=>rf(e),[e]),d=i&&!a?[]:c.map(nf),u=(0,Me.useRef)(!0),m=(0,Me.useRef)(c),p=oh(()=>new Map),[h,f]=(0,Me.useState)(c),[g,v]=(0,Me.useState)(c);ha(()=>{u.current=!1,m.current=c;for(let e=0;e<g.length;e++){const t=nf(g[e]);d.includes(t)?p.delete(t):!0!==p.get(t)&&p.set(t,!1)}},[g,d.length,d.join("-")]);const b=[];if(c!==h){let e=[...c];for(let t=0;t<g.length;t++){const n=g[t],r=nf(n);d.includes(r)||(e.splice(t,0,n),b.push(n))}return"wait"===s&&b.length&&(e=b),v(rf(e)),void f(c)}const{forceRender:y}=(0,Me.useContext)(ua);return(0,T.jsx)(T.Fragment,{children:g.map(e=>{const h=nf(e),f=!(i&&!a)&&(c===g||d.includes(h));return(0,T.jsx)(ef,{isPresent:f,initial:!(u.current&&!n)&&void 0,custom:f?void 0:t,presenceAffectsLayout:o,mode:s,onExitComplete:f?void 0:()=>{if(!p.has(h))return;p.set(h,!0);let e=!0;p.forEach(t=>{t||(e=!1)}),e&&(null==y||y(),v(m.current),i&&(null==l||l()),r&&r())},children:e},h)})})},sf=(0,Me.createContext)({}),af=()=>(0,Me.useContext)(sf),lf=({size:e="md",children:t,className:n})=>(0,T.jsx)(sf.Provider,{value:{size:e},children:(0,T.jsx)("div",{className:qt("flex flex-col bg-background-primary p-2",n),children:t})});lf.displayName="Menu";const cf=({heading:e,arrow:t=!1,showArrowOnHover:n=!1,open:r=!0,onClick:o,children:s,className:i})=>{const[a,l]=(0,Me.useState)(r),[c,d]=(0,Me.useState)(!1),{size:u}=af(),m={sm:"text-xs",md:"text-sm"}[u??"md"],p={sm:"size-4",md:"size-5"}[u??"md"],h=()=>{l(!a),o&&o(!a)};return(0,T.jsxs)("div",{children:[!!e&&(0,T.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:qt("text-text-primary bg-transparent cursor-pointer flex justify-between items-center gap-1",m,e?"p-1":"p-0",i),"aria-expanded":a,children:[(0,T.jsx)("span",{className:"text-text-tertiary",children:e}),t&&(0,T.jsx)(Uh.span,{className:"flex items-center text-border-strong",initial:"hidden",animate:n?a||c?"visible":"hidden":"visible",exit:"hidden",variants:{visible:{opacity:1},hidden:{opacity:0}},transition:{duration:.15},children:(0,T.jsx)(Uh.span,{className:"inline-flex p-1",variants:{open:{rotate:180},closed:{rotate:0}},animate:a?"open":"closed",transition:{duration:.15},children:(0,T.jsx)(tn,{className:qt("shrink-0",p)})})})]}),(0,T.jsx)(of,{initial:!1,children:a&&(0,T.jsx)(Uh.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:s})})]})};cf.displayName="Menu.List";const df=({disabled:e=!1,active:t,onClick:n,children:r,className:o,...s})=>{const{size:i}=af(),a={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,T.jsx)("li",{role:"menuitem",tabIndex:e?-1:0,onClick:e?void 0:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&n?.()},className:qt("flex p-1 gap-1 items-center bg-transparent border-none rounded text-text-secondary cursor-pointer m-0",a,"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,...s,children:r})};df.displayName="Menu.Item";const uf=({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,T.jsx)("li",{className:"m-0 p-0 list-none",role:"separator","aria-hidden":"true",children:(0,T.jsx)("hr",{className:qt("w-full border-0 border-t border-border-subtle",n,t)})})};uf.displayName="Menu.Separator",lf.List=cf,lf.Item=df,lf.Separator=uf;const mf=(0,Me.createContext)({}),pf=()=>(0,Me.useContext)(mf),hf=({placement:e="bottom",offset:t=10,boundary:n="clippingAncestors",children:r,className:o})=>{const[s,i]=(0,Me.useState)(!1),{refs:a,floatingStyles:l,context:c}=Ts({open:s,onOpenChange:i,placement:e,strategy:"fixed",middleware:[so(t),ao({boundary:n}),io({boundary:n})],whileElementsMounted:Xr}),d=ks(c),u=Es(c),m=Vs(c,{role:"menu"}),{getReferenceProps:p,getFloatingProps:h}=_s([d,u,m]),{isMounted:f,styles:g}=$s(c,{duration:150,initial:{opacity:0,scale:.95},open:{opacity:1,scale:1},close:{opacity:0,scale:.95}}),v=()=>i(e=>!e);return(0,T.jsx)(mf.Provider,{value:{refs:a,handleClose:()=>i(!1),isMounted:f,styles:g,floatingStyles:l,getFloatingProps:h},children:(0,T.jsxs)("div",{className:qt("relative inline-block",o),children:[Me.Children.map(r,e=>Me.isValidElement(e)&&"DropdownMenu.Trigger"===e?.type?.displayName?(0,Me.cloneElement)(e,{ref:a.setReference,onClick:v,...p()}):null),Me.Children.toArray(r).filter(e=>Me.isValidElement(e)&&["DropdownMenu.Portal","DropdownMenu.ContentWrapper"].includes(e.type.displayName||"")).map(e=>e)]})})};hf.displayName="DropdownMenu";const ff=({children:e,className:t})=>{const{refs:n,floatingStyles:r,getFloatingProps:o,isMounted:s,styles:i}=pf();return s&&(0,T.jsx)("div",{ref:n.setFloating,className:t,style:{...r,...i},...o(),children:Me.Children.map(e,e=>"DropdownMenu.Content"===e?.type?.displayName?e:null)})};ff.displayName="DropdownMenu.ContentWrapper";const gf=({children:e,root:t,id:n})=>(0,T.jsx)(ls,{id:n,root:t,children:e});gf.displayName="DropdownMenu.Portal";const vf=Me.forwardRef(({children:e,className:t,...n},r)=>(0,Me.isValidElement)(e)?Me.cloneElement(e,{className:qt(t,e.props.className),ref:r,...n}):(0,T.jsx)("div",{ref:r,className:qt("cursor-pointer",t),role:"button",tabIndex:0,...n,children:e}));vf.displayName="DropdownMenu.Trigger";const bf=({children:e,className:t,...n})=>(0,T.jsx)("div",{className:qt("border border-solid border-border-subtle rounded-md shadow-lg overflow-hidden",t),children:(0,T.jsx)(lf,{...n,children:e})});bf.displayName="DropdownMenu.Content";const yf=e=>(0,T.jsx)(lf.List,{...e});yf.displayName="DropdownMenu.List";const xf=({children:e,as:t=lf.Item,...n})=>{const{handleClose:r}=pf();return e?t===Me.Fragment&&(0,Me.isValidElement)(e)?(0,Me.cloneElement)(e,{onClick:Kt(e.props?.onClick,r)}):(0,T.jsx)(t,{...n,className:qt("px-2",n.className),onClick:Kt(n.onClick,r),children:e}):null};xf.displayName="DropdownMenu.Item";const wf=e=>(0,T.jsx)(lf.Separator,{...e});wf.displayName="DropdownMenu.Separator",hf.Trigger=vf,hf.Content=bf,hf.List=yf,hf.Item=xf,hf.Separator=wf,hf.Portal=gf,hf.ContentWrapper=ff;const kf=({content:e="",handleContentChange:t,editorId:n,label:r=null,error:o=!1,onBlur:s=()=>{},onFocus:i=()=>{},required:a=!1,smartTags:l=[],smartTagGroups:c=[],height:d=300})=>{const[u,m]=(0,S.useState)(e||""),[p,h]=(0,S.useState)("visual"),f=(0,S.useRef)(null),g=(0,S.useRef)(null),v=(0,S.useRef)(e||""),b=(0,S.useRef)(t),y=(0,S.useRef)(s),x=(0,S.useRef)(i);(0,S.useEffect)(()=>{b.current=t},[t]),(0,S.useEffect)(()=>{y.current=s},[s]),(0,S.useEffect)(()=>{x.current=i},[i]),(0,S.useEffect)(()=>{const t=e||"";m(t),v.current=t;const r=window.tinyMCE?.get(n);r&&r.getContent()!==t&&r.setContent(t)},[e,n]);const w=(0,S.useCallback)(e=>{m(e),b.current(e)},[]);(0,S.useEffect)(()=>{const e=f.current,t=g.current,r=e=>{const t=window.tinyMCE?.get(n);if(t){const n=t.getContainer(),r=n?.closest(".sd-richtext-content-editor");if(r){const t="visual"===e?"switch-tmce":"switch-html",n=r.querySelector(`.${t}`);n&&n.click()}}},o=()=>{h("visual"),r("visual")},s=()=>{h("html"),r("html")};return e&&t&&(e.addEventListener("click",o),t.addEventListener("click",s)),(()=>{if(window.wp?.editor&&document.getElementById(n)){window.tinyMCE?.get(n)&&window.tinyMCE.execCommand("mceRemoveEditor",!0,n),window.wp.editor.initialize(n,{tinymce:{toolbar1:"formatselect bold italic bullist numlist link blockquote alignleft aligncenter alignright underline strikethrough forecolor removeformat undo redo",content_style:'\n\t\t\t\t\t\t\tbody {\n\t\t\t\t\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n\t\t\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\t\t\tline-height: 1.6;\n\t\t\t\t\t\t\t\tcolor: #333;\n\t\t\t\t\t\t\t\tpadding: 12px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t',fontsize_formats:"12px 14px 16px 18px 24px",plugins:"lists link textcolor",menubar:!1,height:d,resize:!1},quicktags:!0,mediaButtons:!1});const e=window.tinyMCE.get(n);e&&(e.setContent(v.current),e.on("change",()=>{w(e.getContent())}),e.on("blur",()=>{y.current(e.getContent())}),e.on("focus",()=>{x.current(e.getContent())}))}})(),()=>{window.tinyMCE?.get(n)&&window.tinyMCE.execCommand("mceRemoveEditor",!0,n),e?.removeEventListener("click",o),t?.removeEventListener("click",s)}},[n,d,w]);const k=e=>{const t=window.tinyMCE?.get(n);t&&t.insertContent(e)};return(0,T.jsxs)("div",{className:"sd-richtext-content-editor flex flex-col gap-1.5 "+(o?"sd-editor-error":""),"data-editor-id":n,children:[(0,T.jsxs)("div",{className:"sd-top-toolbar-content flex w-full "+(r?"justify-between":"justify-end"),children:[r&&(0,T.jsx)(Yt,{required:a,children:r}),(0,T.jsxs)("div",{className:"flex items-center gap-2 w-fit",children:[(0,T.jsxs)(Xh.Group,{variant:"rounded",size:"xs",children:[(0,T.jsx)(Xh.Tab,{className:"text-sm font-medium "+("visual"===p?"bg-background-primary text-text-primary shadow-sm":""),text:(0,E.__)("Visual","suredonation"),slug:"visual",ref:f},"visual"),(0,T.jsx)(Xh.Tab,{className:"text-sm font-medium "+("html"===p?"bg-background-primary text-text-primary shadow-sm":""),text:(0,E.__)("HTML","suredonation"),slug:"html",ref:g},"html")]}),(c.length>0||l.length>0)&&(0,T.jsxs)(hf,{placement:"bottom-end",className:"min-w-fit",children:[(0,T.jsx)(hf.Trigger,{children:(0,T.jsx)(Ys,{variant:"outline",size:"sm",icon:(0,T.jsx)(Be,{}),iconPosition:"right",className:"min-w-fit [&_svg]:shrink-0",children:(0,E.__)("Add Tag","suredonation")})}),(0,T.jsx)(hf.Portal,{id:"suredonation-dialog-root",children:(0,T.jsx)(hf.ContentWrapper,{children:(0,T.jsx)(hf.Content,{className:"w-60 max-h-80 overflow-y-auto",children:(0,T.jsx)(hf.List,{children:c.length>0?c.map((e,t)=>(0,T.jsxs)("div",{children:[(0,T.jsx)(Yt,{variant:"help",size:"xs",className:"p-2 text-text-primary font-medium text-sm",tabIndex:-1,children:e.label}),e.tags.map(e=>(0,T.jsx)(hf.Item,{className:"text-sm font-normal text-text-secondary hover:bg-background-secondary hover:text-text-primary focus:bg-background-secondary focus:text-text-primary",onClick:()=>k(e.tag),children:e.title||e.tag},e.tag))]},e.label||t)):l.map(e=>(0,T.jsx)(hf.Item,{className:"text-sm font-normal text-text-secondary hover:bg-background-secondary hover:text-text-primary focus:bg-background-secondary focus:text-text-primary",onClick:()=>k(e.tag),children:e.title||e.tag},e.tag))})})})})]})]})]}),(0,T.jsx)("textarea",{className:"sd-tinymce-editor-textarea w-full border-none border-0 focus:border-border-subtle focus:outline-none focus:ring-0 resize-none",id:n,value:u,onChange:e=>w(e.target.value)})]})},jf=[{label:(0,E.__)("Hide Form","suredonation"),value:"hide form"},{label:(0,E.__)("Reset Form","suredonation"),value:"reset form"}],Cf=[{label:(0,E.__)("Success Message","suredonation"),value:"same page"},{label:(0,E.__)("Redirect","suredonation"),value:"different page",subOptionLabel:(0,E.__)("Redirect to","suredonation"),subOptions:[{label:(0,E.__)("Page","suredonation"),value:"different page"},{label:(0,E.__)("Custom URL","suredonation"),value:"custom url"}]}],Sf={confirmation_type:"same page",message:"",submission_action:"hide form",custom_url:"",page_url:""},Ef=()=>{const e=(0,n.useSelect)(e=>e(C.store).getEditedPostAttribute("meta"),[]),{editPost:t,savePost:r}=(0,n.useDispatch)(C.store),[o,s]=(0,S.useState)(Sf),[i,a]=(0,S.useState)(null),[l,c]=(0,S.useState)(!1),[d,u]=(0,S.useState)(!1),[m,p]=(0,S.useState)(null),[h,f]=(0,S.useState)(!1),[g,v]=(0,S.useState)([]),b=(0,S.useRef)(""),y=(0,S.useRef)(null),x=(0,S.useRef)(null),w=(0,S.useRef)(o),k=(0,S.useCallback)(async(e="")=>{x.current?.abort(),x.current=new AbortController;try{const t=await qe()({path:(0,Ke.addQueryArgs)("/wp/v2/pages",{search:e,per_page:20,status:"publish",_fields:"id,title,link"}),signal:x.current.signal});v(t.map(e=>({label:e.title.rendered,value:e.link})))}catch{}},[]),j=function(e,t,n,r){var o=this,s=(0,Me.useRef)(null),i=(0,Me.useRef)(0),a=(0,Me.useRef)(0),l=(0,Me.useRef)(null),c=(0,Me.useRef)([]),d=(0,Me.useRef)(),u=(0,Me.useRef)(),m=(0,Me.useRef)(e),p=(0,Me.useRef)(!0),h=(0,Me.useRef)(),f=(0,Me.useRef)();m.current=e;var g="undefined"!=typeof window,v=!t&&0!==t&&g;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,x=!!n.flushOnExit&&y,w="maxWait"in n,k="debounceOnServer"in n&&!!n.debounceOnServer,j=w?Math.max(+n.maxWait||0,t):null,C=(0,Me.useMemo)(function(){var e=function(e){var t=c.current,n=d.current;return c.current=d.current=null,i.current=e,a.current=a.current||e,u.current=m.current.apply(n,t)},n=function(e,t){v&&cancelAnimationFrame(l.current),l.current=v?requestAnimationFrame(e):setTimeout(e,t)},C=function(e){if(!p.current)return!1;var n=e-s.current;return!s.current||n>=t||n<0||w&&e-i.current>=j},S=function(t){return l.current=null,y&&c.current?e(t):(c.current=d.current=null,u.current)},E=function e(){var r=Date.now();if(b&&a.current===i.current&&T(),C(r))return S(r);if(p.current){var o=t-(r-s.current),l=w?Math.min(o,j-(r-i.current)):o;n(e,l)}},T=function(){r&&r({})},P=function(){if(g||k){var r,a=Date.now(),m=C(a);if(c.current=[].slice.call(arguments),d.current=o,s.current=a,x&&!h.current&&(h.current=function(){var e;"hidden"===(null==(e=globalThis.document)?void 0:e.visibilityState)&&f.current.flush()},null==(r=globalThis.document)||null==r.addEventListener||r.addEventListener("visibilitychange",h.current)),m){if(!l.current&&p.current)return i.current=s.current,n(E,t),b?e(s.current):u.current;if(w)return n(E,t),e(s.current)}return l.current||n(E,t),u.current}};return P.cancel=function(){var e=l.current;e&&(v?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,c.current=s.current=d.current=l.current=null,e&&r&&r({})},P.isPending=function(){return!!l.current},P.flush=function(){return l.current?S(Date.now()):u.current},P},[b,w,t,j,y,x,v,g,k,r]);return f.current=C,(0,Me.useEffect)(function(){return p.current=!0,function(){var e;x&&f.current.flush(),h.current&&(null==(e=globalThis.document)||null==e.removeEventListener||e.removeEventListener("visibilitychange",h.current),h.current=null),p.current=!1}},[x]),C}(k,300);(0,S.useEffect)(()=>{if(null!==y.current)return;k();const t=e?._suredonation_form_confirmation;let n=!1;if(t&&"string"==typeof t)try{const e=JSON.parse(t);if("object"==typeof e&&null!==e){const t={...Sf,...e};s(t),b.current=t.message||"",a(t.message||""),y.current=JSON.stringify(t),n=!0}}catch{}return!n&&e&&(b.current=Sf.message,a(Sf.message),y.current=JSON.stringify(Sf)),()=>{j.cancel(),x.current?.abort()}},[e]),(0,S.useEffect)(()=>{if(w.current=o,null===y.current)return;const e=JSON.stringify({...o,message:b.current});c(e!==y.current)},[o]);const P=(0,S.useCallback)(e=>{if(b.current=e,null!==y.current){const t=JSON.stringify({...w.current,message:e});c(t!==y.current)}},[]);(0,S.useEffect)(()=>{f(!1),p(null)},[o?.confirmation_type]);const N=Cf.find(e=>e.value===o?.confirmation_type||e.subOptions?.some(e=>e.value===o?.confirmation_type));return(0,T.jsx)(da,{title:(0,E.__)("Form Confirmation","suredonation"),titleHelpText:(0,E.__)("Customize the confirmation message or redirect the users after submitting the form.","suredonation"),showTitleHelpText:!0,onClickSave:async()=>{const e=(()=>{if("different page"===o?.confirmation_type&&!o?.page_url)return(0,E.__)("Please select a page.","suredonation");if("custom url"===o?.confirmation_type&&!o?.custom_url)return(0,E.__)("This field is required.","suredonation");if("custom url"===o?.confirmation_type&&o?.custom_url)try{const e=new URL(o.custom_url);if("https:"!==e.protocol)return(0,E.__)("Suggestion: URL should use HTTPS","suredonation");if("localhost"!==e.hostname&&(!e.hostname.includes(".")||e.hostname.split(".").pop().length<=1))return(0,E.__)("URL is missing Top Level Domain (TLD).","suredonation")}catch{return(0,E.__)("Please enter a valid URL.","suredonation")}return""})();if(p(e),""!==e)return void f(!0);u(!0);const n={...o,message:b.current};t({meta:{_suredonation_form_confirmation:JSON.stringify(n)}});try{await r(),y.current=JSON.stringify(n),c(!1),Xe.success((0,E.__)("Confirmation settings saved.","suredonation"))}catch{Xe.error((0,E.__)("Failed to save confirmation settings.","suredonation"))}finally{u(!1)}},saveBtnDisabled:!l||d,isSaving:d,children:(0,T.jsxs)("div",{className:"space-y-6",children:[(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)(Yt,{children:(0,E.__)("Confirmation Type","suredonation")}),(0,T.jsx)("div",{children:(0,T.jsx)(Vi,{children:Cf.map(e=>{const t=((e,t)=>e.value===t||e.subOptions?.some(e=>e.value===t))(e,o?.confirmation_type);return(0,T.jsx)(Vi.Option,{label:e.label,onChange:()=>s({...o,confirmation_type:e.value}),value:e.value,checked:t},e.value)})})})]}),N?.subOptionLabel&&(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)(Yt,{children:N.subOptionLabel}),(0,T.jsx)(Vi,{cols:2,children:N.subOptions?.map(e=>(0,T.jsx)(Vi.Option,{label:e.label,value:e.value,checked:o?.confirmation_type===e.value,onChange:()=>s({...o,confirmation_type:e.value})},e.value))})]}),"same page"===o?.confirmation_type&&null!==i&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{children:(0,T.jsx)(kf,{editorId:"suredonation-confirmation-message",content:i,handleContentChange:P,label:(0,E.__)("Success Message","suredonation"),height:200,smartTags:window.suredonationFormEditor?.smartTags||[]})}),(0,T.jsxs)("div",{className:"space-y-2",children:[(0,T.jsx)(Yt,{children:(0,E.__)("After Form Submission","suredonation")}),(0,T.jsx)(Vi,{cols:2,children:jf.map(e=>(0,T.jsx)(Vi.Option,{label:e.label,value:e.value,checked:o?.submission_action===e.value,onChange:()=>s({...o,submission_action:e.value})},e.value))})]})]}),"different page"===o?.confirmation_type&&(0,T.jsxs)("div",{className:"space-y-1.5",children:[(0,T.jsx)(Yt,{htmlFor:"select-page",children:(0,E.__)("Select Page to redirect","suredonation")}),(0,T.jsxs)(xi,{options:g,value:o?.page_url,onChange:e=>{f(!0),p(null),s({...o,page_url:e})},combobox:!0,searchFn:j,debounceDelay:0,searchPlaceholder:(0,E.__)("Search for a page","suredonation"),children:[(0,T.jsx)(xi.Button,{id:"select-page",placeholder:(0,E.__)("Select a page","suredonation"),children:g?.find(e=>e.value===o?.page_url)?.label}),(0,T.jsx)(xi.Options,{dropdownPortalId:"suredonation-dialog-root",children:g?.map(e=>(0,T.jsx)(xi.Option,{value:e.value,selected:e.value===o?.page_url,children:e.label},e.value))})]})]}),"custom url"===o?.confirmation_type&&(0,T.jsxs)("div",{className:"space-y-1.5",children:[(0,T.jsx)(Yt,{htmlFor:"custom-url-input",required:!0,children:(0,E.__)("Custom URL","suredonation")}),(0,T.jsx)(ki,{id:"custom-url-input",value:o?.custom_url||"",onChange:e=>{f(!0),s({...o,custom_url:e})},size:"md",placeholder:"https://"}),h&&m&&(0,T.jsx)(Yt,{variant:"error",size:"sm",children:m})]})]})})},Tf=Qt("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Pf=(0,Me.forwardRef)(({id:e,label:t,defaultChecked:n=!1,checked:r,onChange:o,indeterminate:s,disabled:i,size:a="md",className:l,...c},d)=>{const u=(0,Me.useMemo)(()=>e||`checkbox-${Hs()}`,[e]),m=(0,Me.useMemo)(()=>typeof r<"u",[r]),[p,h]=(0,Me.useState)(n||!1),f="primary",g={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"}},v={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,Me.useCallback)(()=>m?r:p,[m,r,p]),y=(0,Me.useCallback)(()=>(0,Me.isValidElement)(t)?t:t?.heading||t?.description?(0,T.jsxs)("div",{className:g[a].gap,children:[t?.heading&&(0,T.jsx)(Yt,{className:qt("text-text-primary font-medium leading-4 m-0",g[a].text,g[a].gap,i&&"text-text-disabled"),htmlFor:u,children:t?.heading}),t?.description&&(0,T.jsx)(Yt,{tag:"p",className:qt("font-normal leading-5 m-0",g[a].description,i&&"text-text-disabled"),variant:"help",children:t?.description})]}):null,[t,a,i]);return(0,T.jsxs)("div",{className:qt("inline-flex items-center justify-center gap-2",!!t&&"items-start",i&&"cursor-not-allowed"),children:[(0,T.jsxs)("label",{className:qt("relative flex items-center justify-center rounded-full p-0.5",!i&&"cursor-pointer"),htmlFor:u,children:[(0,T.jsx)("input",{ref:d,id:u,type:"checkbox",className:qt("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",v[f].checkbox,g[a].checkbox,i&&"cursor-not-allowed disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled",l),checked:b(),onChange:e=>{if(i)return;const t=e.target.checked;m||h(t),"function"==typeof o&&o(t)},disabled:i,...c}),(0,T.jsx)("span",{className:qt("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",v[f].icon,i&&"cursor-not-allowed peer-disabled:text-border-disabled"),children:s?(0,T.jsx)(Tf,{className:qt(g[a]?.icon)}):(0,T.jsx)(rn,{className:qt(g[a]?.icon)})})]}),!!t&&y()]})});Pf.displayName="Checkbox";const Nf=(0,Me.createContext)(void 0),Rf=()=>{const e=(0,Me.useContext)(Nf);if(!e)throw new Error("Table components must be used within Table component");return e},_f=({children:e,className:t,checkboxSelection:n=!1,...r})=>{const o={checkboxSelection:n},s=Me.Children.toArray(e).find(e=>Me.isValidElement(e)&&e.type===Of),i=Me.Children.toArray(e).filter(e=>Me.isValidElement(e)&&e.type!==Of);return(0,T.jsx)(Nf.Provider,{value:o,children:(0,T.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,T.jsx)("div",{className:"overflow-x-auto w-full",children:(0,T.jsx)("div",{className:"relative",children:(0,T.jsx)("table",{className:qt("table-fixed min-w-full border-collapse border-spacing-0",t),...r,children:i})})}),s]})})},Af=({children:e,className:t,selected:n,onChangeSelection:r,indeterminate:o,disabled:s,...i})=>{const{checkboxSelection:a}=Rf();return(0,T.jsx)("thead",{className:qt("bg-background-secondary border-x-0 border-t-0 border-b-0.5 border-solid border-border-subtle",t),...i,children:(0,T.jsxs)("tr",{children:[a&&(0,T.jsx)("th",{scope:"col",className:"relative px-5.5 w-11 overflow-hidden",children:(0,T.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,T.jsx)(Pf,{size:"sm",checked:n,indeterminate:o,disabled:s,onChange:e=>{"function"==typeof r&&r(e)},"aria-label":n?"Deselect all":"Select all"})})}),e]})})},Mf=({children:e,className:t,...n})=>(0,T.jsx)("th",{scope:"col",className:qt("p-3 text-left text-sm font-medium leading-5 text-text-primary",t),...n,children:e}),Lf=({children:e,className:t,...n})=>(0,T.jsx)("tbody",{className:qt("bg-background-primary divide-y-0.5 divide-x-0 divide-solid divide-border-subtle",t),...n,children:e}),If=({children:e,selected:t,value:n,className:r,onChangeSelection:o,...s})=>{const{checkboxSelection:i}=Rf();return(0,T.jsxs)("tr",{className:qt("hover:bg-background-secondary",t&&"bg-background-secondary",r),...s,children:[i&&(0,T.jsx)("td",{className:"relative px-5.5 w-11 overflow-hidden",children:(0,T.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,T.jsx)(Pf,{size:"sm",checked:t,onChange:e=>{"function"==typeof o&&o(e,n)},"aria-label":"Select row"})})}),e]})},Df=({children:e,className:t,...n})=>(0,T.jsx)("td",{className:qt("px-3 py-3.5 text-sm font-normal leading-5 text-text-secondary",t),...n,children:e}),Of=({children:e,className:t,...n})=>{const{checkboxSelection:r}=Rf();return(0,T.jsx)("div",{className:qt("px-3 py-3",r&&"px-4",t),...n,children:e})};_f.displayName="Table",Af.displayName="Table.Head",Mf.displayName="Table.HeadCell",Lf.displayName="Table.Body",If.displayName="Table.Row",Df.displayName="Table.Cell",Of.displayName="Table.Footer",_f.Head=Af,_f.HeadCell=Mf,_f.Body=Lf,_f.Row=If,_f.Cell=Df,_f.Footer=Of;const Ff=ze("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]]),Vf=ze("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),zf=({label:e,id:t,value:n,onChange:r,required:o=!1,placeholder:s="",helpText:i="",smartTags:a=[],type:l="text"})=>(0,T.jsxs)("div",{className:"space-y-1.5",children:[(0,T.jsxs)("div",{className:"flex items-end gap-1.5",children:[(0,T.jsx)("div",{className:"flex-1",children:(0,T.jsx)(ki,{id:t,type:l,value:n,onChange:r,label:(0,T.jsxs)(Yt,{size:"sm",className:"[&>span]:text-field-required",children:[e,o&&(0,T.jsx)("span",{children:" *"})]}),placeholder:s,size:"md",className:"[&>input]:text-field-input"})}),a.length>0&&(0,T.jsx)("div",{className:"mt-6",children:(0,T.jsxs)(hf,{placement:"bottom-start",className:"min-w-fit",children:[(0,T.jsx)(hf.Trigger,{children:(0,T.jsx)(Ys,{variant:"outline",size:"md",icon:(0,T.jsx)(Vf,{}),className:"min-w-fit [&_svg]:shrink-0","aria-label":(0,E.__)("Insert smart tag","suredonation")})}),(0,T.jsx)(hf.Portal,{id:"suredonation-dialog-root",children:(0,T.jsx)(hf.ContentWrapper,{children:(0,T.jsx)(hf.Content,{className:"w-60 max-h-80 overflow-y-auto",children:(0,T.jsx)(hf.List,{children:a.map((e,t)=>(0,T.jsxs)("div",{children:[(0,T.jsx)(Yt,{variant:"help",size:"xs",className:"p-2 text-text-primary font-medium text-sm",tabIndex:-1,children:e.label}),e.tags.map(e=>(0,T.jsx)(hf.Item,{className:"text-sm font-normal text-text-secondary hover:bg-background-secondary hover:text-text-primary focus:bg-background-secondary focus:text-text-primary",onClick:()=>{return t=e.tag,void r((n||"")+t);var t},children:e.title||e.tag},e.tag))]},e.label||t))})})})})]})})]}),i&&(0,T.jsx)(Yt,{size:"sm",variant:"help",className:"text-text-tertiary font-normal",children:i})]}),Bf={groups:window.suredonationFormEditor?.emailSmartTags||[]},$f=({data:e,onSave:t,onBack:n})=>{const{groups:r}=Bf,o={id:e.id||!1,status:void 0===e.status||e.status,trigger:e.trigger||"",name:e.name||(0,E.__)("New Notification","suredonation"),email_to:e.email_to||"",subject:e.subject||"",email_body:e.email_body||"",from_name:e.from_name||"{site_title}",from_email:e.from_email||"{admin_email}",reply_to:e.reply_to||""},[s,i]=(0,S.useState)(o),a=(0,S.useRef)(JSON.stringify(o)),l=(0,S.useMemo)(()=>s.id?JSON.stringify(s)!==a.current:!!s.email_to?.trim()&&!!s.subject?.trim(),[s]),c=(e,t)=>{i(n=>({...n,[e]:t}))};return(0,T.jsx)(da,{title:s.id?s.name:(0,E.__)("Add Notification","suredonation"),titleHelpText:(0,E.__)("Configure the email notification details.","suredonation"),showTitleHelpText:!0,onClickSave:()=>{const e=(s.email_to||"").trim(),r=(s.subject||"").trim();e&&r?t(s)&&(Xe.success((0,E.__)("Email notification saved.","suredonation")),n()):Xe.error((0,E.__)("Please provide a recipient email and subject line.","suredonation"))},onClickCancel:()=>{n()},saveBtnDisabled:!l,children:(0,T.jsxs)("div",{className:"space-y-5",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(Yt,{size:"sm",className:"mb-1.5 block",htmlFor:"sd-email-notification-name",children:(0,E.__)("Name","suredonation")}),(0,T.jsx)(ki,{id:"sd-email-notification-name",value:s.name,onChange:e=>c("name",e),placeholder:(0,E.__)("Notification name","suredonation"),size:"md"})]}),(0,T.jsx)(zf,{label:(0,E.__)("Send Email To","suredonation"),id:"sd-email-notification-to",value:s.email_to,onChange:e=>c("email_to",e),required:!0,placeholder:(0,E.__)("e.g. {donor_email} or [email protected]","suredonation"),helpText:(0,E.__)("Use smart tags or enter email addresses. Comma-separated values accepted.","suredonation"),smartTags:r}),(0,T.jsx)(zf,{label:(0,E.__)("Subject","suredonation"),id:"sd-email-notification-subject",value:s.subject,onChange:e=>c("subject",e),required:!0,placeholder:(0,E.__)("Email subject line…","suredonation"),smartTags:r}),(0,T.jsx)(kf,{content:s.email_body,handleContentChange:e=>c("email_body",e),editorId:`sd-email-notif-editor-${s.id||"new"}`,label:(0,E.__)("Email Message","suredonation"),smartTagGroups:r,height:250}),(0,T.jsx)(zf,{label:(0,E.__)("From Name","suredonation"),id:"sd-email-notification-from-name",value:s.from_name,onChange:e=>c("from_name",e),smartTags:r}),(0,T.jsx)(zf,{label:(0,E.__)("From Email","suredonation"),id:"sd-email-notification-from-email",value:s.from_email,onChange:e=>c("from_email",e),helpText:(0,E.__)("Notifications can use only one From Email so please enter a single address.","suredonation"),smartTags:r,type:"email"}),(0,T.jsx)(zf,{label:(0,E.__)("Reply-To Email","suredonation"),id:"sd-email-notification-reply-to",value:s.reply_to,onChange:e=>c("reply_to",e),smartTags:r,type:"email"})]})})},Wf="_suredonation_form_email_notifications",Uf=window.suredonationFormEditor?.defaultEmailNotifications||[],Hf=()=>{const[e,t]=(0,S.useState)(!1),[r,o]=(0,S.useState)([]),{editPost:s,savePost:i}=(0,n.useDispatch)(C.store),[a,l]=(0,S.useState)(!1),[c,d]=(0,S.useState)(!1),{sureformsMeta:u,hasSubscription:m}=(0,n.useSelect)(e=>{const t=e(C.store).getEditedPostAttribute("meta"),n=e(R.store).getBlocks(),r=e=>{for(const t of e){if("suredonation/payment"===t.name&&"subscription"===t.attributes?.paymentType)return!0;if(t.innerBlocks?.length&&r(t.innerBlocks))return!0}return!1};return{sureformsMeta:t,hasSubscription:r(n)}},[]),p=e=>e.trigger&&e.trigger.startsWith("subscription_"),h=(()=>{const e=u?.[Wf];if(e&&"string"==typeof e)try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return null})(),f=(0,S.useMemo)(()=>m?Uf:Uf.filter(e=>!p(e)),[m]),g=null!==h?h:f,v=m?g:g.filter(e=>!p(e));(0,S.useEffect)(()=>{null===h&&f.length>0&&(s({meta:{[Wf]:JSON.stringify(f)}}),d(!0))},[]),(0,S.useEffect)(()=>{if(!m||null===h)return;const e=h.some(e=>p(e));if(e)return;const t=Uf.filter(e=>p(e));if(0===t.length)return;const n=h.reduce((e,t)=>Math.max(e,parseInt(t?.id,10)||0),0),r=t.map((e,t)=>({...e,id:n+t+1})),o=[...h,...r];s({meta:{[Wf]:JSON.stringify(o)}}),d(!0)},[m]);const b=e=>{s({meta:{[Wf]:JSON.stringify(e)}}),d(!0)};return e?(0,T.jsx)($f,{data:r,onSave:e=>{let{email_to:t,subject:n}=e;if(t=(t||"").trim(),n=(n||"").trim(),!t||!n)return Xe.error((0,E.__)("Please provide a recipient email and subject line.","suredonation")),!1;const r=g.map(t=>t.id===e.id?e:t);return b(r),!0},onBack:()=>{t(!1)}}):(0,T.jsx)(da,{title:(0,E.__)("Email Notifications","suredonation"),titleHelpText:(0,E.__)("Configure email notifications sent after a donation is submitted through this form.","suredonation"),showTitleHelpText:!0,onClickSave:async()=>{l(!0);try{await i(),d(!1),Xe.success((0,E.__)("Email notifications saved.","suredonation"))}catch{Xe.error((0,E.__)("Failed to save email notifications.","suredonation"))}finally{l(!1)}},saveBtnDisabled:!c||a,isSaving:a,children:(0,T.jsxs)(_f,{className:"rounded-md",children:[(0,T.jsxs)(_f.Head,{children:[(0,T.jsx)(_f.HeadCell,{className:"w-16",children:(0,E.__)("Status","suredonation")}),(0,T.jsx)(_f.HeadCell,{children:(0,E.__)("Name","suredonation")}),(0,T.jsx)(_f.HeadCell,{children:(0,E.__)("Subject","suredonation")}),(0,T.jsx)(_f.HeadCell,{className:"w-16 text-right",children:(0,E.__)("Actions","suredonation")})]}),(0,T.jsx)(_f.Body,{children:v.map(e=>(0,T.jsxs)(_f.Row,{className:"hover:bg-background-secondary",children:[(0,T.jsx)(_f.Cell,{children:(0,T.jsx)(Ni,{size:"sm",checked:e.status,onChange:()=>(e=>{const t=g.map(t=>t.id===e.id?{...t,status:!t.status}:t);b(t)})(e)})}),(0,T.jsx)(_f.Cell,{children:e.name}),(0,T.jsx)(_f.Cell,{children:e.subject}),(0,T.jsx)(_f.Cell,{className:"text-right",children:(0,T.jsx)(Ti,{placement:"top",tooltipPortalId:"suredonation-dialog-root",content:(0,E.__)("Edit","suredonation"),children:(0,T.jsx)(Ys,{variant:"ghost",size:"xs",className:"text-icon-secondary",onClick:()=>{return n=e,t(!0),void o(n);var n},icon:(0,T.jsx)(Ff,{className:"size-4"})})})})]},e.id))})]})})},qf=(e=!1)=>{const t=[{id:"confirmation_settings",label:(0,E.__)("Confirmation Settings","suredonation"),icon:e?(0,T.jsx)(We,{}):(0,T.jsx)(We,{size:18}),...e&&{component:(0,T.jsx)(Ef,{})}},{id:"email_notifications",label:(0,E.__)("Email Notifications","suredonation"),icon:e?(0,T.jsx)(Ue,{}):(0,T.jsx)(Ue,{size:18}),...e&&{component:(0,T.jsx)(Hf,{})}}];return(0,$e.applyFilters)("sd.formSettings.tabs",t)},Kf=({popoverAnchor:e,setOpenPopover:t,hidePopover:n,setHidePopover:r,onTabClick:o})=>{const s=qf(!1).filter(e=>!e.parent);return(0,T.jsx)(_.Popover,{resize:!0,hidden:n,placement:"bottom-end",anchor:e,onFocusOutside:n=>{e?.contains(n.relatedTarget)||(n.relatedTarget?.className?.includes("media-modal")?r(!0):t(!1))},className:"suredonation-form-settings-popover",children:(0,T.jsx)("div",{className:"suredonation-form-settings-container",children:(0,T.jsx)("div",{className:"suredonation-form-settings-group",children:s.map(e=>(0,T.jsxs)("button",{className:"suredonation-form-settings-nav-item",onClick:()=>{return n=e.id,o(n),void t(!1);var n},children:[e.icon&&(0,T.jsx)("span",{className:"suredonation-form-settings-nav-item-icon",children:e.icon}),(0,T.jsx)("span",{className:"suredonation-form-settings-nav-item-label",children:e.label})]},e.id))})})})},Gf=(0,Me.createContext)({}),Yf=()=>(0,Me.useContext)(Gf),Xf={open:{opacity:1},exit:{opacity:0}},Zf={duration:.2},Jf=({open:e,setOpen:t,children:n,trigger:r=null,className:o,exitOnClickOutside:s=!1,exitOnEsc:i=!0,design:a="simple",scrollLock:l=!0})=>{const c=void 0!==e&&void 0!==t,[d,u]=(0,Me.useState)(!1),m=(0,Me.useRef)(null),p=(0,Me.useRef)(null),h=(0,Me.useMemo)(()=>c?e:d,[e,d]),f=(0,Me.useMemo)(()=>c?t:u,[u,t]),{refs:g,context:v}=Ts({open:h,onOpenChange:f}),b=ks(v),y=Es(v,{enabled:s||i,escapeKey:i,outsidePress:s}),x=Vs(v,{role:"dialog"}),{getFloatingProps:w}=_s([b,y,x]),k=()=>{h||f(!0)},j=(0,Me.useCallback)(()=>(0,Me.isValidElement)(r)?(0,Me.cloneElement)(r,{onClick:Kt(k,r?.props?.onClick),ref:g.setReference,"aria-haspopup":"dialog","aria-expanded":h}):"function"==typeof r?r({onClick:k}):null,[r,k,g.setReference,h]);return(0,T.jsxs)(T.Fragment,{children:[j(),(0,T.jsx)(Gf.Provider,{value:{open:h,setOpen:f,handleClose:()=>{h&&f(!1)},design:a,context:v,getFloatingProps:w,refs:g,dialogContainerRef:p,dialogRef:m,scrollLock:l,className:o},children:n})]})};Jf.displayName="Dialog";const Qf=({children:e,className:t})=>{const{open:n,handleClose:r,context:o,getFloatingProps:s,dialogRef:i,scrollLock:a,dialogContainerRef:l,className:c,refs:d}=Yf();return(0,T.jsx)(of,{children:n&&(0,T.jsx)(ys,{ref:l,lockScroll:a,className:qt("z-999999",c),"aria-modal":"true",children:(0,T.jsx)(gs,{context:o,...d?.reference&&{returnFocus:d.reference},children:(0,T.jsx)(Uh.div,{className:"fixed inset-0 overflow-y-auto",initial:"exit",animate:"open",exit:"exit",variants:Xf,role:"dialog","aria-modal":"true",transition:Zf,children:(0,T.jsx)("div",{className:"flex items-center justify-center min-h-full",children:(0,T.jsx)("div",{ref:e=>{e&&(i.current=e,o&&o.refs.setFloating(e))},...s?.(),className:qt("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})})})})})})};Qf.displayName="Dialog.Panel";const eg=({children:e,...t})=>(0,T.jsx)(ls,{...t,children:e});eg.displayName="Dialog.Portal";const tg=({className:e,...t})=>{const{open:n,dialogContainerRef:r}=Yf();return r?.current?(0,T.jsx)(T.Fragment,{children:(0,Rr.createPortal)((0,T.jsx)(of,{children:n&&(0,T.jsx)(Uh.div,{className:qt("fixed inset-0 -z-10 bg-background-inverse/90",e),...t,initial:"exit",animate:"open",exit:"exit",variants:Xf,transition:Zf})}),r.current)}):null};tg.displayName="Dialog.Backdrop";const ng=({children:e,className:t,...n})=>(0,T.jsx)("div",{className:qt("space-y-2 px-5 pt-5 pb-1",t),...n,children:e});ng.displayName="Dialog.Header";const rg=({children:e,as:t="h3",className:n,...r})=>(0,T.jsx)(t,{className:qt("text-base font-semibold text-text-primary m-0 p-0",n),...r,children:e});rg.displayName="Dialog.Title";const og=({children:e,as:t="p",className:n,...r})=>(0,T.jsx)(t,{className:qt("text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",n),...r,children:e});og.displayName="Dialog.Description";const sg=({className:e,...t})=>(0,T.jsx)("button",{className:qt("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,T.jsx)(li,{className:"size-4 text-text-primary shrink-0"})}),ig=({children:e,as:t=Me.Fragment,...n})=>{const{handleClose:r}=Yf();return e?t===Me.Fragment?"function"==typeof e?e({close:r}):(0,Me.cloneElement)(e,{onClick:r}):(0,T.jsx)(t,{...n,onClick:r,"aria-label":"Close dialog",children:e}):(0,T.jsx)(sg,{onClick:r,...n})};ig.displayName="Dialog.CloseButton";const ag=({children:e,className:t,...n})=>(0,T.jsx)("div",{className:qt("px-5",t),...n,children:e});ag.displayName="Dialog.Body";const lg=({children:e,className:t})=>{const{design:n,handleClose:r}=Yf();return(0,T.jsx)("div",{className:qt("p-4 flex justify-end gap-3",{"bg-background-secondary":"footer-divided"===n},t),children:e?"function"==typeof e?e({close:r}):e:null})};lg.displayName="Dialog.Footer",Jf.Panel=Qf,Jf.Portal=eg,Jf.Title=rg,Jf.Description=og,Jf.CloseButton=ig,Jf.Header=ng,Jf.Body=ag,Jf.Footer=lg,Jf.Backdrop=tg;const cg={"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"},dg={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"},ug="bg-background-inverse border-background-inverse",mg={light:"text-icon-secondary",dark:"text-icon-inverse"};let pg=!1;const hg=({toastItem:e,title:t="",content:n="",autoDismiss:r=!0,dismissAfter:o=5e3,theme:s="light",design:i="stack",icon:a,variant:l="neutral",removeToast:c})=>{const d=(0,Me.useRef)(0),u=(0,Me.useRef)(0),m=(0,Me.useRef)(),p=(e,t=o)=>{if(r&&!(o<0))return d.current=(new Date).getTime(),setTimeout(()=>{"function"==typeof c&&c(e.id)},t)};(0,Me.useEffect)(()=>{const t=o;return m.current=p(e,t),()=>{clearTimeout(m.current)}},[]),(0,Me.useEffect)(()=>{!e?.dismiss||"function"!=typeof c||c(e.id)},[e]);const h=()=>{"function"==typeof c&&e?.action?.onClick?.(()=>c(e.id))};let f=null;return"stack"===i&&(f=(0,T.jsx)("div",{className:qt("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===s?ug:dg?.[l],"w-[22.5rem]"),onMouseEnter:()=>{clearTimeout(m.current),u.current=(new Date).getTime()},onMouseLeave:()=>{m.current=p(e,o-(u.current-d.current))},children:"custom"!==e.type?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Js({variant:l,icon:a,theme:s})}),(0,T.jsxs)("div",{className:"flex flex-col items-start justify-start gap-0.5 mr-6",children:[ei({title:t,theme:s}),ti({content:n,theme:s}),e?.action?.label&&"function"==typeof e?.action?.onClick&&(0,T.jsx)("div",{className:"mt-2.5",children:Qs({actionLabel:e?.action?.label,actionType:e?.action?.type??"button",onAction:h,theme:s})})]}),(0,T.jsx)("div",{className:"absolute right-4 top-4 [&_svg]:size-5",children:(0,T.jsx)("button",{className:qt("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",mg[s]??mg.light),onClick:()=>{"function"==typeof c&&c(e.id)},children:(0,T.jsx)(li,{})})})]}):e?.jsx?.({close:()=>c(e.id),action:e?.action?{...e?.action,onClick:h}:null})})),"inline"===i&&(f=(0,T.jsxs)("div",{className:qt("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===s?ug:dg?.[l],"lg:w-[47.5rem] w-full"),children:[(0,T.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Js({variant:l,icon:a,theme:s})}),(0,T.jsxs)("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0",children:[ei({title:t,theme:s}),ti({content:n,theme:s})]}),(0,T.jsx)("div",{className:"absolute right-3 top-3 [&_svg]:size-5",children:(0,T.jsx)("button",{className:qt("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",mg[s]??mg.light),onClick:()=>c(e.id),children:(0,T.jsx)(li,{})})})]})),f},fg=(e=>(0,Me.memo)(t=>{const n=t.singleTon;return pg&&n?null:(pg=!0,(0,T.jsx)(e,{...t}))}))(({position:e="top-right",design:t="stack",theme:n="light",className:r="",autoDismiss:o=!0,dismissAfter:s=5e3})=>{const[i,a]=(0,Me.useState)([]);(0,Me.useEffect)(()=>{Ye.subscribe(e=>{e?.dismiss?a(t=>t.map(t=>t.id===e.id?{...t,dismiss:!0}:t)):setTimeout(()=>{(0,Rr.flushSync)(()=>a(t=>-1!==t.findIndex(t=>t.id===e.id)?t.map(t=>t.id===e.id?{...t,...e}:t):[...t,e]))})})},[]);const l=e=>{a(t=>t.filter(t=>t.id!==e))};return(0,T.jsx)("ul",{className:qt("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",cg[e]??cg["top-right"],r),children:(0,T.jsx)(of,{initial:!1,children:i.map(e=>(0,T.jsx)(Uh.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,T.jsx)(hg,{toastItem:e,title:e.title,content:e?.description,icon:e?.icon??void 0,design:e?.design??t,autoDismiss:e?.autoDismiss??o,dismissAfter:e?.dismissAfter??s,removeToast:l,variant:e.type,theme:e?.theme??n})},e.id))})})}),gg=ze("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vg=({tabs:e,selectedTab:t,setSelectedTab:n})=>(0,T.jsx)("nav",{className:"shrink-0 w-[17rem] p-2 h-full bg-background-primary overflow-y-auto","aria-label":(0,E.__)("Form settings navigation","suredonation"),children:(0,T.jsx)("ul",{className:"w-full h-full bg-background-primary p-2 space-y-1 m-0",children:e.map(e=>{if(void 0!==e.parent)return null;const r=e.id===t;return(0,T.jsx)("li",{children:(0,T.jsxs)("button",{className:Di("w-full flex items-center justify-start gap-2.5 px-2 py-2 rounded-md border-0 outline-none focus:outline-none focus:ring-1 focus:ring-focus transition-[colors,box-shadow] duration-200 cursor-pointer",r?"bg-brand-background-50 text-text-primary":"bg-transparent text-text-secondary hover:bg-brand-background-50"),onClick:(o=e.id,()=>{n(o)}),"aria-current":r?"true":void 0,children:[(0,T.jsx)("span",{className:Di("[&>svg]:size-5 shrink-0 h-[20px]",r?"text-icon-interactive [&>svg]:!text-icon-interactive":"text-icon-secondary [&>svg]:!text-icon-secondary"),children:e.icon}),(0,T.jsx)("span",{className:"text-base font-normal text-left break-words whitespace-normal",children:e.label})]})},e.id);var o})})}),bg=(0,S.memo)(({open:e,setOpen:t,targetTab:r,close:o})=>{const[s,i]=(0,S.useState)(null),[a,l]=(0,S.useState)(r??"confirmation_settings");(0,S.useLayoutEffect)(()=>{let e=document.getElementById("suredonation-dialog-root");e||(e=document.createElement("div"),e.id="suredonation-dialog-root",document.body.appendChild(e)),i(e)},[]),(0,S.useLayoutEffect)(()=>{r&&e&&l(r)},[r,e]);const c=(0,n.useSelect)(e=>e("core/edit-post")?.isFeatureActive?.("fullscreenMode"),[]);(0,S.useLayoutEffect)(()=>{const e=()=>{window.requestAnimationFrame(()=>{const e=document.querySelector(".suredonation-dialog-panel");if(!e)return;const t=document.getElementById("adminmenu"),n=t?t.offsetWidth+40:0;c?(e.style.removeProperty("margin-left"),e.style.removeProperty("margin-right")):(e.style.marginLeft=`${n}px`,e.style.marginRight="40px")})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[e,c]);const d=qf(!0);return s&&(0,S.createPortal)((0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(Jf,{design:"simple",exitOnEsc:!0,scrollLock:!0,open:e,setOpen:t,className:"[&>div>div]:h-full z-99999 border-radius-none",children:[(0,T.jsx)(Jf.Backdrop,{}),(0,T.jsx)(Jf.Panel,{className:"h-full w-full m-auto rounded-none suredonation-dialog-panel",children:(0,T.jsxs)(ia,{direction:"column",gap:"none",className:"w-full h-full divide-y divide-x-0 divide-solid divide-border-subtle",children:[(0,T.jsxs)(ia,{className:"py-3 px-4",justify:"between",children:[(0,T.jsx)(la,{tag:"h6",title:(0,E.__)("Form Settings","suredonation"),size:"xs"}),(0,T.jsx)(Ys,{variant:"ghost",size:"sm",className:"p-1",onClick:o,icon:(0,T.jsx)(gg,{}),"aria-label":(0,E.__)("Close form settings","suredonation")})]}),(0,T.jsxs)("div",{className:"w-full h-[calc(100%-3rem)] flex justify-start items-stretch",children:[(0,T.jsx)(vg,{tabs:d,selectedTab:a,setSelectedTab:l}),(0,T.jsx)("div",{className:"p-8 w-full h-full bg-background-secondary overflow-y-auto",children:(0,T.jsx)("div",{className:"w-full mx-auto h-full max-w-[43.5rem]",children:d.find(({id:e})=>e===a)?.component})})]})]})})]}),(0,T.jsx)(fg,{position:"top-center"})]}),s)}),yg=()=>{const[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),[l,c]=(0,S.useState)(null);return(0,T.jsxs)("div",{className:"suredonation-form-settings-button-wrapper",children:[(0,T.jsxs)("button",{ref:t,className:"suredonation-form-settings-button",onClick:()=>{const e=!n;r(e),e&&s(!1)},"aria-expanded":n,"aria-haspopup":"true",children:[(0,E.__)("Form Settings","suredonation"),(0,T.jsx)("span",{className:"suredonation-form-settings-button-icon",children:(0,T.jsx)(Be,{})})]}),n&&(0,T.jsx)(Kf,{popoverAnchor:e,setOpenPopover:r,hidePopover:o,setHidePopover:s,onTabClick:e=>{c(e),a(!0)}}),(0,T.jsx)(bg,{open:i,setOpen:a,targetTab:l,close:()=>{a(!1)}})]})},xg=window.wp.coreData,wg=()=>{const e=(0,n.useSelect)(e=>e("core/editor").getCurrentPostId(),[]),[t,r]=(0,xg.useEntityProp)("postType","suredonation_form","title",e),o=(0,S.useRef)(null);return(0,S.useEffect)(()=>{o.current&&!t&&o.current.focus()},[]),(0,T.jsx)(_.TextControl,{__next40pxDefaultSize:!0,ref:o,className:"suredonation-form-title-input",placeholder:(0,E.__)("Form Title","suredonation"),value:t||"",onChange:e=>r(e),autoComplete:"off"})},kg=()=>(0,T.jsx)(R.Inserter,{position:"bottom center",__experimentalIsQuick:!0,className:"suredonation-custom-block-inserter",renderToggle:({onToggle:e,disabled:t,isOpen:n})=>(0,T.jsx)(_.Tooltip,{text:(0,E.__)("Add Block","suredonation"),children:(0,T.jsx)(_.Button,{className:"block-editor-button-block-appender suredonation-custom-block-inserter-button",onClick:e,"aria-haspopup":"true","aria-expanded":n,disabled:t,children:(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",focusable:"false","aria-hidden":"true",children:(0,T.jsx)("path",{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})})})}),isAppender:!0});wp.domReady(()=>{(()=>{_e("core/edit-post")?.isEditorSidebarOpened?.()||Ae("core/edit-post")?.openGeneralSidebar?.("edit-post/document");const e="sd-form-editor/sd-description";_e("core/editor")?.isEditorPanelEnabled?.(e)||Ae("core/edit-post")?.toggleEditorPanelEnabled?.(e),_e("core/editor")?.isEditorPanelOpened?.(e)||Ae("core/edit-post")?.toggleEditorPanelOpened?.(e)})(),(()=>{const e=document.getElementById("editor");if(!e)return;const t=document.createElement("div");t.classList.add("suredonation-form-settings-root");const n=(0,S.createRoot)(t),r=wp.data.subscribe(function(){setTimeout(function(){if(document.querySelector(".suredonation-form-settings-root"))return void r();const o=e.querySelector(".edit-post-header__settings")||e.querySelector(".editor-header__settings");o&&(o.prepend(t),n.render((0,T.jsx)(yg,{})),r())},1)})})(),(()=>{const e=document.createElement("div");e.classList.add("suredonation-form-title-root");const t=(0,S.createRoot)(e),n=wp.data.subscribe(()=>{setTimeout(()=>{if(document.querySelector(".suredonation-form-title-root"))return void n();const r=document.querySelector(".edit-post-header__center")||document.querySelector(".editor-header__center");if(r){const o=document.querySelector(".editor-post-title__block");o&&o.remove(),r.appendChild(e),t.render((0,T.jsx)(wg,{})),n()}},1)})})(),(()=>{let e=null,t=null,n=null,r=null;const o=()=>{r&&e&&r.lastElementChild!==e&&r.appendChild(e)};wp.data.subscribe(()=>{setTimeout(()=>{const s=(()=>{let e=document.querySelector(".is-root-container.block-editor-block-list__layout");if(e)return e;const t=document.querySelector('iframe[name="editor-canvas"]'),n=t&&t.contentDocument;return n&&(e=n.querySelector(".is-root-container.block-editor-block-list__layout"),e)?e:null})();s&&(s===r&&s.contains(e)||(s=>{n&&(n.disconnect(),n=null),t&&(t.unmount(),t=null),r=s,e=s.ownerDocument.createElement("div"),e.classList.add("suredonation-custom-block-inserter-root"),t=(0,S.createRoot)(e),s.appendChild(e),t.render((0,T.jsx)(kg,{})),n=new MutationObserver(o),n.observe(s,{childList:!0})})(s))},1)})})()})})()})();