@spscommerce/ds-react 8.53.3 → 8.53.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4146 -4138
- package/lib/index.umd.cjs +104 -104
- package/lib/utils/selectChildren.d.ts +2 -0
- package/package.json +12 -14
- package/vite.config.mjs +3 -1
package/lib/index.umd.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(x,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("@spscommerce/utils"),require("moment-timezone"),require("@spscommerce/ds-shared"),require("@spscommerce/i18n"),require("react-dom"),require("@spscommerce/ds-colors"),require("@sps-woodland/tabs"),require("@sps-woodland/illustrations")):typeof define=="function"&&define.amd?define(["exports","react","@spscommerce/utils","moment-timezone","@spscommerce/ds-shared","@spscommerce/i18n","react-dom","@spscommerce/ds-colors","@sps-woodland/tabs","@sps-woodland/illustrations"],E):(x=typeof globalThis<"u"?globalThis:x||self,E(x.DSReact={},x.React,x.utils,x.moment$3,x.dsShared,x.i18n,x.ReactDOM,x.dsColors,x.tabs,x.illustrations))})(this,(function(x,E,S,Me,A,he,Ln,Nr,xm,gi){"use strict";function hi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=hi(E),pn=hi(Me);function bi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=bi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function K(){for(var e,t,n=0,o="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=bi(e))&&(o&&(o+=" "),o+=t);return o}const km="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let We=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=km[n[e]&63];return t};function Rt(e){return E.useRef(e||We())}function Ge(e,t){const n=Rt(e),o=E.useRef(`${n.current}_ctrl`);return E.useEffect(()=>{t&&(t.id=o.current,t.update())},[t]),{wrapperId:n.current||void 0,controlId:o.current}}function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xr,vi;function Mm(){if(vi)return xr;vi=1;var e="[object Object]";function t(p){var f=!1;if(p!=null&&typeof p.toString!="function")try{f=!!(p+"")}catch{}return f}function n(p,f){return function(g){return p(f(g))}}var o=Function.prototype,a=Object.prototype,s=o.toString,i=a.hasOwnProperty,l=s.call(Object),c=a.toString,d=n(Object.getPrototypeOf,Object);function m(p){return!!p&&typeof p=="object"}function u(p){if(!m(p)||c.call(p)!=e||t(p))return!1;var f=d(p);if(f===null)return!0;var g=i.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&s.call(g)==l}return xr=u,xr}var Lm=Mm();const yi=Ir(Lm),Ze=new Set,un=new Set,wt=new Set,So=new Set;function Ei(e){Ze.has(e)||wt.has(e)||So.has(e)||un.add(e)}function Ti(e){Ze.has(e)||wt.has(e)||un.has(e)||So.add(e)}const Fe=pn.default||pn,mn="MM/DD/YYYY",_m="MM/DD/YYYY hh:mm A",Pm="MM/DD/YYYY HH:mm",Om="hh:mm A",Bm="HH:mm",Rm=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,_n=Symbol("Date Parse Error");function fn(e){return Fe.isMoment(e)?e.year()*1e4+(e.month()+1)*100+e.date():e.year*1e4+e.month*100+e.date}const j=Object.freeze({createFrom(e,t){if(!e)return null;if(typeof e=="string"){if(t){const n=Fe(e,t,!0);if(n.isValid())return Object.freeze({year:n.year(),month:n.month()+1,date:n.date()})}else{const n=Rm.exec(e);if(n){const[,o,a,s]=n;return Object.freeze({year:Number(s),month:Number(o),date:Number(a)})}}return Object.freeze({[_n]:!0,year:void 0,month:void 0,date:void 0})}return Object.freeze({year:e.year(),month:e.month()+1,date:e.date()})},createMomentFrom(e,t){if(!e)return null;let n=null;return typeof e=="string"?t?n=Fe(e,t,!0):n=Fe(e):Fe.isMoment(e)?n=e:n=j.toMoment(e),n!==null&&Fe.isMoment(n)&&n.isValid()?n:Object.freeze({[_n]:!0,year:void 0,month:void 0,date:void 0})},getRangeSeparator(e){return e?.includes("-")?"/":"-"},createRangeFrom(e,t){if(!e)return null;if(t){const n=j.getRangeSeparator(t),o=new RegExp(`[^\\d]*${n}[^\\d]*`);return e.split(o).slice(0,2).map(a=>j.createFrom(a,t))}else return e.split(/[^\d]*-[^\d]*/).slice(0,2).map(n=>j.createFrom(n))},isValid(e){return e?Fe.isMoment(e)?e.isValid():typeof e=="object"&&typeof e.year=="number"&&typeof e.month=="number"&&typeof e.date=="number"&&j.toMoment(e)?.isValid():!1},nullifyInvalidDate(e){return j.isValid(e)?e:null},toMoment(e){return e?Fe.isMoment(e)?e:Fe({...e,month:e.month-1}):null},toString(e,t){const n=j.toMoment(e);return n&&n.isValid()?n.format(t||mn):""},toStringRange(e,t){if(!e)return"";const n=j.getRangeSeparator(t);return e.slice(0,2).map(o=>j.toString(o,t)).join(n)},toDateTimeString(e,t=!1,n){return e&&Fe.isMoment(e)&&e.isValid()?n?t?e.format(`${n} ${Bm}`):e.format(`${n} ${Om}`):t?e.format(Pm):e.format(_m):""},toDateTimeStringRange(e,t=!1,n){if(!e)return"";const o=j.getRangeSeparator(n);return e.map(a=>j.toDateTimeString(a,t,n)).join(o)},create(){const e=new Date;return Object.freeze({year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()})},isSameDate(e,t){return e&&t&&e.year===t.year&&e.month===t.month&&e.date===t.date},isSameMonth(e,t){return e&&t&&e.year===t.year&&e.month===t.month},isAfter(e,t){return!e||!t?null:fn(e)>fn(t)},isBefore(e,t){return!e||!t?null:fn(e)<fn(t)},isInRange(e,t,n=!0){if(!e||!t||!t[0]||!t[1])return null;const o=fn(e),[a,s]=t.map(fn);return a&&s&&(n&&o>=a&&o<=s||!n&&o>a&&o<s)},prevMonth(e){return Object.freeze({year:e.month===1?e.year-1:e.year,month:e.month-1||12,date:e.date})},nextMonth(e){return Object.freeze({year:e.month===12?e.year+1:e.year,month:e.month+1>12?1:e.month+1,date:e.date})},createRangeFromPreset(e,t){if(typeof e.definition=="function")return e.definition();const n=Fe(),o=n.clone().subtract(Fe.duration(e.definition));return[j.createFrom(o,t),j.createFrom(n,t)]},createDateTimeRangeFromPreset(e){if(typeof e.definition=="function")return e.definition();const t=Fe().subtract(Fe.duration(e.definition)).startOf("day"),n=Fe().endOf("day");return[t,n]},splitMomentInDateTimeParts(e,t=!1,n,o=!1){let a="";t?a=o?"23:59":"00:00":a=o?"11:59":"12:00";const s=o?"PM":"AM";return e&&Fe.isMoment(e)&&e.isValid()?j.toDateTimeString(e,t,n).split(" "):["",a,t?void 0:s]},getCurrentMoment(){return Fe()},validateTimeString(e,t=!1){if(!e)return!0;const n=e.split(":"),o=n[0]||"0",a=n[1]||"0",s=Number.isNaN(Number(o))?NaN:parseInt(o,10),i=Number.isNaN(Number(a))?NaN:parseInt(a,10),l=n.length<=2&&o.length<=2&&a.length<=2;return t?l&&s>=0&&s<=23&&i>=0&&i<=59:l&&(!Number.isNaN(s)&&o.length===1||s>=1)&&s<=12&&i>=0&&i<=59},padIncompleteTimeString(e,t=!1){if(!e)return"";const n=e.split(":"),o=parseInt(n[0]||"0",10),a=parseInt(n[1]||"0",10);if(t){const s=o<10?`0${o}`:`${o}`,i=a<10?`0${a}`:`${a}`;return`${s}:${i}`}else{const s=o===0?"12":o<10?`0${o}`:`${o}`,i=a<10?`0${a}`:`${a}`;return`${s}:${i}`}}}),kr=["01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00"],Mr=["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"];let go=mn;function wi(e){go=e}const Pn=function(t){if(Array.isArray(t)){const n=Pn(t[0]),o=Pn(t[1]);return n||o}if(t&&t.hasOwnProperty("year")){if(t[_n])return{dateFormat:go};if(!j.isValid(t))return{dateValidity:!0}}return null};Ze.add("dateFormat"),Ze.add("dateValidity");const Ci=function(t){if(Array.isArray(t)){const n=Pn(t);if(n)return n;if(t&&j.isBefore(t[1],t[0]))return{dateRangeOrder:!0}}return null};Ze.add("dateRangeOrder");const Di=function({minDate:t,maxDate:n}){function o(a){const s=j.isBefore(a,t),i=j.isAfter(a,n),l={minExceeded:s?j.toString(t,go):null,maxExceeded:i?j.toString(n,go):null};return s||i?{dateConstraint:l}:null}return function(s){if(!s)return null;if(Array.isArray(s)){const i=o(s[0]),l=o(s[1]);return i||l}return s.hasOwnProperty("year")?o(s):null}};Ze.add("dateConstraint");const Fm=Object.freeze(Object.defineProperty({__proto__:null,date:Pn,dateConstraint:Di,dateRange:Ci,setDateFormat:wi},Symbol.toStringTag,{value:"Module"}));function Mt(e,t){for(const n of[].concat(e)){const o=t(n);if(o)return o}return null}const Am=function(t){function n(o){return Number(o)>=t?null:{min:t}}return o=>Mt(o,n)};Ze.add("min");const $m=function(t){function n(o){return Number(o)<=t?null:{max:t}}return o=>Mt(o,n)};un.add("max");const Vm=function(t){return typeof t>"u"||t===null||t===""||Number.isNaN(t)||t?.length===0?{required:!0}:null};un.add("required");const Km=function(t){function n(o){return o===void 0||o.toString().length<t?{minLength:t}:null}return o=>Mt(o,n)};Ze.add("minLength");const Hm=function(t){function n(o){return o==null||Array.isArray(o)&&o.length<t?{minLengthArray:t}:null}return o=>n(o)};Ze.add("minLengthArray");const Wm=function(t){function n(o){return o===void 0||o.toString().length<=t?null:{maxLength:t}}return o=>Mt(o,n)};wt.add("maxLength");const Gm=function(t){function n(o){return o==null||Array.isArray(o)&&o.length<=t?null:{maxLengthArray:t}}return o=>n(o)};Ze.add("maxLengthArray");const Um=function(t){const n=t instanceof RegExp?t:new RegExp(t);function o(a){return n.test(a)?null:{pattern:t}}return a=>Mt(a,o)};Ze.add("pattern");const zm=function(e){function t(n){return new RegExp("^\\p{L}*$","u").test(n)?null:{alpha:!0}}return Mt(e,t)};wt.add("alpha");const jm=function(e){function t(n){return/^[0-9,. ]*$/.test(n)?null:{numeric:!0}}return Mt(e,t)};wt.add("numeric");const Ym=function(e){function t(n){return/^-?[0-9,. ]*$/.test(n)?null:{positiveOrNegativeNumber:!0}}return Mt(e,t)};wt.add("positiveOrNegativeNumber");const qm=function(e){function t(n){return/^[^0-9]*$/.test(n)?null:{nonNumeric:!0}}return Mt(e,t)};wt.add("nonNumeric");const ho=Object.freeze({...Fm,min:Am,max:$m,required:Vm,minLength:Km,minLengthArray:Hm,maxLength:Wm,maxLengthArray:Gm,pattern:Um,alpha:zm,numeric:jm,nonNumeric:qm,positiveOrNegativeNumber:Ym,OnBlurErrorKeys:Ze});function bo(e,t=[]){const n=t.reduce((o,a)=>Object.assign(o,a(e)||{}),{});return Object.keys(n).length?n:null}var Ct=(e=>(e[e.ON_CHANGE=0]="ON_CHANGE",e[e.ON_BLUR=1]="ON_BLUR",e[e.ON_SUBMIT=2]="ON_SUBMIT",e))(Ct||{});function Jm(e,t={},n=[]){for(const[o,a]of Object.entries(t))a===0?Ei(o):a===2&&Ti(o);return r.useCallback(e,n)}class Yt{constructor(t,n){this.path=t,this.update=n,this.validators=[],this.#e=null,this.#t=null,this.#n=null,this.preventativeErrors=[],this.submitted=!1}#e;#t;#n;get errors(){return this.#e===null&&this.#t===null&&this.#n===null?null:{...this.#e??{},...this.#t??{},...this.#n??{}}}setValidators(t){return this.update(this.path,null,void 0,t),this}validate(t,n,o=!1){if(this.validators&&this.validators.length>0){const a=bo(t,this.validators);let s={onSubmit:{},onChange:{},onBlur:{}};a&&(s=Object.keys(a).reduce((i,l)=>(So.has(l)?i.onSubmit[l]=a[l]:un.has(l)?i.onChange[l]=a[l]:i.onBlur[l]=a[l],i),s)),(typeof n>"u"||n===Ct.ON_CHANGE)&&(this.#t=Object.keys(s.onChange).length===0?null:s.onChange),(typeof n>"u"||n===Ct.ON_BLUR)&&(this.#n=Object.keys(s.onBlur).length===0?null:s.onBlur),(typeof n>"u"||n===Ct.ON_SUBMIT)&&(this.#e=Object.keys(s.onSubmit).length===0?null:s.onSubmit,this.#t=Object.keys(s.onChange).length===0?null:s.onChange,this.#n=Object.keys(s.onBlur).length===0?null:s.onBlur),o||this.update(),this.isFocused()&&this.onFocus&&this.onFocus()}else this.errors&&(this.#e=null,this.#n=null,this.#t=null,o||this.update());return this}isValid(){return!this.errors||this.isPristine()}hasErrors(){return!!this.errors}isVisibilyInvalid(){return!this.isValid()}hasError(t){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,t)}hasPreventativeError(t){return this.preventativeErrors.includes(t)}hasPreventativeErrors(){return this.preventativeErrors.length>0}isRequired(){return this.validators&&this.validators.indexOf(ho.required)>-1}isSubmitted(){return this.submitted}onFocus(){}onBlur(){}}class On extends Yt{constructor(){super(...arguments),this.id=We(),this.focused=!1,this.pristine=!0}setValue(t){if(this.preventativeErrors=[],this.validators&&this.validators.length>0){const n=bo(t,this.validators);if(n&&Object.keys(n).filter(a=>wt.has(a)).length>0){this.preventativeErrors=Object.keys(n);return}}this.update(this.path,t)}isPristine(){return this.pristine}markAsPristine(){return this.pristine=!0,this.update(),this}markAsDirty(){return this.pristine=!1,this.update(),this}isFocused(){return this.focused}markAsFocused(){return this.focused=!0,this.update(),this.onFocus&&this.onFocus(),this}markAsBlurred(){return this.update(this.path,null,!0),this.onBlur&&this.onBlur(),this.preventativeErrors=[],this}markAsSubmitted(){return this.submitted=!0,this.update(this.path,null,!1,void 0,!0),this}}class qt extends On{constructor(t,n,o){const a=o?n:t,s=o||n;super(a,s),o&&this.inferMembers(t)}isFocused(){return super.isFocused()||this.rollup("isFocused")}isValid(){return super.isValid()&&this.rollup("isValid")}hasErrors(){return super.hasErrors()||Object.keys(this.fields).some(t=>this.fields[t].hasErrors())}contentsAreValid(){return this.rollup("isValid")&&this.rollup("contentsAreValid")}isPristine(){return super.isPristine()&&this.rollup("isPristine")}markAsPristine(){super.markAsPristine();for(const t of Object.keys(this.fields))this.fields[t].markAsPristine();return this}markAsDirty(){super.markAsDirty();for(const t of Object.keys(this.fields))this.fields[t].markAsDirty();return this}markAsBlurred(){super.markAsBlurred();for(const t of Object.keys(this.fields))this.fields[t].markAsBlurred();return this}markAsSubmitted(){super.markAsSubmitted();for(const t of Object.keys(this.fields))this.fields[t].markAsSubmitted();return this}inferSpsControl(t,n){return vo(t,[...this.path,n],this.update)}rollup(t){return Object.keys(this.fields).reduce((n,o)=>n&&(!this.fields[o][t]||this.fields[o][t]()),!0)}}class Ni extends qt{inferMembers(t){this.fields={};for(const n of Object.keys(t))this.fields[n]=this.inferSpsControl(t[n],n)}}class Ii extends qt{inferMembers(t){this.fields=t.map((n,o)=>this.inferSpsControl(n,String(o)))}}function vo(e,t,n){return e instanceof Yt?(e.path=t,e.update=n,e):Array.isArray(e)?new Ii(e,t,n):yi(e)?new Ni(e,t,n):new On(t,n)}function Bn(e,t){return t.length===0||!e?e:Bn(e.fields[t[0]],t.slice(1,t.length))}function Lr(e,t){if(t.length===0||!e)return[e];const n=t[0];if(t=t.slice(1,t.length),n==="*"){const o=Array.isArray(e.fields)?e.fields:Object.keys(e.fields).map(a=>e.fields[a]);return t.length===0?o:o.reduce((a,s)=>[...a,...Lr(s,t)],[])}return Lr(e.fields[n],t)}function _r(e,t,n){for(const o of Object.keys(t)){const a=t[o];for(const s of Lr(e,o.split(".")))s&&a&&n(s,a)}}function yo(e,t,n,o=!1,a=!1){_r(t,n,(s,i)=>{s.validators=typeof i=="function"?i(e):i,o&&s.validate(S.getPath(e,s.path),void 0,a)})}function Pr(e,t){const n=t[0];return t=t.slice(1),Array.isArray(e)?e.map((o,a)=>a===Number(n)?Pr(o,t):o):yi(e)?Object.keys(e).reduce((o,a)=>Object.assign(o,{[a]:a===n?Pr(e[a],t):e[a]}),{}):e}function Xm(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("The initial value of useSpsForm() hook must be an object.")}function xi(e,t={}){Xm(e);const[,n]=E.useState({}),o=E.useRef(!1);o.current=!1;const a=E.useRef(t),s=E.useCallback(p=>{const f=u.current;let g;if(p)if(p.path)if(p.markAsBlurred){const v=Bn(f.formMeta,p.path);if(v){v.focused=!1;const y=S.getPath(f.formValue,p.path);v.validate(y,Ct.ON_BLUR)}}else if(p.newValidators){if(a.current){const v=p.path.join(".");a.current={...a.current,[v]:p.newValidators},yo(f.formValue,f.formMeta,a.current,!0)}}else if(p.markAsSubmitted){const v=Bn(f.formMeta,p.path);if(v){v.submitted=!0;const y=S.getPath(f.formValue,p.path);v.validate(y,Ct.ON_SUBMIT)}}else g=Pr(f.formValue,p.path),S.setPath(g,p.path,p.value);else g=p.value;if(p?.updateFormOptions?.validators&&(a.current={...a.current,...p.updateFormOptions.validators},yo(f.formValue,f.formMeta,a.current,p.updateFormOptions?.runValidators??!0)),g){f.formMeta.submitted=!1,S.deepFreeze(g);const v=S.diff(f.formValue,g);for(const{type:b,key:h,parentPath:I,objects:[,C]}of v){const D=Bn(f.formMeta,I);if(typeof h!="symbol"&&D){let L;switch(b){case S.DiffChange.ADDITION:D.fields[h]=vo(C[h],[...I,h],l);break;case S.DiffChange.DELETION:Array.isArray(D.fields)?D.fields[h]=void 0:delete D.fields[h];break;case S.DiffChange.ALTERATION:L=vo(C[h],[...I,h],l),(L instanceof qt&&!(D.fields[h]instanceof qt)||!(L instanceof qt)&&D.fields[h]instanceof qt)&&(L.pristine=!1,D.fields[h]=L);break}}}const y=new Set;if(v.filter(b=>b.type===S.DiffChange.DELETION).reduce((b,h)=>(b.has(h.parentPath)||b.add(h.parentPath),b),y),Array.from(y).forEach(b=>{const h=Bn(f.formMeta,b);Array.isArray(h.fields)&&(h.fields=h.fields.filter(I=>I!==void 0))}),a.current){yo(g,f.formMeta,a.current);const b=new Set;t&&_r(f.formMeta,t,(h,I)=>{typeof I=="function"&&(h.validate(S.getPath(g,h.path)),b.add(h))});for(const{type:h,key:I,parentPath:C,objects:[,D]}of v)if(typeof I!="symbol"){let L=f.formMeta,$=g;if(L){for(const O of C)L=L.fields[O],$=$[O],b.has(L)||L.validate($,Ct.ON_CHANGE);if(h===S.DiffChange.ADDITION||h===S.DiffChange.ALTERATION){const O=L.fields[I];if(!b.has(O)&&(L.fields[I].validate(D[I],Ct.ON_CHANGE),h===S.DiffChange.ADDITION&&O.fields))for(const[_,R]of Object.entries(O.fields))R.validate(D[I][_],Ct.ON_CHANGE)}}}}}u.current={...f,formValue:g||f.formValue},o.current||n({})},[]),i=E.useCallback((p,f)=>{p||f?s({value:p,updateFormOptions:f}):s()},[s]),l=E.useCallback((p,f,g=!1,v,y=!1)=>{p?s({path:p,value:f,markAsBlurred:g,newValidators:v,markAsSubmitted:y}):i()},[s,i]),c=E.useMemo(()=>{S.deepFreeze(e);const p=vo(e,[],l);return t&&yo(e,p,t,!1,!0),p},[]),d=E.useCallback(()=>(u.current.formMeta.markAsDirty(),a.current&&_r(u.current.formMeta,a.current,(p,f)=>{(typeof f=="function"||Array.isArray(f))&&p.validate(S.getPath(u.current.formValue,p.path))}),u.current.formMeta.isValid()),[]),m=E.useCallback(()=>u.current.formValue,[]),u=E.useRef({formValue:e,formMeta:c,updateForm:i,validateForm:d,getCurrentFormValue:m});return u.current}const Le=r.forwardRef((e,t)=>{const{className:n,children:o,focusInputOnClick:a,formControl:s,formMeta:i,inputRef:l,onClick:c,...d}=e,m=r.useRef(),p=l||(t||m);function f(){p&&p!==t&&p.current&&p.current.focus()}function g(){p&&p!==t&&p.current&&i&&i instanceof On&&i.markAsFocused()}function v(){p&&p!==t&&p.current&&i&&i instanceof On&&i.markAsBlurred()}const y=K("sps-form-group",(s&&s.isRequired()||i&&i.isRequired())&&"sps-form-group--required",(s&&!s.isValid()||i&&i.isVisibilyInvalid())&&"sps-form-group--error",i&&i.hasPreventativeErrors()&&"sps-form-group--preventative-error",n);function b(h){a&&f(),c&&c(h)}return r.useEffect(()=>{function h(I){I.target.classList.contains("sps-form-control__clear-btn")&&I.preventDefault()}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[]),r.createElement("div",{...d,className:y,ref:t,tabIndex:-1,onClick:b,onFocus:g,onBlur:v},o)});Object.assign(Le,{displayName:"SpsFormComponentWrapper"});const ki=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Mi=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Eo=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Mi(n.overflowY,t)||Mi(n.overflowX,t)||(o=>{const a=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(o);return!!a&&(a.clientHeight<o.scrollHeight||a.clientWidth<o.scrollWidth)})(e)}return!1},To=(e,t,n,o,a,s,i,l)=>s<e&&i>t||s>e&&i<t?0:s<=e&&l<=n||i>=t&&l>=n?s-e-o:i>t&&l<n||s<e&&l>n?i-t+a:0,Zm=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Li=(e,t)=>{var n,o,a,s;if(typeof document>"u")return[];const{scrollMode:i,block:l,inline:c,boundary:d,skipOverflowHiddenElements:m}=t,u=typeof d=="function"?d:B=>B!==d;if(!ki(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let g=e;for(;ki(g)&&u(g);){if(g=Zm(g),g===p){f.push(g);break}g!=null&&g===document.body&&Eo(g)&&!Eo(document.documentElement)||g!=null&&Eo(g,m)&&f.push(g)}const v=(o=(n=window.visualViewport)==null?void 0:n.width)!=null?o:innerWidth,y=(s=(a=window.visualViewport)==null?void 0:a.height)!=null?s:innerHeight,{scrollX:b,scrollY:h}=window,{height:I,width:C,top:D,right:L,bottom:$,left:O}=e.getBoundingClientRect(),{top:_,right:R,bottom:H,left:Z}=(B=>{const M=window.getComputedStyle(B);return{top:parseFloat(M.scrollMarginTop)||0,right:parseFloat(M.scrollMarginRight)||0,bottom:parseFloat(M.scrollMarginBottom)||0,left:parseFloat(M.scrollMarginLeft)||0}})(e);let V=l==="start"||l==="nearest"?D-_:l==="end"?$+H:D+I/2-_+H,w=c==="center"?O+C/2-Z+R:c==="end"?L+R:O-Z;const F=[];for(let B=0;B<f.length;B++){const M=f[B],{height:q,width:N,top:T,right:k,bottom:U,left:J}=M.getBoundingClientRect();if(i==="if-needed"&&D>=0&&O>=0&&$<=y&&L<=v&&(M===p&&!Eo(M)||D>=T&&$<=U&&O>=J&&L<=k))return F;const te=getComputedStyle(M),ne=parseInt(te.borderLeftWidth,10),W=parseInt(te.borderTopWidth,10),X=parseInt(te.borderRightWidth,10),Y=parseInt(te.borderBottomWidth,10);let G=0,ee=0;const z="offsetWidth"in M?M.offsetWidth-M.clientWidth-ne-X:0,Q="offsetHeight"in M?M.offsetHeight-M.clientHeight-W-Y:0,fe="offsetWidth"in M?M.offsetWidth===0?0:N/M.offsetWidth:0,se="offsetHeight"in M?M.offsetHeight===0?0:q/M.offsetHeight:0;if(p===M)G=l==="start"?V:l==="end"?V-y:l==="nearest"?To(h,h+y,y,W,Y,h+V,h+V+I,I):V-y/2,ee=c==="start"?w:c==="center"?w-v/2:c==="end"?w-v:To(b,b+v,v,ne,X,b+w,b+w+C,C),G=Math.max(0,G+h),ee=Math.max(0,ee+b);else{G=l==="start"?V-T-W:l==="end"?V-U+Y+Q:l==="nearest"?To(T,U,q,W,Y+Q,V,V+I,I):V-(T+q/2)+Q/2,ee=c==="start"?w-J-ne:c==="center"?w-(J+N/2)+z/2:c==="end"?w-k+X+z:To(J,k,N,ne,X+z,w,w+C,C);const{scrollLeft:pe,scrollTop:He}=M;G=se===0?0:Math.max(0,Math.min(He+G/se,M.scrollHeight-q/se+Q)),ee=fe===0?0:Math.max(0,Math.min(pe+ee/fe,M.scrollWidth-N/fe+z)),V+=He-G,w+=pe-ee}F.push({el:M,top:G,left:ee})}return F},Qm=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function wo(e,t){if(!e.isConnected||!(a=>{let s=a;for(;s&&s.parentNode;){if(s.parentNode===document)return!0;s=s.parentNode instanceof ShadowRoot?s.parentNode.host:s.parentNode}return!1})(e))return;const n=(a=>{const s=window.getComputedStyle(a);return{top:parseFloat(s.scrollMarginTop)||0,right:parseFloat(s.scrollMarginRight)||0,bottom:parseFloat(s.scrollMarginBottom)||0,left:parseFloat(s.scrollMarginLeft)||0}})(e);if((a=>typeof a=="object"&&typeof a.behavior=="function")(t))return t.behavior(Li(e,t));const o=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:s,left:i}of Li(e,Qm(t))){const l=s-n.top+n.bottom,c=i-n.left+n.right;a.scroll({top:l,left:c,behavior:o})}}const Or=Object.freeze(Object.defineProperty({__proto__:null,default:wo},Symbol.toStringTag,{value:"Module"})),ef={alt:"string",size:"SpinnerSize",title:"string"};function Br(e){const{alt:t,className:n,size:o=A.SpinnerSize.MEDIUM,"data-testid":a,title:s,unsafelyReplaceClassName:i,...l}=e,{t:c}=he.useWoodlandLanguage(),d=t||s||c("spinner.defaultAltText",{defaultValue:"Loading..."}),m=K(i||"sps-spinner",`sps-spinner--${o}`,n);return r.createElement("i",{className:m,"data-testid":a,title:d,...l})}Object.assign(Br,{props:ef,displayName:"SpsSpinner"});const tf=60;function Co(e){return typeof e>"u"?"inherit":`${e}px`}function Rr(e){switch(e){case A.Position.TOP_LEFT:return A.Position.BOTTOM_LEFT;case A.Position.TOP_MIDDLE:return A.Position.BOTTOM_MIDDLE;case A.Position.TOP_RIGHT:return A.Position.BOTTOM_RIGHT;case A.Position.RIGHT_TOP:return A.Position.LEFT_TOP;case A.Position.RIGHT_MIDDLE:return A.Position.LEFT_MIDDLE;case A.Position.RIGHT_BOTTOM:return A.Position.LEFT_BOTTOM;case A.Position.BOTTOM_RIGHT:return A.Position.TOP_RIGHT;case A.Position.BOTTOM_MIDDLE:return A.Position.TOP_MIDDLE;case A.Position.BOTTOM_LEFT:return A.Position.TOP_LEFT;case A.Position.LEFT_BOTTOM:return A.Position.RIGHT_BOTTOM;case A.Position.LEFT_MIDDLE:return A.Position.RIGHT_MIDDLE;case A.Position.LEFT_TOP:return A.Position.RIGHT_TOP}}function nf(e,t,n,o,a,s,i,l){const c=i&&i.current,d=c?c.scrollTop:window.pageYOffset,m=l?0:d,u=c?c.scrollLeft:window.pageXOffset,p=l?0:u,[f,g]=e.split(" ");let v,y,b,h;switch(f){case"top":b=t.height-n.top-m-s[0];break;case"left":y=t.width-n.left-p-s[0];break;case"right":h=n.right+p-s[0];break;case"bottom":v=n.bottom+m-s[0];break;default:throw new Error(`Invalid position ${e}`)}switch(g){case"left":h=n.left+p+s[1];break;case"top":v=n.top+m+s[1];break;case"middle":f==="top"||f==="bottom"?h=n.left+p+n.width/2-a/2+s[1]:(f==="left"||f==="right")&&(v=n.top+m+n.height/2-o.height/2+s[1]);break;case"bottom":b=t.height-n.bottom-m+s[1];break;case"right":y=t.width-n.right-p+s[1];break;default:throw new Error(`Invalid position ${e}`)}return[v,y,b,h]}function Sn(e,t,n,{altPosition:o,setMinWidth:a=!1,setWidth:s=!1,parentElementRef:i,fixed:l=!1,offsets:c=[0,0],altOffsets:d=c}){if(e.current&&t.current){const m=e.current.getBoundingClientRect(),u=t.current.getBoundingClientRect(),p=Math.max(document.documentElement.clientHeight,window.innerHeight||0),f=document.documentElement.getBoundingClientRect().width;let v=(i?.current??document.documentElement).getBoundingClientRect();l&&(v={x:0,y:0,width:f,height:p,top:0,left:0,bottom:p,right:f,toJSON(){return{width:f,height:p,top:0,left:0,bottom:p,right:f}}});const[y,b]=n.split(" ");let h=n;if(o&&(y==="top"&&u.top-m.height<tf||y==="right"&&u.right+m.width>f||y==="bottom"&&u.bottom+m.height>p||y==="left"&&u.left-m.width<0)&&(h=o),b==="left"&&u.left+m.width+(c?.[1]??0)>document.documentElement.getBoundingClientRect().right)switch(y){case"bottom":h=A.Position.BOTTOM_RIGHT;break;case"top":h=A.Position.TOP_RIGHT;break}const I=a?Math.max(u.width,m.width):m.width,C=s?u.width:I,[D,L,$,O]=nf(h,v,u,m,C,h===o?d:c,i,l),_={top:Co(D),right:Co(L),bottom:Co($),left:Co(O)};return l&&(_.position="fixed",_.zIndex=A.ZStratum.BAR),a&&(_.minWidth=`${u.width}px`),s&&(_.width=`${u.width}px`),[_,h===o]}return[{},!1]}const rt=E.createContext(null);function gn(e,t=[]){const n=E.useContext(rt);return E.useMemo(()=>o=>{const s=n&&n.parentElementRef&&n.parentElementRef.current||document.body;let i=null,l=s.lastElementChild;for(;l&&l!==s.firstElementChild;){if(l.hasAttribute("data-portalid")&&l.getAttribute("data-portalid")===e){i=l;break}l=l.previousElementSibling}if(i)s.contains(i)||s.appendChild(i);else{i=document.createElement("div"),i.setAttribute("data-portalid",e),i.setAttribute("data-react-aria-top-layer","true");for(const c of t)i.classList.add(c);s.appendChild(i)}return Ln.createPortal(o,i)},[n])}const Fr=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"];async function _i(e,t,n,o,a,s){const i=typeof e.options=="function"?e.options(t.value):e.options||[],l=i instanceof Promise,c=u=>u.replace(/([.?*+^$[\]\\(){}|-])/g,"");n({pending:l}),s.current=l?i:null;const d=l?await i||[]:i||[];if(l&&s.current!==i)return;let m=Array.from(d).filter(Boolean).map(u=>new A.SpsOptionListOption(u,typeof u=="function"?{textKey:"label",captionKey:"caption"}:{textKey:e.textKey,captionKey:e.captionKey}));if(e.nullOption&&m.unshift(new A.SpsOptionListOption(null,{text:e.nullOption})),t.value&&!e.disableDefaultOptionsFiltering){const u=c(t.value);n({replacementPattern:new RegExp(`(${u})`,"ig")}),m=m.filter(p=>{const f=new RegExp(u,"i"),g=c(p.text);return e.filterByTextAndCaptionKey?f.test(g)||f.test(c(p.caption)):f.test(g)})}else n({replacementPattern:null});if(e.disabledOptions)for(const u of m)e.disabledOptions.includes(u.value)&&(u.disabled=!0);o(Object.freeze(m)),e.onOptionListChanged&&e.onOptionListChanged(m.length),a(m.some(u=>u.value&&!!u.value.icon)),n({pending:!1})}function of(e,t,n){const[o,a]=r.useState(Object.freeze([])),[s,i]=r.useState(!1),l=r.useRef(null),c=r.useRef(e.options);(typeof e.options!="function"||e.disableOptionsMemoization)&&(c.current=e.options);const d=r.useMemo(()=>typeof c.current=="function"?S.debounce(_i,typeof e.searchDebounce<"u"?e.searchDebounce:500):_i,[c.current,e.disabledOptions]);return r.useEffect(()=>{d(e,t,n,a,i,l)},[c.current,t.value,e.disabledOptions]),[o,s]}class Lt{constructor(t,n){this.target=t,this.isPgStoppedInternal=!1,this.currentTarget=t,this.nativeEvent=new CustomEvent("change",n),Object.defineProperty(this.nativeEvent,"target",{value:t,writable:!1,configurable:!1,enumerable:!0})}get bubbles(){return this.nativeEvent.bubbles}get cancelable(){return this.nativeEvent.cancelable}get defaultPrevented(){return this.nativeEvent.defaultPrevented}get eventPhase(){return this.nativeEvent.eventPhase}get isTrusted(){return this.nativeEvent.isTrusted}get timeStamp(){return this.nativeEvent.timeStamp}get type(){return this.nativeEvent.type}preventDefault(){this.nativeEvent.preventDefault()}isDefaultPrevented(){return this.defaultPrevented}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPgStoppedInternal=!0}isPropagationStopped(){return this.isPgStoppedInternal}persist(){throw new Error("This is not a real React ChangeEvent. React does not permit the creation of SyntheticEvents in userland.")}}function rf(e,t){return{...e,...t}}function Dt(e){return E.useReducer(rf,e)}function af({hideInlineSearch:e,showInlineSearch:t,options:n,onSearchChange:o,search:a="",searchPlaceholder:s,searchInputRef:i}){const{t:l}=he.useWoodlandLanguage(),c=s??l("select.searchPlaceholder",{defaultValue:"Search…"}),[d,m]=Dt({isAsync:typeof n=="function",pending:!1,value:a,replacementPattern:null}),u=r.useCallback(y=>{m({value:y.target.value}),o&&o(y)},[o]),p=r.useCallback(y=>{y.nativeEvent.stopImmediatePropagation(),y.stopPropagation()},[]),f=r.useCallback(y=>{y.nativeEvent.stopImmediatePropagation(),m({value:""}),o&&o(new Lt({value:""})),i?.current&&i.current.focus()},[o,i]),g=y=>{y&&(["Tab","Escape","Enter","Up","ArrowUp","Down","ArrowDown"].includes(y.key)||y.stopPropagation())};return r.useEffect(()=>{m({value:a})},[a]),[(d.isAsync||t)&&!e?r.createElement("div",{className:"sps-option-list__search sps-form-group sps-text-input"},r.createElement("div",{className:"sps-form-control"},!d.value&&r.createElement("i",{className:"sps-icon sps-icon-filter sps-text-input__icon"}),r.createElement("input",{type:"text",className:"sps-text-input__input",placeholder:c,ref:i,value:d.value,onChange:u,onClick:p,onKeyDown:g}),d.value&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:f}))):r.createElement(r.Fragment,null),d,m]}const sf=wo||Or,lf=["Tab","Escape","Enter","Up","ArrowUp","Down","ArrowDown"];function cf(e,t,n){return n?(e&&e[n])===(t&&t[n]):e===t}function Pi(e,t,n){return typeof n.value=="function"&&n.disabled?!0:t?!!e?.find(o=>o[t]&&o[t]===n?.value?.[t]):!1}const Rn=r.forwardRef((e,t)=>{const{captionKey:n,comparisonKey:o,disabledOptions:a,options:s,tall:i,textKey:l,valueKey:c,zeroState:d,hideInlineSearch:m,showInlineSearch:u,onSearchChange:p,search:f,searchDebounce:g,searchPlaceholder:v,onSpecialActionSelect:y,attachTo:b,className:h,conformWidth:I,id:C,ignoreWidthStyles:D,isOpen:L,keepOpen:$,keyDown:O,nullOption:_,onOptionListChanged:R,onOptionSelected:H,onPositionFlip:Z,onSelfToggle:V,optionRole:w,positionOverride:F,selectedOption:B,specialAction:M,unsafelyReplaceClassName:q,loading:N,filterByTextAndCaptionKey:T,maxHeightPx:k,maxHeightRem:U,disableOptionsMemoization:J,disableDefaultOptionsFiltering:te,"data-testid":ne,typeaheadEvent:W,...X}=e,Y=r.useMemo(()=>M?new A.SpsOptionListOption(M,{textKey:"label",captionKey:"caption"}):null,[M]),[G,ee]=r.useState(-1),[z,Q]=r.useState(L),fe=t||r.useRef(null),se=r.useRef(null),pe=r.useRef(null),He=gn("sps-option-list-portal"),$e=r.useContext(rt),[Xe,nt]=F||[A.Position.BOTTOM_LEFT,A.Position.TOP_LEFT],[[mt,xe],ot]=r.useState([{},!1]),Ve=r.useRef(null),[ft,_e,oe]=af({...e,searchInputRef:Ve}),[ue,je]=of(e,_e,oe);r.useEffect(()=>{W&&Ye(W)},[W]),r.useEffect(()=>{ot(z?Sn(fe,b,Xe,{altPosition:nt,setMinWidth:!D,setWidth:!D&&I,...$e}):[{},!1])},[z,Xe,nt,ue]),r.useEffect(()=>{let ie;return z&&(ie=()=>{z&&ot(Sn(fe,b,Xe,{altPosition:nt,setMinWidth:!D,setWidth:!D&&I,...$e}))},document.addEventListener("scroll",ie)),()=>{ie&&document.removeEventListener("scroll",ie)}},[z]),r.useEffect(()=>{ee(-1)},[_e]);const mo=K(q||"sps-option-list","z-stratum-dropdown",z&&"sps-option-list--open",_e.isAsync&&"sps-option-list--searchable",xe&&"sps-option-list--opens-upward",M&&M.label&&"sps-option-list--has-special-action",h),Dr=K(q||"sps-option-list__options",i&&"sps-option-list__options--tall"),xt=r.useCallback(()=>{z||(Q(!0),Ve.current&&Ve.current.focus(),ee(-1),V&&V(!0))},[z,V]),jt=r.useCallback(()=>{z&&(Q(!1),ee(-1),V&&V(!1))},[z,V]),yt=r.useCallback((ie,de)=>{de||ie&&!ie.disabled&&(typeof ie.value=="function"?(ie.value(),y&&y()):typeof H=="function"&&H(ie.value),$||jt())},[H,jt]),fo=r.useCallback((ie,de,ke)=>{ie.stopPropagation(),yt(de,ke)},[yt]),ae=r.useRef(a||[]);ae.current=a||[];const we=r.useCallback(ie=>{switch(ie.key){case"Tab":case"Escape":jt();break;case"Enter":if(G>-1){const de=ue[G]||Y;ie.preventDefault();const ke=!!de&&Pi(ae.current,o||"",de);!ke&&de&&typeof H=="function"&&typeof de.value=="function"?de.value():de&&yt(de,ke)}break;case"Up":case"ArrowUp":{let de=G;xe?G<=-1?de=ue.length-1:G===0?M&&(de=ue.length):G<ue.length&&(de=G-1):G>-1&&(de=G-1),de!==G&&(ie.preventDefault(),ee(de));break}case"Down":case"ArrowDown":{xt();let de=G;xe?G!==-1&&(G>=ue.length?de=0:G===ue.length-1?de=-1:de=G+1):G<ue.length-1+ +!!M&&(de=G+1),de!==G&&(ie.preventDefault(),ee(de));break}default:xt()}},[jt,xt,G,yt,H,xe,ue]),Ke=r.useCallback(ie=>{xt();const de=ue.findIndex(ke=>{if(ke.textKey){const Tt=ke.textKey;return ke.value[Tt].toLowerCase().charAt([0])===ie.key.toLocaleLowerCase()}return ke.value.toString().toLowerCase().charAt([0])===ie.key.toLocaleLowerCase()});de>-1&&ee(de)},[ue]),Ye=r.useCallback(ie=>{ie&&(lf.includes(ie.key)?we(ie):Fr.includes(ie.key)&&!m&&Ke(ie))},[jt,xt,G,yt,H,xe,ue]);r.useEffect(()=>{if($e!==null&&document.getElementsByClassName("sps-modal__body").length>0){const ie=()=>{V&&V(!1)},de=document.getElementsByClassName("sps-modal__body")[0];return de.addEventListener("scroll",ie),()=>{de.removeEventListener("scroll",ie)}}},[]),r.useEffect(()=>{z&&pe.current&&sf(pe.current,{scrollMode:"if-needed",block:"nearest",inline:"nearest"})},[G,z]),r.useEffect(()=>{Q(L),L?Ve.current&&Ve.current.focus():ee(-1)},[L]),r.useEffect(()=>{O&&Ye(O)},[O]),r.useEffect(()=>{!z&&se.current&&(p&&_e.value&&p(new Lt({value:""})),oe({value:""}),se.current.scrollTop=0),z&&Z&&Z(xe)},[z]);const Ie=k?k/16:U,Et=Ie?{maxHeight:`${Ie}rem`}:{};function kt(ie,de){return de?r.createElement(r.Fragment,null,ie.split(de).map((ke,Tt)=>de.test(ke)?r.createElement("u",{key:Tt},ke):r.createElement(r.Fragment,{key:Tt},ke))):r.createElement(r.Fragment,null,ie)}return He(r.createElement("div",{className:mo,id:C,"aria-activedescendant":G>-1?`${C}-option-${G}`:"",tabIndex:-1,ref:fe,style:mt,onMouseLeave:()=>ee(-1),"data-testid":ne,...X},ft,r.createElement("div",{className:Dr,ref:se,"data-testid":`${ne}-options`,style:Et},!N&&!_e.pending&&d&&ue.length===0&&r.createElement("div",{className:"sps-option-list__zero-state"},d),(N||_e.pending)&&r.createElement("div",{className:"sps-option-list__loading"},r.createElement(Br,null)),!N&&!_e.pending&&ue.map((ie,de)=>{const ke=`${C}-option-${de}`,Tt=cf(ie.value,B,o),Im=Pi(ae.current,o||"",ie);return r.createElement("a",{key:ke,id:ke,role:w,"aria-selected":Tt,href:ie.href,className:K("sps-option-list__option",ie.caption&&"sps-option-list__option--has-caption",ie.disabled&&"sps-option-list__option--disabled",ie.bold&&"sps-option-list__option--bold",(Tt||Im)&&"sps-option-list__option--selected",G===de&&"sps-option-list__option--highlighted"),onClick:jC=>fo(jC,ie,Im),onMouseOver:()=>ee(de),tabIndex:-1,ref:G===de?pe:null,"data-testid":`${ne}-option-${de}`},ie.value&&ie.value.icon&&r.createElement("i",{className:K("sps-icon","sps-option-list__option-icon",`sps-icon-${String(ie.value.icon)}`)}),(!ie.value||!ie.value.icon&&je)&&r.createElement("span",{className:"sps-option-list__option-icon-spacer"}),r.createElement("span",null,kt(ie.text,_e.replacementPattern)),ie.caption&&r.createElement("div",{className:"sps-option-list__option-caption"},r.createElement("span",null,kt(ie.caption,_e.replacementPattern))))})),Y&&M?.label&&r.createElement("a",{className:K("sps-option-list__option","sps-option-list__special-action",G===ue.length&&"sps-option-list__option--highlighted",M.disabled&&"sps-option-list__special-action--disabled"),href:Y.href,target:Y.href&&M.newTab?"_blank":"_self",onClick:ie=>fo(ie,Y),onMouseOver:()=>ee(ue.length),"data-testid":`${ne}-special-action`},M.icon&&r.createElement("i",{className:K("sps-icon","sps-option-list__option-icon",`sps-icon-${String(M.icon)}`)}),!M.icon&&je&&r.createElement("span",{className:"sps-option-list__option-icon-spacer"}),r.createElement("span",null,M.label))))});Object.assign(Rn,{displayName:"SpsOptionList"});function hn(e){return{key:e.key,preventDefault:()=>{}}}function df(e,t,n=[]){return r.useMemo(()=>{function o(a){return r.createElement(e,{...a,...t},a.children)}return o},n)}function qe(e){return typeof e=="function"?e():e}const Oi=function({children:e,elements:t}){if(t.length===0)return r.createElement(r.Fragment,null,e);const[n,o]=Array.isArray(t[0])?t[0]:[t[0]];return r.createElement(n,{...o??{}},r.createElement(Oi,{elements:t.slice(1)},e))},Bi=function({children:e,providers:t=[],...n}){return r.createElement("div",{...n},r.createElement(Oi,{elements:t},e))},pf=function({children:e,className:t,...n}){return r.createElement(Bi,{className:`sps-app ${t}`,...n},e)};function at(e=[],t=[]){const n=Array.isArray(e)?S.flatten(e):[e],o=t.map(s=>Array.isArray(s)?s:[s]),a=new Array(o.length+1).fill(null).map(()=>[]);for(const s of n){let i=!1;for(let l=0;l<o.length;l+=1)for(const{type:c,props:d={}}of o[l])if(s.type===c&&Object.keys(d).every(u=>d[u]===s.props[u])){i=!0,a[l].push(s);break}i||a[a.length-1].push(s)}return a}function Ri(e,t,n){const o=Object.entries(t).filter(([,s])=>typeof s!="string"&&s.deprecated).map(([s])=>s),a=o.map(s=>n[s]);r.useEffect(()=>{a.find(s=>typeof s<"u")&&console.warn(`The following prop(s) of ${e} are deprecated: ${o.join(", ")}`)},a)}function Ar(e,t){const n=E.useRef(!1);E.useEffect(()=>()=>{n.current=!1},[]),E.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function $r(e,t,n){const o=r.useRef(t(...n));r.useEffect(()=>(document.addEventListener(e,o.current,{capture:!0}),()=>document.removeEventListener(e,o.current)),[]),r.useEffect(()=>{document.removeEventListener(e,o.current),o.current=t(...n),document.addEventListener(e,o.current,{capture:!0})},n)}function Fi(e,t,n){return function(a){!e.current?.contains(a.target)&&!t.current?.contains(a.target)&&n()}}function bn(e,t,n){const o=r.useRef(!1),[a,s]=r.useState(!1),i=r.useCallback(()=>{o.current?o.current=!1:s(!0)},[]),l=r.useCallback((c=!1)=>{s(!1),o.current=c,n&&n()},[]);return $r("mousedown",Fi,[e,t,l]),$r("pointerdown",Fi,[e,t,l]),{showPopup:a,doShowPopup:i,doHidePopup:l}}const Ai=e=>{const t=/(auto|scroll)/,n=(l,c)=>l.parentNode===null?c:n(l.parentNode,c.concat([l])),o=(l,c)=>getComputedStyle(l,null).getPropertyValue(c),a=l=>o(l,"overflow")+o(l,"overflow-y"),s=l=>t.test(a(l));return(l=>{if(!(l instanceof HTMLElement||l instanceof SVGElement))return;const c=n(l.parentNode,[]);for(let d=0;d<c.length;d+=1)if(s(c[d]))return c[d];return null})(e)};let Vr=0;function Fn({isOpen:e,rootRef:t}){r.useLayoutEffect(()=>{let n,o,a;if(e&&t.current){Vr+=1,n=Ai(t.current)||document.body,o=n===document.body?window.innerWidth-document.documentElement.clientWidth:n.offsetWidth-n.clientWidth,n.style.overflow="hidden";const s=window.getComputedStyle(n).paddingRight;if(n.style.paddingRight=s&&s!=="0px"?`calc(${s} + ${o}px)`:`${o}px`,n===document.body){if(a=document.getElementsByClassName("sps-navbar-container").item(0),a&&window.getComputedStyle(a).position==="fixed"){const i=window.getComputedStyle(a).paddingRight;a.style.paddingRight=i&&i!=="0px"?`calc(${i} + ${o}px)`:`${o}px`}else if(a=document.getElementsByTagName("nav").item(0)?.parentElement,a&&window.getComputedStyle(a).position==="fixed"){const l=window.getComputedStyle(a).paddingRight;a.style.paddingRight=l&&l!=="0px"?`calc(${l} + ${o}px)`:`${o}px`}}}return()=>{n&&(Vr-=1,Vr===0&&(n.style.overflow=null,n.style.paddingRight=null,a&&(a.style.paddingRight=null)))}},[e])}const uf={debounce:"number",disabled:"boolean",conformWidth:"boolean",formMeta:"SpsFormFieldMeta<string>",icon:"SpsIcon",onChange:"React.ChangeEventHandler",onSelectionChange:"(newValue: string) => void",placeholder:"string",suggestions:{type:`
|
|
1
|
+
(function(x,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("@spscommerce/utils"),require("moment-timezone"),require("@spscommerce/ds-shared"),require("@spscommerce/i18n"),require("react-dom"),require("@spscommerce/ds-colors"),require("@sps-woodland/illustrations")):typeof define=="function"&&define.amd?define(["exports","react","@spscommerce/utils","moment-timezone","@spscommerce/ds-shared","@spscommerce/i18n","react-dom","@spscommerce/ds-colors","@sps-woodland/illustrations"],E):(x=typeof globalThis<"u"?globalThis:x||self,E(x.DSReact={},x.React,x.utils,x.moment$3,x.dsShared,x.i18n,x.ReactDOM,x.dsColors,x.illustrations))})(this,(function(x,E,S,Me,A,he,Ln,kr,bi){"use strict";function vi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=vi(E),pn=vi(Me);function yi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=yi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function K(){for(var e,t,n=0,o="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=yi(e))&&(o&&(o+=" "),o+=t);return o}const Mm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let We=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Mm[n[e]&63];return t};function Rt(e){return E.useRef(e||We())}function Ge(e,t){const n=Rt(e),o=E.useRef(`${n.current}_ctrl`);return E.useEffect(()=>{t&&(t.id=o.current,t.update())},[t]),{wrapperId:n.current||void 0,controlId:o.current}}function Mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lr,Ei;function Lm(){if(Ei)return Lr;Ei=1;var e="[object Object]";function t(p){var f=!1;if(p!=null&&typeof p.toString!="function")try{f=!!(p+"")}catch{}return f}function n(p,f){return function(g){return p(f(g))}}var o=Function.prototype,a=Object.prototype,s=o.toString,i=a.hasOwnProperty,l=s.call(Object),c=a.toString,d=n(Object.getPrototypeOf,Object);function u(p){return!!p&&typeof p=="object"}function m(p){if(!u(p)||c.call(p)!=e||t(p))return!1;var f=d(p);if(f===null)return!0;var g=i.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&s.call(g)==l}return Lr=m,Lr}var _m=Lm();const Ti=Mr(_m),Ze=new Set,un=new Set,wt=new Set,ho=new Set;function wi(e){Ze.has(e)||wt.has(e)||ho.has(e)||un.add(e)}function Ci(e){Ze.has(e)||wt.has(e)||un.has(e)||ho.add(e)}const Fe=pn.default||pn,mn="MM/DD/YYYY",Pm="MM/DD/YYYY hh:mm A",Om="MM/DD/YYYY HH:mm",Bm="hh:mm A",Rm="HH:mm",Fm=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,_n=Symbol("Date Parse Error");function fn(e){return Fe.isMoment(e)?e.year()*1e4+(e.month()+1)*100+e.date():e.year*1e4+e.month*100+e.date}const j=Object.freeze({createFrom(e,t){if(!e)return null;if(typeof e=="string"){if(t){const n=Fe(e,t,!0);if(n.isValid())return Object.freeze({year:n.year(),month:n.month()+1,date:n.date()})}else{const n=Fm.exec(e);if(n){const[,o,a,s]=n;return Object.freeze({year:Number(s),month:Number(o),date:Number(a)})}}return Object.freeze({[_n]:!0,year:void 0,month:void 0,date:void 0})}return Object.freeze({year:e.year(),month:e.month()+1,date:e.date()})},createMomentFrom(e,t){if(!e)return null;let n=null;return typeof e=="string"?t?n=Fe(e,t,!0):n=Fe(e):Fe.isMoment(e)?n=e:n=j.toMoment(e),n!==null&&Fe.isMoment(n)&&n.isValid()?n:Object.freeze({[_n]:!0,year:void 0,month:void 0,date:void 0})},getRangeSeparator(e){return e?.includes("-")?"/":"-"},createRangeFrom(e,t){if(!e)return null;if(t){const n=j.getRangeSeparator(t),o=new RegExp(`[^\\d]*${n}[^\\d]*`);return e.split(o).slice(0,2).map(a=>j.createFrom(a,t))}else return e.split(/[^\d]*-[^\d]*/).slice(0,2).map(n=>j.createFrom(n))},isValid(e){return e?Fe.isMoment(e)?e.isValid():typeof e=="object"&&typeof e.year=="number"&&typeof e.month=="number"&&typeof e.date=="number"&&j.toMoment(e)?.isValid():!1},nullifyInvalidDate(e){return j.isValid(e)?e:null},toMoment(e){return e?Fe.isMoment(e)?e:Fe({...e,month:e.month-1}):null},toString(e,t){const n=j.toMoment(e);return n&&n.isValid()?n.format(t||mn):""},toStringRange(e,t){if(!e)return"";const n=j.getRangeSeparator(t);return e.slice(0,2).map(o=>j.toString(o,t)).join(n)},toDateTimeString(e,t=!1,n){return e&&Fe.isMoment(e)&&e.isValid()?n?t?e.format(`${n} ${Rm}`):e.format(`${n} ${Bm}`):t?e.format(Om):e.format(Pm):""},toDateTimeStringRange(e,t=!1,n){if(!e)return"";const o=j.getRangeSeparator(n);return e.map(a=>j.toDateTimeString(a,t,n)).join(o)},create(){const e=new Date;return Object.freeze({year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()})},isSameDate(e,t){return e&&t&&e.year===t.year&&e.month===t.month&&e.date===t.date},isSameMonth(e,t){return e&&t&&e.year===t.year&&e.month===t.month},isAfter(e,t){return!e||!t?null:fn(e)>fn(t)},isBefore(e,t){return!e||!t?null:fn(e)<fn(t)},isInRange(e,t,n=!0){if(!e||!t||!t[0]||!t[1])return null;const o=fn(e),[a,s]=t.map(fn);return a&&s&&(n&&o>=a&&o<=s||!n&&o>a&&o<s)},prevMonth(e){return Object.freeze({year:e.month===1?e.year-1:e.year,month:e.month-1||12,date:e.date})},nextMonth(e){return Object.freeze({year:e.month===12?e.year+1:e.year,month:e.month+1>12?1:e.month+1,date:e.date})},createRangeFromPreset(e,t){if(typeof e.definition=="function")return e.definition();const n=Fe(),o=n.clone().subtract(Fe.duration(e.definition));return[j.createFrom(o,t),j.createFrom(n,t)]},createDateTimeRangeFromPreset(e){if(typeof e.definition=="function")return e.definition();const t=Fe().subtract(Fe.duration(e.definition)).startOf("day"),n=Fe().endOf("day");return[t,n]},splitMomentInDateTimeParts(e,t=!1,n,o=!1){let a="";t?a=o?"23:59":"00:00":a=o?"11:59":"12:00";const s=o?"PM":"AM";return e&&Fe.isMoment(e)&&e.isValid()?j.toDateTimeString(e,t,n).split(" "):["",a,t?void 0:s]},getCurrentMoment(){return Fe()},validateTimeString(e,t=!1){if(!e)return!0;const n=e.split(":"),o=n[0]||"0",a=n[1]||"0",s=Number.isNaN(Number(o))?NaN:parseInt(o,10),i=Number.isNaN(Number(a))?NaN:parseInt(a,10),l=n.length<=2&&o.length<=2&&a.length<=2;return t?l&&s>=0&&s<=23&&i>=0&&i<=59:l&&(!Number.isNaN(s)&&o.length===1||s>=1)&&s<=12&&i>=0&&i<=59},padIncompleteTimeString(e,t=!1){if(!e)return"";const n=e.split(":"),o=parseInt(n[0]||"0",10),a=parseInt(n[1]||"0",10);if(t){const s=o<10?`0${o}`:`${o}`,i=a<10?`0${a}`:`${a}`;return`${s}:${i}`}else{const s=o===0?"12":o<10?`0${o}`:`${o}`,i=a<10?`0${a}`:`${a}`;return`${s}:${i}`}}}),_r=["01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00"],Pr=["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"];let bo=mn;function Di(e){bo=e}const Pn=function(t){if(Array.isArray(t)){const n=Pn(t[0]),o=Pn(t[1]);return n||o}if(t&&t.hasOwnProperty("year")){if(t[_n])return{dateFormat:bo};if(!j.isValid(t))return{dateValidity:!0}}return null};Ze.add("dateFormat"),Ze.add("dateValidity");const Ni=function(t){if(Array.isArray(t)){const n=Pn(t);if(n)return n;if(t&&j.isBefore(t[1],t[0]))return{dateRangeOrder:!0}}return null};Ze.add("dateRangeOrder");const Ii=function({minDate:t,maxDate:n}){function o(a){const s=j.isBefore(a,t),i=j.isAfter(a,n),l={minExceeded:s?j.toString(t,bo):null,maxExceeded:i?j.toString(n,bo):null};return s||i?{dateConstraint:l}:null}return function(s){if(!s)return null;if(Array.isArray(s)){const i=o(s[0]),l=o(s[1]);return i||l}return s.hasOwnProperty("year")?o(s):null}};Ze.add("dateConstraint");const Am=Object.freeze(Object.defineProperty({__proto__:null,date:Pn,dateConstraint:Ii,dateRange:Ni,setDateFormat:Di},Symbol.toStringTag,{value:"Module"}));function Mt(e,t){for(const n of[].concat(e)){const o=t(n);if(o)return o}return null}const $m=function(t){function n(o){return Number(o)>=t?null:{min:t}}return o=>Mt(o,n)};Ze.add("min");const Vm=function(t){function n(o){return Number(o)<=t?null:{max:t}}return o=>Mt(o,n)};un.add("max");const Km=function(t){return typeof t>"u"||t===null||t===""||Number.isNaN(t)||t?.length===0?{required:!0}:null};un.add("required");const Hm=function(t){function n(o){return o===void 0||o.toString().length<t?{minLength:t}:null}return o=>Mt(o,n)};Ze.add("minLength");const Wm=function(t){function n(o){return o==null||Array.isArray(o)&&o.length<t?{minLengthArray:t}:null}return o=>n(o)};Ze.add("minLengthArray");const Gm=function(t){function n(o){return o===void 0||o.toString().length<=t?null:{maxLength:t}}return o=>Mt(o,n)};wt.add("maxLength");const Um=function(t){function n(o){return o==null||Array.isArray(o)&&o.length<=t?null:{maxLengthArray:t}}return o=>n(o)};Ze.add("maxLengthArray");const zm=function(t){const n=t instanceof RegExp?t:new RegExp(t);function o(a){return n.test(a)?null:{pattern:t}}return a=>Mt(a,o)};Ze.add("pattern");const jm=function(e){function t(n){return new RegExp("^\\p{L}*$","u").test(n)?null:{alpha:!0}}return Mt(e,t)};wt.add("alpha");const Ym=function(e){function t(n){return/^[0-9,. ]*$/.test(n)?null:{numeric:!0}}return Mt(e,t)};wt.add("numeric");const qm=function(e){function t(n){return/^-?[0-9,. ]*$/.test(n)?null:{positiveOrNegativeNumber:!0}}return Mt(e,t)};wt.add("positiveOrNegativeNumber");const Jm=function(e){function t(n){return/^[^0-9]*$/.test(n)?null:{nonNumeric:!0}}return Mt(e,t)};wt.add("nonNumeric");const vo=Object.freeze({...Am,min:$m,max:Vm,required:Km,minLength:Hm,minLengthArray:Wm,maxLength:Gm,maxLengthArray:Um,pattern:zm,alpha:jm,numeric:Ym,nonNumeric:Jm,positiveOrNegativeNumber:qm,OnBlurErrorKeys:Ze});function yo(e,t=[]){const n=t.reduce((o,a)=>Object.assign(o,a(e)||{}),{});return Object.keys(n).length?n:null}var Ct=(e=>(e[e.ON_CHANGE=0]="ON_CHANGE",e[e.ON_BLUR=1]="ON_BLUR",e[e.ON_SUBMIT=2]="ON_SUBMIT",e))(Ct||{});function Xm(e,t={},n=[]){for(const[o,a]of Object.entries(t))a===0?wi(o):a===2&&Ci(o);return r.useCallback(e,n)}class Yt{constructor(t,n){this.path=t,this.update=n,this.validators=[],this.#e=null,this.#t=null,this.#n=null,this.preventativeErrors=[],this.submitted=!1}#e;#t;#n;get errors(){return this.#e===null&&this.#t===null&&this.#n===null?null:{...this.#e??{},...this.#t??{},...this.#n??{}}}setValidators(t){return this.update(this.path,null,void 0,t),this}validate(t,n,o=!1){if(this.validators&&this.validators.length>0){const a=yo(t,this.validators);let s={onSubmit:{},onChange:{},onBlur:{}};a&&(s=Object.keys(a).reduce((i,l)=>(ho.has(l)?i.onSubmit[l]=a[l]:un.has(l)?i.onChange[l]=a[l]:i.onBlur[l]=a[l],i),s)),(typeof n>"u"||n===Ct.ON_CHANGE)&&(this.#t=Object.keys(s.onChange).length===0?null:s.onChange),(typeof n>"u"||n===Ct.ON_BLUR)&&(this.#n=Object.keys(s.onBlur).length===0?null:s.onBlur),(typeof n>"u"||n===Ct.ON_SUBMIT)&&(this.#e=Object.keys(s.onSubmit).length===0?null:s.onSubmit,this.#t=Object.keys(s.onChange).length===0?null:s.onChange,this.#n=Object.keys(s.onBlur).length===0?null:s.onBlur),o||this.update(),this.isFocused()&&this.onFocus&&this.onFocus()}else this.errors&&(this.#e=null,this.#n=null,this.#t=null,o||this.update());return this}isValid(){return!this.errors||this.isPristine()}hasErrors(){return!!this.errors}isVisibilyInvalid(){return!this.isValid()}hasError(t){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,t)}hasPreventativeError(t){return this.preventativeErrors.includes(t)}hasPreventativeErrors(){return this.preventativeErrors.length>0}isRequired(){return this.validators&&this.validators.indexOf(vo.required)>-1}isSubmitted(){return this.submitted}onFocus(){}onBlur(){}}class On extends Yt{constructor(){super(...arguments),this.id=We(),this.focused=!1,this.pristine=!0}setValue(t){if(this.preventativeErrors=[],this.validators&&this.validators.length>0){const n=yo(t,this.validators);if(n&&Object.keys(n).filter(a=>wt.has(a)).length>0){this.preventativeErrors=Object.keys(n);return}}this.update(this.path,t)}isPristine(){return this.pristine}markAsPristine(){return this.pristine=!0,this.update(),this}markAsDirty(){return this.pristine=!1,this.update(),this}isFocused(){return this.focused}markAsFocused(){return this.focused=!0,this.update(),this.onFocus&&this.onFocus(),this}markAsBlurred(){return this.update(this.path,null,!0),this.onBlur&&this.onBlur(),this.preventativeErrors=[],this}markAsSubmitted(){return this.submitted=!0,this.update(this.path,null,!1,void 0,!0),this}}class qt extends On{constructor(t,n,o){const a=o?n:t,s=o||n;super(a,s),o&&this.inferMembers(t)}isFocused(){return super.isFocused()||this.rollup("isFocused")}isValid(){return super.isValid()&&this.rollup("isValid")}hasErrors(){return super.hasErrors()||Object.keys(this.fields).some(t=>this.fields[t].hasErrors())}contentsAreValid(){return this.rollup("isValid")&&this.rollup("contentsAreValid")}isPristine(){return super.isPristine()&&this.rollup("isPristine")}markAsPristine(){super.markAsPristine();for(const t of Object.keys(this.fields))this.fields[t].markAsPristine();return this}markAsDirty(){super.markAsDirty();for(const t of Object.keys(this.fields))this.fields[t].markAsDirty();return this}markAsBlurred(){super.markAsBlurred();for(const t of Object.keys(this.fields))this.fields[t].markAsBlurred();return this}markAsSubmitted(){super.markAsSubmitted();for(const t of Object.keys(this.fields))this.fields[t].markAsSubmitted();return this}inferSpsControl(t,n){return Eo(t,[...this.path,n],this.update)}rollup(t){return Object.keys(this.fields).reduce((n,o)=>n&&(!this.fields[o][t]||this.fields[o][t]()),!0)}}class xi extends qt{inferMembers(t){this.fields={};for(const n of Object.keys(t))this.fields[n]=this.inferSpsControl(t[n],n)}}class ki extends qt{inferMembers(t){this.fields=t.map((n,o)=>this.inferSpsControl(n,String(o)))}}function Eo(e,t,n){return e instanceof Yt?(e.path=t,e.update=n,e):Array.isArray(e)?new ki(e,t,n):Ti(e)?new xi(e,t,n):new On(t,n)}function Bn(e,t){return t.length===0||!e?e:Bn(e.fields[t[0]],t.slice(1,t.length))}function Or(e,t){if(t.length===0||!e)return[e];const n=t[0];if(t=t.slice(1,t.length),n==="*"){const o=Array.isArray(e.fields)?e.fields:Object.keys(e.fields).map(a=>e.fields[a]);return t.length===0?o:o.reduce((a,s)=>[...a,...Or(s,t)],[])}return Or(e.fields[n],t)}function Br(e,t,n){for(const o of Object.keys(t)){const a=t[o];for(const s of Or(e,o.split(".")))s&&a&&n(s,a)}}function To(e,t,n,o=!1,a=!1){Br(t,n,(s,i)=>{s.validators=typeof i=="function"?i(e):i,o&&s.validate(S.getPath(e,s.path),void 0,a)})}function Rr(e,t){const n=t[0];return t=t.slice(1),Array.isArray(e)?e.map((o,a)=>a===Number(n)?Rr(o,t):o):Ti(e)?Object.keys(e).reduce((o,a)=>Object.assign(o,{[a]:a===n?Rr(e[a],t):e[a]}),{}):e}function Zm(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("The initial value of useSpsForm() hook must be an object.")}function Mi(e,t={}){Zm(e);const[,n]=E.useState({}),o=E.useRef(!1);o.current=!1;const a=E.useRef(t),s=E.useCallback(p=>{const f=m.current;let g;if(p)if(p.path)if(p.markAsBlurred){const v=Bn(f.formMeta,p.path);if(v){v.focused=!1;const y=S.getPath(f.formValue,p.path);v.validate(y,Ct.ON_BLUR)}}else if(p.newValidators){if(a.current){const v=p.path.join(".");a.current={...a.current,[v]:p.newValidators},To(f.formValue,f.formMeta,a.current,!0)}}else if(p.markAsSubmitted){const v=Bn(f.formMeta,p.path);if(v){v.submitted=!0;const y=S.getPath(f.formValue,p.path);v.validate(y,Ct.ON_SUBMIT)}}else g=Rr(f.formValue,p.path),S.setPath(g,p.path,p.value);else g=p.value;if(p?.updateFormOptions?.validators&&(a.current={...a.current,...p.updateFormOptions.validators},To(f.formValue,f.formMeta,a.current,p.updateFormOptions?.runValidators??!0)),g){f.formMeta.submitted=!1,S.deepFreeze(g);const v=S.diff(f.formValue,g);for(const{type:b,key:h,parentPath:I,objects:[,C]}of v){const D=Bn(f.formMeta,I);if(typeof h!="symbol"&&D){let L;switch(b){case S.DiffChange.ADDITION:D.fields[h]=Eo(C[h],[...I,h],l);break;case S.DiffChange.DELETION:Array.isArray(D.fields)?D.fields[h]=void 0:delete D.fields[h];break;case S.DiffChange.ALTERATION:L=Eo(C[h],[...I,h],l),(L instanceof qt&&!(D.fields[h]instanceof qt)||!(L instanceof qt)&&D.fields[h]instanceof qt)&&(L.pristine=!1,D.fields[h]=L);break}}}const y=new Set;if(v.filter(b=>b.type===S.DiffChange.DELETION).reduce((b,h)=>(b.has(h.parentPath)||b.add(h.parentPath),b),y),Array.from(y).forEach(b=>{const h=Bn(f.formMeta,b);Array.isArray(h.fields)&&(h.fields=h.fields.filter(I=>I!==void 0))}),a.current){To(g,f.formMeta,a.current);const b=new Set;t&&Br(f.formMeta,t,(h,I)=>{typeof I=="function"&&(h.validate(S.getPath(g,h.path)),b.add(h))});for(const{type:h,key:I,parentPath:C,objects:[,D]}of v)if(typeof I!="symbol"){let L=f.formMeta,$=g;if(L){for(const O of C)L=L.fields[O],$=$[O],b.has(L)||L.validate($,Ct.ON_CHANGE);if(h===S.DiffChange.ADDITION||h===S.DiffChange.ALTERATION){const O=L.fields[I];if(!b.has(O)&&(L.fields[I].validate(D[I],Ct.ON_CHANGE),h===S.DiffChange.ADDITION&&O.fields))for(const[_,R]of Object.entries(O.fields))R.validate(D[I][_],Ct.ON_CHANGE)}}}}}m.current={...f,formValue:g||f.formValue},o.current||n({})},[]),i=E.useCallback((p,f)=>{p||f?s({value:p,updateFormOptions:f}):s()},[s]),l=E.useCallback((p,f,g=!1,v,y=!1)=>{p?s({path:p,value:f,markAsBlurred:g,newValidators:v,markAsSubmitted:y}):i()},[s,i]),c=E.useMemo(()=>{S.deepFreeze(e);const p=Eo(e,[],l);return t&&To(e,p,t,!1,!0),p},[]),d=E.useCallback(()=>(m.current.formMeta.markAsDirty(),a.current&&Br(m.current.formMeta,a.current,(p,f)=>{(typeof f=="function"||Array.isArray(f))&&p.validate(S.getPath(m.current.formValue,p.path))}),m.current.formMeta.isValid()),[]),u=E.useCallback(()=>m.current.formValue,[]),m=E.useRef({formValue:e,formMeta:c,updateForm:i,validateForm:d,getCurrentFormValue:u});return m.current}const Le=r.forwardRef((e,t)=>{const{className:n,children:o,focusInputOnClick:a,formControl:s,formMeta:i,inputRef:l,onClick:c,...d}=e,u=r.useRef(),p=l||(t||u);function f(){p&&p!==t&&p.current&&p.current.focus()}function g(){p&&p!==t&&p.current&&i&&i instanceof On&&i.markAsFocused()}function v(){p&&p!==t&&p.current&&i&&i instanceof On&&i.markAsBlurred()}const y=K("sps-form-group",(s&&s.isRequired()||i&&i.isRequired())&&"sps-form-group--required",(s&&!s.isValid()||i&&i.isVisibilyInvalid())&&"sps-form-group--error",i&&i.hasPreventativeErrors()&&"sps-form-group--preventative-error",n);function b(h){a&&f(),c&&c(h)}return r.useEffect(()=>{function h(I){I.target.classList.contains("sps-form-control__clear-btn")&&I.preventDefault()}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[]),r.createElement("div",{...d,className:y,ref:t,tabIndex:-1,onClick:b,onFocus:g,onBlur:v},o)});Object.assign(Le,{displayName:"SpsFormComponentWrapper"});const Li=e=>typeof e=="object"&&e!=null&&e.nodeType===1,_i=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",wo=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return _i(n.overflowY,t)||_i(n.overflowX,t)||(o=>{const a=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(o);return!!a&&(a.clientHeight<o.scrollHeight||a.clientWidth<o.scrollWidth)})(e)}return!1},Co=(e,t,n,o,a,s,i,l)=>s<e&&i>t||s>e&&i<t?0:s<=e&&l<=n||i>=t&&l>=n?s-e-o:i>t&&l<n||s<e&&l>n?i-t+a:0,Qm=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Pi=(e,t)=>{var n,o,a,s;if(typeof document>"u")return[];const{scrollMode:i,block:l,inline:c,boundary:d,skipOverflowHiddenElements:u}=t,m=typeof d=="function"?d:B=>B!==d;if(!Li(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let g=e;for(;Li(g)&&m(g);){if(g=Qm(g),g===p){f.push(g);break}g!=null&&g===document.body&&wo(g)&&!wo(document.documentElement)||g!=null&&wo(g,u)&&f.push(g)}const v=(o=(n=window.visualViewport)==null?void 0:n.width)!=null?o:innerWidth,y=(s=(a=window.visualViewport)==null?void 0:a.height)!=null?s:innerHeight,{scrollX:b,scrollY:h}=window,{height:I,width:C,top:D,right:L,bottom:$,left:O}=e.getBoundingClientRect(),{top:_,right:R,bottom:H,left:Z}=(B=>{const M=window.getComputedStyle(B);return{top:parseFloat(M.scrollMarginTop)||0,right:parseFloat(M.scrollMarginRight)||0,bottom:parseFloat(M.scrollMarginBottom)||0,left:parseFloat(M.scrollMarginLeft)||0}})(e);let V=l==="start"||l==="nearest"?D-_:l==="end"?$+H:D+I/2-_+H,w=c==="center"?O+C/2-Z+R:c==="end"?L+R:O-Z;const F=[];for(let B=0;B<f.length;B++){const M=f[B],{height:q,width:N,top:T,right:k,bottom:U,left:J}=M.getBoundingClientRect();if(i==="if-needed"&&D>=0&&O>=0&&$<=y&&L<=v&&(M===p&&!wo(M)||D>=T&&$<=U&&O>=J&&L<=k))return F;const te=getComputedStyle(M),ne=parseInt(te.borderLeftWidth,10),W=parseInt(te.borderTopWidth,10),X=parseInt(te.borderRightWidth,10),Y=parseInt(te.borderBottomWidth,10);let G=0,ee=0;const z="offsetWidth"in M?M.offsetWidth-M.clientWidth-ne-X:0,Q="offsetHeight"in M?M.offsetHeight-M.clientHeight-W-Y:0,fe="offsetWidth"in M?M.offsetWidth===0?0:N/M.offsetWidth:0,se="offsetHeight"in M?M.offsetHeight===0?0:q/M.offsetHeight:0;if(p===M)G=l==="start"?V:l==="end"?V-y:l==="nearest"?Co(h,h+y,y,W,Y,h+V,h+V+I,I):V-y/2,ee=c==="start"?w:c==="center"?w-v/2:c==="end"?w-v:Co(b,b+v,v,ne,X,b+w,b+w+C,C),G=Math.max(0,G+h),ee=Math.max(0,ee+b);else{G=l==="start"?V-T-W:l==="end"?V-U+Y+Q:l==="nearest"?Co(T,U,q,W,Y+Q,V,V+I,I):V-(T+q/2)+Q/2,ee=c==="start"?w-J-ne:c==="center"?w-(J+N/2)+z/2:c==="end"?w-k+X+z:Co(J,k,N,ne,X+z,w,w+C,C);const{scrollLeft:pe,scrollTop:He}=M;G=se===0?0:Math.max(0,Math.min(He+G/se,M.scrollHeight-q/se+Q)),ee=fe===0?0:Math.max(0,Math.min(pe+ee/fe,M.scrollWidth-N/fe+z)),V+=He-G,w+=pe-ee}F.push({el:M,top:G,left:ee})}return F},ef=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function Do(e,t){if(!e.isConnected||!(a=>{let s=a;for(;s&&s.parentNode;){if(s.parentNode===document)return!0;s=s.parentNode instanceof ShadowRoot?s.parentNode.host:s.parentNode}return!1})(e))return;const n=(a=>{const s=window.getComputedStyle(a);return{top:parseFloat(s.scrollMarginTop)||0,right:parseFloat(s.scrollMarginRight)||0,bottom:parseFloat(s.scrollMarginBottom)||0,left:parseFloat(s.scrollMarginLeft)||0}})(e);if((a=>typeof a=="object"&&typeof a.behavior=="function")(t))return t.behavior(Pi(e,t));const o=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:s,left:i}of Pi(e,ef(t))){const l=s-n.top+n.bottom,c=i-n.left+n.right;a.scroll({top:l,left:c,behavior:o})}}const Fr=Object.freeze(Object.defineProperty({__proto__:null,default:Do},Symbol.toStringTag,{value:"Module"})),tf={alt:"string",size:"SpinnerSize",title:"string"};function Ar(e){const{alt:t,className:n,size:o=A.SpinnerSize.MEDIUM,"data-testid":a,title:s,unsafelyReplaceClassName:i,...l}=e,{t:c}=he.useWoodlandLanguage(),d=t||s||c("spinner.defaultAltText",{defaultValue:"Loading..."}),u=K(i||"sps-spinner",`sps-spinner--${o}`,n);return r.createElement("i",{className:u,"data-testid":a,title:d,...l})}Object.assign(Ar,{props:tf,displayName:"SpsSpinner"});const nf=60;function No(e){return typeof e>"u"?"inherit":`${e}px`}function $r(e){switch(e){case A.Position.TOP_LEFT:return A.Position.BOTTOM_LEFT;case A.Position.TOP_MIDDLE:return A.Position.BOTTOM_MIDDLE;case A.Position.TOP_RIGHT:return A.Position.BOTTOM_RIGHT;case A.Position.RIGHT_TOP:return A.Position.LEFT_TOP;case A.Position.RIGHT_MIDDLE:return A.Position.LEFT_MIDDLE;case A.Position.RIGHT_BOTTOM:return A.Position.LEFT_BOTTOM;case A.Position.BOTTOM_RIGHT:return A.Position.TOP_RIGHT;case A.Position.BOTTOM_MIDDLE:return A.Position.TOP_MIDDLE;case A.Position.BOTTOM_LEFT:return A.Position.TOP_LEFT;case A.Position.LEFT_BOTTOM:return A.Position.RIGHT_BOTTOM;case A.Position.LEFT_MIDDLE:return A.Position.RIGHT_MIDDLE;case A.Position.LEFT_TOP:return A.Position.RIGHT_TOP}}function of(e,t,n,o,a,s,i,l){const c=i&&i.current,d=c?c.scrollTop:window.pageYOffset,u=l?0:d,m=c?c.scrollLeft:window.pageXOffset,p=l?0:m,[f,g]=e.split(" ");let v,y,b,h;switch(f){case"top":b=t.height-n.top-u-s[0];break;case"left":y=t.width-n.left-p-s[0];break;case"right":h=n.right+p-s[0];break;case"bottom":v=n.bottom+u-s[0];break;default:throw new Error(`Invalid position ${e}`)}switch(g){case"left":h=n.left+p+s[1];break;case"top":v=n.top+u+s[1];break;case"middle":f==="top"||f==="bottom"?h=n.left+p+n.width/2-a/2+s[1]:(f==="left"||f==="right")&&(v=n.top+u+n.height/2-o.height/2+s[1]);break;case"bottom":b=t.height-n.bottom-u+s[1];break;case"right":y=t.width-n.right-p+s[1];break;default:throw new Error(`Invalid position ${e}`)}return[v,y,b,h]}function Sn(e,t,n,{altPosition:o,setMinWidth:a=!1,setWidth:s=!1,parentElementRef:i,fixed:l=!1,offsets:c=[0,0],altOffsets:d=c}){if(e.current&&t.current){const u=e.current.getBoundingClientRect(),m=t.current.getBoundingClientRect(),p=Math.max(document.documentElement.clientHeight,window.innerHeight||0),f=document.documentElement.getBoundingClientRect().width;let v=(i?.current??document.documentElement).getBoundingClientRect();l&&(v={x:0,y:0,width:f,height:p,top:0,left:0,bottom:p,right:f,toJSON(){return{width:f,height:p,top:0,left:0,bottom:p,right:f}}});const[y,b]=n.split(" ");let h=n;if(o&&(y==="top"&&m.top-u.height<nf||y==="right"&&m.right+u.width>f||y==="bottom"&&m.bottom+u.height>p||y==="left"&&m.left-u.width<0)&&(h=o),b==="left"&&m.left+u.width+(c?.[1]??0)>document.documentElement.getBoundingClientRect().right)switch(y){case"bottom":h=A.Position.BOTTOM_RIGHT;break;case"top":h=A.Position.TOP_RIGHT;break}const I=a?Math.max(m.width,u.width):u.width,C=s?m.width:I,[D,L,$,O]=of(h,v,m,u,C,h===o?d:c,i,l),_={top:No(D),right:No(L),bottom:No($),left:No(O)};return l&&(_.position="fixed",_.zIndex=A.ZStratum.BAR),a&&(_.minWidth=`${m.width}px`),s&&(_.width=`${m.width}px`),[_,h===o]}return[{},!1]}const rt=E.createContext(null);function gn(e,t=[]){const n=E.useContext(rt);return E.useMemo(()=>o=>{const s=n&&n.parentElementRef&&n.parentElementRef.current||document.body;let i=null,l=s.lastElementChild;for(;l&&l!==s.firstElementChild;){if(l.hasAttribute("data-portalid")&&l.getAttribute("data-portalid")===e){i=l;break}l=l.previousElementSibling}if(i)s.contains(i)||s.appendChild(i);else{i=document.createElement("div"),i.setAttribute("data-portalid",e),i.setAttribute("data-react-aria-top-layer","true");for(const c of t)i.classList.add(c);s.appendChild(i)}return Ln.createPortal(o,i)},[n])}const Vr=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"];async function Oi(e,t,n,o,a,s){const i=typeof e.options=="function"?e.options(t.value):e.options||[],l=i instanceof Promise,c=m=>m.replace(/([.?*+^$[\]\\(){}|-])/g,"");n({pending:l}),s.current=l?i:null;const d=l?await i||[]:i||[];if(l&&s.current!==i)return;let u=Array.from(d).filter(Boolean).map(m=>new A.SpsOptionListOption(m,typeof m=="function"?{textKey:"label",captionKey:"caption"}:{textKey:e.textKey,captionKey:e.captionKey}));if(e.nullOption&&u.unshift(new A.SpsOptionListOption(null,{text:e.nullOption})),t.value&&!e.disableDefaultOptionsFiltering){const m=c(t.value);n({replacementPattern:new RegExp(`(${m})`,"ig")}),u=u.filter(p=>{const f=new RegExp(m,"i"),g=c(p.text);return e.filterByTextAndCaptionKey?f.test(g)||f.test(c(p.caption)):f.test(g)})}else n({replacementPattern:null});if(e.disabledOptions)for(const m of u)e.disabledOptions.includes(m.value)&&(m.disabled=!0);o(Object.freeze(u)),e.onOptionListChanged&&e.onOptionListChanged(u.length),a(u.some(m=>m.value&&!!m.value.icon)),n({pending:!1})}function rf(e,t,n){const[o,a]=r.useState(Object.freeze([])),[s,i]=r.useState(!1),l=r.useRef(null),c=r.useRef(e.options);(typeof e.options!="function"||e.disableOptionsMemoization)&&(c.current=e.options);const d=r.useMemo(()=>typeof c.current=="function"?S.debounce(Oi,typeof e.searchDebounce<"u"?e.searchDebounce:500):Oi,[c.current,e.disabledOptions]);return r.useEffect(()=>{d(e,t,n,a,i,l)},[c.current,t.value,e.disabledOptions]),[o,s]}class Lt{constructor(t,n){this.target=t,this.isPgStoppedInternal=!1,this.currentTarget=t,this.nativeEvent=new CustomEvent("change",n),Object.defineProperty(this.nativeEvent,"target",{value:t,writable:!1,configurable:!1,enumerable:!0})}get bubbles(){return this.nativeEvent.bubbles}get cancelable(){return this.nativeEvent.cancelable}get defaultPrevented(){return this.nativeEvent.defaultPrevented}get eventPhase(){return this.nativeEvent.eventPhase}get isTrusted(){return this.nativeEvent.isTrusted}get timeStamp(){return this.nativeEvent.timeStamp}get type(){return this.nativeEvent.type}preventDefault(){this.nativeEvent.preventDefault()}isDefaultPrevented(){return this.defaultPrevented}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPgStoppedInternal=!0}isPropagationStopped(){return this.isPgStoppedInternal}persist(){throw new Error("This is not a real React ChangeEvent. React does not permit the creation of SyntheticEvents in userland.")}}function af(e,t){return{...e,...t}}function Dt(e){return E.useReducer(af,e)}function sf({hideInlineSearch:e,showInlineSearch:t,options:n,onSearchChange:o,search:a="",searchPlaceholder:s,searchInputRef:i}){const{t:l}=he.useWoodlandLanguage(),c=s??l("select.searchPlaceholder",{defaultValue:"Search…"}),[d,u]=Dt({isAsync:typeof n=="function",pending:!1,value:a,replacementPattern:null}),m=r.useCallback(y=>{u({value:y.target.value}),o&&o(y)},[o]),p=r.useCallback(y=>{y.nativeEvent.stopImmediatePropagation(),y.stopPropagation()},[]),f=r.useCallback(y=>{y.nativeEvent.stopImmediatePropagation(),u({value:""}),o&&o(new Lt({value:""})),i?.current&&i.current.focus()},[o,i]),g=y=>{y&&(["Tab","Escape","Enter","Up","ArrowUp","Down","ArrowDown"].includes(y.key)||y.stopPropagation())};return r.useEffect(()=>{u({value:a})},[a]),[(d.isAsync||t)&&!e?r.createElement("div",{className:"sps-option-list__search sps-form-group sps-text-input"},r.createElement("div",{className:"sps-form-control"},!d.value&&r.createElement("i",{className:"sps-icon sps-icon-filter sps-text-input__icon"}),r.createElement("input",{type:"text",className:"sps-text-input__input",placeholder:c,ref:i,value:d.value,onChange:m,onClick:p,onKeyDown:g}),d.value&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:f}))):r.createElement(r.Fragment,null),d,u]}const lf=Do||Fr,cf=["Tab","Escape","Enter","Up","ArrowUp","Down","ArrowDown"];function df(e,t,n){return n?(e&&e[n])===(t&&t[n]):e===t}function Bi(e,t,n){return typeof n.value=="function"&&n.disabled?!0:t?!!e?.find(o=>o[t]&&o[t]===n?.value?.[t]):!1}const Rn=r.forwardRef((e,t)=>{const{captionKey:n,comparisonKey:o,disabledOptions:a,options:s,tall:i,textKey:l,valueKey:c,zeroState:d,hideInlineSearch:u,showInlineSearch:m,onSearchChange:p,search:f,searchDebounce:g,searchPlaceholder:v,onSpecialActionSelect:y,attachTo:b,className:h,conformWidth:I,id:C,ignoreWidthStyles:D,isOpen:L,keepOpen:$,keyDown:O,nullOption:_,onOptionListChanged:R,onOptionSelected:H,onPositionFlip:Z,onSelfToggle:V,optionRole:w,positionOverride:F,selectedOption:B,specialAction:M,unsafelyReplaceClassName:q,loading:N,filterByTextAndCaptionKey:T,maxHeightPx:k,maxHeightRem:U,disableOptionsMemoization:J,disableDefaultOptionsFiltering:te,"data-testid":ne,typeaheadEvent:W,...X}=e,Y=r.useMemo(()=>M?new A.SpsOptionListOption(M,{textKey:"label",captionKey:"caption"}):null,[M]),[G,ee]=r.useState(-1),[z,Q]=r.useState(L),fe=t||r.useRef(null),se=r.useRef(null),pe=r.useRef(null),He=gn("sps-option-list-portal"),$e=r.useContext(rt),[Xe,nt]=F||[A.Position.BOTTOM_LEFT,A.Position.TOP_LEFT],[[mt,xe],ot]=r.useState([{},!1]),Ve=r.useRef(null),[ft,_e,oe]=sf({...e,searchInputRef:Ve}),[ue,je]=rf(e,_e,oe);r.useEffect(()=>{W&&Ye(W)},[W]),r.useEffect(()=>{ot(z?Sn(fe,b,Xe,{altPosition:nt,setMinWidth:!D,setWidth:!D&&I,...$e}):[{},!1])},[z,Xe,nt,ue]),r.useEffect(()=>{let ie;return z&&(ie=()=>{z&&ot(Sn(fe,b,Xe,{altPosition:nt,setMinWidth:!D,setWidth:!D&&I,...$e}))},document.addEventListener("scroll",ie)),()=>{ie&&document.removeEventListener("scroll",ie)}},[z]),r.useEffect(()=>{ee(-1)},[_e]);const So=K(q||"sps-option-list","z-stratum-dropdown",z&&"sps-option-list--open",_e.isAsync&&"sps-option-list--searchable",xe&&"sps-option-list--opens-upward",M&&M.label&&"sps-option-list--has-special-action",h),xr=K(q||"sps-option-list__options",i&&"sps-option-list__options--tall"),xt=r.useCallback(()=>{z||(Q(!0),Ve.current&&Ve.current.focus(),ee(-1),V&&V(!0))},[z,V]),jt=r.useCallback(()=>{z&&(Q(!1),ee(-1),V&&V(!1))},[z,V]),yt=r.useCallback((ie,de)=>{de||ie&&!ie.disabled&&(typeof ie.value=="function"?(ie.value(),y&&y()):typeof H=="function"&&H(ie.value),$||jt())},[H,jt]),go=r.useCallback((ie,de,ke)=>{ie.stopPropagation(),yt(de,ke)},[yt]),ae=r.useRef(a||[]);ae.current=a||[];const we=r.useCallback(ie=>{switch(ie.key){case"Tab":case"Escape":jt();break;case"Enter":if(G>-1){const de=ue[G]||Y;ie.preventDefault();const ke=!!de&&Bi(ae.current,o||"",de);!ke&&de&&typeof H=="function"&&typeof de.value=="function"?de.value():de&&yt(de,ke)}break;case"Up":case"ArrowUp":{let de=G;xe?G<=-1?de=ue.length-1:G===0?M&&(de=ue.length):G<ue.length&&(de=G-1):G>-1&&(de=G-1),de!==G&&(ie.preventDefault(),ee(de));break}case"Down":case"ArrowDown":{xt();let de=G;xe?G!==-1&&(G>=ue.length?de=0:G===ue.length-1?de=-1:de=G+1):G<ue.length-1+ +!!M&&(de=G+1),de!==G&&(ie.preventDefault(),ee(de));break}default:xt()}},[jt,xt,G,yt,H,xe,ue]),Ke=r.useCallback(ie=>{xt();const de=ue.findIndex(ke=>{if(ke.textKey){const Tt=ke.textKey;return ke.value[Tt].toLowerCase().charAt([0])===ie.key.toLocaleLowerCase()}return ke.value.toString().toLowerCase().charAt([0])===ie.key.toLocaleLowerCase()});de>-1&&ee(de)},[ue]),Ye=r.useCallback(ie=>{ie&&(cf.includes(ie.key)?we(ie):Vr.includes(ie.key)&&!u&&Ke(ie))},[jt,xt,G,yt,H,xe,ue]);r.useEffect(()=>{if($e!==null&&document.getElementsByClassName("sps-modal__body").length>0){const ie=()=>{V&&V(!1)},de=document.getElementsByClassName("sps-modal__body")[0];return de.addEventListener("scroll",ie),()=>{de.removeEventListener("scroll",ie)}}},[]),r.useEffect(()=>{z&&pe.current&&lf(pe.current,{scrollMode:"if-needed",block:"nearest",inline:"nearest"})},[G,z]),r.useEffect(()=>{Q(L),L?Ve.current&&Ve.current.focus():ee(-1)},[L]),r.useEffect(()=>{O&&Ye(O)},[O]),r.useEffect(()=>{!z&&se.current&&(p&&_e.value&&p(new Lt({value:""})),oe({value:""}),se.current.scrollTop=0),z&&Z&&Z(xe)},[z]);const Ie=k?k/16:U,Et=Ie?{maxHeight:`${Ie}rem`}:{};function kt(ie,de){return de?r.createElement(r.Fragment,null,ie.split(de).map((ke,Tt)=>de.test(ke)?r.createElement("u",{key:Tt},ke):r.createElement(r.Fragment,{key:Tt},ke))):r.createElement(r.Fragment,null,ie)}return He(r.createElement("div",{className:So,id:C,"aria-activedescendant":G>-1?`${C}-option-${G}`:"",tabIndex:-1,ref:fe,style:mt,onMouseLeave:()=>ee(-1),"data-testid":ne,...X},ft,r.createElement("div",{className:xr,ref:se,"data-testid":`${ne}-options`,style:Et},!N&&!_e.pending&&d&&ue.length===0&&r.createElement("div",{className:"sps-option-list__zero-state"},d),(N||_e.pending)&&r.createElement("div",{className:"sps-option-list__loading"},r.createElement(Ar,null)),!N&&!_e.pending&&ue.map((ie,de)=>{const ke=`${C}-option-${de}`,Tt=df(ie.value,B,o),km=Bi(ae.current,o||"",ie);return r.createElement("a",{key:ke,id:ke,role:w,"aria-selected":Tt,href:ie.href,className:K("sps-option-list__option",ie.caption&&"sps-option-list__option--has-caption",ie.disabled&&"sps-option-list__option--disabled",ie.bold&&"sps-option-list__option--bold",(Tt||km)&&"sps-option-list__option--selected",G===de&&"sps-option-list__option--highlighted"),onClick:qC=>go(qC,ie,km),onMouseOver:()=>ee(de),tabIndex:-1,ref:G===de?pe:null,"data-testid":`${ne}-option-${de}`},ie.value&&ie.value.icon&&r.createElement("i",{className:K("sps-icon","sps-option-list__option-icon",`sps-icon-${String(ie.value.icon)}`)}),(!ie.value||!ie.value.icon&&je)&&r.createElement("span",{className:"sps-option-list__option-icon-spacer"}),r.createElement("span",null,kt(ie.text,_e.replacementPattern)),ie.caption&&r.createElement("div",{className:"sps-option-list__option-caption"},r.createElement("span",null,kt(ie.caption,_e.replacementPattern))))})),Y&&M?.label&&r.createElement("a",{className:K("sps-option-list__option","sps-option-list__special-action",G===ue.length&&"sps-option-list__option--highlighted",M.disabled&&"sps-option-list__special-action--disabled"),href:Y.href,target:Y.href&&M.newTab?"_blank":"_self",onClick:ie=>go(ie,Y),onMouseOver:()=>ee(ue.length),"data-testid":`${ne}-special-action`},M.icon&&r.createElement("i",{className:K("sps-icon","sps-option-list__option-icon",`sps-icon-${String(M.icon)}`)}),!M.icon&&je&&r.createElement("span",{className:"sps-option-list__option-icon-spacer"}),r.createElement("span",null,M.label))))});Object.assign(Rn,{displayName:"SpsOptionList"});function hn(e){return{key:e.key,preventDefault:()=>{}}}function pf(e,t,n=[]){return r.useMemo(()=>{function o(a){return r.createElement(e,{...a,...t},a.children)}return o},n)}function qe(e){return typeof e=="function"?e():e}const Ri=function({children:e,elements:t}){if(t.length===0)return r.createElement(r.Fragment,null,e);const[n,o]=Array.isArray(t[0])?t[0]:[t[0]];return r.createElement(n,{...o??{}},r.createElement(Ri,{elements:t.slice(1)},e))},Fi=function({children:e,providers:t=[],...n}){return r.createElement("div",{...n},r.createElement(Ri,{elements:t},e))},uf=function({children:e,className:t,...n}){return r.createElement(Fi,{className:`sps-app ${t}`,...n},e)};function mf(e,t){const{type:n,props:o={},custom:a}=t;return a?a(e.type):e.type!==n?!1:Object.keys(o).every(s=>o[s]===e.props[s])}function at(e=[],t=[]){const n=Array.isArray(e)?S.flatten(e):[e],o=t.map(s=>Array.isArray(s)?s:[s]),a=new Array(o.length+1).fill(null).map(()=>[]);for(const s of n){let i=!1;for(let l=0;l<o.length;l+=1)for(const c of o[l])if(mf(s,c)){i=!0,a[l].push(s);break}i||a[a.length-1].push(s)}return a}function Ai(e,t,n){const o=Object.entries(t).filter(([,s])=>typeof s!="string"&&s.deprecated).map(([s])=>s),a=o.map(s=>n[s]);r.useEffect(()=>{a.find(s=>typeof s<"u")&&console.warn(`The following prop(s) of ${e} are deprecated: ${o.join(", ")}`)},a)}function Kr(e,t){const n=E.useRef(!1);E.useEffect(()=>()=>{n.current=!1},[]),E.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function Hr(e,t,n){const o=r.useRef(t(...n));r.useEffect(()=>(document.addEventListener(e,o.current,{capture:!0}),()=>document.removeEventListener(e,o.current)),[]),r.useEffect(()=>{document.removeEventListener(e,o.current),o.current=t(...n),document.addEventListener(e,o.current,{capture:!0})},n)}function $i(e,t,n){return function(a){!e.current?.contains(a.target)&&!t.current?.contains(a.target)&&n()}}function bn(e,t,n){const o=r.useRef(!1),[a,s]=r.useState(!1),i=r.useCallback(()=>{o.current?o.current=!1:s(!0)},[]),l=r.useCallback((c=!1)=>{s(!1),o.current=c,n&&n()},[]);return Hr("mousedown",$i,[e,t,l]),Hr("pointerdown",$i,[e,t,l]),{showPopup:a,doShowPopup:i,doHidePopup:l}}const Vi=e=>{const t=/(auto|scroll)/,n=(l,c)=>l.parentNode===null?c:n(l.parentNode,c.concat([l])),o=(l,c)=>getComputedStyle(l,null).getPropertyValue(c),a=l=>o(l,"overflow")+o(l,"overflow-y"),s=l=>t.test(a(l));return(l=>{if(!(l instanceof HTMLElement||l instanceof SVGElement))return;const c=n(l.parentNode,[]);for(let d=0;d<c.length;d+=1)if(s(c[d]))return c[d];return null})(e)};let Io=0,Fn=null,An=null;function $n({isOpen:e,rootRef:t}){r.useLayoutEffect(()=>{let n=!1;if(e&&t.current&&(n=!0,Io+=1,Io===1)){const o=Vi(t.current)||document.body;Fn=o;const a=o===document.body?window.innerWidth-document.documentElement.clientWidth:o.offsetWidth-o.clientWidth;o.style.overflow="hidden";const s=window.getComputedStyle(o).paddingRight;if(o.style.paddingRight=s&&s!=="0px"?`calc(${s} + ${a}px)`:`${a}px`,o===document.body){let i=document.getElementsByClassName("sps-navbar-container").item(0);if(i&&window.getComputedStyle(i).position==="fixed"){const l=window.getComputedStyle(i).paddingRight;i.style.paddingRight=l&&l!=="0px"?`calc(${l} + ${a}px)`:`${a}px`,An=i}else if(i=document.getElementsByTagName("nav").item(0)?.parentElement??null,i&&window.getComputedStyle(i).position==="fixed"){const c=window.getComputedStyle(i).paddingRight;i.style.paddingRight=c&&c!=="0px"?`calc(${c} + ${a}px)`:`${a}px`,An=i}}}return()=>{n&&(Io-=1,Io===0&&Fn&&(Fn.style.overflow="",Fn.style.paddingRight="",An&&(An.style.paddingRight="",An=null),Fn=null))}},[e])}const ff={debounce:"number",disabled:"boolean",conformWidth:"boolean",formMeta:"SpsFormFieldMeta<string>",icon:"SpsIcon",onChange:"React.ChangeEventHandler",onSelectionChange:"(newValue: string) => void",placeholder:"string",suggestions:{type:`
|
|
2
2
|
Eventually<Iterable<string>>
|
|
3
3
|
| ((filter?: string) => Eventually<Iterable<string>>)
|
|
4
|
-
`,required:!0},textKey:"string",captionKey:"string",tallOptionList:"boolean",value:"string",zeroState:"string",loading:"boolean",maxHeightOptionListPx:"number",maxHeightOptionListRem:"number",disableOptionsMemoization:"boolean",inputNotClearable:"boolean",autoFocusOnSelection:"boolean"};function Nt({className:e,debounce:t=0,disabled:n,conformWidth:o,formControl:a,formMeta:s,onChange:i,onSelectionChange:l,icon:c,id:d,placeholder:
|
|
4
|
+
`,required:!0},textKey:"string",captionKey:"string",tallOptionList:"boolean",value:"string",zeroState:"string",loading:"boolean",maxHeightOptionListPx:"number",maxHeightOptionListRem:"number",disableOptionsMemoization:"boolean",inputNotClearable:"boolean",autoFocusOnSelection:"boolean"};function Nt({className:e,debounce:t=0,disabled:n,conformWidth:o,formControl:a,formMeta:s,onChange:i,onSelectionChange:l,icon:c,id:d,placeholder:u="",suggestions:m,unsafelyReplaceClassName:p,textKey:f,captionKey:g,tallOptionList:v,value:y="",zeroState:b,loading:h,maxHeightOptionListPx:I,maxHeightOptionListRem:C,disableOptionsMemoization:D,inputNotClearable:L,autoFocusOnSelection:$,"data-testid":O,..._}){const R=s||a,{wrapperId:H,controlId:Z}=Ge(d,R),[V,w]=Dt({keyDown:null,opensUpward:!1}),F=r.useRef(null),B=r.useRef(null),M=r.useRef(null),{showPopup:q,doShowPopup:N,doHidePopup:T}=bn(F,M);function k(Y,G,ee=!1){R&&(R.setValue(Y),R.markAsDirty()),l&&ee?l(Y):i&&i(G||new Lt({value:Y}))}function U(Y){B.current&&(B.current.value="",k("")),Y.stopPropagation()}function J(Y){k(Y.target.value,Y)}function te(Y){n||(["Up","ArrowUp","Down","ArrowDown","Enter"].indexOf(Y.key)>-1&&Y.preventDefault(),Y.stopPropagation(),w({keyDown:hn(Y)})),Y.key==="Tab"&&T()}function ne(Y){Y?N():T()}function W(Y){w({opensUpward:Y})}const X=K(p||"sps-autocomplete",q&&"sps-autocomplete--open",q&&"z-stratum-dropdown",V.opensUpward&&"sps-autocomplete--opens-upward",n&&"sps-form-control--disabled",e);return r.useEffect(()=>{let Y;return q&&(Y=()=>{T()},window.addEventListener("resize",Y)),()=>{Y&&window.removeEventListener("resize",Y)}},[q]),$n({isOpen:q,rootRef:F}),r.createElement(Le,{id:H,className:X,formControl:a,formMeta:s,inputRef:B,ref:F,focusInputOnClick:!0,onClick:Y=>Y.nativeEvent.stopImmediatePropagation(),"data-testid":`${O}`},r.createElement("div",{className:"sps-text-input"},r.createElement("div",{className:"sps-form-control"},c&&r.createElement("i",{className:K("sps-text-input__icon","sps-icon",`sps-icon-${c}`)}),r.createElement("input",{type:"text",ref:B,value:y,className:"sps-text-input__input",placeholder:u,onFocus:N,onClick:N,onChange:J,onKeyDown:te,disabled:n,id:Z,"data-testid":`${O}__input`,..._}),y&&!n&&!L&&r.createElement("i",{"aria-label":"clear",className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:Y=>U(Y)}))),r.createElement(Rn,{id:`${H}_options`,ref:M,attachTo:F,isOpen:q,options:m,hideInlineSearch:!0,keyDown:V.keyDown,onOptionSelected:Y=>{const G=f&&typeof Y=="object"&&Y!==null?Y[f]??"":Y;k(G,void 0,!0),$&&B.current?.focus()},onPositionFlip:W,onSelfToggle:ne,offsets:[1,0],search:y,searchDebounce:t,textKey:f,captionKey:g,tall:v,zeroState:b,loading:h,maxHeightPx:I,maxHeightRem:C,disableOptionsMemoization:D,conformWidth:o}))}Object.assign(Nt,{props:ff,displayName:"SpsAutocomplete"});const Ki={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
5
5
|
import { SpsAutocomplete } from "@spscommerce/ds-react";
|
|
6
6
|
|
|
7
7
|
function DemoComponent() {
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
<SpsAutocomplete suggestions={colorSearch} value={color} onChange={handleChange} placeholder="Enter a color"/>
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
|
-
`}}}},
|
|
137
|
+
`}}}},Sf={checked:"boolean",disabled:"boolean",formMeta:"SpsFormFieldMeta<boolean>",indeterminate:"boolean",inline:"boolean",label:"string",onChange:"ChangeEventHandler"};function Jt({checked:e,className:t,disabled:n,formControl:o,formMeta:a,id:s,indeterminate:i=!1,inline:l,label:c,onChange:d,"data-testid":u,unsafelyReplaceClassName:m,...p}){const f=a||o,g=r.useRef(null),[v,y]=r.useState(e),[b,h]=r.useState(i),{wrapperId:I,controlId:C}=Ge(s,f);r.useEffect(()=>y(e),[e]),r.useEffect(()=>h(i),[i]),r.useEffect(()=>{g.current&&(g.current.indeterminate=b)},[b]);const D=K(m||"sps-checkbox","sps-checkable",l&&"sps-checkable--inline",!c&&"sps-checkable--no-label",t);function L($){y($.target.checked),h(!1),f&&(f.setValue($.target.checked),f.markAsDirty()),d&&d($),g.current?.focus()}return r.createElement(Le,{id:I,className:D,formControl:o,formMeta:a,inputRef:g,"data-testid":u},r.createElement("input",{type:"checkbox",ref:g,className:"sps-checkable__input",id:C,checked:v,disabled:n,"data-testid":`${u}__checkbox-input`,"data-checked":v?"checked":void 0,onChange:L,...p}),r.createElement("label",{className:"sps-checkable__label",htmlFor:C},c||""))}Object.assign(Jt,{props:Sf,displayName:"SpsCheckbox"});const Hi={labels:{label:"Labels",description:S.code`
|
|
138
138
|
<p>An individual checkbox should be labeled with its own <code>label</code> prop,
|
|
139
139
|
not the <code><SpsLabel></code> component.</p>
|
|
140
140
|
`,examples:{label:{react:S.code`
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
</SpsSummaryListRow>
|
|
250
250
|
);
|
|
251
251
|
}
|
|
252
|
-
`}}}},
|
|
252
|
+
`}}}},gf={disabled:"boolean",href:"string",kind:"ClickableTagKind",onAdd:"() => void",onRemove:"() => void"};function Vn(e){const{children:t,className:n,disabled:o,href:a,kind:s=A.ClickableTagKind.BLUE,onAdd:i,onRemove:l,onClick:c,"data-testid":d,unsafelyReplaceClassName:u,wrap:m=!1,...p}=e,f=K(u||"sps-clickable-tag",`sps-clickable-tag--${s}`,n,o&&"sps-clickable-tag--disabled",(i||l)&&"sps-clickable-tag--icon",m&&"sps-clickable-tag--wrap"),g=K("sps-clickable-tag__label",(a||c)&&"sps-clickable-tag__label--link"),v=r.Children.toArray(t).filter(h=>typeof h=="string").join("");function y(h){i?i():l&&l(),h.stopPropagation()}r.useEffect(()=>{if(l&&i)throw new Error("Clickable tag should have onRemove or onAdd, not both")},[i,l]);function b(h){h.stopPropagation(),c&&c(h)}return r.createElement("div",{className:f,"data-testid":d,...p},r.createElement("span",{className:g,title:v,onClick:b},a&&r.createElement("a",{href:a},t),!a&&t),(i||l)&&!o&&r.createElement("div",{className:"sps-clickable-tag__icon",onClick:y,tabIndex:-1,"aria-label":i?"Add":"Remove"},r.createElement("i",{"aria-hidden":"true",className:`sps-icon sps-icon-${i?A.SpsIcon.PLUS_SIGN:A.SpsIcon.X}`,"data-testid":`${d}__icon`})))}Object.assign(Vn,{props:gf,displayName:"SpsClickableTag"});const Wi={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
253
253
|
import { SpsClickableTag } from "@spscommerce/ds-react";
|
|
254
254
|
import { ClickableTagKind } from "@spscommerce/ds-shared";
|
|
255
255
|
function Component() {
|
|
@@ -349,23 +349,23 @@
|
|
|
349
349
|
</>
|
|
350
350
|
);
|
|
351
351
|
}
|
|
352
|
-
`}}}};function Kr(e,t){return Kr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Kr(e,t)}function Hi(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Kr(e,t)}function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ce.apply(null,arguments)}function $n(e){"@babel/helpers - typeof";return $n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$n(e)}function Sf(e,t){if($n(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if($n(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gf(e){var t=Sf(e,"string");return $n(t)=="symbol"?t:t+""}function hf(e,t,n){return(t=gf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,o)}return n}function Gi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wi(Object(n),!0).forEach(function(o){hf(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wi(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Je(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Ui=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),zi=function(){return Math.random().toString(36).substring(7).split("").join(".")},ji={INIT:"@@redux/INIT"+zi(),REPLACE:"@@redux/REPLACE"+zi()};function bf(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function vf(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Tf(e))return"date";if(Ef(e))return"error";var n=yf(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function yf(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ef(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Tf(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Xt(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=vf(e)),t}function Yi(e,t,n){var o;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Je(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Je(1):"Expected the enhancer to be a function. Instead, received: '"+Xt(n)+"'");return n(Yi)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Je(2):"Expected the root reducer to be a function. Instead, received: '"+Xt(e)+"'");var a=e,s=t,i=[],l=i,c=!1;function d(){l===i&&(l=i.slice())}function m(){if(c)throw new Error(process.env.NODE_ENV==="production"?Je(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function u(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Je(4):"Expected the listener to be a function. Instead, received: '"+Xt(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Je(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var y=!0;return d(),l.push(v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?Je(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d();var h=l.indexOf(v);l.splice(h,1),i=null}}}function p(v){if(!bf(v))throw new Error(process.env.NODE_ENV==="production"?Je(7):"Actions must be plain objects. Instead, the actual type was: '"+Xt(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Je(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Je(9):"Reducers may not dispatch actions.");try{c=!0,s=a(s,v)}finally{c=!1}for(var y=i=l,b=0;b<y.length;b++){var h=y[b];h()}return v}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Je(10):"Expected the nextReducer to be a function. Instead, received: '"+Xt(v));a=v,p({type:ji.REPLACE})}function g(){var v,y=u;return v={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(process.env.NODE_ENV==="production"?Je(11):"Expected the observer to be an object. Instead, received: '"+Xt(h)+"'");function I(){h.next&&h.next(m())}I();var C=y(I);return{unsubscribe:C}}},v[Ui]=function(){return this},v}return p({type:ji.INIT}),o={dispatch:p,subscribe:u,getState:m,replaceReducer:f},o[Ui]=g,o}function qi(e,t){return function(){return t(e.apply(this,arguments))}}function Ji(e,t){if(typeof e=="function")return qi(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?Je(16):"bindActionCreators expected an object or a function, but instead received: '"+Xt(e)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var n={};for(var o in e){var a=e[o];typeof a=="function"&&(n[o]=qi(a,t))}return n}function Xi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(o){return o}:t.length===1?t[0]:t.reduce(function(o,a){return function(){return o(a.apply(void 0,arguments))}})}function wf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(o){return function(){var a=o.apply(void 0,arguments),s=function(){throw new Error(process.env.NODE_ENV==="production"?Je(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},l=t.map(function(c){return c(i)});return s=Xi.apply(void 0,l)(a.dispatch),Gi(Gi({},a),{},{dispatch:s})}}}var Do={exports:{}},No={exports:{}},be={};var Zi;function Cf(){if(Zi)return be;Zi=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function I(D){if(typeof D=="object"&&D!==null){var L=D.$$typeof;switch(L){case t:switch(D=D.type,D){case c:case d:case o:case s:case a:case u:return D;default:switch(D=D&&D.$$typeof,D){case l:case m:case g:case f:case i:return D;default:return L}}case n:return L}}}function C(D){return I(D)===d}return be.AsyncMode=c,be.ConcurrentMode=d,be.ContextConsumer=l,be.ContextProvider=i,be.Element=t,be.ForwardRef=m,be.Fragment=o,be.Lazy=g,be.Memo=f,be.Portal=n,be.Profiler=s,be.StrictMode=a,be.Suspense=u,be.isAsyncMode=function(D){return C(D)||I(D)===c},be.isConcurrentMode=C,be.isContextConsumer=function(D){return I(D)===l},be.isContextProvider=function(D){return I(D)===i},be.isElement=function(D){return typeof D=="object"&&D!==null&&D.$$typeof===t},be.isForwardRef=function(D){return I(D)===m},be.isFragment=function(D){return I(D)===o},be.isLazy=function(D){return I(D)===g},be.isMemo=function(D){return I(D)===f},be.isPortal=function(D){return I(D)===n},be.isProfiler=function(D){return I(D)===s},be.isStrictMode=function(D){return I(D)===a},be.isSuspense=function(D){return I(D)===u},be.isValidElementType=function(D){return typeof D=="string"||typeof D=="function"||D===o||D===d||D===s||D===a||D===u||D===p||typeof D=="object"&&D!==null&&(D.$$typeof===g||D.$$typeof===f||D.$$typeof===i||D.$$typeof===l||D.$$typeof===m||D.$$typeof===y||D.$$typeof===b||D.$$typeof===h||D.$$typeof===v)},be.typeOf=I,be}var ve={};var Qi;function Df(){return Qi||(Qi=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function I(Q){return typeof Q=="string"||typeof Q=="function"||Q===o||Q===d||Q===s||Q===a||Q===u||Q===p||typeof Q=="object"&&Q!==null&&(Q.$$typeof===g||Q.$$typeof===f||Q.$$typeof===i||Q.$$typeof===l||Q.$$typeof===m||Q.$$typeof===y||Q.$$typeof===b||Q.$$typeof===h||Q.$$typeof===v)}function C(Q){if(typeof Q=="object"&&Q!==null){var fe=Q.$$typeof;switch(fe){case t:var se=Q.type;switch(se){case c:case d:case o:case s:case a:case u:return se;default:var pe=se&&se.$$typeof;switch(pe){case l:case m:case g:case f:case i:return pe;default:return fe}}case n:return fe}}}var D=c,L=d,$=l,O=i,_=t,R=m,H=o,Z=g,V=f,w=n,F=s,B=a,M=u,q=!1;function N(Q){return q||(q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(Q)||C(Q)===c}function T(Q){return C(Q)===d}function k(Q){return C(Q)===l}function U(Q){return C(Q)===i}function J(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===t}function te(Q){return C(Q)===m}function ne(Q){return C(Q)===o}function W(Q){return C(Q)===g}function X(Q){return C(Q)===f}function Y(Q){return C(Q)===n}function G(Q){return C(Q)===s}function ee(Q){return C(Q)===a}function z(Q){return C(Q)===u}ve.AsyncMode=D,ve.ConcurrentMode=L,ve.ContextConsumer=$,ve.ContextProvider=O,ve.Element=_,ve.ForwardRef=R,ve.Fragment=H,ve.Lazy=Z,ve.Memo=V,ve.Portal=w,ve.Profiler=F,ve.StrictMode=B,ve.Suspense=M,ve.isAsyncMode=N,ve.isConcurrentMode=T,ve.isContextConsumer=k,ve.isContextProvider=U,ve.isElement=J,ve.isForwardRef=te,ve.isFragment=ne,ve.isLazy=W,ve.isMemo=X,ve.isPortal=Y,ve.isProfiler=G,ve.isStrictMode=ee,ve.isSuspense=z,ve.isValidElementType=I,ve.typeOf=C})()),ve}var el;function Hr(){return el||(el=1,process.env.NODE_ENV==="production"?No.exports=Cf():No.exports=Df()),No.exports}var Wr,tl;function Nf(){if(tl)return Wr;tl=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function a(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},l=0;l<10;l++)i["_"+String.fromCharCode(l)]=l;var c=Object.getOwnPropertyNames(i).map(function(m){return i[m]});if(c.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(m){d[m]=m}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Wr=a()?Object.assign:function(s,i){for(var l,c=o(s),d,m=1;m<arguments.length;m++){l=Object(arguments[m]);for(var u in l)t.call(l,u)&&(c[u]=l[u]);if(e){d=e(l);for(var p=0;p<d.length;p++)n.call(l,d[p])&&(c[d[p]]=l[d[p]])}}return c},Wr}var Gr,nl;function Ur(){if(nl)return Gr;nl=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Gr=e,Gr}var zr,ol;function rl(){return ol||(ol=1,zr=Function.call.bind(Object.prototype.hasOwnProperty)),zr}var jr,al;function If(){if(al)return jr;al=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ur(),n={},o=rl();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function a(s,i,l,c,d){if(process.env.NODE_ENV!=="production"){for(var m in s)if(o(s,m)){var u;try{if(typeof s[m]!="function"){var p=Error((c||"React class")+": "+l+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}u=s[m](i,m,c,l,null,t)}catch(g){u=g}if(u&&!(u instanceof Error)&&e((c||"React class")+": type specification of "+l+" `"+m+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in n)){n[u.message]=!0;var f=d?d():"";e("Failed "+l+" type: "+u.message+(f??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},jr=a,jr}var Yr,sl;function xf(){if(sl)return Yr;sl=1;var e=Hr(),t=Nf(),n=Ur(),o=rl(),a=If(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(l){var c="Warning: "+l;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return Yr=function(l,c){var d=typeof Symbol=="function"&&Symbol.iterator,m="@@iterator";function u(T){var k=T&&(d&&T[d]||T[m]);if(typeof k=="function")return k}var p="<<anonymous>>",f={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:h(),arrayOf:I,element:C(),elementType:D(),instanceOf:L,node:R(),objectOf:O,oneOf:$,oneOfType:_,shape:Z,exact:V};function g(T,k){return T===k?T!==0||1/T===1/k:T!==T&&k!==k}function v(T,k){this.message=T,this.data=k&&typeof k=="object"?k:{},this.stack=""}v.prototype=Error.prototype;function y(T){if(process.env.NODE_ENV!=="production")var k={},U=0;function J(ne,W,X,Y,G,ee,z){if(Y=Y||p,ee=ee||X,z!==n){if(c){var Q=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Q.name="Invariant Violation",Q}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var fe=Y+":"+X;!k[fe]&&U<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ee+"` prop on `"+Y+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),k[fe]=!0,U++)}}return W[X]==null?ne?W[X]===null?new v("The "+G+" `"+ee+"` is marked as required "+("in `"+Y+"`, but its value is `null`.")):new v("The "+G+" `"+ee+"` is marked as required in "+("`"+Y+"`, but its value is `undefined`.")):null:T(W,X,Y,G,ee)}var te=J.bind(null,!1);return te.isRequired=J.bind(null,!0),te}function b(T){function k(U,J,te,ne,W,X){var Y=U[J],G=B(Y);if(G!==T){var ee=M(Y);return new v("Invalid "+ne+" `"+W+"` of type "+("`"+ee+"` supplied to `"+te+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return y(k)}function h(){return y(i)}function I(T){function k(U,J,te,ne,W){if(typeof T!="function")return new v("Property `"+W+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var X=U[J];if(!Array.isArray(X)){var Y=B(X);return new v("Invalid "+ne+" `"+W+"` of type "+("`"+Y+"` supplied to `"+te+"`, expected an array."))}for(var G=0;G<X.length;G++){var ee=T(X,G,te,ne,W+"["+G+"]",n);if(ee instanceof Error)return ee}return null}return y(k)}function C(){function T(k,U,J,te,ne){var W=k[U];if(!l(W)){var X=B(W);return new v("Invalid "+te+" `"+ne+"` of type "+("`"+X+"` supplied to `"+J+"`, expected a single ReactElement."))}return null}return y(T)}function D(){function T(k,U,J,te,ne){var W=k[U];if(!e.isValidElementType(W)){var X=B(W);return new v("Invalid "+te+" `"+ne+"` of type "+("`"+X+"` supplied to `"+J+"`, expected a single ReactElement type."))}return null}return y(T)}function L(T){function k(U,J,te,ne,W){if(!(U[J]instanceof T)){var X=T.name||p,Y=N(U[J]);return new v("Invalid "+ne+" `"+W+"` of type "+("`"+Y+"` supplied to `"+te+"`, expected ")+("instance of `"+X+"`."))}return null}return y(k)}function $(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function k(U,J,te,ne,W){for(var X=U[J],Y=0;Y<T.length;Y++)if(g(X,T[Y]))return null;var G=JSON.stringify(T,function(z,Q){var fe=M(Q);return fe==="symbol"?String(Q):Q});return new v("Invalid "+ne+" `"+W+"` of value `"+String(X)+"` "+("supplied to `"+te+"`, expected one of "+G+"."))}return y(k)}function O(T){function k(U,J,te,ne,W){if(typeof T!="function")return new v("Property `"+W+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var X=U[J],Y=B(X);if(Y!=="object")return new v("Invalid "+ne+" `"+W+"` of type "+("`"+Y+"` supplied to `"+te+"`, expected an object."));for(var G in X)if(o(X,G)){var ee=T(X,G,te,ne,W+"."+G,n);if(ee instanceof Error)return ee}return null}return y(k)}function _(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var k=0;k<T.length;k++){var U=T[k];if(typeof U!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+q(U)+" at index "+k+"."),i}function J(te,ne,W,X,Y){for(var G=[],ee=0;ee<T.length;ee++){var z=T[ee],Q=z(te,ne,W,X,Y,n);if(Q==null)return null;Q.data&&o(Q.data,"expectedType")&&G.push(Q.data.expectedType)}var fe=G.length>0?", expected one of type ["+G.join(", ")+"]":"";return new v("Invalid "+X+" `"+Y+"` supplied to "+("`"+W+"`"+fe+"."))}return y(J)}function R(){function T(k,U,J,te,ne){return w(k[U])?null:new v("Invalid "+te+" `"+ne+"` supplied to "+("`"+J+"`, expected a ReactNode."))}return y(T)}function H(T,k,U,J,te){return new v((T||"React class")+": "+k+" type `"+U+"."+J+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function Z(T){function k(U,J,te,ne,W){var X=U[J],Y=B(X);if(Y!=="object")return new v("Invalid "+ne+" `"+W+"` of type `"+Y+"` "+("supplied to `"+te+"`, expected `object`."));for(var G in T){var ee=T[G];if(typeof ee!="function")return H(te,ne,W,G,M(ee));var z=ee(X,G,te,ne,W+"."+G,n);if(z)return z}return null}return y(k)}function V(T){function k(U,J,te,ne,W){var X=U[J],Y=B(X);if(Y!=="object")return new v("Invalid "+ne+" `"+W+"` of type `"+Y+"` "+("supplied to `"+te+"`, expected `object`."));var G=t({},U[J],T);for(var ee in G){var z=T[ee];if(o(T,ee)&&typeof z!="function")return H(te,ne,W,ee,M(z));if(!z)return new v("Invalid "+ne+" `"+W+"` key `"+ee+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(U[J],null," ")+`
|
|
353
|
-
Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."+ee,n);if(Q)return Q}return null}return y(k)}function w(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(w);if(T===null||l(T))return!0;var k=u(T);if(k){var U=k.call(T),J;if(k!==T.entries){for(;!(J=U.next()).done;)if(!w(J.value))return!1}else for(;!(J=U.next()).done;){var te=J.value;if(te&&!w(te[1]))return!1}}else return!1;return!0;default:return!1}}function F(T,k){return T==="symbol"?!0:k?k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol:!1}function B(T){var k=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":F(k,T)?"symbol":k}function M(T){if(typeof T>"u"||T===null)return""+T;var k=B(T);if(k==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return k}function q(T){var k=M(T);switch(k){case"array":case"object":return"an "+k;case"boolean":case"date":case"regexp":return"a "+k;default:return k}}function N(T){return!T.constructor||!T.constructor.name?p:T.constructor.name}return f.checkPropTypes=a,f.resetWarningCache=a.resetWarningCache,f.PropTypes=f,f},Yr}var qr,il;function kf(){if(il)return qr;il=1;var e=Ur();function t(){}function n(){}return n.resetWarningCache=t,qr=function(){function o(i,l,c,d,m,u){if(u!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}o.isRequired=o;function a(){return o}var s={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:a,element:o,elementType:o,instanceOf:a,node:o,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},qr}var ll;function Mf(){if(ll)return Do.exports;if(ll=1,process.env.NODE_ENV!=="production"){var e=Hr(),t=!0;Do.exports=xf()(e.isElement,t)}else Do.exports=kf()();return Do.exports}var Lf=Mf();const vn=Ir(Lf);var Jr=E.createContext(null);process.env.NODE_ENV!=="production"&&(Jr.displayName="ReactRedux");function _f(e){e()}var cl=_f,Pf=function(t){return cl=t},Of=function(){return cl};function Bf(){var e=Of(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var a=t;a;)a.callback(),a=a.next})},get:function(){for(var a=[],s=t;s;)a.push(s),s=s.next;return a},subscribe:function(a){var s=!0,i=n={callback:a,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!s||t===null||(s=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var dl={notify:function(){},get:function(){return[]}};function pl(e,t){var n,o=dl;function a(u){return c(),o.subscribe(u)}function s(){o.notify()}function i(){m.onStateChange&&m.onStateChange()}function l(){return!!n}function c(){n||(n=t?t.addNestedSub(i):e.subscribe(i),o=Bf())}function d(){n&&(n(),n=void 0,o.clear(),o=dl)}var m={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:i,isSubscribed:l,trySubscribe:c,tryUnsubscribe:d,getListeners:function(){return o}};return m}var ul=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?E.useLayoutEffect:E.useEffect;function ml(e){var t=e.store,n=e.context,o=e.children,a=E.useMemo(function(){var l=pl(t);return{store:t,subscription:l}},[t]),s=E.useMemo(function(){return t.getState()},[t]);ul(function(){var l=a.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),s!==t.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[a,s]);var i=n||Jr;return E.createElement(i.Provider,{value:a},o)}process.env.NODE_ENV!=="production"&&(ml.propTypes={store:vn.shape({subscribe:vn.func.isRequired,dispatch:vn.func.isRequired,getState:vn.func.isRequired}),context:vn.object,children:vn.any});function Io(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}var Xr,fl;function Rf(){if(fl)return Xr;fl=1;var e=Hr(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=o,s[e.Memo]=a;function i(g){return e.isMemo(g)?a:s[g.$$typeof]||t}var l=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,m=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,p=Object.prototype;function f(g,v,y){if(typeof v!="string"){if(p){var b=u(v);b&&b!==p&&f(g,b,y)}var h=c(v);d&&(h=h.concat(d(v)));for(var I=i(g),C=i(v),D=0;D<h.length;++D){var L=h[D];if(!n[L]&&!(y&&y[L])&&!(C&&C[L])&&!(I&&I[L])){var $=m(v,L);try{l(g,L,$)}catch{}}}}return g}return Xr=f,Xr}var Ff=Rf();const Sl=Ir(Ff);var xo={exports:{}},Ee={};var gl;function Af(){if(gl)return Ee;gl=1;var e=60103,t=60106,n=60107,o=60108,a=60114,s=60109,i=60110,l=60112,c=60113,d=60120,m=60115,u=60116,p=60121,f=60122,g=60117,v=60129,y=60131;if(typeof Symbol=="function"&&Symbol.for){var b=Symbol.for;e=b("react.element"),t=b("react.portal"),n=b("react.fragment"),o=b("react.strict_mode"),a=b("react.profiler"),s=b("react.provider"),i=b("react.context"),l=b("react.forward_ref"),c=b("react.suspense"),d=b("react.suspense_list"),m=b("react.memo"),u=b("react.lazy"),p=b("react.block"),f=b("react.server.block"),g=b("react.fundamental"),v=b("react.debug_trace_mode"),y=b("react.legacy_hidden")}function h(V){if(typeof V=="object"&&V!==null){var w=V.$$typeof;switch(w){case e:switch(V=V.type,V){case n:case a:case o:case c:case d:return V;default:switch(V=V&&V.$$typeof,V){case i:case l:case u:case m:case s:return V;default:return w}}case t:return w}}}var I=s,C=e,D=l,L=n,$=u,O=m,_=t,R=a,H=o,Z=c;return Ee.ContextConsumer=i,Ee.ContextProvider=I,Ee.Element=C,Ee.ForwardRef=D,Ee.Fragment=L,Ee.Lazy=$,Ee.Memo=O,Ee.Portal=_,Ee.Profiler=R,Ee.StrictMode=H,Ee.Suspense=Z,Ee.isAsyncMode=function(){return!1},Ee.isConcurrentMode=function(){return!1},Ee.isContextConsumer=function(V){return h(V)===i},Ee.isContextProvider=function(V){return h(V)===s},Ee.isElement=function(V){return typeof V=="object"&&V!==null&&V.$$typeof===e},Ee.isForwardRef=function(V){return h(V)===l},Ee.isFragment=function(V){return h(V)===n},Ee.isLazy=function(V){return h(V)===u},Ee.isMemo=function(V){return h(V)===m},Ee.isPortal=function(V){return h(V)===t},Ee.isProfiler=function(V){return h(V)===a},Ee.isStrictMode=function(V){return h(V)===o},Ee.isSuspense=function(V){return h(V)===c},Ee.isValidElementType=function(V){return typeof V=="string"||typeof V=="function"||V===n||V===a||V===v||V===o||V===c||V===d||V===y||typeof V=="object"&&V!==null&&(V.$$typeof===u||V.$$typeof===m||V.$$typeof===s||V.$$typeof===i||V.$$typeof===l||V.$$typeof===g||V.$$typeof===p||V[0]===f)},Ee.typeOf=h,Ee}var Te={};var hl;function $f(){return hl||(hl=1,process.env.NODE_ENV!=="production"&&(function(){var e=60103,t=60106,n=60107,o=60108,a=60114,s=60109,i=60110,l=60112,c=60113,d=60120,m=60115,u=60116,p=60121,f=60122,g=60117,v=60129,y=60131;if(typeof Symbol=="function"&&Symbol.for){var b=Symbol.for;e=b("react.element"),t=b("react.portal"),n=b("react.fragment"),o=b("react.strict_mode"),a=b("react.profiler"),s=b("react.provider"),i=b("react.context"),l=b("react.forward_ref"),c=b("react.suspense"),d=b("react.suspense_list"),m=b("react.memo"),u=b("react.lazy"),p=b("react.block"),f=b("react.server.block"),g=b("react.fundamental"),b("react.scope"),b("react.opaque.id"),v=b("react.debug_trace_mode"),b("react.offscreen"),y=b("react.legacy_hidden")}var h=!1;function I(z){return!!(typeof z=="string"||typeof z=="function"||z===n||z===a||z===v||z===o||z===c||z===d||z===y||h||typeof z=="object"&&z!==null&&(z.$$typeof===u||z.$$typeof===m||z.$$typeof===s||z.$$typeof===i||z.$$typeof===l||z.$$typeof===g||z.$$typeof===p||z[0]===f))}function C(z){if(typeof z=="object"&&z!==null){var Q=z.$$typeof;switch(Q){case e:var fe=z.type;switch(fe){case n:case a:case o:case c:case d:return fe;default:var se=fe&&fe.$$typeof;switch(se){case i:case l:case u:case m:case s:return se;default:return Q}}case t:return Q}}}var D=i,L=s,$=e,O=l,_=n,R=u,H=m,Z=t,V=a,w=o,F=c,B=!1,M=!1;function q(z){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function N(z){return M||(M=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function T(z){return C(z)===i}function k(z){return C(z)===s}function U(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function J(z){return C(z)===l}function te(z){return C(z)===n}function ne(z){return C(z)===u}function W(z){return C(z)===m}function X(z){return C(z)===t}function Y(z){return C(z)===a}function G(z){return C(z)===o}function ee(z){return C(z)===c}Te.ContextConsumer=D,Te.ContextProvider=L,Te.Element=$,Te.ForwardRef=O,Te.Fragment=_,Te.Lazy=R,Te.Memo=H,Te.Portal=Z,Te.Profiler=V,Te.StrictMode=w,Te.Suspense=F,Te.isAsyncMode=q,Te.isConcurrentMode=N,Te.isContextConsumer=T,Te.isContextProvider=k,Te.isElement=U,Te.isForwardRef=J,Te.isFragment=te,Te.isLazy=ne,Te.isMemo=W,Te.isPortal=X,Te.isProfiler=Y,Te.isStrictMode=G,Te.isSuspense=ee,Te.isValidElementType=I,Te.typeOf=C})()),Te}var bl;function Vf(){return bl||(bl=1,process.env.NODE_ENV==="production"?xo.exports=Af():xo.exports=$f()),xo.exports}var vl=Vf(),Kf=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],Hf=["reactReduxForwardedRef"],Wf=[],Gf=[null,null],Uf=function(t){try{return JSON.stringify(t)}catch{return String(t)}};function zf(e,t){var n=e[1];return[t.payload,n+1]}function yl(e,t,n){ul(function(){return e.apply(void 0,t)},n)}function jf(e,t,n,o,a,s,i){e.current=o,t.current=a,n.current=!1,s.current&&(s.current=null,i())}function Yf(e,t,n,o,a,s,i,l,c,d){if(e){var m=!1,u=null,p=function(){if(!m){var v=t.getState(),y,b;try{y=o(v,a.current)}catch(h){b=h,u=h}b||(u=null),y===s.current?i.current||c():(s.current=y,l.current=y,i.current=!0,d({type:"STORE_UPDATED",payload:{error:b}}))}};n.onStateChange=p,n.trySubscribe(),p();var f=function(){if(m=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u};return f}}var qf=function(){return[null,0]};function Jf(e,t){t===void 0&&(t={});var n=t,o=n.getDisplayName,a=o===void 0?function(L){return"ConnectAdvanced("+L+")"}:o,s=n.methodName,i=s===void 0?"connectAdvanced":s,l=n.renderCountProp,c=l===void 0?void 0:l,d=n.shouldHandleStateChanges,m=d===void 0?!0:d,u=n.storeKey,p=u===void 0?"store":u,f=n.withRef,g=f===void 0?!1:f,v=n.forwardRef,y=v===void 0?!1:v,b=n.context,h=b===void 0?Jr:b,I=Io(n,Kf);if(process.env.NODE_ENV!=="production"){if(c!==void 0)throw new Error("renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension");if(g)throw new Error("withRef is removed. To access the wrapped instance, use a ref on the connected component");var C="To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a {context : MyContext} option to connect";if(p!=="store")throw new Error("storeKey has been removed and does not do anything. "+C)}var D=h;return function($){if(process.env.NODE_ENV!=="production"&&!vl.isValidElementType($))throw new Error("You must pass a component to the function returned by "+(i+". Instead received "+Uf($)));var O=$.displayName||$.name||"Component",_=a(O),R=ce({},I,{getDisplayName:a,methodName:i,renderCountProp:c,shouldHandleStateChanges:m,storeKey:p,displayName:_,wrappedComponentName:O,WrappedComponent:$}),H=I.pure;function Z(M){return e(M.dispatch,R)}var V=H?E.useMemo:function(M){return M()};function w(M){var q=E.useMemo(function(){var Ve=M.reactReduxForwardedRef,ft=Io(M,Hf);return[M.context,Ve,ft]},[M]),N=q[0],T=q[1],k=q[2],U=E.useMemo(function(){return N&&N.Consumer&&vl.isContextConsumer(E.createElement(N.Consumer,null))?N:D},[N,D]),J=E.useContext(U),te=!!M.store&&!!M.store.getState&&!!M.store.dispatch,ne=!!J&&!!J.store;if(process.env.NODE_ENV!=="production"&&!te&&!ne)throw new Error('Could not find "store" in the context of '+('"'+_+'". Either wrap the root component in a <Provider>, ')+"or pass a custom React context provider to <Provider> and the corresponding "+("React context consumer to "+_+" in connect options."));var W=te?M.store:J.store,X=E.useMemo(function(){return Z(W)},[W]),Y=E.useMemo(function(){if(!m)return Gf;var Ve=pl(W,te?null:J.subscription),ft=Ve.notifyNestedSubs.bind(Ve);return[Ve,ft]},[W,te,J]),G=Y[0],ee=Y[1],z=E.useMemo(function(){return te?J:ce({},J,{subscription:G})},[te,J,G]),Q=E.useReducer(zf,Wf,qf),fe=Q[0],se=fe[0],pe=Q[1];if(se&&se.error)throw se.error;var He=E.useRef(),$e=E.useRef(k),Xe=E.useRef(),nt=E.useRef(!1),mt=V(function(){return Xe.current&&k===$e.current?Xe.current:X(W.getState(),k)},[W,se,k]);yl(jf,[$e,He,nt,k,mt,Xe,ee]),yl(Yf,[m,W,G,X,$e,He,nt,Xe,ee,pe],[W,G,X]);var xe=E.useMemo(function(){return E.createElement($,ce({},mt,{ref:T}))},[T,$,mt]),ot=E.useMemo(function(){return m?E.createElement(U.Provider,{value:z},xe):xe},[U,xe,z]);return ot}var F=H?E.memo(w):w;if(F.WrappedComponent=$,F.displayName=w.displayName=_,y){var B=E.forwardRef(function(q,N){return E.createElement(F,ce({},q,{reactReduxForwardedRef:N}))});return B.displayName=_,B.WrappedComponent=$,Sl(B,$)}return Sl(F,$)}}function El(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Zr(e,t){if(El(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!El(e[n[a]],t[n[a]]))return!1;return!0}function Xf(e,t){var n={},o=function(i){var l=e[i];typeof l=="function"&&(n[i]=function(){return t(l.apply(void 0,arguments))})};for(var a in e)o(a);return n}function Zf(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function Tl(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function wl(e,t,n){Zf(e)||Tl(n+"() in "+t+" must return a plain object. Instead received "+e+".")}function Qr(e){return function(n,o){var a=e(n,o);function s(){return a}return s.dependsOnOwnProps=!1,s}}function Cl(e){return e.dependsOnOwnProps!==null&&e.dependsOnOwnProps!==void 0?!!e.dependsOnOwnProps:e.length!==1}function Dl(e,t){return function(o,a){var s=a.displayName,i=function(c,d){return i.dependsOnOwnProps?i.mapToProps(c,d):i.mapToProps(c)};return i.dependsOnOwnProps=!0,i.mapToProps=function(c,d){i.mapToProps=e,i.dependsOnOwnProps=Cl(e);var m=i(c,d);return typeof m=="function"&&(i.mapToProps=m,i.dependsOnOwnProps=Cl(m),m=i(c,d)),process.env.NODE_ENV!=="production"&&wl(m,s,t),m},i}}function Qf(e){return typeof e=="function"?Dl(e,"mapDispatchToProps"):void 0}function eS(e){return e?void 0:Qr(function(t){return{dispatch:t}})}function tS(e){return e&&typeof e=="object"?Qr(function(t){return Xf(e,t)}):void 0}const nS=[Qf,eS,tS];function oS(e){return typeof e=="function"?Dl(e,"mapStateToProps"):void 0}function rS(e){return e?void 0:Qr(function(){return{}})}const aS=[oS,rS];function sS(e,t,n){return ce({},n,e,t)}function iS(e){return function(n,o){var a=o.displayName,s=o.pure,i=o.areMergedPropsEqual,l=!1,c;return function(m,u,p){var f=e(m,u,p);return l?(!s||!i(f,c))&&(c=f):(l=!0,c=f,process.env.NODE_ENV!=="production"&&wl(c,a,"mergeProps")),c}}}function lS(e){return typeof e=="function"?iS(e):void 0}function cS(e){return e?void 0:function(){return sS}}const dS=[lS,cS];function ea(e,t,n){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||Tl("The selector for "+t+" of "+n+" did not specify a value for dependsOnOwnProps."));else throw new Error("Unexpected value for "+t+" in "+n+".")}function pS(e,t,n,o){ea(e,"mapStateToProps",o),ea(t,"mapDispatchToProps",o),ea(n,"mergeProps",o)}var uS=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function mS(e,t,n,o){return function(s,i){return n(e(s,i),t(o,i),i)}}function fS(e,t,n,o,a){var s=a.areStatesEqual,i=a.areOwnPropsEqual,l=a.areStatePropsEqual,c=!1,d,m,u,p,f;function g(I,C){return d=I,m=C,u=e(d,m),p=t(o,m),f=n(u,p,m),c=!0,f}function v(){return u=e(d,m),t.dependsOnOwnProps&&(p=t(o,m)),f=n(u,p,m),f}function y(){return e.dependsOnOwnProps&&(u=e(d,m)),t.dependsOnOwnProps&&(p=t(o,m)),f=n(u,p,m),f}function b(){var I=e(d,m),C=!l(I,u);return u=I,C&&(f=n(u,p,m)),f}function h(I,C){var D=!i(C,m),L=!s(I,d,C,m);return d=I,m=C,D&&L?v():D?y():L?b():f}return function(C,D){return c?h(C,D):g(C,D)}}function SS(e,t){var n=t.initMapStateToProps,o=t.initMapDispatchToProps,a=t.initMergeProps,s=Io(t,uS),i=n(e,s),l=o(e,s),c=a(e,s);process.env.NODE_ENV!=="production"&&pS(i,l,c,s.displayName);var d=s.pure?fS:mS;return d(i,l,c,e,s)}var gS=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function ta(e,t,n){for(var o=t.length-1;o>=0;o--){var a=t[o](e);if(a)return a}return function(s,i){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+i.wrappedComponentName+".")}}function hS(e,t){return e===t}function bS(e){var t=e===void 0?{}:e,n=t.connectHOC,o=n===void 0?Jf:n,a=t.mapStateToPropsFactories,s=a===void 0?aS:a,i=t.mapDispatchToPropsFactories,l=i===void 0?nS:i,c=t.mergePropsFactories,d=c===void 0?dS:c,m=t.selectorFactory,u=m===void 0?SS:m;return function(f,g,v,y){y===void 0&&(y={});var b=y,h=b.pure,I=h===void 0?!0:h,C=b.areStatesEqual,D=C===void 0?hS:C,L=b.areOwnPropsEqual,$=L===void 0?Zr:L,O=b.areStatePropsEqual,_=O===void 0?Zr:O,R=b.areMergedPropsEqual,H=R===void 0?Zr:R,Z=Io(b,gS),V=ta(f,s,"mapStateToProps"),w=ta(g,l,"mapDispatchToProps"),F=ta(v,d,"mergeProps");return o(u,ce({methodName:"connect",getDisplayName:function(M){return"Connect("+M+")"},shouldHandleStateChanges:!!f,initMapStateToProps:V,initMapDispatchToProps:w,initMergeProps:F,pure:I,areStatesEqual:D,areOwnPropsEqual:$,areStatePropsEqual:_,areMergedPropsEqual:H},Z))}}const Nl=bS();Pf(Ln.unstable_batchedUpdates);function vS(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Il(e,t){var n=E.useState(function(){return{inputs:t,result:e()}})[0],o=E.useRef(!0),a=E.useRef(n),s=o.current||!!(t&&a.current.inputs&&vS(t,a.current.inputs)),i=s?a.current:{inputs:t,result:e()};return E.useEffect(function(){o.current=!1,a.current=i},[i]),i.result}function yS(e,t){return Il(function(){return e},t)}var Se=Il,le=yS,ES=process.env.NODE_ENV==="production",na="Invariant failed";function xl(e,t){if(ES)throw new Error(na);var n=typeof t=="function"?t():t,o=n?"".concat(na,": ").concat(n):na;throw new Error(o)}var St=function(t){var n=t.top,o=t.right,a=t.bottom,s=t.left,i=o-s,l=a-n,c={top:n,right:o,bottom:a,left:s,width:i,height:l,x:s,y:n,center:{x:(o+s)/2,y:(a+n)/2}};return c},oa=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},kl=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},TS=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},ra={top:0,right:0,bottom:0,left:0},aa=function(t){var n=t.borderBox,o=t.margin,a=o===void 0?ra:o,s=t.border,i=s===void 0?ra:s,l=t.padding,c=l===void 0?ra:l,d=St(oa(n,a)),m=St(kl(n,i)),u=St(kl(m,c));return{marginBox:d,borderBox:St(n),paddingBox:m,contentBox:u,margin:a,border:i,padding:c}},st=function(t){var n=t.slice(0,-2),o=t.slice(-2);if(o!=="px")return 0;var a=Number(n);return isNaN(a)&&(process.env.NODE_ENV!=="production"?xl(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):xl()),a},wS=function(){return{x:window.pageXOffset,y:window.pageYOffset}},ko=function(t,n){var o=t.borderBox,a=t.border,s=t.margin,i=t.padding,l=TS(o,n);return aa({borderBox:l,border:a,margin:s,padding:i})},Mo=function(t,n){return n===void 0&&(n=wS()),ko(t,n)},Ml=function(t,n){var o={top:st(n.marginTop),right:st(n.marginRight),bottom:st(n.marginBottom),left:st(n.marginLeft)},a={top:st(n.paddingTop),right:st(n.paddingRight),bottom:st(n.paddingBottom),left:st(n.paddingLeft)},s={top:st(n.borderTopWidth),right:st(n.borderRightWidth),bottom:st(n.borderBottomWidth),left:st(n.borderLeftWidth)};return aa({borderBox:t,margin:o,padding:a,border:s})},Ll=function(t){var n=t.getBoundingClientRect(),o=window.getComputedStyle(t);return Ml(n,o)},_l=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function CS(e,t){return!!(e===t||_l(e)&&_l(t))}function DS(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!CS(e[n],t[n]))return!1;return!0}function Pe(e,t){t===void 0&&(t=DS);var n,o=[],a,s=!1;function i(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s&&n===this&&t(l,o)||(a=e.apply(this,l),s=!0,n=this,o=l),a}return i}var Vn=function(t){var n=[],o=null,a=function(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];n=l,!o&&(o=requestAnimationFrame(function(){o=null,t.apply(void 0,n)}))};return a.cancel=function(){o&&(cancelAnimationFrame(o),o=null)},a},NS=process.env.NODE_ENV==="production",IS=/[ \t]{2,}/g,xS=/^[ \t]*/gm,Pl=function(t){return t.replace(IS," ").replace(xS,"").trim()},kS=function(t){return Pl(`
|
|
352
|
+
`}}}};function Wr(e,t){return Wr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Wr(e,t)}function Gi(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Wr(e,t)}function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ce.apply(null,arguments)}function Kn(e){"@babel/helpers - typeof";return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(e)}function hf(e,t){if(Kn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(Kn(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bf(e){var t=hf(e,"string");return Kn(t)=="symbol"?t:t+""}function vf(e,t,n){return(t=bf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ui(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,o)}return n}function zi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ui(Object(n),!0).forEach(function(o){vf(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ui(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Je(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ji=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Yi=function(){return Math.random().toString(36).substring(7).split("").join(".")},qi={INIT:"@@redux/INIT"+Yi(),REPLACE:"@@redux/REPLACE"+Yi()};function yf(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ef(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Cf(e))return"date";if(wf(e))return"error";var n=Tf(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Tf(e){return typeof e.constructor=="function"?e.constructor.name:null}function wf(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Cf(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Xt(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Ef(e)),t}function Ji(e,t,n){var o;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Je(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Je(1):"Expected the enhancer to be a function. Instead, received: '"+Xt(n)+"'");return n(Ji)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Je(2):"Expected the root reducer to be a function. Instead, received: '"+Xt(e)+"'");var a=e,s=t,i=[],l=i,c=!1;function d(){l===i&&(l=i.slice())}function u(){if(c)throw new Error(process.env.NODE_ENV==="production"?Je(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function m(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Je(4):"Expected the listener to be a function. Instead, received: '"+Xt(v)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Je(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var y=!0;return d(),l.push(v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?Je(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d();var h=l.indexOf(v);l.splice(h,1),i=null}}}function p(v){if(!yf(v))throw new Error(process.env.NODE_ENV==="production"?Je(7):"Actions must be plain objects. Instead, the actual type was: '"+Xt(v)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Je(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Je(9):"Reducers may not dispatch actions.");try{c=!0,s=a(s,v)}finally{c=!1}for(var y=i=l,b=0;b<y.length;b++){var h=y[b];h()}return v}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Je(10):"Expected the nextReducer to be a function. Instead, received: '"+Xt(v));a=v,p({type:qi.REPLACE})}function g(){var v,y=m;return v={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(process.env.NODE_ENV==="production"?Je(11):"Expected the observer to be an object. Instead, received: '"+Xt(h)+"'");function I(){h.next&&h.next(u())}I();var C=y(I);return{unsubscribe:C}}},v[ji]=function(){return this},v}return p({type:qi.INIT}),o={dispatch:p,subscribe:m,getState:u,replaceReducer:f},o[ji]=g,o}function Xi(e,t){return function(){return t(e.apply(this,arguments))}}function Zi(e,t){if(typeof e=="function")return Xi(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?Je(16):"bindActionCreators expected an object or a function, but instead received: '"+Xt(e)+`'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);var n={};for(var o in e){var a=e[o];typeof a=="function"&&(n[o]=Xi(a,t))}return n}function Qi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(o){return o}:t.length===1?t[0]:t.reduce(function(o,a){return function(){return o(a.apply(void 0,arguments))}})}function Df(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(o){return function(){var a=o.apply(void 0,arguments),s=function(){throw new Error(process.env.NODE_ENV==="production"?Je(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},l=t.map(function(c){return c(i)});return s=Qi.apply(void 0,l)(a.dispatch),zi(zi({},a),{},{dispatch:s})}}}var xo={exports:{}},ko={exports:{}},be={};var el;function Nf(){if(el)return be;el=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function I(D){if(typeof D=="object"&&D!==null){var L=D.$$typeof;switch(L){case t:switch(D=D.type,D){case c:case d:case o:case s:case a:case m:return D;default:switch(D=D&&D.$$typeof,D){case l:case u:case g:case f:case i:return D;default:return L}}case n:return L}}}function C(D){return I(D)===d}return be.AsyncMode=c,be.ConcurrentMode=d,be.ContextConsumer=l,be.ContextProvider=i,be.Element=t,be.ForwardRef=u,be.Fragment=o,be.Lazy=g,be.Memo=f,be.Portal=n,be.Profiler=s,be.StrictMode=a,be.Suspense=m,be.isAsyncMode=function(D){return C(D)||I(D)===c},be.isConcurrentMode=C,be.isContextConsumer=function(D){return I(D)===l},be.isContextProvider=function(D){return I(D)===i},be.isElement=function(D){return typeof D=="object"&&D!==null&&D.$$typeof===t},be.isForwardRef=function(D){return I(D)===u},be.isFragment=function(D){return I(D)===o},be.isLazy=function(D){return I(D)===g},be.isMemo=function(D){return I(D)===f},be.isPortal=function(D){return I(D)===n},be.isProfiler=function(D){return I(D)===s},be.isStrictMode=function(D){return I(D)===a},be.isSuspense=function(D){return I(D)===m},be.isValidElementType=function(D){return typeof D=="string"||typeof D=="function"||D===o||D===d||D===s||D===a||D===m||D===p||typeof D=="object"&&D!==null&&(D.$$typeof===g||D.$$typeof===f||D.$$typeof===i||D.$$typeof===l||D.$$typeof===u||D.$$typeof===y||D.$$typeof===b||D.$$typeof===h||D.$$typeof===v)},be.typeOf=I,be}var ve={};var tl;function If(){return tl||(tl=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function I(Q){return typeof Q=="string"||typeof Q=="function"||Q===o||Q===d||Q===s||Q===a||Q===m||Q===p||typeof Q=="object"&&Q!==null&&(Q.$$typeof===g||Q.$$typeof===f||Q.$$typeof===i||Q.$$typeof===l||Q.$$typeof===u||Q.$$typeof===y||Q.$$typeof===b||Q.$$typeof===h||Q.$$typeof===v)}function C(Q){if(typeof Q=="object"&&Q!==null){var fe=Q.$$typeof;switch(fe){case t:var se=Q.type;switch(se){case c:case d:case o:case s:case a:case m:return se;default:var pe=se&&se.$$typeof;switch(pe){case l:case u:case g:case f:case i:return pe;default:return fe}}case n:return fe}}}var D=c,L=d,$=l,O=i,_=t,R=u,H=o,Z=g,V=f,w=n,F=s,B=a,M=m,q=!1;function N(Q){return q||(q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(Q)||C(Q)===c}function T(Q){return C(Q)===d}function k(Q){return C(Q)===l}function U(Q){return C(Q)===i}function J(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===t}function te(Q){return C(Q)===u}function ne(Q){return C(Q)===o}function W(Q){return C(Q)===g}function X(Q){return C(Q)===f}function Y(Q){return C(Q)===n}function G(Q){return C(Q)===s}function ee(Q){return C(Q)===a}function z(Q){return C(Q)===m}ve.AsyncMode=D,ve.ConcurrentMode=L,ve.ContextConsumer=$,ve.ContextProvider=O,ve.Element=_,ve.ForwardRef=R,ve.Fragment=H,ve.Lazy=Z,ve.Memo=V,ve.Portal=w,ve.Profiler=F,ve.StrictMode=B,ve.Suspense=M,ve.isAsyncMode=N,ve.isConcurrentMode=T,ve.isContextConsumer=k,ve.isContextProvider=U,ve.isElement=J,ve.isForwardRef=te,ve.isFragment=ne,ve.isLazy=W,ve.isMemo=X,ve.isPortal=Y,ve.isProfiler=G,ve.isStrictMode=ee,ve.isSuspense=z,ve.isValidElementType=I,ve.typeOf=C})()),ve}var nl;function Gr(){return nl||(nl=1,process.env.NODE_ENV==="production"?ko.exports=Nf():ko.exports=If()),ko.exports}var Ur,ol;function xf(){if(ol)return Ur;ol=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function a(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},l=0;l<10;l++)i["_"+String.fromCharCode(l)]=l;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var d={};return"abcdefghijklmnopqrst".split("").forEach(function(u){d[u]=u}),Object.keys(Object.assign({},d)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ur=a()?Object.assign:function(s,i){for(var l,c=o(s),d,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var m in l)t.call(l,m)&&(c[m]=l[m]);if(e){d=e(l);for(var p=0;p<d.length;p++)n.call(l,d[p])&&(c[d[p]]=l[d[p]])}}return c},Ur}var zr,rl;function jr(){if(rl)return zr;rl=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return zr=e,zr}var Yr,al;function sl(){return al||(al=1,Yr=Function.call.bind(Object.prototype.hasOwnProperty)),Yr}var qr,il;function kf(){if(il)return qr;il=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=jr(),n={},o=sl();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function a(s,i,l,c,d){if(process.env.NODE_ENV!=="production"){for(var u in s)if(o(s,u)){var m;try{if(typeof s[u]!="function"){var p=Error((c||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}m=s[u](i,u,c,l,null,t)}catch(g){m=g}if(m&&!(m instanceof Error)&&e((c||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in n)){n[m.message]=!0;var f=d?d():"";e("Failed "+l+" type: "+m.message+(f??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},qr=a,qr}var Jr,ll;function Mf(){if(ll)return Jr;ll=1;var e=Gr(),t=xf(),n=jr(),o=sl(),a=kf(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(l){var c="Warning: "+l;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return Jr=function(l,c){var d=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function m(T){var k=T&&(d&&T[d]||T[u]);if(typeof k=="function")return k}var p="<<anonymous>>",f={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:h(),arrayOf:I,element:C(),elementType:D(),instanceOf:L,node:R(),objectOf:O,oneOf:$,oneOfType:_,shape:Z,exact:V};function g(T,k){return T===k?T!==0||1/T===1/k:T!==T&&k!==k}function v(T,k){this.message=T,this.data=k&&typeof k=="object"?k:{},this.stack=""}v.prototype=Error.prototype;function y(T){if(process.env.NODE_ENV!=="production")var k={},U=0;function J(ne,W,X,Y,G,ee,z){if(Y=Y||p,ee=ee||X,z!==n){if(c){var Q=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Q.name="Invariant Violation",Q}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var fe=Y+":"+X;!k[fe]&&U<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ee+"` prop on `"+Y+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),k[fe]=!0,U++)}}return W[X]==null?ne?W[X]===null?new v("The "+G+" `"+ee+"` is marked as required "+("in `"+Y+"`, but its value is `null`.")):new v("The "+G+" `"+ee+"` is marked as required in "+("`"+Y+"`, but its value is `undefined`.")):null:T(W,X,Y,G,ee)}var te=J.bind(null,!1);return te.isRequired=J.bind(null,!0),te}function b(T){function k(U,J,te,ne,W,X){var Y=U[J],G=B(Y);if(G!==T){var ee=M(Y);return new v("Invalid "+ne+" `"+W+"` of type "+("`"+ee+"` supplied to `"+te+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return y(k)}function h(){return y(i)}function I(T){function k(U,J,te,ne,W){if(typeof T!="function")return new v("Property `"+W+"` of component `"+te+"` has invalid PropType notation inside arrayOf.");var X=U[J];if(!Array.isArray(X)){var Y=B(X);return new v("Invalid "+ne+" `"+W+"` of type "+("`"+Y+"` supplied to `"+te+"`, expected an array."))}for(var G=0;G<X.length;G++){var ee=T(X,G,te,ne,W+"["+G+"]",n);if(ee instanceof Error)return ee}return null}return y(k)}function C(){function T(k,U,J,te,ne){var W=k[U];if(!l(W)){var X=B(W);return new v("Invalid "+te+" `"+ne+"` of type "+("`"+X+"` supplied to `"+J+"`, expected a single ReactElement."))}return null}return y(T)}function D(){function T(k,U,J,te,ne){var W=k[U];if(!e.isValidElementType(W)){var X=B(W);return new v("Invalid "+te+" `"+ne+"` of type "+("`"+X+"` supplied to `"+J+"`, expected a single ReactElement type."))}return null}return y(T)}function L(T){function k(U,J,te,ne,W){if(!(U[J]instanceof T)){var X=T.name||p,Y=N(U[J]);return new v("Invalid "+ne+" `"+W+"` of type "+("`"+Y+"` supplied to `"+te+"`, expected ")+("instance of `"+X+"`."))}return null}return y(k)}function $(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function k(U,J,te,ne,W){for(var X=U[J],Y=0;Y<T.length;Y++)if(g(X,T[Y]))return null;var G=JSON.stringify(T,function(z,Q){var fe=M(Q);return fe==="symbol"?String(Q):Q});return new v("Invalid "+ne+" `"+W+"` of value `"+String(X)+"` "+("supplied to `"+te+"`, expected one of "+G+"."))}return y(k)}function O(T){function k(U,J,te,ne,W){if(typeof T!="function")return new v("Property `"+W+"` of component `"+te+"` has invalid PropType notation inside objectOf.");var X=U[J],Y=B(X);if(Y!=="object")return new v("Invalid "+ne+" `"+W+"` of type "+("`"+Y+"` supplied to `"+te+"`, expected an object."));for(var G in X)if(o(X,G)){var ee=T(X,G,te,ne,W+"."+G,n);if(ee instanceof Error)return ee}return null}return y(k)}function _(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var k=0;k<T.length;k++){var U=T[k];if(typeof U!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+q(U)+" at index "+k+"."),i}function J(te,ne,W,X,Y){for(var G=[],ee=0;ee<T.length;ee++){var z=T[ee],Q=z(te,ne,W,X,Y,n);if(Q==null)return null;Q.data&&o(Q.data,"expectedType")&&G.push(Q.data.expectedType)}var fe=G.length>0?", expected one of type ["+G.join(", ")+"]":"";return new v("Invalid "+X+" `"+Y+"` supplied to "+("`"+W+"`"+fe+"."))}return y(J)}function R(){function T(k,U,J,te,ne){return w(k[U])?null:new v("Invalid "+te+" `"+ne+"` supplied to "+("`"+J+"`, expected a ReactNode."))}return y(T)}function H(T,k,U,J,te){return new v((T||"React class")+": "+k+" type `"+U+"."+J+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+te+"`.")}function Z(T){function k(U,J,te,ne,W){var X=U[J],Y=B(X);if(Y!=="object")return new v("Invalid "+ne+" `"+W+"` of type `"+Y+"` "+("supplied to `"+te+"`, expected `object`."));for(var G in T){var ee=T[G];if(typeof ee!="function")return H(te,ne,W,G,M(ee));var z=ee(X,G,te,ne,W+"."+G,n);if(z)return z}return null}return y(k)}function V(T){function k(U,J,te,ne,W){var X=U[J],Y=B(X);if(Y!=="object")return new v("Invalid "+ne+" `"+W+"` of type `"+Y+"` "+("supplied to `"+te+"`, expected `object`."));var G=t({},U[J],T);for(var ee in G){var z=T[ee];if(o(T,ee)&&typeof z!="function")return H(te,ne,W,ee,M(z));if(!z)return new v("Invalid "+ne+" `"+W+"` key `"+ee+"` supplied to `"+te+"`.\nBad object: "+JSON.stringify(U[J],null," ")+`
|
|
353
|
+
Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."+ee,n);if(Q)return Q}return null}return y(k)}function w(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(w);if(T===null||l(T))return!0;var k=m(T);if(k){var U=k.call(T),J;if(k!==T.entries){for(;!(J=U.next()).done;)if(!w(J.value))return!1}else for(;!(J=U.next()).done;){var te=J.value;if(te&&!w(te[1]))return!1}}else return!1;return!0;default:return!1}}function F(T,k){return T==="symbol"?!0:k?k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol:!1}function B(T){var k=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":F(k,T)?"symbol":k}function M(T){if(typeof T>"u"||T===null)return""+T;var k=B(T);if(k==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return k}function q(T){var k=M(T);switch(k){case"array":case"object":return"an "+k;case"boolean":case"date":case"regexp":return"a "+k;default:return k}}function N(T){return!T.constructor||!T.constructor.name?p:T.constructor.name}return f.checkPropTypes=a,f.resetWarningCache=a.resetWarningCache,f.PropTypes=f,f},Jr}var Xr,cl;function Lf(){if(cl)return Xr;cl=1;var e=jr();function t(){}function n(){}return n.resetWarningCache=t,Xr=function(){function o(i,l,c,d,u,m){if(m!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}o.isRequired=o;function a(){return o}var s={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:a,element:o,elementType:o,instanceOf:a,node:o,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Xr}var dl;function _f(){if(dl)return xo.exports;if(dl=1,process.env.NODE_ENV!=="production"){var e=Gr(),t=!0;xo.exports=Mf()(e.isElement,t)}else xo.exports=Lf()();return xo.exports}var Pf=_f();const vn=Mr(Pf);var Zr=E.createContext(null);process.env.NODE_ENV!=="production"&&(Zr.displayName="ReactRedux");function Of(e){e()}var pl=Of,Bf=function(t){return pl=t},Rf=function(){return pl};function Ff(){var e=Rf(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var a=t;a;)a.callback(),a=a.next})},get:function(){for(var a=[],s=t;s;)a.push(s),s=s.next;return a},subscribe:function(a){var s=!0,i=n={callback:a,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!s||t===null||(s=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var ul={notify:function(){},get:function(){return[]}};function ml(e,t){var n,o=ul;function a(m){return c(),o.subscribe(m)}function s(){o.notify()}function i(){u.onStateChange&&u.onStateChange()}function l(){return!!n}function c(){n||(n=t?t.addNestedSub(i):e.subscribe(i),o=Ff())}function d(){n&&(n(),n=void 0,o.clear(),o=ul)}var u={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:i,isSubscribed:l,trySubscribe:c,tryUnsubscribe:d,getListeners:function(){return o}};return u}var fl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?E.useLayoutEffect:E.useEffect;function Sl(e){var t=e.store,n=e.context,o=e.children,a=E.useMemo(function(){var l=ml(t);return{store:t,subscription:l}},[t]),s=E.useMemo(function(){return t.getState()},[t]);fl(function(){var l=a.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),s!==t.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[a,s]);var i=n||Zr;return E.createElement(i.Provider,{value:a},o)}process.env.NODE_ENV!=="production"&&(Sl.propTypes={store:vn.shape({subscribe:vn.func.isRequired,dispatch:vn.func.isRequired,getState:vn.func.isRequired}),context:vn.object,children:vn.any});function Mo(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}var Qr,gl;function Af(){if(gl)return Qr;gl=1;var e=Gr(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[e.ForwardRef]=o,s[e.Memo]=a;function i(g){return e.isMemo(g)?a:s[g.$$typeof]||t}var l=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,p=Object.prototype;function f(g,v,y){if(typeof v!="string"){if(p){var b=m(v);b&&b!==p&&f(g,b,y)}var h=c(v);d&&(h=h.concat(d(v)));for(var I=i(g),C=i(v),D=0;D<h.length;++D){var L=h[D];if(!n[L]&&!(y&&y[L])&&!(C&&C[L])&&!(I&&I[L])){var $=u(v,L);try{l(g,L,$)}catch{}}}}return g}return Qr=f,Qr}var $f=Af();const hl=Mr($f);var Lo={exports:{}},Ee={};var bl;function Vf(){if(bl)return Ee;bl=1;var e=60103,t=60106,n=60107,o=60108,a=60114,s=60109,i=60110,l=60112,c=60113,d=60120,u=60115,m=60116,p=60121,f=60122,g=60117,v=60129,y=60131;if(typeof Symbol=="function"&&Symbol.for){var b=Symbol.for;e=b("react.element"),t=b("react.portal"),n=b("react.fragment"),o=b("react.strict_mode"),a=b("react.profiler"),s=b("react.provider"),i=b("react.context"),l=b("react.forward_ref"),c=b("react.suspense"),d=b("react.suspense_list"),u=b("react.memo"),m=b("react.lazy"),p=b("react.block"),f=b("react.server.block"),g=b("react.fundamental"),v=b("react.debug_trace_mode"),y=b("react.legacy_hidden")}function h(V){if(typeof V=="object"&&V!==null){var w=V.$$typeof;switch(w){case e:switch(V=V.type,V){case n:case a:case o:case c:case d:return V;default:switch(V=V&&V.$$typeof,V){case i:case l:case m:case u:case s:return V;default:return w}}case t:return w}}}var I=s,C=e,D=l,L=n,$=m,O=u,_=t,R=a,H=o,Z=c;return Ee.ContextConsumer=i,Ee.ContextProvider=I,Ee.Element=C,Ee.ForwardRef=D,Ee.Fragment=L,Ee.Lazy=$,Ee.Memo=O,Ee.Portal=_,Ee.Profiler=R,Ee.StrictMode=H,Ee.Suspense=Z,Ee.isAsyncMode=function(){return!1},Ee.isConcurrentMode=function(){return!1},Ee.isContextConsumer=function(V){return h(V)===i},Ee.isContextProvider=function(V){return h(V)===s},Ee.isElement=function(V){return typeof V=="object"&&V!==null&&V.$$typeof===e},Ee.isForwardRef=function(V){return h(V)===l},Ee.isFragment=function(V){return h(V)===n},Ee.isLazy=function(V){return h(V)===m},Ee.isMemo=function(V){return h(V)===u},Ee.isPortal=function(V){return h(V)===t},Ee.isProfiler=function(V){return h(V)===a},Ee.isStrictMode=function(V){return h(V)===o},Ee.isSuspense=function(V){return h(V)===c},Ee.isValidElementType=function(V){return typeof V=="string"||typeof V=="function"||V===n||V===a||V===v||V===o||V===c||V===d||V===y||typeof V=="object"&&V!==null&&(V.$$typeof===m||V.$$typeof===u||V.$$typeof===s||V.$$typeof===i||V.$$typeof===l||V.$$typeof===g||V.$$typeof===p||V[0]===f)},Ee.typeOf=h,Ee}var Te={};var vl;function Kf(){return vl||(vl=1,process.env.NODE_ENV!=="production"&&(function(){var e=60103,t=60106,n=60107,o=60108,a=60114,s=60109,i=60110,l=60112,c=60113,d=60120,u=60115,m=60116,p=60121,f=60122,g=60117,v=60129,y=60131;if(typeof Symbol=="function"&&Symbol.for){var b=Symbol.for;e=b("react.element"),t=b("react.portal"),n=b("react.fragment"),o=b("react.strict_mode"),a=b("react.profiler"),s=b("react.provider"),i=b("react.context"),l=b("react.forward_ref"),c=b("react.suspense"),d=b("react.suspense_list"),u=b("react.memo"),m=b("react.lazy"),p=b("react.block"),f=b("react.server.block"),g=b("react.fundamental"),b("react.scope"),b("react.opaque.id"),v=b("react.debug_trace_mode"),b("react.offscreen"),y=b("react.legacy_hidden")}var h=!1;function I(z){return!!(typeof z=="string"||typeof z=="function"||z===n||z===a||z===v||z===o||z===c||z===d||z===y||h||typeof z=="object"&&z!==null&&(z.$$typeof===m||z.$$typeof===u||z.$$typeof===s||z.$$typeof===i||z.$$typeof===l||z.$$typeof===g||z.$$typeof===p||z[0]===f))}function C(z){if(typeof z=="object"&&z!==null){var Q=z.$$typeof;switch(Q){case e:var fe=z.type;switch(fe){case n:case a:case o:case c:case d:return fe;default:var se=fe&&fe.$$typeof;switch(se){case i:case l:case m:case u:case s:return se;default:return Q}}case t:return Q}}}var D=i,L=s,$=e,O=l,_=n,R=m,H=u,Z=t,V=a,w=o,F=c,B=!1,M=!1;function q(z){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function N(z){return M||(M=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function T(z){return C(z)===i}function k(z){return C(z)===s}function U(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function J(z){return C(z)===l}function te(z){return C(z)===n}function ne(z){return C(z)===m}function W(z){return C(z)===u}function X(z){return C(z)===t}function Y(z){return C(z)===a}function G(z){return C(z)===o}function ee(z){return C(z)===c}Te.ContextConsumer=D,Te.ContextProvider=L,Te.Element=$,Te.ForwardRef=O,Te.Fragment=_,Te.Lazy=R,Te.Memo=H,Te.Portal=Z,Te.Profiler=V,Te.StrictMode=w,Te.Suspense=F,Te.isAsyncMode=q,Te.isConcurrentMode=N,Te.isContextConsumer=T,Te.isContextProvider=k,Te.isElement=U,Te.isForwardRef=J,Te.isFragment=te,Te.isLazy=ne,Te.isMemo=W,Te.isPortal=X,Te.isProfiler=Y,Te.isStrictMode=G,Te.isSuspense=ee,Te.isValidElementType=I,Te.typeOf=C})()),Te}var yl;function Hf(){return yl||(yl=1,process.env.NODE_ENV==="production"?Lo.exports=Vf():Lo.exports=Kf()),Lo.exports}var El=Hf(),Wf=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],Gf=["reactReduxForwardedRef"],Uf=[],zf=[null,null],jf=function(t){try{return JSON.stringify(t)}catch{return String(t)}};function Yf(e,t){var n=e[1];return[t.payload,n+1]}function Tl(e,t,n){fl(function(){return e.apply(void 0,t)},n)}function qf(e,t,n,o,a,s,i){e.current=o,t.current=a,n.current=!1,s.current&&(s.current=null,i())}function Jf(e,t,n,o,a,s,i,l,c,d){if(e){var u=!1,m=null,p=function(){if(!u){var v=t.getState(),y,b;try{y=o(v,a.current)}catch(h){b=h,m=h}b||(m=null),y===s.current?i.current||c():(s.current=y,l.current=y,i.current=!0,d({type:"STORE_UPDATED",payload:{error:b}}))}};n.onStateChange=p,n.trySubscribe(),p();var f=function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,m)throw m};return f}}var Xf=function(){return[null,0]};function Zf(e,t){t===void 0&&(t={});var n=t,o=n.getDisplayName,a=o===void 0?function(L){return"ConnectAdvanced("+L+")"}:o,s=n.methodName,i=s===void 0?"connectAdvanced":s,l=n.renderCountProp,c=l===void 0?void 0:l,d=n.shouldHandleStateChanges,u=d===void 0?!0:d,m=n.storeKey,p=m===void 0?"store":m,f=n.withRef,g=f===void 0?!1:f,v=n.forwardRef,y=v===void 0?!1:v,b=n.context,h=b===void 0?Zr:b,I=Mo(n,Wf);if(process.env.NODE_ENV!=="production"){if(c!==void 0)throw new Error("renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension");if(g)throw new Error("withRef is removed. To access the wrapped instance, use a ref on the connected component");var C="To use a custom Redux store for specific components, create a custom React context with React.createContext(), and pass the context object to React Redux's Provider and specific components like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. You may also pass a {context : MyContext} option to connect";if(p!=="store")throw new Error("storeKey has been removed and does not do anything. "+C)}var D=h;return function($){if(process.env.NODE_ENV!=="production"&&!El.isValidElementType($))throw new Error("You must pass a component to the function returned by "+(i+". Instead received "+jf($)));var O=$.displayName||$.name||"Component",_=a(O),R=ce({},I,{getDisplayName:a,methodName:i,renderCountProp:c,shouldHandleStateChanges:u,storeKey:p,displayName:_,wrappedComponentName:O,WrappedComponent:$}),H=I.pure;function Z(M){return e(M.dispatch,R)}var V=H?E.useMemo:function(M){return M()};function w(M){var q=E.useMemo(function(){var Ve=M.reactReduxForwardedRef,ft=Mo(M,Gf);return[M.context,Ve,ft]},[M]),N=q[0],T=q[1],k=q[2],U=E.useMemo(function(){return N&&N.Consumer&&El.isContextConsumer(E.createElement(N.Consumer,null))?N:D},[N,D]),J=E.useContext(U),te=!!M.store&&!!M.store.getState&&!!M.store.dispatch,ne=!!J&&!!J.store;if(process.env.NODE_ENV!=="production"&&!te&&!ne)throw new Error('Could not find "store" in the context of '+('"'+_+'". Either wrap the root component in a <Provider>, ')+"or pass a custom React context provider to <Provider> and the corresponding "+("React context consumer to "+_+" in connect options."));var W=te?M.store:J.store,X=E.useMemo(function(){return Z(W)},[W]),Y=E.useMemo(function(){if(!u)return zf;var Ve=ml(W,te?null:J.subscription),ft=Ve.notifyNestedSubs.bind(Ve);return[Ve,ft]},[W,te,J]),G=Y[0],ee=Y[1],z=E.useMemo(function(){return te?J:ce({},J,{subscription:G})},[te,J,G]),Q=E.useReducer(Yf,Uf,Xf),fe=Q[0],se=fe[0],pe=Q[1];if(se&&se.error)throw se.error;var He=E.useRef(),$e=E.useRef(k),Xe=E.useRef(),nt=E.useRef(!1),mt=V(function(){return Xe.current&&k===$e.current?Xe.current:X(W.getState(),k)},[W,se,k]);Tl(qf,[$e,He,nt,k,mt,Xe,ee]),Tl(Jf,[u,W,G,X,$e,He,nt,Xe,ee,pe],[W,G,X]);var xe=E.useMemo(function(){return E.createElement($,ce({},mt,{ref:T}))},[T,$,mt]),ot=E.useMemo(function(){return u?E.createElement(U.Provider,{value:z},xe):xe},[U,xe,z]);return ot}var F=H?E.memo(w):w;if(F.WrappedComponent=$,F.displayName=w.displayName=_,y){var B=E.forwardRef(function(q,N){return E.createElement(F,ce({},q,{reactReduxForwardedRef:N}))});return B.displayName=_,B.WrappedComponent=$,hl(B,$)}return hl(F,$)}}function wl(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ea(e,t){if(wl(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(!Object.prototype.hasOwnProperty.call(t,n[a])||!wl(e[n[a]],t[n[a]]))return!1;return!0}function Qf(e,t){var n={},o=function(i){var l=e[i];typeof l=="function"&&(n[i]=function(){return t(l.apply(void 0,arguments))})};for(var a in e)o(a);return n}function eS(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function Cl(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function Dl(e,t,n){eS(e)||Cl(n+"() in "+t+" must return a plain object. Instead received "+e+".")}function ta(e){return function(n,o){var a=e(n,o);function s(){return a}return s.dependsOnOwnProps=!1,s}}function Nl(e){return e.dependsOnOwnProps!==null&&e.dependsOnOwnProps!==void 0?!!e.dependsOnOwnProps:e.length!==1}function Il(e,t){return function(o,a){var s=a.displayName,i=function(c,d){return i.dependsOnOwnProps?i.mapToProps(c,d):i.mapToProps(c)};return i.dependsOnOwnProps=!0,i.mapToProps=function(c,d){i.mapToProps=e,i.dependsOnOwnProps=Nl(e);var u=i(c,d);return typeof u=="function"&&(i.mapToProps=u,i.dependsOnOwnProps=Nl(u),u=i(c,d)),process.env.NODE_ENV!=="production"&&Dl(u,s,t),u},i}}function tS(e){return typeof e=="function"?Il(e,"mapDispatchToProps"):void 0}function nS(e){return e?void 0:ta(function(t){return{dispatch:t}})}function oS(e){return e&&typeof e=="object"?ta(function(t){return Qf(e,t)}):void 0}const rS=[tS,nS,oS];function aS(e){return typeof e=="function"?Il(e,"mapStateToProps"):void 0}function sS(e){return e?void 0:ta(function(){return{}})}const iS=[aS,sS];function lS(e,t,n){return ce({},n,e,t)}function cS(e){return function(n,o){var a=o.displayName,s=o.pure,i=o.areMergedPropsEqual,l=!1,c;return function(u,m,p){var f=e(u,m,p);return l?(!s||!i(f,c))&&(c=f):(l=!0,c=f,process.env.NODE_ENV!=="production"&&Dl(c,a,"mergeProps")),c}}}function dS(e){return typeof e=="function"?cS(e):void 0}function pS(e){return e?void 0:function(){return lS}}const uS=[dS,pS];function na(e,t,n){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||Cl("The selector for "+t+" of "+n+" did not specify a value for dependsOnOwnProps."));else throw new Error("Unexpected value for "+t+" in "+n+".")}function mS(e,t,n,o){na(e,"mapStateToProps",o),na(t,"mapDispatchToProps",o),na(n,"mergeProps",o)}var fS=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function SS(e,t,n,o){return function(s,i){return n(e(s,i),t(o,i),i)}}function gS(e,t,n,o,a){var s=a.areStatesEqual,i=a.areOwnPropsEqual,l=a.areStatePropsEqual,c=!1,d,u,m,p,f;function g(I,C){return d=I,u=C,m=e(d,u),p=t(o,u),f=n(m,p,u),c=!0,f}function v(){return m=e(d,u),t.dependsOnOwnProps&&(p=t(o,u)),f=n(m,p,u),f}function y(){return e.dependsOnOwnProps&&(m=e(d,u)),t.dependsOnOwnProps&&(p=t(o,u)),f=n(m,p,u),f}function b(){var I=e(d,u),C=!l(I,m);return m=I,C&&(f=n(m,p,u)),f}function h(I,C){var D=!i(C,u),L=!s(I,d,C,u);return d=I,u=C,D&&L?v():D?y():L?b():f}return function(C,D){return c?h(C,D):g(C,D)}}function hS(e,t){var n=t.initMapStateToProps,o=t.initMapDispatchToProps,a=t.initMergeProps,s=Mo(t,fS),i=n(e,s),l=o(e,s),c=a(e,s);process.env.NODE_ENV!=="production"&&mS(i,l,c,s.displayName);var d=s.pure?gS:SS;return d(i,l,c,e,s)}var bS=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function oa(e,t,n){for(var o=t.length-1;o>=0;o--){var a=t[o](e);if(a)return a}return function(s,i){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+i.wrappedComponentName+".")}}function vS(e,t){return e===t}function yS(e){var t=e===void 0?{}:e,n=t.connectHOC,o=n===void 0?Zf:n,a=t.mapStateToPropsFactories,s=a===void 0?iS:a,i=t.mapDispatchToPropsFactories,l=i===void 0?rS:i,c=t.mergePropsFactories,d=c===void 0?uS:c,u=t.selectorFactory,m=u===void 0?hS:u;return function(f,g,v,y){y===void 0&&(y={});var b=y,h=b.pure,I=h===void 0?!0:h,C=b.areStatesEqual,D=C===void 0?vS:C,L=b.areOwnPropsEqual,$=L===void 0?ea:L,O=b.areStatePropsEqual,_=O===void 0?ea:O,R=b.areMergedPropsEqual,H=R===void 0?ea:R,Z=Mo(b,bS),V=oa(f,s,"mapStateToProps"),w=oa(g,l,"mapDispatchToProps"),F=oa(v,d,"mergeProps");return o(m,ce({methodName:"connect",getDisplayName:function(M){return"Connect("+M+")"},shouldHandleStateChanges:!!f,initMapStateToProps:V,initMapDispatchToProps:w,initMergeProps:F,pure:I,areStatesEqual:D,areOwnPropsEqual:$,areStatePropsEqual:_,areMergedPropsEqual:H},Z))}}const xl=yS();Bf(Ln.unstable_batchedUpdates);function ES(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function kl(e,t){var n=E.useState(function(){return{inputs:t,result:e()}})[0],o=E.useRef(!0),a=E.useRef(n),s=o.current||!!(t&&a.current.inputs&&ES(t,a.current.inputs)),i=s?a.current:{inputs:t,result:e()};return E.useEffect(function(){o.current=!1,a.current=i},[i]),i.result}function TS(e,t){return kl(function(){return e},t)}var Se=kl,le=TS,wS=process.env.NODE_ENV==="production",ra="Invariant failed";function Ml(e,t){if(wS)throw new Error(ra);var n=typeof t=="function"?t():t,o=n?"".concat(ra,": ").concat(n):ra;throw new Error(o)}var St=function(t){var n=t.top,o=t.right,a=t.bottom,s=t.left,i=o-s,l=a-n,c={top:n,right:o,bottom:a,left:s,width:i,height:l,x:s,y:n,center:{x:(o+s)/2,y:(a+n)/2}};return c},aa=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},Ll=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},CS=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},sa={top:0,right:0,bottom:0,left:0},ia=function(t){var n=t.borderBox,o=t.margin,a=o===void 0?sa:o,s=t.border,i=s===void 0?sa:s,l=t.padding,c=l===void 0?sa:l,d=St(aa(n,a)),u=St(Ll(n,i)),m=St(Ll(u,c));return{marginBox:d,borderBox:St(n),paddingBox:u,contentBox:m,margin:a,border:i,padding:c}},st=function(t){var n=t.slice(0,-2),o=t.slice(-2);if(o!=="px")return 0;var a=Number(n);return isNaN(a)&&(process.env.NODE_ENV!=="production"?Ml(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):Ml()),a},DS=function(){return{x:window.pageXOffset,y:window.pageYOffset}},_o=function(t,n){var o=t.borderBox,a=t.border,s=t.margin,i=t.padding,l=CS(o,n);return ia({borderBox:l,border:a,margin:s,padding:i})},Po=function(t,n){return n===void 0&&(n=DS()),_o(t,n)},_l=function(t,n){var o={top:st(n.marginTop),right:st(n.marginRight),bottom:st(n.marginBottom),left:st(n.marginLeft)},a={top:st(n.paddingTop),right:st(n.paddingRight),bottom:st(n.paddingBottom),left:st(n.paddingLeft)},s={top:st(n.borderTopWidth),right:st(n.borderRightWidth),bottom:st(n.borderBottomWidth),left:st(n.borderLeftWidth)};return ia({borderBox:t,margin:o,padding:a,border:s})},Pl=function(t){var n=t.getBoundingClientRect(),o=window.getComputedStyle(t);return _l(n,o)},Ol=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function NS(e,t){return!!(e===t||Ol(e)&&Ol(t))}function IS(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!NS(e[n],t[n]))return!1;return!0}function Pe(e,t){t===void 0&&(t=IS);var n,o=[],a,s=!1;function i(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s&&n===this&&t(l,o)||(a=e.apply(this,l),s=!0,n=this,o=l),a}return i}var Hn=function(t){var n=[],o=null,a=function(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];n=l,!o&&(o=requestAnimationFrame(function(){o=null,t.apply(void 0,n)}))};return a.cancel=function(){o&&(cancelAnimationFrame(o),o=null)},a},xS=process.env.NODE_ENV==="production",kS=/[ \t]{2,}/g,MS=/^[ \t]*/gm,Bl=function(t){return t.replace(kS," ").replace(MS,"").trim()},LS=function(t){return Bl(`
|
|
354
354
|
%creact-beautiful-dnd
|
|
355
355
|
|
|
356
|
-
%c`+
|
|
356
|
+
%c`+Bl(t)+`
|
|
357
357
|
|
|
358
358
|
%c👷 This is a development only message. It will be removed in production builds.
|
|
359
|
-
`)},
|
|
359
|
+
`)},_S=function(t){return[LS(t),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},PS="__react-beautiful-dnd-disable-dev-warnings";function Rl(e,t){var n;xS||typeof window<"u"&&window[PS]||(n=console)[e].apply(n,_S(t))}var Ce=Rl.bind(null,"warn"),la=Rl.bind(null,"error");function Ft(){}function OS(e,t){return ce({},e,{},t)}function it(e,t,n){var o=t.map(function(a){var s=OS(n,a.options);return e.addEventListener(a.eventName,a.fn,s),function(){e.removeEventListener(a.eventName,a.fn,s)}});return function(){o.forEach(function(s){s()})}}var BS=process.env.NODE_ENV==="production",Fl="Invariant failed";function Wn(e){this.message=e}Wn.prototype.toString=function(){return this.message};function P(e,t){throw BS?new Wn(Fl):new Wn(Fl+": "+(t||""))}var RS=(function(e){Gi(t,e);function t(){for(var o,a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return o=e.call.apply(e,[this].concat(s))||this,o.callbacks=null,o.unbind=Ft,o.onWindowError=function(l){var c=o.getCallbacks();c.isDragging()&&(c.tryAbort(),process.env.NODE_ENV!=="production"&&Ce(`
|
|
360
360
|
An error was caught by our window 'error' event listener while a drag was occurring.
|
|
361
361
|
The active drag has been aborted.
|
|
362
|
-
`));var d=l.error;d instanceof
|
|
362
|
+
`));var d=l.error;d instanceof Wn&&(l.preventDefault(),process.env.NODE_ENV!=="production"&&la(d.message))},o.getCallbacks=function(){if(!o.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return o.callbacks},o.setCallbacks=function(l){o.callbacks=l},o}var n=t.prototype;return n.componentDidMount=function(){this.unbind=it(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(a){if(a instanceof Wn){process.env.NODE_ENV!=="production"&&la(a.message),this.setState({});return}throw a},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t})(E.Component),FS=`
|
|
363
363
|
Press space bar to start a drag.
|
|
364
364
|
When dragging you can use the arrow keys to move the item around and escape to cancel.
|
|
365
365
|
Some screen readers may require you to be in focus mode or to use your pass through key
|
|
366
|
-
`,
|
|
367
|
-
You have lifted an item in position `+
|
|
368
|
-
`},
|
|
366
|
+
`,Oo=function(t){return t+1},AS=function(t){return`
|
|
367
|
+
You have lifted an item in position `+Oo(t.source.index)+`
|
|
368
|
+
`},Al=function(t,n){var o=t.droppableId===n.droppableId,a=Oo(t.index),s=Oo(n.index);return o?`
|
|
369
369
|
You have moved the item from position `+a+`
|
|
370
370
|
to position `+s+`
|
|
371
371
|
`:`
|
|
@@ -373,58 +373,58 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
373
373
|
in list `+t.droppableId+`
|
|
374
374
|
to list `+n.droppableId+`
|
|
375
375
|
in position `+s+`
|
|
376
|
-
`}
|
|
376
|
+
`},$l=function(t,n,o){var a=n.droppableId===o.droppableId;return a?`
|
|
377
377
|
The item `+t+`
|
|
378
378
|
has been combined with `+o.draggableId:`
|
|
379
379
|
The item `+t+`
|
|
380
380
|
in list `+n.droppableId+`
|
|
381
381
|
has been combined with `+o.draggableId+`
|
|
382
382
|
in list `+o.droppableId+`
|
|
383
|
-
`}
|
|
383
|
+
`},$S=function(t){var n=t.destination;if(n)return Al(t.source,n);var o=t.combine;return o?$l(t.draggableId,t.source,o):"You are over an area that cannot be dropped on"},Vl=function(t){return`
|
|
384
384
|
The item has returned to its starting position
|
|
385
|
-
of `+
|
|
386
|
-
`},
|
|
385
|
+
of `+Oo(t.index)+`
|
|
386
|
+
`},VS=function(t){if(t.reason==="CANCEL")return`
|
|
387
387
|
Movement cancelled.
|
|
388
|
-
`+
|
|
388
|
+
`+Vl(t.source)+`
|
|
389
389
|
`;var n=t.destination,o=t.combine;return n?`
|
|
390
390
|
You have dropped the item.
|
|
391
|
-
`+
|
|
391
|
+
`+Al(t.source,n)+`
|
|
392
392
|
`:o?`
|
|
393
393
|
You have dropped the item.
|
|
394
|
-
|
|
394
|
+
`+$l(t.draggableId,t.source,o)+`
|
|
395
395
|
`:`
|
|
396
396
|
The item has been dropped while not over a drop area.
|
|
397
|
-
`+
|
|
398
|
-
`},_o={dragHandleUsageInstructions:BS,onDragStart:RS,onDragUpdate:FS,onDragEnd:AS},Oe={x:0,y:0},Ae=function(t,n){return{x:t.x+n.x,y:t.y+n.y}},Qe=function(t,n){return{x:t.x-n.x,y:t.y-n.y}},At=function(t,n){return t.x===n.x&&t.y===n.y},yn=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},Zt=function(t,n,o){var a;return o===void 0&&(o=0),a={},a[t]=n,a[t==="x"?"y":"x"]=o,a},Hn=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},$l=function(t,n){return Math.min.apply(Math,n.map(function(o){return Hn(t,o)}))},Vl=function(t){return function(n){return{x:t(n.x),y:t(n.y)}}},$S=(function(e,t){var n=St({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}),Wn=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Kl=function(t){return[{x:t.left,y:t.top},{x:t.right,y:t.top},{x:t.left,y:t.bottom},{x:t.right,y:t.bottom}]},VS={top:0,right:0,bottom:0,left:0},KS=function(t,n){return n?Wn(t,n.scroll.diff.displacement):t},HS=function(t,n,o){if(o&&o.increasedBy){var a;return ce({},t,(a={},a[n.end]=t[n.end]+o.increasedBy[n.line],a))}return t},WS=function(t,n){return n&&n.shouldClipSubject?$S(n.pageMarginBox,t):St(t)},En=(function(e){var t=e.page,n=e.withPlaceholder,o=e.axis,a=e.frame,s=KS(t.marginBox,a),i=HS(s,o,n),l=WS(i,a);return{page:t,withPlaceholder:n,active:l}}),ia=(function(e,t){e.frame||(process.env.NODE_ENV,P());var n=e.frame,o=Qe(t,n.scroll.initial),a=yn(o),s=ce({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:o,displacement:a},max:n.scroll.max}}),i=En({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:s}),l=ce({},e,{frame:s,subject:i});return l});function GS(e){return Number.isInteger?Number.isInteger(e):typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function Po(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function la(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function $t(e,t){if(e.find)return e.find(t);var n=la(e,t);if(n!==-1)return e[n]}function Hl(e){return Array.prototype.slice.call(e)}var Wl=Pe(function(e){return e.reduce(function(t,n){return t[n.descriptor.id]=n,t},{})}),Gl=Pe(function(e){return e.reduce(function(t,n){return t[n.descriptor.id]=n,t},{})}),Oo=Pe(function(e){return Po(e)}),US=Pe(function(e){return Po(e)}),Qt=Pe(function(e,t){var n=US(t).filter(function(o){return e===o.descriptor.droppableId}).sort(function(o,a){return o.descriptor.index-a.descriptor.index});return n});function ca(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function Bo(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var Ro=Pe(function(e,t){return t.filter(function(n){return n.descriptor.id!==e.descriptor.id})}),zS=(function(e){var t=e.isMovingForward,n=e.draggable,o=e.destination,a=e.insideDestination,s=e.previousImpact;if(!o.isCombineEnabled)return null;var i=ca(s);if(!i)return null;function l(v){var y={type:"COMBINE",combine:{draggableId:v,droppableId:o.descriptor.id}};return ce({},s,{at:y})}var c=s.displaced.all,d=c.length?c[0]:null;if(t)return d?l(d):null;var m=Ro(n,a);if(!d){if(!m.length)return null;var u=m[m.length-1];return l(u.descriptor.id)}var p=la(m,function(v){return v.descriptor.id===d});p===-1&&(process.env.NODE_ENV!=="production"?P(!1,"Could not find displaced item in set"):P());var f=p-1;if(f<0)return null;var g=m[f];return l(g.descriptor.id)}),Tn=(function(e,t){return e.descriptor.droppableId===t.descriptor.id}),Ul={point:Oe,value:0},Gn={invisible:{},visible:{},all:[]},jS={displaced:Gn,displacedBy:Ul,at:null},lt=(function(e,t){return function(n){return e<=n&&n<=t}}),zl=(function(e){var t=lt(e.top,e.bottom),n=lt(e.left,e.right);return function(o){var a=t(o.top)&&t(o.bottom)&&n(o.left)&&n(o.right);if(a)return!0;var s=t(o.top)||t(o.bottom),i=n(o.left)||n(o.right),l=s&&i;if(l)return!0;var c=o.top<e.top&&o.bottom>e.bottom,d=o.left<e.left&&o.right>e.right,m=c&&d;if(m)return!0;var u=c&&i||d&&s;return u}}),YS=(function(e){var t=lt(e.top,e.bottom),n=lt(e.left,e.right);return function(o){var a=t(o.top)&&t(o.bottom)&&n(o.left)&&n(o.right);return a}}),da={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},jl={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},qS=(function(e){return function(t){var n=lt(t.top,t.bottom),o=lt(t.left,t.right);return function(a){return e===da?n(a.top)&&n(a.bottom):o(a.left)&&o(a.right)}}}),JS=function(t,n){var o=n.frame?n.frame.scroll.diff.displacement:Oe;return Wn(t,o)},XS=function(t,n,o){return n.subject.active?o(n.subject.active)(t):!1},ZS=function(t,n,o){return o(n)(t)},pa=function(t){var n=t.target,o=t.destination,a=t.viewport,s=t.withDroppableDisplacement,i=t.isVisibleThroughFrameFn,l=s?JS(n,o):n;return XS(l,o,i)&&ZS(l,a,i)},QS=function(t){return pa(ce({},t,{isVisibleThroughFrameFn:zl}))},Yl=function(t){return pa(ce({},t,{isVisibleThroughFrameFn:YS}))},eg=function(t){return pa(ce({},t,{isVisibleThroughFrameFn:qS(t.destination.axis)}))},tg=function(t,n,o){if(typeof o=="boolean")return o;if(!n)return!0;var a=n.invisible,s=n.visible;if(a[t])return!1;var i=s[t];return i?i.shouldAnimate:!0};function ng(e,t){var n=e.page.marginBox,o={top:t.point.y,right:0,bottom:0,left:t.point.x};return St(oa(n,o))}function Un(e){var t=e.afterDragging,n=e.destination,o=e.displacedBy,a=e.viewport,s=e.forceShouldAnimate,i=e.last;return t.reduce(function(c,d){var m=ng(d,o),u=d.descriptor.id;c.all.push(u);var p=QS({target:m,destination:n,viewport:a,withDroppableDisplacement:!0});if(!p)return c.invisible[d.descriptor.id]=!0,c;var f=tg(u,i,s),g={draggableId:u,shouldAnimate:f};return c.visible[u]=g,c},{all:[],visible:{},invisible:{}})}function og(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function ql(e){var t=e.insideDestination,n=e.inHomeList,o=e.displacedBy,a=e.destination,s=og(t,{inHomeList:n});return{displaced:Gn,displacedBy:o,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:s}}}}function Fo(e){var t=e.draggable,n=e.insideDestination,o=e.destination,a=e.viewport,s=e.displacedBy,i=e.last,l=e.index,c=e.forceShouldAnimate,d=Tn(t,o);if(l==null)return ql({insideDestination:n,inHomeList:d,displacedBy:s,destination:o});var m=$t(n,function(v){return v.descriptor.index===l});if(!m)return ql({insideDestination:n,inHomeList:d,displacedBy:s,destination:o});var u=Ro(t,n),p=n.indexOf(m),f=u.slice(p),g=Un({afterDragging:f,destination:o,displacedBy:s,last:i,viewport:a.frame,forceShouldAnimate:c});return{displaced:g,displacedBy:s,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:l}}}}function Vt(e,t){return!!t.effected[e]}var rg=(function(e){var t=e.isMovingForward,n=e.destination,o=e.draggables,a=e.combine,s=e.afterCritical;if(!n.isCombineEnabled)return null;var i=a.draggableId,l=o[i],c=l.descriptor.index,d=Vt(i,s);return d?t?c:c-1:t?c+1:c}),ag=(function(e){var t=e.isMovingForward,n=e.isInHomeList,o=e.insideDestination,a=e.location;if(!o.length)return null;var s=a.index,i=t?s+1:s-1,l=o[0].descriptor.index,c=o[o.length-1].descriptor.index,d=n?c:c+1;return i<l||i>d?null:i}),sg=(function(e){var t=e.isMovingForward,n=e.isInHomeList,o=e.draggable,a=e.draggables,s=e.destination,i=e.insideDestination,l=e.previousImpact,c=e.viewport,d=e.afterCritical,m=l.at;if(m||(process.env.NODE_ENV!=="production"?P(!1,"Cannot move in direction without previous impact location"):P()),m.type==="REORDER"){var u=ag({isMovingForward:t,isInHomeList:n,location:m.destination,insideDestination:i});return u==null?null:Fo({draggable:o,insideDestination:i,destination:s,viewport:c,last:l.displaced,displacedBy:l.displacedBy,index:u})}var p=rg({isMovingForward:t,destination:s,displaced:l.displaced,draggables:a,combine:m.combine,afterCritical:d});return p==null?null:Fo({draggable:o,insideDestination:i,destination:s,viewport:c,last:l.displaced,displacedBy:l.displacedBy,index:p})}),ig=(function(e){var t=e.displaced,n=e.afterCritical,o=e.combineWith,a=e.displacedBy,s=!!(t.visible[o]||t.invisible[o]);return Vt(o,n)?s?Oe:yn(a.point):s?a.point:Oe}),lg=(function(e){var t=e.afterCritical,n=e.impact,o=e.draggables,a=Bo(n);a||(process.env.NODE_ENV,P());var s=a.draggableId,i=o[s].page.borderBox.center,l=ig({displaced:n.displaced,afterCritical:t,combineWith:s,displacedBy:n.displacedBy});return Ae(i,l)}),Jl=function(t,n){return n.margin[t.start]+n.borderBox[t.size]/2},cg=function(t,n){return n.margin[t.end]+n.borderBox[t.size]/2},ua=function(t,n,o){return n[t.crossAxisStart]+o.margin[t.crossAxisStart]+o.borderBox[t.crossAxisSize]/2},Xl=function(t){var n=t.axis,o=t.moveRelativeTo,a=t.isMoving;return Zt(n.line,o.marginBox[n.end]+Jl(n,a),ua(n,o.marginBox,a))},Zl=function(t){var n=t.axis,o=t.moveRelativeTo,a=t.isMoving;return Zt(n.line,o.marginBox[n.start]-cg(n,a),ua(n,o.marginBox,a))},dg=function(t){var n=t.axis,o=t.moveInto,a=t.isMoving;return Zt(n.line,o.contentBox[n.start]+Jl(n,a),ua(n,o.contentBox,a))},pg=(function(e){var t=e.impact,n=e.draggable,o=e.draggables,a=e.droppable,s=e.afterCritical,i=Qt(a.descriptor.id,o),l=n.page,c=a.axis;if(!i.length)return dg({axis:c,moveInto:a.page,isMoving:l});var d=t.displaced,m=t.displacedBy,u=d.all[0];if(u){var p=o[u];if(Vt(u,s))return Zl({axis:c,moveRelativeTo:p.page,isMoving:l});var f=ko(p.page,m.point);return Zl({axis:c,moveRelativeTo:f,isMoving:l})}var g=i[i.length-1];if(g.descriptor.id===n.descriptor.id)return l.borderBox.center;if(Vt(g.descriptor.id,s)){var v=ko(g.page,yn(s.displacedBy.point));return Xl({axis:c,moveRelativeTo:v,isMoving:l})}return Xl({axis:c,moveRelativeTo:g.page,isMoving:l})}),ma=(function(e,t){var n=e.frame;return n?Ae(t,n.scroll.diff.displacement):t}),ug=function(t){var n=t.impact,o=t.draggable,a=t.droppable,s=t.draggables,i=t.afterCritical,l=o.page.borderBox.center,c=n.at;return!a||!c?l:c.type==="REORDER"?pg({impact:n,draggable:o,draggables:s,droppable:a,afterCritical:i}):lg({impact:n,draggables:s,afterCritical:i})},Ao=(function(e){var t=ug(e),n=e.droppable,o=n?ma(n,t):t;return o}),Ql=(function(e,t){var n=Qe(t,e.scroll.initial),o=yn(n),a=St({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),s={frame:a,scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:o}}};return s});function ec(e,t){return e.map(function(n){return t[n]})}function mg(e,t){for(var n=0;n<t.length;n++){var o=t[n].visible[e];if(o)return o}return null}var fg=(function(e){var t=e.impact,n=e.viewport,o=e.destination,a=e.draggables,s=e.maxScrollChange,i=Ql(n,Ae(n.scroll.current,s)),l=o.frame?ia(o,Ae(o.frame.scroll.current,s)):o,c=t.displaced,d=Un({afterDragging:ec(c.all,a),destination:o,displacedBy:t.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),m=Un({afterDragging:ec(c.all,a),destination:l,displacedBy:t.displacedBy,viewport:n.frame,last:c,forceShouldAnimate:!1}),u={},p={},f=[c,d,m];c.all.forEach(function(v){var y=mg(v,f);if(y){p[v]=y;return}u[v]=!0});var g=ce({},t,{displaced:{all:c.all,invisible:u,visible:p}});return g}),Sg=(function(e,t){return Ae(e.scroll.diff.displacement,t)}),fa=(function(e){var t=e.pageBorderBoxCenter,n=e.draggable,o=e.viewport,a=Sg(o,t),s=Qe(a,n.page.borderBox.center);return Ae(n.client.borderBox.center,s)}),tc=(function(e){var t=e.draggable,n=e.destination,o=e.newPageBorderBoxCenter,a=e.viewport,s=e.withDroppableDisplacement,i=e.onlyOnMainAxis,l=i===void 0?!1:i,c=Qe(o,t.page.borderBox.center),d=Wn(t.page.borderBox,c),m={target:d,destination:n,withDroppableDisplacement:s,viewport:a};return l?eg(m):Yl(m)}),gg=(function(e){var t=e.isMovingForward,n=e.draggable,o=e.destination,a=e.draggables,s=e.previousImpact,i=e.viewport,l=e.previousPageBorderBoxCenter,c=e.previousClientSelection,d=e.afterCritical;if(!o.isEnabled)return null;var m=Qt(o.descriptor.id,a),u=Tn(n,o),p=zS({isMovingForward:t,draggable:n,destination:o,insideDestination:m,previousImpact:s})||sg({isMovingForward:t,isInHomeList:u,draggable:n,draggables:a,destination:o,insideDestination:m,previousImpact:s,viewport:i,afterCritical:d});if(!p)return null;var f=Ao({impact:p,draggable:n,droppable:o,draggables:a,afterCritical:d}),g=tc({draggable:n,destination:o,newPageBorderBoxCenter:f,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(g){var v=fa({pageBorderBoxCenter:f,draggable:n,viewport:i});return{clientSelection:v,impact:p,scrollJumpRequest:null}}var y=Qe(f,l),b=fg({impact:p,viewport:i,destination:o,draggables:a,maxScrollChange:y});return{clientSelection:c,impact:b,scrollJumpRequest:y}}),Ue=function(t){var n=t.subject.active;return n||(process.env.NODE_ENV!=="production"?P(!1,"Cannot get clipped area from droppable"):P()),n},hg=(function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,o=e.source,a=e.droppables,s=e.viewport,i=o.subject.active;if(!i)return null;var l=o.axis,c=lt(i[l.start],i[l.end]),d=Oo(a).filter(function(u){return u!==o}).filter(function(u){return u.isEnabled}).filter(function(u){return!!u.subject.active}).filter(function(u){return zl(s.frame)(Ue(u))}).filter(function(u){var p=Ue(u);return t?i[l.crossAxisEnd]<p[l.crossAxisEnd]:p[l.crossAxisStart]<i[l.crossAxisStart]}).filter(function(u){var p=Ue(u),f=lt(p[l.start],p[l.end]);return c(p[l.start])||c(p[l.end])||f(i[l.start])||f(i[l.end])}).sort(function(u,p){var f=Ue(u)[l.crossAxisStart],g=Ue(p)[l.crossAxisStart];return t?f-g:g-f}).filter(function(u,p,f){return Ue(u)[l.crossAxisStart]===Ue(f[0])[l.crossAxisStart]});if(!d.length)return null;if(d.length===1)return d[0];var m=d.filter(function(u){var p=lt(Ue(u)[l.start],Ue(u)[l.end]);return p(n[l.line])});return m.length===1?m[0]:m.length>1?m.sort(function(u,p){return Ue(u)[l.start]-Ue(p)[l.start]})[0]:d.sort(function(u,p){var f=$l(n,Kl(Ue(u))),g=$l(n,Kl(Ue(p)));return f!==g?f-g:Ue(u)[l.start]-Ue(p)[l.start]})[0]}),nc=function(t,n){var o=t.page.borderBox.center;return Vt(t.descriptor.id,n)?Qe(o,n.displacedBy.point):o},bg=function(t,n){var o=t.page.borderBox;return Vt(t.descriptor.id,n)?Wn(o,yn(n.displacedBy.point)):o},vg=(function(e){var t=e.pageBorderBoxCenter,n=e.viewport,o=e.destination,a=e.insideDestination,s=e.afterCritical,i=a.filter(function(l){return Yl({target:bg(l,s),destination:o,viewport:n.frame,withDroppableDisplacement:!0})}).sort(function(l,c){var d=Hn(t,ma(o,nc(l,s))),m=Hn(t,ma(o,nc(c,s)));return d<m?-1:m<d?1:l.descriptor.index-c.descriptor.index});return i[0]||null}),zn=Pe(function(t,n){var o=n[t.line];return{value:o,point:Zt(t.line,o)}}),yg=function(t,n,o){var a=t.axis;if(t.descriptor.mode==="virtual")return Zt(a.line,n[a.line]);var s=t.subject.page.contentBox[a.size],i=Qt(t.descriptor.id,o),l=i.reduce(function(m,u){return m+u.client.marginBox[a.size]},0),c=l+n[a.line],d=c-s;return d<=0?null:Zt(a.line,d)},oc=function(t,n){return ce({},t,{scroll:ce({},t.scroll,{max:n})})},rc=function(t,n,o){var a=t.frame;Tn(n,t)&&(process.env.NODE_ENV!=="production"?P(!1,"Should not add placeholder space to home list"):P()),t.subject.withPlaceholder&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot add placeholder size to a subject when it already has one"):P());var s=zn(t.axis,n.displaceBy).point,i=yg(t,s,o),l={placeholderSize:s,increasedBy:i,oldFrameMaxScroll:t.frame?t.frame.scroll.max:null};if(!a){var c=En({page:t.subject.page,withPlaceholder:l,axis:t.axis,frame:t.frame});return ce({},t,{subject:c})}var d=i?Ae(a.scroll.max,i):a.scroll.max,m=oc(a,d),u=En({page:t.subject.page,withPlaceholder:l,axis:t.axis,frame:m});return ce({},t,{subject:u,frame:m})},Eg=function(t){var n=t.subject.withPlaceholder;n||(process.env.NODE_ENV!=="production"?P(!1,"Cannot remove placeholder form subject when there was none"):P());var o=t.frame;if(!o){var a=En({page:t.subject.page,axis:t.axis,frame:null,withPlaceholder:null});return ce({},t,{subject:a})}var s=n.oldFrameMaxScroll;s||(process.env.NODE_ENV!=="production"?P(!1,"Expected droppable with frame to have old max frame scroll when removing placeholder"):P());var i=oc(o,s),l=En({page:t.subject.page,axis:t.axis,frame:i,withPlaceholder:null});return ce({},t,{subject:l,frame:i})},Tg=(function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,o=e.insideDestination,a=e.draggable,s=e.draggables,i=e.destination,l=e.viewport,c=e.afterCritical;if(!n){if(o.length)return null;var d={displaced:Gn,displacedBy:Ul,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},m=Ao({impact:d,draggable:a,droppable:i,draggables:s,afterCritical:c}),u=Tn(a,i)?i:rc(i,a,s),p=tc({draggable:a,destination:u,newPageBorderBoxCenter:m,viewport:l.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return p?d:null}var f=t[i.axis.line]<=n.page.borderBox.center[i.axis.line],g=(function(){var y=n.descriptor.index;return n.descriptor.id===a.descriptor.id||f?y:y+1})(),v=zn(i.axis,a.displaceBy);return Fo({draggable:a,insideDestination:o,destination:i,viewport:l,displacedBy:v,last:Gn,index:g})}),wg=(function(e){var t=e.isMovingForward,n=e.previousPageBorderBoxCenter,o=e.draggable,a=e.isOver,s=e.draggables,i=e.droppables,l=e.viewport,c=e.afterCritical,d=hg({isMovingForward:t,pageBorderBoxCenter:n,source:a,droppables:i,viewport:l});if(!d)return null;var m=Qt(d.descriptor.id,s),u=vg({pageBorderBoxCenter:n,viewport:l,destination:d,insideDestination:m,afterCritical:c}),p=Tg({previousPageBorderBoxCenter:n,destination:d,draggable:o,draggables:s,moveRelativeTo:u,insideDestination:m,viewport:l,afterCritical:c});if(!p)return null;var f=Ao({impact:p,draggable:o,droppable:d,draggables:s,afterCritical:c}),g=fa({pageBorderBoxCenter:f,draggable:o,viewport:l});return{clientSelection:g,impact:p,scrollJumpRequest:null}}),et=(function(e){var t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null}),Cg=function(t,n){var o=et(t);return o?n[o]:null},Dg=(function(e){var t=e.state,n=e.type,o=Cg(t.impact,t.dimensions.droppables),a=!!o,s=t.dimensions.droppables[t.critical.droppable.id],i=o||s,l=i.axis.direction,c=l==="vertical"&&(n==="MOVE_UP"||n==="MOVE_DOWN")||l==="horizontal"&&(n==="MOVE_LEFT"||n==="MOVE_RIGHT");if(c&&!a)return null;var d=n==="MOVE_DOWN"||n==="MOVE_RIGHT",m=t.dimensions.draggables[t.critical.draggable.id],u=t.current.page.borderBoxCenter,p=t.dimensions,f=p.draggables,g=p.droppables;return c?gg({isMovingForward:d,previousPageBorderBoxCenter:u,draggable:m,destination:i,draggables:f,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):wg({isMovingForward:d,previousPageBorderBoxCenter:u,draggable:m,isOver:i,draggables:f,droppables:g,viewport:t.viewport,afterCritical:t.afterCritical})});function en(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function ac(e){var t=lt(e.top,e.bottom),n=lt(e.left,e.right);return function(a){return t(a.y)&&n(a.x)}}function Ng(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Ig(e){var t=e.pageBorderBox,n=e.draggable,o=e.candidates,a=n.page.borderBox.center,s=o.map(function(i){var l=i.axis,c=Zt(i.axis.line,t.center[l.line],i.page.borderBox.center[l.crossAxisLine]);return{id:i.descriptor.id,distance:Hn(a,c)}}).sort(function(i,l){return l.distance-i.distance});return s[0]?s[0].id:null}function xg(e){var t=e.pageBorderBox,n=e.draggable,o=e.droppables,a=Oo(o).filter(function(s){if(!s.isEnabled)return!1;var i=s.subject.active;if(!i||!Ng(t,i))return!1;if(ac(i)(t.center))return!0;var l=s.axis,c=i.center[l.crossAxisLine],d=t[l.crossAxisStart],m=t[l.crossAxisEnd],u=lt(i[l.crossAxisStart],i[l.crossAxisEnd]),p=u(d),f=u(m);return!p&&!f?!0:p?d<c:m>c});return a.length?a.length===1?a[0].descriptor.id:Ig({pageBorderBox:t,draggable:n,candidates:a}):null}var sc=function(t,n){return St(Wn(t,n))},kg=(function(e,t){var n=e.frame;return n?sc(t,n.scroll.diff.value):t});function ic(e){var t=e.displaced,n=e.id;return!!(t.visible[n]||t.invisible[n])}function Mg(e){var t=e.draggable,n=e.closest,o=e.inHomeList;return n?o&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}var Lg=(function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,o=e.destination,a=e.insideDestination,s=e.last,i=e.viewport,l=e.afterCritical,c=o.axis,d=zn(o.axis,n.displaceBy),m=d.value,u=t[c.start],p=t[c.end],f=Ro(n,a),g=$t(f,function(y){var b=y.descriptor.id,h=y.page.borderBox.center[c.line],I=Vt(b,l),C=ic({displaced:s,id:b});return I?C?p<=h:u<h-m:C?p<=h+m:u<h}),v=Mg({draggable:n,closest:g,inHomeList:Tn(n,o)});return Fo({draggable:n,insideDestination:a,destination:o,viewport:i,last:s,displacedBy:d,index:v})}),_g=4,Pg=(function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,o=e.previousImpact,a=e.destination,s=e.insideDestination,i=e.afterCritical;if(!a.isCombineEnabled)return null;var l=a.axis,c=zn(a.axis,t.displaceBy),d=c.value,m=n[l.start],u=n[l.end],p=Ro(t,s),f=$t(p,function(v){var y=v.descriptor.id,b=v.page.borderBox,h=b[l.size],I=h/_g,C=Vt(y,i),D=ic({displaced:o.displaced,id:y});return C?D?u>b[l.start]+I&&u<b[l.end]-I:m>b[l.start]-d+I&&m<b[l.end]-d-I:D?u>b[l.start]+d+I&&u<b[l.end]+d-I:m>b[l.start]+I&&m<b[l.end]-I});if(!f)return null;var g={displacedBy:c,displaced:o.displaced,at:{type:"COMBINE",combine:{draggableId:f.descriptor.id,droppableId:a.descriptor.id}}};return g}),lc=(function(e){var t=e.pageOffset,n=e.draggable,o=e.draggables,a=e.droppables,s=e.previousImpact,i=e.viewport,l=e.afterCritical,c=sc(n.page.borderBox,t),d=xg({pageBorderBox:c,draggable:n,droppables:a});if(!d)return jS;var m=a[d],u=Qt(m.descriptor.id,o),p=kg(m,c);return Pg({pageBorderBoxWithDroppableScroll:p,draggable:n,previousImpact:s,destination:m,insideDestination:u,afterCritical:l})||Lg({pageBorderBoxWithDroppableScroll:p,draggable:n,destination:m,insideDestination:u,last:s.displaced,viewport:i,afterCritical:l})}),Sa=(function(e,t){var n;return ce({},e,(n={},n[t.descriptor.id]=t,n))}),Og=function(t){var n=t.previousImpact,o=t.impact,a=t.droppables,s=et(n),i=et(o);if(!s||s===i)return a;var l=a[s];if(!l.subject.withPlaceholder)return a;var c=Eg(l);return Sa(a,c)},Bg=(function(e){var t=e.draggable,n=e.draggables,o=e.droppables,a=e.previousImpact,s=e.impact,i=Og({previousImpact:a,impact:s,droppables:o}),l=et(s);if(!l)return i;var c=o[l];if(Tn(t,c)||c.subject.withPlaceholder)return i;var d=rc(c,t,n);return Sa(i,d)}),jn=(function(e){var t=e.state,n=e.clientSelection,o=e.dimensions,a=e.viewport,s=e.impact,i=e.scrollJumpRequest,l=a||t.viewport,c=o||t.dimensions,d=n||t.current.client.selection,m=Qe(d,t.initial.client.selection),u={offset:m,selection:d,borderBoxCenter:Ae(t.initial.client.borderBoxCenter,m)},p={selection:Ae(u.selection,l.scroll.current),borderBoxCenter:Ae(u.borderBoxCenter,l.scroll.current),offset:Ae(u.offset,l.scroll.diff.value)},f={client:u,page:p};if(t.phase==="COLLECTING")return ce({phase:"COLLECTING"},t,{dimensions:c,viewport:l,current:f});var g=c.draggables[t.critical.draggable.id],v=s||lc({pageOffset:p.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:t.impact,viewport:l,afterCritical:t.afterCritical}),y=Bg({draggable:g,impact:v,previousImpact:t.impact,draggables:c.draggables,droppables:c.droppables}),b=ce({},t,{current:f,dimensions:{draggables:c.draggables,droppables:y},impact:v,viewport:l,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null});return b});function Rg(e,t){return e.map(function(n){return t[n]})}var cc=(function(e){var t=e.impact,n=e.viewport,o=e.draggables,a=e.destination,s=e.forceShouldAnimate,i=t.displaced,l=Rg(i.all,o),c=Un({afterDragging:l,destination:a,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:s,last:i});return ce({},t,{displaced:c})}),dc=(function(e){var t=e.impact,n=e.draggable,o=e.droppable,a=e.draggables,s=e.viewport,i=e.afterCritical,l=Ao({impact:t,draggable:n,draggables:a,droppable:o,afterCritical:i});return fa({pageBorderBoxCenter:l,draggable:n,viewport:s})}),pc=(function(e){var t=e.state,n=e.dimensions,o=e.viewport;t.movementMode!=="SNAP"&&(process.env.NODE_ENV,P());var a=t.impact,s=o||t.viewport,i=n||t.dimensions,l=i.draggables,c=i.droppables,d=l[t.critical.draggable.id],m=et(a);m||(process.env.NODE_ENV!=="production"?P(!1,"Must be over a destination in SNAP movement mode"):P());var u=c[m],p=cc({impact:a,viewport:s,destination:u,draggables:l}),f=dc({impact:p,draggable:d,droppable:u,draggables:l,viewport:s,afterCritical:t.afterCritical});return jn({impact:p,clientSelection:f,state:t,dimensions:i,viewport:s})}),Fg=(function(e){return{index:e.index,droppableId:e.droppableId}}),uc=(function(e){var t=e.draggable,n=e.home,o=e.draggables,a=e.viewport,s=zn(n.axis,t.displaceBy),i=Qt(n.descriptor.id,o),l=i.indexOf(t);l===-1&&(process.env.NODE_ENV!=="production"?P(!1,"Expected draggable to be inside home list"):P());var c=i.slice(l+1),d=c.reduce(function(f,g){return f[g.descriptor.id]=!0,f},{}),m={inVirtualList:n.descriptor.mode==="virtual",displacedBy:s,effected:d},u=Un({afterDragging:c,destination:n,displacedBy:s,last:null,viewport:a.frame,forceShouldAnimate:!1}),p={displaced:u,displacedBy:s,at:{type:"REORDER",destination:Fg(t.descriptor)}};return{impact:p,afterCritical:m}}),Ag=(function(e,t){return{draggables:e.draggables,droppables:Sa(e.droppables,t)}}),Yn=function(t){process.env.NODE_ENV},qn=function(t){process.env.NODE_ENV},$g=(function(e){var t=e.draggable,n=e.offset,o=e.initialWindowScroll,a=ko(t.client,n),s=Mo(a,o),i=ce({},t,{placeholder:ce({},t.placeholder,{client:a}),client:a,page:s});return i}),Vg=(function(e){var t=e.frame;return t||(process.env.NODE_ENV!=="production"?P(!1,"Expected Droppable to have a frame"):P()),t}),Kg=(function(e){var t=e.additions,n=e.updatedDroppables,o=e.viewport,a=o.scroll.diff.value;return t.map(function(s){var i=s.descriptor.droppableId,l=n[i],c=Vg(l),d=c.scroll.diff.value,m=Ae(a,d),u=$g({draggable:s,offset:m,initialWindowScroll:o.scroll.initial});return u})}),Hg=(function(e){var t=e.state,n=e.published;Yn();var o=n.modified.map(function(I){var C=t.dimensions.droppables[I.droppableId],D=ia(C,I.scroll);return D}),a=ce({},t.dimensions.droppables,{},Wl(o)),s=Gl(Kg({additions:n.additions,updatedDroppables:a,viewport:t.viewport})),i=ce({},t.dimensions.draggables,{},s);n.removals.forEach(function(I){delete i[I]});var l={droppables:a,draggables:i},c=et(t.impact),d=c?l.droppables[c]:null,m=l.draggables[t.critical.draggable.id],u=l.droppables[t.critical.droppable.id],p=uc({draggable:m,home:u,draggables:i,viewport:t.viewport}),f=p.impact,g=p.afterCritical,v=d&&d.isCombineEnabled?t.impact:f,y=lc({pageOffset:t.current.page.offset,draggable:l.draggables[t.critical.draggable.id],draggables:l.draggables,droppables:l.droppables,previousImpact:v,viewport:t.viewport,afterCritical:g});qn();var b=ce({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:y,onLiftImpact:f,dimensions:l,afterCritical:g,forceShouldAnimate:!1});if(t.phase==="COLLECTING")return b;var h=ce({phase:"DROP_PENDING"},b,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1});return h}),ga=function(t){return t.movementMode==="SNAP"},ha=function(t,n,o){var a=Ag(t.dimensions,n);return!ga(t)||o?jn({state:t,dimensions:a}):pc({state:t,dimensions:a})};function ba(e){return e.isDragging&&e.movementMode==="SNAP"?ce({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var mc={phase:"IDLE",completed:null,shouldFlush:!1},Wg=(function(e,t){if(e===void 0&&(e=mc),t.type==="FLUSH")return ce({},mc,{shouldFlush:!0});if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?P(!1,"INITIAL_PUBLISH must come after a IDLE phase"):P());var n=t.payload,o=n.critical,a=n.clientSelection,s=n.viewport,i=n.dimensions,l=n.movementMode,c=i.draggables[o.draggable.id],d=i.droppables[o.droppable.id],m={selection:a,borderBoxCenter:c.client.borderBox.center,offset:Oe},u={client:m,page:{selection:Ae(m.selection,s.scroll.initial),borderBoxCenter:Ae(m.selection,s.scroll.initial),offset:Ae(m.selection,s.scroll.diff.value)}},p=Oo(i.droppables).every(function(z){return!z.isFixedOnPage}),f=uc({draggable:c,home:d,draggables:i.draggables,viewport:s}),g=f.impact,v=f.afterCritical,y={phase:"DRAGGING",isDragging:!0,critical:o,movementMode:l,dimensions:i,initial:u,current:u,isWindowScrollAllowed:p,impact:g,afterCritical:v,onLiftImpact:g,viewport:s,scrollJumpRequest:null,forceShouldAnimate:null};return y}if(t.type==="COLLECTION_STARTING"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?P(!1,"Collection cannot start from phase "+e.phase):P());var b=ce({phase:"COLLECTING"},e,{phase:"COLLECTING"});return b}if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?P(!1,"Unexpected "+t.type+" received in phase "+e.phase):P()),Hg({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;en(e)||(process.env.NODE_ENV!=="production"?P(!1,t.type+" not permitted in phase "+e.phase):P());var h=t.payload.client;return At(h,e.current.client.selection)?e:jn({state:e,clientSelection:h,impact:ga(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return ba(e);en(e)||(process.env.NODE_ENV!=="production"?P(!1,t.type+" not permitted in phase "+e.phase):P());var I=t.payload,C=I.id,D=I.newScroll,L=e.dimensions.droppables[C];if(!L)return e;var $=ia(L,D);return ha(e,$,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;en(e)||(process.env.NODE_ENV!=="production"?P(!1,"Attempting to move in an unsupported phase "+e.phase):P());var O=t.payload,_=O.id,R=O.isEnabled,H=e.dimensions.droppables[_];H||(process.env.NODE_ENV!=="production"?P(!1,"Cannot find Droppable[id: "+_+"] to toggle its enabled state"):P()),H.isEnabled===R&&(process.env.NODE_ENV!=="production"?P(!1,"Trying to set droppable isEnabled to "+String(R)+`
|
|
399
|
-
but it is already `+String(H.isEnabled)):P());var Z=ce({},H,{isEnabled:R});return
|
|
400
|
-
but it is already `+String(B.isCombineEnabled)):P());var M=ce({},B,{isCombineEnabled:F});return
|
|
397
|
+
`+Vl(t.source)+`
|
|
398
|
+
`},Bo={dragHandleUsageInstructions:FS,onDragStart:AS,onDragUpdate:$S,onDragEnd:VS},Oe={x:0,y:0},Ae=function(t,n){return{x:t.x+n.x,y:t.y+n.y}},Qe=function(t,n){return{x:t.x-n.x,y:t.y-n.y}},At=function(t,n){return t.x===n.x&&t.y===n.y},yn=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},Zt=function(t,n,o){var a;return o===void 0&&(o=0),a={},a[t]=n,a[t==="x"?"y":"x"]=o,a},Gn=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},Kl=function(t,n){return Math.min.apply(Math,n.map(function(o){return Gn(t,o)}))},Hl=function(t){return function(n){return{x:t(n.x),y:t(n.y)}}},KS=(function(e,t){var n=St({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}),Un=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Wl=function(t){return[{x:t.left,y:t.top},{x:t.right,y:t.top},{x:t.left,y:t.bottom},{x:t.right,y:t.bottom}]},HS={top:0,right:0,bottom:0,left:0},WS=function(t,n){return n?Un(t,n.scroll.diff.displacement):t},GS=function(t,n,o){if(o&&o.increasedBy){var a;return ce({},t,(a={},a[n.end]=t[n.end]+o.increasedBy[n.line],a))}return t},US=function(t,n){return n&&n.shouldClipSubject?KS(n.pageMarginBox,t):St(t)},En=(function(e){var t=e.page,n=e.withPlaceholder,o=e.axis,a=e.frame,s=WS(t.marginBox,a),i=GS(s,o,n),l=US(i,a);return{page:t,withPlaceholder:n,active:l}}),ca=(function(e,t){e.frame||(process.env.NODE_ENV,P());var n=e.frame,o=Qe(t,n.scroll.initial),a=yn(o),s=ce({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:o,displacement:a},max:n.scroll.max}}),i=En({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:s}),l=ce({},e,{frame:s,subject:i});return l});function zS(e){return Number.isInteger?Number.isInteger(e):typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function Ro(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function da(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function $t(e,t){if(e.find)return e.find(t);var n=da(e,t);if(n!==-1)return e[n]}function Gl(e){return Array.prototype.slice.call(e)}var Ul=Pe(function(e){return e.reduce(function(t,n){return t[n.descriptor.id]=n,t},{})}),zl=Pe(function(e){return e.reduce(function(t,n){return t[n.descriptor.id]=n,t},{})}),Fo=Pe(function(e){return Ro(e)}),jS=Pe(function(e){return Ro(e)}),Qt=Pe(function(e,t){var n=jS(t).filter(function(o){return e===o.descriptor.droppableId}).sort(function(o,a){return o.descriptor.index-a.descriptor.index});return n});function pa(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function Ao(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var $o=Pe(function(e,t){return t.filter(function(n){return n.descriptor.id!==e.descriptor.id})}),YS=(function(e){var t=e.isMovingForward,n=e.draggable,o=e.destination,a=e.insideDestination,s=e.previousImpact;if(!o.isCombineEnabled)return null;var i=pa(s);if(!i)return null;function l(v){var y={type:"COMBINE",combine:{draggableId:v,droppableId:o.descriptor.id}};return ce({},s,{at:y})}var c=s.displaced.all,d=c.length?c[0]:null;if(t)return d?l(d):null;var u=$o(n,a);if(!d){if(!u.length)return null;var m=u[u.length-1];return l(m.descriptor.id)}var p=da(u,function(v){return v.descriptor.id===d});p===-1&&(process.env.NODE_ENV!=="production"?P(!1,"Could not find displaced item in set"):P());var f=p-1;if(f<0)return null;var g=u[f];return l(g.descriptor.id)}),Tn=(function(e,t){return e.descriptor.droppableId===t.descriptor.id}),jl={point:Oe,value:0},zn={invisible:{},visible:{},all:[]},qS={displaced:zn,displacedBy:jl,at:null},lt=(function(e,t){return function(n){return e<=n&&n<=t}}),Yl=(function(e){var t=lt(e.top,e.bottom),n=lt(e.left,e.right);return function(o){var a=t(o.top)&&t(o.bottom)&&n(o.left)&&n(o.right);if(a)return!0;var s=t(o.top)||t(o.bottom),i=n(o.left)||n(o.right),l=s&&i;if(l)return!0;var c=o.top<e.top&&o.bottom>e.bottom,d=o.left<e.left&&o.right>e.right,u=c&&d;if(u)return!0;var m=c&&i||d&&s;return m}}),JS=(function(e){var t=lt(e.top,e.bottom),n=lt(e.left,e.right);return function(o){var a=t(o.top)&&t(o.bottom)&&n(o.left)&&n(o.right);return a}}),ua={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},ql={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},XS=(function(e){return function(t){var n=lt(t.top,t.bottom),o=lt(t.left,t.right);return function(a){return e===ua?n(a.top)&&n(a.bottom):o(a.left)&&o(a.right)}}}),ZS=function(t,n){var o=n.frame?n.frame.scroll.diff.displacement:Oe;return Un(t,o)},QS=function(t,n,o){return n.subject.active?o(n.subject.active)(t):!1},eg=function(t,n,o){return o(n)(t)},ma=function(t){var n=t.target,o=t.destination,a=t.viewport,s=t.withDroppableDisplacement,i=t.isVisibleThroughFrameFn,l=s?ZS(n,o):n;return QS(l,o,i)&&eg(l,a,i)},tg=function(t){return ma(ce({},t,{isVisibleThroughFrameFn:Yl}))},Jl=function(t){return ma(ce({},t,{isVisibleThroughFrameFn:JS}))},ng=function(t){return ma(ce({},t,{isVisibleThroughFrameFn:XS(t.destination.axis)}))},og=function(t,n,o){if(typeof o=="boolean")return o;if(!n)return!0;var a=n.invisible,s=n.visible;if(a[t])return!1;var i=s[t];return i?i.shouldAnimate:!0};function rg(e,t){var n=e.page.marginBox,o={top:t.point.y,right:0,bottom:0,left:t.point.x};return St(aa(n,o))}function jn(e){var t=e.afterDragging,n=e.destination,o=e.displacedBy,a=e.viewport,s=e.forceShouldAnimate,i=e.last;return t.reduce(function(c,d){var u=rg(d,o),m=d.descriptor.id;c.all.push(m);var p=tg({target:u,destination:n,viewport:a,withDroppableDisplacement:!0});if(!p)return c.invisible[d.descriptor.id]=!0,c;var f=og(m,i,s),g={draggableId:m,shouldAnimate:f};return c.visible[m]=g,c},{all:[],visible:{},invisible:{}})}function ag(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function Xl(e){var t=e.insideDestination,n=e.inHomeList,o=e.displacedBy,a=e.destination,s=ag(t,{inHomeList:n});return{displaced:zn,displacedBy:o,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:s}}}}function Vo(e){var t=e.draggable,n=e.insideDestination,o=e.destination,a=e.viewport,s=e.displacedBy,i=e.last,l=e.index,c=e.forceShouldAnimate,d=Tn(t,o);if(l==null)return Xl({insideDestination:n,inHomeList:d,displacedBy:s,destination:o});var u=$t(n,function(v){return v.descriptor.index===l});if(!u)return Xl({insideDestination:n,inHomeList:d,displacedBy:s,destination:o});var m=$o(t,n),p=n.indexOf(u),f=m.slice(p),g=jn({afterDragging:f,destination:o,displacedBy:s,last:i,viewport:a.frame,forceShouldAnimate:c});return{displaced:g,displacedBy:s,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:l}}}}function Vt(e,t){return!!t.effected[e]}var sg=(function(e){var t=e.isMovingForward,n=e.destination,o=e.draggables,a=e.combine,s=e.afterCritical;if(!n.isCombineEnabled)return null;var i=a.draggableId,l=o[i],c=l.descriptor.index,d=Vt(i,s);return d?t?c:c-1:t?c+1:c}),ig=(function(e){var t=e.isMovingForward,n=e.isInHomeList,o=e.insideDestination,a=e.location;if(!o.length)return null;var s=a.index,i=t?s+1:s-1,l=o[0].descriptor.index,c=o[o.length-1].descriptor.index,d=n?c:c+1;return i<l||i>d?null:i}),lg=(function(e){var t=e.isMovingForward,n=e.isInHomeList,o=e.draggable,a=e.draggables,s=e.destination,i=e.insideDestination,l=e.previousImpact,c=e.viewport,d=e.afterCritical,u=l.at;if(u||(process.env.NODE_ENV!=="production"?P(!1,"Cannot move in direction without previous impact location"):P()),u.type==="REORDER"){var m=ig({isMovingForward:t,isInHomeList:n,location:u.destination,insideDestination:i});return m==null?null:Vo({draggable:o,insideDestination:i,destination:s,viewport:c,last:l.displaced,displacedBy:l.displacedBy,index:m})}var p=sg({isMovingForward:t,destination:s,displaced:l.displaced,draggables:a,combine:u.combine,afterCritical:d});return p==null?null:Vo({draggable:o,insideDestination:i,destination:s,viewport:c,last:l.displaced,displacedBy:l.displacedBy,index:p})}),cg=(function(e){var t=e.displaced,n=e.afterCritical,o=e.combineWith,a=e.displacedBy,s=!!(t.visible[o]||t.invisible[o]);return Vt(o,n)?s?Oe:yn(a.point):s?a.point:Oe}),dg=(function(e){var t=e.afterCritical,n=e.impact,o=e.draggables,a=Ao(n);a||(process.env.NODE_ENV,P());var s=a.draggableId,i=o[s].page.borderBox.center,l=cg({displaced:n.displaced,afterCritical:t,combineWith:s,displacedBy:n.displacedBy});return Ae(i,l)}),Zl=function(t,n){return n.margin[t.start]+n.borderBox[t.size]/2},pg=function(t,n){return n.margin[t.end]+n.borderBox[t.size]/2},fa=function(t,n,o){return n[t.crossAxisStart]+o.margin[t.crossAxisStart]+o.borderBox[t.crossAxisSize]/2},Ql=function(t){var n=t.axis,o=t.moveRelativeTo,a=t.isMoving;return Zt(n.line,o.marginBox[n.end]+Zl(n,a),fa(n,o.marginBox,a))},ec=function(t){var n=t.axis,o=t.moveRelativeTo,a=t.isMoving;return Zt(n.line,o.marginBox[n.start]-pg(n,a),fa(n,o.marginBox,a))},ug=function(t){var n=t.axis,o=t.moveInto,a=t.isMoving;return Zt(n.line,o.contentBox[n.start]+Zl(n,a),fa(n,o.contentBox,a))},mg=(function(e){var t=e.impact,n=e.draggable,o=e.draggables,a=e.droppable,s=e.afterCritical,i=Qt(a.descriptor.id,o),l=n.page,c=a.axis;if(!i.length)return ug({axis:c,moveInto:a.page,isMoving:l});var d=t.displaced,u=t.displacedBy,m=d.all[0];if(m){var p=o[m];if(Vt(m,s))return ec({axis:c,moveRelativeTo:p.page,isMoving:l});var f=_o(p.page,u.point);return ec({axis:c,moveRelativeTo:f,isMoving:l})}var g=i[i.length-1];if(g.descriptor.id===n.descriptor.id)return l.borderBox.center;if(Vt(g.descriptor.id,s)){var v=_o(g.page,yn(s.displacedBy.point));return Ql({axis:c,moveRelativeTo:v,isMoving:l})}return Ql({axis:c,moveRelativeTo:g.page,isMoving:l})}),Sa=(function(e,t){var n=e.frame;return n?Ae(t,n.scroll.diff.displacement):t}),fg=function(t){var n=t.impact,o=t.draggable,a=t.droppable,s=t.draggables,i=t.afterCritical,l=o.page.borderBox.center,c=n.at;return!a||!c?l:c.type==="REORDER"?mg({impact:n,draggable:o,draggables:s,droppable:a,afterCritical:i}):dg({impact:n,draggables:s,afterCritical:i})},Ko=(function(e){var t=fg(e),n=e.droppable,o=n?Sa(n,t):t;return o}),tc=(function(e,t){var n=Qe(t,e.scroll.initial),o=yn(n),a=St({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),s={frame:a,scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:o}}};return s});function nc(e,t){return e.map(function(n){return t[n]})}function Sg(e,t){for(var n=0;n<t.length;n++){var o=t[n].visible[e];if(o)return o}return null}var gg=(function(e){var t=e.impact,n=e.viewport,o=e.destination,a=e.draggables,s=e.maxScrollChange,i=tc(n,Ae(n.scroll.current,s)),l=o.frame?ca(o,Ae(o.frame.scroll.current,s)):o,c=t.displaced,d=jn({afterDragging:nc(c.all,a),destination:o,displacedBy:t.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),u=jn({afterDragging:nc(c.all,a),destination:l,displacedBy:t.displacedBy,viewport:n.frame,last:c,forceShouldAnimate:!1}),m={},p={},f=[c,d,u];c.all.forEach(function(v){var y=Sg(v,f);if(y){p[v]=y;return}m[v]=!0});var g=ce({},t,{displaced:{all:c.all,invisible:m,visible:p}});return g}),hg=(function(e,t){return Ae(e.scroll.diff.displacement,t)}),ga=(function(e){var t=e.pageBorderBoxCenter,n=e.draggable,o=e.viewport,a=hg(o,t),s=Qe(a,n.page.borderBox.center);return Ae(n.client.borderBox.center,s)}),oc=(function(e){var t=e.draggable,n=e.destination,o=e.newPageBorderBoxCenter,a=e.viewport,s=e.withDroppableDisplacement,i=e.onlyOnMainAxis,l=i===void 0?!1:i,c=Qe(o,t.page.borderBox.center),d=Un(t.page.borderBox,c),u={target:d,destination:n,withDroppableDisplacement:s,viewport:a};return l?ng(u):Jl(u)}),bg=(function(e){var t=e.isMovingForward,n=e.draggable,o=e.destination,a=e.draggables,s=e.previousImpact,i=e.viewport,l=e.previousPageBorderBoxCenter,c=e.previousClientSelection,d=e.afterCritical;if(!o.isEnabled)return null;var u=Qt(o.descriptor.id,a),m=Tn(n,o),p=YS({isMovingForward:t,draggable:n,destination:o,insideDestination:u,previousImpact:s})||lg({isMovingForward:t,isInHomeList:m,draggable:n,draggables:a,destination:o,insideDestination:u,previousImpact:s,viewport:i,afterCritical:d});if(!p)return null;var f=Ko({impact:p,draggable:n,droppable:o,draggables:a,afterCritical:d}),g=oc({draggable:n,destination:o,newPageBorderBoxCenter:f,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(g){var v=ga({pageBorderBoxCenter:f,draggable:n,viewport:i});return{clientSelection:v,impact:p,scrollJumpRequest:null}}var y=Qe(f,l),b=gg({impact:p,viewport:i,destination:o,draggables:a,maxScrollChange:y});return{clientSelection:c,impact:b,scrollJumpRequest:y}}),Ue=function(t){var n=t.subject.active;return n||(process.env.NODE_ENV!=="production"?P(!1,"Cannot get clipped area from droppable"):P()),n},vg=(function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,o=e.source,a=e.droppables,s=e.viewport,i=o.subject.active;if(!i)return null;var l=o.axis,c=lt(i[l.start],i[l.end]),d=Fo(a).filter(function(m){return m!==o}).filter(function(m){return m.isEnabled}).filter(function(m){return!!m.subject.active}).filter(function(m){return Yl(s.frame)(Ue(m))}).filter(function(m){var p=Ue(m);return t?i[l.crossAxisEnd]<p[l.crossAxisEnd]:p[l.crossAxisStart]<i[l.crossAxisStart]}).filter(function(m){var p=Ue(m),f=lt(p[l.start],p[l.end]);return c(p[l.start])||c(p[l.end])||f(i[l.start])||f(i[l.end])}).sort(function(m,p){var f=Ue(m)[l.crossAxisStart],g=Ue(p)[l.crossAxisStart];return t?f-g:g-f}).filter(function(m,p,f){return Ue(m)[l.crossAxisStart]===Ue(f[0])[l.crossAxisStart]});if(!d.length)return null;if(d.length===1)return d[0];var u=d.filter(function(m){var p=lt(Ue(m)[l.start],Ue(m)[l.end]);return p(n[l.line])});return u.length===1?u[0]:u.length>1?u.sort(function(m,p){return Ue(m)[l.start]-Ue(p)[l.start]})[0]:d.sort(function(m,p){var f=Kl(n,Wl(Ue(m))),g=Kl(n,Wl(Ue(p)));return f!==g?f-g:Ue(m)[l.start]-Ue(p)[l.start]})[0]}),rc=function(t,n){var o=t.page.borderBox.center;return Vt(t.descriptor.id,n)?Qe(o,n.displacedBy.point):o},yg=function(t,n){var o=t.page.borderBox;return Vt(t.descriptor.id,n)?Un(o,yn(n.displacedBy.point)):o},Eg=(function(e){var t=e.pageBorderBoxCenter,n=e.viewport,o=e.destination,a=e.insideDestination,s=e.afterCritical,i=a.filter(function(l){return Jl({target:yg(l,s),destination:o,viewport:n.frame,withDroppableDisplacement:!0})}).sort(function(l,c){var d=Gn(t,Sa(o,rc(l,s))),u=Gn(t,Sa(o,rc(c,s)));return d<u?-1:u<d?1:l.descriptor.index-c.descriptor.index});return i[0]||null}),Yn=Pe(function(t,n){var o=n[t.line];return{value:o,point:Zt(t.line,o)}}),Tg=function(t,n,o){var a=t.axis;if(t.descriptor.mode==="virtual")return Zt(a.line,n[a.line]);var s=t.subject.page.contentBox[a.size],i=Qt(t.descriptor.id,o),l=i.reduce(function(u,m){return u+m.client.marginBox[a.size]},0),c=l+n[a.line],d=c-s;return d<=0?null:Zt(a.line,d)},ac=function(t,n){return ce({},t,{scroll:ce({},t.scroll,{max:n})})},sc=function(t,n,o){var a=t.frame;Tn(n,t)&&(process.env.NODE_ENV!=="production"?P(!1,"Should not add placeholder space to home list"):P()),t.subject.withPlaceholder&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot add placeholder size to a subject when it already has one"):P());var s=Yn(t.axis,n.displaceBy).point,i=Tg(t,s,o),l={placeholderSize:s,increasedBy:i,oldFrameMaxScroll:t.frame?t.frame.scroll.max:null};if(!a){var c=En({page:t.subject.page,withPlaceholder:l,axis:t.axis,frame:t.frame});return ce({},t,{subject:c})}var d=i?Ae(a.scroll.max,i):a.scroll.max,u=ac(a,d),m=En({page:t.subject.page,withPlaceholder:l,axis:t.axis,frame:u});return ce({},t,{subject:m,frame:u})},wg=function(t){var n=t.subject.withPlaceholder;n||(process.env.NODE_ENV!=="production"?P(!1,"Cannot remove placeholder form subject when there was none"):P());var o=t.frame;if(!o){var a=En({page:t.subject.page,axis:t.axis,frame:null,withPlaceholder:null});return ce({},t,{subject:a})}var s=n.oldFrameMaxScroll;s||(process.env.NODE_ENV!=="production"?P(!1,"Expected droppable with frame to have old max frame scroll when removing placeholder"):P());var i=ac(o,s),l=En({page:t.subject.page,axis:t.axis,frame:i,withPlaceholder:null});return ce({},t,{subject:l,frame:i})},Cg=(function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,o=e.insideDestination,a=e.draggable,s=e.draggables,i=e.destination,l=e.viewport,c=e.afterCritical;if(!n){if(o.length)return null;var d={displaced:zn,displacedBy:jl,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},u=Ko({impact:d,draggable:a,droppable:i,draggables:s,afterCritical:c}),m=Tn(a,i)?i:sc(i,a,s),p=oc({draggable:a,destination:m,newPageBorderBoxCenter:u,viewport:l.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return p?d:null}var f=t[i.axis.line]<=n.page.borderBox.center[i.axis.line],g=(function(){var y=n.descriptor.index;return n.descriptor.id===a.descriptor.id||f?y:y+1})(),v=Yn(i.axis,a.displaceBy);return Vo({draggable:a,insideDestination:o,destination:i,viewport:l,displacedBy:v,last:zn,index:g})}),Dg=(function(e){var t=e.isMovingForward,n=e.previousPageBorderBoxCenter,o=e.draggable,a=e.isOver,s=e.draggables,i=e.droppables,l=e.viewport,c=e.afterCritical,d=vg({isMovingForward:t,pageBorderBoxCenter:n,source:a,droppables:i,viewport:l});if(!d)return null;var u=Qt(d.descriptor.id,s),m=Eg({pageBorderBoxCenter:n,viewport:l,destination:d,insideDestination:u,afterCritical:c}),p=Cg({previousPageBorderBoxCenter:n,destination:d,draggable:o,draggables:s,moveRelativeTo:m,insideDestination:u,viewport:l,afterCritical:c});if(!p)return null;var f=Ko({impact:p,draggable:o,droppable:d,draggables:s,afterCritical:c}),g=ga({pageBorderBoxCenter:f,draggable:o,viewport:l});return{clientSelection:g,impact:p,scrollJumpRequest:null}}),et=(function(e){var t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null}),Ng=function(t,n){var o=et(t);return o?n[o]:null},Ig=(function(e){var t=e.state,n=e.type,o=Ng(t.impact,t.dimensions.droppables),a=!!o,s=t.dimensions.droppables[t.critical.droppable.id],i=o||s,l=i.axis.direction,c=l==="vertical"&&(n==="MOVE_UP"||n==="MOVE_DOWN")||l==="horizontal"&&(n==="MOVE_LEFT"||n==="MOVE_RIGHT");if(c&&!a)return null;var d=n==="MOVE_DOWN"||n==="MOVE_RIGHT",u=t.dimensions.draggables[t.critical.draggable.id],m=t.current.page.borderBoxCenter,p=t.dimensions,f=p.draggables,g=p.droppables;return c?bg({isMovingForward:d,previousPageBorderBoxCenter:m,draggable:u,destination:i,draggables:f,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):Dg({isMovingForward:d,previousPageBorderBoxCenter:m,draggable:u,isOver:i,draggables:f,droppables:g,viewport:t.viewport,afterCritical:t.afterCritical})});function en(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function ic(e){var t=lt(e.top,e.bottom),n=lt(e.left,e.right);return function(a){return t(a.y)&&n(a.x)}}function xg(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function kg(e){var t=e.pageBorderBox,n=e.draggable,o=e.candidates,a=n.page.borderBox.center,s=o.map(function(i){var l=i.axis,c=Zt(i.axis.line,t.center[l.line],i.page.borderBox.center[l.crossAxisLine]);return{id:i.descriptor.id,distance:Gn(a,c)}}).sort(function(i,l){return l.distance-i.distance});return s[0]?s[0].id:null}function Mg(e){var t=e.pageBorderBox,n=e.draggable,o=e.droppables,a=Fo(o).filter(function(s){if(!s.isEnabled)return!1;var i=s.subject.active;if(!i||!xg(t,i))return!1;if(ic(i)(t.center))return!0;var l=s.axis,c=i.center[l.crossAxisLine],d=t[l.crossAxisStart],u=t[l.crossAxisEnd],m=lt(i[l.crossAxisStart],i[l.crossAxisEnd]),p=m(d),f=m(u);return!p&&!f?!0:p?d<c:u>c});return a.length?a.length===1?a[0].descriptor.id:kg({pageBorderBox:t,draggable:n,candidates:a}):null}var lc=function(t,n){return St(Un(t,n))},Lg=(function(e,t){var n=e.frame;return n?lc(t,n.scroll.diff.value):t});function cc(e){var t=e.displaced,n=e.id;return!!(t.visible[n]||t.invisible[n])}function _g(e){var t=e.draggable,n=e.closest,o=e.inHomeList;return n?o&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}var Pg=(function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,o=e.destination,a=e.insideDestination,s=e.last,i=e.viewport,l=e.afterCritical,c=o.axis,d=Yn(o.axis,n.displaceBy),u=d.value,m=t[c.start],p=t[c.end],f=$o(n,a),g=$t(f,function(y){var b=y.descriptor.id,h=y.page.borderBox.center[c.line],I=Vt(b,l),C=cc({displaced:s,id:b});return I?C?p<=h:m<h-u:C?p<=h+u:m<h}),v=_g({draggable:n,closest:g,inHomeList:Tn(n,o)});return Vo({draggable:n,insideDestination:a,destination:o,viewport:i,last:s,displacedBy:d,index:v})}),Og=4,Bg=(function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,o=e.previousImpact,a=e.destination,s=e.insideDestination,i=e.afterCritical;if(!a.isCombineEnabled)return null;var l=a.axis,c=Yn(a.axis,t.displaceBy),d=c.value,u=n[l.start],m=n[l.end],p=$o(t,s),f=$t(p,function(v){var y=v.descriptor.id,b=v.page.borderBox,h=b[l.size],I=h/Og,C=Vt(y,i),D=cc({displaced:o.displaced,id:y});return C?D?m>b[l.start]+I&&m<b[l.end]-I:u>b[l.start]-d+I&&u<b[l.end]-d-I:D?m>b[l.start]+d+I&&m<b[l.end]+d-I:u>b[l.start]+I&&u<b[l.end]-I});if(!f)return null;var g={displacedBy:c,displaced:o.displaced,at:{type:"COMBINE",combine:{draggableId:f.descriptor.id,droppableId:a.descriptor.id}}};return g}),dc=(function(e){var t=e.pageOffset,n=e.draggable,o=e.draggables,a=e.droppables,s=e.previousImpact,i=e.viewport,l=e.afterCritical,c=lc(n.page.borderBox,t),d=Mg({pageBorderBox:c,draggable:n,droppables:a});if(!d)return qS;var u=a[d],m=Qt(u.descriptor.id,o),p=Lg(u,c);return Bg({pageBorderBoxWithDroppableScroll:p,draggable:n,previousImpact:s,destination:u,insideDestination:m,afterCritical:l})||Pg({pageBorderBoxWithDroppableScroll:p,draggable:n,destination:u,insideDestination:m,last:s.displaced,viewport:i,afterCritical:l})}),ha=(function(e,t){var n;return ce({},e,(n={},n[t.descriptor.id]=t,n))}),Rg=function(t){var n=t.previousImpact,o=t.impact,a=t.droppables,s=et(n),i=et(o);if(!s||s===i)return a;var l=a[s];if(!l.subject.withPlaceholder)return a;var c=wg(l);return ha(a,c)},Fg=(function(e){var t=e.draggable,n=e.draggables,o=e.droppables,a=e.previousImpact,s=e.impact,i=Rg({previousImpact:a,impact:s,droppables:o}),l=et(s);if(!l)return i;var c=o[l];if(Tn(t,c)||c.subject.withPlaceholder)return i;var d=sc(c,t,n);return ha(i,d)}),qn=(function(e){var t=e.state,n=e.clientSelection,o=e.dimensions,a=e.viewport,s=e.impact,i=e.scrollJumpRequest,l=a||t.viewport,c=o||t.dimensions,d=n||t.current.client.selection,u=Qe(d,t.initial.client.selection),m={offset:u,selection:d,borderBoxCenter:Ae(t.initial.client.borderBoxCenter,u)},p={selection:Ae(m.selection,l.scroll.current),borderBoxCenter:Ae(m.borderBoxCenter,l.scroll.current),offset:Ae(m.offset,l.scroll.diff.value)},f={client:m,page:p};if(t.phase==="COLLECTING")return ce({phase:"COLLECTING"},t,{dimensions:c,viewport:l,current:f});var g=c.draggables[t.critical.draggable.id],v=s||dc({pageOffset:p.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:t.impact,viewport:l,afterCritical:t.afterCritical}),y=Fg({draggable:g,impact:v,previousImpact:t.impact,draggables:c.draggables,droppables:c.droppables}),b=ce({},t,{current:f,dimensions:{draggables:c.draggables,droppables:y},impact:v,viewport:l,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null});return b});function Ag(e,t){return e.map(function(n){return t[n]})}var pc=(function(e){var t=e.impact,n=e.viewport,o=e.draggables,a=e.destination,s=e.forceShouldAnimate,i=t.displaced,l=Ag(i.all,o),c=jn({afterDragging:l,destination:a,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:s,last:i});return ce({},t,{displaced:c})}),uc=(function(e){var t=e.impact,n=e.draggable,o=e.droppable,a=e.draggables,s=e.viewport,i=e.afterCritical,l=Ko({impact:t,draggable:n,draggables:a,droppable:o,afterCritical:i});return ga({pageBorderBoxCenter:l,draggable:n,viewport:s})}),mc=(function(e){var t=e.state,n=e.dimensions,o=e.viewport;t.movementMode!=="SNAP"&&(process.env.NODE_ENV,P());var a=t.impact,s=o||t.viewport,i=n||t.dimensions,l=i.draggables,c=i.droppables,d=l[t.critical.draggable.id],u=et(a);u||(process.env.NODE_ENV!=="production"?P(!1,"Must be over a destination in SNAP movement mode"):P());var m=c[u],p=pc({impact:a,viewport:s,destination:m,draggables:l}),f=uc({impact:p,draggable:d,droppable:m,draggables:l,viewport:s,afterCritical:t.afterCritical});return qn({impact:p,clientSelection:f,state:t,dimensions:i,viewport:s})}),$g=(function(e){return{index:e.index,droppableId:e.droppableId}}),fc=(function(e){var t=e.draggable,n=e.home,o=e.draggables,a=e.viewport,s=Yn(n.axis,t.displaceBy),i=Qt(n.descriptor.id,o),l=i.indexOf(t);l===-1&&(process.env.NODE_ENV!=="production"?P(!1,"Expected draggable to be inside home list"):P());var c=i.slice(l+1),d=c.reduce(function(f,g){return f[g.descriptor.id]=!0,f},{}),u={inVirtualList:n.descriptor.mode==="virtual",displacedBy:s,effected:d},m=jn({afterDragging:c,destination:n,displacedBy:s,last:null,viewport:a.frame,forceShouldAnimate:!1}),p={displaced:m,displacedBy:s,at:{type:"REORDER",destination:$g(t.descriptor)}};return{impact:p,afterCritical:u}}),Vg=(function(e,t){return{draggables:e.draggables,droppables:ha(e.droppables,t)}}),Jn=function(t){process.env.NODE_ENV},Xn=function(t){process.env.NODE_ENV},Kg=(function(e){var t=e.draggable,n=e.offset,o=e.initialWindowScroll,a=_o(t.client,n),s=Po(a,o),i=ce({},t,{placeholder:ce({},t.placeholder,{client:a}),client:a,page:s});return i}),Hg=(function(e){var t=e.frame;return t||(process.env.NODE_ENV!=="production"?P(!1,"Expected Droppable to have a frame"):P()),t}),Wg=(function(e){var t=e.additions,n=e.updatedDroppables,o=e.viewport,a=o.scroll.diff.value;return t.map(function(s){var i=s.descriptor.droppableId,l=n[i],c=Hg(l),d=c.scroll.diff.value,u=Ae(a,d),m=Kg({draggable:s,offset:u,initialWindowScroll:o.scroll.initial});return m})}),Gg=(function(e){var t=e.state,n=e.published;Jn();var o=n.modified.map(function(I){var C=t.dimensions.droppables[I.droppableId],D=ca(C,I.scroll);return D}),a=ce({},t.dimensions.droppables,{},Ul(o)),s=zl(Wg({additions:n.additions,updatedDroppables:a,viewport:t.viewport})),i=ce({},t.dimensions.draggables,{},s);n.removals.forEach(function(I){delete i[I]});var l={droppables:a,draggables:i},c=et(t.impact),d=c?l.droppables[c]:null,u=l.draggables[t.critical.draggable.id],m=l.droppables[t.critical.droppable.id],p=fc({draggable:u,home:m,draggables:i,viewport:t.viewport}),f=p.impact,g=p.afterCritical,v=d&&d.isCombineEnabled?t.impact:f,y=dc({pageOffset:t.current.page.offset,draggable:l.draggables[t.critical.draggable.id],draggables:l.draggables,droppables:l.droppables,previousImpact:v,viewport:t.viewport,afterCritical:g});Xn();var b=ce({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:y,onLiftImpact:f,dimensions:l,afterCritical:g,forceShouldAnimate:!1});if(t.phase==="COLLECTING")return b;var h=ce({phase:"DROP_PENDING"},b,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1});return h}),ba=function(t){return t.movementMode==="SNAP"},va=function(t,n,o){var a=Vg(t.dimensions,n);return!ba(t)||o?qn({state:t,dimensions:a}):mc({state:t,dimensions:a})};function ya(e){return e.isDragging&&e.movementMode==="SNAP"?ce({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var Sc={phase:"IDLE",completed:null,shouldFlush:!1},Ug=(function(e,t){if(e===void 0&&(e=Sc),t.type==="FLUSH")return ce({},Sc,{shouldFlush:!0});if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?P(!1,"INITIAL_PUBLISH must come after a IDLE phase"):P());var n=t.payload,o=n.critical,a=n.clientSelection,s=n.viewport,i=n.dimensions,l=n.movementMode,c=i.draggables[o.draggable.id],d=i.droppables[o.droppable.id],u={selection:a,borderBoxCenter:c.client.borderBox.center,offset:Oe},m={client:u,page:{selection:Ae(u.selection,s.scroll.initial),borderBoxCenter:Ae(u.selection,s.scroll.initial),offset:Ae(u.selection,s.scroll.diff.value)}},p=Fo(i.droppables).every(function(z){return!z.isFixedOnPage}),f=fc({draggable:c,home:d,draggables:i.draggables,viewport:s}),g=f.impact,v=f.afterCritical,y={phase:"DRAGGING",isDragging:!0,critical:o,movementMode:l,dimensions:i,initial:m,current:m,isWindowScrollAllowed:p,impact:g,afterCritical:v,onLiftImpact:g,viewport:s,scrollJumpRequest:null,forceShouldAnimate:null};return y}if(t.type==="COLLECTION_STARTING"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?P(!1,"Collection cannot start from phase "+e.phase):P());var b=ce({phase:"COLLECTING"},e,{phase:"COLLECTING"});return b}if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?P(!1,"Unexpected "+t.type+" received in phase "+e.phase):P()),Gg({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;en(e)||(process.env.NODE_ENV!=="production"?P(!1,t.type+" not permitted in phase "+e.phase):P());var h=t.payload.client;return At(h,e.current.client.selection)?e:qn({state:e,clientSelection:h,impact:ba(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return ya(e);en(e)||(process.env.NODE_ENV!=="production"?P(!1,t.type+" not permitted in phase "+e.phase):P());var I=t.payload,C=I.id,D=I.newScroll,L=e.dimensions.droppables[C];if(!L)return e;var $=ca(L,D);return va(e,$,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;en(e)||(process.env.NODE_ENV!=="production"?P(!1,"Attempting to move in an unsupported phase "+e.phase):P());var O=t.payload,_=O.id,R=O.isEnabled,H=e.dimensions.droppables[_];H||(process.env.NODE_ENV!=="production"?P(!1,"Cannot find Droppable[id: "+_+"] to toggle its enabled state"):P()),H.isEnabled===R&&(process.env.NODE_ENV!=="production"?P(!1,"Trying to set droppable isEnabled to "+String(R)+`
|
|
399
|
+
but it is already `+String(H.isEnabled)):P());var Z=ce({},H,{isEnabled:R});return va(e,Z,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;en(e)||(process.env.NODE_ENV!=="production"?P(!1,"Attempting to move in an unsupported phase "+e.phase):P());var V=t.payload,w=V.id,F=V.isCombineEnabled,B=e.dimensions.droppables[w];B||(process.env.NODE_ENV!=="production"?P(!1,"Cannot find Droppable[id: "+w+"] to toggle its isCombineEnabled state"):P()),B.isCombineEnabled===F&&(process.env.NODE_ENV!=="production"?P(!1,"Trying to set droppable isCombineEnabled to "+String(F)+`
|
|
400
|
+
but it is already `+String(B.isCombineEnabled)):P());var M=ce({},B,{isCombineEnabled:F});return va(e,M,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;en(e)||(process.env.NODE_ENV!=="production"?P(!1,"Cannot move by window in phase "+e.phase):P()),e.isWindowScrollAllowed||(process.env.NODE_ENV!=="production"?P(!1,"Window scrolling is currently not supported for fixed lists"):P());var q=t.payload.newScroll;if(At(e.viewport.scroll.current,q))return ya(e);var N=tc(e.viewport,q);return ba(e)?mc({state:e,viewport:N}):qn({state:e,viewport:N})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!en(e))return e;var T=t.payload.maxScroll;if(At(T,e.viewport.scroll.max))return e;var k=ce({},e.viewport,{scroll:ce({},e.viewport.scroll,{max:T})});return ce({phase:"DRAGGING"},e,{viewport:k})}if(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?P(!1,t.type+" received while not in DRAGGING phase"):P());var U=Ig({state:e,type:t.type});return U?qn({state:e,impact:U.impact,clientSelection:U.clientSelection,scrollJumpRequest:U.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){var J=t.payload.reason;e.phase!=="COLLECTING"&&(process.env.NODE_ENV!=="production"?P(!1,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):P());var te=ce({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:J});return te}if(t.type==="DROP_ANIMATE"){var ne=t.payload,W=ne.completed,X=ne.dropDuration,Y=ne.newHomeClientOffset;e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?P(!1,"Cannot animate drop from phase "+e.phase):P());var G={phase:"DROP_ANIMATING",completed:W,dropDuration:X,newHomeClientOffset:Y,dimensions:e.dimensions};return G}if(t.type==="DROP_COMPLETE"){var ee=t.payload.completed;return{phase:"IDLE",completed:ee,shouldFlush:!1}}return e}),zg=function(t){return{type:"BEFORE_INITIAL_CAPTURE",payload:t}},jg=function(t){return{type:"LIFT",payload:t}},Yg=function(t){return{type:"INITIAL_PUBLISH",payload:t}},qg=function(t){return{type:"PUBLISH_WHILE_DRAGGING",payload:t}},Jg=function(){return{type:"COLLECTION_STARTING",payload:null}},Xg=function(t){return{type:"UPDATE_DROPPABLE_SCROLL",payload:t}},Zg=function(t){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:t}},Qg=function(t){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:t}},gc=function(t){return{type:"MOVE",payload:t}},eh=function(t){return{type:"MOVE_BY_WINDOW_SCROLL",payload:t}},th=function(t){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:t}},nh=function(){return{type:"MOVE_UP",payload:null}},oh=function(){return{type:"MOVE_DOWN",payload:null}},rh=function(){return{type:"MOVE_RIGHT",payload:null}},ah=function(){return{type:"MOVE_LEFT",payload:null}},Ea=function(){return{type:"FLUSH",payload:null}},sh=function(t){return{type:"DROP_ANIMATE",payload:t}},Ta=function(t){return{type:"DROP_COMPLETE",payload:t}},hc=function(t){return{type:"DROP",payload:t}},ih=function(t){return{type:"DROP_PENDING",payload:t}},bc=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function lh(e){if(!(e.length<=1)){for(var t=e.map(function(l){return l.descriptor.index}),n={},o=1;o<t.length;o++){var a=t[o],s=t[o-1];a!==s+1&&(n[a]=!0)}if(Object.keys(n).length){var i=t.map(function(l){var c=!!n[l];return c?"[🔥"+l+"]":""+l}).join(", ");process.env.NODE_ENV!=="production"&&Ce(`
|
|
401
401
|
Detected non-consecutive <Draggable /> indexes.
|
|
402
402
|
|
|
403
403
|
(This can cause unexpected bugs)
|
|
404
404
|
|
|
405
405
|
`+i+`
|
|
406
|
-
`)}}}function
|
|
406
|
+
`)}}}function ch(e,t){if(process.env.NODE_ENV!=="production"){var n=Qt(e.droppable.id,t.draggables);lh(n)}}var dh=(function(e){return function(t){var n=t.getState,o=t.dispatch;return function(a){return function(s){if(s.type!=="LIFT"){a(s);return}var i=s.payload,l=i.id,c=i.clientSelection,d=i.movementMode,u=n();u.phase==="DROP_ANIMATING"&&o(Ta({completed:u.completed})),n().phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?P(!1,"Unexpected phase to start a drag"):P()),o(Ea()),o(zg({draggableId:l,movementMode:d}));var m={shouldPublishImmediately:d==="SNAP"},p={draggableId:l,scrollOptions:m},f=e.startPublishing(p),g=f.critical,v=f.dimensions,y=f.viewport;ch(g,v),o(Yg({critical:g,dimensions:v,clientSelection:c,movementMode:d,viewport:y}))}}}}),ph=(function(e){return function(){return function(t){return function(n){n.type==="INITIAL_PUBLISH"&&e.dragging(),n.type==="DROP_ANIMATE"&&e.dropping(n.payload.completed.result.reason),(n.type==="FLUSH"||n.type==="DROP_COMPLETE")&&e.resting(),t(n)}}}}),wa={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Zn={opacity:{drop:0,combining:.7},scale:{drop:.75}},Ca={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},tn=Ca.outOfTheWay+"s "+wa.outOfTheWay,Qn={fluid:"opacity "+tn,snap:"transform "+tn+", opacity "+tn,drop:function(t){var n=t+"s "+wa.drop;return"transform "+n+", opacity "+n},outOfTheWay:"transform "+tn,placeholder:"height "+tn+", width "+tn+", margin "+tn},vc=function(t){return At(t,Oe)?null:"translate("+t.x+"px, "+t.y+"px)"},Da={moveTo:vc,drop:function(t,n){var o=vc(t);return o?n?o+" scale("+Zn.scale.drop+")":o:null}},Na=Ca.minDropTime,yc=Ca.maxDropTime,uh=yc-Na,Ec=1500,mh=.6,fh=(function(e){var t=e.current,n=e.destination,o=e.reason,a=Gn(t,n);if(a<=0)return Na;if(a>=Ec)return yc;var s=a/Ec,i=Na+uh*s,l=o==="CANCEL"?i*mh:i;return Number(l.toFixed(2))}),Sh=(function(e){var t=e.impact,n=e.draggable,o=e.dimensions,a=e.viewport,s=e.afterCritical,i=o.draggables,l=o.droppables,c=et(t),d=c?l[c]:null,u=l[n.descriptor.droppableId],m=uc({impact:t,draggable:n,draggables:i,afterCritical:s,droppable:d||u,viewport:a}),p=Qe(m,n.client.borderBox.center);return p}),gh=(function(e){var t=e.draggables,n=e.reason,o=e.lastImpact,a=e.home,s=e.viewport,i=e.onLiftImpact;if(!o.at||n!=="DROP"){var l=pc({draggables:t,impact:i,destination:a,viewport:s,forceShouldAnimate:!0});return{impact:l,didDropInsideDroppable:!1}}if(o.at.type==="REORDER")return{impact:o,didDropInsideDroppable:!0};var c=ce({},o,{displaced:zn});return{impact:c,didDropInsideDroppable:!0}}),hh=(function(e){var t=e.getState,n=e.dispatch;return function(o){return function(a){if(a.type!=="DROP"){o(a);return}var s=t(),i=a.payload.reason;if(s.phase==="COLLECTING"){n(ih({reason:i}));return}if(s.phase!=="IDLE"){var l=s.phase==="DROP_PENDING"&&s.isWaiting;l&&(process.env.NODE_ENV!=="production"?P(!1,"A DROP action occurred while DROP_PENDING and still waiting"):P()),s.phase==="DRAGGING"||s.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?P(!1,"Cannot drop in phase: "+s.phase):P());var c=s.critical,d=s.dimensions,u=d.draggables[s.critical.draggable.id],m=gh({reason:i,lastImpact:s.impact,afterCritical:s.afterCritical,onLiftImpact:s.onLiftImpact,home:s.dimensions.droppables[s.critical.droppable.id],viewport:s.viewport,draggables:s.dimensions.draggables}),p=m.impact,f=m.didDropInsideDroppable,g=f?pa(p):null,v=f?Ao(p):null,y={index:c.draggable.index,droppableId:c.droppable.id},b={draggableId:u.descriptor.id,type:u.descriptor.type,source:y,reason:i,mode:s.movementMode,destination:g,combine:v},h=Sh({impact:p,draggable:u,dimensions:d,viewport:s.viewport,afterCritical:s.afterCritical}),I={critical:s.critical,afterCritical:s.afterCritical,result:b,impact:p},C=!At(s.current.client.offset,h)||!!b.combine;if(!C){n(Ta({completed:I}));return}var D=fh({current:s.current.client.offset,destination:h,reason:i}),L={newHomeClientOffset:h,dropDuration:D,completed:I};n(sh(L))}}}}),Tc=(function(){return{x:window.pageXOffset,y:window.pageYOffset}});function bh(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(n){n.target!==window&&n.target!==window.document||e()}}}function vh(e){var t=e.onWindowScroll;function n(){t(Tc())}var o=Hn(n),a=bh(o),s=Ft;function i(){return s!==Ft}function l(){i()&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot start scroll listener when already active"):P()),s=it(window,[a])}function c(){i()||(process.env.NODE_ENV!=="production"?P(!1,"Cannot stop scroll listener when not active"):P()),o.cancel(),s(),s=Ft}return{start:l,stop:c,isActive:i}}var yh=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},Eh=(function(e){var t=vh({onWindowScroll:function(o){e.dispatch(eh({newScroll:o}))}});return function(n){return function(o){!t.isActive()&&o.type==="INITIAL_PUBLISH"&&t.start(),t.isActive()&&yh(o)&&t.stop(),n(o)}}}),Th=(function(e){var t=!1,n=!1,o=setTimeout(function(){n=!0}),a=function(i){if(t){process.env.NODE_ENV!=="production"&&Ce("Announcement already made. Not making a second announcement");return}if(n){process.env.NODE_ENV!=="production"&&Ce(`
|
|
407
407
|
Announcements cannot be made asynchronously.
|
|
408
408
|
Default message has already been announced.
|
|
409
|
-
`);return}t=!0,e(i),clearTimeout(o)};return a.wasCalled=function(){return t},a}),
|
|
409
|
+
`);return}t=!0,e(i),clearTimeout(o)};return a.wasCalled=function(){return t},a}),wh=(function(){var e=[],t=function(s){var i=da(e,function(d){return d.timerId===s});i===-1&&(process.env.NODE_ENV!=="production"?P(!1,"Could not find timer"):P());var l=e.splice(i,1),c=l[0];c.callback()},n=function(s){var i=setTimeout(function(){return t(i)}),l={timerId:i,callback:s};e.push(l)},o=function(){if(e.length){var s=[].concat(e);e.length=0,s.forEach(function(i){clearTimeout(i.timerId),i.callback()})}};return{add:n,flush:o}}),Ch=function(t,n){return t==null&&n==null?!0:t==null||n==null?!1:t.droppableId===n.droppableId&&t.index===n.index},Dh=function(t,n){return t==null&&n==null?!0:t==null||n==null?!1:t.draggableId===n.draggableId&&t.droppableId===n.droppableId},Nh=function(t,n){if(t===n)return!0;var o=t.draggable.id===n.draggable.id&&t.draggable.droppableId===n.draggable.droppableId&&t.draggable.type===n.draggable.type&&t.draggable.index===n.draggable.index,a=t.droppable.id===n.droppable.id&&t.droppable.type===n.droppable.type;return o&&a},eo=function(t,n){Jn(),n(),Xn()},Ho=function(t,n){return{draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:n}},Ia=function(t,n,o,a){if(!t){o(a(n));return}var s=Th(o),i={announce:s};t(n,i),s.wasCalled()||o(a(n))},Ih=(function(e,t){var n=wh(),o=null,a=function(p,f){o&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot fire onBeforeCapture as a drag start has already been published"):P()),eo("onBeforeCapture",function(){var g=e().onBeforeCapture;if(g){var v={draggableId:p,mode:f};g(v)}})},s=function(p,f){o&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):P()),eo("onBeforeDragStart",function(){var g=e().onBeforeDragStart;g&&g(Ho(p,f))})},i=function(p,f){o&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):P());var g=Ho(p,f);o={mode:f,lastCritical:p,lastLocation:g.source,lastCombine:null},n.add(function(){eo("onDragStart",function(){return Ia(e().onDragStart,g,t,Bo.onDragStart)})})},l=function(p,f){var g=pa(f),v=Ao(f);o||(process.env.NODE_ENV!=="production"?P(!1,"Cannot fire onDragMove when onDragStart has not been called"):P());var y=!Nh(p,o.lastCritical);y&&(o.lastCritical=p);var b=!Ch(o.lastLocation,g);b&&(o.lastLocation=g);var h=!Dh(o.lastCombine,v);if(h&&(o.lastCombine=v),!(!y&&!b&&!h)){var I=ce({},Ho(p,o.mode),{combine:v,destination:g});n.add(function(){eo("onDragUpdate",function(){return Ia(e().onDragUpdate,I,t,Bo.onDragUpdate)})})}},c=function(){o||(process.env.NODE_ENV!=="production"?P(!1,"Can only flush responders while dragging"):P()),n.flush()},d=function(p){o||(process.env.NODE_ENV!=="production"?P(!1,"Cannot fire onDragEnd when there is no matching onDragStart"):P()),o=null,eo("onDragEnd",function(){return Ia(e().onDragEnd,p,t,Bo.onDragEnd)})},u=function(){if(o){var p=ce({},Ho(o.lastCritical,o.mode),{combine:null,destination:null,reason:"CANCEL"});d(p)}};return{beforeCapture:a,beforeStart:s,start:i,update:l,flush:c,drop:d,abort:u}}),xh=(function(e,t){var n=Ih(e,t);return function(o){return function(a){return function(s){if(s.type==="BEFORE_INITIAL_CAPTURE"){n.beforeCapture(s.payload.draggableId,s.payload.movementMode);return}if(s.type==="INITIAL_PUBLISH"){var i=s.payload.critical;n.beforeStart(i,s.payload.movementMode),a(s),n.start(i,s.payload.movementMode);return}if(s.type==="DROP_COMPLETE"){var l=s.payload.completed.result;n.flush(),a(s),n.drop(l);return}if(a(s),s.type==="FLUSH"){n.abort();return}var c=o.getState();c.phase==="DRAGGING"&&n.update(c.critical,c.impact)}}}}),kh=(function(e){return function(t){return function(n){if(n.type!=="DROP_ANIMATION_FINISHED"){t(n);return}var o=e.getState();o.phase!=="DROP_ANIMATING"&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot finish a drop animating when no drop is occurring"):P()),e.dispatch(Ta({completed:o.completed}))}}}),Mh=(function(e){var t=null,n=null;function o(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return function(a){return function(s){if((s.type==="FLUSH"||s.type==="DROP_COMPLETE"||s.type==="DROP_ANIMATION_FINISHED")&&o(),a(s),s.type==="DROP_ANIMATE"){var i={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var c=e.getState();c.phase==="DROP_ANIMATING"&&e.dispatch(bc())}};n=requestAnimationFrame(function(){n=null,t=it(window,[i])})}}}}),Lh=(function(e){return function(){return function(t){return function(n){(n.type==="DROP_COMPLETE"||n.type==="FLUSH"||n.type==="DROP_ANIMATE")&&e.stopPublishing(),t(n)}}}}),_h=(function(e){var t=!1;return function(){return function(n){return function(o){if(o.type==="INITIAL_PUBLISH"){t=!0,e.tryRecordFocus(o.payload.critical.draggable.id),n(o),e.tryRestoreFocusRecorded();return}if(n(o),!!t){if(o.type==="FLUSH"){t=!1,e.tryRestoreFocusRecorded();return}if(o.type==="DROP_COMPLETE"){t=!1;var a=o.payload.completed.result;a.combine&&e.tryShiftRecord(a.draggableId,a.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}),Ph=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},Oh=(function(e){return function(t){return function(n){return function(o){if(Ph(o)){e.stop(),n(o);return}if(o.type==="INITIAL_PUBLISH"){n(o);var a=t.getState();a.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?P(!1,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):P()),e.start(a);return}n(o),e.scroll(t.getState())}}}}),Bh=(function(e){return function(t){return function(n){if(t(n),n.type==="PUBLISH_WHILE_DRAGGING"){var o=e.getState();o.phase==="DROP_PENDING"&&(o.isWaiting||e.dispatch(hc({reason:o.reason})))}}}}),Rh=process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"react-beautiful-dnd"}):Qi,Fh=(function(e){var t=e.dimensionMarshal,n=e.focusMarshal,o=e.styleMarshal,a=e.getResponders,s=e.announce,i=e.autoScroller;return Ji(Ug,Rh(Df(ph(o),Lh(t),dh(t),hh,kh,Mh,Bh,Oh(i),Eh,_h(n),xh(a,s))))}),xa=function(){return{additions:{},removals:{},modified:{}}};function Ah(e){var t=e.registry,n=e.callbacks,o=xa(),a=null,s=function(){a||(n.collectionStarting(),a=requestAnimationFrame(function(){a=null,Jn();var u=o,m=u.additions,p=u.removals,f=u.modified,g=Object.keys(m).map(function(b){return t.draggable.getById(b).getDimension(Oe)}).sort(function(b,h){return b.descriptor.index-h.descriptor.index}),v=Object.keys(f).map(function(b){var h=t.droppable.getById(b),I=h.callbacks.getScrollWhileDragging();return{droppableId:b,scroll:I}}),y={additions:g,removals:Object.keys(p),modified:v};o=xa(),Xn(),n.publish(y)}))},i=function(u){var m=u.descriptor.id;o.additions[m]=u,o.modified[u.descriptor.droppableId]=!0,o.removals[m]&&delete o.removals[m],s()},l=function(u){var m=u.descriptor;o.removals[m.id]=!0,o.modified[m.droppableId]=!0,o.additions[m.id]&&delete o.additions[m.id],s()},c=function(){a&&(cancelAnimationFrame(a),a=null,o=xa())};return{add:i,remove:l,stop:c}}var wc=(function(e){var t=e.scrollHeight,n=e.scrollWidth,o=e.height,a=e.width,s=Qe({x:n,y:t},{x:a,y:o}),i={x:Math.max(0,s.x),y:Math.max(0,s.y)};return i}),Cc=(function(){var e=document.documentElement;return e||(process.env.NODE_ENV!=="production"?P(!1,"Cannot find document.documentElement"):P()),e}),Dc=(function(){var e=Cc(),t=wc({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight});return t}),$h=(function(){var e=Tc(),t=Dc(),n=e.y,o=e.x,a=Cc(),s=a.clientWidth,i=a.clientHeight,l=o+s,c=n+i,d=St({top:n,left:o,right:l,bottom:c}),u={frame:d,scroll:{initial:e,current:e,max:t,diff:{value:Oe,displacement:Oe}}};return u}),Vh=(function(e){var t=e.critical,n=e.scrollOptions,o=e.registry;Jn();var a=$h(),s=a.scroll.current,i=t.droppable,l=o.droppable.getAllByType(i.type).map(function(m){return m.callbacks.getDimensionAndWatchScroll(s,n)}),c=o.draggable.getAllByType(t.draggable.type).map(function(m){return m.getDimension(s)}),d={draggables:zl(c),droppables:Ul(l)};Xn();var u={dimensions:d,critical:t,viewport:a};return u});function Nc(e,t,n){if(n.descriptor.id===t.id||n.descriptor.type!==t.type)return!1;var o=e.droppable.getById(n.descriptor.droppableId);return o.descriptor.mode!=="virtual"?(process.env.NODE_ENV!=="production"&&Ce(`
|
|
410
410
|
You are attempting to add or remove a Draggable [id: `+n.descriptor.id+`]
|
|
411
411
|
while a drag is occurring. This is only supported for virtual lists.
|
|
412
412
|
|
|
413
413
|
See https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/patterns/virtual-lists.md
|
|
414
|
-
`),!1):!0}var
|
|
414
|
+
`),!1):!0}var Kh=(function(e,t){var n=null,o=Ah({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),a=function(f,g){e.droppable.exists(f)||(process.env.NODE_ENV!=="production"?P(!1,"Cannot update is enabled flag of Droppable "+f+" as it is not registered"):P()),n&&t.updateDroppableIsEnabled({id:f,isEnabled:g})},s=function(f,g){n&&(e.droppable.exists(f)||(process.env.NODE_ENV!=="production"?P(!1,"Cannot update isCombineEnabled flag of Droppable "+f+" as it is not registered"):P()),t.updateDroppableIsCombineEnabled({id:f,isCombineEnabled:g}))},i=function(f,g){n&&(e.droppable.exists(f)||(process.env.NODE_ENV!=="production"?P(!1,"Cannot update the scroll on Droppable "+f+" as it is not registered"):P()),t.updateDroppableScroll({id:f,newScroll:g}))},l=function(f,g){n&&e.droppable.getById(f).callbacks.scroll(g)},c=function(){if(n){o.stop();var f=n.critical.droppable;e.droppable.getAllByType(f.type).forEach(function(g){return g.callbacks.dragStopped()}),n.unsubscribe(),n=null}},d=function(f){n||(process.env.NODE_ENV!=="production"?P(!1,"Should only be subscribed when a collection is occurring"):P());var g=n.critical.draggable;f.type==="ADDITION"&&Nc(e,g,f.value)&&o.add(f.value),f.type==="REMOVAL"&&Nc(e,g,f.value)&&o.remove(f.value)},u=function(f){n&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot start capturing critical dimensions as there is already a collection"):P());var g=e.draggable.getById(f.draggableId),v=e.droppable.getById(g.descriptor.droppableId),y={draggable:g.descriptor,droppable:v.descriptor},b=e.subscribe(d);return n={critical:y,unsubscribe:b},Vh({critical:y,registry:e,scrollOptions:f.scrollOptions})},m={updateDroppableIsEnabled:a,updateDroppableIsCombineEnabled:s,scrollDroppable:l,updateDroppableScroll:i,startPublishing:u,stopPublishing:c};return m}),Ic=(function(e,t){return e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP"}),Hh=(function(e){window.scrollBy(e.x,e.y)}),Wh=Pe(function(e){return Fo(e).filter(function(t){return!(!t.isEnabled||!t.frame)})}),Gh=function(t,n){var o=$t(Wh(n),function(a){return a.frame||(process.env.NODE_ENV!=="production"?P(!1,"Invalid result"):P()),ic(a.frame.pageMarginBox)(t)});return o},Uh=(function(e){var t=e.center,n=e.destination,o=e.droppables;if(n){var a=o[n];return a.frame?a:null}var s=Gh(t,o);return s}),Kt={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(t){return Math.pow(t,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},zh=(function(e,t){var n=e[t.size]*Kt.startFromPercentage,o=e[t.size]*Kt.maxScrollAtPercentage,a={startScrollingFrom:n,maxScrollValueAt:o};return a}),xc=(function(e){var t=e.startOfRange,n=e.endOfRange,o=e.current,a=n-t;if(a===0)return process.env.NODE_ENV!=="production"&&Ce(`
|
|
415
415
|
Detected distance range of 0 in the fluid auto scroller
|
|
416
416
|
This is unexpected and would cause a divide by 0 issue.
|
|
417
417
|
Not allowing an auto scroll
|
|
418
|
-
`),0;var s=o-t,i=s/a;return i}),
|
|
418
|
+
`),0;var s=o-t,i=s/a;return i}),ka=1,jh=(function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return Kt.maxPixelScroll;if(e===t.startScrollingFrom)return ka;var n=xc({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),o=1-n,a=Kt.maxPixelScroll*Kt.ease(o);return Math.ceil(a)}),kc=Kt.durationDampening.accelerateAt,Mc=Kt.durationDampening.stopDampeningAt,Yh=(function(e,t){var n=t,o=Mc,a=Date.now(),s=a-n;if(s>=Mc)return e;if(s<kc)return ka;var i=xc({startOfRange:kc,endOfRange:o,current:s}),l=e*Kt.ease(i);return Math.ceil(l)}),Lc=(function(e){var t=e.distanceToEdge,n=e.thresholds,o=e.dragStartTime,a=e.shouldUseTimeDampening,s=jh(t,n);return s===0?0:a?Math.max(Yh(s,o),ka):s}),_c=(function(e){var t=e.container,n=e.distanceToEdges,o=e.dragStartTime,a=e.axis,s=e.shouldUseTimeDampening,i=zh(t,a),l=n[a.end]<n[a.start];return l?Lc({distanceToEdge:n[a.end],thresholds:i,dragStartTime:o,shouldUseTimeDampening:s}):-1*Lc({distanceToEdge:n[a.start],thresholds:i,dragStartTime:o,shouldUseTimeDampening:s})}),qh=(function(e){var t=e.container,n=e.subject,o=e.proposedScroll,a=n.height>t.height,s=n.width>t.width;return!s&&!a?o:s&&a?null:{x:s?0:o.x,y:a?0:o.y}}),Jh=Hl(function(e){return e===0?0:e}),Pc=(function(e){var t=e.dragStartTime,n=e.container,o=e.subject,a=e.center,s=e.shouldUseTimeDampening,i={top:a.y-n.top,right:n.right-a.x,bottom:n.bottom-a.y,left:a.x-n.left},l=_c({container:n,distanceToEdges:i,dragStartTime:t,axis:ua,shouldUseTimeDampening:s}),c=_c({container:n,distanceToEdges:i,dragStartTime:t,axis:ql,shouldUseTimeDampening:s}),d=Jh({x:c,y:l});if(At(d,Oe))return null;var u=qh({container:n,subject:o,proposedScroll:d});return u?At(u,Oe)?null:u:null}),Xh=Hl(function(e){return e===0?0:e>0?1:-1}),Ma=(function(){var e=function(n,o){return n<0?n:n>o?n-o:0};return function(t){var n=t.current,o=t.max,a=t.change,s=Ae(n,a),i={x:e(s.x,o.x),y:e(s.y,o.y)};return At(i,Oe)?null:i}})(),Oc=function(t){var n=t.max,o=t.current,a=t.change,s={x:Math.max(o.x,n.x),y:Math.max(o.y,n.y)},i=Xh(a),l=Ma({max:s,current:o,change:i});return!l||i.x!==0&&l.x===0||i.y!==0&&l.y===0},La=function(t,n){return Oc({current:t.scroll.current,max:t.scroll.max,change:n})},Zh=function(t,n){if(!La(t,n))return null;var o=t.scroll.max,a=t.scroll.current;return Ma({current:a,max:o,change:n})},_a=function(t,n){var o=t.frame;return o?Oc({current:o.scroll.current,max:o.scroll.max,change:n}):!1},Qh=function(t,n){var o=t.frame;return!o||!_a(t,n)?null:Ma({current:o.scroll.current,max:o.scroll.max,change:n})},eb=(function(e){var t=e.viewport,n=e.subject,o=e.center,a=e.dragStartTime,s=e.shouldUseTimeDampening,i=Pc({dragStartTime:a,container:t.frame,subject:n,center:o,shouldUseTimeDampening:s});return i&&La(t,i)?i:null}),tb=(function(e){var t=e.droppable,n=e.subject,o=e.center,a=e.dragStartTime,s=e.shouldUseTimeDampening,i=t.frame;if(!i)return null;var l=Pc({dragStartTime:a,container:i.pageMarginBox,subject:n,center:o,shouldUseTimeDampening:s});return l&&_a(t,l)?l:null}),Bc=(function(e){var t=e.state,n=e.dragStartTime,o=e.shouldUseTimeDampening,a=e.scrollWindow,s=e.scrollDroppable,i=t.current.page.borderBoxCenter,l=t.dimensions.draggables[t.critical.draggable.id],c=l.page.marginBox;if(t.isWindowScrollAllowed){var d=t.viewport,u=eb({dragStartTime:n,viewport:d,subject:c,center:i,shouldUseTimeDampening:o});if(u){a(u);return}}var m=Uh({center:i,destination:et(t.impact),droppables:t.dimensions.droppables});if(m){var p=tb({dragStartTime:n,droppable:m,subject:c,center:i,shouldUseTimeDampening:o});p&&s(m.descriptor.id,p)}}),nb=(function(e){var t=e.scrollWindow,n=e.scrollDroppable,o=Hn(t),a=Hn(n),s=null,i=function(u){s||(process.env.NODE_ENV!=="production"?P(!1,"Cannot fluid scroll if not dragging"):P());var m=s,p=m.shouldUseTimeDampening,f=m.dragStartTime;Bc({state:u,scrollWindow:o,scrollDroppable:a,dragStartTime:f,shouldUseTimeDampening:p})},l=function(u){Jn(),s&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot start auto scrolling when already started"):P());var m=Date.now(),p=!1,f=function(){p=!0};Bc({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:f,scrollDroppable:f}),s={dragStartTime:m,shouldUseTimeDampening:p},Xn(),p&&i(u)},c=function(){s&&(o.cancel(),a.cancel(),s=null)};return{start:l,stop:c,scroll:i}}),ob=(function(e){var t=e.move,n=e.scrollDroppable,o=e.scrollWindow,a=function(d,u){var m=Ae(d.current.client.selection,u);t({client:m})},s=function(d,u){if(!_a(d,u))return u;var m=Qh(d,u);if(!m)return n(d.descriptor.id,u),null;var p=Qe(u,m);n(d.descriptor.id,p);var f=Qe(u,p);return f},i=function(d,u,m){if(!d||!La(u,m))return m;var p=Zh(u,m);if(!p)return o(m),null;var f=Qe(m,p);o(f);var g=Qe(m,f);return g},l=function(d){var u=d.scrollJumpRequest;if(u){var m=et(d.impact);m||(process.env.NODE_ENV!=="production"?P(!1,"Cannot perform a jump scroll when there is no destination"):P());var p=s(d.dimensions.droppables[m],u);if(p){var f=d.viewport,g=i(d.isWindowScrollAllowed,f,p);g&&a(d,g)}}};return l}),rb=(function(e){var t=e.scrollDroppable,n=e.scrollWindow,o=e.move,a=nb({scrollWindow:n,scrollDroppable:t}),s=ob({move:o,scrollWindow:n,scrollDroppable:t}),i=function(d){if(d.phase==="DRAGGING"){if(d.movementMode==="FLUID"){a.scroll(d);return}d.scrollJumpRequest&&s(d)}},l={scroll:i,start:a.start,stop:a.stop};return l}),wn="data-rbd",Cn=(function(){var e=wn+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}})(),Pa=(function(){var e=wn+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}})(),ab=(function(){var e=wn+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}})(),Rc={contextId:wn+"-scroll-container-context-id"},sb=function(t){return function(n){return"["+n+'="'+t+'"]'}},to=function(t,n){return t.map(function(o){var a=o.styles[n];return a?o.selector+" { "+a+" }":""}).join(" ")},ib="pointer-events: none;",lb=(function(e){var t=sb(e),n=(function(){var l=`
|
|
419
419
|
cursor: -webkit-grab;
|
|
420
420
|
cursor: grab;
|
|
421
421
|
`;return{selector:t(Cn.contextId),styles:{always:`
|
|
422
422
|
-webkit-touch-callout: none;
|
|
423
423
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
424
424
|
touch-action: manipulation;
|
|
425
|
-
`,resting:l,dragging:
|
|
426
|
-
transition: `+
|
|
427
|
-
`;return{selector:t(
|
|
425
|
+
`,resting:l,dragging:ib,dropAnimating:l}}})(),o=(function(){var l=`
|
|
426
|
+
transition: `+Qn.outOfTheWay+`;
|
|
427
|
+
`;return{selector:t(Pa.contextId),styles:{dragging:l,dropAnimating:l,userCancel:l}}})(),a={selector:t(ab.contextId),styles:{always:"overflow-anchor: none;"}},s={selector:"body",styles:{dragging:`
|
|
428
428
|
cursor: grabbing;
|
|
429
429
|
cursor: -webkit-grabbing;
|
|
430
430
|
user-select: none;
|
|
@@ -432,7 +432,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
432
432
|
-moz-user-select: none;
|
|
433
433
|
-ms-user-select: none;
|
|
434
434
|
overflow-anchor: none;
|
|
435
|
-
`}},i=[o,n,a,s];return{always:
|
|
435
|
+
`}},i=[o,n,a,s];return{always:to(i,"always"),resting:to(i,"resting"),dragging:to(i,"dragging"),dropAnimating:to(i,"dropAnimating"),userCancel:to(i,"userCancel")}}),tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?E.useLayoutEffect:E.useEffect,Oa=function(){var t=document.querySelector("head");return t||(process.env.NODE_ENV!=="production"?P(!1,"Cannot find the head to append a style to"):P()),t},Fc=function(t){var n=document.createElement("style");return t&&n.setAttribute("nonce",t),n.type="text/css",n};function cb(e,t){var n=Se(function(){return lb(e)},[e]),o=E.useRef(null),a=E.useRef(null),s=le(Pe(function(m){var p=a.current;p||(process.env.NODE_ENV!=="production"?P(!1,"Cannot set dynamic style element if it is not set"):P()),p.textContent=m}),[]),i=le(function(m){var p=o.current;p||(process.env.NODE_ENV!=="production"?P(!1,"Cannot set dynamic style element if it is not set"):P()),p.textContent=m},[]);tt(function(){!o.current&&!a.current||(process.env.NODE_ENV!=="production"?P(!1,"style elements already mounted"):P());var m=Fc(t),p=Fc(t);return o.current=m,a.current=p,m.setAttribute(wn+"-always",e),p.setAttribute(wn+"-dynamic",e),Oa().appendChild(m),Oa().appendChild(p),i(n.always),s(n.resting),function(){var f=function(v){var y=v.current;y||(process.env.NODE_ENV!=="production"?P(!1,"Cannot unmount ref as it is not set"):P()),Oa().removeChild(y),v.current=null};f(o),f(a)}},[t,i,s,n.always,n.resting,e]);var l=le(function(){return s(n.dragging)},[s,n.dragging]),c=le(function(m){if(m==="DROP"){s(n.dropAnimating);return}s(n.userCancel)},[s,n.dropAnimating,n.userCancel]),d=le(function(){a.current&&s(n.resting)},[s,n.resting]),u=Se(function(){return{dragging:l,dropping:c,resting:d}},[l,c,d]);return u}var Ac=(function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window});function no(e){return e instanceof Ac(e).HTMLElement}function $c(e,t){var n="["+Cn.contextId+'="'+e+'"]',o=Gl(document.querySelectorAll(n));if(!o.length)return process.env.NODE_ENV!=="production"&&Ce('Unable to find any drag handles in the context "'+e+'"'),null;var a=$t(o,function(s){return s.getAttribute(Cn.draggableId)===t});return a?no(a)?a:(process.env.NODE_ENV!=="production"&&Ce("drag handle needs to be a HTMLElement"),null):(process.env.NODE_ENV!=="production"&&Ce('Unable to find drag handle with id "'+t+'" as no handle with a matching id was found'),null)}function db(e){var t=E.useRef({}),n=E.useRef(null),o=E.useRef(null),a=E.useRef(!1),s=le(function(p,f){var g={id:p,focus:f};return t.current[p]=g,function(){var y=t.current,b=y[p];b!==g&&delete y[p]}},[]),i=le(function(p){var f=$c(e,p);f&&f!==document.activeElement&&f.focus()},[e]),l=le(function(p,f){n.current===p&&(n.current=f)},[]),c=le(function(){o.current||a.current&&(o.current=requestAnimationFrame(function(){o.current=null;var p=n.current;p&&i(p)}))},[i]),d=le(function(p){n.current=null;var f=document.activeElement;f&&f.getAttribute(Cn.draggableId)===p&&(n.current=p)},[]);tt(function(){return a.current=!0,function(){a.current=!1;var p=o.current;p&&cancelAnimationFrame(p)}},[]);var u=Se(function(){return{register:s,tryRecordFocus:d,tryRestoreFocusRecorded:c,tryShiftRecord:l}},[s,d,c,l]);return u}function pb(){var e={draggables:{},droppables:{}},t=[];function n(m){return t.push(m),function(){var f=t.indexOf(m);f!==-1&&t.splice(f,1)}}function o(m){t.length&&t.forEach(function(p){return p(m)})}function a(m){return e.draggables[m]||null}function s(m){var p=a(m);return p||(process.env.NODE_ENV!=="production"?P(!1,"Cannot find draggable entry with id ["+m+"]"):P()),p}var i={register:function(p){e.draggables[p.descriptor.id]=p,o({type:"ADDITION",value:p})},update:function(p,f){var g=e.draggables[f.descriptor.id];g&&g.uniqueId===p.uniqueId&&(delete e.draggables[f.descriptor.id],e.draggables[p.descriptor.id]=p)},unregister:function(p){var f=p.descriptor.id,g=a(f);g&&p.uniqueId===g.uniqueId&&(delete e.draggables[f],o({type:"REMOVAL",value:p}))},getById:s,findById:a,exists:function(p){return!!a(p)},getAllByType:function(p){return Ro(e.draggables).filter(function(f){return f.descriptor.type===p})}};function l(m){return e.droppables[m]||null}function c(m){var p=l(m);return p||(process.env.NODE_ENV!=="production"?P(!1,"Cannot find droppable entry with id ["+m+"]"):P()),p}var d={register:function(p){e.droppables[p.descriptor.id]=p},unregister:function(p){var f=l(p.descriptor.id);f&&p.uniqueId===f.uniqueId&&delete e.droppables[p.descriptor.id]},getById:c,findById:l,exists:function(p){return!!l(p)},getAllByType:function(p){return Ro(e.droppables).filter(function(f){return f.descriptor.type===p})}};function u(){e.draggables={},e.droppables={},t.length=0}return{draggable:i,droppable:d,subscribe:n,clean:u}}function ub(){var e=Se(pb,[]);return E.useEffect(function(){return function(){requestAnimationFrame(e.clean)}},[e]),e}var Ba=E.createContext(null),oo=(function(){var e=document.body;return e||(process.env.NODE_ENV!=="production"?P(!1,"Cannot find document.body"):P()),e}),mb={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},fb=function(t){return"rbd-announcement-"+t};function Sb(e){var t=Se(function(){return fb(e)},[e]),n=E.useRef(null);E.useEffect(function(){var s=document.createElement("div");return n.current=s,s.id=t,s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true"),ce(s.style,mb),oo().appendChild(s),function(){setTimeout(function(){var c=oo();c.contains(s)&&c.removeChild(s),s===n.current&&(n.current=null)})}},[t]);var o=le(function(a){var s=n.current;if(s){s.textContent=a;return}process.env.NODE_ENV!=="production"&&Ce(`
|
|
436
436
|
A screen reader message was trying to be announced but it was unable to do so.
|
|
437
437
|
This can occur if you unmount your <DragDropContext /> in your onDragEnd.
|
|
438
438
|
Consider calling provided.announce() before the unmount so that the instruction will
|
|
@@ -441,34 +441,34 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
441
441
|
Message not passed to screen reader:
|
|
442
442
|
|
|
443
443
|
"`+a+`"
|
|
444
|
-
`)},[]);return o}var
|
|
444
|
+
`)},[]);return o}var Vc=0,gb={separator:"::"};function hb(){Vc=0}function Ra(e,t){return t===void 0&&(t=gb),Se(function(){return""+e+t.separator+Vc++},[t.separator,e])}function bb(e){var t=e.contextId,n=e.uniqueId;return"rbd-hidden-text-"+t+"-"+n}function vb(e){var t=e.contextId,n=e.text,o=Ra("hidden-text",{separator:"-"}),a=Se(function(){return bb({contextId:t,uniqueId:o})},[o,t]);return E.useEffect(function(){var i=document.createElement("div");return i.id=a,i.textContent=n,i.style.display="none",oo().appendChild(i),function(){var c=oo();c.contains(i)&&c.removeChild(i)}},[a,n]),a}var Wo=E.createContext(null),yb={react:"^16.8.5 || ^17.0.0 || ^18.0.0","react-dom":"^16.8.5 || ^17.0.0 || ^18.0.0"},Eb=/(\d+)\.(\d+)\.(\d+)/,Kc=function(t){var n=Eb.exec(t);n==null&&(process.env.NODE_ENV!=="production"?P(!1,"Unable to parse React version "+t):P());var o=Number(n[1]),a=Number(n[2]),s=Number(n[3]);return{major:o,minor:a,patch:s,raw:t}},Tb=function(t,n){return n.major>t.major?!0:n.major<t.major?!1:n.minor>t.minor?!0:n.minor<t.minor?!1:n.patch>=t.patch},wb=(function(e,t){var n=Kc(e),o=Kc(t);Tb(n,o)||process.env.NODE_ENV!=="production"&&Ce(`
|
|
445
445
|
React version: [`+o.raw+`]
|
|
446
446
|
does not satisfy expected peer dependency version: [`+n.raw+`]
|
|
447
447
|
|
|
448
448
|
This can result in run time bugs, and even fatal crashes
|
|
449
|
-
`)}),
|
|
449
|
+
`)}),Fa=`
|
|
450
450
|
We expect a html5 doctype: <!doctype html>
|
|
451
451
|
This is to ensure consistent browser layout and measurement
|
|
452
452
|
|
|
453
453
|
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md
|
|
454
|
-
`,
|
|
454
|
+
`,Cb=(function(e){var t=e.doctype;if(!t){process.env.NODE_ENV!=="production"&&Ce(`
|
|
455
455
|
No <!doctype html> found.
|
|
456
456
|
|
|
457
|
-
`+
|
|
457
|
+
`+Fa+`
|
|
458
458
|
`);return}t.name.toLowerCase()!=="html"&&process.env.NODE_ENV!=="production"&&Ce(`
|
|
459
459
|
Unexpected <!doctype> found: (`+t.name+`)
|
|
460
460
|
|
|
461
|
-
`+
|
|
461
|
+
`+Fa+`
|
|
462
462
|
`),t.publicId!==""&&process.env.NODE_ENV!=="production"&&Ce(`
|
|
463
463
|
Unexpected <!doctype> publicId found: (`+t.publicId+`)
|
|
464
464
|
A html5 doctype does not have a publicId
|
|
465
465
|
|
|
466
|
-
`+
|
|
467
|
-
`)});function
|
|
466
|
+
`+Fa+`
|
|
467
|
+
`)});function Aa(e){process.env.NODE_ENV!=="production"&&e()}function ro(e,t){Aa(function(){E.useEffect(function(){try{e()}catch(n){la(`
|
|
468
468
|
A setup problem was encountered.
|
|
469
469
|
|
|
470
470
|
> `+n.message+`
|
|
471
|
-
`)}},t)})}function
|
|
471
|
+
`)}},t)})}function Db(){ro(function(){wb(yb.react,E.version),Cb(document)},[])}function $a(e){var t=E.useRef(e);return E.useEffect(function(){t.current=e}),t}function Nb(){var e=null;function t(){return!!e}function n(i){return i===e}function o(i){e&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot claim lock as it is already claimed"):P());var l={abandon:i};return e=l,l}function a(){e||(process.env.NODE_ENV!=="production"?P(!1,"Cannot release lock when there is no lock"):P()),e=null}function s(){e&&(e.abandon(),a())}return{isClaimed:t,isActive:n,claim:o,release:a,tryAbandon:s}}var Ib=9,xb=13,Va=27,Hc=32,kb=33,Mb=34,Lb=35,_b=36,Pb=37,Ob=38,Bb=39,Rb=40,Go,Fb=(Go={},Go[xb]=!0,Go[Ib]=!0,Go),Wc=(function(e){Fb[e.keyCode]&&e.preventDefault()}),Uo=(function(){var e="visibilitychange";if(typeof document>"u")return e;var t=[e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],n=$t(t,function(o){return"on"+o in document});return n||e})(),Gc=0,Uc=5;function Ab(e,t){return Math.abs(t.x-e.x)>=Uc||Math.abs(t.y-e.y)>=Uc}var zc={type:"IDLE"};function $b(e){var t=e.cancel,n=e.completed,o=e.getPhase,a=e.setPhase;return[{eventName:"mousemove",fn:function(i){var l=i.button,c=i.clientX,d=i.clientY;if(l===Gc){var u={x:c,y:d},m=o();if(m.type==="DRAGGING"){i.preventDefault(),m.actions.move(u);return}m.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot be IDLE"):P());var p=m.point;if(Ab(p,u)){i.preventDefault();var f=m.actions.fluidLift(u);a({type:"DRAGGING",actions:f})}}}},{eventName:"mouseup",fn:function(i){var l=o();if(l.type!=="DRAGGING"){t();return}i.preventDefault(),l.actions.drop({shouldBlockNextClick:!0}),n()}},{eventName:"mousedown",fn:function(i){o().type==="DRAGGING"&&i.preventDefault(),t()}},{eventName:"keydown",fn:function(i){var l=o();if(l.type==="PENDING"){t();return}if(i.keyCode===Va){i.preventDefault(),t();return}Wc(i)}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){o().type==="PENDING"&&t()}},{eventName:"webkitmouseforcedown",fn:function(i){var l=o();if(l.type==="IDLE"&&(process.env.NODE_ENV!=="production"?P(!1,"Unexpected phase"):P()),l.actions.shouldRespectForcePress()){t();return}i.preventDefault()}},{eventName:Uo,fn:t}]}function jc(e){var t=E.useRef(zc),n=E.useRef(Ft),o=Se(function(){return{eventName:"mousedown",fn:function(m){if(!m.defaultPrevented&&m.button===Gc&&!(m.ctrlKey||m.metaKey||m.shiftKey||m.altKey)){var p=e.findClosestDraggableId(m);if(p){var f=e.tryGetLock(p,i,{sourceEvent:m});if(f){m.preventDefault();var g={x:m.clientX,y:m.clientY};n.current(),d(f,g)}}}}}},[e]),a=Se(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(m){if(!m.defaultPrevented){var p=e.findClosestDraggableId(m);if(p){var f=e.findOptionsForDraggable(p);f&&(f.shouldRespectForcePress||e.canGetLock(p)&&m.preventDefault())}}}}},[e]),s=le(function(){var m={passive:!1,capture:!0};n.current=it(window,[a,o],m)},[a,o]),i=le(function(){var u=t.current;u.type!=="IDLE"&&(t.current=zc,n.current(),s())},[s]),l=le(function(){var u=t.current;i(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[i]),c=le(function(){var m={capture:!0,passive:!1},p=$b({cancel:l,completed:i,getPhase:function(){return t.current},setPhase:function(g){t.current=g}});n.current=it(window,p,m)},[l,i]),d=le(function(m,p){t.current.type!=="IDLE"&&(process.env.NODE_ENV!=="production"?P(!1,"Expected to move from IDLE to PENDING drag"):P()),t.current={type:"PENDING",point:p,actions:m},c()},[c]);tt(function(){return s(),function(){n.current()}},[s])}var Dn;function Vb(){}var Kb=(Dn={},Dn[Mb]=!0,Dn[kb]=!0,Dn[_b]=!0,Dn[Lb]=!0,Dn);function Hb(e,t){function n(){t(),e.cancel()}function o(){t(),e.drop()}return[{eventName:"keydown",fn:function(s){if(s.keyCode===Va){s.preventDefault(),n();return}if(s.keyCode===Hc){s.preventDefault(),o();return}if(s.keyCode===Rb){s.preventDefault(),e.moveDown();return}if(s.keyCode===Ob){s.preventDefault(),e.moveUp();return}if(s.keyCode===Bb){s.preventDefault(),e.moveRight();return}if(s.keyCode===Pb){s.preventDefault(),e.moveLeft();return}if(Kb[s.keyCode]){s.preventDefault();return}Wc(s)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Uo,fn:n}]}function Yc(e){var t=E.useRef(Vb),n=Se(function(){return{eventName:"keydown",fn:function(s){if(s.defaultPrevented||s.keyCode!==Hc)return;var i=e.findClosestDraggableId(s);if(!i)return;var l=e.tryGetLock(i,u,{sourceEvent:s});if(!l)return;s.preventDefault();var c=!0,d=l.snapLift();t.current();function u(){c||(process.env.NODE_ENV!=="production"?P(!1,"Cannot stop capturing a keyboard drag when not capturing"):P()),c=!1,t.current(),o()}t.current=it(window,Hb(d,u),{capture:!0,passive:!1})}}},[e]),o=le(function(){var s={passive:!1,capture:!0};t.current=it(window,[n],s)},[n]);tt(function(){return o(),function(){t.current()}},[o])}var Ka={type:"IDLE"},Wb=120,Gb=.15;function Ub(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(a){a.preventDefault()}},{eventName:"keydown",fn:function(a){if(n().type!=="DRAGGING"){t();return}a.keyCode===Va&&a.preventDefault(),t()}},{eventName:Uo,fn:t}]}function zb(e){var t=e.cancel,n=e.completed,o=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(s){var i=o();if(i.type!=="DRAGGING"){t();return}i.hasMoved=!0;var l=s.touches[0],c=l.clientX,d=l.clientY,u={x:c,y:d};s.preventDefault(),i.actions.move(u)}},{eventName:"touchend",fn:function(s){var i=o();if(i.type!=="DRAGGING"){t();return}s.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),n()}},{eventName:"touchcancel",fn:function(s){if(o().type!=="DRAGGING"){t();return}s.preventDefault(),t()}},{eventName:"touchforcechange",fn:function(s){var i=o();i.type==="IDLE"&&(process.env.NODE_ENV,P());var l=s.touches[0];if(l){var c=l.force>=Gb;if(c){var d=i.actions.shouldRespectForcePress();if(i.type==="PENDING"){d&&t();return}if(d){if(i.hasMoved){s.preventDefault();return}t();return}s.preventDefault()}}}},{eventName:Uo,fn:t}]}function qc(e){var t=E.useRef(Ka),n=E.useRef(Ft),o=le(function(){return t.current},[]),a=le(function(f){t.current=f},[]),s=Se(function(){return{eventName:"touchstart",fn:function(f){if(!f.defaultPrevented){var g=e.findClosestDraggableId(f);if(g){var v=e.tryGetLock(g,l,{sourceEvent:f});if(v){var y=f.touches[0],b=y.clientX,h=y.clientY,I={x:b,y:h};n.current(),m(v,I)}}}}}},[e]),i=le(function(){var f={capture:!0,passive:!1};n.current=it(window,[s],f)},[s]),l=le(function(){var p=t.current;p.type!=="IDLE"&&(p.type==="PENDING"&&clearTimeout(p.longPressTimerId),a(Ka),n.current(),i())},[i,a]),c=le(function(){var p=t.current;l(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[l]),d=le(function(){var f={capture:!0,passive:!1},g={cancel:c,completed:l,getPhase:o},v=it(window,zb(g),f),y=it(window,Ub(g),f);n.current=function(){v(),y()}},[c,o,l]),u=le(function(){var f=o();f.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot start dragging from phase "+f.type):P());var g=f.actions.fluidLift(f.point);a({type:"DRAGGING",actions:g,hasMoved:!1})},[o,a]),m=le(function(f,g){o().type!=="IDLE"&&(process.env.NODE_ENV!=="production"?P(!1,"Expected to move from IDLE to PENDING drag"):P());var v=setTimeout(u,Wb);a({type:"PENDING",point:g,actions:f,longPressTimerId:v}),d()},[d,o,a,u]);tt(function(){return i(),function(){n.current();var g=o();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),a(Ka))}},[o,i,a]),tt(function(){var f=it(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return f},[])}function jb(e){Aa(function(){var t=$a(e);ro(function(){t.current.length!==e.length&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot change the amount of sensor hooks after mounting"):P(!1))})})}var Yb={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Jc(e,t){if(t==null)return!1;var n=!!Yb[t.tagName.toLowerCase()];if(n)return!0;var o=t.getAttribute("contenteditable");return o==="true"||o===""?!0:t===e?!1:Jc(e,t.parentElement)}function qb(e,t){var n=t.target;return no(n)?Jc(e,n):!1}var Jb=(function(e){return St(e.getBoundingClientRect()).center});function Xb(e){return e instanceof Ac(e).Element}var Zb=(function(){var e="matches";if(typeof document>"u")return e;var t=[e,"msMatchesSelector","webkitMatchesSelector"],n=$t(t,function(o){return o in Element.prototype});return n||e})();function Xc(e,t){return e==null?null:e[Zb](t)?e:Xc(e.parentElement,t)}function Qb(e,t){return e.closest?e.closest(t):Xc(e,t)}function ev(e){return"["+Cn.contextId+'="'+e+'"]'}function tv(e,t){var n=t.target;if(!Xb(n))return process.env.NODE_ENV!=="production"&&Ce("event.target must be a Element"),null;var o=ev(e),a=Qb(n,o);return a?no(a)?a:(process.env.NODE_ENV!=="production"&&Ce("drag handle must be a HTMLElement"),null):null}function nv(e,t){var n=tv(e,t);return n?n.getAttribute(Cn.draggableId):null}function ov(e,t){var n="["+Pa.contextId+'="'+e+'"]',o=Gl(document.querySelectorAll(n)),a=$t(o,function(s){return s.getAttribute(Pa.id)===t});return a?no(a)?a:(process.env.NODE_ENV!=="production"&&Ce("Draggable element is not a HTMLElement"),null):null}function rv(e){e.preventDefault()}function zo(e){var t=e.expected,n=e.phase,o=e.isLockActive,a=e.shouldWarn;return o()?t!==n?(a&&process.env.NODE_ENV!=="production"&&Ce(`
|
|
472
472
|
Cannot perform action.
|
|
473
473
|
The actions you used belong to an outdated phase
|
|
474
474
|
|
|
@@ -486,7 +486,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
486
486
|
|
|
487
487
|
- Throw away your action handlers when forceStop() is called
|
|
488
488
|
- Check actions.isActive() if you really need to
|
|
489
|
-
`),!1)}function
|
|
489
|
+
`),!1)}function Zc(e){var t=e.lockAPI,n=e.store,o=e.registry,a=e.draggableId;if(t.isClaimed())return!1;var s=o.draggable.findById(a);return s?!(!s.options.isEnabled||!Ic(n.getState(),a)):(process.env.NODE_ENV!=="production"&&Ce("Unable to find draggable with id: "+a),!1)}function av(e){var t=e.lockAPI,n=e.contextId,o=e.store,a=e.registry,s=e.draggableId,i=e.forceSensorStop,l=e.sourceEvent,c=Zc({lockAPI:t,store:o,registry:a,draggableId:s});if(!c)return null;var d=a.draggable.getById(s),u=ov(n,d.descriptor.id);if(!u)return process.env.NODE_ENV!=="production"&&Ce("Unable to find draggable element with id: "+s),null;if(l&&!d.options.canDragInteractiveElements&&qb(u,l))return null;var m=t.claim(i||Ft),p="PRE_DRAG";function f(){return d.options.shouldRespectForcePress}function g(){return t.isActive(m)}function v(L,$){zo({expected:L,phase:p,isLockActive:g,shouldWarn:!0})&&o.dispatch($())}var y=v.bind(null,"DRAGGING");function b(L){function $(){t.release(),p="COMPLETED"}p!=="PRE_DRAG"&&($(),p!=="PRE_DRAG"&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot lift in phase "+p):P())),o.dispatch(jg(L.liftActionArgs)),p="DRAGGING";function O(_,R){if(R===void 0&&(R={shouldBlockNextClick:!1}),L.cleanup(),R.shouldBlockNextClick){var H=it(window,[{eventName:"click",fn:rv,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(H)}$(),o.dispatch(hc({reason:_}))}return ce({isActive:function(){return zo({expected:"DRAGGING",phase:p,isLockActive:g,shouldWarn:!1})},shouldRespectForcePress:f,drop:function(R){return O("DROP",R)},cancel:function(R){return O("CANCEL",R)}},L.actions)}function h(L){var $=Hn(function(_){y(function(){return gc({client:_})})}),O=b({liftActionArgs:{id:s,clientSelection:L,movementMode:"FLUID"},cleanup:function(){return $.cancel()},actions:{move:$}});return ce({},O,{move:$})}function I(){var L={moveUp:function(){return y(nh)},moveRight:function(){return y(rh)},moveDown:function(){return y(oh)},moveLeft:function(){return y(ah)}};return b({liftActionArgs:{id:s,clientSelection:Jb(u),movementMode:"SNAP"},cleanup:Ft,actions:L})}function C(){var L=zo({expected:"PRE_DRAG",phase:p,isLockActive:g,shouldWarn:!0});L&&t.release()}var D={isActive:function(){return zo({expected:"PRE_DRAG",phase:p,isLockActive:g,shouldWarn:!1})},shouldRespectForcePress:f,fluidLift:h,snapLift:I,abort:C};return D}var sv=[jc,Yc,qc];function iv(e){var t=e.contextId,n=e.store,o=e.registry,a=e.customSensors,s=e.enableDefaultSensors,i=[].concat(s?sv:[],a||[]),l=E.useState(function(){return Nb()})[0],c=le(function(h,I){h.isDragging&&!I.isDragging&&l.tryAbandon()},[l]);tt(function(){var h=n.getState(),I=n.subscribe(function(){var C=n.getState();c(h,C),h=C});return I},[l,n,c]),tt(function(){return l.tryAbandon},[l.tryAbandon]);var d=le(function(b){return Zc({lockAPI:l,registry:o,store:n,draggableId:b})},[l,o,n]),u=le(function(b,h,I){return av({lockAPI:l,registry:o,contextId:t,store:n,draggableId:b,forceSensorStop:h,sourceEvent:I&&I.sourceEvent?I.sourceEvent:null})},[t,l,o,n]),m=le(function(b){return nv(t,b)},[t]),p=le(function(b){var h=o.draggable.findById(b);return h?h.options:null},[o.draggable]),f=le(function(){l.isClaimed()&&(l.tryAbandon(),n.getState().phase!=="IDLE"&&n.dispatch(Ea()))},[l,n]),g=le(l.isClaimed,[l]),v=Se(function(){return{canGetLock:d,tryGetLock:u,findClosestDraggableId:m,findOptionsForDraggable:p,tryReleaseLock:f,isLockClaimed:g}},[d,u,m,p,f,g]);jb(i);for(var y=0;y<i.length;y++)i[y](v)}var lv=function(t){return{onBeforeCapture:t.onBeforeCapture,onBeforeDragStart:t.onBeforeDragStart,onDragStart:t.onDragStart,onDragEnd:t.onDragEnd,onDragUpdate:t.onDragUpdate}};function ao(e){return e.current||(process.env.NODE_ENV!=="production"?P(!1,"Could not find store from lazy ref"):P()),e.current}function cv(e){var t=e.contextId,n=e.setCallbacks,o=e.sensors,a=e.nonce,s=e.dragHandleUsageInstructions,i=E.useRef(null);Db();var l=$a(e),c=le(function(){return lv(l.current)},[l]),d=Sb(t),u=vb({contextId:t,text:s}),m=cb(t,a),p=le(function(_){ao(i).dispatch(_)},[]),f=Se(function(){return Zi({publishWhileDragging:qg,updateDroppableScroll:Xg,updateDroppableIsEnabled:Zg,updateDroppableIsCombineEnabled:Qg,collectionStarting:Jg},p)},[p]),g=ub(),v=Se(function(){return Kh(g,f)},[g,f]),y=Se(function(){return rb(ce({scrollWindow:Hh,scrollDroppable:v.scrollDroppable},Zi({move:gc},p)))},[v.scrollDroppable,p]),b=db(t),h=Se(function(){return Fh({announce:d,autoScroller:y,dimensionMarshal:v,focusMarshal:b,getResponders:c,styleMarshal:m})},[d,y,v,b,c,m]);process.env.NODE_ENV!=="production"&&i.current&&i.current!==h&&process.env.NODE_ENV!=="production"&&Ce("unexpected store change"),i.current=h;var I=le(function(){var _=ao(i),R=_.getState();R.phase!=="IDLE"&&_.dispatch(Ea())},[]),C=le(function(){var _=ao(i).getState();return _.isDragging||_.phase==="DROP_ANIMATING"},[]),D=Se(function(){return{isDragging:C,tryAbort:I}},[C,I]);n(D);var L=le(function(_){return Ic(ao(i).getState(),_)},[]),$=le(function(){return en(ao(i).getState())},[]),O=Se(function(){return{marshal:v,focus:b,contextId:t,canLift:L,isMovementAllowed:$,dragHandleUsageInstructionsId:u,registry:g}},[t,v,u,b,L,$,g]);return iv({contextId:t,store:h,registry:g,customSensors:o,enableDefaultSensors:e.enableDefaultSensors!==!1}),E.useEffect(function(){return I},[I]),E.createElement(Wo.Provider,{value:O},E.createElement(Sl,{context:Ba,store:h},e.children))}var Qc=0;function dv(){Qc=0}function pv(){return Se(function(){return""+Qc++},[])}function uv(){dv(),hb()}function ed(e){var t=pv(),n=e.dragHandleUsageInstructions||Bo.dragHandleUsageInstructions;return E.createElement(RS,null,function(o){return E.createElement(cv,{nonce:e.nonce,contextId:t,setCallbacks:o,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)})}var Ha=function(t){return function(n){return t===n}},mv=Ha("scroll"),fv=Ha("auto"),Sv=Ha("visible"),td=function(t,n){return n(t.overflowX)||n(t.overflowY)},gv=function(t,n){return n(t.overflowX)&&n(t.overflowY)},nd=function(t){var n=window.getComputedStyle(t),o={overflowX:n.overflowX,overflowY:n.overflowY};return td(o,mv)||td(o,fv)},hv=function(){if(process.env.NODE_ENV==="production")return!1;var t=oo(),n=document.documentElement;if(n||(process.env.NODE_ENV,P()),!nd(t))return!1;var o=window.getComputedStyle(n),a={overflowX:o.overflowX,overflowY:o.overflowY};return gv(a,Sv)||process.env.NODE_ENV!=="production"&&Ce(`
|
|
490
490
|
We have detected that your <body> element might be a scroll container.
|
|
491
491
|
We have found no reliable way of detecting whether the <body> element is a scroll container.
|
|
492
492
|
Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)
|
|
@@ -495,25 +495,25 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
495
495
|
we will be treating the <body> as *not* a scroll container
|
|
496
496
|
|
|
497
497
|
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/how-we-detect-scroll-containers.md
|
|
498
|
-
`),!1},
|
|
498
|
+
`),!1},od=function e(t){return t==null?null:t===document.body?hv()?t:null:t===document.documentElement?null:nd(t)?t:e(t.parentElement)},bv=(function(e){if(e){var t=od(e.parentElement);t&&process.env.NODE_ENV!=="production"&&Ce(`
|
|
499
499
|
Droppable: unsupported nested scroll container detected.
|
|
500
500
|
A Droppable can only have one scroll parent (which can be itself)
|
|
501
501
|
Nested scroll containers are currently not supported.
|
|
502
502
|
|
|
503
503
|
We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131
|
|
504
|
-
`)}}),
|
|
504
|
+
`)}}),Wa=(function(e){return{x:e.scrollLeft,y:e.scrollTop}}),vv=function e(t){if(!t)return!1;var n=window.getComputedStyle(t);return n.position==="fixed"?!0:e(t.parentElement)},yv=(function(e){var t=od(e),n=vv(e);return{closestScrollable:t,isFixedOnPage:n}}),Ev=(function(e){var t=e.descriptor,n=e.isEnabled,o=e.isCombineEnabled,a=e.isFixedOnPage,s=e.direction,i=e.client,l=e.page,c=e.closest,d=(function(){if(!c)return null;var f=c.scrollSize,g=c.client,v=wc({scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,height:g.paddingBox.height,width:g.paddingBox.width});return{pageMarginBox:c.page.marginBox,frameClient:g,scrollSize:f,shouldClipSubject:c.shouldClipSubject,scroll:{initial:c.scroll,current:c.scroll,max:v,diff:{value:Oe,displacement:Oe}}}})(),u=s==="vertical"?ua:ql,m=En({page:l,withPlaceholder:null,axis:u,frame:d}),p={descriptor:t,isCombineEnabled:o,isFixedOnPage:a,axis:u,isEnabled:n,client:i,page:l,frame:d,subject:m};return p}),Tv=function(t,n){var o=Pl(t);if(!n||t!==n)return o;var a=o.paddingBox.top-n.scrollTop,s=o.paddingBox.left-n.scrollLeft,i=a+n.scrollHeight,l=s+n.scrollWidth,c={top:a,right:l,bottom:i,left:s},d=aa(c,o.border),u=ia({borderBox:d,margin:o.margin,border:o.border,padding:o.padding});return u},wv=(function(e){var t=e.ref,n=e.descriptor,o=e.env,a=e.windowScroll,s=e.direction,i=e.isDropDisabled,l=e.isCombineEnabled,c=e.shouldClipSubject,d=o.closestScrollable,u=Tv(t,d),m=Po(u,a),p=(function(){if(!d)return null;var g=Pl(d),v={scrollHeight:d.scrollHeight,scrollWidth:d.scrollWidth};return{client:g,page:Po(g,a),scroll:Wa(d),scrollSize:v,shouldClipSubject:c}})(),f=Ev({descriptor:n,isEnabled:!i,isCombineEnabled:l,isFixedOnPage:o.isFixedOnPage,direction:s,client:u,page:m,closest:p});return f}),Cv={passive:!1},Dv={passive:!0},rd=(function(e){return e.shouldPublishImmediately?Cv:Dv});function jo(e){var t=E.useContext(e);return t||(process.env.NODE_ENV!=="production"?P(!1,"Could not find required context"):P()),t}var Yo=function(t){return t&&t.env.closestScrollable||null};function Nv(e){var t=E.useRef(null),n=jo(Wo),o=Ra("droppable"),a=n.registry,s=n.marshal,i=$a(e),l=Se(function(){return{id:e.droppableId,type:e.type,mode:e.mode}},[e.droppableId,e.mode,e.type]),c=E.useRef(l),d=Se(function(){return Pe(function(C,D){t.current||(process.env.NODE_ENV!=="production"?P(!1,"Can only update scroll when dragging"):P());var L={x:C,y:D};s.updateDroppableScroll(l.id,L)})},[l.id,s]),u=le(function(){var C=t.current;return!C||!C.env.closestScrollable?Oe:Wa(C.env.closestScrollable)},[]),m=le(function(){var C=u();d(C.x,C.y)},[u,d]),p=Se(function(){return Hn(m)},[m]),f=le(function(){var C=t.current,D=Yo(C);C&&D||(process.env.NODE_ENV!=="production"?P(!1,"Could not find scroll options while scrolling"):P());var L=C.scrollOptions;if(L.shouldPublishImmediately){m();return}p()},[p,m]),g=le(function(C,D){t.current&&(process.env.NODE_ENV!=="production"?P(!1,"Cannot collect a droppable while a drag is occurring"):P());var L=i.current,$=L.getDroppableRef();$||(process.env.NODE_ENV!=="production"?P(!1,"Cannot collect without a droppable ref"):P());var O=yv($),_={ref:$,descriptor:l,env:O,scrollOptions:D};t.current=_;var R=wv({ref:$,descriptor:l,env:O,windowScroll:C,direction:L.direction,isDropDisabled:L.isDropDisabled,isCombineEnabled:L.isCombineEnabled,shouldClipSubject:!L.ignoreContainerClipping}),H=O.closestScrollable;return H&&(H.setAttribute(Rc.contextId,n.contextId),H.addEventListener("scroll",f,rd(_.scrollOptions)),process.env.NODE_ENV!=="production"&&bv(H)),R},[n.contextId,l,f,i]),v=le(function(){var C=t.current,D=Yo(C);return C&&D||(process.env.NODE_ENV!=="production"?P(!1,"Can only recollect Droppable client for Droppables that have a scroll container"):P()),Wa(D)},[]),y=le(function(){var C=t.current;C||(process.env.NODE_ENV!=="production"?P(!1,"Cannot stop drag when no active drag"):P());var D=Yo(C);t.current=null,D&&(p.cancel(),D.removeAttribute(Rc.contextId),D.removeEventListener("scroll",f,rd(C.scrollOptions)))},[f,p]),b=le(function(C){var D=t.current;D||(process.env.NODE_ENV!=="production"?P(!1,"Cannot scroll when there is no drag"):P());var L=Yo(D);L||(process.env.NODE_ENV!=="production"?P(!1,"Cannot scroll a droppable with no closest scrollable"):P()),L.scrollTop+=C.y,L.scrollLeft+=C.x},[]),h=Se(function(){return{getDimensionAndWatchScroll:g,getScrollWhileDragging:v,dragStopped:y,scroll:b}},[y,g,v,b]),I=Se(function(){return{uniqueId:o,descriptor:l,callbacks:h}},[h,l,o]);tt(function(){return c.current=I.descriptor,a.droppable.register(I),function(){t.current&&(process.env.NODE_ENV!=="production"&&Ce("Unsupported: changing the droppableId or type of a Droppable during a drag"),y()),a.droppable.unregister(I)}},[h,l,y,I,s,a.droppable]),tt(function(){t.current&&s.updateDroppableIsEnabled(c.current.id,!e.isDropDisabled)},[e.isDropDisabled,s]),tt(function(){t.current&&s.updateDroppableIsCombineEnabled(c.current.id,e.isCombineEnabled)},[e.isCombineEnabled,s])}function Ga(){}var ad={width:0,height:0,margin:HS},Iv=function(t){var n=t.isAnimatingOpenOnMount,o=t.placeholder,a=t.animate;return n||a==="close"?ad:{height:o.client.borderBox.height,width:o.client.borderBox.width,margin:o.client.margin}},xv=function(t){var n=t.isAnimatingOpenOnMount,o=t.placeholder,a=t.animate,s=Iv({isAnimatingOpenOnMount:n,placeholder:o,animate:a});return{display:o.display,boxSizing:"border-box",width:s.width,height:s.height,marginTop:s.margin.top,marginRight:s.margin.right,marginBottom:s.margin.bottom,marginLeft:s.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:a!=="none"?Qn.placeholder:null}};function kv(e){var t=E.useRef(null),n=le(function(){t.current&&(clearTimeout(t.current),t.current=null)},[]),o=e.animate,a=e.onTransitionEnd,s=e.onClose,i=e.contextId,l=E.useState(e.animate==="open"),c=l[0],d=l[1];E.useEffect(function(){return c?o!=="open"?(n(),d(!1),Ga):t.current?Ga:(t.current=setTimeout(function(){t.current=null,d(!1)}),n):Ga},[o,c,n]);var u=le(function(p){p.propertyName==="height"&&(a(),o==="close"&&s())},[o,s,a]),m=xv({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return E.createElement(e.placeholder.tagName,{style:m,"data-rbd-placeholder-context-id":i,onTransitionEnd:u,ref:e.innerRef})}var Mv=E.memo(kv),Ua=E.createContext(null);function sd(e){e&&no(e)||(process.env.NODE_ENV!=="production"?P(!1,`
|
|
505
505
|
provided.innerRef has not been provided with a HTMLElement.
|
|
506
506
|
|
|
507
507
|
You can find a guide on using the innerRef callback functions at:
|
|
508
508
|
https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md
|
|
509
|
-
`):P())}function
|
|
509
|
+
`):P())}function za(e){return typeof e=="boolean"}function ja(e,t){t.forEach(function(n){return n(e)})}var Lv=[function(t){var n=t.props;n.droppableId||(process.env.NODE_ENV!=="production"?P(!1,"A Droppable requires a droppableId prop"):P()),typeof n.droppableId!="string"&&(process.env.NODE_ENV!=="production"?P(!1,"A Droppable requires a [string] droppableId. Provided: ["+typeof n.droppableId+"]"):P())},function(t){var n=t.props;za(n.isDropDisabled)||(process.env.NODE_ENV!=="production"?P(!1,"isDropDisabled must be a boolean"):P()),za(n.isCombineEnabled)||(process.env.NODE_ENV!=="production"?P(!1,"isCombineEnabled must be a boolean"):P()),za(n.ignoreContainerClipping)||(process.env.NODE_ENV!=="production"?P(!1,"ignoreContainerClipping must be a boolean"):P())},function(t){var n=t.getDroppableRef;sd(n())}],_v=[function(t){var n=t.props,o=t.getPlaceholderRef;if(n.placeholder){var a=o();a||process.env.NODE_ENV!=="production"&&Ce(`
|
|
510
510
|
Droppable setup issue [droppableId: "`+n.droppableId+`"]:
|
|
511
511
|
DroppableProvided > placeholder could not be found.
|
|
512
512
|
|
|
513
513
|
Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.
|
|
514
514
|
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/api/droppable.md
|
|
515
|
-
`)}}],
|
|
516
|
-
Provided: [type: `+typeof a+"] (value: "+a+")"):P(!1)),GS(e.index)||(process.env.NODE_ENV!=="production"?P(!1,o(a)+" requires an integer index prop"):P(!1)),e.mapped.type!=="DRAGGING"&&(rd(n()),e.isEnabled&&(Fc(t,a)||(process.env.NODE_ENV!=="production"?P(!1,o(a)+" Unable to find drag handle"):P(!1))))})}function Wv(e){Ra(function(){var t=E.useRef(e);no(function(){e!==t.current&&(process.env.NODE_ENV!=="production"?P(!1,"Draggable isClone prop value changed during component life"):P(!1))},[e])})}function Gv(e){e.preventDefault()}function Uv(e){var t=E.useRef(null),n=le(function(_){t.current=_},[]),o=le(function(){return t.current},[]),a=Go(Vo),s=a.contextId,i=a.dragHandleUsageInstructionsId,l=a.registry,c=Go(Wa),d=c.type,m=c.droppableId,u=Se(function(){return{id:e.draggableId,index:e.index,type:d,droppableId:m}},[e.draggableId,e.index,d,m]),p=e.children,f=e.draggableId,g=e.isEnabled,v=e.shouldRespectForcePress,y=e.canDragInteractiveElements,b=e.isClone,h=e.mapped,I=e.dropAnimationFinished;if(Hv(e,s,o),Wv(b),!b){var C=Se(function(){return{descriptor:u,registry:l,getDraggableRef:o,canDragInteractiveElements:y,shouldRespectForcePress:v,isEnabled:g}},[u,l,o,y,v,g]);Kv(C)}var D=Se(function(){return g?{tabIndex:0,role:"button","aria-describedby":i,"data-rbd-drag-handle-draggable-id":f,"data-rbd-drag-handle-context-id":s,draggable:!1,onDragStart:Gv}:null},[s,i,f,g]),L=le(function(_){h.type==="DRAGGING"&&h.dropping&&_.propertyName==="transform"&&I()},[I,h]),$=Se(function(){var _=$v(h),R=h.type==="DRAGGING"&&h.dropping?L:null,H={innerRef:n,draggableProps:{"data-rbd-draggable-context-id":s,"data-rbd-draggable-id":f,style:_,onTransitionEnd:R},dragHandleProps:D};return H},[s,D,f,h,L,n]),O=Se(function(){return{draggableId:u.id,type:u.type,source:{index:u.index,droppableId:u.droppableId}}},[u.droppableId,u.id,u.index,u.type]);return p($,h.snapshot,O)}var sd=(function(e,t){return e===t}),id=(function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null}),zv=function(t){return t.combine?t.combine.draggableId:null},jv=function(t){return t.at&&t.at.type==="COMBINE"?t.at.combine.draggableId:null};function Yv(){var e=Pe(function(a,s){return{x:a,y:s}}),t=Pe(function(a,s,i,l,c){return{isDragging:!0,isClone:s,isDropAnimating:!!c,dropAnimation:c,mode:a,draggingOver:i,combineWith:l,combineTargetFor:null}}),n=Pe(function(a,s,i,l,c,d,m){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:c,combineWith:d,mode:s,offset:a,dimension:i,forceShouldAnimate:m,snapshot:t(s,l,c,d,null)}}}),o=function(s,i){if(s.isDragging){if(s.critical.draggable.id!==i.draggableId)return null;var l=s.current.client.offset,c=s.dimensions.draggables[i.draggableId],d=et(s.impact),m=jv(s.impact),u=s.forceShouldAnimate;return n(e(l.x,l.y),s.movementMode,c,i.isClone,d,m,u)}if(s.phase==="DROP_ANIMATING"){var p=s.completed;if(p.result.draggableId!==i.draggableId)return null;var f=i.isClone,g=s.dimensions.draggables[i.draggableId],v=p.result,y=v.mode,b=id(v),h=zv(v),I=s.dropDuration,C={duration:I,curve:Ea.drop,moveTo:s.newHomeClientOffset,opacity:h?Jn.opacity.drop:null,scale:h?Jn.scale.drop:null};return{mapped:{type:"DRAGGING",offset:s.newHomeClientOffset,dimension:g,dropping:C,draggingOver:b,combineWith:h,mode:y,forceShouldAnimate:null,snapshot:t(y,f,b,h,C)}}}return null};return o}function ld(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var qv={mapped:{type:"SECONDARY",offset:Oe,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:ld(null)}};function Jv(){var e=Pe(function(i,l){return{x:i,y:l}}),t=Pe(ld),n=Pe(function(i,l,c){return l===void 0&&(l=null),{mapped:{type:"SECONDARY",offset:i,combineTargetFor:l,shouldAnimateDisplacement:c,snapshot:t(l)}}}),o=function(l){return l?n(Oe,l,!0):null},a=function(l,c,d,m){var u=d.displaced.visible[l],p=!!(m.inVirtualList&&m.effected[l]),f=Bo(d),g=f&&f.draggableId===l?c:null;if(!u){if(!p)return o(g);if(d.displaced.invisible[l])return null;var v=yn(m.displacedBy.point),y=e(v.x,v.y);return n(y,g,!0)}if(p)return o(g);var b=d.displacedBy.point,h=e(b.x,b.y);return n(h,g,u.shouldAnimate)},s=function(l,c){if(l.isDragging)return l.critical.draggable.id===c.draggableId?null:a(c.draggableId,l.critical.draggable.id,l.impact,l.afterCritical);if(l.phase==="DROP_ANIMATING"){var d=l.completed;return d.result.draggableId===c.draggableId?null:a(c.draggableId,d.result.draggableId,d.impact,d.afterCritical)}return null};return s}var Xv=function(){var t=Yv(),n=Jv(),o=function(s,i){return t(s,i)||n(s,i)||qv};return o},Zv={dropAnimationFinished:gc},Qv=Nl(Xv,Zv,null,{context:Pa,pure:!0,areStatePropsEqual:sd})(Uv);function cd(e){var t=Go(Wa),n=t.isUsingCloneFor;return n===e.draggableId&&!e.isClone?null:E.createElement(Qv,e)}function dd(e){var t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,o=!!e.shouldRespectForcePress;return E.createElement(cd,ce({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:o}))}function ey(e){var t=E.useContext(Vo);t||(process.env.NODE_ENV!=="production"?P(!1,"Could not find app context"):P());var n=t.contextId,o=t.isMovementAllowed,a=E.useRef(null),s=E.useRef(null),i=e.children,l=e.droppableId,c=e.type,d=e.mode,m=e.direction,u=e.ignoreContainerClipping,p=e.isDropDisabled,f=e.isCombineEnabled,g=e.snapshot,v=e.useClone,y=e.updateViewportMaxScroll,b=e.getContainerForClone,h=le(function(){return a.current},[]),I=le(function(Z){a.current=Z},[]),C=le(function(){return s.current},[]),D=le(function(Z){s.current=Z},[]);_v({props:e,getDroppableRef:h,getPlaceholderRef:C});var L=le(function(){o()&&y({maxScroll:wc()})},[o,y]);Cv({droppableId:l,type:c,mode:d,direction:m,isDropDisabled:p,isCombineEnabled:f,ignoreContainerClipping:u,getDroppableRef:h});var $=E.createElement(Pv,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},function(Z){var V=Z.onClose,w=Z.data,F=Z.animate;return E.createElement(xv,{placeholder:w,onClose:V,innerRef:D,animate:F,contextId:n,onTransitionEnd:L})}),O=Se(function(){return{innerRef:I,placeholder:$,droppableProps:{"data-rbd-droppable-id":l,"data-rbd-droppable-context-id":n}}},[n,l,$,I]),_=v?v.dragging.draggableId:null,R=Se(function(){return{droppableId:l,type:c,isUsingCloneFor:_}},[l,_,c]);function H(){if(!v)return null;var Z=v.dragging,V=v.render,w=E.createElement(cd,{draggableId:Z.draggableId,index:Z.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(F,B){return V(F,B,Z)});return Ln.createPortal(w,b())}return E.createElement(Wa.Provider,{value:R},i(O,g),H())}var za=function(t,n){return t===n.droppable.type},pd=function(t,n){return n.draggables[t.draggable.id]},ty=function(){var t={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},n=ce({},t,{shouldAnimatePlaceholder:!1}),o=Pe(function(i){return{draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}}}),a=Pe(function(i,l,c,d,m,u){var p=m.descriptor.id,f=m.descriptor.droppableId===i;if(f){var g=u?{render:u,dragging:o(m.descriptor)}:null,v={isDraggingOver:c,draggingOverWith:c?p:null,draggingFromThisWith:p,isUsingPlaceholder:!0};return{placeholder:m.placeholder,shouldAnimatePlaceholder:!1,snapshot:v,useClone:g}}if(!l)return n;if(!d)return t;var y={isDraggingOver:c,draggingOverWith:p,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:m.placeholder,shouldAnimatePlaceholder:!0,snapshot:y,useClone:null}}),s=function(l,c){var d=c.droppableId,m=c.type,u=!c.isDropDisabled,p=c.renderClone;if(l.isDragging){var f=l.critical;if(!za(m,f))return n;var g=pd(f,l.dimensions),v=et(l.impact)===d;return a(d,u,v,v,g,p)}if(l.phase==="DROP_ANIMATING"){var y=l.completed;if(!za(m,y.critical))return n;var b=pd(y.critical,l.dimensions);return a(d,u,id(y.result)===d,et(y.impact)===d,b,p)}if(l.phase==="IDLE"&&l.completed&&!l.shouldFlush){var h=l.completed;if(!za(m,h.critical))return n;var I=et(h.impact)===d,C=!!(h.impact.at&&h.impact.at.type==="COMBINE"),D=h.critical.droppable.id===d;return I?C?t:n:D?t:n}return n};return s},ny={updateViewportMaxScroll:Qg};function oy(){return document.body||(process.env.NODE_ENV!=="production"?P(!1,"document.body is not ready"):P()),document.body}var ry={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:oy},ja=Nl(ty,ny,null,{context:Pa,pure:!0,areStatePropsEqual:sd})(ey);ja.defaultProps=ry;const ay={disabled:"boolean",href:"string",icon:"SpsIcon",kind:"ButtonKind",spinning:"boolean",spinningTitle:"string",type:"ButtonType"};function Ne(e){const{children:t,className:n,href:o,icon:a,kind:s=A.ButtonKind.DEFAULT,spinning:i,spinningTitle:l,type:c=A.ButtonType.BUTTON,unsafelyReplaceClassName:d,...m}=e;let{disabled:u}=e;i&&(u=!0);const{t:p}=he.useWoodlandLanguage(),f=K(d||"sps-button",`sps-button--${s}`,u&&"sps-button--disabled",i&&"sps-button--spinning",n),g=a&&r.createElement("i",{className:K("sps-icon",`sps-icon-${a}`),"aria-hidden":"true"}),v=i&&r.createElement("div",{className:"sps-spinner"},l||p("button.spinningTitle"));return r.createElement("div",{className:f},o?r.createElement("a",{...m,href:o,className:"sps-button__clickable-element"},g,t,v):r.createElement("button",{...m,type:c,className:"sps-button__clickable-element",disabled:u},g,t,v))}Object.assign(Ne,{props:ay,displayName:"SpsButton"});const sy={content:"ReactNodeLike",icon:"SpsIcon",title:"string"};function ud(e){const{content:t,className:n,icon:o,title:a,"data-testid":s,unsafelyReplaceClassName:i,...l}=e,c=K(i||"sps-card__header",n);return r.createElement("div",{className:c,title:a,...l},r.createElement("div",{className:"sps-card__title"}," ",o&&r.createElement("i",{"aria-hidden":"true",className:`sps-icon sps-icon-${o}`})," ",a),r.createElement("div",{className:"sps-card__header-content"},t))}Object.assign(ud,{props:sy,displayName:"SpsCardHeader"});const iy={icon:"SpsIcon",kind:"TagKind"};function gt(e){const{children:t,className:n,icon:o,kind:a=A.TagKind.DEFAULT,"data-testid":s,unsafelyReplaceClassName:i,...l}=e,c=r.Children.toArray(t).filter(m=>typeof m=="string").join(""),d=K(i||"sps-tag",`sps-tag--${a}`,n);return r.createElement("span",{className:d,"data-testid":`${s}__tag`,title:c,...l},o&&r.createElement("i",{"aria-hidden":"true",className:`sps-icon sps-icon-${o}`,"data-testid":`${s}__icon`}),t)}Object.assign(gt,{props:iy,displayName:"SpsTag"});const ly={activateTab:"Function",active:"boolean",icon:"SpsIcon",label:"string",index:"number",tag:"string",tagKind:"TagKind",tagIcon:"SpsIcon"};function Ya(e){const{activateTab:t,active:n,children:o,className:a,label:s,icon:i,id:l,index:c=0,tag:d,tagKind:m,tagIcon:u,"data-testid":p,unsafelyReplaceClassName:f,...g}=e,v=()=>{t&&t(this,c,o)},y=h=>{(h.key==="Enter"||h.key===" "||h.key==="Spacebar")&&(h.preventDefault(),h.stopPropagation(),t&&t(this,c,o))},b=K(f||"sps-nav__item","sps-nav__link",n&&"active",a);return r.createElement("a",{className:b,onClick:v,"data-toggle":"tab",id:l,role:"tab","aria-controls":l,...g,tabIndex:0,onKeyDown:y},i&&r.createElement("i",{className:`sps-icon sps-icon-${i}`}),r.createElement("span",null,s),d&&r.createElement(gt,{kind:m||A.TagKind.KEY,icon:u},d))}Object.assign(Ya,{props:ly,displayName:"SpsCardTabbedPane"});function cy(e,t,n){const[o,a]=r.useState({index:0,content:null}),s=r.useCallback((i,l,c)=>{a({index:l,content:c})},[]);return r.useEffect(()=>{function i(d){for(const m of d){const u=m.props;a({...o,content:u.children});break}}function l(d,m){for(let u=0;u<=d.length;u+=1){const p=d[u];if(p&&p.props&&(p.props.id&&p.props.id===m||p.props.label&&p.props.label===m)){a({content:p.props.children,index:u});break}}}const c=r.Children.toArray(e);n&&t?l(c,t):n&&i(c)},[t,e]),[o,s]}const dy={activeTab:"string",footer:"ReactNodeOrRenderFn",headerContent:"ReactNodeOrRenderFn",headerIcon:"SpsIcon",headerTitle:"string"};function qa(e){r.useEffect(()=>{console.log(["App developers: There's a new card component! Update for improved performance,","fewer bugs, and increased flexibility. Reach out to the design system help Slack","channel if you have any questions!"].join(" "))},[]);const{activeTab:t,children:n,className:o,footer:a,headerContent:s,headerIcon:i,headerTitle:l,"data-testid":c,unsafelyReplaceClassName:d,...m}=e,u=r.Children.toArray(n).some(v=>r.isValidElement(v)&&v.type===Ya),[p,f]=cy(n,t,u),g=K(d||"sps-card",o);return r.createElement("div",{...m,className:g,"data-testid":`${c}__card`},(l||s)&&r.createElement(ud,{title:l,content:qe(s),icon:i,"data-testid":`${c}__header`}),u===!0?r.createElement(r.Fragment,null,r.createElement("nav",{className:"sps-nav sps-nav--tabs",role:"tablist","data-testid":`${c}__tabs`},r.Children.map(n,(v,y)=>{if(r.isValidElement(v))return r.cloneElement(v,{active:y===p.index,index:y,activateTab:f,"data-testid":`${c}__tab`})})),r.createElement("div",{className:"sps-card__body","data-testid":`${c}__body--tab-active`},p.content)):r.createElement("div",{className:"sps-card__body","data-testid":`${c}__body`},n),a&&r.createElement("div",{className:"sps-card__footer","data-testid":`${c}__footer`},qe(a)))}Object.assign(qa,{props:dy,displayName:"SpsCard"});function Ja(e,t){const[n,...o]=S.crumblePath(t);return o.length?e.members[n].get(o):e.members[n]}function py(e=[],t={}){return{validators:[],...t,_type:"Array",members:[...e],errors:null,invalid:!1,isValid(){const n=this;return!n.invalid&&n.members.every(o=>o.isValid())},isRequired(){const n=this;return n.validators&&n.validators.indexOf(ho.required)>-1},hasError(n){const o=this;return o.errors&&Object.prototype.hasOwnProperty.call(o.errors,n)},length:e.length,setInitValue(n){for(const[o,a]of this.members.entries())a.setInitValue(n[o]);return this},getValue(){return this.members.map(n=>n.getValue())},setValue(n=[]){for(const[o,a]of this.members.entries())a.setValue(n[o]);return this},update(){return this},isFocused(){return this.members.some(n=>n.isFocused())},focus(){const n=this;return n.members.length&&n.members[0].focus(),this},blur(){for(const n of this.members)n.blur();return this},isPristine(){return this.members.every(n=>n.isPristine())},markAsPristine(){for(const n of this.members)n.markAsPristine();return this},markAsDirty(){for(const n of this.members)n.markAsDirty();return this},reset(n){const o=this;o.members=[...e],o.length=e.length;for(const[a,s]of o.members.entries())n&&a<n.length?s.reset(n[a]):s.reset();return o.update(),this},get(n){return Ja(this,n)},at(n){return this.members[n]},push(n){const o=this;return o.members.push(n),o.length=o.members.length,o.update(),this},insert(n,o){const a=this;return a.members.splice(n,0,o),a.length=a.members.length,a.update(),this},removeAt(n){const o=this;return o.members.splice(n,1),o.length=o.members.length,o.update(),this},setControl(n,o){const a=this;return a.members[n]=o,a.update(),this}}}function uy(e,t={}){return{validators:[],id:We(),...t,_type:"Control",initValue:e,setInitValue(n){return this.value=n,this.initValue=n,this},value:e,getValue(){return this.value},setValue(n){return this.value=n,this.update(),this},errors:null,invalid:!1,isValid(){return!this.invalid},hasError(n){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,n)},focused:!1,isFocused(){return this.focused},pristine:!0,isPristine(){return this.pristine},isRequired(){return this.validators&&this.validators.indexOf(ho.required)>-1},update(){return this},focus(){return this.focused=!0,this.update(),this.onFocus&&this.onFocus(),this},blur(){return this.focused=!1,this.update(),this.onBlur&&this.onBlur(),this},markAsPristine(){return this.pristine=!0,this.update(),this},markAsDirty(){return this.pristine=!1,this.update(),this},reset(n=this.initValue){return this.value=n,this.pristine=!0,this.update(),this}}}function my(e={},t={}){return{validators:[],...t,_type:"Group",members:{...e},errors:null,invalid:!1,isValid(){return!this.invalid&&Object.keys(this.members).every(n=>this.members[n].isValid())},hasError(n){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,n)},setInitValue(n={}){for(const o of Object.keys(this.members))this.members[o].setInitValue(n[o]);return this},getValue(){return Object.keys(this.members).reduce((n,o)=>Object.assign(n,{[o]:this.members[o].getValue()}),{})},setValue(n={}){for(const o of Object.keys(this.members))this.members[o].setValue(n[o]);return this},update(){return this},isFocused(){return Object.keys(this.members).some(n=>this.members[n].isFocused())},focus(){const n=Object.keys(this.members);return n.length&&this.members[n[0]].focus(),this},blur(){for(const n of Object.keys(this.members))this.members[n].blur();return this},isPristine(){return Object.keys(this.members).every(n=>this.members[n].isPristine())},markAsPristine(){for(const n of Object.keys(this.members))this.members[n].markAsPristine();return this},markAsDirty(){for(const n of Object.keys(this.members))this.members[n].markAsDirty();return this},reset(n){this.members={...e};for(const o of Object.keys(this.members))n&&Object.prototype.hasOwnProperty.call(n,o)?this.members[o].reset(n[o]):this.members[o].reset();return this.update(),this},get(n){return Ja(this,n)},addControl(n,o){if(this.contains(n))throw new Error(`Form group already contains a control called "${n}".`);return this.members[n]=o,this.update(),this},removeControl(n){return delete this.members[n],this.update(),this},setControl(n,o){return this.members[n]=o,this.update(),this},contains(n){return Object.keys(this.members).indexOf(n)>-1}}}function fy(e,t){t&&e.setInitValue(t);const[n,o]=E.useState(),[a,s]=E.useState([]),[i,l]=E.useReducer(c=>{for(const d of a)for(const m of S.traversePath(c,d))m.validators&&m.validators.length&&(m.errors=bo(m.getValue(),m.validators),m.invalid=!!m.errors&&!m.pristine);return o(void 0),s([]),{...c}},e);return S.forEachNestedObject(i,(c,d)=>{d._type&&(d.update=function(){return a.push(c),s(a),n||o(window.setTimeout(l,0)),this})}),i}function Sy(e,t=null){const[n,o]=E.useState(t),a=E.useRef(()=>null);return E.useEffect(()=>{const s=()=>n;if(e.validators){const i=e.validators.indexOf(a.current);i===-1?e.validators.push(s):e.validators[i]=s,e.update(),a.current=s}},[n]),[n,o]}const md={formMeta:"SpsFormSetMeta<any>",onSubmit:"React.FormEventHandler"},ro=r.forwardRef((e,t)=>{const{children:n,onSubmit:o,formArray:a,formGroup:s,formMeta:i,...l}=e,c=s||a;function d(m){m.preventDefault(),c&&c.markAsDirty(),i&&(i.markAsDirty(),i.markAsBlurred(),i.markAsSubmitted()),o&&o(m)}return r.createElement("form",{ref:t,onSubmit:d,...l},n)});Object.assign(ro,{props:md,displayName:"SpsForm"});const fd={},gy={ideal:{label:"Ideal",examples:{ideal:{react:S.code`
|
|
515
|
+
`)}}],Pv=[function(t){var n=t.props;n.renderClone||(process.env.NODE_ENV!=="production"?P(!1,"Must provide a clone render function (renderClone) for virtual lists"):P())},function(t){var n=t.getPlaceholderRef;n()&&(process.env.NODE_ENV!=="production"?P(!1,"Expected virtual list to not have a placeholder"):P())}];function Ov(e){ro(function(){ja(e,Lv),e.props.mode==="standard"&&ja(e,_v),e.props.mode==="virtual"&&ja(e,Pv)})}var Bv=(function(e){Gi(t,e);function t(){for(var o,a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return o=e.call.apply(e,[this].concat(s))||this,o.state={isVisible:!!o.props.on,data:o.props.on,animate:o.props.shouldAnimate&&o.props.on?"open":"none"},o.onClose=function(){o.state.animate==="close"&&o.setState({isVisible:!1})},o}t.getDerivedStateFromProps=function(a,s){return a.shouldAnimate?a.on?{isVisible:!0,data:a.on,animate:"open"}:s.isVisible?{isVisible:!0,data:s.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!a.on,data:a.on,animate:"none"}};var n=t.prototype;return n.render=function(){if(!this.state.isVisible)return null;var a={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(a)},t})(E.PureComponent),id={dragging:5e3,dropAnimating:4500},Rv=function(t,n){return n?Qn.drop(n.duration):t?Qn.snap:Qn.fluid},Fv=function(t,n){return t?n?Zn.opacity.drop:Zn.opacity.combining:null},Av=function(t){return t.forceShouldAnimate!=null?t.forceShouldAnimate:t.mode==="SNAP"};function $v(e){var t=e.dimension,n=t.client,o=e.offset,a=e.combineWith,s=e.dropping,i=!!a,l=Av(e),c=!!s,d=c?Da.drop(o,i):Da.moveTo(o),u={position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:Rv(l,s),transform:d,opacity:Fv(i,c),zIndex:c?id.dropAnimating:id.dragging,pointerEvents:"none"};return u}function Vv(e){return{transform:Da.moveTo(e.offset),transition:e.shouldAnimateDisplacement?null:"none"}}function Kv(e){return e.type==="DRAGGING"?$v(e):Vv(e)}function Hv(e,t,n){n===void 0&&(n=Oe);var o=window.getComputedStyle(t),a=t.getBoundingClientRect(),s=_l(a,o),i=Po(s,n),l={client:s,tagName:t.tagName.toLowerCase(),display:o.display},c={x:s.marginBox.width,y:s.marginBox.height},d={descriptor:e,placeholder:l,displaceBy:c,client:s,page:i};return d}function Wv(e){var t=Ra("draggable"),n=e.descriptor,o=e.registry,a=e.getDraggableRef,s=e.canDragInteractiveElements,i=e.shouldRespectForcePress,l=e.isEnabled,c=Se(function(){return{canDragInteractiveElements:s,shouldRespectForcePress:i,isEnabled:l}},[s,l,i]),d=le(function(f){var g=a();return g||(process.env.NODE_ENV!=="production"?P(!1,"Cannot get dimension when no ref is set"):P()),Hv(n,g,f)},[n,a]),u=Se(function(){return{uniqueId:t,descriptor:n,options:c,getDimension:d}},[n,d,c,t]),m=E.useRef(u),p=E.useRef(!0);tt(function(){return o.draggable.register(m.current),function(){return o.draggable.unregister(m.current)}},[o.draggable]),tt(function(){if(p.current){p.current=!1;return}var f=m.current;m.current=u,o.draggable.update(u,f)},[u,o.draggable])}function Gv(e,t,n){ro(function(){function o(s){return"Draggable[id: "+s+"]: "}var a=e.draggableId;a||(process.env.NODE_ENV!=="production"?P(!1,"Draggable requires a draggableId"):P(!1)),typeof a!="string"&&(process.env.NODE_ENV!=="production"?P(!1,`Draggable requires a [string] draggableId.
|
|
516
|
+
Provided: [type: `+typeof a+"] (value: "+a+")"):P(!1)),zS(e.index)||(process.env.NODE_ENV!=="production"?P(!1,o(a)+" requires an integer index prop"):P(!1)),e.mapped.type!=="DRAGGING"&&(sd(n()),e.isEnabled&&($c(t,a)||(process.env.NODE_ENV!=="production"?P(!1,o(a)+" Unable to find drag handle"):P(!1))))})}function Uv(e){Aa(function(){var t=E.useRef(e);ro(function(){e!==t.current&&(process.env.NODE_ENV!=="production"?P(!1,"Draggable isClone prop value changed during component life"):P(!1))},[e])})}function zv(e){e.preventDefault()}function jv(e){var t=E.useRef(null),n=le(function(_){t.current=_},[]),o=le(function(){return t.current},[]),a=jo(Wo),s=a.contextId,i=a.dragHandleUsageInstructionsId,l=a.registry,c=jo(Ua),d=c.type,u=c.droppableId,m=Se(function(){return{id:e.draggableId,index:e.index,type:d,droppableId:u}},[e.draggableId,e.index,d,u]),p=e.children,f=e.draggableId,g=e.isEnabled,v=e.shouldRespectForcePress,y=e.canDragInteractiveElements,b=e.isClone,h=e.mapped,I=e.dropAnimationFinished;if(Gv(e,s,o),Uv(b),!b){var C=Se(function(){return{descriptor:m,registry:l,getDraggableRef:o,canDragInteractiveElements:y,shouldRespectForcePress:v,isEnabled:g}},[m,l,o,y,v,g]);Wv(C)}var D=Se(function(){return g?{tabIndex:0,role:"button","aria-describedby":i,"data-rbd-drag-handle-draggable-id":f,"data-rbd-drag-handle-context-id":s,draggable:!1,onDragStart:zv}:null},[s,i,f,g]),L=le(function(_){h.type==="DRAGGING"&&h.dropping&&_.propertyName==="transform"&&I()},[I,h]),$=Se(function(){var _=Kv(h),R=h.type==="DRAGGING"&&h.dropping?L:null,H={innerRef:n,draggableProps:{"data-rbd-draggable-context-id":s,"data-rbd-draggable-id":f,style:_,onTransitionEnd:R},dragHandleProps:D};return H},[s,D,f,h,L,n]),O=Se(function(){return{draggableId:m.id,type:m.type,source:{index:m.index,droppableId:m.droppableId}}},[m.droppableId,m.id,m.index,m.type]);return p($,h.snapshot,O)}var ld=(function(e,t){return e===t}),cd=(function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null}),Yv=function(t){return t.combine?t.combine.draggableId:null},qv=function(t){return t.at&&t.at.type==="COMBINE"?t.at.combine.draggableId:null};function Jv(){var e=Pe(function(a,s){return{x:a,y:s}}),t=Pe(function(a,s,i,l,c){return{isDragging:!0,isClone:s,isDropAnimating:!!c,dropAnimation:c,mode:a,draggingOver:i,combineWith:l,combineTargetFor:null}}),n=Pe(function(a,s,i,l,c,d,u){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:c,combineWith:d,mode:s,offset:a,dimension:i,forceShouldAnimate:u,snapshot:t(s,l,c,d,null)}}}),o=function(s,i){if(s.isDragging){if(s.critical.draggable.id!==i.draggableId)return null;var l=s.current.client.offset,c=s.dimensions.draggables[i.draggableId],d=et(s.impact),u=qv(s.impact),m=s.forceShouldAnimate;return n(e(l.x,l.y),s.movementMode,c,i.isClone,d,u,m)}if(s.phase==="DROP_ANIMATING"){var p=s.completed;if(p.result.draggableId!==i.draggableId)return null;var f=i.isClone,g=s.dimensions.draggables[i.draggableId],v=p.result,y=v.mode,b=cd(v),h=Yv(v),I=s.dropDuration,C={duration:I,curve:wa.drop,moveTo:s.newHomeClientOffset,opacity:h?Zn.opacity.drop:null,scale:h?Zn.scale.drop:null};return{mapped:{type:"DRAGGING",offset:s.newHomeClientOffset,dimension:g,dropping:C,draggingOver:b,combineWith:h,mode:y,forceShouldAnimate:null,snapshot:t(y,f,b,h,C)}}}return null};return o}function dd(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var Xv={mapped:{type:"SECONDARY",offset:Oe,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:dd(null)}};function Zv(){var e=Pe(function(i,l){return{x:i,y:l}}),t=Pe(dd),n=Pe(function(i,l,c){return l===void 0&&(l=null),{mapped:{type:"SECONDARY",offset:i,combineTargetFor:l,shouldAnimateDisplacement:c,snapshot:t(l)}}}),o=function(l){return l?n(Oe,l,!0):null},a=function(l,c,d,u){var m=d.displaced.visible[l],p=!!(u.inVirtualList&&u.effected[l]),f=Ao(d),g=f&&f.draggableId===l?c:null;if(!m){if(!p)return o(g);if(d.displaced.invisible[l])return null;var v=yn(u.displacedBy.point),y=e(v.x,v.y);return n(y,g,!0)}if(p)return o(g);var b=d.displacedBy.point,h=e(b.x,b.y);return n(h,g,m.shouldAnimate)},s=function(l,c){if(l.isDragging)return l.critical.draggable.id===c.draggableId?null:a(c.draggableId,l.critical.draggable.id,l.impact,l.afterCritical);if(l.phase==="DROP_ANIMATING"){var d=l.completed;return d.result.draggableId===c.draggableId?null:a(c.draggableId,d.result.draggableId,d.impact,d.afterCritical)}return null};return s}var Qv=function(){var t=Jv(),n=Zv(),o=function(s,i){return t(s,i)||n(s,i)||Xv};return o},ey={dropAnimationFinished:bc},ty=xl(Qv,ey,null,{context:Ba,pure:!0,areStatePropsEqual:ld})(jv);function pd(e){var t=jo(Ua),n=t.isUsingCloneFor;return n===e.draggableId&&!e.isClone?null:E.createElement(ty,e)}function ud(e){var t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,o=!!e.shouldRespectForcePress;return E.createElement(pd,ce({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:o}))}function ny(e){var t=E.useContext(Wo);t||(process.env.NODE_ENV!=="production"?P(!1,"Could not find app context"):P());var n=t.contextId,o=t.isMovementAllowed,a=E.useRef(null),s=E.useRef(null),i=e.children,l=e.droppableId,c=e.type,d=e.mode,u=e.direction,m=e.ignoreContainerClipping,p=e.isDropDisabled,f=e.isCombineEnabled,g=e.snapshot,v=e.useClone,y=e.updateViewportMaxScroll,b=e.getContainerForClone,h=le(function(){return a.current},[]),I=le(function(Z){a.current=Z},[]),C=le(function(){return s.current},[]),D=le(function(Z){s.current=Z},[]);Ov({props:e,getDroppableRef:h,getPlaceholderRef:C});var L=le(function(){o()&&y({maxScroll:Dc()})},[o,y]);Nv({droppableId:l,type:c,mode:d,direction:u,isDropDisabled:p,isCombineEnabled:f,ignoreContainerClipping:m,getDroppableRef:h});var $=E.createElement(Bv,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},function(Z){var V=Z.onClose,w=Z.data,F=Z.animate;return E.createElement(Mv,{placeholder:w,onClose:V,innerRef:D,animate:F,contextId:n,onTransitionEnd:L})}),O=Se(function(){return{innerRef:I,placeholder:$,droppableProps:{"data-rbd-droppable-id":l,"data-rbd-droppable-context-id":n}}},[n,l,$,I]),_=v?v.dragging.draggableId:null,R=Se(function(){return{droppableId:l,type:c,isUsingCloneFor:_}},[l,_,c]);function H(){if(!v)return null;var Z=v.dragging,V=v.render,w=E.createElement(pd,{draggableId:Z.draggableId,index:Z.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(F,B){return V(F,B,Z)});return Ln.createPortal(w,b())}return E.createElement(Ua.Provider,{value:R},i(O,g),H())}var Ya=function(t,n){return t===n.droppable.type},md=function(t,n){return n.draggables[t.draggable.id]},oy=function(){var t={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},n=ce({},t,{shouldAnimatePlaceholder:!1}),o=Pe(function(i){return{draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}}}),a=Pe(function(i,l,c,d,u,m){var p=u.descriptor.id,f=u.descriptor.droppableId===i;if(f){var g=m?{render:m,dragging:o(u.descriptor)}:null,v={isDraggingOver:c,draggingOverWith:c?p:null,draggingFromThisWith:p,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!1,snapshot:v,useClone:g}}if(!l)return n;if(!d)return t;var y={isDraggingOver:c,draggingOverWith:p,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:u.placeholder,shouldAnimatePlaceholder:!0,snapshot:y,useClone:null}}),s=function(l,c){var d=c.droppableId,u=c.type,m=!c.isDropDisabled,p=c.renderClone;if(l.isDragging){var f=l.critical;if(!Ya(u,f))return n;var g=md(f,l.dimensions),v=et(l.impact)===d;return a(d,m,v,v,g,p)}if(l.phase==="DROP_ANIMATING"){var y=l.completed;if(!Ya(u,y.critical))return n;var b=md(y.critical,l.dimensions);return a(d,m,cd(y.result)===d,et(y.impact)===d,b,p)}if(l.phase==="IDLE"&&l.completed&&!l.shouldFlush){var h=l.completed;if(!Ya(u,h.critical))return n;var I=et(h.impact)===d,C=!!(h.impact.at&&h.impact.at.type==="COMBINE"),D=h.critical.droppable.id===d;return I?C?t:n:D?t:n}return n};return s},ry={updateViewportMaxScroll:th};function ay(){return document.body||(process.env.NODE_ENV!=="production"?P(!1,"document.body is not ready"):P()),document.body}var sy={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ay},qa=xl(oy,ry,null,{context:Ba,pure:!0,areStatePropsEqual:ld})(ny);qa.defaultProps=sy;const iy={disabled:"boolean",href:"string",icon:"SpsIcon",kind:"ButtonKind",spinning:"boolean",spinningTitle:"string",type:"ButtonType"};function Ne(e){const{children:t,className:n,href:o,icon:a,kind:s=A.ButtonKind.DEFAULT,spinning:i,spinningTitle:l,type:c=A.ButtonType.BUTTON,unsafelyReplaceClassName:d,...u}=e;let{disabled:m}=e;i&&(m=!0);const{t:p}=he.useWoodlandLanguage(),f=K(d||"sps-button",`sps-button--${s}`,m&&"sps-button--disabled",i&&"sps-button--spinning",n),g=a&&r.createElement("i",{className:K("sps-icon",`sps-icon-${a}`),"aria-hidden":"true"}),v=i&&r.createElement("div",{className:"sps-spinner"},l||p("button.spinningTitle"));return r.createElement("div",{className:f},o?r.createElement("a",{...u,href:o,className:"sps-button__clickable-element"},g,t,v):r.createElement("button",{...u,type:c,className:"sps-button__clickable-element",disabled:m},g,t,v))}Object.assign(Ne,{props:iy,displayName:"SpsButton"});const ly={content:"ReactNodeLike",icon:"SpsIcon",title:"string"};function fd(e){const{content:t,className:n,icon:o,title:a,"data-testid":s,unsafelyReplaceClassName:i,...l}=e,c=K(i||"sps-card__header",n);return r.createElement("div",{className:c,title:a,...l},r.createElement("div",{className:"sps-card__title"}," ",o&&r.createElement("i",{"aria-hidden":"true",className:`sps-icon sps-icon-${o}`})," ",a),r.createElement("div",{className:"sps-card__header-content"},t))}Object.assign(fd,{props:ly,displayName:"SpsCardHeader"});const cy={icon:"SpsIcon",kind:"TagKind"};function gt(e){const{children:t,className:n,icon:o,kind:a=A.TagKind.DEFAULT,"data-testid":s,unsafelyReplaceClassName:i,...l}=e,c=r.Children.toArray(t).filter(u=>typeof u=="string").join(""),d=K(i||"sps-tag",`sps-tag--${a}`,n);return r.createElement("span",{className:d,"data-testid":`${s}__tag`,title:c,...l},o&&r.createElement("i",{"aria-hidden":"true",className:`sps-icon sps-icon-${o}`,"data-testid":`${s}__icon`}),t)}Object.assign(gt,{props:cy,displayName:"SpsTag"});const dy={activateTab:"Function",active:"boolean",icon:"SpsIcon",label:"string",index:"number",tag:"string",tagKind:"TagKind",tagIcon:"SpsIcon"};function Ja(e){const{activateTab:t,active:n,children:o,className:a,label:s,icon:i,id:l,index:c=0,tag:d,tagKind:u,tagIcon:m,"data-testid":p,unsafelyReplaceClassName:f,...g}=e,v=()=>{t&&t(this,c,o)},y=h=>{(h.key==="Enter"||h.key===" "||h.key==="Spacebar")&&(h.preventDefault(),h.stopPropagation(),t&&t(this,c,o))},b=K(f||"sps-nav__item","sps-nav__link",n&&"active",a);return r.createElement("a",{className:b,onClick:v,"data-toggle":"tab",id:l,role:"tab","aria-controls":l,...g,tabIndex:0,onKeyDown:y},i&&r.createElement("i",{className:`sps-icon sps-icon-${i}`}),r.createElement("span",null,s),d&&r.createElement(gt,{kind:u||A.TagKind.KEY,icon:m},d))}Object.assign(Ja,{props:dy,displayName:"SpsCardTabbedPane"});function py(e,t,n){const[o,a]=r.useState({index:0,content:null}),s=r.useCallback((i,l,c)=>{a({index:l,content:c})},[]);return r.useEffect(()=>{function i(d){for(const u of d){const m=u.props;a({...o,content:m.children});break}}function l(d,u){for(let m=0;m<=d.length;m+=1){const p=d[m];if(p&&p.props&&(p.props.id&&p.props.id===u||p.props.label&&p.props.label===u)){a({content:p.props.children,index:m});break}}}const c=r.Children.toArray(e);n&&t?l(c,t):n&&i(c)},[t,e]),[o,s]}const uy={activeTab:"string",footer:"ReactNodeOrRenderFn",headerContent:"ReactNodeOrRenderFn",headerIcon:"SpsIcon",headerTitle:"string"};function Xa(e){r.useEffect(()=>{console.log(["App developers: There's a new card component! Update for improved performance,","fewer bugs, and increased flexibility. Reach out to the design system help Slack","channel if you have any questions!"].join(" "))},[]);const{activeTab:t,children:n,className:o,footer:a,headerContent:s,headerIcon:i,headerTitle:l,"data-testid":c,unsafelyReplaceClassName:d,...u}=e,m=r.Children.toArray(n).some(v=>r.isValidElement(v)&&v.type===Ja),[p,f]=py(n,t,m),g=K(d||"sps-card",o);return r.createElement("div",{...u,className:g,"data-testid":`${c}__card`},(l||s)&&r.createElement(fd,{title:l,content:qe(s),icon:i,"data-testid":`${c}__header`}),m===!0?r.createElement(r.Fragment,null,r.createElement("nav",{className:"sps-nav sps-nav--tabs",role:"tablist","data-testid":`${c}__tabs`},r.Children.map(n,(v,y)=>{if(r.isValidElement(v))return r.cloneElement(v,{active:y===p.index,index:y,activateTab:f,"data-testid":`${c}__tab`})})),r.createElement("div",{className:"sps-card__body","data-testid":`${c}__body--tab-active`},p.content)):r.createElement("div",{className:"sps-card__body","data-testid":`${c}__body`},n),a&&r.createElement("div",{className:"sps-card__footer","data-testid":`${c}__footer`},qe(a)))}Object.assign(Xa,{props:uy,displayName:"SpsCard"});function Za(e,t){const[n,...o]=S.crumblePath(t);return o.length?e.members[n].get(o):e.members[n]}function my(e=[],t={}){return{validators:[],...t,_type:"Array",members:[...e],errors:null,invalid:!1,isValid(){const n=this;return!n.invalid&&n.members.every(o=>o.isValid())},isRequired(){const n=this;return n.validators&&n.validators.indexOf(vo.required)>-1},hasError(n){const o=this;return o.errors&&Object.prototype.hasOwnProperty.call(o.errors,n)},length:e.length,setInitValue(n){for(const[o,a]of this.members.entries())a.setInitValue(n[o]);return this},getValue(){return this.members.map(n=>n.getValue())},setValue(n=[]){for(const[o,a]of this.members.entries())a.setValue(n[o]);return this},update(){return this},isFocused(){return this.members.some(n=>n.isFocused())},focus(){const n=this;return n.members.length&&n.members[0].focus(),this},blur(){for(const n of this.members)n.blur();return this},isPristine(){return this.members.every(n=>n.isPristine())},markAsPristine(){for(const n of this.members)n.markAsPristine();return this},markAsDirty(){for(const n of this.members)n.markAsDirty();return this},reset(n){const o=this;o.members=[...e],o.length=e.length;for(const[a,s]of o.members.entries())n&&a<n.length?s.reset(n[a]):s.reset();return o.update(),this},get(n){return Za(this,n)},at(n){return this.members[n]},push(n){const o=this;return o.members.push(n),o.length=o.members.length,o.update(),this},insert(n,o){const a=this;return a.members.splice(n,0,o),a.length=a.members.length,a.update(),this},removeAt(n){const o=this;return o.members.splice(n,1),o.length=o.members.length,o.update(),this},setControl(n,o){const a=this;return a.members[n]=o,a.update(),this}}}function fy(e,t={}){return{validators:[],id:We(),...t,_type:"Control",initValue:e,setInitValue(n){return this.value=n,this.initValue=n,this},value:e,getValue(){return this.value},setValue(n){return this.value=n,this.update(),this},errors:null,invalid:!1,isValid(){return!this.invalid},hasError(n){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,n)},focused:!1,isFocused(){return this.focused},pristine:!0,isPristine(){return this.pristine},isRequired(){return this.validators&&this.validators.indexOf(vo.required)>-1},update(){return this},focus(){return this.focused=!0,this.update(),this.onFocus&&this.onFocus(),this},blur(){return this.focused=!1,this.update(),this.onBlur&&this.onBlur(),this},markAsPristine(){return this.pristine=!0,this.update(),this},markAsDirty(){return this.pristine=!1,this.update(),this},reset(n=this.initValue){return this.value=n,this.pristine=!0,this.update(),this}}}function Sy(e={},t={}){return{validators:[],...t,_type:"Group",members:{...e},errors:null,invalid:!1,isValid(){return!this.invalid&&Object.keys(this.members).every(n=>this.members[n].isValid())},hasError(n){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,n)},setInitValue(n={}){for(const o of Object.keys(this.members))this.members[o].setInitValue(n[o]);return this},getValue(){return Object.keys(this.members).reduce((n,o)=>Object.assign(n,{[o]:this.members[o].getValue()}),{})},setValue(n={}){for(const o of Object.keys(this.members))this.members[o].setValue(n[o]);return this},update(){return this},isFocused(){return Object.keys(this.members).some(n=>this.members[n].isFocused())},focus(){const n=Object.keys(this.members);return n.length&&this.members[n[0]].focus(),this},blur(){for(const n of Object.keys(this.members))this.members[n].blur();return this},isPristine(){return Object.keys(this.members).every(n=>this.members[n].isPristine())},markAsPristine(){for(const n of Object.keys(this.members))this.members[n].markAsPristine();return this},markAsDirty(){for(const n of Object.keys(this.members))this.members[n].markAsDirty();return this},reset(n){this.members={...e};for(const o of Object.keys(this.members))n&&Object.prototype.hasOwnProperty.call(n,o)?this.members[o].reset(n[o]):this.members[o].reset();return this.update(),this},get(n){return Za(this,n)},addControl(n,o){if(this.contains(n))throw new Error(`Form group already contains a control called "${n}".`);return this.members[n]=o,this.update(),this},removeControl(n){return delete this.members[n],this.update(),this},setControl(n,o){return this.members[n]=o,this.update(),this},contains(n){return Object.keys(this.members).indexOf(n)>-1}}}function gy(e,t){t&&e.setInitValue(t);const[n,o]=E.useState(),[a,s]=E.useState([]),[i,l]=E.useReducer(c=>{for(const d of a)for(const u of S.traversePath(c,d))u.validators&&u.validators.length&&(u.errors=yo(u.getValue(),u.validators),u.invalid=!!u.errors&&!u.pristine);return o(void 0),s([]),{...c}},e);return S.forEachNestedObject(i,(c,d)=>{d._type&&(d.update=function(){return a.push(c),s(a),n||o(window.setTimeout(l,0)),this})}),i}function hy(e,t=null){const[n,o]=E.useState(t),a=E.useRef(()=>null);return E.useEffect(()=>{const s=()=>n;if(e.validators){const i=e.validators.indexOf(a.current);i===-1?e.validators.push(s):e.validators[i]=s,e.update(),a.current=s}},[n]),[n,o]}const Sd={formMeta:"SpsFormSetMeta<any>",onSubmit:"React.FormEventHandler"},so=r.forwardRef((e,t)=>{const{children:n,onSubmit:o,formArray:a,formGroup:s,formMeta:i,...l}=e,c=s||a;function d(u){u.preventDefault(),c&&c.markAsDirty(),i&&(i.markAsDirty(),i.markAsBlurred(),i.markAsSubmitted()),o&&o(u)}return r.createElement("form",{ref:t,onSubmit:d,...l},n)});Object.assign(so,{props:Sd,displayName:"SpsForm"});const gd={},by={ideal:{label:"Ideal",examples:{ideal:{react:S.code`
|
|
517
517
|
import {
|
|
518
518
|
SpsForm,
|
|
519
519
|
SpsLabel,
|
|
@@ -665,7 +665,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
665
665
|
</>
|
|
666
666
|
)
|
|
667
667
|
}
|
|
668
|
-
`}}}},
|
|
668
|
+
`}}}},vy={index:"number",key:"string",columnId:"string",name:"string",value:"string",onDelete:"(columnValue: string) => void",mandatory:"boolean"};function qo(e){const{index:t,key:n,columnId:o,name:a,value:s,onDelete:i,mandatory:l,ref:c,...d}=e,{t:u}=he.useWoodlandLanguage();return r.createElement(ud,{key:o,draggableId:o||"",index:t||0,...d},m=>r.createElement("div",{ref:m.innerRef,...m.draggableProps,...m.dragHandleProps,className:"sps-content-row"},r.createElement("div",{className:"sps-content-row__col-group","data-col-value":s},r.createElement("div",{className:"sps-content-row__col sps-column-chooser__grab-col"},r.createElement("i",{className:"sps-column-chooser__drag-handle"})),r.createElement("div",{className:"sps-content-row__col--borderless"},r.createElement("div",{className:"sps-body-12"},a)),r.createElement("div",{className:"sps-content-row__col sps-column-chooser__delete-col"},!l&&r.createElement(Ne,{"aria-label":u("columnChooser.removeButton",{elementName:a,defaultValue:`Remove ${a}`}),kind:A.ButtonKind.ICON,icon:A.SpsIcon.X,onClick:()=>{i&&i(s||"")}})))))}Object.assign(qo,{props:vy,displayName:"SpsColumnChooserColumn"});const yy={maxSelectedColumns:"number | null",unselectedColumns:"ColumnProps[]",selectedColumns:"ColumnProps[]",onApplyChanges:"(selectedColumns: ColumnProps[]) => void"};function Qa(e){const{unselectedColumns:t=[],selectedColumns:n=[],maxSelectedColumns:o=8,onApplyChanges:a,maxVisibleUnselectedColumns:s,updateInitialState:i,className:l,unsafelyReplaceClassName:c,...d}=e,[u,m]=Dt({isVisible:!1,unselectedColumns:[...t.map(O=>({...O,label:O.name,columnId:We()}))],selectedColumns:[...n.map(O=>({...O,columnId:We()}))],searchSelectedColumn:null,pendingUnselectedColumns:[...t.map(O=>({...O,label:O.name,columnId:We()}))],pendingSelectedColumns:[...n.map(O=>({...O,columnId:We()}))]}),{t:p}=he.useWoodlandLanguage(),f={searchSelectedColumn:""},g=K(u.isVisible&&"sps-button--open",l),{formMeta:v,formValue:y,updateForm:b}=Mi(f);function h(O){if(O.target.value){const _=[...u.pendingSelectedColumns],R=[];u.pendingUnselectedColumns.forEach(H=>{O.target.value===H.name?(b(f),_.push({columnId:We(),name:H.name,value:H.value})):R.push(H)}),m({pendingSelectedColumns:_,pendingUnselectedColumns:R})}}function I(O){const _=[],R=[...u.pendingUnselectedColumns];u.pendingSelectedColumns.forEach(H=>{O===H.value?R.push({columnId:We(),name:H.name,value:H.value}):_.push(H)}),m({pendingSelectedColumns:_,pendingUnselectedColumns:R})}function C(O){if(!O.destination)return;const _=[...u.pendingSelectedColumns],[R]=_.splice(O.source.index,1);_.splice(O.destination.index,0,R),m({pendingSelectedColumns:_})}function D(){const O=u.pendingSelectedColumns.map(_=>{const R={..._};return R.columnId&&delete R.columnId,R});b(f),m({isVisible:!1,selectedColumns:[...u.pendingSelectedColumns],unselectedColumns:[...u.pendingUnselectedColumns]}),a&&a(O)}function L(){m({isVisible:!u.isVisible}),u.isVisible&&m({pendingSelectedColumns:[...u.selectedColumns],pendingUnselectedColumns:[...u.unselectedColumns]})}const $=r.useCallback(O=>{const _=new RegExp(O??"","i");return s?u.pendingUnselectedColumns.filter(R=>_.test(R.name)).map(R=>R.name).slice(0,s):u.pendingUnselectedColumns.map(R=>R.name)},[u.pendingUnselectedColumns,s]);return r.useEffect(()=>{i&&m({unselectedColumns:[...t.map(O=>({...O,label:O.name,columnId:We()}))],pendingUnselectedColumns:[...t.map(O=>({...O,label:O.name,columnId:We()}))]})},[t]),r.useEffect(()=>{i&&m({selectedColumns:[...n.map(O=>({...O,columnId:We()}))],pendingSelectedColumns:[...n.map(O=>({...O,columnId:We()}))]})},[n]),r.createElement("div",{className:"sps-column-chooser z-stratum-dropdown",...d},r.createElement(Ne,{className:g,"aria-label":`${u.isVisible?"Close":"Open"} Column Chooser`,kind:A.ButtonKind.ICON,icon:A.SpsIcon.TABLE,onClick:L,"data-testid":"button"}),u.isVisible&&r.createElement(Xa,{"data-testid":"open",footer:()=>r.createElement(Ne,{"aria-label":"Apply Changes",kind:A.ButtonKind.LINK,onClick:D},p("columnChooser.applyChanges",{defaultValue:"Apply Changes"}))},r.createElement("div",{className:"sps-column-chooser__search-container"},r.createElement(Nt,{suggestions:$,disabled:!!(o&&u.pendingSelectedColumns.length>=o),value:y.searchSelectedColumn?y.searchSelectedColumn:"",formMeta:v.fields.searchSelectedColumn,onChange:h,placeholder:p("columnChooser.findColumnsToAdd",{defaultValue:"Find Columns to Add"}),"data-testid":"autocomplete",disableOptionsMemoization:!0})),r.createElement("div",{className:"sps-column-chooser__selected-title"},p("columnChooser.selected",{defaultValue:"Selected"})),r.createElement(ed,{onDragEnd:C},r.createElement(qa,{droppableId:"column-chooser"},O=>r.createElement("div",{...O.droppableProps,ref:O.innerRef},u.pendingSelectedColumns.map((_,R)=>r.createElement(qo,{index:R,key:_.columnId,columnId:_.columnId,name:_.name,value:_.value,onDelete:I,mandatory:_.mandatory})),O.placeholder)))))}Object.assign(Qa,{props:yy,displayName:"SpsColumnChooser"});const hd={basic:{label:"Basic",description:"Column chooser component",examples:{basic:{react:S.code`
|
|
669
669
|
import { SpsColumnChooser } from "@spscommerce/ds-react";
|
|
670
670
|
function DemoComponent() {
|
|
671
671
|
const unselectedCols = [
|
|
@@ -684,7 +684,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
684
684
|
/>
|
|
685
685
|
);
|
|
686
686
|
}
|
|
687
|
-
`}}}},
|
|
687
|
+
`}}}},Ey={icon:{type:"SpsIcon",required:!0},size:"SpsIconSize"};function ht(e){const{className:t,"data-testid":n,icon:o,size:a=A.SpsIconSize.MEDIUM,unsafelyReplaceClassName:s,...i}=e,l=K(s||"sps-icon",`sps-icon-${o}`,`sps-icon--${a}`,e.onClick&&"interactive-icon",t);return r.createElement("i",{className:l,"aria-hidden":"true","data-testid":n,...i})}Object.assign(ht,{props:Ey,displayName:"SpsI"});const Ty={borderless:"boolean",lean:"boolean",leaner:{type:"boolean",deprecated:!0},widthPx:"number",widthRem:"number"};function nn(e){const{borderless:t,children:n,className:o,lean:a,leaner:s,style:i,unsafelyReplaceClassName:l,widthPx:c,widthRem:d,...u}=e;r.useEffect(()=>{s&&console.log(["The 'leaner' prop on SpsContentRowCol is deprecated. The padding for Content","Rows has been updated so the old 'lean' padding is the default, and the","'leaner' padding is enabled with 'lean'. This column will be displayed as","a new 'lean' column, but you should change the prop you're passing as well."].join(" "))},[s]);const m=K(l||"sps-content-row__col",t&&"sps-content-row__col--borderless",(a||s)&&"sps-content-row__col--lean",o),p=c?c/16:d,f=p?{...i,width:`${p}rem`}:i;return r.createElement("div",{...u,className:m,style:f},n)}Object.assign(nn,{props:Ty,displayName:"SpsContentRowCol"});const wy={};function Jo(e){const{children:t,className:n,"data-testid":o,unsafelyReplaceClassName:a,...s}=e,i=K(a||"sps-content-row__expansion",n);return r.createElement("div",{className:i,...s,"data-testid":`${o}__expansion`},t)}Object.assign(Jo,{props:wy,displayName:"SpsContentRowExpansion"});const Cy={alternateLayout:"boolean",initiallyExpanded:"boolean",cardSpacing:"boolean",expanded:"boolean",onBeforeCollapsed:"() => boolean",onBeforeExpanded:"() => boolean",onSelectionChange:"ChangeEventHandler",onCollapsed:"() => void",onExpanded:"() => void",selectable:"boolean",selected:"boolean"};function es(e){const{alternateLayout:t=!1,children:n,className:o,expanded:a,onBeforeCollapsed:s,onBeforeExpanded:i,onSelectionChange:l,onCollapsed:c,onExpanded:d,initiallyExpanded:u=!1,cardSpacing:m=!1,selectable:p=!1,selected:f,"data-testid":g,unsafelyReplaceClassName:v,...y}=e,{t:b}=he.useWoodlandLanguage(),[h,I]=r.useState(u),C=typeof a=="boolean"?a:h;function D(H){H.stopPropagation(),C&&(!s||s())?(I(!1),c&&c()):!C&&(!i||i())&&(I(!0),d&&d())}const L=()=>r.createElement(Jt,{checked:f,onChange:l}),$=()=>r.createElement("button",{type:"button",className:"sps-content-row__expand-btn",onClick:D,"aria-label":b(`contentRow.${C?"collapse":"expand"}`,{defaultValue:`${C?"Collapse":"Expand"}`})},r.createElement(ht,{icon:C?A.SpsIcon.MINUS_CIRCLE:A.SpsIcon.PLUS_CIRCLE})),O=K(v||"sps-content-row",C&&"sps-content-row--expanded",m&&"sps-content-row--card-spaced",f&&"sps-content-row--selected",t&&"sps-content-row--alternate-layout",o),[_,[R]]=at(n,[{type:nn},{type:Jo}]);return r.createElement("div",{className:O,"data-testid":g,...y},r.createElement("div",{className:"sps-content-row__col-group","data-testid":`${g}__children`},p&&!t&&r.createElement(nn,{widthPx:46},r.createElement(L,null)),R&&!t&&r.createElement(nn,{widthPx:44},r.createElement($,null)),R&&p&&t&&r.createElement(nn,{widthPx:46},r.createElement("section",null,r.createElement(L,null)),r.createElement("section",null,r.createElement($,null))),_),R)}Object.assign(es,{props:Cy,displayName:"SpsContentRow"});const bd={basic:{label:"Content rows",examples:{basic:{react:S.code`
|
|
688
688
|
import {
|
|
689
689
|
SpsContentRow,
|
|
690
690
|
SpsContentRowCol,
|
|
@@ -1152,7 +1152,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
1152
1152
|
</>
|
|
1153
1153
|
)
|
|
1154
1154
|
}
|
|
1155
|
-
`}}}},wy=pn.default||pn;function Cy(){return new Array(7).fill(null)}function hd(e){const t=wy({year:e.year,month:e.month-1,date:1}),n=t.weekday(),o=t.daysInMonth(),a=Math.ceil((o+n)/7),s=a*7,i=new Array(a).fill(!0).map(Cy);t.subtract(n,"days");for(let l=0;l<s;l+=1){const c=i[Math.floor(l/7)],d=l%7;c[d]=Object.freeze({year:t.year(),month:t.month()+1,date:t.date()}),d===6&&Object.freeze(c),t.add(1,"day")}return i}function bd(e){const[t,n]=r.useState(()=>hd(e));return r.useEffect(()=>{n(hd(e))},[e]),t}function vd(e){const[t,n]=r.useState(()=>j.toMoment(e));return r.useEffect(()=>n(j.toMoment(e)),[e]),t}function Yo(e){const t=e%10,n=~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}function _t(e,t,n){const o={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?o[n][0]:o[n][1]}function Dy(e){e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:_t,mm:"%d Minuten",h:_t,hh:"%d Stunden",d:_t,dd:_t,w:_t,ww:"%d Wochen",M:_t,MM:_t,y:_t,yy:_t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}function Ny(e){e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:Yo,week:{dow:0,doy:4}})}function Iy(e){e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:Yo})}function xy(e){e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:Yo,week:{dow:1,doy:4}})}function ky(e){e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:Yo,week:{dow:1,doy:4}})}function My(e){const t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(o,a){return o?/-MMM-/.test(a)?n[o.month()]:t[o.month()]:t},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}function Ly(e){e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(t,n){switch(n){case"D":return t+(t===1?"er":"");default:case"M":case"Q":case"DDD":case"d":return t+(t===1?"er":"e");case"w":case"W":return t+(t===1?"re":"e")}},week:{dow:1,doy:4}})}function _y(e){e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(t,n){switch(n){default:case"M":case"Q":case"D":case"DDD":case"d":return t+(t===1?"er":"e");case"w":case"W":return t+(t===1?"re":"e")}}})}function Py(e){e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},lastWeek:function(){return this.day()===0?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT":"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}function Oy(e){const t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_");e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(o,a){return o?/-MMM-/.test(a)?n[o.month()]:t[o.month()]:t},monthsParseExact:!0,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(o){return o+(o===1||o===8||o>=20?"ste":"de")},week:{dow:1,doy:4}})}function By(e){e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,n){return t===12&&(t=0),n==="凌晨"||n==="早上"||n==="上午"?t:n==="下午"||n==="晚上"?t+12:t>=11?t:t+12},meridiem:function(t,n){const o=t*100+n;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(t){return t.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(t){return this.week()!==t.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(t,n){switch(n){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"周";default:return String(t)}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}function Ry(e){e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,n){return t===12&&(t=0),n==="凌晨"||n==="早上"||n==="上午"?t:n==="中午"?t>=11?t:t+12:n==="下午"||n==="晚上"?t+12:t},meridiem:function(t,n){const o=t*100+n;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(t,n){switch(n){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"週";default:return String(t)}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}function Fy(e){const t=e.locale();Dy(e),Ny(e),Iy(e),xy(e),ky(e),My(e),Ly(e),_y(e),Py(e),Oy(e),By(e),Ry(e),e.locale(t)}Fy(Me);const Ay=Me.locale(),Nn=Me.locales();Nn.indexOf("en-US")===-1&&Me.defineLocale("en-US",{parentLocale:"en",longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY @ LT",LLLL:"dddd MMMM D, YYYY @ LT"}}),Nn.indexOf("en-US24")===-1&&Me.defineLocale("en-US24",{parentLocale:"en-US",longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss"}}),Nn.indexOf("en-PH")===-1&&(Me.defineLocale("en-PH",{parentLocale:"en-GB"}),Me.updateLocale("en-PH",{longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A"}})),Nn.indexOf("en-IN")===-1&&(Me.defineLocale("en-IN",{parentLocale:"en-GB"}),Me.updateLocale("en-IN",{longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",ll:"D-MMM-YYYY"}})),Nn.indexOf("en-SG")===-1&&(Me.defineLocale("en-SG",{parentLocale:"en-IN"}),Me.updateLocale("en-SG",{longDateFormat:{ll:"D MMM YYYY"}})),Nn.indexOf("en-HK")===-1&&Me.defineLocale("en-HK",{parentLocale:"en-GB"}),Me.locale(Ay);function qo(){return typeof window>"u"?"en-US":window.navigator.languages?.[0]||window.navigator.language||"en-US"}function yd(e){if(typeof Intl>"u"||typeof Intl.DateTimeFormat!="function")return!1;try{const t=e??qo();return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12===!1}catch{return!1}}function Ed(e){const t=e??qo();return Me().locale(t).locale()}const Td=r.createContext(void 0);function $y({currentUser:e,locale:t,children:n}){const o=r.useMemo(()=>({currentUser:e,locale:t}),[e,t]);return r.createElement(Td.Provider,{value:o},n)}function ao(e){const t=r.useContext(Td);return e?.preferences?.locale||e?.acting_entity?.user_info?.preferences?.locale||t?.locale||t?.currentUser?.preferences?.locale||t?.currentUser?.acting_entity?.user_info?.preferences?.locale||qo()}const Vy=pn.default||pn,ze="sps-datepicker__calendar";function so({maxDate:e,selectedDate:t,selectedRange:n}){const o=n?j.nullifyInvalidDate(n[0])||j.nullifyInvalidDate(n[1]):null;return j.nullifyInvalidDate(t)||o||j.nullifyInvalidDate(e)||j.create()}function Jo(e){const{children:t,className:n,isOpen:o,maxDate:a,minDate:s,currentUser:i,onNewSelection:l,selectedDate:c,selectedRange:d,selectedPreset:m,showTwoMonths:u=!1,"data-testid":p,...f}=e,{t:g}=he.useWoodlandLanguage(),v=ao(i),y=r.useMemo(()=>Ed(v),[v]),b=r.useMemo(()=>Vy.localeData(y).weekdaysShort(),[y]),[h,I]=r.useState(()=>so(e)),[C,D]=r.useState(j.nextMonth({...h,date:15})),L=r.useMemo(()=>j.create(),[]);r.useEffect(()=>{if(d&&d[0]&&d[1]&&d[0].month!==h.month&&d[0].month!==C.month&&d[1].month!==h.month&&d[1].month!==C.month){const N=so(e);I(N),D(j.nextMonth({month:N.month,date:15,year:N.year}))}else if(d&&d[0]&&!d[1]&&d[0].month!==h.month&&d[0].month!==C.month){const N=so(e);I(N),D(j.nextMonth({month:N.month,date:15,year:N.year}))}else if(d&&!d[0]&&d[1]&&d[1].month!==h.month&&d[1].month!==C.month){const N=so(e);I(N),D(j.nextMonth({month:N.month,date:15,year:N.year}))}else{const N=so(e);I(N),D(j.nextMonth({month:N.month,date:15,year:N.year}))}},[c,d,a,o]);const $=vd(h),O=bd(h),_=vd(C),R=bd(C),[H,Z]=r.useState();function V(){I(j.prevMonth({...h,date:15})),u&&D(j.prevMonth({...C,date:15}))}function w(){I(j.nextMonth({...h,date:15})),u&&D(j.nextMonth({...C,date:15}))}function F(N){N.target&&N.target.classList.contains(`${ze}-day`)?u&&N.target.classList.contains(`${C.month}`)?Z({...C,date:Number(N.target.textContent)}):Z({...h,date:Number(N.target.textContent)}):(!N.target||!N.target.classList.contains(`${ze}-row`))&&Z(void 0)}function B(N,T=!1){const k=`${ze}-day`;return K(`${ze}-cell`,N&&h&&N.month===h.month&&!T&&k,u&&N.month===C.month&&T&&k,j.isSameDate(L,N)&&`${k}--current-day`,(j.isSameDate(N,c)&&j.isInRange(N,[s,a])!==!1||d&&j.isSameDate(N,d[0])||j.isInRange(N,d))&&`${k}--selected`,j.isInRange(N,[s,a])===!1&&`${k}--disabled`,d&&d[1]&&j.isSameDate(N,d[0])&&!j.isSameDate(N,d[1])&&`${k}--selection-start`,j.isInRange(N,d,!1)&&`${k}--selection-middle`,d&&j.isSameDate(N,d[1])&&!j.isSameDate(N,d[0])&&`${k}--selection-end`,d&&d[0]&&!d[1]&&(!s&&!a||j.isInRange(H,[s,a]))&&j.isInRange(N,[d[0],H],!1)&&`${k}--pending-selection`,m&&m==="After"&&d&&d[0]&&d[1]===null&&(!s&&!a||j.isInRange(N,[d[0],a]))&&j.isInRange(N,[d[0],{month:12,date:31,year:3e3}],!1)&&`${k}--selected`,m&&m==="Before"&&d&&d[0]===null&&d[1]&&(!s&&!a||j.isInRange(N,[s,d[1]]))&&j.isInRange(N,[{month:1,date:1,year:1900},d[1]])&&`${k}--selected`)}function M(N){N&&h&&N.month===h.month&&j.isInRange(N,[s,a])!==!1&&l(N),N&&u&&C&&N.month===C.month&&j.isInRange(N,[s,a])!==!1&&l(N)}const q=K(ze,n);return h?r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":`${p}`,className:q,...f,onMouseOver:F},r.createElement("div",{className:`${ze}-head`},r.createElement("button",{"data-testid":`${p}_prev_month`,type:"button",tabIndex:-1,disabled:j.isSameMonth(h,s),title:g("datepicker.calendar.prevMonth",{defaultValue:"View Previous Month"}),className:"sps-datepicker__button sps-datepicker__button-previous-month",onClick:V},r.createElement("i",{className:"sps-icon sps-icon-chevron-left"})),r.createElement("span",{className:`${ze}-head-label`},r.createElement("span",{className:`${ze}-head-label-month`},$?$.clone().locale(y).format("MMMM"):""),r.createElement("span",{className:`${ze}-head-label-year`},h.year)),!u&&r.createElement("button",{type:"button","data-testid":`${p}_next_month`,tabIndex:-1,disabled:j.isSameMonth(h,a),title:g("datepicker.calendar.nextMonth",{defaultValue:"View Next Month"}),className:"sps-datepicker__button sps-datepicker__button-next-month",onClick:w},r.createElement("i",{className:"sps-icon sps-icon-chevron-right"}))),r.createElement("div",{className:`${ze}-body`},r.createElement("div",{className:"sps-datepicker__calendar-row"},b.map(N=>r.createElement("div",{key:N,className:"sps-datepicker__calendar-header-cell"},N))),O.map((N,T)=>r.createElement("div",{key:T,className:"sps-datepicker__calendar-row"},N.map((k,U)=>r.createElement("div",{key:U,className:B(k),onClick:()=>M(k),"data-testid":`${p}_${j.toString(k)}`},k?k.date:"")))))),u&&r.createElement("div",{"data-testid":`${p}`,className:q,...f,onMouseOver:F},r.createElement("div",{className:`${ze}-head`},r.createElement("span",{className:`${ze}-head-label`},r.createElement("span",{className:`${ze}-head-label-month`},_?_.clone().locale(y).format("MMMM"):""),r.createElement("span",{className:`${ze}-head-label-year`},C.year)),r.createElement("button",{type:"button","data-testid":`${p}_next_month`,tabIndex:-1,disabled:j.isSameMonth(C,a),title:g("datepicker.calendar.nextMonth",{defaultValue:"View Next Month"}),className:"sps-datepicker__button sps-datepicker__button-next-month",onClick:w},r.createElement("i",{className:"sps-icon sps-icon-chevron-right"}))),r.createElement("div",{className:`${ze}-body`},r.createElement("div",{className:"sps-datepicker__calendar-row"},b.map(N=>r.createElement("div",{key:N,className:"sps-datepicker__calendar-header-cell"},N))),R.map((N,T)=>r.createElement("div",{key:T,className:"sps-datepicker__calendar-row"},N.map((k,U)=>r.createElement("div",{key:U,className:K(B(k,!0),`${C.month.toString()}`),onClick:()=>M(k),"data-testid":`${p}_${j.toString(k)}`},k?k.date:""))))))):r.createElement(r.Fragment,null)}Object.assign(Jo,{displayName:"SpsDatepickerCalendar"});const wd="sps-datepicker__popup",Xo=r.forwardRef(({attachTo:e,children:t,className:n,isOpen:o,...a},s)=>{const i=s||r.useRef(null),l=gn("sps-datepicker-popup-portal"),c=r.useContext(rt),[d]=o?Sn(i,e,A.Position.BOTTOM_LEFT,{altPosition:Rr(A.Position.BOTTOM_LEFT),...c}):[{}],m=K(wd,"z-stratum-dropdown",o&&`${wd}--open`,n);return l(r.createElement("div",{...a,className:m,ref:i,style:d},t))});Object.assign(Xo,{displayName:"SpsDatepickerPopup"});const Ky={currentUser:"any",disabled:"boolean",formMeta:"SpsFormFieldMeta<SimpleDate>",maxDate:"SimpleDate",minDate:"SimpleDate",onChange:"(newDate: SimpleDate) => void",value:"SimpleDate",format:"string",showTwoMonths:"boolean",autoCloseOnSelect:"boolean"},Cd="sps-datepicker";function Qa({children:e,className:t,currentUser:n,disabled:o,formMeta:a,id:s,maxDate:i,minDate:l,onChange:c,value:d,format:m,showTwoMonths:u,autoCloseOnSelect:p=!0,"data-testid":f,...g}){const{wrapperId:v,controlId:y}=Ge(s,a),b=r.useRef(null),h=r.useRef(null),I=r.useRef(null),[C,D]=r.useState(j.toString(d,m)),{showPopup:L,doShowPopup:$,doHidePopup:O}=bn(b,h);function _(B){a&&(a.setValue(B),a.markAsDirty()),c&&c(B)}function R(B){_(B),D(j.toString(B,m)),I&&I.current&&I.current.focus(),p&&O()}function H(B){D(B.target.value);const M=j.createFrom(B.target.value,m);_(M)}function Z(){O(),D(""),_()}function V(B){switch(B.key){case"Tab":O();break;case"Backspace":B.target.selectionStart===0&&d&&!Array.isArray(d)&&Z();break}}const w=K(Cd,"sps-text-input",L&&`${Cd}--open`,t),F=r.useRef(!1);return r.useEffect(()=>{F.current?d?j.isValid(d)&&D(j.toString(d,m)):Z():F.current=!0},[d,m]),r.createElement(r.Fragment,null,r.createElement(Le,{id:v,className:w,formMeta:a,inputRef:I,focusInputOnClick:!0,ref:b},r.createElement("div",{className:K("sps-form-control",o&&"disabled")},r.createElement("i",{className:K("sps-text-input__icon","sps-icon","sps-icon-calendar-blank")}),r.createElement("input",{type:"text",ref:I,className:"sps-text-input__input",id:y,placeholder:m?.toUpperCase()||mn,onChange:H,onClick:$,onFocus:$,onKeyDown:V,value:C,disabled:o,"data-testid":`${f}_date_input`,...g}),d&&!o&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:Z}))),r.createElement(Xo,{isOpen:L,attachTo:b,ref:h},r.createElement(Jo,{"data-testid":`${f}_calendar`,selectedDate:d,onNewSelection:R,minDate:l,maxDate:i,showTwoMonths:u,currentUser:n})))}Object.assign(Qa,{props:Ky,displayName:"SpsDatepicker"});const Dd={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
1155
|
+
`}}}},Dy=pn.default||pn;function Ny(){return new Array(7).fill(null)}function vd(e){const t=Dy({year:e.year,month:e.month-1,date:1}),n=t.weekday(),o=t.daysInMonth(),a=Math.ceil((o+n)/7),s=a*7,i=new Array(a).fill(!0).map(Ny);t.subtract(n,"days");for(let l=0;l<s;l+=1){const c=i[Math.floor(l/7)],d=l%7;c[d]=Object.freeze({year:t.year(),month:t.month()+1,date:t.date()}),d===6&&Object.freeze(c),t.add(1,"day")}return i}function yd(e){const[t,n]=r.useState(()=>vd(e));return r.useEffect(()=>{n(vd(e))},[e]),t}function Ed(e){const[t,n]=r.useState(()=>j.toMoment(e));return r.useEffect(()=>n(j.toMoment(e)),[e]),t}function Xo(e){const t=e%10,n=~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}function _t(e,t,n){const o={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?o[n][0]:o[n][1]}function Iy(e){e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:_t,mm:"%d Minuten",h:_t,hh:"%d Stunden",d:_t,dd:_t,w:_t,ww:"%d Wochen",M:_t,MM:_t,y:_t,yy:_t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}function xy(e){e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:Xo,week:{dow:0,doy:4}})}function ky(e){e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:Xo})}function My(e){e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:Xo,week:{dow:1,doy:4}})}function Ly(e){e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:Xo,week:{dow:1,doy:4}})}function _y(e){const t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(o,a){return o?/-MMM-/.test(a)?n[o.month()]:t[o.month()]:t},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}function Py(e){e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(t,n){switch(n){case"D":return t+(t===1?"er":"");default:case"M":case"Q":case"DDD":case"d":return t+(t===1?"er":"e");case"w":case"W":return t+(t===1?"re":"e")}},week:{dow:1,doy:4}})}function Oy(e){e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(t,n){switch(n){default:case"M":case"Q":case"D":case"DDD":case"d":return t+(t===1?"er":"e");case"w":case"W":return t+(t===1?"re":"e")}}})}function By(e){e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},lastWeek:function(){return this.day()===0?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT":"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT"},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}function Ry(e){const t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_");e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(o,a){return o?/-MMM-/.test(a)?n[o.month()]:t[o.month()]:t},monthsParseExact:!0,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(o){return o+(o===1||o===8||o>=20?"ste":"de")},week:{dow:1,doy:4}})}function Fy(e){e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,n){return t===12&&(t=0),n==="凌晨"||n==="早上"||n==="上午"?t:n==="下午"||n==="晚上"?t+12:t>=11?t:t+12},meridiem:function(t,n){const o=t*100+n;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(t){return t.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(t){return this.week()!==t.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(t,n){switch(n){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"周";default:return String(t)}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}function Ay(e){e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(t,n){return t===12&&(t=0),n==="凌晨"||n==="早上"||n==="上午"?t:n==="中午"?t>=11?t:t+12:n==="下午"||n==="晚上"?t+12:t},meridiem:function(t,n){const o=t*100+n;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(t,n){switch(n){case"d":case"D":case"DDD":return t+"日";case"M":return t+"月";case"w":case"W":return t+"週";default:return String(t)}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}function $y(e){const t=e.locale();Iy(e),xy(e),ky(e),My(e),Ly(e),_y(e),Py(e),Oy(e),By(e),Ry(e),Fy(e),Ay(e),e.locale(t)}$y(Me);const Vy=Me.locale(),Nn=Me.locales();Nn.indexOf("en-US")===-1&&Me.defineLocale("en-US",{parentLocale:"en",longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY @ LT",LLLL:"dddd MMMM D, YYYY @ LT"}}),Nn.indexOf("en-US24")===-1&&Me.defineLocale("en-US24",{parentLocale:"en-US",longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss"}}),Nn.indexOf("en-PH")===-1&&(Me.defineLocale("en-PH",{parentLocale:"en-GB"}),Me.updateLocale("en-PH",{longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A"}})),Nn.indexOf("en-IN")===-1&&(Me.defineLocale("en-IN",{parentLocale:"en-GB"}),Me.updateLocale("en-IN",{longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",ll:"D-MMM-YYYY"}})),Nn.indexOf("en-SG")===-1&&(Me.defineLocale("en-SG",{parentLocale:"en-IN"}),Me.updateLocale("en-SG",{longDateFormat:{ll:"D MMM YYYY"}})),Nn.indexOf("en-HK")===-1&&Me.defineLocale("en-HK",{parentLocale:"en-GB"}),Me.locale(Vy);function Zo(){return typeof window>"u"?"en-US":window.navigator.languages?.[0]||window.navigator.language||"en-US"}function Td(e){if(typeof Intl>"u"||typeof Intl.DateTimeFormat!="function")return!1;try{const t=e??Zo();return new Intl.DateTimeFormat(t,{hour:"numeric"}).resolvedOptions().hour12===!1}catch{return!1}}function wd(e){const t=e??Zo();return Me().locale(t).locale()}const Cd=r.createContext(void 0);function Ky({currentUser:e,locale:t,children:n}){const o=r.useMemo(()=>({currentUser:e,locale:t}),[e,t]);return r.createElement(Cd.Provider,{value:o},n)}function io(e){const t=r.useContext(Cd);return e?.preferences?.locale||e?.acting_entity?.user_info?.preferences?.locale||t?.locale||t?.currentUser?.preferences?.locale||t?.currentUser?.acting_entity?.user_info?.preferences?.locale||Zo()}const Hy=pn.default||pn,ze="sps-datepicker__calendar";function lo({maxDate:e,selectedDate:t,selectedRange:n}){const o=n?j.nullifyInvalidDate(n[0])||j.nullifyInvalidDate(n[1]):null;return j.nullifyInvalidDate(t)||o||j.nullifyInvalidDate(e)||j.create()}function Qo(e){const{children:t,className:n,isOpen:o,maxDate:a,minDate:s,currentUser:i,onNewSelection:l,selectedDate:c,selectedRange:d,selectedPreset:u,showTwoMonths:m=!1,"data-testid":p,...f}=e,{t:g}=he.useWoodlandLanguage(),v=io(i),y=r.useMemo(()=>wd(v),[v]),b=r.useMemo(()=>Hy.localeData(y).weekdaysShort(),[y]),[h,I]=r.useState(()=>lo(e)),[C,D]=r.useState(j.nextMonth({...h,date:15})),L=r.useMemo(()=>j.create(),[]);r.useEffect(()=>{if(d&&d[0]&&d[1]&&d[0].month!==h.month&&d[0].month!==C.month&&d[1].month!==h.month&&d[1].month!==C.month){const N=lo(e);I(N),D(j.nextMonth({month:N.month,date:15,year:N.year}))}else if(d&&d[0]&&!d[1]&&d[0].month!==h.month&&d[0].month!==C.month){const N=lo(e);I(N),D(j.nextMonth({month:N.month,date:15,year:N.year}))}else if(d&&!d[0]&&d[1]&&d[1].month!==h.month&&d[1].month!==C.month){const N=lo(e);I(N),D(j.nextMonth({month:N.month,date:15,year:N.year}))}else{const N=lo(e);I(N),D(j.nextMonth({month:N.month,date:15,year:N.year}))}},[c,d,a,o]);const $=Ed(h),O=yd(h),_=Ed(C),R=yd(C),[H,Z]=r.useState();function V(){I(j.prevMonth({...h,date:15})),m&&D(j.prevMonth({...C,date:15}))}function w(){I(j.nextMonth({...h,date:15})),m&&D(j.nextMonth({...C,date:15}))}function F(N){N.target&&N.target.classList.contains(`${ze}-day`)?m&&N.target.classList.contains(`${C.month}`)?Z({...C,date:Number(N.target.textContent)}):Z({...h,date:Number(N.target.textContent)}):(!N.target||!N.target.classList.contains(`${ze}-row`))&&Z(void 0)}function B(N,T=!1){const k=`${ze}-day`;return K(`${ze}-cell`,N&&h&&N.month===h.month&&!T&&k,m&&N.month===C.month&&T&&k,j.isSameDate(L,N)&&`${k}--current-day`,(j.isSameDate(N,c)&&j.isInRange(N,[s,a])!==!1||d&&j.isSameDate(N,d[0])||j.isInRange(N,d))&&`${k}--selected`,j.isInRange(N,[s,a])===!1&&`${k}--disabled`,d&&d[1]&&j.isSameDate(N,d[0])&&!j.isSameDate(N,d[1])&&`${k}--selection-start`,j.isInRange(N,d,!1)&&`${k}--selection-middle`,d&&j.isSameDate(N,d[1])&&!j.isSameDate(N,d[0])&&`${k}--selection-end`,d&&d[0]&&!d[1]&&(!s&&!a||j.isInRange(H,[s,a]))&&j.isInRange(N,[d[0],H],!1)&&`${k}--pending-selection`,u&&u==="After"&&d&&d[0]&&d[1]===null&&(!s&&!a||j.isInRange(N,[d[0],a]))&&j.isInRange(N,[d[0],{month:12,date:31,year:3e3}],!1)&&`${k}--selected`,u&&u==="Before"&&d&&d[0]===null&&d[1]&&(!s&&!a||j.isInRange(N,[s,d[1]]))&&j.isInRange(N,[{month:1,date:1,year:1900},d[1]])&&`${k}--selected`)}function M(N){N&&h&&N.month===h.month&&j.isInRange(N,[s,a])!==!1&&l(N),N&&m&&C&&N.month===C.month&&j.isInRange(N,[s,a])!==!1&&l(N)}const q=K(ze,n);return h?r.createElement(r.Fragment,null,r.createElement("div",{"data-testid":`${p}`,className:q,...f,onMouseOver:F},r.createElement("div",{className:`${ze}-head`},r.createElement("button",{"data-testid":`${p}_prev_month`,type:"button",tabIndex:-1,disabled:j.isSameMonth(h,s),title:g("datepicker.calendar.prevMonth",{defaultValue:"View Previous Month"}),className:"sps-datepicker__button sps-datepicker__button-previous-month",onClick:V},r.createElement("i",{className:"sps-icon sps-icon-chevron-left"})),r.createElement("span",{className:`${ze}-head-label`},r.createElement("span",{className:`${ze}-head-label-month`},$?$.clone().locale(y).format("MMMM"):""),r.createElement("span",{className:`${ze}-head-label-year`},h.year)),!m&&r.createElement("button",{type:"button","data-testid":`${p}_next_month`,tabIndex:-1,disabled:j.isSameMonth(h,a),title:g("datepicker.calendar.nextMonth",{defaultValue:"View Next Month"}),className:"sps-datepicker__button sps-datepicker__button-next-month",onClick:w},r.createElement("i",{className:"sps-icon sps-icon-chevron-right"}))),r.createElement("div",{className:`${ze}-body`},r.createElement("div",{className:"sps-datepicker__calendar-row"},b.map(N=>r.createElement("div",{key:N,className:"sps-datepicker__calendar-header-cell"},N))),O.map((N,T)=>r.createElement("div",{key:T,className:"sps-datepicker__calendar-row"},N.map((k,U)=>r.createElement("div",{key:U,className:B(k),onClick:()=>M(k),"data-testid":`${p}_${j.toString(k)}`},k?k.date:"")))))),m&&r.createElement("div",{"data-testid":`${p}`,className:q,...f,onMouseOver:F},r.createElement("div",{className:`${ze}-head`},r.createElement("span",{className:`${ze}-head-label`},r.createElement("span",{className:`${ze}-head-label-month`},_?_.clone().locale(y).format("MMMM"):""),r.createElement("span",{className:`${ze}-head-label-year`},C.year)),r.createElement("button",{type:"button","data-testid":`${p}_next_month`,tabIndex:-1,disabled:j.isSameMonth(C,a),title:g("datepicker.calendar.nextMonth",{defaultValue:"View Next Month"}),className:"sps-datepicker__button sps-datepicker__button-next-month",onClick:w},r.createElement("i",{className:"sps-icon sps-icon-chevron-right"}))),r.createElement("div",{className:`${ze}-body`},r.createElement("div",{className:"sps-datepicker__calendar-row"},b.map(N=>r.createElement("div",{key:N,className:"sps-datepicker__calendar-header-cell"},N))),R.map((N,T)=>r.createElement("div",{key:T,className:"sps-datepicker__calendar-row"},N.map((k,U)=>r.createElement("div",{key:U,className:K(B(k,!0),`${C.month.toString()}`),onClick:()=>M(k),"data-testid":`${p}_${j.toString(k)}`},k?k.date:""))))))):r.createElement(r.Fragment,null)}Object.assign(Qo,{displayName:"SpsDatepickerCalendar"});const Dd="sps-datepicker__popup",er=r.forwardRef(({attachTo:e,children:t,className:n,isOpen:o,...a},s)=>{const i=s||r.useRef(null),l=gn("sps-datepicker-popup-portal"),c=r.useContext(rt),[d]=o?Sn(i,e,A.Position.BOTTOM_LEFT,{altPosition:$r(A.Position.BOTTOM_LEFT),...c}):[{}],u=K(Dd,"z-stratum-dropdown",o&&`${Dd}--open`,n);return l(r.createElement("div",{...a,className:u,ref:i,style:d},t))});Object.assign(er,{displayName:"SpsDatepickerPopup"});const Wy={currentUser:"any",disabled:"boolean",formMeta:"SpsFormFieldMeta<SimpleDate>",maxDate:"SimpleDate",minDate:"SimpleDate",onChange:"(newDate: SimpleDate) => void",value:"SimpleDate",format:"string",showTwoMonths:"boolean",autoCloseOnSelect:"boolean"},Nd="sps-datepicker";function ts({children:e,className:t,currentUser:n,disabled:o,formMeta:a,id:s,maxDate:i,minDate:l,onChange:c,value:d,format:u,showTwoMonths:m,autoCloseOnSelect:p=!0,"data-testid":f,...g}){const{wrapperId:v,controlId:y}=Ge(s,a),b=r.useRef(null),h=r.useRef(null),I=r.useRef(null),[C,D]=r.useState(j.toString(d,u)),{showPopup:L,doShowPopup:$,doHidePopup:O}=bn(b,h);function _(B){a&&(a.setValue(B),a.markAsDirty()),c&&c(B)}function R(B){_(B),D(j.toString(B,u)),I&&I.current&&I.current.focus(),p&&O()}function H(B){D(B.target.value);const M=j.createFrom(B.target.value,u);_(M)}function Z(){O(),D(""),_()}function V(B){switch(B.key){case"Tab":O();break;case"Backspace":B.target.selectionStart===0&&d&&!Array.isArray(d)&&Z();break}}const w=K(Nd,"sps-text-input",L&&`${Nd}--open`,t),F=r.useRef(!1);return r.useEffect(()=>{F.current?d?j.isValid(d)&&D(j.toString(d,u)):Z():F.current=!0},[d,u]),r.createElement(r.Fragment,null,r.createElement(Le,{id:v,className:w,formMeta:a,inputRef:I,focusInputOnClick:!0,ref:b},r.createElement("div",{className:K("sps-form-control",o&&"disabled")},r.createElement("i",{className:K("sps-text-input__icon","sps-icon","sps-icon-calendar-blank")}),r.createElement("input",{type:"text",ref:I,className:"sps-text-input__input",id:y,placeholder:u?.toUpperCase()||mn,onChange:H,onClick:$,onFocus:$,onKeyDown:V,value:C,disabled:o,"data-testid":`${f}_date_input`,...g}),d&&!o&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:Z}))),r.createElement(er,{isOpen:L,attachTo:b,ref:h},r.createElement(Qo,{"data-testid":`${f}_calendar`,selectedDate:d,onNewSelection:R,minDate:l,maxDate:i,showTwoMonths:m,currentUser:n})))}Object.assign(ts,{props:Wy,displayName:"SpsDatepicker"});const Id={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
1156
1156
|
import {
|
|
1157
1157
|
useSpsForm,
|
|
1158
1158
|
SpsLabel,
|
|
@@ -1369,7 +1369,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
1369
1369
|
</SpsLocaleProvider>
|
|
1370
1370
|
);
|
|
1371
1371
|
}
|
|
1372
|
-
`}}}},
|
|
1372
|
+
`}}}},Gy={currentUser:"any",disabled:"boolean",formMeta:"SpsFormFieldMeta<SimpleDateRange| null | undefined>",maxDate:"SimpleDate",minDate:"SimpleDate",onChange:'(newDateRange: SimpleDateRange | null, preset?: DatePreset["definition"]) => void',presets:"Array<DatePreset>",selectedPreset:"string",onPresetChange:"(newPreset?: string) => void",value:"SimpleDateRange | DatePreset",showTwoMonths:"boolean",format:"string"},xd="sps-datepicker",ns=[{definition:"P0D",label:"datepicker.preset.today"},{definition:"Before",label:"datepicker.preset.before"},{definition:"After",label:"datepicker.preset.after"},{definition:"P7D",label:"datepicker.preset.sevenDays"},{definition:"P30D",label:"datepicker.preset.thirtyDays"},{definition:"P60D",label:"datepicker.preset.sixtyDays"},{definition:"P90D",label:"datepicker.preset.ninetyDays"},{definition:"P1Y",label:"datepicker.preset.oneYear"}];function kd(e,t=""){return e.find(n=>n.definition===t)}function Uy(e,t){return e.length===t.length&&e.every((n,o)=>n.definition===t[o].definition&&n.label===t[o].label)}function os({children:e,className:t,currentUser:n,disabled:o,formMeta:a,id:s,maxDate:i,minDate:l,onChange:c,presets:d=ns,selectedPreset:u,onPresetChange:m,value:p,showTwoMonths:f=!1,format:g,"data-testid":v,...y}){const{t:b}=he.useWoodlandLanguage(),{wrapperId:h,controlId:I}=Ge(s,a),C=r.useRef(null),D=r.useRef(null),L=r.useRef(null),[$,O]=r.useState(Array.isArray(p)?j.toStringRange(p,g):""),[_,R]=r.useState(kd(d,u)||null),[H,Z]=r.useState(),{showPopup:V,doShowPopup:w,doHidePopup:F}=bn(C,L);function B(W,X){a&&(a.setValue(W),a.markAsDirty()),c?.(W,typeof X=="string"?X:void 0)}r.useEffect(()=>{R(kd(d,u)||null)},[u]);function M(W){return W&&/^datepicker\./.test(W.label)?b(W.label):W?.label??""}function q(W){const X=p||[];let Y,G=_;const ee=G?M(G):"";ee==="Before"?Y=[null,W]:ee==="After"?Y=[W,null]:!X[0]||X[1]||j.isBefore(W,X[0])?Y=[W,null]:Y=[X[0],W],(Y[0]&&Y[1]||ee==="Before"||ee==="After")&&(F(!0),D&&D.current&&D.current.focus()),G&&ee!=="Before"&&ee!=="After"?(R(null),m?.(),G=null):G?.definition!==u&&m?.(typeof G?.definition=="string"?G.definition:M(G)),B(Y,G?.definition),O(j.toStringRange(Y,g)),Z(void 0)}function N(W){O(W.target.value);let X=j.createRangeFrom(W.target.value,g),Y=_;const G=Y?M(Y):"";Array.isArray(X)&&(X[0]&&X[1]&&(G==="Before"||G==="After")?(R(null),Y=null):G==="Before"&&X[0]!==null?X=[null,X[0]]:G==="After"&&X[0]!==null&&(X=[X[0],null])),B(X,null),Z(void 0)}function T(){R(null),Z(void 0),O(""),B(),m?.(void 0)}function k(W){switch(W.key){case"Tab":F();break;case"Backspace":W.target.selectionStart===0&&p&&_&&T();break}}function U(W){if(m&&W?.definition!==u&&(typeof W?.definition=="string"&&(W.definition==="Before"||W.definition==="After")&&m?.(),m(typeof W?.definition=="string"?W.definition:W?M(W):"")),!W){R(null),B();return}const X=W&&M(W);let Y=j.createRangeFromPreset(W,g);const G=j.getRangeSeparator(g);(X==="Before"||X==="After")&&p&&p[0]&&p[1]?Y=j.createRangeFrom(G,g):X==="Before"?Y=j.createRangeFrom(`${G}${j.toString(p&&(p[0]||p[1]),g)}`):X==="After"&&(Y=j.createRangeFrom(`${j.toString(p&&(p[0]||p[1]),g)}${G}`));let ee=_;R(W),(JSON.stringify(p)!==JSON.stringify(Y)||JSON.stringify(ee)!==JSON.stringify(W))&&B(Y,typeof W?.definition=="string"?W.definition:M(W))}r.useEffect(()=>{if(!p||Array.isArray(p)&&!p.length){R(null);return}if(!Uy(d,ns)&&Array.isArray(p)){const W=j.toStringRange(p,g),X=d.find(Y=>W===j.toStringRange(j.createRangeFromPreset(Y,g),g));X?U(X):p[0]&&p[1]&&R(null)}},[p,g]),r.useEffect(()=>{const W=["Before","After"].includes(M(_));!p||_&&!W?O(""):Array.isArray(p)&&((!p[0]||!p[0].hasOwnProperty(_n))&&(!p[1]||!p[1].hasOwnProperty(_n))&&O(j.toStringRange(p,g)),_||Z(void 0))},[p,_,g]);const J=K(xd,"sps-text-input",V&&`${xd}--open`,t);let te=$;const ne=j.getRangeSeparator(g);return _&&M(_)==="Before"&&$.startsWith(ne)?te=$.substring(1):_&&M(_)==="After"&&$.endsWith(ne)&&(te=$.substring(0,$.length-1)),r.createElement(r.Fragment,null,r.createElement(Le,{id:h,className:J,formMeta:a,inputRef:D,focusInputOnClick:!0,ref:C},r.createElement("div",{className:K("sps-form-control",o&&"disabled")},r.createElement("i",{className:K("sps-text-input__icon","sps-icon","sps-icon-calendar")}),_&&r.createElement("div",{"data-testid":`${v}_selected_preset`,className:"sps-datepicker__selected-preset"},r.createElement("span",{className:"sps-tag sps-tag--info"},M(_))),r.createElement("input",{type:"text",ref:D,className:"sps-text-input__input","data-testid":`${v}_date_input`,id:I,placeholder:!$&&!_?g?.toUpperCase()||mn:void 0,onChange:N,onClick:w,onFocus:w,onKeyDown:k,value:te,disabled:o,...y}),p&&!o&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:T}))),r.createElement(er,{isOpen:V,attachTo:C,ref:L},r.createElement("div",{className:"sps-datepicker__presets"},r.createElement("fieldset",null,r.createElement("legend",{className:"sps-datepicker__presets-label"},b("datepicker.presetsLabel")),r.createElement("div",{className:"sps-custom-control sps-custom-radio sps-custom-control--no-error"},r.createElement("input",{"data-testid":`${v}_presets_custom_input`,type:"radio",id:`sps-date-range-picker-${h}__range-custom`,className:"sps-custom-control__input",checked:!_,name:`sps-date-range-picker-${h}__range`,onChange:()=>U()}),r.createElement("label",{className:"sps-custom-control__label",htmlFor:`sps-date-range-picker-${h}__range-custom`},b("datepicker.preset.custom",{defaultValue:"Custom"}))),d.map((W,X)=>r.createElement("div",{key:M(W),className:"sps-custom-control sps-custom-radio sps-custom-control--no-error"},r.createElement("input",{type:"radio","data-testid":`${v}_preset_option_${W.label}`,id:`sps-date-range-picker-${h}__range-${X}`,name:`sps-date-range-picker-${h}__range`,onChange:()=>U(W),checked:_?.definition?_.definition===W.definition:!1,className:"sps-custom-control__input"}),r.createElement("label",{className:"sps-custom-control__label",htmlFor:`sps-date-range-picker-${h}__range-${X}`},M(W)))))),r.createElement(Qo,{"data-testid":`${v}_calendar`,selectedRange:Array.isArray(p)?p:H,onNewSelection:q,minDate:l,maxDate:i,showTwoMonths:f,selectedPreset:_&&M(_),isOpen:V,currentUser:n})))}Object.assign(os,{props:Gy,displayName:"SpsDateRangePicker"});const Md={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
1373
1373
|
import {
|
|
1374
1374
|
useSpsForm,
|
|
1375
1375
|
SpsLabel,
|
|
@@ -1646,7 +1646,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
1646
1646
|
</SpsLocaleProvider>
|
|
1647
1647
|
);
|
|
1648
1648
|
}
|
|
1649
|
-
`}}}},
|
|
1649
|
+
`}}}},zy=Do||Fr,jy={action:"SpsActionMethod",captionKey:"string",comparisonKey:"string",conformWidth:"boolean",disabled:"boolean",disabledOptions:"any[]",formMeta:"SpsFormFieldMeta<any>",notClearable:"boolean",options:"Eventually<any[]> | (filter?: string) => Eventually<any[]>",onChange:"ChangeEventHandler",onSearchChange:"(searchText: string) => void",onOpen:"OnOpenHandler",placeholder:"string",searchDebounce:"number",searchPlaceholder:"string",showInlineSearch:"boolean",tallOptionList:"boolean",textKey:"string",valueKey:"string",value:"any",zeroState:"string",autoFixWidth:"boolean",loading:"boolean",filterByTextAndCaptionKey:"boolean",maxHeightOptionListPx:"number",maxHeightOptionListRem:"number",disableOptionsMemoization:"boolean",onBeforeChange:"(value: string) => boolean | Promise<boolean>"},on=r.forwardRef((e,t)=>{const{action:n,autoFixWidth:o=!1,captionKey:a,className:s,comparisonKey:i,conformWidth:l,disabled:c,disabledOptions:d,formControl:u,formMeta:m,id:p,notClearable:f,options:g,onChange:v,onSearchChange:y,onClick:b,onOpen:h,placeholder:I,searchDebounce:C,searchPlaceholder:D,showInlineSearch:L,tallOptionList:$,textKey:O,valueKey:_,unsafelyReplaceClassName:R,value:H,zeroState:Z,loading:V,filterByTextAndCaptionKey:w,maxHeightOptionListPx:F,maxHeightOptionListRem:B,"data-testid":M,disableOptionsMemoization:q,disableDefaultOptionsFiltering:N,onBeforeChange:T,...k}=e,U=m||u,{wrapperId:J,controlId:te}=Ge(p,U),ne=r.useRef(null),W=r.useRef(null),X=r.useRef(null),{t:Y}=he.useWoodlandLanguage(),[G,ee]=Dt({isOpen:!1,value:H,text:"",keyDown:null,opensUpward:!1,optionIds:""}),[z,Q]=r.useState();function fe(oe){ee({value:oe,text:oe&&O?oe[O]:oe})}async function se(oe){const ue=oe&&_&&typeof oe=="object"?oe[_]:oe;T&&!await T(ue)||(fe(oe),U&&(U.setValue(ue),U.markAsDirty()),v&&v(new Lt({value:ue})))}r.useEffect(()=>{fe(H)},[H,O]);function pe(){se(void 0)}function He(){ee({isOpen:!1})}function $e(oe){oe.nativeEvent.stopImmediatePropagation(),c||ee({isOpen:!G.isOpen})}function Xe(oe){c||(["Up","ArrowUp","Down","ArrowDown"," ","Spacebar"].indexOf(oe.key)>-1&&oe.preventDefault(),Vr.includes(oe.key)&&(oe.preventDefault(),Q(hn(oe))),ee({keyDown:hn(oe)}))}function nt(oe){ee({isOpen:oe})}function mt(oe){ee({opensUpward:oe})}function xe(oe){oe.detail!==J&&ee({isOpen:!1})}function ot(oe){ee({optionIds:new Array(oe).fill("").map((ue,je)=>`${J}-options-option-${je}`).join(",")})}const Ve=r.useCallback(oe=>{y?.(oe.target.value)},[y]);r.useEffect(()=>(document.addEventListener("click",He),document.addEventListener("DropdownOpened",xe),()=>{document.removeEventListener("click",He),document.removeEventListener("DropdownOpened",xe)}),[]),r.useLayoutEffect(()=>{if(o&&X.current&&ne.current){ne.current.style.width="";const ue=`${ne.current.getBoundingClientRect().width+6}px`;ne.current.style.width=ue,X.current.style.width=ue,X.current.style.maxWidth=ue}}),Kr(()=>{if(G.isOpen){W.current&&zy(W.current,{scrollMode:"if-needed"}),h?.();const oe=document.createEvent("CustomEvent");oe.initCustomEvent("DropdownOpened",!1,!1,J),document.dispatchEvent(oe)}},[G.isOpen]),r.useImperativeHandle(t,()=>({focus:()=>{W.current?.focus()}})),r.useEffect(()=>{let oe;return G.isOpen&&(oe=()=>{ee({isOpen:!1})},window.addEventListener("resize",oe)),()=>{oe&&window.removeEventListener("resize",oe)}},[G.isOpen]),$n({isOpen:G.isOpen,rootRef:W});const ft=K(R||"sps-select",G.isOpen&&"sps-select--open",G.isOpen&&"z-stratum-dropdown",G.opensUpward&&"sps-select--opens-upward",s),_e=G.text||I||Y("select.defaultPlaceholder",{defaultValue:"Select one..."});return r.createElement(Le,{id:J,className:ft,onKeyDown:Xe,formControl:u,formMeta:m,ref:W,role:"listbox","aria-owns":G.optionIds,"data-testid":M,onClick:b,...k},r.createElement("div",{className:K("sps-select__dropctrl",c&&"disabled"),id:te,tabIndex:0,onClick:$e,ref:X,title:_e,"data-testid":`${M}-dropctrl`},r.createElement("div",{className:"sps-select__dropctrl-content"},r.createElement("span",{className:K("sps-select__value",!G.text&&"sps-select__value--placeholder"),"data-testid":`${M}-value`},_e),G.value&&!f&&!c&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-select__clear-btn",onClick:pe,"data-testid":`${M}-clear-value`}),r.createElement("i",{className:"sps-icon sps-icon-chevron-down sps-select__dropctrl-icon"}))),r.createElement(Rn,{id:`${J}-options`,ref:ne,attachTo:X,captionKey:a,comparisonKey:i,disabledOptions:d,isOpen:G.isOpen,keyDown:G.keyDown,options:g,onOptionSelected:se,onPositionFlip:mt,onSelfToggle:nt,onSearchChange:Ve,searchDebounce:C,searchPlaceholder:D,showInlineSearch:L,selectedOption:G.value,specialAction:n,tall:$,textKey:O,filterByTextAndCaptionKey:w,optionRole:"option",valueKey:_,onOptionListChanged:ot,zeroState:Z,ignoreWidthStyles:o,loading:V,maxHeightPx:F,maxHeightRem:B,disableOptionsMemoization:q,disableDefaultOptionsFiltering:N,"data-testid":`${M}-option-list`,typeaheadEvent:z,conformWidth:l}))});Object.assign(on,{props:jy,displayName:"SpsSelect"});const Ld={general:{label:"General Usage",description:({NavigateTo:e})=>E.createElement(E.Fragment,null,E.createElement("h5",null,"Use a Select:"),E.createElement("ul",null,E.createElement("li",{className:"mb-2"},"When a list of predetermined values can be provided.")),E.createElement("h5",null,"Do Not Use a Select:"),E.createElement("ul",null,E.createElement("li",{className:"mb-2"},"When there are only two possible options. Consider"," ",E.createElement(e,{to:"checkbox"},"Checkboxes")," or"," ",E.createElement(e,{to:"radio-buttons"},"Radio Buttons")," insead."),E.createElement("li",{className:"mb-2"},"When it is ideal to display all available options without requiring a click. Consider"," ",E.createElement(e,{to:"checkbox"},"Checkboxes")," or"," ",E.createElement(e,{to:"radio-buttons"},"Radio Buttons")," insead.")),E.createElement("h5",null,"Using Selects in a Form"),E.createElement("p",null,"Reference the ",E.createElement(e,{to:"form"},"Forms")," page for guidelines for placing inputs in Form layouts"))},basic:{label:"Basic Selects",description:()=>E.createElement("p",null,"Basic Selects include a label and dropdown menu containing a list of options. The user is allowed to make a single selection."),examples:{basic:{react:S.code`
|
|
1650
1650
|
import { SpsLabel, SpsSelect, useSpsForm } from "@spscommerce/ds-react";
|
|
1651
1651
|
function DemoComponent() {
|
|
1652
1652
|
const colors = ["red", "blue", "green"];
|
|
@@ -2006,7 +2006,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
2006
2006
|
</div>
|
|
2007
2007
|
)
|
|
2008
2008
|
}
|
|
2009
|
-
`}}}},zy={formMeta:"SpsFormSetMeta<any>",stacked:"boolean"};function In({children:e,className:t,formArray:n,formGroup:o,formMeta:a,stacked:s,"data-testid":i,unsafelyReplaceClassName:l,...c}){const d=o||n,m=d||a,[u,p]=r.useState(!1);r.useEffect(()=>{if(m){const g=m.isFocused();!u&&g&&m.onFocus?m.onFocus():u&&!g&&m.onBlur&&m.onBlur(),p(g)}});const f=K(l||"sps-form-group",(d&&d.invalid||a&&(!a.isValid()||!a.contentsAreValid()))&&"sps-form-group--error",t);return r.createElement("div",{className:f,"data-testid":i,...c},r.createElement("div",{className:K("sps-input-group",s&&"sps-input-group--stacked")},e))}Object.assign(In,{props:zy,displayName:"SpsInputGroup"});const jy={currentUser:"any",disabled:"boolean",formMeta:"SpsFormFieldMeta<SimpleMomentRange>",maxDate:"SimpleDate",minDate:"SimpleDate",onChange:"(newMomentRange: SimpleMomentRange) => void",presets:"Array<DateTimePreset>",value:"SimpleMomentRange",showTwoMonths:"boolean",twentyFourHour:"boolean",format:"string",placeholder12h:"string",placeholder24h:"string",selectedPreset:"string",onPresetChange:"(newPreset?: string) => void"},Md="sps-datepicker",Ld=["AM","PM"],_d=[{definition:"P0D",label:"datepicker.preset.today"},{definition:"() => [null, {month: 1, date: 1, year: 3000}]",label:"datepicker.preset.before"},{definition:"() => [{month: 1, date: 1, year: 1990}, null]",label:"datepicker.preset.after"},{definition:"P7D",label:"datepicker.preset.sevenDays"},{definition:"P30D",label:"datepicker.preset.thirtyDays"},{definition:"P60D",label:"datepicker.preset.sixtyDays"},{definition:"P90D",label:"datepicker.preset.ninetyDays"},{definition:"P1Y",label:"datepicker.preset.oneYear"}];function Pd(e,t=""){return e.find(n=>n.definition===t)}function ns({className:e,currentUser:t,disabled:n,formMeta:o,id:a,maxDate:s,minDate:i,onChange:l,presets:c=_d,value:d,showTwoMonths:m=!1,twentyFourHour:u,format:p,"data-testid":f,placeholder24h:g="00:00",placeholder12h:v="12:00",selectedPreset:y,onPresetChange:b}){const{t:h}=he.useWoodlandLanguage(),I=ao(t),C=u??yd(I),D=h("timeInput.customTime",{defaultValue:"Custom time"}),{wrapperId:L,controlId:$}=Ge(a&&`${a}_from`,o),{wrapperId:O,controlId:_}=Ge(a&&`${a}_to`,o),R=r.useRef(null),H=r.useRef(null),Z=r.useRef(null),V=r.useRef(null),w=r.useRef(null),F=j.splitMomentInDateTimeParts(Array.isArray(d)?d[0]:void 0,C,p),B=j.splitMomentInDateTimeParts(Array.isArray(d)?d[1]:void 0,C,p,!0),[M,q]=r.useState(F[0]),[N,T]=r.useState(B[0]),[k,U]=r.useState(F[1]),[J,te]=r.useState(B[1]),[ne,W]=r.useState(F[2]),[X,Y]=r.useState(B[2]),[G,ee]=r.useState(Pd(c,y)||null),{showPopup:z,doShowPopup:Q,doHidePopup:fe}=bn(R,w);r.useEffect(()=>{ee(Pd(c,y)||null)},[y]);function se(ae){o&&(o.setValue(ae),o.markAsDirty()),l&&l(ae)}function pe(ae){return ae&&(/^datepicker\./.test(ae.label)?h(ae.label):ae.label)}const He=pe(G)==="Before",$e=pe(G)==="After";function Xe(ae){const we=d||[],Ke=j.toMoment(ae);let Ye;if(He)Ye=[null,Ke],fe(!0),b?.(pe(G));else if($e)Ye=[Ke,null],fe(!0),b?.(pe(G));else if(!we[0]||we[1]||Ke?.isBefore(j.toMoment(j.createFrom(we[0],p)))){let Ie=parseInt(k?.split(":")[0]||"0",10);!C&&Ie===12&&(Ie=0);const Et=parseInt(k?.split(":")[1]||"0",10);Ke?.set("hour",ne==="PM"?12+Ie:Ie<12?Ie:0),Ke?.set("minute",Et),Ye=[Ke,null],ee(null),b?.(null)}else{let Ie=parseInt(J?.split(":")[0]||"0",10);!C&&Ie===12&&(Ie=0);const Et=parseInt(J?.split(":")[1]||"0",10);Ke?.set("hour",X==="PM"?12+Ie:Ie),Ke?.set("minute",Et),Ke?.isBefore(we[0])?Ye=[Ke,null]:(Ye=[we[0],Ke],fe(!0)),b?.(null),ee(null)}se(Ye)}function nt(ae){q(ae.target.value),G!==null&&(ee(null),b?.(null))}function mt(ae){j.validateTimeString(ae.target.value,C)&&(U(ae.target.value),G!==null&&(ee(null),b?.(null)))}function xe(ae,we,Ke){const Ye=M,Ie=we??k,Et=ne;if(Ye===F[0]&&Ie===F[1]&&Et===F[2])return;const kt=j.createFrom(Ye,p);if(kt&&j.isValid(kt)){const ie=j.toMoment(kt);let de=parseInt(Ie?.split(":")[0]||"0",10);!C&&de===12&&(de=0);const ke=parseInt(Ie?.split(":")[1]||"0",10);ie?.set("hour",Et==="PM"?12+de:de),ie?.set("minute",ke);const Tt=[ie,ie?.isBefore(d?.[1])&&d?.[1]||null];se(Tt)}}function ot(ae){j.validateTimeString(ae??k,C)&&(U(j.padIncompleteTimeString(ae??k,C)),setTimeout(()=>xe(void 0,ae),0))}function Ve(ae){W(ae.target.value)}function ft(ae){j.validateTimeString(ae,C)&&(U(ae),setTimeout(()=>ot(ae),0))}r.useEffect(()=>{ne!==F[2]&&xe()},[ne]);function _e(ae){T(ae.target.value)}function oe(ae){j.validateTimeString(ae.target.value,C)&&te(ae.target.value)}function ue(ae,we,Ke){const Ye=N,Ie=we??J,Et=X;if(Ye===B[0]&&Ie===B[1]&&Et===B[2])return;const kt=j.createFrom(Ye,p);if(kt&&j.isValid(kt)){const ie=j.toMoment(kt);let de=parseInt(Ie?.split(":")[0]||"0",10);!C&&de===12&&(de=0);const ke=parseInt(Ie?.split(":")[1]||"0",10);ie?.set("hour",Et==="PM"?12+de:de),ie?.set("minute",ke);const Tt=[ie?.isAfter(d?.[0])&&d?.[0]||null,ie];se(Tt)}}function je(ae){j.validateTimeString(ae??J,C)&&(te(j.padIncompleteTimeString(ae??J,C)),setTimeout(()=>ue(void 0,ae),0))}function mo(ae){Y(ae.target.value)}function Dr(ae){j.validateTimeString(ae,C)&&(te(ae),setTimeout(()=>je(ae),0))}r.useEffect(()=>{X!==B[2]&&ue()},[X]);function xt(){se([null,null]),ee(null),b?.(null)}function jt(ae){return function(we){switch(we.key){case"Tab":fe();break;case"Backspace":we.target.selectionStart===0&&d&&!Array.isArray(d)&&xt();break;case"Enter":ae==="from"?xe():ae==="to"&&ue();break}}}function yt(ae){if(!ae){ee(null),se([null,null]),b?.(null);return}ee(ae);const we=j.createDateTimeRangeFromPreset(ae);ae&&pe(ae)==="Before"?!d||Array.isArray(d)&&d[0]&&d[1]?se([null,null]):Array.isArray(d)&&d[0]?se([null,j.toMoment(j.createFrom(d[0],p))]):Array.isArray(d)&&d[1]&&se([null,j.toMoment(j.createFrom(d[1],p))]):ae&&pe(ae)==="After"?!d||Array.isArray(d)&&d[0]&&d[1]?se([null,null]):Array.isArray(d)&&d[0]?se([j.toMoment(j.createFrom(d[0],p)),null]):Array.isArray(d)&&d[1]&&se([j.toMoment(j.createFrom(d[1],p)),null]):JSON.stringify(d)!==JSON.stringify(we)&&se([we[0],we[1]]),b&&ae?.definition!==y&&b(typeof ae?.definition=="string"?ae?.definition:pe(ae))}r.useEffect(()=>{d&&Array.isArray(d)&&!d.length&&xt()},[d]),r.useEffect(()=>{if(d&&Array.isArray(d)&&Array.isArray(d)){if(d[0]&&!d[1]){const ae=c.find(we=>pe(we)==="After");ae&&yt(ae)}else if(!d[0]&&d[1]){const ae=c.find(we=>pe(we)==="Before");ae&&yt(ae)}else if(d[0]&&d[1]){const ae=j.toDateTimeStringRange(d,C,p),we=c.find(Ke=>ae===j.toDateTimeStringRange(j.createDateTimeRangeFromPreset(Ke),C,p));we&&yt(we)}}},[]),r.useEffect(()=>{F[0]?q(F[0]):q(""),F[1]?U(F[1]):U(C?"00:00":"12:00"),C||(F[2]?W(F[2]):W("AM")),B[0]?T(B[0]):T(""),B[1]?te(B[1]):te(C?"23:59":"11:59"),C||(B[2]?Y(B[2]):Y("PM"))},[F[0],F[1],F[2],B[0],B[1],B[2],C]);const fo=K(Md,"sps-text-input",z&&`${Md}--open`,e);return r.createElement(r.Fragment,null,r.createElement("div",{className:K("sps-datetime-range-picker")},r.createElement("div",{className:K("sps-datetime-range-picker__pair")},r.createElement(Le,{id:L,className:fo,formMeta:o,inputRef:H,focusInputOnClick:!0,ref:R},r.createElement("div",{className:K("sps-form-control",n&&"disabled")},r.createElement("i",{className:K("sps-text-input__icon","sps-icon","sps-icon-calendar")}),G&&r.createElement("div",{"data-testid":`${f}_selected_preset`,className:"sps-datepicker__selected-preset"},r.createElement("span",{className:"sps-tag sps-tag--info"},pe(G))),r.createElement("input",{type:"text",ref:H,className:"sps-text-input__input","data-testid":`${f}_from_date_input`,id:$,placeholder:!M&&!G?p?.toUpperCase()||mn:He?B[0]:$e?F[0]:void 0,onChange:nt,onClick:Q,onFocus:Q,onBlur:()=>xe(),onKeyDown:jt("from"),value:G?"":M,disabled:n}),d&&!n&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:xt}))),!G&&(C?r.createElement(Nt,{className:"sps-time-input",placeholder:g,suggestions:Mr,zeroState:D,value:k,onChange:mt,onBlur:()=>ot(),onSelectionChange:ft,disabled:n,inputNotClearable:!0,autoFocusOnSelection:!0}):r.createElement(In,null,r.createElement(Nt,{className:"sps-time-input",placeholder:v,suggestions:kr,zeroState:D,value:k,onChange:mt,onBlur:()=>ot(),onSelectionChange:ft,disabled:n,inputNotClearable:!0,autoFocusOnSelection:!0}),r.createElement(on,{options:Ld,value:ne,onChange:Ve,disabled:n,notClearable:!0})))),!G&&r.createElement("span",{className:K("sps-datepicker__to")},h("dateTimeRangePicker.to",{defaultValue:"to"})),!G&&r.createElement("div",{className:K("sps-datetime-range-picker__pair")},r.createElement(Le,{id:O,className:fo,formMeta:o,inputRef:V,focusInputOnClick:!0,ref:Z},r.createElement("div",{className:K("sps-form-control",n&&"disabled")},r.createElement("i",{className:K("sps-text-input__icon","sps-icon","sps-icon-calendar")}),G&&r.createElement("div",{"data-testid":`${f}_selected_preset`,className:"sps-datepicker__selected-preset"},r.createElement("span",{className:"sps-tag sps-tag--info"},pe(G))),r.createElement("input",{type:"text",ref:V,className:"sps-text-input__input","data-testid":`${f}_to_date_input`,id:_,placeholder:!N&&!G?p?.toUpperCase()||mn:void 0,onChange:_e,onClick:Q,onFocus:Q,onKeyDown:jt("to"),onBlur:()=>ue(),value:N,disabled:n}),d&&!n&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:xt}))),C?r.createElement(Nt,{className:"sps-time-input",placeholder:g,suggestions:Mr,zeroState:D,value:J,onChange:oe,onBlur:()=>je(),onSelectionChange:Dr,disabled:n,inputNotClearable:!0,autoFocusOnSelection:!0}):r.createElement(In,null,r.createElement(Nt,{className:"sps-time-input",placeholder:v,suggestions:kr,zeroState:D,value:J,onChange:oe,onBlur:()=>je(),onSelectionChange:Dr,disabled:n,inputNotClearable:!0,autoFocusOnSelection:!0}),r.createElement(on,{options:Ld,value:X,onChange:mo,disabled:n,notClearable:!0})))),r.createElement(Xo,{isOpen:z,attachTo:R,ref:w},r.createElement("div",{className:"sps-datepicker__presets"},r.createElement("fieldset",null,r.createElement("legend",{className:"sps-datepicker__presets-label"},h("datepicker.presetsLabel",{defaultValue:"Ranges"})),r.createElement("div",{className:"sps-custom-control sps-custom-radio sps-custom-control--no-error"},r.createElement("input",{"data-testid":`${f}_presets_custom_input`,type:"radio",id:`sps-date-range-picker-${L}__range-custom`,className:"sps-custom-control__input",checked:!G,name:`sps-date-range-picker-${L}__range`,onChange:()=>yt()}),r.createElement("label",{className:"sps-custom-control__label",htmlFor:`sps-date-range-picker-${L}__range-custom`},h("datepicker.preset.custom",{defaultValue:"Custom"}))),c.map((ae,we)=>r.createElement("div",{key:pe(ae),className:"sps-custom-control sps-custom-radio sps-custom-control--no-error"},r.createElement("input",{type:"radio","data-testid":`${f}_preset_option_${ae.label}`,id:`sps-date-range-picker-${L}__range-${we}`,name:`sps-date-range-picker-${L}__range`,onChange:()=>yt(ae),checked:G?.definition?G.definition===ae.definition:!1,className:"sps-custom-control__input"}),r.createElement("label",{className:"sps-custom-control__label",htmlFor:`sps-date-range-picker-${L}__range-${we}`},pe(ae)))))),r.createElement(Jo,{"data-testid":`${f}_calendar`,selectedRange:Array.isArray(d)?[j.createFrom(d[0],p),j.createFrom(d[1],p)]:void 0,onNewSelection:Xe,minDate:i,maxDate:s,showTwoMonths:m,selectedPreset:G&&pe(G),currentUser:t})))}Object.assign(ns,{props:jy,displayName:"SpsDateTimeRangePicker"});const Od={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
2009
|
+
`}}}},Yy={formMeta:"SpsFormSetMeta<any>",stacked:"boolean"};function In({children:e,className:t,formArray:n,formGroup:o,formMeta:a,stacked:s,"data-testid":i,unsafelyReplaceClassName:l,...c}){const d=o||n,u=d||a,[m,p]=r.useState(!1);r.useEffect(()=>{if(u){const g=u.isFocused();!m&&g&&u.onFocus?u.onFocus():m&&!g&&u.onBlur&&u.onBlur(),p(g)}});const f=K(l||"sps-form-group",(d&&d.invalid||a&&(!a.isValid()||!a.contentsAreValid()))&&"sps-form-group--error",t);return r.createElement("div",{className:f,"data-testid":i,...c},r.createElement("div",{className:K("sps-input-group",s&&"sps-input-group--stacked")},e))}Object.assign(In,{props:Yy,displayName:"SpsInputGroup"});const qy={currentUser:"any",disabled:"boolean",formMeta:"SpsFormFieldMeta<SimpleMomentRange>",maxDate:"SimpleDate",minDate:"SimpleDate",onChange:"(newMomentRange: SimpleMomentRange) => void",presets:"Array<DateTimePreset>",value:"SimpleMomentRange",showTwoMonths:"boolean",twentyFourHour:"boolean",format:"string",placeholder12h:"string",placeholder24h:"string",selectedPreset:"string",onPresetChange:"(newPreset?: string) => void"},_d="sps-datepicker",Pd=["AM","PM"],Od=[{definition:"P0D",label:"datepicker.preset.today"},{definition:"() => [null, {month: 1, date: 1, year: 3000}]",label:"datepicker.preset.before"},{definition:"() => [{month: 1, date: 1, year: 1990}, null]",label:"datepicker.preset.after"},{definition:"P7D",label:"datepicker.preset.sevenDays"},{definition:"P30D",label:"datepicker.preset.thirtyDays"},{definition:"P60D",label:"datepicker.preset.sixtyDays"},{definition:"P90D",label:"datepicker.preset.ninetyDays"},{definition:"P1Y",label:"datepicker.preset.oneYear"}];function Bd(e,t=""){return e.find(n=>n.definition===t)}function rs({className:e,currentUser:t,disabled:n,formMeta:o,id:a,maxDate:s,minDate:i,onChange:l,presets:c=Od,value:d,showTwoMonths:u=!1,twentyFourHour:m,format:p,"data-testid":f,placeholder24h:g="00:00",placeholder12h:v="12:00",selectedPreset:y,onPresetChange:b}){const{t:h}=he.useWoodlandLanguage(),I=io(t),C=m??Td(I),D=h("timeInput.customTime",{defaultValue:"Custom time"}),{wrapperId:L,controlId:$}=Ge(a&&`${a}_from`,o),{wrapperId:O,controlId:_}=Ge(a&&`${a}_to`,o),R=r.useRef(null),H=r.useRef(null),Z=r.useRef(null),V=r.useRef(null),w=r.useRef(null),F=j.splitMomentInDateTimeParts(Array.isArray(d)?d[0]:void 0,C,p),B=j.splitMomentInDateTimeParts(Array.isArray(d)?d[1]:void 0,C,p,!0),[M,q]=r.useState(F[0]),[N,T]=r.useState(B[0]),[k,U]=r.useState(F[1]),[J,te]=r.useState(B[1]),[ne,W]=r.useState(F[2]),[X,Y]=r.useState(B[2]),[G,ee]=r.useState(Bd(c,y)||null),{showPopup:z,doShowPopup:Q,doHidePopup:fe}=bn(R,w);r.useEffect(()=>{ee(Bd(c,y)||null)},[y]);function se(ae){o&&(o.setValue(ae),o.markAsDirty()),l&&l(ae)}function pe(ae){return ae&&(/^datepicker\./.test(ae.label)?h(ae.label):ae.label)}const He=pe(G)==="Before",$e=pe(G)==="After";function Xe(ae){const we=d||[],Ke=j.toMoment(ae);let Ye;if(He)Ye=[null,Ke],fe(!0),b?.(pe(G));else if($e)Ye=[Ke,null],fe(!0),b?.(pe(G));else if(!we[0]||we[1]||Ke?.isBefore(j.toMoment(j.createFrom(we[0],p)))){let Ie=parseInt(k?.split(":")[0]||"0",10);!C&&Ie===12&&(Ie=0);const Et=parseInt(k?.split(":")[1]||"0",10);Ke?.set("hour",ne==="PM"?12+Ie:Ie<12?Ie:0),Ke?.set("minute",Et),Ye=[Ke,null],ee(null),b?.(null)}else{let Ie=parseInt(J?.split(":")[0]||"0",10);!C&&Ie===12&&(Ie=0);const Et=parseInt(J?.split(":")[1]||"0",10);Ke?.set("hour",X==="PM"?12+Ie:Ie),Ke?.set("minute",Et),Ke?.isBefore(we[0])?Ye=[Ke,null]:(Ye=[we[0],Ke],fe(!0)),b?.(null),ee(null)}se(Ye)}function nt(ae){q(ae.target.value),G!==null&&(ee(null),b?.(null))}function mt(ae){j.validateTimeString(ae.target.value,C)&&(U(ae.target.value),G!==null&&(ee(null),b?.(null)))}function xe(ae,we,Ke){const Ye=M,Ie=we??k,Et=ne;if(Ye===F[0]&&Ie===F[1]&&Et===F[2])return;const kt=j.createFrom(Ye,p);if(kt&&j.isValid(kt)){const ie=j.toMoment(kt);let de=parseInt(Ie?.split(":")[0]||"0",10);!C&&de===12&&(de=0);const ke=parseInt(Ie?.split(":")[1]||"0",10);ie?.set("hour",Et==="PM"?12+de:de),ie?.set("minute",ke);const Tt=[ie,ie?.isBefore(d?.[1])&&d?.[1]||null];se(Tt)}}function ot(ae){j.validateTimeString(ae??k,C)&&(U(j.padIncompleteTimeString(ae??k,C)),setTimeout(()=>xe(void 0,ae),0))}function Ve(ae){W(ae.target.value)}function ft(ae){j.validateTimeString(ae,C)&&(U(ae),setTimeout(()=>ot(ae),0))}r.useEffect(()=>{ne!==F[2]&&xe()},[ne]);function _e(ae){T(ae.target.value)}function oe(ae){j.validateTimeString(ae.target.value,C)&&te(ae.target.value)}function ue(ae,we,Ke){const Ye=N,Ie=we??J,Et=X;if(Ye===B[0]&&Ie===B[1]&&Et===B[2])return;const kt=j.createFrom(Ye,p);if(kt&&j.isValid(kt)){const ie=j.toMoment(kt);let de=parseInt(Ie?.split(":")[0]||"0",10);!C&&de===12&&(de=0);const ke=parseInt(Ie?.split(":")[1]||"0",10);ie?.set("hour",Et==="PM"?12+de:de),ie?.set("minute",ke);const Tt=[ie?.isAfter(d?.[0])&&d?.[0]||null,ie];se(Tt)}}function je(ae){j.validateTimeString(ae??J,C)&&(te(j.padIncompleteTimeString(ae??J,C)),setTimeout(()=>ue(void 0,ae),0))}function So(ae){Y(ae.target.value)}function xr(ae){j.validateTimeString(ae,C)&&(te(ae),setTimeout(()=>je(ae),0))}r.useEffect(()=>{X!==B[2]&&ue()},[X]);function xt(){se([null,null]),ee(null),b?.(null)}function jt(ae){return function(we){switch(we.key){case"Tab":fe();break;case"Backspace":we.target.selectionStart===0&&d&&!Array.isArray(d)&&xt();break;case"Enter":ae==="from"?xe():ae==="to"&&ue();break}}}function yt(ae){if(!ae){ee(null),se([null,null]),b?.(null);return}ee(ae);const we=j.createDateTimeRangeFromPreset(ae);ae&&pe(ae)==="Before"?!d||Array.isArray(d)&&d[0]&&d[1]?se([null,null]):Array.isArray(d)&&d[0]?se([null,j.toMoment(j.createFrom(d[0],p))]):Array.isArray(d)&&d[1]&&se([null,j.toMoment(j.createFrom(d[1],p))]):ae&&pe(ae)==="After"?!d||Array.isArray(d)&&d[0]&&d[1]?se([null,null]):Array.isArray(d)&&d[0]?se([j.toMoment(j.createFrom(d[0],p)),null]):Array.isArray(d)&&d[1]&&se([j.toMoment(j.createFrom(d[1],p)),null]):JSON.stringify(d)!==JSON.stringify(we)&&se([we[0],we[1]]),b&&ae?.definition!==y&&b(typeof ae?.definition=="string"?ae?.definition:pe(ae))}r.useEffect(()=>{d&&Array.isArray(d)&&!d.length&&xt()},[d]),r.useEffect(()=>{if(d&&Array.isArray(d)&&Array.isArray(d)){if(d[0]&&!d[1]){const ae=c.find(we=>pe(we)==="After");ae&&yt(ae)}else if(!d[0]&&d[1]){const ae=c.find(we=>pe(we)==="Before");ae&&yt(ae)}else if(d[0]&&d[1]){const ae=j.toDateTimeStringRange(d,C,p),we=c.find(Ke=>ae===j.toDateTimeStringRange(j.createDateTimeRangeFromPreset(Ke),C,p));we&&yt(we)}}},[]),r.useEffect(()=>{F[0]?q(F[0]):q(""),F[1]?U(F[1]):U(C?"00:00":"12:00"),C||(F[2]?W(F[2]):W("AM")),B[0]?T(B[0]):T(""),B[1]?te(B[1]):te(C?"23:59":"11:59"),C||(B[2]?Y(B[2]):Y("PM"))},[F[0],F[1],F[2],B[0],B[1],B[2],C]);const go=K(_d,"sps-text-input",z&&`${_d}--open`,e);return r.createElement(r.Fragment,null,r.createElement("div",{className:K("sps-datetime-range-picker")},r.createElement("div",{className:K("sps-datetime-range-picker__pair")},r.createElement(Le,{id:L,className:go,formMeta:o,inputRef:H,focusInputOnClick:!0,ref:R},r.createElement("div",{className:K("sps-form-control",n&&"disabled")},r.createElement("i",{className:K("sps-text-input__icon","sps-icon","sps-icon-calendar")}),G&&r.createElement("div",{"data-testid":`${f}_selected_preset`,className:"sps-datepicker__selected-preset"},r.createElement("span",{className:"sps-tag sps-tag--info"},pe(G))),r.createElement("input",{type:"text",ref:H,className:"sps-text-input__input","data-testid":`${f}_from_date_input`,id:$,placeholder:!M&&!G?p?.toUpperCase()||mn:He?B[0]:$e?F[0]:void 0,onChange:nt,onClick:Q,onFocus:Q,onBlur:()=>xe(),onKeyDown:jt("from"),value:G?"":M,disabled:n}),d&&!n&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:xt}))),!G&&(C?r.createElement(Nt,{className:"sps-time-input",placeholder:g,suggestions:Pr,zeroState:D,value:k,onChange:mt,onBlur:()=>ot(),onSelectionChange:ft,disabled:n,inputNotClearable:!0,autoFocusOnSelection:!0}):r.createElement(In,null,r.createElement(Nt,{className:"sps-time-input",placeholder:v,suggestions:_r,zeroState:D,value:k,onChange:mt,onBlur:()=>ot(),onSelectionChange:ft,disabled:n,inputNotClearable:!0,autoFocusOnSelection:!0}),r.createElement(on,{options:Pd,value:ne,onChange:Ve,disabled:n,notClearable:!0})))),!G&&r.createElement("span",{className:K("sps-datepicker__to")},h("dateTimeRangePicker.to",{defaultValue:"to"})),!G&&r.createElement("div",{className:K("sps-datetime-range-picker__pair")},r.createElement(Le,{id:O,className:go,formMeta:o,inputRef:V,focusInputOnClick:!0,ref:Z},r.createElement("div",{className:K("sps-form-control",n&&"disabled")},r.createElement("i",{className:K("sps-text-input__icon","sps-icon","sps-icon-calendar")}),G&&r.createElement("div",{"data-testid":`${f}_selected_preset`,className:"sps-datepicker__selected-preset"},r.createElement("span",{className:"sps-tag sps-tag--info"},pe(G))),r.createElement("input",{type:"text",ref:V,className:"sps-text-input__input","data-testid":`${f}_to_date_input`,id:_,placeholder:!N&&!G?p?.toUpperCase()||mn:void 0,onChange:_e,onClick:Q,onFocus:Q,onKeyDown:jt("to"),onBlur:()=>ue(),value:N,disabled:n}),d&&!n&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:xt}))),C?r.createElement(Nt,{className:"sps-time-input",placeholder:g,suggestions:Pr,zeroState:D,value:J,onChange:oe,onBlur:()=>je(),onSelectionChange:xr,disabled:n,inputNotClearable:!0,autoFocusOnSelection:!0}):r.createElement(In,null,r.createElement(Nt,{className:"sps-time-input",placeholder:v,suggestions:_r,zeroState:D,value:J,onChange:oe,onBlur:()=>je(),onSelectionChange:xr,disabled:n,inputNotClearable:!0,autoFocusOnSelection:!0}),r.createElement(on,{options:Pd,value:X,onChange:So,disabled:n,notClearable:!0})))),r.createElement(er,{isOpen:z,attachTo:R,ref:w},r.createElement("div",{className:"sps-datepicker__presets"},r.createElement("fieldset",null,r.createElement("legend",{className:"sps-datepicker__presets-label"},h("datepicker.presetsLabel",{defaultValue:"Ranges"})),r.createElement("div",{className:"sps-custom-control sps-custom-radio sps-custom-control--no-error"},r.createElement("input",{"data-testid":`${f}_presets_custom_input`,type:"radio",id:`sps-date-range-picker-${L}__range-custom`,className:"sps-custom-control__input",checked:!G,name:`sps-date-range-picker-${L}__range`,onChange:()=>yt()}),r.createElement("label",{className:"sps-custom-control__label",htmlFor:`sps-date-range-picker-${L}__range-custom`},h("datepicker.preset.custom",{defaultValue:"Custom"}))),c.map((ae,we)=>r.createElement("div",{key:pe(ae),className:"sps-custom-control sps-custom-radio sps-custom-control--no-error"},r.createElement("input",{type:"radio","data-testid":`${f}_preset_option_${ae.label}`,id:`sps-date-range-picker-${L}__range-${we}`,name:`sps-date-range-picker-${L}__range`,onChange:()=>yt(ae),checked:G?.definition?G.definition===ae.definition:!1,className:"sps-custom-control__input"}),r.createElement("label",{className:"sps-custom-control__label",htmlFor:`sps-date-range-picker-${L}__range-${we}`},pe(ae)))))),r.createElement(Qo,{"data-testid":`${f}_calendar`,selectedRange:Array.isArray(d)?[j.createFrom(d[0],p),j.createFrom(d[1],p)]:void 0,onNewSelection:Xe,minDate:i,maxDate:s,showTwoMonths:u,selectedPreset:G&&pe(G),currentUser:t})))}Object.assign(rs,{props:qy,displayName:"SpsDateTimeRangePicker"});const Rd={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
2010
2010
|
import {
|
|
2011
2011
|
useSpsForm,
|
|
2012
2012
|
SpsLabel,
|
|
@@ -2223,7 +2223,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
2223
2223
|
</SpsLocaleProvider>
|
|
2224
2224
|
);
|
|
2225
2225
|
}
|
|
2226
|
-
`}}}},
|
|
2226
|
+
`}}}},Jy={ISO_8601:"ISO_8601",ISO_8601_UTC:"ISO_8601_UTC",SHORT_TIME:"LT",SHORT_TIME_ZONE:"LT z",LONG_TIME:"LTS",LONG_TIME_ZONE:"LTS z",NUM_DATE:"L",SHORT_DATE:"ll",LONG_DATE:"LL",SHORT_DATETIME:"lll",SHORT_DATETIME_ZONE:"lll z",LONG_DATETIME:"LLL",LONG_DATETIME_ZONE:"LLL z",SHORT_FULLDATETIME:"llll",SHORT_FULLDATETIME_ZONE:"llll z",LONG_FULLDATETIME:"LLLL",LONG_FULLDATETIME_ZONE:"LLLL z"},Xy={currentUser:"any",dateToFormat:"string | Date",format:"string",locale:"string",relative:"boolean",relativeHrs:"number",tz:"string"};function Zy(e,t,n=0){if(!n&&!t)return!1;if(t)return!0;const o=Me(e);return Me().diff(o,"hours")<n}function Qy({locale:e,tz:t,dateToFormat:n,format:o,currentUser:a,relative:s,relativeHrs:i,children:l}){const c=a?a.preferences||a.acting_entity?.user_info?.preferences:void 0,d=t||c?.timezone||Me.tz.guess(),u=e||c?.locale||Zo(),m=o?Jy[o]:"lll",p=n||String(l),f=Me(p);if(f.locale(wd(u)),!f.isValid())throw new Error("invalid date");return f.tz(d),Zy(p,s||!1,i)?f.fromNow():f.format(m)}function as(e){const{dateToFormat:t,locale:n,tz:o,format:a,currentUser:s,relative:i,relativeHrs:l,children:c,...d}=e,u=io(s),m=n??u;return r.createElement("span",{className:"sps-datetime",...d},Qy({locale:m,tz:o,dateToFormat:t,format:a,currentUser:s,relative:i,relativeHrs:l,children:c}))}Object.assign(as,{props:Xy,displayName:"SpsDateTime"});const Fd={basic:{label:"Datetime Component",description:"<p>Formats dates</p>",examples:{basicAttribute:{imports:S.code`
|
|
2227
2227
|
import { SpsDateTime } from "@spscommerce/ds-react";
|
|
2228
2228
|
`,jsx:S.code`
|
|
2229
2229
|
<SpsDateTime dateToFormat="2018-09-11T16:32:52.822000Z" />
|
|
@@ -2231,7 +2231,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
2231
2231
|
import { SpsDateTime } from "@spscommerce/ds-react";
|
|
2232
2232
|
`,jsx:S.code`
|
|
2233
2233
|
<SpsDateTime>2018-09-11T16:32:52.822000Z</SpsDateTime>
|
|
2234
|
-
`}}}},
|
|
2234
|
+
`}}}},Ad={compact:"boolean",wideTerms:"boolean",widerTerms:"boolean"};function tr(e){const{children:t,className:n,compact:o=!1,"data-testid":a,unsafelyReplaceClassName:s,wideTerms:i=!1,widerTerms:l=!1,...c}=e,d=r.Children.map(t,(m,p)=>{if(m.type.toString()!==r.Fragment.toString()){const v=parseInt(`${p/2}`,10)+1;return r.cloneElement(m,{style:{...m.props.style,msGridRow:v}})}const f=m.props.children;return r.Children.map(f,v=>r.cloneElement(v,{style:{...v.props.style,msGridRow:p+1}}))}),u=K(s||"sps-description-list",o&&"sps-description-list--compact",i&&"sps-description-list--wide-terms",l&&"sps-description-list--wider-terms",n);return r.createElement("dl",{className:u,"data-testid":`${a}`,...c},d)}Object.assign(tr,{props:Ad,displayName:"SpsDescriptionList / SpsDl"});function $d(e){return r.createElement(tr,{...e})}Object.assign($d,{props:Ad,displayName:"SpsDescriptionList / SpsDl"});const Vd={};function nr(e){const{children:t,className:n,"data-testid":o,unsafelyReplaceClassName:a,...s}=e,i=K(a||"sps-description-list__definition",n);return r.createElement("dd",{className:i,"data-testid":`${o}`,...s},t)}Object.assign(nr,{props:Vd,displayName:"SpsDescriptionListDefinition / SpsDd"});function Kd(e){return r.createElement(nr,{...e})}Object.assign(Kd,{props:Vd,displayName:"SpsDescriptionListDefinition / SpsDd"});var ge=(e=>(e.VISIBLE="visible",e.DEFER_VISIBLE="defer_visible",e.HIDDEN="hidden",e.DELAYED_HIDDEN="delayed_hidden",e))(ge||{});function or(e){return e==="visible"?"hidden":"visible"}const Hd=13,eE=20,Wd=10,rn=new Map,tE={for:{type:"React.MutableRefObject<any> | string",required:!0},hideDelay:"number",isShown:"TooltipVisibility",kind:"TooltipKind",offsets:"[number, number]",altOffsets:"[number, number]",onDeferred:"() => void",position:"Position",altPosition:"Position",showOn:"TooltipShowTrigger",title:"string | ReactNode"};function ct({children:e,className:t,for:n,"data-testid":o,hideDelay:a=A.TOOLTIP_HIDE_DELAY_MS_DEFAULT,isShown:s,kind:i=A.TooltipKind.DEFAULT,offsets:l=[0,0],altOffsets:c,onDeferred:d,position:u=A.Position.TOP_MIDDLE,altPosition:m=$r(u),showOn:p=A.TooltipShowTrigger.MOUSEOVER,style:f,title:g,unsafelyReplaceClassName:v}){const y=r.useRef({instanceKey:Symbol("ds-react:tooltip:instance-key"),prevIsShown:s,hideTimer:null}),[b,h]=r.useState(!1),I=r.useRef(null),C=typeof n=="string"?r.useRef(document.getElementById(n)):n,D=r.useCallback(()=>{y.current.hideTimer&&(clearTimeout(y.current.hideTimer),y.current.hideTimer=null)},[]),L=r.useCallback(()=>{D(),h(!1)},[]),$=r.useCallback((T=!1)=>{if(T===!0&&rn.size>0)return d&&d(),!1;if(I.current?.textContent==="")return console.warn("SpsTooltip is empty; aborting show"),!1;D();for(const k of rn.values())k();return h(!0),!0},[]),O=r.useCallback(T=>{T&&T.stopPropagation(),h(k=>k?(L(),!1):$())},[]),_=r.useCallback(T=>{I.current&&!I.current.contains(T.target)&&L()},[]),R=r.useCallback(()=>{D(),y.current.hideTimer=setTimeout(L,a)},[]),H=r.useCallback(T=>{const[k,U]=T.split(" ");if(U==="middle")return 0;const J=C?.current?.getBoundingClientRect();if(!J)return 0;const te=Wd*Math.sqrt(2),ne=(te-Wd)/2,W=eE-ne+te/2;return["top","bottom"].includes(k)?!J.width||J.width>50?0:J.width/2-W:["left","right"].includes(k)?!J.height||J.height>50?0:J.height/2-W:0},[]);r.useEffect(()=>{if(typeof n=="string"&&(C.current=document.getElementById(n)),b?rn.set(y.current.instanceKey,L):rn.has(y.current.instanceKey)&&rn.delete(y.current.instanceKey),p===A.TooltipShowTrigger.MANUAL){if(s!==y.current.prevIsShown)switch(s){case"visible":$();break;case"defer_visible":$(!0);break;case"hidden":L();break;case"delayed_hidden":R();break}y.current.prevIsShown=s}},[b,s]),r.useEffect(()=>{if(C.current)switch(p){case A.TooltipShowTrigger.MOUSEOVER:C.current.addEventListener("mouseenter",$),C.current.addEventListener("mouseleave",R);break;case A.TooltipShowTrigger.CLICK:C.current.addEventListener("click",O),document.addEventListener("click",_);break;case A.TooltipShowTrigger.MANUAL:break}},[C]),r.useEffect(()=>{I.current?.textContent===""&&b&&(y.current.hideTimer&&(clearTimeout(y.current.hideTimer),y.current.hideTimer=null),h(!1))},[e,b]),r.useEffect(()=>()=>{D(),rn.has(y.current.instanceKey)&&rn.delete(y.current.instanceKey),C.current&&(C.current.removeEventListener("mouseenter",$),C.current.removeEventListener("mouseleave",R),C.current.removeEventListener("click",O),document.removeEventListener("click",_))},[]);const Z=gn("sps-tooltip-portal"),V=r.useContext(rt),[[w,F],B]=r.useState([{},!1]),M=()=>{const T=[l[0]-Hd,l[1]+H(u)],k=m?[(c?.[0]??l[0])-Hd,(c?.[1]??l[1])+H(m)]:T;return Sn(I,C,u,{altPosition:m,setMinWidth:!1,offsets:T,altOffsets:k,...V})},q=r.useRef(M);q.current=M,r.useEffect(()=>{B(b?q.current():[{},!1])},[b,u,m,l[0],l[1],c?.[0],c?.[1],V?.fixed,V?.parentElementRef,e]),r.useEffect(()=>{if(!b)return;const T=()=>{B(q.current())};return document.addEventListener("scroll",T),()=>{document.removeEventListener("scroll",T)}},[b]);const N=K(v||"sps-tooltip","z-stratum-tip",`sps-tooltip--${i}`,`sps-tooltip--pos-${(F?m:u).replace(" ","-")}`,b&&"sps-tooltip--shown",t);return Z(r.createElement("div",{role:"tooltip",className:N,"data-testid":o,ref:I,style:{...f,...w},onMouseEnter:p===A.TooltipShowTrigger.MOUSEOVER?D:void 0,onMouseLeave:p===A.TooltipShowTrigger.MOUSEOVER?R:void 0},g&&(typeof g=="string"?r.createElement("span",{className:"sps-tooltip__title d-block"},g):g),r.createElement("span",{className:"sps-tooltip__body d-block"},e),r.createElement("span",{className:"sps-tooltip__caret"})))}Object.assign(ct,{props:tE,displayName:"SpsTooltip"});const Gd={error:"boolean",errors:"ReactNodeOrRenderFn",help:"ReactNodeOrRenderFn",labelFor:"SpsFormFieldMeta<any>",required:"boolean"};function rr(e){const{children:t,className:n,error:o,errors:a,help:s,labelFor:i,required:l,"data-testid":c,unsafelyReplaceClassName:d,...u}=e,m=r.useRef(null),p=r.useRef();function f(){return p?.current&&p.current.parentElement?.classList.contains("sps-form-group--error")}function g(){return i&&!i.isPristine()&&!i.isValid()}const[v,y]=r.useState(),[b,h]=r.useState(ge.HIDDEN);r.useEffect(()=>{y(g()||f()?A.TooltipKind.ERROR:A.TooltipKind.HELP)}),r.useEffect(()=>{p.current=m?.current?.getElementsByClassName("sps-form-group__label")[0];const D=()=>h(ge.VISIBLE),L=()=>h(ge.HIDDEN);return p.current&&(p.current.addEventListener("focus",D),p.current.addEventListener("blur",L)),()=>{p.current&&(p.current.removeEventListener("focus",D),p.current.removeEventListener("blur",L))}}),i&&(i.onFocus=()=>h(ge.VISIBLE),i.onBlur=()=>h(ge.HIDDEN));const I=K(d||"sps-description-list__term",(l||i&&i.isRequired())&&"sps-description-list__term--required",(o||g())&&"sps-description-list__term--error",n);function C(){h(b===ge.VISIBLE?ge.HIDDEN:ge.VISIBLE)}return r.createElement(r.Fragment,null,r.createElement("dt",{className:I,"data-testid":`${c}`,ref:m,onMouseEnter:()=>h(ge.VISIBLE),onMouseLeave:()=>h(ge.DELAYED_HIDDEN),onClick:C,...u},t),r.createElement(ct,{kind:v,for:m,showOn:A.TooltipShowTrigger.MANUAL,isShown:b},qe(v===A.TooltipKind.ERROR?a:s)))}Object.assign(rr,{props:Gd,displayName:"SpsDescriptionListTerm / SpsDt"});function Ud(e){return r.createElement(rr,{...e})}Object.assign(Ud,{props:Gd,displayName:"SpsDescriptionListTerm / SpsDt"});const zd={general:{label:"General Usage",description:()=>E.createElement(E.Fragment,null,E.createElement("p",null,"Description Lists should be used to group a series of related terms (and their accompanying descriptions) together in a tabular-like format."),E.createElement("p",null,"Note: Description Lists are not the required pattern for listing terms and descriptions, but should be used when it benefits the legibility of the content over other typographic formats such as unordered lists or tables."),E.createElement("h5",null,"Use a Description List"),E.createElement("ul",null,E.createElement("li",{className:"mb-2"},"To display two or more terms that have accompanying descriptions or values.")),E.createElement("h5",null,"Do Not Use a Description List"),E.createElement("ul",null,E.createElement("li",{className:"mb-2"},"To display a single term"),E.createElement("li",{className:"mb-2"},"If the listed terms do not have descriptions")))},basic:{label:"Basic Description Lists",description:()=>E.createElement("p",null,"Description Lists are available in two sizes. Additionally, the left column can be set to one of three different width options to best accomodate the content in each specific use case."),examples:{oneToThree:{description:()=>E.createElement("h5",null,"1-to-3"),react:S.code`
|
|
2235
2235
|
import { SpsDl, SpsDt, SpsDd } from "@spscommerce/ds-react";
|
|
2236
2236
|
function DemoComponent() {
|
|
2237
2237
|
return (
|
|
@@ -2705,7 +2705,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
2705
2705
|
</SpsForm>
|
|
2706
2706
|
)
|
|
2707
2707
|
}
|
|
2708
|
-
`}}}},
|
|
2708
|
+
`}}}},nE=Do||Fr,oE={alignLeft:"boolean",disabled:"boolean",conformWidth:"boolean",icon:"SpsIcon",kind:"DropdownKind",label:"string",options:"Array<SpsActionMethod | [SpsActionDescriptor, () => void]>",spinning:"boolean",spinningTitle:"string",tallOptionList:"boolean",onOpen:"() => void",onClose:"() => void",loading:"boolean",maxHeightOptionListPx:"number",maxHeightOptionListRem:"number",disableOptionsMemoization:"boolean"};function an(e){const{action:t,alignLeft:n,className:o,conformWidth:a,disabled:s,icon:i,id:l,kind:c,label:d,options:u=[],tabIndex:m,spinning:p,spinningTitle:f,tallOptionList:g,unsafelyReplaceClassName:v,onOpen:y,onClose:b,loading:h,maxHeightOptionListPx:I,maxHeightOptionListRem:C,disableOptionsMemoization:D,...L}=e,{t:$}=he.useWoodlandLanguage(),O=Rt(l),[_,R]=r.useState(!1),[H,Z]=r.useState(!1),[V,w]=r.useState(),F=r.useRef(null),B=u.map(z=>typeof z=="function"?z:Object.assign(z[1],{...A.SPS_ACTION_DEFAULTS,...z[0]})),M=`${O.current}-button`,q=`${O.current}-menu`;let N,T;d?(T=c||A.DropdownKind.DEFAULT,N=i):(T=A.DropdownKind.ICON,N=i||A.SpsIcon.ELLIPSES);const k=r.useRef(null);r.useEffect(()=>{_&&y?y():!_&&b&&b()},[_]);function U(z){k.current&&!k.current.contains(z.target)&&R(!1)}function J(z){z.preventDefault(),!s&&!p&&R(!_)}function te(z){R(z)}function ne(){R(!1)}function W(z){s||(["Up","ArrowUp","Down","ArrowDown"].indexOf(z.key)>-1&&z.preventDefault(),w(hn(z)))}function X(z){z.detail!==O.current&&R(!1)}r.useEffect(()=>(document.addEventListener("click",U),document.addEventListener("DropdownOpened",X),()=>{document.removeEventListener("click",U),document.removeEventListener("DropdownOpened",X)}),[]),r.useEffect(()=>{if(_){F.current&&nE(F.current,{scrollMode:"if-needed"});const z=document.createEvent("CustomEvent");z.initCustomEvent("DropdownOpened",!1,!1,O.current),document.dispatchEvent(z)}},[_]);const Y=K(v||"sps-dropdown",_&&"sps-dropdown--open",_&&"z-stratum-dropdown",H&&"sps-dropdown--opens-upward",!d&&"sps-dropdown--no-label",s&&"disabled",o),G=K("sps-button",`sps-button--${T}`,s&&"sps-button--disabled",p&&"sps-button--spinning"),ee=T===A.DropdownKind.ICON&&!n?[A.Position.BOTTOM_RIGHT,A.Position.TOP_RIGHT]:void 0;return r.useEffect(()=>{let z;return _&&(z=()=>{R(!1)},window.addEventListener("resize",z)),()=>{z&&window.removeEventListener("resize",z)}},[_]),$n({isOpen:_,rootRef:k}),r.createElement("div",{...L,id:O.current,className:Y,onKeyDown:W},r.createElement("div",{onClick:J,className:G,ref:k},r.createElement("button",{type:"button",id:M,ref:F,"aria-haspopup":"true","aria-controls":q,"aria-expanded":_?!0:void 0,tabIndex:m,disabled:s,onClick:J},r.createElement("i",{className:K("sps-icon",`sps-icon-${N}`)}),d&&r.createElement("span",null,d),p&&r.createElement("div",{className:"sps-spinner",key:1},f||$("button.spinningTitle")))),r.createElement(Rn,{positionOverride:ee,isOpen:_,"aria-labelledby":M,keyDown:V,onOptionSelected:ne,id:q,attachTo:k,onPositionFlip:Z,onSelfToggle:te,options:B,offsets:[0,0],tall:g,optionRole:"option",loading:h,maxHeightPx:I,maxHeightRem:C,disableOptionsMemoization:D,specialAction:t,conformWidth:a}))}Object.assign(an,{props:oE,displayName:"SpsDropdown"});const jd={labelled:{label:"Labelled",examples:{default:{description:"<h3> Default Dropdown</h3>",react:S.code`
|
|
2709
2709
|
import {
|
|
2710
2710
|
SpsDropdown,
|
|
2711
2711
|
useSpsAction,
|
|
@@ -2942,7 +2942,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
2942
2942
|
</SpsTable>
|
|
2943
2943
|
)
|
|
2944
2944
|
}
|
|
2945
|
-
`}}}},
|
|
2945
|
+
`}}}},rE={checked:"boolean",onChange:"ChangeEventHandler",indeterminate:"boolean",disabled:"boolean",options:"Array<SpsActionMethod | [SpsActionDescriptor, () => void]>"};function ss(e){const{options:t,className:n,checked:o,onChange:a,indeterminate:s,disabled:i,"data-testid":l,...c}=e,d=K("sps-checkbox-dropdown",n);return r.createElement("span",{className:d,"data-testid":l,...c},r.createElement(Jt,{indeterminate:s,checked:o,disabled:i,onChange:a,inline:!0,"data-testid":`${l}__checkbox`}),r.createElement(an,{disabled:i,options:t,icon:A.SpsIcon.CHEVRON_DOWN,"data-testid":`${l}__dropdown`}))}Object.assign(ss,{props:rE,displayName:"SpsCheckboxDropdown"});const aE={errors:"ReactNodeOrRenderFn",formMeta:"SpsFormSetMeta<any>",legend:"string",hasRequiredFields:"boolean",optional:"boolean",enabled:"boolean",onToggled:"(isEnabled: boolean) => void",tooltip:"string",applyNestedStyles:"boolean"};function is({children:e,className:t,errors:n,formArray:o,formGroup:a,formMeta:s,legend:i,unsafelyReplaceClassName:l,hasRequiredFields:c=!1,optional:d=!1,enabled:u=!1,onToggled:m,tooltip:p,applyNestedStyles:f,"data-testid":g,errorsTooltipTrigger:v=A.TooltipShowTrigger.CLICK,errorsTooltipPosition:y=A.Position.LEFT_MIDDLE}){const b=a||o,h=r.useRef(null),I=r.useRef(null),[C,D]=r.useState(ge.HIDDEN),[L,$]=r.useState(!1),[O,_]=r.useState(u);Kr(()=>{m?.(O)},[O]),r.useEffect(()=>{if(b||s){const Z=b&&b.isFocused()||s&&s.isFocused();!L&&Z?D(ge.VISIBLE):L&&!Z&&D(ge.HIDDEN),$(Z||!1)}});const R=K(l||f?"nested-styles-fieldset":"sps-fieldset",(b&&!b.isPristine()&&b.invalid||s&&(!s.isValid()||!s.contentsAreValid()))&&"sps-fieldset--error",t,d&&!O&&"sps-fieldset--collapsed",c&&"sps-fieldset--required-fields");function H(){D(C===ge.VISIBLE?ge.HIDDEN:ge.VISIBLE)}return r.createElement("div",{className:"sps-fieldset-container"},r.createElement("fieldset",{className:R,"data-testid":g},r.createElement("legend",{className:"sps-fieldset__legend",ref:h,onMouseEnter:()=>D(ge.VISIBLE),onMouseLeave:()=>D(ge.DELAYED_HIDDEN),onClick:H},d&&r.createElement(Jt,{checked:O,className:"d-inline-flex pr-1",onChange:Z=>{_(Z.target.checked)},"data-testid":`${g}__checkbox`}),i,p&&r.createElement("span",{className:"sps-fieldset__legend-icon",ref:I},r.createElement(ht,{icon:A.SpsIcon.INFO_CIRCLE,"data-testid":`${g}__info-icon`}))),p&&r.createElement(ct,{for:I},p),!!n&&r.createElement(ct,{for:h,kind:A.TooltipKind.ERROR,showOn:v,position:y,isShown:C},qe(n)),e))}Object.assign(is,{props:aE,displayName:"SpsFieldset"});const Yd={basic:{label:"Basic Content Sections",description:"info about basic content sections",examples:{basic:{react:S.code`
|
|
2946
2946
|
import {
|
|
2947
2947
|
useSpsForm,
|
|
2948
2948
|
SpsFieldset,
|
|
@@ -3222,7 +3222,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
3222
3222
|
</SpsForm>
|
|
3223
3223
|
)
|
|
3224
3224
|
}
|
|
3225
|
-
`}}}},
|
|
3225
|
+
`}}}},sE={disabled:"boolean",defaultValue:"number",min:"number",max:"number",step:"number",onValueChange:"(newValue: number) => void"};function ls(e){const{autoComplete:t,disabled:n,defaultValue:o=0,min:a=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:i=1,onValueChange:l,unsafelyReplaceClassName:c,className:d,"data-testid":u,...m}=e,[p,f]=r.useState(Math.max(a,o));r.useEffect(()=>{f(Math.max(a,o))},[o]);const[g,v]=r.useState(!1);r.useEffect(()=>{l&&typeof l=="function"&&l(p),v(p<a||p>s)},[p]);const y=()=>p<=a?!1:(p>s?f(s):f(C=>Math.max(C-i,a)),!0),b=()=>p>=s?!1:(p<a?f(a):f(C=>C+i),!0),h=C=>{C.target.value!==""&&f(parseInt(C.target.value,10))},I=c||K("sps-incrementor sps-input-group sps-input-group__append",d);return r.createElement("div",{className:I,...m,"data-testid":u},r.createElement("div",{className:"sps-button sps-button--icon"},r.createElement("button",{type:"button","data-testid":`${u}__minus`,onClick:y,disabled:n,"aria-label":`Subtract ${i}`},r.createElement("i",{className:"sps-icon sps-icon-minus","aria-hidden":"true"}))),r.createElement("div",{className:"sps-text-input"},r.createElement("input",{type:"text",className:K("sps-form-control",g&&"sps-input--error"),value:p,onChange:h,disabled:n,"data-testid":`${u}__input`,autoComplete:t})),r.createElement("div",{className:"sps-button sps-button--icon"},r.createElement("button",{type:"button","data-testid":`${u}__plus`,onClick:b,disabled:n,"aria-label":`Add ${i}`},r.createElement("i",{className:"sps-icon sps-icon-plus-sign","aria-hidden":"true"}))))}Object.assign(ls,{props:sE,displayName:"SpsIncrementor"});const qd={stepExample:{label:"Incrementor",description:"info about incrementor",examples:{stacked:{react:S.code`
|
|
3226
3226
|
import { SpsIncrementor } from "@spscommerce/ds-react";
|
|
3227
3227
|
function Component () {
|
|
3228
3228
|
const [value, setValue] = React.useState("");
|
|
@@ -3243,7 +3243,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
3243
3243
|
</React.Fragment>
|
|
3244
3244
|
);
|
|
3245
3245
|
}
|
|
3246
|
-
`}}}},
|
|
3246
|
+
`}}}},iE={for:{type:"SpsFormMetaBase<any>",required:!0},description:"string",stronglySuggested:"boolean",help:"ReactNodeOrRenderFn",helpIcon:"SpsIcon",helpIconColor:"string",errors:"ReactNodeOrRenderFn",helpTooltipPosition:"Position",helpTooltipAltPosition:"Position",errorTooltipPosition:"Position",errorTooltipAltPosition:"Position",preventativeErrorTooltipPosition:"Position",preventativeErrorTooltipAltPosition:"Position",suggestedTooltipPosition:"Position",suggestedTooltipAltPosition:"Position"};function cs({children:e,className:t,description:n,for:o,stronglySuggested:a,help:s,helpIcon:i=A.SpsIcon.QUESTION_CIRCLE,helpIconColor:l="blue200",errors:c,helpTooltipPosition:d=A.Position.TOP_MIDDLE,helpTooltipAltPosition:u=A.Position.TOP_MIDDLE,errorTooltipPosition:m=A.Position.TOP_MIDDLE,errorTooltipAltPosition:p=A.Position.LEFT_MIDDLE,preventativeErrorTooltipPosition:f=A.Position.TOP_MIDDLE,preventativeErrorTooltipAltPosition:g=A.Position.LEFT_MIDDLE,suggestedTooltipPosition:v=A.Position.TOP_LEFT,suggestedTooltipAltPosition:y=A.Position.TOP_LEFT,unsafelyReplaceClassName:b,"data-testid":h,...I}){const{t:C}=he.useWoodlandLanguage(),D=r.useRef(null),L=r.useRef(null),$=r.useRef(null),O=r.useRef(null),[_,R]=r.useState(ge.HIDDEN),[H,Z]=r.useState(ge.HIDDEN),[V,w]=r.useState(ge.HIDDEN),[F,B]=r.useState(ge.HIDDEN),M={maxLength:"This field accepts a maximum number of characters.",alpha:"This field accepts only alphabetic values.",numeric:"This field accpets only numerical values (zero or greater).",positiveOrNegativeNumber:"This field accpets only numerical values.",nonNumeric:"This field accepts only non-numerical values."};function q(){w(ge.HIDDEN),R(ge.HIDDEN)}function N(){Z(ge.HIDDEN),B(ge.HIDDEN)}function T(se){se.preventDefault(),N(),w(or(V))}function k(){return o&&(o instanceof Yt&&o.isVisibilyInvalid()||!(o instanceof Yt)&&!o.isValid())?[H,Z]:o&&o instanceof Yt&&o.hasPreventativeErrors()?[F,B]:[ge.HIDDEN,()=>{}]}function U(){N();const[se,pe]=k();pe(or(se))}function J(){N();const[,se]=k();se(ge.VISIBLE)}function te(se){se.preventDefault(),N(),R(or(_))}r.useEffect(()=>{o&&(o.onFocus=J,o.onBlur=N)},[o]);const ne=K(b||"sps-form-group__label-container",t),[W,X]=o instanceof Yt?[o,void 0]:[void 0,o];function Y(se,pe){return{dateFormat:`Please enter a date in the format ${pe}.`,dateRangeOrder:"End date cannot be before start date.",dateValidity:"Please enter a valid date.",max:`Please enter a value no greater than ${pe}.`,maxLength:`Please enter no more than ${pe} characters.`,min:`Please enter a value no less than ${pe}.`,minLength:`Please enter at least ${pe} characters.`,required:"This field is required."}[se]}function G(){if(W){for(const se of["dateFormat","dateRangeOrder","dateValidity","required","minLength"])if(W.hasError(se))return C(`label.errors.${se}`,{context:W.errors?W.errors[se]:"",defaultValue:`${Y(se,W.errors?W.errors[se]:"")}`});if(W.hasError("dateConstraint")){const se=W.errors?.dateConstraint,pe=se.minExceeded?"min":"max";return C(`label.errors.dateConstraint.${pe}`,{context:se,defaultValue:pe==="min"?`Please enter a date on or after ${typeof se=="object"?se.minExceeded:se}`:`Please enter a date on or prior to ${typeof se=="object"?se.maxExceeded:se}`})}}return null}function ee(){if(W){for(const se of wt)if(W.hasPreventativeError(se))return C(`label.preventativeErrors.${se}`,{defaultValue:`${M[se]}`})}return null}const[z,Q]=at(e,[{type:ht}]);r.useEffect(()=>{W?.hasPreventativeErrors()&&B(ge.VISIBLE)},[W?.hasPreventativeErrors()]);const fe=r.useRef(null);return r.useEffect(()=>{function se(pe){fe.current?.contains(pe.target)||q()}return document.addEventListener("click",se),()=>{document.removeEventListener("click",se)}},[]),r.createElement(Le,{ref:fe,formMeta:W,formControl:X},r.createElement("div",{className:ne},r.createElement("button",{className:K("sps-icon-button-wrapper","suggested-icon",!a&&"d-none"),tabIndex:0,onClick:T,type:"button","aria-label":`${Q} Strongly Suggested Help`,hidden:!a},r.createElement("i",{ref:L,"data-testid":`${h}__suggested-icon`,className:K("sps-icon","sps-icon-exclamation-triangle","orange200","sps-form-group__label-suggested-icon",!a&&"d-none")})),r.createElement("i",{ref:D,"data-testid":`${h}__error-icon`,className:K("sps-icon","sps-icon-exclamation-circle","sps-form-group__label--error-icon"),onClick:U,"aria-label":`${Q} Error Help`}),r.createElement("label",{htmlFor:o&&"id"in o?o.id:void 0,className:"sps-form-group__label","data-testid":h,...I},r.createElement("span",{ref:O,className:"sps-form-group__label-content"},Q)),r.createElement("button",{className:K("sps-icon-button-wrapper",!s&&"d-none"),tabIndex:0,onClick:te,type:"button","aria-label":`${Q} Help`,hidden:!s},r.createElement("i",{ref:$,"data-testid":`${h}__help-icon`,className:K("sps-icon",`sps-icon-${i}`,l,!s&&"d-none"),onClick:te})),z),r.createElement(ct,{kind:A.TooltipKind.DEFAULT,for:$,showOn:A.TooltipShowTrigger.MANUAL,isShown:_,position:d,altPosition:u},qe(s)),r.createElement(ct,{kind:A.TooltipKind.ERROR,for:D,showOn:A.TooltipShowTrigger.MANUAL,isShown:H,position:m,altPosition:p},qe(c)||G()),W?.hasPreventativeErrors()&&r.createElement(ct,{kind:A.TooltipKind.WARNING,for:O,showOn:A.TooltipShowTrigger.MANUAL,isShown:F,position:f,altPosition:g},qe(c)||ee()),r.createElement(ct,{kind:A.TooltipKind.DEFAULT,for:L,position:v,altPosition:y,showOn:A.TooltipShowTrigger.MANUAL,isShown:V},C("label.stronglySuggested")),n&&r.createElement("div",{className:"sps-form-control__description","data-testid":`${h}__description`},n))}Object.assign(cs,{props:iE,displayName:"SpsLabel"});const Jd={general:{label:"General Usage",description:()=>r.createElement("p",null,"In almost all cases, input fields should be paired with a label describing the value to be entered into the field. Certain labels can be accompanied by icons to provide additional information or context about that particular field.")},basic:{label:"Basic Label",examples:{basic:{react:S.code`
|
|
3247
3247
|
import {
|
|
3248
3248
|
SpsLabel,
|
|
3249
3249
|
SpsTextInput,
|
|
@@ -3446,11 +3446,11 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
3446
3446
|
></SpsTextInput>
|
|
3447
3447
|
</>;
|
|
3448
3448
|
}
|
|
3449
|
-
`}}}},
|
|
3449
|
+
`}}}},lE={clearSelected:{type:"() => void",required:!0},itemsSelected:{type:"string | number",required:!0}};function ds(e){const{itemsSelected:t,clearSelected:n,children:o,className:a,"data-testid":s,unsafelyReplaceClassName:i,...l}=e,{t:c}=he.useWoodlandLanguage(),d=()=>{typeof n=="function"&&n()},u=K(i||"sps-list-action-bar-container","z-stratum-actionbar",a);return t?r.createElement("div",{className:u,...l,"data-testid":s},r.createElement("div",{className:"sps-list-action-bar"},r.createElement("div",{className:"sps-list-action-bar__details"},r.createElement("span",{className:"sps-tag sps-tag--info","data-testid":`${s}__badge`},t),c("listActionBar.itemsSelected",{defaultValue:"Items Selected"})),r.createElement("div",{className:"sps-list-action-bar__actions"},r.createElement(rt.Provider,{value:{fixed:!0}},o)),r.createElement("div",{className:"sps-list-action-bar__clear"},r.createElement(Ne,{kind:A.ButtonKind.LINK,icon:A.SpsIcon.X,onClick:d,"data-testid":`${s}__clear-button`},c("listActionBar.clearSelected",{defaultValue:"Clear Selected"}))))):r.createElement(r.Fragment,null)}Object.assign(ds,{props:lE,displayName:"SpsListActionBar"});const ar=r.createContext({resizeable:!1,resizeState:{},setResizeState:()=>{},setSingleResizeState:()=>{},sort:[],setSort:()=>{}}),cE=({children:e,resizeable:t=!1,resizeState:n,onResizeStateChange:o,sort:a,onSortChange:s})=>{const[i,l]=r.useState(n||{}),[c,d]=r.useState(a||[]),u=r.useRef(s);u.current=s;const m=r.useRef(o);m.current=o,r.useEffect(()=>{a&&a!==c&&d(a)},[a]);const p=r.useCallback(y=>{d(y),u.current?.(y)},[]),f=r.useCallback(y=>{l(y),m.current?.(y)},[]),g=r.useCallback((y,b)=>{l(h=>{const I={...h,[y]:b};return m.current?.(I),I})},[]),v=r.useMemo(()=>({resizeable:t,resizeState:i,setResizeState:f,setSingleResizeState:g,sort:c,setSort:p}),[t,i,f,g,c,p]);return r.createElement(ar.Provider,{value:v},e)},Xd=(e,t)=>{r.useLayoutEffect(()=>{if(e&&t.current){let n=0,o=!0,a=t.current.previousElementSibling;for(;a!==null;){if(!a.classList.contains("sps-table__cell--pinned")){o=!1;break}a=a.previousElementSibling}if(o){for(a=t.current.previousElementSibling;a!==null;)n+=a.clientWidth,a=a.previousElementSibling;t.current.style.left=`${n}px`}else{let s=t.current.nextElementSibling;for(;s!==null;)n+=s.clientWidth,s=s.nextElementSibling;t.current.style.right=`${n}px`}}})},dE=e=>{r.useLayoutEffect(()=>{const t=()=>{if(!e.current)return;const n=e.current.querySelectorAll("table > thead > tr:first-child > .sps-table__cell--pinned"),o=e.current.offsetWidth-e.current.clientWidth,a=e.current.offsetHeight-e.current.clientHeight;if(n.length>0){const s=[],i=[];n.forEach(d=>{let u=!0,m=d.previousElementSibling;for(;m!==null;){if(!m.classList.contains("sps-table__cell--pinned")){u=!1;break}m=m.previousElementSibling}u?s.push(d):i.push(d)});const l=s.reduce((d,u)=>d+u.clientWidth,0),c=i.reduce((d,u)=>d+u.clientWidth,0);e.current.style.backgroundPosition=`${l}px 0,
|
|
3450
3450
|
calc(100% - ${c}px) 0,
|
|
3451
3451
|
${l}px ${-a}px,
|
|
3452
3452
|
calc(100% - ${c+o}px) ${-a}px`}else e.current.style.backgroundPosition=`0 0, 100% 0, 0 ${-a}px,
|
|
3453
|
-
calc(100% - ${o}px) ${-a}px`};return e.current&&(t(),e.current.addEventListener("scroll",t),window.addEventListener("scroll",t)),()=>{e.current&&e.current.removeEventListener("scroll",t),window.removeEventListener("scroll",t)}})},cE=(e,t,n)=>{r.useLayoutEffect(()=>{const o=e.current;if(!o)return;const a=o?.querySelector("thead"),s=o?.querySelector("table"),i=document.body.querySelector(".sps-navbar-container");let l=o?.querySelector(".placeholder-head"),c,d=!1,m=null;const u=()=>({tableBodyFirstRowCells:s?.querySelector("tbody>tr")?.querySelectorAll("td")??null,tableHeadCells:a?.querySelectorAll("th")??null}),p=H=>{const Z=Math.max(0,o.scrollWidth-o.clientWidth);return Math.min(Math.max(H,0),Z)},f=()=>{a&&(a.style.position=t?"sticky":"",a.style.top=t?"0":"",a.style.overflowX="",a.style.overflowY="",a.classList.remove("sps-table__head--scroll-x-hidden"),a.style.maxWidth="",a.style.width="",a.style.minWidth=""),l&&(l.style.width="",l.style.height="");const{tableBodyFirstRowCells:H,tableHeadCells:Z}=u();H&&Array.from(H).forEach((V,w)=>{const F=Z?.[w];if(F){const B=F.getAttribute("data-resizekey"),M=B&&n?n[B]:void 0;if(M){const q=`${M}px`;F.style.minWidth=q,F.style.maxWidth=q,F.style.width=q,V.style.minWidth=q,V.style.maxWidth=q,V.style.width=q}else F.style.minWidth="",F.style.width="",F.style.maxWidth="",V.style.minWidth="",V.style.width="",V.style.maxWidth=""}else V.style.minWidth="",V.style.width="",V.style.maxWidth=""})},g=H=>{!a||!o||d||(d=!0,H==="container"?a.scrollLeft=o.scrollLeft:o.scrollLeft=a.scrollLeft,d=!1)},v=()=>g("container"),y=()=>g("head"),b=()=>{let H=null;c===window?H=i?i.getBoundingClientRect().height:0:c instanceof HTMLElement&&(H=c.getBoundingClientRect().top);const Z=o.scrollLeft,V=a?.getBoundingClientRect(),w=o.getBoundingClientRect();if(H&&V&&V.top<=H&&H<=w.bottom-V.height&&w.top<=H){const{tableBodyFirstRowCells:F,tableHeadCells:B}=u();if(F&&B&&Array.from(F).forEach((q,N)=>{const T=B[N];if(!T)return;const k=q.getBoundingClientRect().width,U=T.getBoundingClientRect().width,J=`${Math.max(k,U)}px`;T.style.minWidth=J,T.style.width=J,T.style.maxWidth=J,q.style.minWidth=J,q.style.width=J,q.style.maxWidth=J}),a&&e.current){a.style.position="fixed",a.style.top=`${H}px`,a.style.overflowX="scroll",a.style.overflowY="hidden",a.classList.add("sps-table__head--scroll-x-hidden");const q=e.current.offsetWidth-e.current.clientWidth,N=`${w.width-q}px`;a.style.maxWidth=N,a.style.width=N,a.style.minWidth=N}l||(l=document.createElement("div"),l.className="placeholder-head",o.insertBefore(l,s));const M=l;M.style.width=`${V.width}px`,M.style.height=`${V.height}px`}else l&&(o.removeChild(l),l=null,f());o.scrollLeft=p(Z),g("container")},h=()=>{const H=o.scrollLeft;f(),b(),o.scrollLeft=p(H),g("container")},I=()=>{m==null&&(m=window.requestAnimationFrame(()=>{m=null,h()}))};let C,D=!1;const L=()=>a?.classList.contains("sps-table__head--pinned")??!1,$=()=>{if(D||!a)return;D=!0,c=Ai(o)||window,c?.addEventListener("scroll",b),window.addEventListener("resize",h),o.addEventListener("scroll",v),a.addEventListener("scroll",y);const H=s?.querySelector("tbody");H&&(C=new MutationObserver(I),C.observe(H,{childList:!0,subtree:!0,characterData:!0})),h()},O=()=>{D&&(D=!1,c&&(c.removeEventListener("scroll",b),c=void 0),window.removeEventListener("resize",h),o.removeEventListener("scroll",v),a?.removeEventListener("scroll",y),C?.disconnect(),C=void 0,m!=null&&(window.cancelAnimationFrame(m),m=null),l&&(o.removeChild(l),l=null),f())},_=()=>{L()?$():O()};_();let R;return a&&(R=new MutationObserver(_),R.observe(a,{attributes:!0,attributeFilter:["class"]})),()=>{R?.disconnect(),O()}},[t,n])},dE=(e,t)=>{const n=()=>{if(!e.current||!t)return;const o=e.current,a=o?.querySelector("table > thead"),s=o?.querySelector("table"),i=o?.querySelector(".shadow--top"),l=o?.querySelector(".shadow--bottom");if(a&&s&&i&&l){l.style.left="0",l.style.bottom="0",i.style.left="0";const c=o.offsetHeight-o?.clientHeight,d=s.getBoundingClientRect().height,m=a.getBoundingClientRect().height,u=o.scrollTop,p=d+c-o.getBoundingClientRect().height-o.scrollTop,f=o.scrollLeft;l.style.bottom=`${-u}px`,l.style.left=`${f}px`,l.style.opacity=p>0?"1":"0",i.style.top=`${u+m}px`,i.style.left=`${f}px`,i.style.opacity=u>0?"1":"0"}};r.useLayoutEffect(()=>{if(e.current&&t){const o=e.current.querySelector("table > thead");return o&&(o.style.position="sticky",o.style.top="0",o.style.zIndex="2",o.style.backgroundColor="#fff"),e.current.addEventListener("scroll",n),()=>{e.current?.removeEventListener("scroll",n)}}},[]),r.useLayoutEffect(()=>{e.current&&t&&n()})},pE={sort:"SortedColumn",onSortChange:"SortChangeHandler",selectable:"boolean",maxHeightPx:"number",maxHeightRem:"number",resizeable:"boolean",resizeState:"ResizeState",onResizeStateChange:"ResizeStateChangeHandler"};function sn({children:e,className:t,onSortChange:n,sort:o,"data-testid":a,unsafelyReplaceClassName:s,maxHeightPx:i,maxHeightRem:l,resizeable:c,resizeState:d,onResizeStateChange:m,...u}){const p=K(s||"sps-table-container",t),f=i?i/16:l,g=f?{maxHeight:`${f}rem`}:{},v=r.useRef(null);return dE(v,f),lE(v),cE(v,f,d),r.createElement(iE,{resizeable:c,resizeState:d,onResizeStateChange:m,sort:o,onSortChange:n},r.createElement("div",{ref:v,className:p,style:g},r.createElement("div",{className:"sps-table__shadow shadow--top"}),r.createElement("div",{className:"sps-table__shadow shadow--bottom"}),r.createElement("table",{className:"sps-table",role:"table","data-testid":`${a}`,...u},e)))}Object.assign(sn,{props:pE,displayName:"SpsTable"});function Jd(e){if(!e||!e.parentElement)return null;let t=e.parentElement;for(;t;){if(t.tagName.toLowerCase()==="table")return t;t=t.parentElement}return null}const Xd=({tableHeaderRef:e,resizerRef:t,resizeKey:n})=>{const{resizeable:o,resizeState:a,setSingleResizeState:s}=r.useContext(nr),i=!!o&&!!n,l=i?a?.[n]:0;return r.useLayoutEffect(()=>{let c,d=l,m=0;const u=Jd(e.current),p=e.current?.querySelector(".sps-table__column-resizer"),f=e.current?.querySelector(".sps-table__column-resizer-guide");function g(){if(e.current&&c&&(p&&(p.style.backgroundColor=Nr.colors.blue200,p.style.zIndex="999"),f&&u&&(f.style.height=`${u.getBoundingClientRect().height}px`,f.style.display="block"),u)){const L=u.querySelectorAll("thead > tr > th");for(let $=0;$<L.length;$+=1){const O=L[$].querySelector(".sps-table__column-resizer");L[$].style.cursor="col-resize",L[$]!==e.current&&O&&(L[$].classList.remove("sps-table__header--resizeable"),O.style.display="none")}}}function v(){e.current&&c&&p&&f&&(p.style.right=`${m}px`,p.style.zIndex="999",f.style.right=`${m}px`)}function y(){if(e.current){const L=d?`${d}px`:"";e.current.style.width=L,e.current.style.maxWidth=L,e.current.style.minWidth=L;const $=e.current.querySelector(".sps-table__header-cell-body");if($&&($.style.overflow=L?"hidden":"",$.style.textOverflow=L?"ellipsis":""),p&&f&&(p.style.right="0",p.style.backgroundColor="",p.style.zIndex="0",f.style.right="0",f.style.display="none"),e.current.classList.contains("sps-table__cell--pinned")||(e.current.style.position="relative"),u){const O=u.querySelectorAll("thead > tr > th");for(let _=0;_<O.length;_+=1){const R=O[_].querySelector(".sps-table__header-cell-body"),H=O[_].querySelector(".sps-table__column-resizer");O[_].style.cursor="default",O[_]!==e.current&&H&&(O[_].classList.add("sps-table__header--resizeable"),H.style.display="block"),R?.textContent&&!R.title&&(R.title=R.textContent)}}}}const b=L=>{e.current&&(L.preventDefault(),c=L.clientX,d=e.current.clientWidth,g())},h=L=>{if(!c||!e.current)return;const $=Math.max(Math.min(c-L.clientX,40),-40);$!==0&&(c=L.clientX,m+=$,d=Math.max(d-$,40),v())},I=()=>{!e.current||!c||(c=0,m=0,y(),s(n,d))},C=()=>{d=0,y(),s(n,d)};let D=!1;return i&&t.current&&(t.current.addEventListener("dragstart",b),t.current.addEventListener("mousedown",b),t.current.addEventListener("dblclick",C),window.addEventListener("mousemove",h),window.addEventListener("dragend",I),window.addEventListener("mouseup",I),D=!0,y()),()=>{t.current&&D&&(t.current.removeEventListener("dragstart",b),t.current.removeEventListener("mousedown",b),t.current.removeEventListener("dblclick",C)),D&&(window.removeEventListener("mousemove",h),window.removeEventListener("dragend",I),window.removeEventListener("mouseup",I))}},[i,l,n,s]),{isResizeable:i}},Zd=e=>{const{resizeable:t,resizeState:n}=r.useContext(nr);r.useLayoutEffect(()=>{if(!t||!n||!e.current)return;const o=Jd(e.current);if(!o)return;const a=o.querySelector(`thead > tr > th:nth-of-type(${e.current.cellIndex+1})`);if(!a)return;const s=a.getAttribute("data-resizekey");if(!s)return;const i=n[s],l=i?`${i}px`:"";e.current.style.width=l,e.current.style.maxWidth=l,e.current.style.minWidth=l,e.current.style.overflowWrap=l?"break-word":"",e.current.style.whiteSpace=l?"normal":"",e.current.title||(e.current.title=e.current.textContent||"")})},Qd={controlCell:"boolean",sortKey:"string",resizeKey:"string",pinned:"boolean"};function Be({children:e,className:t,controlCell:n,sortKey:o,resizeKey:a="","data-testid":s,unsafelyReplaceClassName:i,pinned:l=!1,...c}){const{sort:d,setSort:m}=r.useContext(nr),u=d?.find(h=>h.key===o),p=()=>{if(o&&!n){const h=u?.direction===A.SortDirection.ASCENDING?A.SortDirection.DESCENDING:A.SortDirection.ASCENDING;m([{key:o,direction:h}])}},f=h=>{(h.key==="Enter"||h.key===" "||h.key==="Spacebar")&&(h.preventDefault(),p())},g=r.useRef(null);qd(l,g);const v=r.useRef(null),{isResizeable:y}=Xd({tableHeaderRef:g,resizerRef:v,resizeKey:a}),b=K(i||"sps-table__header",n&&"sps-table__header--control",!o&&"sps-table__header--sort-disabled",u?.direction===A.SortDirection.ASCENDING&&"sps-table__header--sorted-asc",u?.direction===A.SortDirection.DESCENDING&&"sps-table__header--sorted-desc",l&&"sps-table__cell--pinned",y&&"sps-table__header--resizeable",t);return r.createElement("th",{className:b,ref:g,role:"columnheader","aria-sort":u?.direction||"none","data-testid":`${s}__header`,"data-resizekey":a||void 0,...c},r.createElement("span",{className:"sps-table__header-cell-body","data-testid":`${s}__header-cell-body`,onClick:p,tabIndex:o?0:void 0,onKeyDown:f},e),y&&r.createElement(r.Fragment,null,r.createElement("span",{ref:v,className:K("sps-table__column-resizer")}),r.createElement("span",{className:K("sps-table__column-resizer-guide")})))}Object.assign(Be,{props:Qd,displayName:"SpsTableHeader"});function ep(e){return r.createElement(Be,{...e})}Object.assign(ep,{props:Qd,displayName:"SpsTh"});const tp={pinned:"boolean"};function Ht({children:e,className:t,"data-testid":n,unsafelyReplaceClassName:o,pinned:a,...s}){const i=K(o||"sps-table__head",a&&"sps-table__head--pinned",t);return r.createElement("thead",{className:i,"data-testid":`${n}__head`,...s},e)}Object.assign(Ht,{props:tp,displayName:"SpsTableHead"});function np(e){return r.createElement(Ht,{...e})}Object.assign(np,{props:tp,displayName:"SpsThead"});const op={};function De({children:e,className:t,"data-testid":n,unsafelyReplaceClassName:o,...a}){const s=K(o||"sps-table__row",t);return r.createElement("tr",{className:s,role:"row","data-testid":`${n}__row`,...a},e)}Object.assign(De,{props:op,displayName:"SpsTableRow"});function rp(e){return r.createElement(De,{...e})}Object.assign(rp,{props:op,displayName:"SpsTr"});const ap={};function Wt(e){const{children:t,className:n,"data-testid":o,unsafelyReplaceClassName:a,...s}=e,i=K(a||"sps-table__body",n);return r.createElement("tbody",{className:i,"data-testid":`${o}__body`,...s},t)}Object.assign(Wt,{props:ap,displayName:"SpsTableBody"});function sp(e){return r.createElement(Wt,{...e})}Object.assign(sp,{props:ap,displayName:"SpsTbody"});const ip={buttonCell:"boolean",controlCell:"boolean",wrap:"SpsTableCellWrapWidth",pinned:"boolean"};function re(e){const{buttonCell:t,children:n,className:o,controlCell:a,"data-testid":s,unsafelyReplaceClassName:i,wrap:l,pinned:c=!1,...d}=e,m=K(i||"sps-table__cell",t&&"sps-table__cell--button-cell",a&&"sps-table__cell--control",l&&`sps-table__cell--text-wrap-${l}`,c&&"sps-table__cell--pinned",o),u=r.useRef(null);return qd(c,u),Zd(u),r.createElement("td",{className:m,ref:u,role:"cell","data-testid":`${s}__cell`,...d},n)}Object.assign(re,{props:ip,displayName:"SpsTableCell"});function lp(e){return r.createElement(re,{...e})}Object.assign(lp,{props:ip,displayName:"SpsTd"});const uE={};function cp(e){const{children:t,className:n,unsafelyReplaceClassName:o,...a}=e,[s,i,l]=at(t,[{type:Ne,props:{kind:A.ButtonKind.LINK}},[{type:Ne,props:{kind:A.ButtonKind.ICON}},{type:an}]]),c=s.length>0&&(i.length>0||l.length>0),d=i.length>0&&l.length>0,m=K(o||"sps-button-group",n);return r.createElement("div",{className:m,...a},s.length>0&&s,c&&r.createElement("div",{className:"sps-vertical-rule"}),i.length>0&&i,d&&r.createElement("div",{className:"sps-vertical-rule"}),l.length>0&&l)}Object.assign(cp,{props:uE,displayName:"SpsButtonGroup"});const mE={basic:{label:"Basic Buttons",description:({NavigateTo:e})=>r.createElement("span",{className:"sps-body-14 mt-4"},"The most common type of button that can be used in most cases. Example: Basic Buttons in a"," ",r.createElement(e,{to:"Modal"},"Modal"),"."),examples:{basic:{description:"Without Icons",imports:S.code`
|
|
3453
|
+
calc(100% - ${o}px) ${-a}px`};return e.current&&(t(),e.current.addEventListener("scroll",t),window.addEventListener("scroll",t)),()=>{e.current&&e.current.removeEventListener("scroll",t),window.removeEventListener("scroll",t)}})},pE=(e,t,n)=>{r.useLayoutEffect(()=>{const o=e.current;if(!o)return;const a=o?.querySelector("thead"),s=o?.querySelector("table"),i=document.body.querySelector(".sps-navbar-container");let l=o?.querySelector(".placeholder-head"),c,d=!1,u=null;const m=()=>({tableBodyFirstRowCells:s?.querySelector("tbody>tr")?.querySelectorAll("td")??null,tableHeadCells:a?.querySelectorAll("th")??null}),p=H=>{const Z=Math.max(0,o.scrollWidth-o.clientWidth);return Math.min(Math.max(H,0),Z)},f=()=>{a&&(a.style.position=t?"sticky":"",a.style.top=t?"0":"",a.style.overflowX="",a.style.overflowY="",a.classList.remove("sps-table__head--scroll-x-hidden"),a.style.maxWidth="",a.style.width="",a.style.minWidth=""),l&&(l.style.width="",l.style.height="");const{tableBodyFirstRowCells:H,tableHeadCells:Z}=m();H&&Array.from(H).forEach((V,w)=>{const F=Z?.[w];if(F){const B=F.getAttribute("data-resizekey"),M=B&&n?n[B]:void 0;if(M){const q=`${M}px`;F.style.minWidth=q,F.style.maxWidth=q,F.style.width=q,V.style.minWidth=q,V.style.maxWidth=q,V.style.width=q}else F.style.minWidth="",F.style.width="",F.style.maxWidth="",V.style.minWidth="",V.style.width="",V.style.maxWidth=""}else V.style.minWidth="",V.style.width="",V.style.maxWidth=""})},g=H=>{!a||!o||d||(d=!0,H==="container"?a.scrollLeft=o.scrollLeft:o.scrollLeft=a.scrollLeft,d=!1)},v=()=>g("container"),y=()=>g("head"),b=()=>{let H=null;c===window?H=i?i.getBoundingClientRect().height:0:c instanceof HTMLElement&&(H=c.getBoundingClientRect().top);const Z=o.scrollLeft,V=a?.getBoundingClientRect(),w=o.getBoundingClientRect();if(H&&V&&V.top<=H&&H<=w.bottom-V.height&&w.top<=H){const{tableBodyFirstRowCells:F,tableHeadCells:B}=m();if(F&&B&&Array.from(F).forEach((q,N)=>{const T=B[N];if(!T)return;const k=q.getBoundingClientRect().width,U=T.getBoundingClientRect().width,J=`${Math.max(k,U)}px`;T.style.minWidth=J,T.style.width=J,T.style.maxWidth=J,q.style.minWidth=J,q.style.width=J,q.style.maxWidth=J}),a&&e.current){a.style.position="fixed",a.style.top=`${H}px`,a.style.overflowX="scroll",a.style.overflowY="hidden",a.classList.add("sps-table__head--scroll-x-hidden");const q=e.current.offsetWidth-e.current.clientWidth,N=`${w.width-q}px`;a.style.maxWidth=N,a.style.width=N,a.style.minWidth=N}l||(l=document.createElement("div"),l.className="placeholder-head",o.insertBefore(l,s));const M=l;M.style.width=`${V.width}px`,M.style.height=`${V.height}px`}else l&&(o.removeChild(l),l=null,f());o.scrollLeft=p(Z),g("container")},h=()=>{const H=o.scrollLeft;f(),b(),o.scrollLeft=p(H),g("container")},I=()=>{u==null&&(u=window.requestAnimationFrame(()=>{u=null,h()}))};let C,D=!1;const L=()=>a?.classList.contains("sps-table__head--pinned")??!1,$=()=>{if(D||!a)return;D=!0,c=Vi(o)||window,c?.addEventListener("scroll",b),window.addEventListener("resize",h),o.addEventListener("scroll",v),a.addEventListener("scroll",y);const H=s?.querySelector("tbody");H&&(C=new MutationObserver(I),C.observe(H,{childList:!0,subtree:!0,characterData:!0})),h()},O=()=>{D&&(D=!1,c&&(c.removeEventListener("scroll",b),c=void 0),window.removeEventListener("resize",h),o.removeEventListener("scroll",v),a?.removeEventListener("scroll",y),C?.disconnect(),C=void 0,u!=null&&(window.cancelAnimationFrame(u),u=null),l&&(o.removeChild(l),l=null),f())},_=()=>{L()?$():O()};_();let R;return a&&(R=new MutationObserver(_),R.observe(a,{attributes:!0,attributeFilter:["class"]})),()=>{R?.disconnect(),O()}},[t,n])},uE=(e,t)=>{const n=()=>{if(!e.current||!t)return;const o=e.current,a=o?.querySelector("table > thead"),s=o?.querySelector("table"),i=o?.querySelector(".shadow--top"),l=o?.querySelector(".shadow--bottom");if(a&&s&&i&&l){l.style.left="0",l.style.bottom="0",i.style.left="0";const c=o.offsetHeight-o?.clientHeight,d=s.getBoundingClientRect().height,u=a.getBoundingClientRect().height,m=o.scrollTop,p=d+c-o.getBoundingClientRect().height-o.scrollTop,f=o.scrollLeft;l.style.bottom=`${-m}px`,l.style.left=`${f}px`,l.style.opacity=p>0?"1":"0",i.style.top=`${m+u}px`,i.style.left=`${f}px`,i.style.opacity=m>0?"1":"0"}};r.useLayoutEffect(()=>{if(e.current&&t){const o=e.current.querySelector("table > thead");return o&&(o.style.position="sticky",o.style.top="0",o.style.zIndex="2",o.style.backgroundColor="#fff"),e.current.addEventListener("scroll",n),()=>{e.current?.removeEventListener("scroll",n)}}},[]),r.useLayoutEffect(()=>{e.current&&t&&n()})},mE={sort:"SortedColumn",onSortChange:"SortChangeHandler",selectable:"boolean",maxHeightPx:"number",maxHeightRem:"number",resizeable:"boolean",resizeState:"ResizeState",onResizeStateChange:"ResizeStateChangeHandler"};function sn({children:e,className:t,onSortChange:n,sort:o,"data-testid":a,unsafelyReplaceClassName:s,maxHeightPx:i,maxHeightRem:l,resizeable:c,resizeState:d,onResizeStateChange:u,...m}){const p=K(s||"sps-table-container",t),f=i?i/16:l,g=f?{maxHeight:`${f}rem`}:{},v=r.useRef(null);return uE(v,f),dE(v),pE(v,f,d),r.createElement(cE,{resizeable:c,resizeState:d,onResizeStateChange:u,sort:o,onSortChange:n},r.createElement("div",{ref:v,className:p,style:g},r.createElement("div",{className:"sps-table__shadow shadow--top"}),r.createElement("div",{className:"sps-table__shadow shadow--bottom"}),r.createElement("table",{className:"sps-table",role:"table","data-testid":`${a}`,...m},e)))}Object.assign(sn,{props:mE,displayName:"SpsTable"});function Zd(e){if(!e||!e.parentElement)return null;let t=e.parentElement;for(;t;){if(t.tagName.toLowerCase()==="table")return t;t=t.parentElement}return null}const Qd=({tableHeaderRef:e,resizerRef:t,resizeKey:n})=>{const{resizeable:o,resizeState:a,setSingleResizeState:s}=r.useContext(ar),i=!!o&&!!n,l=i?a?.[n]:0;return r.useLayoutEffect(()=>{let c,d=l,u=0;const m=Zd(e.current),p=e.current?.querySelector(".sps-table__column-resizer"),f=e.current?.querySelector(".sps-table__column-resizer-guide");function g(){if(e.current&&c&&(p&&(p.style.backgroundColor=kr.colors.blue200,p.style.zIndex="999"),f&&m&&(f.style.height=`${m.getBoundingClientRect().height}px`,f.style.display="block"),m)){const L=m.querySelectorAll("thead > tr > th");for(let $=0;$<L.length;$+=1){const O=L[$].querySelector(".sps-table__column-resizer");L[$].style.cursor="col-resize",L[$]!==e.current&&O&&(L[$].classList.remove("sps-table__header--resizeable"),O.style.display="none")}}}function v(){e.current&&c&&p&&f&&(p.style.right=`${u}px`,p.style.zIndex="999",f.style.right=`${u}px`)}function y(){if(e.current){const L=d?`${d}px`:"";e.current.style.width=L,e.current.style.maxWidth=L,e.current.style.minWidth=L;const $=e.current.querySelector(".sps-table__header-cell-body");if($&&($.style.overflow=L?"hidden":"",$.style.textOverflow=L?"ellipsis":""),p&&f&&(p.style.right="0",p.style.backgroundColor="",p.style.zIndex="0",f.style.right="0",f.style.display="none"),e.current.classList.contains("sps-table__cell--pinned")||(e.current.style.position="relative"),m){const O=m.querySelectorAll("thead > tr > th");for(let _=0;_<O.length;_+=1){const R=O[_].querySelector(".sps-table__header-cell-body"),H=O[_].querySelector(".sps-table__column-resizer");O[_].style.cursor="default",O[_]!==e.current&&H&&(O[_].classList.add("sps-table__header--resizeable"),H.style.display="block"),R?.textContent&&!R.title&&(R.title=R.textContent)}}}}const b=L=>{e.current&&(L.preventDefault(),c=L.clientX,d=e.current.clientWidth,g())},h=L=>{if(!c||!e.current)return;const $=Math.max(Math.min(c-L.clientX,40),-40);$!==0&&(c=L.clientX,u+=$,d=Math.max(d-$,40),v())},I=()=>{!e.current||!c||(c=0,u=0,y(),s(n,d))},C=()=>{d=0,y(),s(n,d)};let D=!1;return i&&t.current&&(t.current.addEventListener("dragstart",b),t.current.addEventListener("mousedown",b),t.current.addEventListener("dblclick",C),window.addEventListener("mousemove",h),window.addEventListener("dragend",I),window.addEventListener("mouseup",I),D=!0,y()),()=>{t.current&&D&&(t.current.removeEventListener("dragstart",b),t.current.removeEventListener("mousedown",b),t.current.removeEventListener("dblclick",C)),D&&(window.removeEventListener("mousemove",h),window.removeEventListener("dragend",I),window.removeEventListener("mouseup",I))}},[i,l,n,s]),{isResizeable:i}},ep=e=>{const{resizeable:t,resizeState:n}=r.useContext(ar);r.useLayoutEffect(()=>{if(!t||!n||!e.current)return;const o=Zd(e.current);if(!o)return;const a=o.querySelector(`thead > tr > th:nth-of-type(${e.current.cellIndex+1})`);if(!a)return;const s=a.getAttribute("data-resizekey");if(!s)return;const i=n[s],l=i?`${i}px`:"";e.current.style.width=l,e.current.style.maxWidth=l,e.current.style.minWidth=l,e.current.style.overflowWrap=l?"break-word":"",e.current.style.whiteSpace=l?"normal":"",e.current.title||(e.current.title=e.current.textContent||"")})},tp={controlCell:"boolean",sortKey:"string",resizeKey:"string",pinned:"boolean"};function Be({children:e,className:t,controlCell:n,sortKey:o,resizeKey:a="","data-testid":s,unsafelyReplaceClassName:i,pinned:l=!1,...c}){const{sort:d,setSort:u}=r.useContext(ar),m=d?.find(h=>h.key===o),p=()=>{if(o&&!n){const h=m?.direction===A.SortDirection.ASCENDING?A.SortDirection.DESCENDING:A.SortDirection.ASCENDING;u([{key:o,direction:h}])}},f=h=>{(h.key==="Enter"||h.key===" "||h.key==="Spacebar")&&(h.preventDefault(),p())},g=r.useRef(null);Xd(l,g);const v=r.useRef(null),{isResizeable:y}=Qd({tableHeaderRef:g,resizerRef:v,resizeKey:a}),b=K(i||"sps-table__header",n&&"sps-table__header--control",!o&&"sps-table__header--sort-disabled",m?.direction===A.SortDirection.ASCENDING&&"sps-table__header--sorted-asc",m?.direction===A.SortDirection.DESCENDING&&"sps-table__header--sorted-desc",l&&"sps-table__cell--pinned",y&&"sps-table__header--resizeable",t);return r.createElement("th",{className:b,ref:g,role:"columnheader","aria-sort":m?.direction||"none","data-testid":`${s}__header`,"data-resizekey":a||void 0,...c},r.createElement("span",{className:"sps-table__header-cell-body","data-testid":`${s}__header-cell-body`,onClick:p,tabIndex:o?0:void 0,onKeyDown:f},e),y&&r.createElement(r.Fragment,null,r.createElement("span",{ref:v,className:K("sps-table__column-resizer")}),r.createElement("span",{className:K("sps-table__column-resizer-guide")})))}Object.assign(Be,{props:tp,displayName:"SpsTableHeader"});function np(e){return r.createElement(Be,{...e})}Object.assign(np,{props:tp,displayName:"SpsTh"});const op={pinned:"boolean"};function Ht({children:e,className:t,"data-testid":n,unsafelyReplaceClassName:o,pinned:a,...s}){const i=K(o||"sps-table__head",a&&"sps-table__head--pinned",t);return r.createElement("thead",{className:i,"data-testid":`${n}__head`,...s},e)}Object.assign(Ht,{props:op,displayName:"SpsTableHead"});function rp(e){return r.createElement(Ht,{...e})}Object.assign(rp,{props:op,displayName:"SpsThead"});const ap={};function De({children:e,className:t,"data-testid":n,unsafelyReplaceClassName:o,...a}){const s=K(o||"sps-table__row",t);return r.createElement("tr",{className:s,role:"row","data-testid":`${n}__row`,...a},e)}Object.assign(De,{props:ap,displayName:"SpsTableRow"});function sp(e){return r.createElement(De,{...e})}Object.assign(sp,{props:ap,displayName:"SpsTr"});const ip={};function Wt(e){const{children:t,className:n,"data-testid":o,unsafelyReplaceClassName:a,...s}=e,i=K(a||"sps-table__body",n);return r.createElement("tbody",{className:i,"data-testid":`${o}__body`,...s},t)}Object.assign(Wt,{props:ip,displayName:"SpsTableBody"});function lp(e){return r.createElement(Wt,{...e})}Object.assign(lp,{props:ip,displayName:"SpsTbody"});const cp={buttonCell:"boolean",controlCell:"boolean",wrap:"SpsTableCellWrapWidth",pinned:"boolean"};function re(e){const{buttonCell:t,children:n,className:o,controlCell:a,"data-testid":s,unsafelyReplaceClassName:i,wrap:l,pinned:c=!1,...d}=e,u=K(i||"sps-table__cell",t&&"sps-table__cell--button-cell",a&&"sps-table__cell--control",l&&`sps-table__cell--text-wrap-${l}`,c&&"sps-table__cell--pinned",o),m=r.useRef(null);return Xd(c,m),ep(m),r.createElement("td",{className:u,ref:m,role:"cell","data-testid":`${s}__cell`,...d},n)}Object.assign(re,{props:cp,displayName:"SpsTableCell"});function dp(e){return r.createElement(re,{...e})}Object.assign(dp,{props:cp,displayName:"SpsTd"});const fE={};function pp(e){const{children:t,className:n,unsafelyReplaceClassName:o,...a}=e,[s,i,l]=at(t,[{type:Ne,props:{kind:A.ButtonKind.LINK}},[{type:Ne,props:{kind:A.ButtonKind.ICON}},{type:an}]]),c=s.length>0&&(i.length>0||l.length>0),d=i.length>0&&l.length>0,u=K(o||"sps-button-group",n);return r.createElement("div",{className:u,...a},s.length>0&&s,c&&r.createElement("div",{className:"sps-vertical-rule"}),i.length>0&&i,d&&r.createElement("div",{className:"sps-vertical-rule"}),l.length>0&&l)}Object.assign(pp,{props:fE,displayName:"SpsButtonGroup"});const SE={basic:{label:"Basic Buttons",description:({NavigateTo:e})=>r.createElement("span",{className:"sps-body-14 mt-4"},"The most common type of button that can be used in most cases. Example: Basic Buttons in a"," ",r.createElement(e,{to:"Modal"},"Modal"),"."),examples:{basic:{description:"Without Icons",imports:S.code`
|
|
3454
3454
|
import { SpsButton } from "@spscommerce/ds-react";
|
|
3455
3455
|
import { ButtonKind } from "@spscommerce/ds-shared";
|
|
3456
3456
|
`,jsx:S.code`
|
|
@@ -3905,7 +3905,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
3905
3905
|
<SpsButton className="mr-2 mb-1" kind={ButtonKind.KEY}>Button</SpsButton>
|
|
3906
3906
|
<SpsButton className="mr-2 mb-1" kind={ButtonKind.CONFIRM}>Button</SpsButton>
|
|
3907
3907
|
</>
|
|
3908
|
-
`}}}},
|
|
3908
|
+
`}}}},gE={},hE="sps-icon-button-panel";function up({children:e,className:t,...n}){const o=K(hE,t),[a]=at(e,[{type:Ne,props:{kind:A.ButtonKind.ICON}}]);return r.createElement("div",{className:o,...n},a)}Object.assign(up,{props:gE,displayName:"SpsIconButtonPanel"});const mp={generalUsage:{label:"General Usage",customSection:()=>r.createElement("section",{id:"table-general-usage"},r.createElement("div",{className:"flex-color-header"},r.createElement("h4",null,"General Usage"),r.createElement(Ne,{onClick:()=>{window.scrollTo({top:0,behavior:"smooth"})},kind:A.ButtonKind.LINK},"Back to Top")),r.createElement("h5",null,"Use Tables:"),r.createElement("ul",{className:"sps-body-14"},r.createElement("li",null,"Each record has more than 6 points of data"),r.createElement("li",null,"When more records need to be shown in the vertical space"),r.createElement("li",null,"When sorting options need to be precise (needs better explanation)."),r.createElement("li",null,"When tabular views are the expected/conventional view of thet data being displayed (one example: if the data is to be exported into a spreadsheet view).")),r.createElement("h5",null,"Avoid Tables:"),r.createElement("ul",{className:"sps-body-14"},r.createElement("li",null,"When large images need to be included amongst the data.")),r.createElement("div",null,"For additional help deciding which option best suits the data being displayed, refer to the List Usage Matrix."))},basic:{label:"Standard Tables",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("div",{className:"sps-body-14"},"Tables display tabular data in columns and rows with a header row used to identify the type of content in each column. The most common style of content displayed in tables is text (Small Body Copy), but additional elements such as tags and icons can be used when necessary."),r.createElement("br",null),r.createElement("div",{className:"sps-body-14"},"Tables can be used in conjunction with the"," ",r.createElement(e,{to:"List Toolbar"},"List Toolbar")," and"," ",r.createElement(e,{to:"Pagination"},"Pagination")," components for extended capabilities.")),examples:{basic:{react:S.code`
|
|
3909
3909
|
import {
|
|
3910
3910
|
SpsTable,
|
|
3911
3911
|
SpsTableHead,
|
|
@@ -5340,7 +5340,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
5340
5340
|
</>
|
|
5341
5341
|
);
|
|
5342
5342
|
}
|
|
5343
|
-
`}}}},
|
|
5343
|
+
`}}}},bE={basic:{label:"Basic Tag",examples:{basic:{react:S.code`
|
|
5344
5344
|
import { SpsTag } from "@spscommerce/ds-react";
|
|
5345
5345
|
import { TagKind } from "@spscommerce/ds-shared";
|
|
5346
5346
|
function Component() {
|
|
@@ -5476,7 +5476,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
5476
5476
|
</>
|
|
5477
5477
|
)
|
|
5478
5478
|
}
|
|
5479
|
-
`}}}},
|
|
5479
|
+
`}}}},fp={general:{label:"General Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("p",null,"The Action Bar is divided into three sections: Selection Counter, Action Buttons, and Clear Button. It spans the entire width of the browser window. The count in the Selection Counter persists across paginated views"),r.createElement("p",null,"For more information on acceptable content varieties in the Action Buttons section, refer to the Button Groups section on the"," ",r.createElement(e,{to:"button"},"Buttons")," page"),r.createElement("img",{src:"assets/images/list-action-bar-example.svg",alt:"A List Action Bar with labels on each section",className:"w-100 mb-3"}),r.createElement(sn,null,r.createElement(Ht,null,r.createElement(Be,null,"Order"),r.createElement(Be,null,"Section"),r.createElement(Be,null,"Content Varieties")),r.createElement(Wt,null,r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"1")),r.createElement(re,null,"Selection Counter"),r.createElement(re,null)),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"2")),r.createElement(re,null,"Action Buttons"),r.createElement(re,null)),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"3")),r.createElement(re,null,"Clear Button"),r.createElement(re,null,r.createElement(gt,{className:"mr-1"},"Basic Buttons"),r.createElement(gt,{className:"mr-1"},"Icon Buttons"),r.createElement(gt,{className:"mr-1"},"Text Buttons"))))))}},vE={kind:"FeedbackBlockKind",message:{type:"string",required:!0}};function ps(e){const{className:t,kind:n=A.FeedbackBlockKind.INFO,message:o,"data-testid":a,unsafelyReplaceClassName:s,...i}=e,l=K(s||"sps-micro-block",`sps-micro-block--${n}`,t);return r.createElement("div",{className:l,"data-testid":a,...i},r.createElement("i",{className:`sps-icon sps-icon-${A.FeedbackBlockIcons[n]}`,"aria-hidden":"true","data-testid":`${a}__icon`}),r.createElement("span",null,o))}Object.assign(ps,{props:vE,displayName:"SpsMicroBlock"});const Sp={infoBlock:{label:"Info Micro Block",examples:{infoBlock:{imports:S.code`
|
|
5480
5480
|
import { SpsMicroBlock } from "@spscommerce/ds-react";
|
|
5481
5481
|
import { FeedbackBlockKind } from "@spscommerce/ds-shared";
|
|
5482
5482
|
`,jsx:S.code`
|
|
@@ -5501,7 +5501,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
5501
5501
|
import { FeedbackBlockKind } from "@spscommerce/ds-shared";
|
|
5502
5502
|
`,jsx:S.code`
|
|
5503
5503
|
<SpsMicroBlock kind={FeedbackBlockKind.TIP} message="Pro Tip: Don't be a loser."/>
|
|
5504
|
-
`}}}},
|
|
5504
|
+
`}}}},yE={kind:"ModalKind",size:"ModalSize",title:"string",onClose:"() => void",focusElementOnOpen:"React.MutableRefObject<HTMLElement>",fullHeight:"boolean"};function sr({children:e}){return r.createElement("div",{className:"sps-modal__footer"},e)}Object.assign(sr,{props:{},propTypes:{},displayName:"SpsModalFooter"});function us({children:e,className:t,id:n,kind:o=A.ModalKind.GENERAL,size:a=A.ModalSize.SMALL,onClose:s,focusElementOnOpen:i,title:l,fullHeight:c=!1,...d}){const u=Rt(n),m=K("sps-modal","z-stratum-dialog",`sps-modal--${o}`,`sps-modal--${a}`,t),{t:p}=he.useWoodlandLanguage(),f=r.useRef(null),g=r.useRef(document.body.style.paddingRight||""),v=r.useRef(document.body.style.overflow||"");v.current==="hidden"&&(v.current="",g.current=""),r.useLayoutEffect(()=>{let C=!1;if(document.body.style.overflow!=="hidden"){const D=`${window.innerWidth-document.body.clientWidth}px`;document.body.style.paddingRight=D,document.body.style.overflow="hidden",C=!0}return()=>{C&&(document.body.style.overflow=v.current,document.body.style.paddingRight=g.current)}},[]),r.useEffect(()=>{i&&i.current?i.current.focus():f.current&&f.current.focus()},[i]);const y=r.useCallback(C=>{if(C&&C.key==="Escape"&&s&&s(),C&&C.key==="Tab"&&f.current){const D=f.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),L=D[0],$=D[D.length-1];D.length===0?C.preventDefault():C.shiftKey&&C.target===L?(C.preventDefault(),$.focus()):!C.shiftKey&&C.target===$&&(C.preventDefault(),L.focus())}},[s]),[[b],h]=at(e,[{type:sr}]),I={general:"Action",info:"Info",success:"Success",warning:"Warning","serious-warning":"Warning"};return r.createElement("div",{id:u.current,role:"dialog","aria-modal":!0,"aria-labelledby":`${u.current}-title`,className:m,onKeyDown:y,tabIndex:-1,ref:f,"data-react-aria-top-layer":"true"},r.createElement("div",{...d,className:K("sps-modal__dialog",{"sps-modal__dialog-full-height":c})},r.createElement("div",{className:"sps-modal__titlebar"},r.createElement("div",{className:"sps-modal__title",id:`${u.current}-title`},l||p(`modal.defaultTitle.${o}`,{defaultValue:`${I[o]}`})),s&&r.createElement("div",{className:"sps-button sps-button--icon",onClick:s},r.createElement("button",{"aria-label":p("modal.close",{defaultValue:"Close modal"}),type:"button"},r.createElement("i",{className:"sps-icon sps-icon-x"})))),r.createElement("div",{className:"sps-modal__body"},r.createElement(rt.Provider,{value:{parentElementRef:f,fixed:!0}},h)),b||r.createElement("div",{className:"sps-modal__footer"},r.createElement(Ne,{kind:o===A.ModalKind.SERIOUS_WARNING?A.ButtonKind.DELETE:A.ButtonKind.KEY,onClick:s},p("modal.defaultButtonLabel",{defaultValue:"Okay"})))))}Object.assign(us,{props:yE,displayName:"SpsModal"});const EE={title:"string",show:"boolean",closeOnEscapePressed:"boolean",onClose:"() => void",focusElementOnOpen:"React.MutableRefObject<HTMLElement>"};function ms({children:e,className:t,id:n,show:o,closeOnEscapePressed:a=!0,onClose:s,focusElementOnOpen:i,title:l,noBackground:c,...d}){const u=Rt(n),m=K("sps-slide-in-panel","z-stratum-dialog",o?"open":"",c?"no-background":"",t),{t:p}=he.useWoodlandLanguage(),f=r.useRef(null),g=r.useRef(document.body.style.paddingRight||""),v=r.useRef(document.body.style.overflow||"");v.current==="hidden"&&(v.current="",g.current=""),r.useLayoutEffect(()=>{let h=!1;if(o&&document.body.style.overflow!=="hidden"){const I=`${window.innerWidth-document.body.clientWidth}px`;document.body.style.paddingRight=I,document.body.style.overflow="hidden",h=!0}return()=>{h&&(document.body.style.overflow=v.current,document.body.style.paddingRight=g.current)}},[o]),r.useEffect(()=>{i&&i.current?i.current.focus():f.current&&f.current.focus()},[i]);const y=r.useCallback(h=>{if(a&&h&&h.key==="Escape"&&s&&s(),h&&h.key==="Tab"&&f.current){const I=f.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),C=I[0],D=I[I.length-1];I.length===0?h.preventDefault():h.shiftKey&&h.target===C?(h.preventDefault(),D.focus()):!h.shiftKey&&h.target===D&&(h.preventDefault(),C.focus())}},[s]);r.useEffect(()=>(window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y)}),[y]);const[b]=at(e);return r.createElement("div",{id:u.current,role:"dialog","aria-labelledby":`${u.current}-title`,className:m,tabIndex:-1,ref:f,"data-react-aria-top-layer":"true"},r.createElement("div",{...d,className:`sps-slide-in-panel__dialog ${o?"open":""}`},r.createElement("div",{className:"sps-slide-in-panel__titlebar"},r.createElement("div",{className:"sps-slide-in-panel__title",id:`${u.current}-title`},l||p("slideInPanel.defaultTitle",{defaultValue:"Slide In Panel"})),s&&r.createElement("div",{className:"sps-button sps-button--icon",onClick:s},r.createElement("button",{"aria-label":p("slideInPanel.close",{defaultValue:"Close"}),type:"button"},r.createElement("i",{className:"sps-icon sps-icon-x"})))),r.createElement("div",{className:"sps-slide-in-panel__body"},r.createElement(rt.Provider,{value:{parentElementRef:f,fixed:!0}},b))))}Object.assign(ms,{props:EE,displayName:"SpsSlideInPanel"});const gp={generalUsage:{label:"General Usage",description:()=>r.createElement(r.Fragment,null),examples:{noCloseButton:{description:()=>r.createElement(r.Fragment,null,r.createElement("p",null,"Click on the button below to show the slide-in panel.")),react:S.code`
|
|
5505
5505
|
import { SpsButton, SpsSlideInPanel } from "@spscommerce/ds-react";
|
|
5506
5506
|
import { ButtonKind } from "@spscommerce/ds-shared";
|
|
5507
5507
|
function Component() {
|
|
@@ -5542,7 +5542,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
5542
5542
|
</SpsSlideInPanel>
|
|
5543
5543
|
</>;
|
|
5544
5544
|
}
|
|
5545
|
-
`}}}},
|
|
5545
|
+
`}}}},hp={generalUsage:{label:"General Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("h5",{className:"mt-2"},"Use a Modal:"),r.createElement("ul",null,r.createElement("li",null,"When the user needs to confirm a basic decision, such as deleting a record."),r.createElement("li",null,"When important information needs to be displayed to the user before continuing."),r.createElement("li",null,"When a simple selection, such as a single form input, is required before proceeding.")),r.createElement("h5",null,"Avoid a Modal:"),r.createElement("ul",null,r.createElement("li",null,"When a complex form is required. Use a"," ",r.createElement(e,{to:"Focused Task"},"Focused Task View")," instead."),r.createElement("li",null,"When sharing non-critical or tertiary information. Use a"," ",r.createElement(e,{to:"Growlers"},"Growler")," instead."))),examples:{noCloseButton:{description:()=>r.createElement(r.Fragment,null,r.createElement("h5",null,"Close Button"),r.createElement("p",null,"Remove the Close Button in the upper right of the Modal if the user must choose the course of action before proceeding.")),react:S.code`
|
|
5546
5546
|
import {
|
|
5547
5547
|
SpsButton,
|
|
5548
5548
|
SpsModal,
|
|
@@ -5992,7 +5992,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
5992
5992
|
</>
|
|
5993
5993
|
);
|
|
5994
5994
|
}
|
|
5995
|
-
`}}}},
|
|
5995
|
+
`}}}},TE={captionKey:"string",clearSearchOnBlur:"boolean",clearSearchOnEnter:"boolean",clearSearchOnSelection:"boolean",debounce:"number",disabled:"boolean",disableSelected:"boolean",comparisonKey:"string",conformWidth:"boolean",formMeta:"SpsFormFieldMeta<any[]>",hideSelected:"boolean",icon:"SpsIcon",onChange:"ChangeEventHandler",onSearchChange:"(searchText: string) => void",options:"Eventually<any[]> | (filter?: string) => Eventually<any[]>",placeholder:"string",tallOptionList:"boolean",textKey:"string",value:"any",zeroState:"string",loading:"boolean",filterByTextAndCaptionKey:"boolean",maxHeightOptionListPx:"number",maxHeightOptionListRem:"number",disableOptionsMemoization:"boolean"};function fs({action:e,captionKey:t,className:n,clearSearchOnBlur:o,clearSearchOnEnter:a,clearSearchOnSelection:s=!0,conformWidth:i,debounce:l,disabled:c,disableSelected:d=!1,comparisonKey:u,formControl:m,formMeta:p,hideSelected:f,id:g,onChange:v,onSearchChange:y,options:b,placeholder:h,tallOptionList:I,textKey:C,unsafelyReplaceClassName:D,value:L,zeroState:$="There are no matching options.",loading:O,filterByTextAndCaptionKey:_,icon:R,maxHeightOptionListPx:H,maxHeightOptionListRem:Z,disableOptionsMemoization:V,"data-testid":w,wrap:F=!1,...B}){const M=L??[],q=p||m,{wrapperId:N,controlId:T}=Ge(g,q),[k,U]=Dt({keyDown:null,opensUpward:!1,searchText:"",activeTagIndex:null,optionIds:""});r.useEffect(()=>{y&&y(k.searchText)},[k.searchText]);const J=r.useRef(null),te=r.useRef(null),ne=r.useRef(null),W=r.useRef(null),X=r.useRef(null);function Y(){o&&U({searchText:""})}const{showPopup:G,doShowPopup:ee,doHidePopup:z}=bn(J,W,Y);function Q(){U({activeTagIndex:null}),ee()}function fe(){setTimeout(()=>{ne.current?.focus()},0)}function se(oe){if(X.current&&X.current.children.length&&typeof oe=="number"){const je=X.current.children[oe]?.querySelector(".sps-clickable-tag__icon");je&&je.focus()}}function pe(oe,ue=!0){ue&&U({searchText:""}),q&&(q.setValue(oe),q.markAsDirty()),v&&v(new Lt({value:oe}))}function He(oe){M.indexOf(oe)===-1&&pe([...M,oe],s),fe()}function $e(oe){const ue=M.filter((je,So)=>So!==oe);pe(ue)}function Xe(oe){U({searchText:oe.target.value})}function nt(oe){if(!c){const ue=!f&&!oe.target.selectionStart&&M&&M.length;switch(oe.key){case"Backspace":if(k.activeTagIndex===M.length-1){$e(k.activeTagIndex),fe();return}if(k.activeTagIndex!==null){$e(k.activeTagIndex);return}if(ue){pe(M.slice(0,M.length-1));return}break;case"Delete":if(k.activeTagIndex!==null){$e(k.activeTagIndex);return}break;case"Up":case"ArrowUp":case"Down":case"ArrowDown":oe.preventDefault();break;case"Left":case"ArrowLeft":if(ue){k.activeTagIndex===null?(U({activeTagIndex:M.length-1}),z(),se(M.length-1)):k.activeTagIndex>0&&(U({activeTagIndex:k.activeTagIndex-1}),z(),se(k.activeTagIndex-1));return}break;case"Right":case"ArrowRight":if(k.activeTagIndex!==null){k.activeTagIndex===M.length-1?(U({activeTagIndex:null}),ee(),ne.current?.focus()):(U({activeTagIndex:k.activeTagIndex+1}),se(k.activeTagIndex+1));return}break;case"Tab":z();break;case"Escape":z(),ne.current?.blur();break;case"Enter":a&&U({searchText:""});break}U({keyDown:hn(oe)})}}function mt(oe){U({opensUpward:oe})}function xe(oe){pe([]),oe.stopPropagation()}function ot(oe){U({optionIds:new Array(oe).fill("").map((ue,je)=>`${N}-options-option-${je}`).join(",")})}const Ve=r.useCallback(()=>{U({searchText:""}),fe()},[]),ft=K(D||"sps-multi-select",G&&"sps-multi-select--open",G&&"z-stratum-dropdown",k.opensUpward&&"sps-multi-select--opens-upward",c&&"sps-form-control--disabled",n),_e=new Array(M.length).fill(0).map((oe,ue)=>`${N}_tag-${ue}`);return r.useEffect(()=>{let oe;return G&&(oe=()=>{z()},window.addEventListener("resize",oe)),()=>{oe&&window.removeEventListener("resize",oe)}},[G]),$n({isOpen:G,rootRef:J}),r.createElement(Le,{id:N,className:ft,formControl:m,formMeta:p,ref:J,inputRef:ne,focusInputOnClick:!0,onKeyDown:nt,role:"listbox","aria-multiselectable":!0,"aria-activedescendant":_e[k.activeTagIndex||0],"aria-owns":k.optionIds},r.createElement("div",{className:"sps-text-input",ref:te},r.createElement("div",{className:K("sps-form-control",M&&!c&&"sps-form-control--clearable")},R&&r.createElement("i",{className:K("sps-text-input__icon","sps-icon",`sps-icon-${R}`)}),r.createElement("div",{className:"sps-multi-select__tags-and-input",ref:X},f?null:M.map((oe,ue)=>r.createElement(Vn,{id:_e[ue],role:"option",disabled:c,"aria-selected":"true",key:_e[ue],onRemove:()=>$e(ue),wrap:F},C?oe[C]:oe)),r.createElement("input",{type:"text",ref:ne,"data-testid":`${w}__option-list-input`,value:k.searchText,className:"sps-text-input__input",placeholder:M.length===0?h:void 0,id:T,onClick:Q,onChange:Xe,onFocus:Q,onKeyDown:nt,disabled:c,role:"listbox","aria-multiselectable":"true","aria-owns":_e.join(" "),...B})),M.length!==0&&!c?r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:oe=>xe(oe)}):null)),r.createElement(Rn,{id:`${N}_options`,ref:W,"data-testid":`${w}__option-list`,attachTo:te,captionKey:t,disabledOptions:d?M:null,isOpen:G,comparisonKey:u,keepOpen:!0,keyDown:k.keyDown,options:b,specialAction:e,onOptionSelected:He,onPositionFlip:mt,hideInlineSearch:!0,optionRole:"option",onOptionListChanged:ot,filterByTextAndCaptionKey:_,searchDebounce:l,search:k.searchText,tall:I,textKey:C,zeroState:$,loading:O,maxHeightPx:H,maxHeightRem:Z,disableOptionsMemoization:V,onSpecialActionSelect:Ve,conformWidth:i}))}Object.assign(fs,{props:TE,displayName:"SpsMultiSelect"});const bp={general:{label:"General Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("h5",null,"Use a Multi-Select"),r.createElement("ul",null,r.createElement("li",null,"When a list of predetermined values can be provided and the input allows multiple entries.")),r.createElement("h5",null,"Do Not Use a Multi-Select:"),r.createElement("ul",null,r.createElement("li",{className:"mb-2"},"When there are only two possible options. Consider"," ",r.createElement(e,{to:"checkbox"},"Checkboxes")," or"," ",r.createElement(e,{to:"radio-buttons"},"Radio Buttons")," instead."),r.createElement("li",null,"When it is ideal to display all available options without requiring a click. Consider"," ",r.createElement(e,{to:"checkbox"},"Checkboxes")," or"," ",r.createElement(e,{to:"radio-buttons"},"Radio Buttons")," instead.")),r.createElement("h5",null,"Using Multi-Selects in a Form"),r.createElement("p",null,"Reference the ",r.createElement(e,{to:"form"},"Forms")," page for guidelines for placing"," ",r.createElement(e,{to:"text-inputs"},"Inputs")," in Form Layouts."))},basicMultiSelect:{label:"Basic Multi-Selects",description:"Basic Multi-Selects include a label and dropdown menu including a list of options. The user is allowed to make a single selection.",examples:{basic:{react:S.code`
|
|
5996
5996
|
import {
|
|
5997
5997
|
SpsLabel,
|
|
5998
5998
|
SpsMultiSelect,
|
|
@@ -6374,7 +6374,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
6374
6374
|
<br />
|
|
6375
6375
|
{JSON.stringify(formValue)}
|
|
6376
6376
|
</>
|
|
6377
|
-
}`}}}},
|
|
6377
|
+
}`}}}},wE={page:"number",numPages:"number",onPageChange:"(pageNumber: number) => void",disabled:"boolean",unknownPageCount:"boolean",nextPageBtnDisabled:"boolean",onBeforeChange:"(page: number) => boolean | Promise<boolean>"};function ir(e){const{numPages:t=0,onPageChange:n,page:o=1,unsafelyReplaceClassName:a,className:s,"data-testid":i,disabled:l=!1,unknownPageCount:c=!1,nextPageBtnDisabled:d=!1,onBeforeChange:u,...m}=e,{t:p}=he.useWoodlandLanguage(),[f,g]=r.useState(o),[v,y]=r.useState(o);r.useEffect(()=>{y(o),g(o)},[o]);async function b(D){if(u&&!await u(D))return;const L=S.constrain(D,[1,t]);D!==v&&(y(L),g(L),n&&typeof n=="function"&&n(L))}function h(D){g(Number(D.target.value)||"")}const I=K(a||"sps-page-selector",s),C=Rt();return r.createElement("div",{className:I,"data-testid":i,...m},!c&&r.createElement(r.Fragment,null,r.createElement("div",{className:"sps-pagination__input-wrapper","data-testid":`${i}__input`},r.createElement("div",{className:"sps-form-control sps-pagination__input-sizer"},f),r.createElement("label",{htmlFor:C.current,className:"sr-only"},p("pagination.page",{defaultValue:"Page"})),r.createElement(so,{onSubmit:()=>b(Number(f))},r.createElement("input",{id:C.current,type:"text",value:f,onInput:h,onChange:()=>{},className:"sps-form-control sps-pagination__input",disabled:l,onBlur:()=>b(Number(f))}))),r.createElement("span",{className:"sps-page-selector__total-pages","data-testid":`${i}_page-count`},Number.isNaN(t)?p("pagination.ofMany",{defaultValue:"of many"}):p("pagination.ofPageCount",{pageCount:t,defaultValue:`of ${t}`}))),r.createElement("div",{className:"sps-icon-button-panel","data-testid":`${i}__buttons`},r.createElement("div",{className:K("sps-button","sps-button--icon",(v===1||l)&&"sps-button--disabled")},r.createElement("button",{type:"button",onClick:()=>b(v-1),disabled:v===1||l,title:p("pagination.prevPage",{defaultValue:"Previous Page"})},r.createElement("i",{className:"sps-icon sps-icon-chevron-left","aria-hidden":"true"}))),r.createElement("div",{className:K("sps-button","sps-button--icon",(v===t||l||d)&&"sps-button--disabled")},r.createElement("button",{type:"button",onClick:()=>b(v+1),disabled:v===t||l||d,title:p("pagination.nextPage",{defaultValue:"Next Page"})},r.createElement("i",{className:"sps-icon sps-icon-chevron-right","aria-hidden":"true"})))))}Object.assign(ir,{props:wE,displayName:"SpsPageSelector"});const CE={page:"number",pageSize:"number",pageSizeOptions:"Array<number>",totalResults:"number",onPageChange:"(page: number, pageSize: number, indices: [number, number]) => void",disabled:"boolean",unknownPageCount:"boolean",nextPageBtnDisabled:"boolean",resultsOnPage:"number",onBeforeChange:"(page: number, pageSize: number) => boolean | Promise<boolean>"};function Ss(e){const{className:t,onPageChange:n,page:o=1,pageSizeOptions:a=A.DEFAULT_PAGE_SIZE_OPTIONS,pageSize:s=a[0],"data-testid":i,totalResults:l,unsafelyReplaceClassName:c,disabled:d=!1,unknownPageCount:u=!1,nextPageBtnDisabled:m=!1,resultsOnPage:p,onBeforeChange:f,...g}=e,{t:v}=he.useWoodlandLanguage(),[y,b]=Dt({page:o,pageSize:s,numPages:0,indices:[0,0]});function h(R=y.pageSize){return l!==void 0?Math.ceil(l/R):NaN}function I(R=y.page,H=y.pageSize){const Z=h(H),V=R===Z&&l!==void 0&&l%H||H,w=p||(Z===0?0:V),F=(R-1)*H;return Z===0?[0,0]:[F+1,F+w]}function C(R){const H={page:R,indices:I(R)};return b(H),H}function D(R,H){const Z={page:H,pageSize:R,numPages:h(R),indices:I(H,R)};return b(Z),Z}r.useEffect(()=>{b({numPages:h(),indices:I()})},[l,p]),r.useEffect(()=>{o!==y.page&&C(o)},[o]),r.useEffect(()=>{s!==y.pageSize&&D(s,o!==y.page?o:y.page)},[s]);function L(){return typeof l=="number"?l:v("pagination.many",{defaultValue:"many"})}function $(R){const H=D(R.target.value,1);n(H.page,H.pageSize,H.indices)}function O(R){const H=C(R);n(H.page,y.pageSize,H.indices)}const _=K(c||"sps-pagination",t);return r.createElement("div",{className:_,"data-testid":i,...g},r.createElement("div",{"data-testid":`${i}__size-selector`,className:"sps-page-size-selector"},v("pagination.view",{defaultValue:"View"}),r.createElement(on,{options:a,onChange:$,notClearable:!0,autoFixWidth:!0,value:y.pageSize,className:"ml-1 mr-1",disabled:d,onBeforeChange:f?R=>f(y.page,Number(R)):void 0}),v("pagination.perPage",{defaultValue:"Per Page"})),u?r.createElement("div",{className:"sps-pagination__details"},`${v("pagination.viewing",{defaultValue:"Viewing"})} ${y.indices[0]} - ${y.indices[1]} ${v("pagination.ofMany",{defaultValue:"of many"})}`):r.createElement("div",{className:"sps-pagination__details"},`${v("pagination.viewing",{defaultValue:"Viewing"})} ${y.indices[0]} - ${y.indices[1]} ${v("pagination.of",{defaultValue:"of"})} ${L()}`),r.createElement(ir,{numPages:y.numPages,page:y.page,onPageChange:O,disabled:d,unknownPageCount:u,nextPageBtnDisabled:m,onBeforeChange:f?R=>f(R,y.pageSize):void 0}))}Object.assign(Ss,{props:CE,displayName:"SpsPagination"});const vp={general:{label:"General Usage",description:()=>r.createElement(r.Fragment,null,r.createElement("p",null,"Use the Standard Pagination Bar on a list page (comprised of a Table, Content Rows, or Content Tiles). It should always appear at the bottom of the listed records."),r.createElement("p",null,"Use the Mini Pagination component when a paginated list of results exists inside a smaller Card."))},pagination:{label:"Standard Pagination Bar",description:({Link:e})=>r.createElement(r.Fragment,null,r.createElement("p",null,"The Standard Pagination Bar is comprised of three main sections. The middle section is hidden from view when the width of its container is at the responsive breakpoint of 767 pixels."),r.createElement("ul",null,r.createElement("li",null,r.createElement("p",null,r.createElement("span",{className:"sps-text-semibold"},"Results-per-page Select")," (left): allows the user to adjust the number of records being displayed per page.*")),r.createElement("li",null,r.createElement("p",null,r.createElement("span",{className:"sps-text-semibold"},"Viewing details")," (middle): describes which results are being displayed on the current page.")),r.createElement("li",null,r.createElement("p",null,r.createElement("span",{className:"sps-text-semibold"},"Page Navigator")," (right): allows the user to navigate between pages of results"))),r.createElement("i",null,"*Note: For Tables and Content Rows, per-page options should be 25, 50, and 100. For Content Tiles, per-page options should be 24, 48, and 100."),r.createElement("br",null),r.createElement("p",{className:"mt-2"},"To see an example of the Standard Pagination Bar in context with a Table, view the Table Lists section on the ",r.createElement(e,{to:"/style-and-layout/page-types"},"Page Types")," page.")),examples:{basic:{description:()=>r.createElement("h4",null,"Building the Standard Pagination Bar"),react:S.code`
|
|
6378
6378
|
import { SpsPagination } from "@spscommerce/ds-react";
|
|
6379
6379
|
function Component() {
|
|
6380
6380
|
const [page, setPage] = React.useState(2);
|
|
@@ -6489,7 +6489,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
6489
6489
|
function Component() {
|
|
6490
6490
|
return <SpsPageSelector numPages={25} onPageChange={() => {}} disabled />;
|
|
6491
6491
|
}
|
|
6492
|
-
`}}}},
|
|
6492
|
+
`}}}},DE={checked:"boolean",disabled:"boolean",formMeta:"SpsFormFieldMeta<any>",inline:"boolean",centered:"boolean",label:"string",name:{type:"string",required:!0},onChange:"ChangeEventHandler",value:"any"};function gs({checked:e,className:t,"data-testid":n,disabled:o,formControl:a,formMeta:s,id:i,inline:l,centered:c,label:d,name:u,onChange:m,ref:p,unsafelyReplaceClassName:f,value:g,...v}){const y=s||a,b=r.useRef(null),{wrapperId:h,controlId:I}=Ge(i),C=K(f||"sps-radio-button","sps-checkable",l&&"sps-checkable--inline",c&&"sps-checkable--centered",!d&&"sps-checkable--no-label",t);function D(L){y&&(y.setValue(g),y.markAsDirty()),m&&m(L),b.current?.focus()}return r.createElement(Le,{id:h,className:C,formControl:a,formMeta:s,inputRef:b,ref:p,"data-testid":`${n}`,onClick:()=>b.current?.click()},r.createElement("input",{type:"radio",ref:b,className:"sps-checkable__input","data-checked":e?"checked":void 0,"data-testid":`${n}__radio-input`,id:I,name:u,checked:e,disabled:o,onChange:D,...v}),r.createElement("label",{className:"sps-checkable__label",htmlFor:I},d||""))}Object.assign(gs,{props:DE,displayName:"SpsRadioButton"});const yp={general:{label:"General Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("h5",null,"Use Radio Buttons:"),r.createElement("ul",null,r.createElement("li",null,"When only one option can be selected from the available options.")),r.createElement("h5",null,"Do Not Use Radio Buttons:"),r.createElement("ul",null,r.createElement("li",null,"When a selection causes an immediate change in the system. Use a"," ",r.createElement(e,{to:"toggle"},"Toggle")," instead."),r.createElement("li",null,"When multiple options can be selected from the available options. Use"," ",r.createElement(e,{to:"checkbox"},"Checkboxes")," instead."),r.createElement("li",null,"When the list of available options requires too much space to list efficiently. Use"," ",r.createElement(e,{to:"dropdown"},"Dropdown")," instead.")),r.createElement("h5",null,"Using Radio Buttons in a Form"),r.createElement("p",null,"Reference the ",r.createElement(e,{to:"form"},"Forms")," page for guidelines for placing Radio Buttons in Form Layouts."),r.createElement("h5",null,"End to End Testing Radio Buttons"),r.createElement("p",null,'To determine if a radio button is checked in an E2E test, you should Use data-checked="checked".'))},basic:{label:"Basic Radio Buttons",description:()=>r.createElement("p",null,"Radio Buttons that represent related options are grouped together with a label. The groups can be arranged horizontally or vertically to best utilize available space."),examples:{horizontal:{description:()=>r.createElement("h4",null,"Horizontal Group"),react:S.code`
|
|
6493
6493
|
import {
|
|
6494
6494
|
useSpsForm,
|
|
6495
6495
|
SpsForm,
|
|
@@ -7033,7 +7033,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
7033
7033
|
</SpsForm>
|
|
7034
7034
|
);
|
|
7035
7035
|
}
|
|
7036
|
-
`}}}},
|
|
7036
|
+
`}}}},Ep=({branch:e,setActiveBranch:t,activeBranch:n})=>{const[o,a]=E.useState(e.expanded||!1);return r.createElement("ul",{className:K("sps-side-nav__branch",e.name===n&&"sps-side-nav__branch--active")},r.createElement("li",{className:K("sps-side-nav__leaf",e.name===n&&"sps-side-nav__leaf--active")},r.createElement("span",{className:"sps-side-nav__link",onClick:()=>{a(!o),e.subNavItems||t(e.name,e.key)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.stopPropagation(),s.preventDefault(),a(!o),e.subNavItems||t(e.name,e.key))},role:"tab",tabIndex:0,"aria-selected":e.name===n},e.subNavItems&&r.createElement("i",{className:K("sps-icon sps-side-nav__toggle",o?"sps-icon-chevron-down":"sps-icon-chevron-right")}),r.createElement("span",{className:"sps-side-nav__link-title"},e.icon&&r.createElement("i",{className:`sps-icon sps-icon-${e.icon} mr-2`}),e.name),r.createElement("div",{className:"sps-side-nav__link-tag",style:{marginTop:"-2px"}},e.tag&&r.createElement("span",{className:`sps-tag sps-tag--${e.tag}`},e.tagContent))),e.subNavItems&&o&&e.subNavItems.map(s=>r.createElement(Ep,{branch:{...s,expanded:lr(s.subNavItems||[],n)},setActiveBranch:t,activeBranch:n,key:s.key??s.name}))))},lr=(e,t)=>e?e.some(n=>n.name===t)||e.some(n=>lr(n.subNavItems||[],t)):!1,Tp=({title:e,titleIcon:t,navOptions:n,onNavChange:o,activeNavItem:a,tabs:s,onTabChange:i,initialActiveTab:l,filterable:c,filterInputPlaceholder:d})=>{const u=E.useRef(a),[m,p]=E.useState(a),[f,g]=E.useState(l||(s?s[0]:"")),[v,y]=E.useState(""),b=(D,L)=>{p(D),o&&o(D,L)},h=D=>{g(D),i&&i(D)},I=D=>D?D.some(L=>L.name.toLowerCase().includes(v))||D.some(L=>I(L.subNavItems||[])):!1,C=n.map(D=>({...D,navItems:D.navItems.filter(L=>L.name.toLowerCase().includes(v)||I(L.subNavItems||[]))}));return a!==u.current&&(p(a),u.current=a),r.createElement("div",{className:"sps-side-nav sps-card"},e&&r.createElement("div",{className:"sps-card__header",title:e},r.createElement("div",{className:"sps-card__title"},t&&r.createElement("i",{className:`sps-icon sps-icon-${t}`}),e)),s&&r.createElement("nav",{className:"sps-nav sps-nav--tabs"},s.map(D=>r.createElement("span",{className:K("sps-nav__item","sps-nav__link",D===f&&"active"),"data-toggle":"tab",role:"tab",tabIndex:0,key:D,onClick:()=>h(D),onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.stopPropagation(),L.preventDefault(),h(D))}},r.createElement("span",null,D)))),r.createElement("div",{className:"sps-card__body"},c&&r.createElement("section",{className:"sps-side-nav__section"},r.createElement("div",{className:"sps-text-input"},r.createElement("div",{className:"sps-form-control"},r.createElement("i",{className:"sps-text-input__icon sps-icon sps-icon-filter"}),r.createElement("input",{type:"text",className:"sps-text-input__input",placeholder:d,onChange:D=>{y(D.target.value)}})))),C.map(D=>r.createElement("section",{className:"sps-side-nav__section",key:D.key??D.sectionTitle},D.sectionTitle&&r.createElement("div",{className:"sps-side-nav__section-title",style:{fontWeight:400}},D.sectionTitle),D.navItems.map(L=>r.createElement(Ep,{branch:{...L,expanded:lr(L.subNavItems||[],a)},activeBranch:m,setActiveBranch:($,O)=>{b($,O)},key:L.key??L.name}))))))},wp={usage:{label:"Usage",customSection:()=>r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("span",{className:"sps-body-14 mb-2"},"Use the Side Navigation if:"),r.createElement("ul",{className:"mt-2"},r.createElement("li",{className:"mb-1"},"The navigation benefits from subsections or nested structures"),r.createElement("li",{className:"mb-1"},"There are too many items for Tabbed Navigation"),r.createElement("li",null,"The navigation items have long names"))),r.createElement("div",null,r.createElement("span",{className:"sps-body-14 mb-2"},"Avoid using the Side Navigation if:"),r.createElement("ul",{className:"mt-2"},r.createElement("li",{className:"mb-1"},"Tabbed Navigation is sufficient"),r.createElement("li",{className:"mb-1"},"The full width of the page is required to sufficiently display content"))))},filter:{label:"Filter",description:"Use Filters when the Side Navigation benefits from filtering, usually when it contains a long list of navigation items.",examples:{simple:{react:S.code`
|
|
7037
7037
|
import { SpsSideNav } from "@spscommerce/ds-react";
|
|
7038
7038
|
import { SpsIcon } from "@spscommerce/ds-shared";
|
|
7039
7039
|
function DemoComponent() {
|
|
@@ -7354,7 +7354,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
7354
7354
|
</div>
|
|
7355
7355
|
);
|
|
7356
7356
|
}
|
|
7357
|
-
`}}}},
|
|
7357
|
+
`}}}},NE={disabled:"boolean",href:"string",label:"string",icon:"SpsIcon",kind:"StdButtonKind",options:"Array<SpsActionMethod | [SpsActionDescriptor, () => void]>",spinning:"boolean",spinningTitle:"string"};function hs(e){const{children:t,className:n,"data-testid":o,disabled:a,href:s,label:i,options:l,icon:c,kind:d=A.StdButtonKind.DEFAULT,spinning:u,spinningTitle:m,unsafelyReplaceClassName:p,onClick:f,...g}=e,v=r.useRef(null),[y,b]=r.useState({width:0}),[h,I]=r.useState(!1),[C,D]=r.useState(!1);r.useLayoutEffect(()=>{v.current&&b({width:v.current.offsetWidth})},[]),r.useEffect(()=>{D(!!u)},[u]);const L=()=>{I(!0)},$=()=>{I(!1)},O=K(p||"sps-split-button",`sps-split-button--${d}`,h&&"sps-split-button--open",n);return r.createElement(r.Fragment,null,C?r.createElement(Ne,{className:n,"data-testid":o,style:{width:y.width},kind:d,icon:c,href:s,spinning:!0,spinningTitle:m},i):r.createElement("div",{ref:v,className:O,"data-testid":o,...g},r.createElement(Ne,{kind:d,icon:c,href:s,disabled:a,onClick:f},i),r.createElement(an,{kind:d,options:l,disabled:a,onOpen:L,onClose:$})))}Object.assign(hs,{props:NE,displayName:"SpsSplitButton"});const Cp={kinds:{label:"Regular Split Buttons",description:S.code`<p>info about split buttons</p>`,examples:{basic:{description:S.code`<p>Basic</p>`,imports:S.code`
|
|
7358
7358
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
|
7359
7359
|
`,jsx:S.code`
|
|
7360
7360
|
<React.Fragment>
|
|
@@ -7426,7 +7426,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
7426
7426
|
]} className="mr-1">
|
|
7427
7427
|
</SpsSplitButton>
|
|
7428
7428
|
</React.Fragment>
|
|
7429
|
-
`}}}},
|
|
7429
|
+
`}}}},IE={};function co(e){const{children:t,className:n,"data-testid":o,unsafelyReplaceClassName:a,...s}=e,i=K(a||"sps-content-row__expansion",n);return r.createElement("div",{className:i,...s,"data-testid":`${o}__expansion`},t)}Object.assign(co,{props:IE,displayName:"SpsSummaryListExpansion"});const xE={expanded:"boolean",selected:"boolean",onToggle:"(isExpanded: boolean) => void"};function bs(e){const{children:t,className:n,expanded:o,onToggle:a,selected:s,"data-testid":i,unsafelyReplaceClassName:l,...c}=e,[d,u]=Dt({isExpanded:o,expandable:!1});r.useEffect(()=>{const b=r.Children.toArray(t).some(h=>r.isValidElement(h)&&h.type===co);u({expandable:b})},[]);function m(){const b=!d.isExpanded;u({isExpanded:b}),a&&a(b)}function p(b){b.stopPropagation(),m()}function f(b){(b.key==="Enter"||b.key===" "||b.key==="Spacebar")&&(b.preventDefault(),b.stopPropagation(),m())}const g=K(l||"sps-summary-list-row","sps-content-row",d.expandable&&"sps-summary-list-row--expandable",d.isExpanded&&"sps-content-row--expanded",s&&"sps-summary-list-row--selected",n),[v,y]=at(t,[{type:co}]);return console.warn(["The SpsSummaryListRow component will be replaced by the SpsContentRow component.","All references to it should be replaced before SpsSummaryListRow is removed.","Reach out to the design system help Slack channel if you have any questions!"].join(" ")),r.createElement("div",{className:g,"data-testid":i,...c},r.createElement("div",{className:"sps-content-row__col-group","data-testid":`${i}__col-group`,onClick:p,onKeyDown:f,tabIndex:0},y),v)}Object.assign(bs,{props:xE,displayName:"SpsSummaryListRow"});const kE={borderless:"boolean",lean:"boolean",leaner:"boolean",width:"string"};function vs(e){const{className:t,children:n,borderless:o,lean:a,leaner:s,"data-testid":i,unsafelyReplaceClassName:l,width:c,...d}=e,u=K(l||"sps-content-row__col",a&&"sps-content-row__col--lean",s&&"sps-content-row__col--leaner",o&&"sps-content-row__col--borderless",t);return r.createElement("div",{className:u,style:{width:c},...d,"data-testid":`${i}__col`},n)}Object.assign(vs,{props:kE,displayName:"SpsSummaryListColumn"});const Dp={basic:{label:"Basic Usage",examples:{basic:{imports:S.code`
|
|
7430
7430
|
import {
|
|
7431
7431
|
SpsSummaryListRow,
|
|
7432
7432
|
SpsSummaryListColumn,
|
|
@@ -7720,7 +7720,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
7720
7720
|
</SpsSummaryListRow>
|
|
7721
7721
|
);
|
|
7722
7722
|
}
|
|
7723
|
-
`}}}},
|
|
7723
|
+
`}}}},ME={tasks:"ReactSpsTask[]",taskQueuePosition:"Position",notificationText:"string",tooltipConfig:"{ position: Position, kind: TooltipKind }",onClose:"() => void",onOpen:"() => void",onClearCompleted:"() => void",suppressTooltips:"boolean"};function ys({tasks:e=[],taskQueuePosition:t=A.Position.BOTTOM_RIGHT,notificationText:n,tooltipConfig:o={},onOpen:a,onClose:s,onClearCompleted:i,className:l,"data-testid":c,unsafelyReplaceClassName:d,suppressTooltips:u=!1,...m}){const{t:p}=he.useWoodlandLanguage(),f=!!e.length,[g,v]=r.useState(!1),[y,b]=r.useState(f),h=r.useRef(null),I=r.useRef(null),C=r.useCallback(()=>{v(!1),s&&s()},[]);r.useEffect(()=>{g?window.addEventListener("resize",C):window.removeEventListener("resize",C)},[g]);const D=gn("sps-task-queue-portal"),L=r.useContext(rt),[$]=g?Sn(I,h,t,{altPosition:t,...L}):[{},!1],O=o.position||A.Position.BOTTOM_RIGHT,_=o.kind||A.TooltipKind.DEFAULT,R=e.filter(T=>T.unread).length,H=e.filter(T=>T.status===A.SpsTaskStatus.IN_PROGRESS).length,Z=e.some(T=>T.status===A.SpsTaskStatus.COMPLETED||T.status===A.SpsTaskStatus.ERRORED),V=r.useRef(s);V.current=s;const w=r.useRef(null),F=()=>{f&&!g?(v(!0),a&&a()):g&&(v(!1),s&&s()),w.current&&(w.current.scrollTop=0)},B=T=>T.status===A.SpsTaskStatus.IN_PROGRESS?A.SpsTaskStatusIcons[T.status]:`sps-icon sps-icon-${A.SpsTaskStatusIcons[T.status]}`;r.useEffect(()=>{g&&!f&&(v(!1),V.current&&V.current())},[g,f]);const M=r.useRef();r.useEffect(()=>{R>0?(b(!0),M.current&&window.clearTimeout(M.current),M.current=window.setTimeout(()=>{M.current=void 0,b(!1)},A.TASK_QUEUE_NOTIFICATION_DURATION_MS)):(M.current&&(window.clearTimeout(M.current),M.current=void 0),b(!1))},[R]),r.useEffect(()=>{const T=()=>{v(k=>(k&&V.current&&V.current(),!1))};return document.getElementById("root")?.addEventListener("click",T),()=>{document.getElementById("root")?.removeEventListener("click",T)}},[]),$n({isOpen:g,rootRef:h}),r.useEffect(()=>()=>{M.current&&window.clearTimeout(M.current)},[]);const q=K(d||"sps-task-queue",g&&"sps-task-queue--open",g&&"z-stratum-dropdown",!f&&"sps-task-queue--no-tasks",l);function N(T){return(T.actions||[]).map(k=>{if(r.isValidElement(k)){const U=k;if(U.type!==Ne||U.props.kind!==A.ButtonKind.ICON)throw new Error("Task queue task action must be a config object or an SpsButton of kind ICON");return U}else{const U=k;return r.createElement("div",{key:U.icon,className:"sps-button sps-button--icon"},r.createElement("button",{type:"button",title:U.label,disabled:U.disabled,onClick:()=>{U.onClick&&U.onClick(T)}},U.caption,U.icon&&r.createElement("i",{className:`sps-icon sps-icon-${U.icon}`,"aria-hidden":"true"})))}})}return r.createElement("div",{className:q,onClick:T=>{T.nativeEvent.stopImmediatePropagation()},"data-testid":c,...m},r.createElement("button",{type:"button",ref:h,className:"sps-task-queue__button",title:"Task Queue",onClick:F},!!R&&r.createElement("span",{className:"sps-tag sps-tag--info"},R),H?r.createElement("span",{className:"sps-spinner sps-spinner--small"}):r.createElement("i",{className:"sps-icon sps-icon-list","aria-hidden":"true"})),r.createElement(ct,{for:h,position:O,kind:_,showOn:f?A.TooltipShowTrigger.MANUAL:A.TooltipShowTrigger.MOUSEOVER,isShown:y&&!g?ge.VISIBLE:ge.HIDDEN,hideDelay:Number(f)&&A.TASK_QUEUE_NOTIFICATION_DURATION_MS},!u&&y&&(n||p("taskQueue.newTask",{defaultValue:"You have a new task in your queue."})),!u&&!y&&!f&&p("taskQueue.noTasks",{defaultValue:"There are currently no tasks in your queue."})),D(r.createElement("div",{ref:I,className:K("sps-task-queue__task-list",g&&"sps-task-queue__task-list--open","z-stratum-dropdown"),style:$},r.createElement("div",{ref:w,className:"sps-task-queue__task-list-tasks"},e.map((T,k)=>r.createElement("div",{key:k,className:K("sps-task-queue__task",T.unread&&"sps-task-queue__task--unread")},r.createElement("i",{className:B(T)}),r.createElement("div",{className:"sps-task-queue__task-description"},r.createElement("div",{className:"sps-task-queue__task-heading"},T.heading),T.subheading&&r.createElement("div",{className:"sps-task-queue__task-subheading",title:T.subheading},T.subheading)),T.actions&&!!T.actions.length&&r.createElement("div",{className:"sps-task-queue__task-actions"},N(T))))),Z&&i&&r.createElement("div",{className:"sps-task-queue__footer"},r.createElement("div",{className:"sps-button sps-button--link"},r.createElement("button",{type:"button",onClick:i},p("taskQueue.clearCompleted",{defaultValue:"Clear Completed"})))))))}Object.assign(ys,{props:ME,displayName:"SpsTaskQueue"});const Np={inProgress:{label:"Task Queue in progress",description:"<p>Info about Task Queue</p>",examples:{inProgress:{react:S.code`
|
|
7724
7724
|
import { SpsTaskQueue } from "@spscommerce/ds-react";
|
|
7725
7725
|
import { SpsTaskStatus, SpsIcon } from "@spscommerce/ds-shared";
|
|
7726
7726
|
|
|
@@ -8009,7 +8009,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
8009
8009
|
</div>
|
|
8010
8010
|
);
|
|
8011
8011
|
}
|
|
8012
|
-
`}}}},
|
|
8012
|
+
`}}}},LE={disabled:"boolean",formMeta:"SpsFormFieldMeta<string>",icon:"SpsIcon",name:"string",onChange:"ChangeEventHandler<HTMLInputElement>",placeholder:"string",value:"string",additionalText:"string"},cr=r.forwardRef(({className:e,disabled:t=!1,formControl:n,formMeta:o,icon:a,id:s,name:i,onChange:l,placeholder:c,"data-testid":d,title:u,unsafelyReplaceClassName:m,value:p="",additionalText:f,notClearable:g,...v},y)=>{const b=o||n,{wrapperId:h,controlId:I}=Ge(s,b),C=r.useRef(null);function D(_,R){b&&(b.setValue(_),b.markAsDirty()),l&&C.current&&l(R||new Lt(C.current))}function L(){C.current&&(C.current.value="",D(""))}function $(_){D(_.target.value,_)}const O=K(m||"sps-text-input",e);return r.createElement(Le,{id:h,className:O,formControl:n,formMeta:o,inputRef:C,ref:y,focusInputOnClick:!0,"data-testid":`${d}`},r.createElement("div",{className:K("sps-form-control",t&&"disabled")},a&&r.createElement("i",{className:K("sps-text-input__icon","sps-icon",`sps-icon-${a}`)}),r.createElement("input",{type:"text",ref:C,"data-testid":`${d}__input`,className:"sps-text-input__input",id:I,name:i,placeholder:c,onChange:$,title:u,value:p,disabled:t,...v}),!g&&p&&!t&&r.createElement("i",{"data-testid":`${d}__input_clear`,className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:L})),f&&r.createElement("p",{className:"sps-input__additional-text"},f))});Object.assign(cr,{props:LE,displayName:"SpsTextInput"});const Ip={general:{label:"General Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("h5",null,"Use a Text Input:"),r.createElement("ul",null,r.createElement("li",null,"When the value required is short (a single word or short phrase)."),r.createElement("li",null,"When only one value is required or accepted.")),r.createElement("h5",null,"Do Not Use a Text Input:"),r.createElement("ul",null,r.createElement("li",null,"When a value of considerable length (such as a sentence or paragraph) is required or accepted. Use a ",r.createElement(e,{to:"text-areas"},"Text Area")," instead."),r.createElement("li",null,"When more than one value is required or accepted in the field. Use"," ",r.createElement(e,{to:"multi-select"},"Multi-Select")," instead."),r.createElement("li",null,"When a boolean selection is required (such as on/off, yes/no, etc). Use"," ",r.createElement(e,{to:"checkbox"},"Checkboxes"),","," ",r.createElement(e,{to:"radio-buttons"},"Radio Buttons")," or"," ",r.createElement(e,{to:"toggle"},"Toggles")," instead.")),r.createElement("h5",null,"Using Text Inputs in a Form"),r.createElement("p",null,"Reference the ",r.createElement(e,{to:"form"},"Forms")," page for guidelines for placing Inputs in Form Layouts."))},basic:{label:"Basic Text Inputs",description:()=>r.createElement("p",null,"Basic Text Inputs include a label and an input field."),examples:{standard:{react:S.code`
|
|
8013
8013
|
import { SpsLabel, SpsTextInput, useSpsForm } from "@spscommerce/ds-react";
|
|
8014
8014
|
|
|
8015
8015
|
function DemoComponent() {
|
|
@@ -8084,7 +8084,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
8084
8084
|
</div>
|
|
8085
8085
|
);
|
|
8086
8086
|
}
|
|
8087
|
-
`}}}},
|
|
8087
|
+
`}}}},_E={disabled:"boolean",formMeta:"SpsFormFieldMeta<string>",name:"string",onChange:"ChangeEventHandler",placeholder:"string",rows:"number",value:"string",additionalText:"string"},PE=500;function Es({className:e,disabled:t=!1,formControl:n,formMeta:o,id:a,name:s,onChange:i,placeholder:l="",ref:c,rows:d=2,"data-testid":u,unsafelyReplaceClassName:m,value:p="",additionalText:f,...g}){const v=o||n,{wrapperId:y,controlId:b}=Ge(a,v),h=r.useRef(null),I=r.useRef(!1),C=r.useRef(void 0);r.useEffect(()=>()=>clearTimeout(C.current),[]);function D(R,H){v&&(v.setValue(R),v.markAsDirty()),i&&h.current&&i(H||new Lt(h.current))}function L(){h.current&&(h.current.value="",D(""))}function $(R){D(R.target.value,R)}const O=K(m||"sps-textarea",e);function _(R){if(clearTimeout(C.current),C.current=void 0,R.key==="Escape"){if(!I.current){I.current=!0,C.current=setTimeout(()=>{I.current=!1},PE);return}R.stopPropagation(),p&&!t&&L()}I.current=!1}return r.createElement(Le,{id:y,className:O,formControl:n,formMeta:o,inputRef:h,ref:c,"data-testid":u},r.createElement("div",{className:"position-relative"},r.createElement("textarea",{ref:h,rows:d,"data-testid":`${u}__input`,className:"sps-form-control",id:b,name:s,placeholder:l,onChange:$,onKeyDown:_,"aria-label":l,value:p||"",disabled:t,...g})),f&&r.createElement("p",{className:"sps-input__additional-text"},f))}Object.assign(Es,{props:_E,displayName:"SpsTextarea"});const xp={general:{label:"General Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("h5",null,"Use a Text Area:"),r.createElement("ul",null,r.createElement("li",null,"When a value of considerable length (such as a sentence or paragraph) is required or accepted.")),r.createElement("h5",null,"Do Not Use a Text Area:"),r.createElement("ul",null,r.createElement("li",null,"When the value required is short (a single word or short phrase). Use a"," ",r.createElement(e,{to:"text-inputs"},"Text Input")," instead."),r.createElement("li",null,"When more than one value is required or accepted in the field. Use"," ",r.createElement(e,{to:"multi-select"},"Multi-Select")," instead."),r.createElement("li",null,"When a boolean selection is required (such as on/off, yes/no, etc). Use"," ",r.createElement(e,{to:"checkbox"},"Checkboxes"),","," ",r.createElement(e,{to:"radio-buttons"},"Radio Buttons")," or"," ",r.createElement(e,{to:"toggle"},"Toggles")," instead.")),r.createElement("h5",null,"Using Text Areas in a Form"),r.createElement("p",null,"Reference the ",r.createElement(e,{to:"form"},"Forms")," page for guidelines for placing Inputs in Form Layouts."))},basic:{label:"Basic Text Areas",description:()=>r.createElement("p",null,"Basic Text Areas include a label and a large input field. By default a Text Area is three lines tall, but the height can be adjusted. A text area can be cleared by pressing 'Escape' twice while the input is focused."),examples:{standard:{react:S.code`
|
|
8088
8088
|
import { SpsLabel, SpsTextarea, useSpsForm } from "@spscommerce/ds-react";
|
|
8089
8089
|
function DemoComponent() {
|
|
8090
8090
|
const { formValue, formMeta, updateForm } = useSpsForm({ notes: "" });
|
|
@@ -8155,7 +8155,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
8155
8155
|
</div>
|
|
8156
8156
|
);
|
|
8157
8157
|
}
|
|
8158
|
-
`}}}},
|
|
8158
|
+
`}}}},kp={active:"boolean",description:"string",disabled:"boolean",formMeta:"SpsFormFieldMeta<boolean>",label:"string",large:"boolean",onChange:"(isActive: boolean) => void"};function Ts(e){const{active:t,className:n,description:o,disabled:a,formControl:s,formMeta:i,id:l,label:c,large:d,onChange:u,ref:m,"data-testid":p,unsafelyReplaceClassName:f,...g}=e;Ai("SpsToggle",kp,e);const v=i||s,[y,b]=r.useState(t),{wrapperId:h,controlId:I}=Ge(l,v),C=`${h}_status-label`,D=`${h}_description`,L=r.useRef(null);r.useEffect(()=>b(t),[t]);function $(R){b(R.target.checked),v&&(v.setValue(R.target.checked),v.markAsDirty()),u&&u(R.target.checked),L.current?.focus()}const O=t??y,_=K(f||"sps-toggle",O&&"sps-toggle--active",d&&"sps-toggle--large",a&&"sps-toggle--disabled",n);return r.createElement(Le,{id:h,formControl:s,formMeta:i,inputRef:L,ref:m,"data-testid":`${p}`},r.createElement("div",{className:_},r.createElement("input",{type:"checkbox",ref:L,className:"sps-toggle__input",id:I,checked:O||!1,disabled:a,onChange:$,"aria-describedby":`${C},${D}`,"data-testid":`${p}__input`,...g}),r.createElement("span",{className:"sps-toggle__slider"}),c&&r.createElement("label",{className:"sps-toggle__status-label",htmlFor:I,id:C},c),o&&r.createElement("span",{className:"sps-toggle__description",id:D},o)))}Object.assign(Ts,{props:kp,displayName:"SpsToggle"});const Mp={general:{label:"General Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("h5",null,"Use Toggles:"),r.createElement("ul",null,r.createElement("li",{className:"mb-2"},'When an option represents a specific "on/off" state.'),r.createElement("li",{className:"mb-2"},"When the selection causes an imeediate change in the system.")),r.createElement("h5",null,"Do Not Use Toggles:"),r.createElement("ul",null,r.createElement("li",{className:"mb-2"},"When a selection does not cause an immediate change in the system."," ",r.createElement(e,{to:"checkbox"},"Checkboxes")," or"," ",r.createElement(e,{to:"radio-buttons"},"Radio Buttons")," instead."),r.createElement("li",{className:"mb-2"},"Inside a form with a save/submit button as this contradicts the immediate change in the system that a toggle controls.")))},basic:{label:"Basic Toggles",description:()=>r.createElement("p",null,"Basic toggles can appear with or without labels and can include an extended description if necessary."),examples:{basic:{description:()=>r.createElement("h4",{className:"mb-3"},"Toggle"),react:S.code`
|
|
8159
8159
|
import { SpsToggle, useSpsForm } from "@spscommerce/ds-react";
|
|
8160
8160
|
function DemoComponent() {
|
|
8161
8161
|
const { formValue, formMeta, updateForm } = useSpsForm({
|
|
@@ -8334,7 +8334,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
8334
8334
|
/>
|
|
8335
8335
|
)
|
|
8336
8336
|
}
|
|
8337
|
-
`}}}},
|
|
8337
|
+
`}}}},OE={icon:"SpsIcon",iconSize:"SpsIconSize"};function ws({icon:e,iconSize:t=A.SpsIconSize.SMALL,children:n}){return r.createElement("div",{className:"sps-tooltip__title-component"},e&&r.createElement(ht,{icon:e,size:t}),r.createElement("span",{className:"sps-tooltip__title"},n))}Object.assign(ws,{props:OE,displayName:"SpsTooltipTitle"});const Lp={basic:{label:"Basic",description:"Info about basic usage of tooltip",examples:{basic:{description:S.code`
|
|
8338
8338
|
<p>There are two ways to tell the tooltip what to attach to. The first is to
|
|
8339
8339
|
pass in a ref.</p>
|
|
8340
8340
|
`,react:S.code`
|
|
@@ -8771,7 +8771,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
8771
8771
|
</React.Fragment>
|
|
8772
8772
|
);
|
|
8773
8773
|
}
|
|
8774
|
-
`}}}},
|
|
8774
|
+
`}}}},_p={heading:"string",icon:"SpsIcon"};function dr(e){const{children:t,className:n,icon:o,title:a,"data-testid":s,unsafelyReplaceClassName:i,...l}=e,c=K(i||"sps-workflow",n);return r.createElement("div",{className:c,"data-testid":`${s}`,...l},a&&r.createElement("h1",{className:"sps-workflow__heading","data-testid":`${s}__title`},r.createElement("span",{className:"sps-workflow__icon","data-testid":`${s}__icon`},r.createElement("i",{"aria-hidden":"true",className:K("sps-icon",`sps-icon-${o}`)})),a),t)}Object.assign(dr,{props:_p,displayName:"SpsWorkflow"});function Pp(e){return r.createElement(dr,{...e})}Object.assign(Pp,{props:_p,displayName:"SpsWf"});const BE={size:"RingSize",progress:"number"};function Cs({size:e=A.RingSize.SMALL,progress:t=0}){const o=e-4,a=o*2*Math.PI,s=a-t/100*a;return r.createElement("div",{className:"sps-progress-ring"},r.createElement("svg",{height:e*2,width:e*2,style:{transform:"rotate(-90deg)"}},r.createElement("circle",{stroke:kr.colors.gray300,fill:"transparent",strokeWidth:4,strokeDasharray:`${a} ${a}`,r:o,cx:e,cy:e}),r.createElement("circle",{stroke:kr.colors.purple200,fill:"transparent",strokeWidth:4,strokeDasharray:`${a} ${a}`,style:{strokeDashoffset:s},r:o,cx:e,cy:e})))}Object.assign(Cs,{props:BE,displayName:"SpsProgressRing"});const RE={phases:"WizardPhase[]"},bt="sps-wizard-sidebar";function Ds({className:e,phases:t=[]}){const n=K(bt,e);return r.createElement("div",{className:n},t.map(o=>{const a=K(`${bt}__phase-title`,o.disabled&&`${bt}__phase-title--disabled`);return r.createElement("div",{className:`${bt}__phase-wrapper`,key:o.title},r.createElement("div",{className:a},o.title),o.steps.map(s=>{const i=K(`${bt}__step`,s.active&&`${bt}__step--active`,s.disabled&&`${bt}__step--disabled`,!!s.onClick&&!s.disabled&&`${bt}__step--clickable`);return r.createElement("div",{className:i,key:s.title,onClick:!s.disabled&&s.onClick||void 0},r.createElement("div",{className:`${bt}__step-progress`},s.percentComplete===100?r.createElement("div",{className:`${bt}__step-complete`},r.createElement(ht,{icon:A.SpsIcon.CHECKMARK})):r.createElement(Cs,{size:A.RingSize.SMALL,progress:s.percentComplete})),r.createElement("div",{className:`${bt}__step-title`,role:"button"},s.title))}))}))}Object.assign(Ds,{props:RE,displayName:"SpsWizardSidebar"});const FE={display:"string",condition:"WizardSubstepConditions",orderPosition:"string | number"};function Ns(e){const{condition:t=A.WizardSubstepConditions.BASIC,orderPosition:n,display:o,children:a,className:s,unsafelyReplaceClassName:i,...l}=e,c=K(i||"sps-wizard-substep",s);return r.createElement("div",{className:c,...l},r.createElement("div",{className:K("sps-wizard-substep__heading",`sps-wizard-substep__heading--${t}`)},r.createElement("div",{className:"sps-wizard-substep__heading-icon"},t===A.WizardSubstepConditions.COMPLETED?r.createElement("i",{"aria-hidden":"true",className:"sps-icon sps-icon-checkmark"}):n),r.createElement("p",null,o)),r.createElement("div",{className:K("sps-wizard-substep__body",`sps-wizard-substep__body--${t}`)},a))}Object.assign(Ns,{props:FE,displayName:"SpsWizardSubstep"});const Op={substep:{label:"Substep",examples:{completed:{imports:S.code`
|
|
8775
8775
|
import { SpsWizardSubstep } from "@spscommerce/ds-react";
|
|
8776
8776
|
import { WizardSubstepConditions } from "@spscommerce/ds-shared";
|
|
8777
8777
|
`,jsx:S.code`
|
|
@@ -8849,7 +8849,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
8849
8849
|
</div>
|
|
8850
8850
|
)
|
|
8851
8851
|
}
|
|
8852
|
-
`}}}},
|
|
8852
|
+
`}}}},Bp={};function pr(e){const{children:t,className:n,"data-testid":o,unsafelyReplaceClassName:a,...s}=e,i=K(a||"sps-workflow__document",n);return r.createElement("span",{className:i,"data-testid":`${o}__document`,...s},t)}Object.assign(pr,{props:Bp,displayName:"SpsWorkflowDocument"});function Rp(e){return r.createElement(pr,{...e})}Object.assign(Rp,{props:Bp,displayName:"SpsWfDoc"});const Fp={icon:"SpsIcon"};function ur(e){const{children:t,className:n,icon:o,"data-testid":a,unsafelyReplaceClassName:s,...i}=e,l=K(s||"sps-workflow__document-status",n);return r.createElement("span",{className:l,"data-testid":`${a}__doc-status`,...i},o&&r.createElement("i",{"aria-hidden":"true",className:`sps-icon sps-icon-${o}`}),t)}Object.assign(ur,{props:Fp,displayName:"SpsWorkflowDocumentStatus"});function Ap(e){return r.createElement(ur,{...e})}Object.assign(Ap,{props:Fp,displayName:"SpsWfDs"});const $p={icon:{type:"SpsIcon",required:!0},title:{type:"string",required:!0}};function mr(e){const{children:t,className:n,icon:o,title:a,"data-testid":s,unsafelyReplaceClassName:i,...l}=e,c=K(i||"sps-workflow__step",n);return r.createElement("div",{className:c,"data-testid":`${s}__step`,...l},r.createElement("i",{"aria-hidden":"true",className:`sps-icon sps-icon-${o} sps-workflow__step-icon`}),r.createElement("h2",{className:"sps-workflow__step-heading","data-testid":`${s}__step-heading`},a),t)}Object.assign(mr,{props:$p,displayName:"SpsWorkflowStep"});function Vp(e){return r.createElement(mr,{...e})}Object.assign(Vp,{props:$p,displayName:"SpsWfStep"});const Kp={basic:{label:"Basic Usage",examples:{basic:{imports:S.code`
|
|
8853
8853
|
import { SpsWorkflow, SpsWorkflowStep, SpsWorkflowDocument, SpsWorkflowDocumentStatus } from "@spscommerce/ds-react";
|
|
8854
8854
|
import { SpsIcon } from "@spscommerce/ds-shared";
|
|
8855
8855
|
`,jsx:S.code`
|
|
@@ -8899,7 +8899,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
8899
8899
|
</SpsWfStep>
|
|
8900
8900
|
</SpsWf>
|
|
8901
8901
|
</div>
|
|
8902
|
-
`}}}},
|
|
8902
|
+
`}}}},AE={kind:"FeedbackBlockKind"};function Is(e){const{children:t,className:n,kind:o=A.FeedbackBlockKind.TIP,"data-testid":a,unsafelyReplaceClassName:s,...i}=e,l=K(s||"sps-feedback-block",`sps-feedback-block--${o}`,n);return r.createElement("div",{className:l,role:"alert","data-testid":a,...i},r.createElement("i",{className:K("sps-icon",`sps-icon-${A.FeedbackBlockIcons[o]}`),"aria-hidden":"true"}),r.createElement("span",{className:"sps-feedback-block__content","data-testid":`${a}__text`},t))}Object.assign(Is,{props:AE,displayName:"SpsFeedbackBlock"});const $E={standard:{label:"Standard Size",description:"Use Standard Size Feedback Blocks for the majority of cases. If a smaller or more subtle solution is needed, use the Micro Size Feedback Block.",examples:{error:{description:"Error",imports:S.code`
|
|
8903
8903
|
import { SpsFeedbackBlock } from "@spscommerce/ds-react";
|
|
8904
8904
|
import { FeedbackBlockKind } from "@spscommerce/ds-shared";
|
|
8905
8905
|
`,jsx:S.code`
|
|
@@ -8974,7 +8974,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
8974
8974
|
kind={FeedbackBlockKind.WARNING}
|
|
8975
8975
|
message="This order is missing a shipment date."
|
|
8976
8976
|
/>
|
|
8977
|
-
`}}}};function
|
|
8977
|
+
`}}}};function VE(){return r.createElement(Is,{kind:A.FeedbackBlockKind.WARNING},"The Workflow component is being deprecated. As of November 6, 2024, please use the"," ",r.createElement("a",{href:"#/components/wizard"},"Wizard")," ","component instead.")}const KE={};function xs({children:e,className:t,...n}){return r.createElement("div",{className:K("sps-filter-panel",t),...n},e)}Object.assign(xs,{props:KE,displayName:"SpsFilterPanel"});const HE={title:"string | ReactNode",expanded:"boolean",heightPx:"number",heightRem:"number",onExpand:"() => void",onCollapse:"() => void"};function ks({children:e,className:t,title:n,expanded:o,heightPx:a,heightRem:s,onExpand:i,onCollapse:l,...c}){const[d,u]=r.useState(o),m=typeof o<"u"?o:d,p=a?a/16:s,f=p?{overflowY:"scroll",height:`${p}rem`}:{},g=()=>r.createElement("button",{type:"button",className:"sps-filter-panel__section__expand-btn",onMouseDown:v=>v.preventDefault(),onClick:()=>{u(!m),!m&&i?i():m&&l&&l()}},r.createElement(ht,{icon:m?A.SpsIcon.MINUS_CIRCLE:A.SpsIcon.PLUS_CIRCLE}));return r.useEffect(()=>{u(o)},[o]),r.createElement("div",{className:K("sps-filter-panel__section",t),...c},r.createElement("div",{className:"sps-filter-panel__section__title-wrapper"},r.createElement(g,null),n&&(typeof n=="string"?r.createElement("p",null,n):n)),m&&r.createElement("div",{className:"sps-filter-panel__section__content-wrapper",style:f},r.createElement("div",{className:"sps-filter-panel__section__content"},e)))}Object.assign(ks,{props:HE,displayName:"SpsFilterPanelSection"});const WE={onClear:"() => void"};function Ms({children:e,className:t,onClear:n,...o}){const{t:a}=he.useWoodlandLanguage();return r.createElement("div",{className:K("sps-filter-panel__cap",t),...o},r.createElement("div",{className:"sps-filter-panel__cap__title-wrapper"},r.createElement(ht,{icon:A.SpsIcon.FILTER,size:A.SpsIconSize.SMALL}),r.createElement("p",null,a("filterPanel.title",{defaultValue:"Filters"}))),r.createElement(Ne,{kind:A.ButtonKind.LINK,onClick:n},a("filterPanel.clear",{defaultValue:"Clear Filters"})),e)}Object.assign(Ms,{props:WE,displayName:"SpsFilterPanelCap"});const Hp={generalUsage:{label:"General Usage",examples:{general:{react:S.code`
|
|
8978
8978
|
import {
|
|
8979
8979
|
useSpsForm,
|
|
8980
8980
|
SpsForm,
|
|
@@ -9395,7 +9395,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
9395
9395
|
</div>
|
|
9396
9396
|
);
|
|
9397
9397
|
}
|
|
9398
|
-
`}}}},
|
|
9398
|
+
`}}}},GE={value:"string",placeholder:"string",formMeta:"SpsFormFieldMeta<string>",onFilterChange:"ChangeEventHandler<HTMLInputElement>"};function Ls({className:e,value:t,placeholder:n,formMeta:o,onFilterChange:a,...s}){const{t:i}=he.useWoodlandLanguage();return r.createElement("div",{className:K("sps-filter-panel__filter-box",e),...s},r.createElement(cr,{value:t,icon:A.SpsIcon.FILTER,formMeta:o,placeholder:n||i("filterPanel.filterPlaceholder",{defaultValue:"Filter options"}),onChange:a}))}Object.assign(Ls,{props:GE,displayName:"SpsFilterPanelFilterBox"});const UE={showCondition:"boolean"};function _s({showCondition:e=!0,children:t,className:n,...o}){return e?r.createElement("div",{className:K("sps-conditional-field",n),...o},t):null}Object.assign(_s,{props:UE,displayName:"SpsConditionalField"});const Wp={generalUsage:{label:"General Usage",examples:{withCheckbox:{react:S.code`
|
|
9399
9399
|
import {
|
|
9400
9400
|
SpsCheckbox,
|
|
9401
9401
|
SpsInputGroup,
|
|
@@ -9531,11 +9531,11 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var Q=z(X,ee,te,ne,W+"."
|
|
|
9531
9531
|
</SpsForm>
|
|
9532
9532
|
)
|
|
9533
9533
|
}
|
|
9534
|
-
`}}}};function
|
|
9535
|
-
${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter(o=>o!=="")}function
|
|
9534
|
+
`}}}};function Gp(e,t){const n=new RegExp(`[\\t\r
|
|
9535
|
+
${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter(o=>o!=="")}function zE(e,t,n){n.includes(`
|
|
9536
9536
|
`)||(e=e?.replaceAll(`
|
|
9537
|
-
`," ")),n.includes(" ")||(e=e?.replaceAll(" "," "));let o=[e];for(const s of n)o=o.flatMap(i=>i?.split(s));return o=o.map(s=>s?.trim()).filter(s=>!!s),[...new Set([...t??[],...o])]}const
|
|
9538
|
-
`," "];function
|
|
9537
|
+
`," ")),n.includes(" ")||(e=e?.replaceAll(" "," "));let o=[e];for(const s of n)o=o.flatMap(i=>i?.split(s));return o=o.map(s=>s?.trim()).filter(s=>!!s),[...new Set([...t??[],...o])]}const jE={disabled:"boolean",formMeta:"SpsFormFieldMeta<any[]>",icon:"SpsIcon",onChange:"ChangeEventHandler",onEntryChange:"(searchText: string) => void",placeholder:"string",value:"any",createTagOptions:"string[]",isSingleLine:"boolean",dynamicPasting:"boolean"},Up=[","," ",`
|
|
9538
|
+
`," "];function Ps({className:e,disabled:t,formControl:n,formMeta:o,id:a,onChange:s,onEntryChange:i,placeholder:l,unsafelyReplaceClassName:c,value:d,icon:u,createTagOptions:m=Up,"data-testid":p,isSingleLine:f,dynamicPasting:g,...v}){const y=o||n,{wrapperId:b,controlId:h}=Ge(a,y);Array.isArray(m)||(console.error("createTagOptions must be of type array, ignoring and using defaults"),m=Up);const[I,C]=Dt({keyDown:null,searchText:"",activeTagIndex:null,optionIds:""});r.useEffect(()=>{i&&i(I.searchText)},[I.searchText]);const D=r.useRef(null),L=r.useRef(null),$=r.useRef(null);function O(){setTimeout(()=>{L.current?.focus()},0)}function _(T){C({searchText:""}),y&&(y.setValue(T),y.markAsDirty()),s&&s(new Lt({value:T}))}function R(T){const k=(d||[]).filter((U,J)=>J!==T);_(k)}function H(T){C({searchText:T.target.value})}function Z(T){if($.current&&$.current.children.length&&typeof T=="number"){const U=$.current.children[T]?.querySelector(".sps-clickable-tag__icon");U&&U.focus()}}const V=r.useCallback(T=>{C({activeTagIndex:null,searchText:""});const k=I.searchText.trim(),U=d||[];k&&U.indexOf(k)===-1&&_([...U,...Gp(k,m)]),!((T.key==="Tab"||T.key==="Enter")&&!I.searchText)&&T.preventDefault()},[I.searchText,d,Gp]);function w(T){V(T)}function F(T){if(!t){const k=!T.target.selectionStart&&d&&d.length,U=d?d.length:0;switch(T.key){case"Backspace":if(I.activeTagIndex===U-1){R(I.activeTagIndex),O();return}if(I.activeTagIndex!==null){R(I.activeTagIndex);return}if(k){_(d.slice(0,U-1)),O();return}break;case"Delete":I.activeTagIndex!==null&&(R(I.activeTagIndex),O());break;case"Enter":case"Tab":V(T);break;case"Up":case"ArrowUp":case"Down":case"ArrowDown":T.preventDefault();break;case"Left":case"ArrowLeft":if(k){I.activeTagIndex===null?(C({activeTagIndex:U-1}),Z(U-1)):I.activeTagIndex>0&&(C({activeTagIndex:I.activeTagIndex-1}),Z(I.activeTagIndex-1));return}break;case"Right":case"ArrowRight":if(I.activeTagIndex!==null){I.activeTagIndex===U-1?(C({activeTagIndex:null}),L.current?.focus()):(C({activeTagIndex:I.activeTagIndex+1}),Z(I.activeTagIndex+1));return}break}for(const J of m)T.key===J&&V(T);C({keyDown:hn(T)})}}function B(T){_([]),T.stopPropagation()}function M(T){T.preventDefault(),T.stopPropagation();const k=T.clipboardData?.getData("text/plain")??"";if(g&&!m.some(J=>k.includes(J))){const J=L.current?.value??"";C({searchText:`${J}${k}`});return}const U=zE(k,d,m);_(U)}r.useEffect(()=>(L.current?.addEventListener("paste",M),()=>{L.current?.removeEventListener("paste",M)}),[L,d,m,g]);const q=K(c||"sps-multi-select",t&&"sps-form-control--disabled",e),N=new Array(d?.length||0).fill(0).map((T,k)=>`${b}_tag-${k}`);return r.createElement(Le,{id:b,className:q,formControl:n,formMeta:o,ref:D,inputRef:L,focusInputOnClick:!0,onKeyDown:F,role:"listbox","aria-multiselectable":!0,"aria-activedescendant":N[I.activeTagIndex||0],"aria-owns":I.optionIds},r.createElement("div",{className:"sps-text-input"},r.createElement("div",{className:f?K("sps-form-control",d&&!t&&"sps-form-control--clearable"&&"sps-multi-select__max-height"):K("sps-form-control",d&&!t&&"sps-form-control--clearable")},u&&r.createElement("i",{className:K("sps-text-input__icon","sps-icon",`sps-icon-${u}`)}),r.createElement("div",{className:"sps-multi-select__tags-and-input",ref:$},Array.isArray(d)&&d.map((T,k)=>r.createElement(Vn,{id:N[k],role:"option",disabled:t,"aria-selected":"true",key:N[k],onRemove:()=>R(k)},r.createElement("span",null,T))),r.createElement("input",{type:"text",ref:L,"data-testid":`${p}__multi-value-text-input`,value:I.searchText,className:"sps-text-input__input",placeholder:I.searchText.length===0&&(!d||d.length===0)?l:void 0,id:h,onBlur:w,onChange:H,onKeyDown:F,disabled:t,role:"listbox","aria-multiselectable":"true","aria-owns":N.join(" "),...v})),d&&d.length!==0&&!t?r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:T=>B(T)}):null)))}Object.assign(Ps,{props:jE,displayName:"SpsMultiValueTextInput"});const zp={general:{label:"General Usage",description:()=>r.createElement(r.Fragment,null,r.createElement("h5",null,"Coming soon"))},basic:{label:"Basic Usage",examples:{basic:{react:S.code`
|
|
9539
9539
|
import { SpsMultiValueTextInput, SpsLabel, useSpsForm } from "@spscommerce/ds-react";
|
|
9540
9540
|
function DemoComponent() {
|
|
9541
9541
|
const { formValue, formMeta, updateForm } = useSpsForm({
|
|
@@ -9712,7 +9712,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
9712
9712
|
</>
|
|
9713
9713
|
)
|
|
9714
9714
|
}
|
|
9715
|
-
`}}}},
|
|
9715
|
+
`}}}},YE={currentUser:"any",disabled:"boolean",formMeta:"SpsFormFieldMeta<string>",onChange:"(newValue: string) => void",value:"string",twentyFourHour:"boolean",placeholder12h:"string",placeholder24h:"string"},jp=["AM","PM"],Os=r.forwardRef(function({className:t,currentUser:n,disabled:o,formControl:a,formMeta:s,id:i,onChange:l,value:c,twentyFourHour:d,placeholder24h:u="00:00",placeholder12h:m="12:00","data-testid":p,...f},g){const{t:v}=he.useWoodlandLanguage(),y=io(n),b=d??Td(y),h=s||a,{wrapperId:I}=Ge(i,h),C=r.useRef(null),D=v("timeInput.customTime",{defaultValue:"Custom time"}),{current:L}=Rt(i),$=b?c:c?.split(" ")[0],O=j.validateTimeString($,b)?j.padIncompleteTimeString($,b):"",_=b?"":c?.split(" ")[1]?.toUpperCase(),R=O&&jp.find(k=>k===_)||"",[H,Z]=r.useState(O),[V,w]=r.useState(R||"AM");function F(k){s&&(s.setValue(k||""),s.markAsDirty()),l&&l(k||"")}function B(k){j.validateTimeString(k.target.value,b)&&Z(k.target.value)}function M(k){if(j.validateTimeString(k??H,b)){const U=j.padIncompleteTimeString(k??H,b);Z(U),F(U&&!b?`${U} ${V}`:U||"")}else F("")}function q(k){w(k.target.value);const U=j.padIncompleteTimeString(H,b);U&&!b&&F(`${U} ${k.target.value}`)}function N(k){j.validateTimeString(k,b)&&(Z(k??""),setTimeout(()=>M(k),0))}r.useEffect(()=>{O!==H&&Z(O)},[O]),r.useEffect(()=>{R&&R!==V&&w(R)},[R]);const T=K("sps-time-input",t);return b?r.createElement(Le,{id:I,formControl:a,formMeta:s,inputRef:C,ref:g,"data-testid":p},r.createElement(Nt,{id:L,"data-testid":p,className:T,suggestions:Pr,zeroState:D,placeholder:u,value:H,onChange:B,onBlur:()=>M(),onSelectionChange:N,onKeyDown:k=>{k.key==="Enter"&&M()},disabled:o,inputNotClearable:!0,autoFocusOnSelection:!0,...f})):r.createElement(Le,{id:I,formControl:a,formMeta:s,inputRef:C,ref:g,"data-testid":p},r.createElement(In,null,r.createElement(Nt,{id:L,"data-testid":p,className:T,suggestions:_r,zeroState:D,placeholder:m,value:H,onChange:B,onBlur:()=>M(),onSelectionChange:N,onKeyDown:k=>{k.key==="Enter"&&M()},disabled:o,inputNotClearable:!0,autoFocusOnSelection:!0}),r.createElement(on,{id:`${L}__select`,"data-testid":`${p}__select`,options:jp,value:V,onChange:q,disabled:o,notClearable:!0,className:T})))});Object.assign(Os,{props:YE,displayName:"SpsTimeInput"});const Yp={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
9716
9716
|
import {
|
|
9717
9717
|
useSpsForm,
|
|
9718
9718
|
SpsTimeInput,
|
|
@@ -9826,13 +9826,13 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
9826
9826
|
</SpsLocaleProvider>
|
|
9827
9827
|
);
|
|
9828
9828
|
}
|
|
9829
|
-
`}}}},jE={Autocomplete:{components:[Nt],examples:$i},Checkboxes:{components:[Jt],examples:Vi},"Clickable Tags":{components:[An],examples:Ki},"Column Chooser":{components:[Xa,zo],examples:Sd},"Conditional Fields":{description:()=>r.createElement("p",null,"A conditional field is one that is only available when a certain option is selected amongst a set of checkboxes or radio buttons."),components:[Ms],examples:Kp},"Content Rows":{components:[Za,nn,jo],examples:gd},"Content Sections":{components:[as],examples:zd},"Date Pickers":{components:[Qa],examples:Dd},"Date Range Pickers":{components:[ts],examples:xd},"Date Time Range Pickers":{components:[ns],examples:Od},Datetime:{components:[os],examples:Bd},"Time Input":{components:[_s],examples:zp},"Description Lists":{description:()=>r.createElement("p",null,"Description Lists display a series of terms with accompanying descriptions such as a glossary of terms."),components:[Zo,Qo,tr],examples:Gd},Dropdown:{components:[an,rs],examples:Ud},"Filter Panel":{components:[Ns,Is,xs,ks],examples:Vp},Form:{components:[ro],examples:fd},Incrementor:{components:[ss],examples:jd},Label:{description:()=>r.createElement("p",null,"Labels provide a description for the value to be entered or selected in an accompanying input field."),components:[is],examples:Yd},"List Action Bar":{description:()=>r.createElement("p",null,"The List Action Bar contains the action buttons relevant to selected items from a Table List, Row List, or Card List. The List Action Bar is only visible when one or more list items have been selected and appears anchored to the bottom of the page above all other content."),components:[ls],examples:up},"Micro Block":{components:[cs],examples:mp},Modals:{description:()=>r.createElement("p",null,"Modals are overlays on a page that focus a user’s attention on an important message or a simple action. Examples of a Modal include confirming the deletion of a record, or making a single selection."),components:[ds,or],examples:Sp},"Multi Select":{description:()=>r.createElement("p",null,"Multi-Selects consist of a Label and a dropdown menu from which a user selects one or more values from a list of pre-defined options."),components:[us],examples:gp},"Multi Value Text Input":{description:()=>r.createElement("p",null,"To be determined."),components:[Ls],examples:Gp},Pagination:{description:()=>r.createElement("p",null,"The Pagination component allows users to navigate lists of records and control the number of records displayed on each page. The records can span across multiple pages, or within sections of a page."),components:[ms,rr],examples:hp},"Radio Buttons":{description:"Radio Buttons allow a user to make single selection from a list of predefined options.",components:[fs],examples:bp},Selects:{description:"Selects consist off a Label and a dropdown menu from which a user selects a value from a list of pre-defined options.",components:[on],examples:kd},"Side Navigation":{description:"Side Navigations are used to provide quick access to a series of related pages or content. It can be used to navigate between different page views, or as an anchor-style menu to scroll to specific content on the same page.",components:[yp],examples:Ep},"Split Button":{components:[Ss],examples:Tp},"Summary List Row":{components:[gs,hs,io],examples:wp},Tables:{description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("div",{className:"sps-body-14"},"Tables (along with ",r.createElement(e,{to:"content-rows"},"Content Rows")," and"," ",r.createElement(e,{to:"content-tiles"},"Content Tiles"),") are one of three options for displaying a list of records on a page."),r.createElement("br",null),r.createElement("div",{className:"sps-body-14"},"Tables are the ideal solution for displaying tabular data, especially when the listed records contain a considerable amount of data points. While tables are primarily used to display an extensive list of records, often in a paginated format, they can also be used to display smaller sets of tabular data in any context.")),components:[sn,Wt,re,Ht,Be,De],examples:pp},"Task Queue":{components:[bs],examples:Cp},"Text Inputs":{description:()=>r.createElement("p",null,"Text Inputs consist of a Label and a field in which a user enters a short value."),components:[sr],examples:Dp},"Text Areas":{description:()=>r.createElement("p",null,"Text Areas consist of a Label and a field in which a user enters a long value."),components:[vs],examples:Np},Toggles:{description:()=>r.createElement("p",null,"Toggles allow a user to immediately turn a setting on or off."),components:[ys],examples:xp},Tooltips:{components:[ct,Es],examples:kp},Wizard:{components:[ws,Cs],examples:_p},Workflow:{components:[ir,lr,cr,dr],examples:$p,notices:[AE]},"Slide In Panels":{description:"",components:[ps],examples:fp}},YE=new Set(["id"]),qE=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),JE=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),XE=new Set(["dir","lang","hidden","inert","translate"]),jp=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),ZE=/^(data-.*)$/;function QE(e,t={}){let{labelable:n,isLink:o,global:a,events:s=a,propNames:i}=t,l={};for(const c in e)Object.prototype.hasOwnProperty.call(e,c)&&(YE.has(c)||n&&qE.has(c)||o&&JE.has(c)||a&&XE.has(c)||s&&(jp.has(c)||c.endsWith("Capture")&&jp.has(c.slice(0,-7)))||i?.has(c)||ZE.test(c))&&(l[c]=e[c]);return l}const Yp=new WeakMap;function pr(e,t,n){if(!e)return"";typeof t=="string"&&(t=t.replace(/\s+/g,""));let o=Yp.get(e);return process.env.NODE_ENV!=="production"&&!o&&console.error("There is no tab id, please check if you have rendered the tab panel before the tab list."),`${o}-${n}-${t}`}function Ps(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Gt=typeof document<"u"?E.useLayoutEffect:()=>{},ur={prefix:String(Math.round(Math.random()*1e10)),current:0},qp=E.createContext(ur),eT=E.createContext(!1);let tT=!!(typeof window<"u"&&window.document&&window.document.createElement),Os=new WeakMap;function nT(e=!1){let t=E.useContext(qp),n=E.useRef(null);if(n.current===null&&!e){let o=E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(o){let a=Os.get(o);a==null?Os.set(o,{id:t.current,state:o.memoizedState}):o.memoizedState!==a.state&&(t.current=a.id,Os.delete(o))}n.current=++t.current}return n.current}function oT(e){let t=E.useContext(qp);t===ur&&!tT&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=nT(!!e),o=t===ur&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${o}-${n}`}function rT(e){let t=E.useId(),[n]=E.useState(Jp()),o=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${ur.prefix}`;return e||`${o}-${t}`}const aT=typeof E.useId=="function"?rT:oT;function sT(){return!1}function iT(){return!0}function lT(e){return()=>{}}function Jp(){return typeof E.useSyncExternalStore=="function"?E.useSyncExternalStore(lT,sT,iT):E.useContext(eT)}let cT=!!(typeof window<"u"&&window.document&&window.document.createElement),xn=new Map,lo;typeof FinalizationRegistry<"u"&&(lo=new FinalizationRegistry(e=>{xn.delete(e)}));function mr(e){let[t,n]=E.useState(e),o=E.useRef(null),a=aT(t),s=E.useRef(null);if(lo&&lo.register(s,a),cT){const i=xn.get(a);i&&!i.includes(o)?i.push(o):xn.set(a,[o])}return Gt(()=>{let i=a;return()=>{lo&&lo.unregister(s),xn.delete(i)}},[a]),E.useEffect(()=>{let i=o.current;return i&&n(i),()=>{i&&(o.current=null)}}),a}function dT(e,t){if(e===t)return e;let n=xn.get(e);if(n)return n.forEach(a=>a.current=t),t;let o=xn.get(t);return o?(o.forEach(a=>a.current=e),e):t}function pT(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1;const o=e.map(a=>{const s=Xp(a,t);return n||=typeof s=="function",s});if(n)return()=>{o.forEach((a,s)=>{typeof a=="function"?a():Xp(e[s],null)})}}}function Xp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dt(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let o=e[n];for(let a in o){let s=t[a],i=o[a];typeof s=="function"&&typeof i=="function"&&a[0]==="o"&&a[1]==="n"&&a.charCodeAt(2)>=65&&a.charCodeAt(2)<=90?t[a]=Ps(s,i):(a==="className"||a==="UNSAFE_className")&&typeof s=="string"&&typeof i=="string"?t[a]=K(s,i):a==="id"&&s&&i?t.id=dT(s,i):a==="ref"&&s&&i?t.ref=pT(s,i):t[a]=i!==void 0?i:s}}return t}function Pt(e){if(uT())e.focus({preventScroll:!0});else{let t=mT(e);e.focus(),fT(t)}}let fr=null;function uT(){if(fr==null){fr=!1;try{document.createElement("div").focus({get preventScroll(){return fr=!0,!0}})}catch{}}return fr}function mT(e){let t=e.parentNode,n=[],o=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==o;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return o instanceof HTMLElement&&n.push({element:o,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft}),n}function fT(e){for(let{element:t,scrollTop:n,scrollLeft:o}of e)t.scrollTop=n,t.scrollLeft=o}const Re=e=>e?.ownerDocument??document,pt=e=>e&&"window"in e&&e.window===e?e:Re(e).defaultView||window;function ST(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function gT(e){return ST(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let hT=!1;function Sr(){return hT}function ye(e,t){if(!Sr())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:gT(n)?n=n.host:n=n.parentNode}return!1}const It=(e=document)=>{if(!Sr())return e.activeElement;let t=e.activeElement;for(;t&&"shadowRoot"in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function me(e){if(Sr()&&e.target instanceof Element&&e.target.shadowRoot){if("composedPath"in e)return e.composedPath()[0]??null;if("composedPath"in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function Zp(e){if(!e)return!1;let t=e.getRootNode(),n=pt(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let o=t.activeElement;return o!=null&&e.contains(o)}const bT=typeof Element<"u"&&"checkVisibility"in Element.prototype;function vT(e){const t=pt(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:o}=e.style,a=n!=="none"&&o!=="hidden"&&o!=="collapse";if(a){const{getComputedStyle:s}=e.ownerDocument.defaultView;let{display:i,visibility:l}=s(e);a=i!=="none"&&l!=="hidden"&&l!=="collapse"}return a}function yT(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Bs(e,t){return bT?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&vT(e)&&yT(e,t)&&(!e.parentElement||Bs(e.parentElement,e))}const Rs=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],ET=Rs.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Rs.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const TT=Rs.join(':not([hidden]):not([tabindex="-1"]),');function Qp(e,t){return e.matches(ET)&&!tu(e)&&(t?.skipVisibilityCheck||Bs(e))}function eu(e){return e.matches(TT)&&Bs(e)&&!tu(e)}function tu(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function nu(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function wT(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function CT(e){let t=E.useRef({isFocused:!1,observer:null});return Gt(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),E.useCallback(n=>{let o=me(n);if(o instanceof HTMLButtonElement||o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement){t.current.isFocused=!0;let a=o,s=i=>{if(t.current.isFocused=!1,a.disabled){let l=nu(i);e?.(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};a.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&a.disabled){t.current.observer?.disconnect();let i=a===It()?null:It();a.dispatchEvent(new FocusEvent("blur",{relatedTarget:i})),a.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:i}))}}),t.current.observer.observe(a,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let gr=!1;function ou(e){for(;e&&!Qp(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=pt(e),n=t.document.activeElement;if(!n||n===e)return;gr=!0;let o=!1,a=m=>{(me(m)===n||o)&&m.stopImmediatePropagation()},s=m=>{(me(m)===n||o)&&(m.stopImmediatePropagation(),!e&&!o&&(o=!0,Pt(n),c()))},i=m=>{(me(m)===e||o)&&m.stopImmediatePropagation()},l=m=>{(me(m)===e||o)&&(m.stopImmediatePropagation(),o||(o=!0,Pt(n),c()))};t.addEventListener("blur",a,!0),t.addEventListener("focusout",s,!0),t.addEventListener("focusin",l,!0),t.addEventListener("focus",i,!0);let c=()=>{cancelAnimationFrame(d),t.removeEventListener("blur",a,!0),t.removeEventListener("focusout",s,!0),t.removeEventListener("focusin",l,!0),t.removeEventListener("focus",i,!0),gr=!1,o=!1},d=requestAnimationFrame(c);return c}function hr(e){if(typeof window>"u"||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(n=>e.test(n.brand))||e.test(window.navigator.userAgent)}function Fs(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Ot(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const ln=Ot(function(){return Fs(/^Mac/i)}),DT=Ot(function(){return Fs(/^iPhone/i)}),ru=Ot(function(){return Fs(/^iPad/i)||ln()&&navigator.maxTouchPoints>1}),br=Ot(function(){return DT()||ru()}),NT=Ot(function(){return ln()||br()}),IT=Ot(function(){return hr(/AppleWebKit/i)&&!xT()}),xT=Ot(function(){return hr(/Chrome/i)}),au=Ot(function(){return hr(/Android/i)}),kT=Ot(function(){return hr(/Firefox/i)});function As(e){return e.pointerType===""&&e.isTrusted?!0:au()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function MT(e){return!au()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}const LT=E.createContext({isNative:!0,open:PT,useHref:e=>e});function $s(){return E.useContext(LT)}function Bt(e,t,n=!0){let{metaKey:o,ctrlKey:a,altKey:s,shiftKey:i}=t;kT()&&window.event?.type?.startsWith("key")&&e.target==="_blank"&&(ln()?o=!0:a=!0);let l=IT()&&ln()&&!ru()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:o,ctrlKey:a,altKey:s,shiftKey:i}):new MouseEvent("click",{metaKey:o,ctrlKey:a,altKey:s,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});Bt.isOpening=n,Pt(e),e.dispatchEvent(l),Bt.isOpening=!1}Bt.isOpening=!1;function _T(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function PT(e,t){_T(e,n=>Bt(n,t))}function OT(e){const n=$s().useHref(e?.href??"");return{href:e?.href?n:void 0,target:e?.target,rel:e?.rel,download:e?.download,ping:e?.ping,referrerPolicy:e?.referrerPolicy}}let co=null;const BT=new Set;let po=new Map,cn=!1,Vs=!1;function Ks(e,t){for(let n of BT)n(e,t)}function RT(e){return!(e.metaKey||!ln()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function vr(e){cn=!0,!Bt.isOpening&&RT(e)&&(co="keyboard",Ks("keyboard",e))}function ut(e){co="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(cn=!0,Ks("pointer",e))}function su(e){!Bt.isOpening&&As(e)&&(cn=!0,co="virtual")}function iu(e){let t=pt(me(e)),n=Re(me(e));me(e)===t||me(e)===n||gr||!e.isTrusted||(!cn&&!Vs&&(co="virtual",Ks("virtual",e)),cn=!1,Vs=!1)}function lu(){gr||(cn=!1,Vs=!0)}function cu(e){if(typeof window>"u"||typeof document>"u")return;const t=pt(e),n=Re(e);if(po.get(t))return;let o=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){cn=!0,o.apply(this,arguments)},n.addEventListener("keydown",vr,!0),n.addEventListener("keyup",vr,!0),n.addEventListener("click",su,!0),t.addEventListener("focus",iu,!0),t.addEventListener("blur",lu,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ut,!0),n.addEventListener("pointermove",ut,!0),n.addEventListener("pointerup",ut,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ut,!0),n.addEventListener("mousemove",ut,!0),n.addEventListener("mouseup",ut,!0)),t.addEventListener("beforeunload",()=>{du(e)},{once:!0}),po.set(t,{focus:o})}const du=(e,t)=>{const n=pt(e),o=Re(e);t&&o.removeEventListener("DOMContentLoaded",t),po.has(n)&&(n.HTMLElement.prototype.focus=po.get(n).focus,o.removeEventListener("keydown",vr,!0),o.removeEventListener("keyup",vr,!0),o.removeEventListener("click",su,!0),n.removeEventListener("focus",iu,!0),n.removeEventListener("blur",lu,!1),typeof PointerEvent<"u"?(o.removeEventListener("pointerdown",ut,!0),o.removeEventListener("pointermove",ut,!0),o.removeEventListener("pointerup",ut,!0)):process.env.NODE_ENV==="test"&&(o.removeEventListener("mousedown",ut,!0),o.removeEventListener("mousemove",ut,!0),o.removeEventListener("mouseup",ut,!0)),po.delete(n))};function FT(e){const t=Re(e);let n;return t.readyState!=="loading"?cu(e):(n=()=>{cu(e)},t.addEventListener("DOMContentLoaded",n)),()=>du(e,n)}typeof document<"u"&&FT();function Hs(){return co}let Ut=new Map,Ws=new Set;function pu(){if(typeof window>"u")return;function e(o){return"propertyName"in o}let t=o=>{let a=me(o);if(!e(o)||!a)return;let s=Ut.get(a);s||(s=new Set,Ut.set(a,s),a.addEventListener("transitioncancel",n,{once:!0})),s.add(o.propertyName)},n=o=>{let a=me(o);if(!e(o)||!a)return;let s=Ut.get(a);if(s&&(s.delete(o.propertyName),s.size===0&&(a.removeEventListener("transitioncancel",n),Ut.delete(a)),Ut.size===0)){for(let i of Ws)i();Ws.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?pu():document.addEventListener("DOMContentLoaded",pu));function AT(){for(const[e]of Ut)"isConnected"in e&&!e.isConnected&&Ut.delete(e)}function uu(e){requestAnimationFrame(()=>{AT(),Ut.size===0?e():Ws.add(e)})}function yr(e){if(!e.isConnected)return;const t=Re(e);if(Hs()==="virtual"){let n=It(t);uu(()=>{const o=It(t);(o===n||o===t.body)&&e.isConnected&&Pt(e)})}else Pt(e)}function $T(e){let{isDisabled:t,onFocus:n,onBlur:o,onFocusChange:a}=e;const s=E.useCallback(c=>{if(me(c)===c.currentTarget)return o&&o(c),a&&a(!1),!0},[o,a]),i=CT(s),l=E.useCallback(c=>{let d=me(c);const m=Re(d),u=m?It(m):It();d===c.currentTarget&&d===u&&(n&&n(c),a&&a(!0),i(c))},[a,n,i]);return{focusProps:{onFocus:!t&&(n||a||o)?l:void 0,onBlur:!t&&(o||a)?s:void 0}}}function mu(e){if(!e)return;let t=!0;return n=>{let o={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t&&process.env.NODE_ENV!=="production"?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(o),t&&n.stopPropagation()}}function VT(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:mu(e.onKeyDown),onKeyUp:mu(e.onKeyUp)}}}function fu(e,t){Gt(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}let KT=E.createContext(null);function HT(e){let t=E.useContext(KT)||{};fu(t,e);let{ref:n,...o}=t;return o}function WT(e,t){let{focusProps:n}=$T(e),{keyboardProps:o}=VT(e),a=dt(n,o),s=HT(t),i=e.isDisabled?{}:s,l=E.useRef(e.autoFocus);E.useEffect(()=>{l.current&&t.current&&yr(t.current),l.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:dt({...a,tabIndex:c},i)}}function Gs(e){return NT()?e.altKey:e.ctrlKey}function Us(e,t){let n=`[data-key="${CSS.escape(String(t))}"]`,o=e.current?.dataset.collection;return o&&(n=`[data-collection="${CSS.escape(o)}"]${n}`),e.current?.querySelector(n)}const Su=new WeakMap;function GT(e){let t=mr();return Su.set(e,t),t}function UT(e){return Su.get(e)}function kn(e){return ln()?e.metaKey:e.ctrlKey}function gu(e){let t=jT(Re(e));t!==e&&(t&&zT(t,e),e&&hu(e,t))}function zT(e,t){e.dispatchEvent(new FocusEvent("blur",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:t}))}function hu(e,t){e.dispatchEvent(new FocusEvent("focus",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:t}))}function jT(e){let t=It(e),n=t?.getAttribute("aria-activedescendant");return n&&e.getElementById(n)||t}let Mn="default",zs="",Er=new WeakMap;function bu(e){if(br()){if(Mn==="default"){const t=Re(e);zs=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}Mn="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Er.set(e,e.style[t]),e.style[t]="none"}}function js(e){if(br()){if(Mn!=="disabled")return;Mn="restoring",setTimeout(()=>{uu(()=>{if(Mn==="restoring"){const t=Re(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=zs||""),zs="",Mn="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Er.has(e)){let t=Er.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Er.delete(e)}}function vu(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let Ys=new WeakMap;function YT(e){let t=e??(typeof document<"u"?document:void 0);if(!t)return vu(t);if(Ys.has(t))return Ys.get(t);let n=t.querySelector('meta[property="csp-nonce"]'),o=n&&n instanceof pt(n).HTMLMetaElement&&(n.nonce||n.content)||vu(t)||void 0;return o!==void 0&&Ys.set(t,o),o}const yu=E.createContext({register:()=>{}});yu.displayName="PressResponderContext";const qT=E.useInsertionEffect??Gt;function Tr(e){const t=E.useRef(null);return qT(()=>{t.current=e},[e]),E.useCallback((...n)=>{const o=t.current;return o?.(...n)},[])}function Eu(){let e=E.useRef(new Map),t=E.useCallback((a,s,i,l)=>{let c=l?.once?(...d)=>{e.current.delete(i),i(...d)}:i;e.current.set(i,{type:s,eventTarget:a,fn:c,options:l}),a.addEventListener(s,c,l)},[]),n=E.useCallback((a,s,i,l)=>{let c=e.current.get(i)?.fn||i;a.removeEventListener(s,c,l),e.current.delete(i)},[]),o=E.useCallback(()=>{e.current.forEach((a,s)=>{n(a.eventTarget,a.type,s,a.options)})},[n]);return E.useEffect(()=>o,[o]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:o}}function JT(e){let t=E.useContext(yu);if(t){let{register:n,ref:o,...a}=t;e=dt(a,e),n()}return fu(t,e.ref),e}class wr{#e;constructor(t,n,o,a){this.#e=!0;const i=(a?.target??o.currentTarget)?.getBoundingClientRect();let l,c=0,d,m=null;o.clientX!=null&&o.clientY!=null&&(d=o.clientX,m=o.clientY),i&&(d!=null&&m!=null?(l=d-i.left,c=m-i.top):(l=i.width/2,c=i.height/2)),this.type=t,this.pointerType=n,this.target=o.currentTarget,this.shiftKey=o.shiftKey,this.metaKey=o.metaKey,this.ctrlKey=o.ctrlKey,this.altKey=o.altKey,this.x=l,this.y=c,this.key=o.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}const Tu=Symbol("linkClicked"),wu="react-aria-pressable-style",Cu="data-react-aria-pressable";function Du(e){let{onPress:t,onPressChange:n,onPressStart:o,onPressEnd:a,onPressUp:s,onClick:i,isDisabled:l,isPressed:c,preventFocusOnPress:d,shouldCancelOnPointerExit:m,allowTextSelectionOnPress:u,ref:p,...f}=JT(e),[g,v]=E.useState(!1),y=E.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:b,removeAllGlobalListeners:h}=Eu(),I=E.useCallback((w,F)=>{let B=y.current;if(l||B.didFirePressStart)return!1;let M=!0;if(B.isTriggeringEvent=!0,o){let q=new wr("pressstart",F,w);o(q),M=q.shouldStopPropagation}return n&&n(!0),B.isTriggeringEvent=!1,B.didFirePressStart=!0,v(!0),M},[l,o,n]),C=E.useCallback((w,F,B=!0)=>{let M=y.current;if(!M.didFirePressStart)return!1;M.didFirePressStart=!1,M.isTriggeringEvent=!0;let q=!0;if(a){let N=new wr("pressend",F,w);a(N),q=N.shouldStopPropagation}if(n&&n(!1),v(!1),t&&B&&!l){let N=new wr("press",F,w);t(N),q&&=N.shouldStopPropagation}return M.isTriggeringEvent=!1,q},[l,a,n,t]),D=Tr(C),L=E.useCallback((w,F)=>{let B=y.current;if(l)return!1;if(s){B.isTriggeringEvent=!0;let M=new wr("pressup",F,w);return s(M),B.isTriggeringEvent=!1,M.shouldStopPropagation}return!0},[l,s]),$=Tr(L),O=E.useCallback(w=>{let F=y.current;if(F.isPressed&&F.target){F.didFirePressStart&&F.pointerType!=null&&C(dn(F.target,w),F.pointerType,!1),F.isPressed=!1,F.isOverTarget=!1,F.activePointerId=null,F.pointerType=null,h(),u||js(F.target);for(let B of F.disposables)B();F.disposables=[]}},[u,h,C]),_=Tr(O),R=E.useCallback(w=>{m&&O(w)},[m,O]),H=E.useCallback(w=>{l||i?.(w)},[l,i]),Z=E.useCallback((w,F)=>{if(!l&&i){let B=new MouseEvent("click",w);wT(B,F),i(nu(B))}},[l,i]),V=E.useMemo(()=>{let w=y.current,F={onKeyDown(M){if(Js(M.nativeEvent,M.currentTarget)&&ye(M.currentTarget,me(M))){xu(me(M),M.key)&&M.preventDefault();let q=!0;!w.isPressed&&!M.repeat&&(w.target=M.currentTarget,w.isPressed=!0,w.pointerType="keyboard",q=I(M,"keyboard"));let N=M.currentTarget,T=k=>{Js(k,N)&&!k.repeat&&ye(N,me(k))&&w.target&&$(dn(w.target,k),"keyboard")};b(Re(M.currentTarget),"keyup",Ps(T,B),!0),q&&M.stopPropagation(),M.metaKey&&ln()&&w.metaKeyEvents?.set(M.key,M.nativeEvent)}else M.key==="Meta"&&(w.metaKeyEvents=new Map)},onClick(M){if(!(M&&!ye(M.currentTarget,me(M)))&&M&&M.button===0&&!w.isTriggeringEvent&&!Bt.isOpening){let q=!0;if(l&&M.preventDefault(),!w.ignoreEmulatedMouseEvents&&!w.isPressed&&(w.pointerType==="virtual"||As(M.nativeEvent))){let N=I(M,"virtual"),T=$(M,"virtual"),k=D(M,"virtual");H(M),q=N&&T&&k}else if(w.isPressed&&w.pointerType!=="keyboard"){let N=w.pointerType||M.nativeEvent.pointerType||"virtual",T=$(dn(M.currentTarget,M),N),k=D(dn(M.currentTarget,M),N,!0);q=T&&k,w.isOverTarget=!1,H(M),_(M)}w.ignoreEmulatedMouseEvents=!1,q&&M.stopPropagation()}}},B=M=>{if(w.isPressed&&w.target&&Js(M,w.target)){xu(me(M),M.key)&&M.preventDefault();let q=me(M),N=ye(w.target,q);D(dn(w.target,M),"keyboard",N),N&&Z(M,w.target),h(),M.key!=="Enter"&&qs(w.target)&&ye(w.target,q)&&!M[Tu]&&(M[Tu]=!0,Bt(w.target,M,!1)),w.isPressed=!1,w.metaKeyEvents?.delete(M.key)}else if(M.key==="Meta"&&w.metaKeyEvents?.size){let q=w.metaKeyEvents;w.metaKeyEvents=void 0;for(let N of q.values())w.target?.dispatchEvent(new KeyboardEvent("keyup",N))}};if(typeof PointerEvent<"u"){F.onPointerDown=N=>{if(N.button!==0||!ye(N.currentTarget,me(N)))return;if(MT(N.nativeEvent)){w.pointerType="virtual";return}w.pointerType=N.pointerType;let T=!0;if(!w.isPressed){w.isPressed=!0,w.isOverTarget=!0,w.activePointerId=N.pointerId,w.target=N.currentTarget,u||bu(w.target),T=I(N,w.pointerType);let k=me(N);"releasePointerCapture"in k&&("hasPointerCapture"in k?k.hasPointerCapture(N.pointerId)&&k.releasePointerCapture(N.pointerId):k.releasePointerCapture(N.pointerId)),b(Re(N.currentTarget),"pointerup",M,!1),b(Re(N.currentTarget),"pointercancel",q,!1)}T&&N.stopPropagation()},F.onMouseDown=N=>{if(ye(N.currentTarget,me(N))&&N.button===0){if(d){let T=ou(N.target);T&&w.disposables.push(T)}N.stopPropagation()}},F.onPointerUp=N=>{!ye(N.currentTarget,me(N))||w.pointerType==="virtual"||N.button===0&&!w.isPressed&&$(N,w.pointerType||N.pointerType)},F.onPointerEnter=N=>{N.pointerId===w.activePointerId&&w.target&&!w.isOverTarget&&w.pointerType!=null&&(w.isOverTarget=!0,I(dn(w.target,N),w.pointerType))},F.onPointerLeave=N=>{N.pointerId===w.activePointerId&&w.target&&w.isOverTarget&&w.pointerType!=null&&(w.isOverTarget=!1,D(dn(w.target,N),w.pointerType,!1),R(N))};let M=N=>{if(N.pointerId===w.activePointerId&&w.isPressed&&N.button===0&&w.target){if(ye(w.target,me(N))&&w.pointerType!=null){let T=!1,k=setTimeout(()=>{w.isPressed&&w.target instanceof HTMLElement&&(T?_(N):(Pt(w.target),w.target.click()))},80);b(N.currentTarget,"click",()=>T=!0,!0),w.disposables.push(()=>clearTimeout(k))}else _(N);w.isOverTarget=!1}},q=N=>{_(N)};F.onDragStart=N=>{ye(N.currentTarget,me(N))&&_(N)}}else if(process.env.NODE_ENV==="test"){F.onMouseDown=N=>{if(N.button!==0||!ye(N.currentTarget,me(N)))return;if(w.ignoreEmulatedMouseEvents){N.stopPropagation();return}if(w.isPressed=!0,w.isOverTarget=!0,w.target=N.currentTarget,w.pointerType=As(N.nativeEvent)?"virtual":"mouse",Ln.flushSync(()=>I(N,w.pointerType))&&N.stopPropagation(),d){let k=ou(N.target);k&&w.disposables.push(k)}b(Re(N.currentTarget),"mouseup",M,!1)},F.onMouseEnter=N=>{if(!ye(N.currentTarget,me(N)))return;let T=!0;w.isPressed&&!w.ignoreEmulatedMouseEvents&&w.pointerType!=null&&(w.isOverTarget=!0,T=I(N,w.pointerType)),T&&N.stopPropagation()},F.onMouseLeave=N=>{if(!ye(N.currentTarget,me(N)))return;let T=!0;w.isPressed&&!w.ignoreEmulatedMouseEvents&&w.pointerType!=null&&(w.isOverTarget=!1,T=D(N,w.pointerType,!1),R(N)),T&&N.stopPropagation()},F.onMouseUp=N=>{ye(N.currentTarget,me(N))&&!w.ignoreEmulatedMouseEvents&&N.button===0&&!w.isPressed&&$(N,w.pointerType||"mouse")};let M=N=>{if(N.button===0){if(w.ignoreEmulatedMouseEvents){w.ignoreEmulatedMouseEvents=!1;return}w.target&&ye(w.target,me(N))&&w.pointerType!=null||_(N),w.isOverTarget=!1}};F.onTouchStart=N=>{if(!ye(N.currentTarget,me(N)))return;let T=XT(N.nativeEvent);if(!T)return;w.activePointerId=T.identifier,w.ignoreEmulatedMouseEvents=!0,w.isOverTarget=!0,w.isPressed=!0,w.target=N.currentTarget,w.pointerType="touch",u||bu(w.target),I(zt(w.target,N),w.pointerType)&&N.stopPropagation(),b(pt(N.currentTarget),"scroll",q,!0)},F.onTouchMove=N=>{if(!ye(N.currentTarget,me(N)))return;if(!w.isPressed){N.stopPropagation();return}let T=Nu(N.nativeEvent,w.activePointerId),k=!0;T&&Iu(T,N.currentTarget)?!w.isOverTarget&&w.pointerType!=null&&(w.isOverTarget=!0,k=I(zt(w.target,N),w.pointerType)):w.isOverTarget&&w.pointerType!=null&&(w.isOverTarget=!1,k=D(zt(w.target,N),w.pointerType,!1),R(zt(w.target,N))),k&&N.stopPropagation()},F.onTouchEnd=N=>{if(!ye(N.currentTarget,me(N)))return;if(!w.isPressed){N.stopPropagation();return}let T=Nu(N.nativeEvent,w.activePointerId),k=!0;T&&Iu(T,N.currentTarget)&&w.pointerType!=null?($(zt(w.target,N),w.pointerType),k=D(zt(w.target,N),w.pointerType),Z(N.nativeEvent,w.target)):w.isOverTarget&&w.pointerType!=null&&(k=D(zt(w.target,N),w.pointerType,!1)),k&&N.stopPropagation(),w.isPressed=!1,w.activePointerId=null,w.isOverTarget=!1,w.ignoreEmulatedMouseEvents=!0,w.target&&!u&&js(w.target),h()},F.onTouchCancel=N=>{ye(N.currentTarget,me(N))&&(N.stopPropagation(),w.isPressed&&_(zt(w.target,N)))};let q=N=>{w.isPressed&&ye(me(N),w.target)&&_({currentTarget:w.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};F.onDragStart=N=>{ye(N.currentTarget,me(N))&&_(N)}}return F},[b,l,d,h,u,R,I,H,Z]);return E.useEffect(()=>{if(!p||process.env.NODE_ENV==="test")return;const w=Re(p.current);if(!w||!w.head||w.getElementById(wu))return;const F=w.createElement("style");F.id=wu;let B=YT(w);B&&(F.nonce=B),F.textContent=`
|
|
9829
|
+
`}}}},qE={Autocomplete:{components:[Nt],examples:Ki},Checkboxes:{components:[Jt],examples:Hi},"Clickable Tags":{components:[Vn],examples:Wi},"Column Chooser":{components:[Qa,qo],examples:hd},"Conditional Fields":{description:()=>r.createElement("p",null,"A conditional field is one that is only available when a certain option is selected amongst a set of checkboxes or radio buttons."),components:[_s],examples:Wp},"Content Rows":{components:[es,nn,Jo],examples:bd},"Content Sections":{components:[is],examples:Yd},"Date Pickers":{components:[ts],examples:Id},"Date Range Pickers":{components:[os],examples:Md},"Date Time Range Pickers":{components:[rs],examples:Rd},Datetime:{components:[as],examples:Fd},"Time Input":{components:[Os],examples:Yp},"Description Lists":{description:()=>r.createElement("p",null,"Description Lists display a series of terms with accompanying descriptions such as a glossary of terms."),components:[tr,nr,rr],examples:zd},Dropdown:{components:[an,ss],examples:jd},"Filter Panel":{components:[xs,ks,Ms,Ls],examples:Hp},Form:{components:[so],examples:gd},Incrementor:{components:[ls],examples:qd},Label:{description:()=>r.createElement("p",null,"Labels provide a description for the value to be entered or selected in an accompanying input field."),components:[cs],examples:Jd},"List Action Bar":{description:()=>r.createElement("p",null,"The List Action Bar contains the action buttons relevant to selected items from a Table List, Row List, or Card List. The List Action Bar is only visible when one or more list items have been selected and appears anchored to the bottom of the page above all other content."),components:[ds],examples:fp},"Micro Block":{components:[ps],examples:Sp},Modals:{description:()=>r.createElement("p",null,"Modals are overlays on a page that focus a user’s attention on an important message or a simple action. Examples of a Modal include confirming the deletion of a record, or making a single selection."),components:[us,sr],examples:hp},"Multi Select":{description:()=>r.createElement("p",null,"Multi-Selects consist of a Label and a dropdown menu from which a user selects one or more values from a list of pre-defined options."),components:[fs],examples:bp},"Multi Value Text Input":{description:()=>r.createElement("p",null,"To be determined."),components:[Ps],examples:zp},Pagination:{description:()=>r.createElement("p",null,"The Pagination component allows users to navigate lists of records and control the number of records displayed on each page. The records can span across multiple pages, or within sections of a page."),components:[Ss,ir],examples:vp},"Radio Buttons":{description:"Radio Buttons allow a user to make single selection from a list of predefined options.",components:[gs],examples:yp},Selects:{description:"Selects consist off a Label and a dropdown menu from which a user selects a value from a list of pre-defined options.",components:[on],examples:Ld},"Side Navigation":{description:"Side Navigations are used to provide quick access to a series of related pages or content. It can be used to navigate between different page views, or as an anchor-style menu to scroll to specific content on the same page.",components:[Tp],examples:wp},"Split Button":{components:[hs],examples:Cp},"Summary List Row":{components:[bs,vs,co],examples:Dp},Tables:{description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("div",{className:"sps-body-14"},"Tables (along with ",r.createElement(e,{to:"content-rows"},"Content Rows")," and"," ",r.createElement(e,{to:"content-tiles"},"Content Tiles"),") are one of three options for displaying a list of records on a page."),r.createElement("br",null),r.createElement("div",{className:"sps-body-14"},"Tables are the ideal solution for displaying tabular data, especially when the listed records contain a considerable amount of data points. While tables are primarily used to display an extensive list of records, often in a paginated format, they can also be used to display smaller sets of tabular data in any context.")),components:[sn,Wt,re,Ht,Be,De],examples:mp},"Task Queue":{components:[ys],examples:Np},"Text Inputs":{description:()=>r.createElement("p",null,"Text Inputs consist of a Label and a field in which a user enters a short value."),components:[cr],examples:Ip},"Text Areas":{description:()=>r.createElement("p",null,"Text Areas consist of a Label and a field in which a user enters a long value."),components:[Es],examples:xp},Toggles:{description:()=>r.createElement("p",null,"Toggles allow a user to immediately turn a setting on or off."),components:[Ts],examples:Mp},Tooltips:{components:[ct,ws],examples:Lp},Wizard:{components:[Ds,Ns],examples:Op},Workflow:{components:[dr,pr,ur,mr],examples:Kp,notices:[VE]},"Slide In Panels":{description:"",components:[ms],examples:gp}},JE=new Set(["id"]),XE=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),ZE=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),QE=new Set(["dir","lang","hidden","inert","translate"]),qp=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),eT=/^(data-.*)$/;function tT(e,t={}){let{labelable:n,isLink:o,global:a,events:s=a,propNames:i}=t,l={};for(const c in e)Object.prototype.hasOwnProperty.call(e,c)&&(JE.has(c)||n&&XE.has(c)||o&&ZE.has(c)||a&&QE.has(c)||s&&(qp.has(c)||c.endsWith("Capture")&&qp.has(c.slice(0,-7)))||i?.has(c)||eT.test(c))&&(l[c]=e[c]);return l}const Jp=new WeakMap;function fr(e,t,n){if(!e)return"";typeof t=="string"&&(t=t.replace(/\s+/g,""));let o=Jp.get(e);return process.env.NODE_ENV!=="production"&&!o&&console.error("There is no tab id, please check if you have rendered the tab panel before the tab list."),`${o}-${n}-${t}`}function Bs(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Gt=typeof document<"u"?E.useLayoutEffect:()=>{},Sr={prefix:String(Math.round(Math.random()*1e10)),current:0},Xp=E.createContext(Sr),nT=E.createContext(!1);let oT=!!(typeof window<"u"&&window.document&&window.document.createElement),Rs=new WeakMap;function rT(e=!1){let t=E.useContext(Xp),n=E.useRef(null);if(n.current===null&&!e){let o=E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(o){let a=Rs.get(o);a==null?Rs.set(o,{id:t.current,state:o.memoizedState}):o.memoizedState!==a.state&&(t.current=a.id,Rs.delete(o))}n.current=++t.current}return n.current}function aT(e){let t=E.useContext(Xp);t===Sr&&!oT&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=rT(!!e),o=t===Sr&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${o}-${n}`}function sT(e){let t=E.useId(),[n]=E.useState(Zp()),o=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Sr.prefix}`;return e||`${o}-${t}`}const iT=typeof E.useId=="function"?sT:aT;function lT(){return!1}function cT(){return!0}function dT(e){return()=>{}}function Zp(){return typeof E.useSyncExternalStore=="function"?E.useSyncExternalStore(dT,lT,cT):E.useContext(nT)}let pT=!!(typeof window<"u"&&window.document&&window.document.createElement),xn=new Map,po;typeof FinalizationRegistry<"u"&&(po=new FinalizationRegistry(e=>{xn.delete(e)}));function gr(e){let[t,n]=E.useState(e),o=E.useRef(null),a=iT(t),s=E.useRef(null);if(po&&po.register(s,a),pT){const i=xn.get(a);i&&!i.includes(o)?i.push(o):xn.set(a,[o])}return Gt(()=>{let i=a;return()=>{po&&po.unregister(s),xn.delete(i)}},[a]),E.useEffect(()=>{let i=o.current;return i&&n(i),()=>{i&&(o.current=null)}}),a}function uT(e,t){if(e===t)return e;let n=xn.get(e);if(n)return n.forEach(a=>a.current=t),t;let o=xn.get(t);return o?(o.forEach(a=>a.current=e),e):t}function mT(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1;const o=e.map(a=>{const s=Qp(a,t);return n||=typeof s=="function",s});if(n)return()=>{o.forEach((a,s)=>{typeof a=="function"?a():Qp(e[s],null)})}}}function Qp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dt(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let o=e[n];for(let a in o){let s=t[a],i=o[a];typeof s=="function"&&typeof i=="function"&&a[0]==="o"&&a[1]==="n"&&a.charCodeAt(2)>=65&&a.charCodeAt(2)<=90?t[a]=Bs(s,i):(a==="className"||a==="UNSAFE_className")&&typeof s=="string"&&typeof i=="string"?t[a]=K(s,i):a==="id"&&s&&i?t.id=uT(s,i):a==="ref"&&s&&i?t.ref=mT(s,i):t[a]=i!==void 0?i:s}}return t}function Pt(e){if(fT())e.focus({preventScroll:!0});else{let t=ST(e);e.focus(),gT(t)}}let hr=null;function fT(){if(hr==null){hr=!1;try{document.createElement("div").focus({get preventScroll(){return hr=!0,!0}})}catch{}}return hr}function ST(e){let t=e.parentNode,n=[],o=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==o;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return o instanceof HTMLElement&&n.push({element:o,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft}),n}function gT(e){for(let{element:t,scrollTop:n,scrollLeft:o}of e)t.scrollTop=n,t.scrollLeft=o}const Re=e=>e?.ownerDocument??document,pt=e=>e&&"window"in e&&e.window===e?e:Re(e).defaultView||window;function hT(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function bT(e){return hT(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let vT=!1;function br(){return vT}function ye(e,t){if(!br())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:bT(n)?n=n.host:n=n.parentNode}return!1}const It=(e=document)=>{if(!br())return e.activeElement;let t=e.activeElement;for(;t&&"shadowRoot"in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function me(e){if(br()&&e.target instanceof Element&&e.target.shadowRoot){if("composedPath"in e)return e.composedPath()[0]??null;if("composedPath"in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function eu(e){if(!e)return!1;let t=e.getRootNode(),n=pt(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let o=t.activeElement;return o!=null&&e.contains(o)}const yT=typeof Element<"u"&&"checkVisibility"in Element.prototype;function ET(e){const t=pt(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:o}=e.style,a=n!=="none"&&o!=="hidden"&&o!=="collapse";if(a){const{getComputedStyle:s}=e.ownerDocument.defaultView;let{display:i,visibility:l}=s(e);a=i!=="none"&&l!=="hidden"&&l!=="collapse"}return a}function TT(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Fs(e,t){return yT?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&ET(e)&&TT(e,t)&&(!e.parentElement||Fs(e.parentElement,e))}const As=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],wT=As.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";As.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const CT=As.join(':not([hidden]):not([tabindex="-1"]),');function tu(e,t){return e.matches(wT)&&!ou(e)&&(t?.skipVisibilityCheck||Fs(e))}function nu(e){return e.matches(CT)&&Fs(e)&&!ou(e)}function ou(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function ru(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function DT(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function NT(e){let t=E.useRef({isFocused:!1,observer:null});return Gt(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),E.useCallback(n=>{let o=me(n);if(o instanceof HTMLButtonElement||o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement){t.current.isFocused=!0;let a=o,s=i=>{if(t.current.isFocused=!1,a.disabled){let l=ru(i);e?.(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};a.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&a.disabled){t.current.observer?.disconnect();let i=a===It()?null:It();a.dispatchEvent(new FocusEvent("blur",{relatedTarget:i})),a.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:i}))}}),t.current.observer.observe(a,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let vr=!1;function au(e){for(;e&&!tu(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=pt(e),n=t.document.activeElement;if(!n||n===e)return;vr=!0;let o=!1,a=u=>{(me(u)===n||o)&&u.stopImmediatePropagation()},s=u=>{(me(u)===n||o)&&(u.stopImmediatePropagation(),!e&&!o&&(o=!0,Pt(n),c()))},i=u=>{(me(u)===e||o)&&u.stopImmediatePropagation()},l=u=>{(me(u)===e||o)&&(u.stopImmediatePropagation(),o||(o=!0,Pt(n),c()))};t.addEventListener("blur",a,!0),t.addEventListener("focusout",s,!0),t.addEventListener("focusin",l,!0),t.addEventListener("focus",i,!0);let c=()=>{cancelAnimationFrame(d),t.removeEventListener("blur",a,!0),t.removeEventListener("focusout",s,!0),t.removeEventListener("focusin",l,!0),t.removeEventListener("focus",i,!0),vr=!1,o=!1},d=requestAnimationFrame(c);return c}function yr(e){if(typeof window>"u"||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(n=>e.test(n.brand))||e.test(window.navigator.userAgent)}function $s(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function Ot(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const ln=Ot(function(){return $s(/^Mac/i)}),IT=Ot(function(){return $s(/^iPhone/i)}),su=Ot(function(){return $s(/^iPad/i)||ln()&&navigator.maxTouchPoints>1}),Er=Ot(function(){return IT()||su()}),xT=Ot(function(){return ln()||Er()}),kT=Ot(function(){return yr(/AppleWebKit/i)&&!MT()}),MT=Ot(function(){return yr(/Chrome/i)}),iu=Ot(function(){return yr(/Android/i)}),LT=Ot(function(){return yr(/Firefox/i)});function Vs(e){return e.pointerType===""&&e.isTrusted?!0:iu()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function _T(e){return!iu()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}const PT=E.createContext({isNative:!0,open:BT,useHref:e=>e});function Ks(){return E.useContext(PT)}function Bt(e,t,n=!0){let{metaKey:o,ctrlKey:a,altKey:s,shiftKey:i}=t;LT()&&window.event?.type?.startsWith("key")&&e.target==="_blank"&&(ln()?o=!0:a=!0);let l=kT()&&ln()&&!su()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:o,ctrlKey:a,altKey:s,shiftKey:i}):new MouseEvent("click",{metaKey:o,ctrlKey:a,altKey:s,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});Bt.isOpening=n,Pt(e),e.dispatchEvent(l),Bt.isOpening=!1}Bt.isOpening=!1;function OT(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function BT(e,t){OT(e,n=>Bt(n,t))}function RT(e){const n=Ks().useHref(e?.href??"");return{href:e?.href?n:void 0,target:e?.target,rel:e?.rel,download:e?.download,ping:e?.ping,referrerPolicy:e?.referrerPolicy}}let uo=null;const FT=new Set;let mo=new Map,cn=!1,Hs=!1;function Ws(e,t){for(let n of FT)n(e,t)}function AT(e){return!(e.metaKey||!ln()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Tr(e){cn=!0,!Bt.isOpening&&AT(e)&&(uo="keyboard",Ws("keyboard",e))}function ut(e){uo="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(cn=!0,Ws("pointer",e))}function lu(e){!Bt.isOpening&&Vs(e)&&(cn=!0,uo="virtual")}function cu(e){let t=pt(me(e)),n=Re(me(e));me(e)===t||me(e)===n||vr||!e.isTrusted||(!cn&&!Hs&&(uo="virtual",Ws("virtual",e)),cn=!1,Hs=!1)}function du(){vr||(cn=!1,Hs=!0)}function pu(e){if(typeof window>"u"||typeof document>"u")return;const t=pt(e),n=Re(e);if(mo.get(t))return;let o=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){cn=!0,o.apply(this,arguments)},n.addEventListener("keydown",Tr,!0),n.addEventListener("keyup",Tr,!0),n.addEventListener("click",lu,!0),t.addEventListener("focus",cu,!0),t.addEventListener("blur",du,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ut,!0),n.addEventListener("pointermove",ut,!0),n.addEventListener("pointerup",ut,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",ut,!0),n.addEventListener("mousemove",ut,!0),n.addEventListener("mouseup",ut,!0)),t.addEventListener("beforeunload",()=>{uu(e)},{once:!0}),mo.set(t,{focus:o})}const uu=(e,t)=>{const n=pt(e),o=Re(e);t&&o.removeEventListener("DOMContentLoaded",t),mo.has(n)&&(n.HTMLElement.prototype.focus=mo.get(n).focus,o.removeEventListener("keydown",Tr,!0),o.removeEventListener("keyup",Tr,!0),o.removeEventListener("click",lu,!0),n.removeEventListener("focus",cu,!0),n.removeEventListener("blur",du,!1),typeof PointerEvent<"u"?(o.removeEventListener("pointerdown",ut,!0),o.removeEventListener("pointermove",ut,!0),o.removeEventListener("pointerup",ut,!0)):process.env.NODE_ENV==="test"&&(o.removeEventListener("mousedown",ut,!0),o.removeEventListener("mousemove",ut,!0),o.removeEventListener("mouseup",ut,!0)),mo.delete(n))};function $T(e){const t=Re(e);let n;return t.readyState!=="loading"?pu(e):(n=()=>{pu(e)},t.addEventListener("DOMContentLoaded",n)),()=>uu(e,n)}typeof document<"u"&&$T();function Gs(){return uo}let Ut=new Map,Us=new Set;function mu(){if(typeof window>"u")return;function e(o){return"propertyName"in o}let t=o=>{let a=me(o);if(!e(o)||!a)return;let s=Ut.get(a);s||(s=new Set,Ut.set(a,s),a.addEventListener("transitioncancel",n,{once:!0})),s.add(o.propertyName)},n=o=>{let a=me(o);if(!e(o)||!a)return;let s=Ut.get(a);if(s&&(s.delete(o.propertyName),s.size===0&&(a.removeEventListener("transitioncancel",n),Ut.delete(a)),Ut.size===0)){for(let i of Us)i();Us.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?mu():document.addEventListener("DOMContentLoaded",mu));function VT(){for(const[e]of Ut)"isConnected"in e&&!e.isConnected&&Ut.delete(e)}function fu(e){requestAnimationFrame(()=>{VT(),Ut.size===0?e():Us.add(e)})}function wr(e){if(!e.isConnected)return;const t=Re(e);if(Gs()==="virtual"){let n=It(t);fu(()=>{const o=It(t);(o===n||o===t.body)&&e.isConnected&&Pt(e)})}else Pt(e)}function KT(e){let{isDisabled:t,onFocus:n,onBlur:o,onFocusChange:a}=e;const s=E.useCallback(c=>{if(me(c)===c.currentTarget)return o&&o(c),a&&a(!1),!0},[o,a]),i=NT(s),l=E.useCallback(c=>{let d=me(c);const u=Re(d),m=u?It(u):It();d===c.currentTarget&&d===m&&(n&&n(c),a&&a(!0),i(c))},[a,n,i]);return{focusProps:{onFocus:!t&&(n||a||o)?l:void 0,onBlur:!t&&(o||a)?s:void 0}}}function Su(e){if(!e)return;let t=!0;return n=>{let o={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t&&process.env.NODE_ENV!=="production"?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(o),t&&n.stopPropagation()}}function HT(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:Su(e.onKeyDown),onKeyUp:Su(e.onKeyUp)}}}function gu(e,t){Gt(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}let WT=E.createContext(null);function GT(e){let t=E.useContext(WT)||{};gu(t,e);let{ref:n,...o}=t;return o}function UT(e,t){let{focusProps:n}=KT(e),{keyboardProps:o}=HT(e),a=dt(n,o),s=GT(t),i=e.isDisabled?{}:s,l=E.useRef(e.autoFocus);E.useEffect(()=>{l.current&&t.current&&wr(t.current),l.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:dt({...a,tabIndex:c},i)}}function zs(e){return xT()?e.altKey:e.ctrlKey}function js(e,t){let n=`[data-key="${CSS.escape(String(t))}"]`,o=e.current?.dataset.collection;return o&&(n=`[data-collection="${CSS.escape(o)}"]${n}`),e.current?.querySelector(n)}const hu=new WeakMap;function zT(e){let t=gr();return hu.set(e,t),t}function jT(e){return hu.get(e)}function kn(e){return ln()?e.metaKey:e.ctrlKey}function bu(e){let t=qT(Re(e));t!==e&&(t&&YT(t,e),e&&vu(e,t))}function YT(e,t){e.dispatchEvent(new FocusEvent("blur",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:t}))}function vu(e,t){e.dispatchEvent(new FocusEvent("focus",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:t}))}function qT(e){let t=It(e),n=t?.getAttribute("aria-activedescendant");return n&&e.getElementById(n)||t}let Mn="default",Ys="",Cr=new WeakMap;function yu(e){if(Er()){if(Mn==="default"){const t=Re(e);Ys=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}Mn="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Cr.set(e,e.style[t]),e.style[t]="none"}}function qs(e){if(Er()){if(Mn!=="disabled")return;Mn="restoring",setTimeout(()=>{fu(()=>{if(Mn==="restoring"){const t=Re(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=Ys||""),Ys="",Mn="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Cr.has(e)){let t=Cr.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Cr.delete(e)}}function Eu(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let Js=new WeakMap;function JT(e){let t=e??(typeof document<"u"?document:void 0);if(!t)return Eu(t);if(Js.has(t))return Js.get(t);let n=t.querySelector('meta[property="csp-nonce"]'),o=n&&n instanceof pt(n).HTMLMetaElement&&(n.nonce||n.content)||Eu(t)||void 0;return o!==void 0&&Js.set(t,o),o}const Tu=E.createContext({register:()=>{}});Tu.displayName="PressResponderContext";const XT=E.useInsertionEffect??Gt;function Dr(e){const t=E.useRef(null);return XT(()=>{t.current=e},[e]),E.useCallback((...n)=>{const o=t.current;return o?.(...n)},[])}function wu(){let e=E.useRef(new Map),t=E.useCallback((a,s,i,l)=>{let c=l?.once?(...d)=>{e.current.delete(i),i(...d)}:i;e.current.set(i,{type:s,eventTarget:a,fn:c,options:l}),a.addEventListener(s,c,l)},[]),n=E.useCallback((a,s,i,l)=>{let c=e.current.get(i)?.fn||i;a.removeEventListener(s,c,l),e.current.delete(i)},[]),o=E.useCallback(()=>{e.current.forEach((a,s)=>{n(a.eventTarget,a.type,s,a.options)})},[n]);return E.useEffect(()=>o,[o]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:o}}function ZT(e){let t=E.useContext(Tu);if(t){let{register:n,ref:o,...a}=t;e=dt(a,e),n()}return gu(t,e.ref),e}class Nr{#e;constructor(t,n,o,a){this.#e=!0;const i=(a?.target??o.currentTarget)?.getBoundingClientRect();let l,c=0,d,u=null;o.clientX!=null&&o.clientY!=null&&(d=o.clientX,u=o.clientY),i&&(d!=null&&u!=null?(l=d-i.left,c=u-i.top):(l=i.width/2,c=i.height/2)),this.type=t,this.pointerType=n,this.target=o.currentTarget,this.shiftKey=o.shiftKey,this.metaKey=o.metaKey,this.ctrlKey=o.ctrlKey,this.altKey=o.altKey,this.x=l,this.y=c,this.key=o.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}const Cu=Symbol("linkClicked"),Du="react-aria-pressable-style",Nu="data-react-aria-pressable";function Iu(e){let{onPress:t,onPressChange:n,onPressStart:o,onPressEnd:a,onPressUp:s,onClick:i,isDisabled:l,isPressed:c,preventFocusOnPress:d,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:m,ref:p,...f}=ZT(e),[g,v]=E.useState(!1),y=E.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:b,removeAllGlobalListeners:h}=wu(),I=E.useCallback((w,F)=>{let B=y.current;if(l||B.didFirePressStart)return!1;let M=!0;if(B.isTriggeringEvent=!0,o){let q=new Nr("pressstart",F,w);o(q),M=q.shouldStopPropagation}return n&&n(!0),B.isTriggeringEvent=!1,B.didFirePressStart=!0,v(!0),M},[l,o,n]),C=E.useCallback((w,F,B=!0)=>{let M=y.current;if(!M.didFirePressStart)return!1;M.didFirePressStart=!1,M.isTriggeringEvent=!0;let q=!0;if(a){let N=new Nr("pressend",F,w);a(N),q=N.shouldStopPropagation}if(n&&n(!1),v(!1),t&&B&&!l){let N=new Nr("press",F,w);t(N),q&&=N.shouldStopPropagation}return M.isTriggeringEvent=!1,q},[l,a,n,t]),D=Dr(C),L=E.useCallback((w,F)=>{let B=y.current;if(l)return!1;if(s){B.isTriggeringEvent=!0;let M=new Nr("pressup",F,w);return s(M),B.isTriggeringEvent=!1,M.shouldStopPropagation}return!0},[l,s]),$=Dr(L),O=E.useCallback(w=>{let F=y.current;if(F.isPressed&&F.target){F.didFirePressStart&&F.pointerType!=null&&C(dn(F.target,w),F.pointerType,!1),F.isPressed=!1,F.isOverTarget=!1,F.activePointerId=null,F.pointerType=null,h(),m||qs(F.target);for(let B of F.disposables)B();F.disposables=[]}},[m,h,C]),_=Dr(O),R=E.useCallback(w=>{u&&O(w)},[u,O]),H=E.useCallback(w=>{l||i?.(w)},[l,i]),Z=E.useCallback((w,F)=>{if(!l&&i){let B=new MouseEvent("click",w);DT(B,F),i(ru(B))}},[l,i]),V=E.useMemo(()=>{let w=y.current,F={onKeyDown(M){if(Zs(M.nativeEvent,M.currentTarget)&&ye(M.currentTarget,me(M))){Mu(me(M),M.key)&&M.preventDefault();let q=!0;!w.isPressed&&!M.repeat&&(w.target=M.currentTarget,w.isPressed=!0,w.pointerType="keyboard",q=I(M,"keyboard"));let N=M.currentTarget,T=k=>{Zs(k,N)&&!k.repeat&&ye(N,me(k))&&w.target&&$(dn(w.target,k),"keyboard")};b(Re(M.currentTarget),"keyup",Bs(T,B),!0),q&&M.stopPropagation(),M.metaKey&&ln()&&w.metaKeyEvents?.set(M.key,M.nativeEvent)}else M.key==="Meta"&&(w.metaKeyEvents=new Map)},onClick(M){if(!(M&&!ye(M.currentTarget,me(M)))&&M&&M.button===0&&!w.isTriggeringEvent&&!Bt.isOpening){let q=!0;if(l&&M.preventDefault(),!w.ignoreEmulatedMouseEvents&&!w.isPressed&&(w.pointerType==="virtual"||Vs(M.nativeEvent))){let N=I(M,"virtual"),T=$(M,"virtual"),k=D(M,"virtual");H(M),q=N&&T&&k}else if(w.isPressed&&w.pointerType!=="keyboard"){let N=w.pointerType||M.nativeEvent.pointerType||"virtual",T=$(dn(M.currentTarget,M),N),k=D(dn(M.currentTarget,M),N,!0);q=T&&k,w.isOverTarget=!1,H(M),_(M)}w.ignoreEmulatedMouseEvents=!1,q&&M.stopPropagation()}}},B=M=>{if(w.isPressed&&w.target&&Zs(M,w.target)){Mu(me(M),M.key)&&M.preventDefault();let q=me(M),N=ye(w.target,q);D(dn(w.target,M),"keyboard",N),N&&Z(M,w.target),h(),M.key!=="Enter"&&Xs(w.target)&&ye(w.target,q)&&!M[Cu]&&(M[Cu]=!0,Bt(w.target,M,!1)),w.isPressed=!1,w.metaKeyEvents?.delete(M.key)}else if(M.key==="Meta"&&w.metaKeyEvents?.size){let q=w.metaKeyEvents;w.metaKeyEvents=void 0;for(let N of q.values())w.target?.dispatchEvent(new KeyboardEvent("keyup",N))}};if(typeof PointerEvent<"u"){F.onPointerDown=N=>{if(N.button!==0||!ye(N.currentTarget,me(N)))return;if(_T(N.nativeEvent)){w.pointerType="virtual";return}w.pointerType=N.pointerType;let T=!0;if(!w.isPressed){w.isPressed=!0,w.isOverTarget=!0,w.activePointerId=N.pointerId,w.target=N.currentTarget,m||yu(w.target),T=I(N,w.pointerType);let k=me(N);"releasePointerCapture"in k&&("hasPointerCapture"in k?k.hasPointerCapture(N.pointerId)&&k.releasePointerCapture(N.pointerId):k.releasePointerCapture(N.pointerId)),b(Re(N.currentTarget),"pointerup",M,!1),b(Re(N.currentTarget),"pointercancel",q,!1)}T&&N.stopPropagation()},F.onMouseDown=N=>{if(ye(N.currentTarget,me(N))&&N.button===0){if(d){let T=au(N.target);T&&w.disposables.push(T)}N.stopPropagation()}},F.onPointerUp=N=>{!ye(N.currentTarget,me(N))||w.pointerType==="virtual"||N.button===0&&!w.isPressed&&$(N,w.pointerType||N.pointerType)},F.onPointerEnter=N=>{N.pointerId===w.activePointerId&&w.target&&!w.isOverTarget&&w.pointerType!=null&&(w.isOverTarget=!0,I(dn(w.target,N),w.pointerType))},F.onPointerLeave=N=>{N.pointerId===w.activePointerId&&w.target&&w.isOverTarget&&w.pointerType!=null&&(w.isOverTarget=!1,D(dn(w.target,N),w.pointerType,!1),R(N))};let M=N=>{if(N.pointerId===w.activePointerId&&w.isPressed&&N.button===0&&w.target){if(ye(w.target,me(N))&&w.pointerType!=null){let T=!1,k=setTimeout(()=>{w.isPressed&&w.target instanceof HTMLElement&&(T?_(N):(Pt(w.target),w.target.click()))},80);b(N.currentTarget,"click",()=>T=!0,!0),w.disposables.push(()=>clearTimeout(k))}else _(N);w.isOverTarget=!1}},q=N=>{_(N)};F.onDragStart=N=>{ye(N.currentTarget,me(N))&&_(N)}}else if(process.env.NODE_ENV==="test"){F.onMouseDown=N=>{if(N.button!==0||!ye(N.currentTarget,me(N)))return;if(w.ignoreEmulatedMouseEvents){N.stopPropagation();return}if(w.isPressed=!0,w.isOverTarget=!0,w.target=N.currentTarget,w.pointerType=Vs(N.nativeEvent)?"virtual":"mouse",Ln.flushSync(()=>I(N,w.pointerType))&&N.stopPropagation(),d){let k=au(N.target);k&&w.disposables.push(k)}b(Re(N.currentTarget),"mouseup",M,!1)},F.onMouseEnter=N=>{if(!ye(N.currentTarget,me(N)))return;let T=!0;w.isPressed&&!w.ignoreEmulatedMouseEvents&&w.pointerType!=null&&(w.isOverTarget=!0,T=I(N,w.pointerType)),T&&N.stopPropagation()},F.onMouseLeave=N=>{if(!ye(N.currentTarget,me(N)))return;let T=!0;w.isPressed&&!w.ignoreEmulatedMouseEvents&&w.pointerType!=null&&(w.isOverTarget=!1,T=D(N,w.pointerType,!1),R(N)),T&&N.stopPropagation()},F.onMouseUp=N=>{ye(N.currentTarget,me(N))&&!w.ignoreEmulatedMouseEvents&&N.button===0&&!w.isPressed&&$(N,w.pointerType||"mouse")};let M=N=>{if(N.button===0){if(w.ignoreEmulatedMouseEvents){w.ignoreEmulatedMouseEvents=!1;return}w.target&&ye(w.target,me(N))&&w.pointerType!=null||_(N),w.isOverTarget=!1}};F.onTouchStart=N=>{if(!ye(N.currentTarget,me(N)))return;let T=QT(N.nativeEvent);if(!T)return;w.activePointerId=T.identifier,w.ignoreEmulatedMouseEvents=!0,w.isOverTarget=!0,w.isPressed=!0,w.target=N.currentTarget,w.pointerType="touch",m||yu(w.target),I(zt(w.target,N),w.pointerType)&&N.stopPropagation(),b(pt(N.currentTarget),"scroll",q,!0)},F.onTouchMove=N=>{if(!ye(N.currentTarget,me(N)))return;if(!w.isPressed){N.stopPropagation();return}let T=xu(N.nativeEvent,w.activePointerId),k=!0;T&&ku(T,N.currentTarget)?!w.isOverTarget&&w.pointerType!=null&&(w.isOverTarget=!0,k=I(zt(w.target,N),w.pointerType)):w.isOverTarget&&w.pointerType!=null&&(w.isOverTarget=!1,k=D(zt(w.target,N),w.pointerType,!1),R(zt(w.target,N))),k&&N.stopPropagation()},F.onTouchEnd=N=>{if(!ye(N.currentTarget,me(N)))return;if(!w.isPressed){N.stopPropagation();return}let T=xu(N.nativeEvent,w.activePointerId),k=!0;T&&ku(T,N.currentTarget)&&w.pointerType!=null?($(zt(w.target,N),w.pointerType),k=D(zt(w.target,N),w.pointerType),Z(N.nativeEvent,w.target)):w.isOverTarget&&w.pointerType!=null&&(k=D(zt(w.target,N),w.pointerType,!1)),k&&N.stopPropagation(),w.isPressed=!1,w.activePointerId=null,w.isOverTarget=!1,w.ignoreEmulatedMouseEvents=!0,w.target&&!m&&qs(w.target),h()},F.onTouchCancel=N=>{ye(N.currentTarget,me(N))&&(N.stopPropagation(),w.isPressed&&_(zt(w.target,N)))};let q=N=>{w.isPressed&&ye(me(N),w.target)&&_({currentTarget:w.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};F.onDragStart=N=>{ye(N.currentTarget,me(N))&&_(N)}}return F},[b,l,d,h,m,R,I,H,Z]);return E.useEffect(()=>{if(!p||process.env.NODE_ENV==="test")return;const w=Re(p.current);if(!w||!w.head||w.getElementById(Du))return;const F=w.createElement("style");F.id=Du;let B=JT(w);B&&(F.nonce=B),F.textContent=`
|
|
9830
9830
|
@layer {
|
|
9831
|
-
[${
|
|
9831
|
+
[${Nu}] {
|
|
9832
9832
|
touch-action: pan-x pan-y pinch-zoom;
|
|
9833
9833
|
}
|
|
9834
9834
|
}
|
|
9835
|
-
`.trim(),w.head.prepend(F)},[p]),E.useEffect(()=>{let w=y.current;return()=>{u||js(w.target??void 0);for(let F of w.disposables)F();w.disposables=[]}},[u]),{isPressed:c||g,pressProps:dt(f,V,{[Cu]:!0})}}function qs(e){return e.tagName==="A"&&e.hasAttribute("href")}function Js(e,t){const{key:n,code:o}=e,a=t,s=a.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||o==="Space")&&!(a instanceof pt(a).HTMLInputElement&&!ku(a,n)||a instanceof pt(a).HTMLTextAreaElement||a.isContentEditable)&&!((s==="link"||!s&&qs(a))&&n!=="Enter")}function XT(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function Nu(e,t){const n=e.changedTouches;for(let o=0;o<n.length;o++){const a=n[o];if(a.identifier===t)return a}return null}function zt(e,t){let n=0,o=0;return t.targetTouches&&t.targetTouches.length===1&&(n=t.targetTouches[0].clientX,o=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:o}}function dn(e,t){let n=t.clientX,o=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:o,key:t.key}}function ZT(e){let t=0,n=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?n=e.height/2:e.radiusY!==void 0&&(n=e.radiusY),{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function QT(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function Iu(e,t){let n=t.getBoundingClientRect(),o=ZT(e);return QT(n,o)}function ew(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!qs(e)}function xu(e,t){return e instanceof HTMLInputElement?!ku(e,t):ew(e)}const tw=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ku(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":tw.has(e.type)}let nw=0;const Xs=new Map;function ow(e){let[t,n]=E.useState();return Gt(()=>{if(!e)return;let o=Xs.get(e);if(o)n(o.element.id);else{let a=`react-aria-description-${nw++}`;n(a);let s=document.createElement("div");s.id=a,s.style.display="none",s.textContent=e,document.body.appendChild(s),o={refCount:0,element:s},Xs.set(e,o)}return o.refCount++,()=>{o&&--o.refCount===0&&(o.element.remove(),Xs.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}const rw=500;function aw(e){let{isDisabled:t,onLongPressStart:n,onLongPressEnd:o,onLongPress:a,threshold:s=rw,accessibilityDescription:i}=e;const l=E.useRef(void 0);let{addGlobalListener:c,removeGlobalListener:d}=Eu(),{pressProps:m}=Du({isDisabled:t,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(n&&n({...p,type:"longpressstart"}),l.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Re(p.target).activeElement!==p.target&&Pt(p.target),a&&a({...p,type:"longpress"}),l.current=void 0},s),p.pointerType==="touch")){let f=v=>{v.preventDefault()},g=pt(p.target);c(p.target,"contextmenu",f,{once:!0}),c(g,"pointerup",()=>{setTimeout(()=>{d(p.target,"contextmenu",f)},30)},{once:!0})}},onPressEnd(p){l.current&&clearTimeout(l.current),o&&(p.pointerType==="mouse"||p.pointerType==="touch")&&o({...p,type:"longpressend"})}}),u=ow(a&&!t?i:void 0);return{longPressProps:dt(m,u)}}function sw(e){let{id:t,selectionManager:n,key:o,ref:a,shouldSelectOnPressUp:s,shouldUseVirtualFocus:i,focus:l,isDisabled:c,onAction:d,allowsDifferentPressOrigin:m,linkBehavior:u="action"}=e,p=$s();t=mr(t);let f=T=>{if(T.pointerType==="keyboard"&&Gs(T))n.toggleSelection(o);else{if(n.selectionMode==="none")return;if(n.isLink(o)){if(u==="selection"&&a.current){let k=n.getItemProps(o);p.open(a.current,T,k.href,k.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(u==="override"||u==="none")return}n.selectionMode==="single"?n.isSelected(o)&&!n.disallowEmptySelection?n.toggleSelection(o):n.replaceSelection(o):T&&T.shiftKey?n.extendSelection(o):n.selectionBehavior==="toggle"||T&&(kn(T)||T.pointerType==="touch"||T.pointerType==="virtual")?n.toggleSelection(o):n.replaceSelection(o)}};E.useEffect(()=>{o===n.focusedKey&&n.isFocused&&(i?gu(a.current):l?l():It()!==a.current&&a.current&&yr(a.current))},[a,o,n.focusedKey,n.childFocusStrategy,n.isFocused,i]),c=c||n.isDisabled(o);let g={};!i&&!c?g={tabIndex:o===n.focusedKey?0:-1,onFocus(T){me(T)===a.current&&n.setFocusedKey(o)}}:c&&(g.onMouseDown=T=>{T.preventDefault()}),E.useEffect(()=>{c&&n.focusedKey===o&&n.setFocusedKey(null)},[n,c,o]);let v=n.isLink(o)&&u==="override",y=d&&e.UNSTABLE_itemBehavior==="action",b=n.isLink(o)&&u!=="selection"&&u!=="none",h=!c&&n.canSelectItem(o)&&!v&&!y,I=(d||b)&&!c,C=I&&(n.selectionBehavior==="replace"?!h:!h||n.isEmpty),D=I&&h&&n.selectionBehavior==="replace",L=C||D,$=E.useRef(null),O=L&&h,_=E.useRef(!1),R=E.useRef(!1),H=n.getItemProps(o),Z=T=>{d&&(d(),a.current?.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),b&&a.current&&p.open(a.current,T,H.href,H.routerOptions)},V={ref:a};if(s?(V.onPressStart=T=>{$.current=T.pointerType,_.current=O,T.pointerType==="keyboard"&&(!L||Lu(T.key))&&f(T)},m?(V.onPressUp=C?void 0:T=>{T.pointerType==="mouse"&&h&&f(T)},V.onPress=C?Z:T=>{T.pointerType!=="keyboard"&&T.pointerType!=="mouse"&&h&&f(T)}):V.onPress=T=>{if(C||D&&T.pointerType!=="mouse"){if(T.pointerType==="keyboard"&&!Mu(T.key))return;Z(T)}else T.pointerType!=="keyboard"&&h&&f(T)}):(V.onPressStart=T=>{$.current=T.pointerType,_.current=O,R.current=C,h&&(T.pointerType==="mouse"&&!C||T.pointerType==="keyboard"&&(!I||Lu(T.key)))&&f(T)},V.onPress=T=>{(T.pointerType==="touch"||T.pointerType==="pen"||T.pointerType==="virtual"||T.pointerType==="keyboard"&&L&&Mu(T.key)||T.pointerType==="mouse"&&R.current)&&(L?Z(T):h&&f(T))}),g["data-collection"]=UT(n.collection),g["data-key"]=o,V.preventFocusOnPress=i,i&&(V=dt(V,{onPressStart(T){T.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(o))},onPress(T){T.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(o))}})),H)for(let T of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])H[T]&&(V[T]=Ps(V[T],H[T]));let{pressProps:w,isPressed:F}=Du(V),B=D?T=>{$.current==="mouse"&&(T.stopPropagation(),T.preventDefault(),Z(T))}:void 0,{longPressProps:M}=aw({isDisabled:!O,onLongPress(T){T.pointerType==="touch"&&(f(T),n.setSelectionBehavior("toggle"))}}),q=T=>{$.current==="touch"&&_.current&&T.preventDefault()},N=u!=="none"&&n.isLink(o)?T=>{Bt.isOpening||T.preventDefault()}:void 0;return{itemProps:dt(g,h||C||i&&!c?w:{},O?M:{},{onDoubleClick:B,onDragStartCapture:q,onClick:N,id:t},i?{onMouseDown:T=>T.preventDefault()}:void 0),isPressed:F,isSelected:n.isSelected(o),isFocused:n.isFocused&&n.focusedKey===o,isDisabled:c,allowsSelection:h,hasAction:L}}function Mu(e){return e==="Enter"}function Lu(e){return e===" "}function iw(e,t,n){let{key:o,isDisabled:a,shouldSelectOnPressUp:s}=e,{selectionManager:i,selectedKey:l}=t,c=o===l,d=a||t.isDisabled||t.selectionManager.isDisabled(o),m=t.collection.getItem(o),{itemProps:u,isPressed:p}=sw({selectionManager:i,key:o,ref:n,isDisabled:d,shouldSelectOnPressUp:s??m?.props.href!=null,linkBehavior:"selection"}),f=pr(t,o,"tab"),g=pr(t,o,"tabpanel"),{tabIndex:v}=u,y=QE(m?.props,{labelable:!0});delete y.id;let b=OT(m?.props),{focusableProps:h}=WT({...m?.props,isDisabled:d},n);return{tabProps:dt(y,h,b,u,{id:f,"aria-selected":c,"aria-disabled":d||void 0,"aria-controls":c?g:void 0,tabIndex:d?void 0:v,role:"tab"}),isSelected:c,isDisabled:d,isPressed:p}}class lw{constructor(t,n,o,a){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{if(i.nodeType===Node.ELEMENT_NODE){const l=i.shadowRoot;if(l){const c=this._doc.createTreeWalker(l,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if(this.filter?.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=a??null,this.whatToShow=o??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,o,this._acceptNode));const s=n.shadowRoot;if(s){const i=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}get currentNode(){return this._currentNode}set currentNode(t){if(!ye(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let o=t,a=t;for(this._currentNode=t;o&&o!==this.root;)if(o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=o,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});n.push(l),l.currentNode=a,this._currentSetFor.add(l),o=a=i.host}else o=o.parentNode;const s=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=a,this._currentSetFor.add(s),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return ye(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(t):this.filter?.acceptNode&&(o=this.filter.acceptNode(t)),o===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let a=this.nextNode();return a&&(this.currentNode=a),a}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const n=t.previousNode();if(n){if(n.shadowRoot){let a;if(typeof this.filter=="function"?a=this.filter(n):this.filter?.acceptNode&&(a=this.filter.acceptNode(n)),a===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let s=this.lastChild();return s&&(this.currentNode=s),s}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function cw(e,t,n,o){return Sr()?new lw(e,t,n,o):e.createTreeWalker(t,n,o)}function dw(e){if(!e.form)return Array.from(Re(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(o=>!o.form);const t=e.form.elements.namedItem(e.name);let n=pt(e);return t instanceof n.RadioNodeList?Array.from(t).filter(o=>o instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function pw(e){if(e.checked)return!0;const t=dw(e);return t.length>0&&!t.some(n=>n.checked)}function _u(e,t){return!e||!t?!1:t.some(n=>ye(n,e))}function Pu(e,t,n){let o=t?.tabbable?eu:Qp,a=e?.nodeType===Node.ELEMENT_NODE?e:null,s=Re(a),i=cw(s,e||s,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return ye(t?.from,l)||t?.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!pw(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:o(l)&&(!n||_u(l,n))&&(!t?.accept||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}class Zs{constructor(){this.fastMap=new Map,this.root=new Ou({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,o){let a=this.fastMap.get(n??null);if(!a)return;let s=new Ou({scopeRef:t});a.addChild(s),s.parent=a,this.fastMap.set(t,s),o&&(s.nodeToRestore=o)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let o=n.parent;for(let s of this.traverse())s!==n&&n.nodeToRestore&&s.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&_u(s.nodeToRestore,n.scopeRef.current)&&(s.nodeToRestore=n.nodeToRestore);let a=n.children;o&&(o.removeChild(n),a.size>0&&a.forEach(s=>o&&o.addChild(s))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){let t=new Zs;for(let n of this.traverse())t.addTreeNode(n.scopeRef,n.parent?.scopeRef??null,n.nodeToRestore);return t}}class Ou{constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}}new Zs;function uw(e,t){let n=t?.isDisabled,[o,a]=E.useState(!1);return Gt(()=>{if(e?.current&&!n){let s=()=>{if(e.current){let l=Pu(e.current,{tabbable:!0});a(!!l.nextNode())}};s();let i=new MutationObserver(s);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),n?!1:o}function Bu(e,t){let{id:n,"aria-label":o,"aria-labelledby":a}=e;return n=mr(n),a&&o?a=[...new Set([n,...a.trim().split(/\s+/)])].join(" "):a&&(a=a.trim().split(/\s+/).join(" ")),!o&&!a&&t&&(o=t),{id:n,"aria-label":o,"aria-labelledby":a}}function mw(e,t,n){let o=uw(n)?void 0:0;const a=pr(t,e.id??t?.selectedKey,"tabpanel"),s=Bu({...e,id:a,"aria-labelledby":pr(t,t?.selectedKey,"tab")});return{tabPanelProps:dt(s,{tabIndex:o,role:"tabpanel","aria-describedby":e["aria-describedby"],"aria-details":e["aria-details"]})}}class fw{constructor(t,n,o,a=new Set){this.collection=t,this.flipDirection=n==="rtl"&&o==="horizontal",this.disabledKeys=a,this.tabDirection=o==="horizontal"}getKeyLeftOf(t){return this.flipDirection?this.getNextKey(t):this.getPreviousKey(t)}getKeyRightOf(t){return this.flipDirection?this.getPreviousKey(t):this.getNextKey(t)}isDisabled(t){return this.disabledKeys.has(t)||!!this.collection.getItem(t)?.props?.isDisabled}getFirstKey(){let t=this.collection.getFirstKey();return t!=null&&this.isDisabled(t)&&(t=this.getNextKey(t)),t}getLastKey(){let t=this.collection.getLastKey();return t!=null&&this.isDisabled(t)&&(t=this.getPreviousKey(t)),t}getKeyAbove(t){return this.tabDirection?null:this.getPreviousKey(t)}getKeyBelow(t){return this.tabDirection?null:this.getNextKey(t)}getNextKey(t){let n=t;do n=this.collection.getKeyAfter(n),n==null&&(n=this.collection.getFirstKey());while(n!=null&&this.isDisabled(n));return n}getPreviousKey(t){let n=t;do n=this.collection.getKeyBefore(n),n==null&&(n=this.collection.getLastKey());while(n!=null&&this.isDisabled(n));return n}}const Sw=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),gw=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function hw(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),o=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(o)return o.direction==="rtl";if(n.script)return Sw.has(n.script)}let t=e.split("-")[0];return gw.has(t)}const Ru=Symbol.for("react-aria.i18n.locale");function Fu(){let e=typeof window<"u"&&window[Ru]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:hw(e)?"rtl":"ltr"}}let Qs=Fu(),uo=new Set;function Au(){Qs=Fu();for(let e of uo)e(Qs)}function bw(){let e=Jp(),[t,n]=E.useState(Qs);return E.useEffect(()=>(uo.size===0&&window.addEventListener("languagechange",Au),uo.add(n),()=>{uo.delete(n),uo.size===0&&window.removeEventListener("languagechange",Au)}),[]),e?{locale:typeof window<"u"&&window[Ru]||"en-US",direction:"ltr"}:t}const vw=E.createContext(null);function $u(){let e=bw();return E.useContext(vw)||e}const yw="react-aria-clear-focus",Ew="react-aria-focus";function Tw(e,t){if(!e)return!1;let n=window.getComputedStyle(e),o=document.scrollingElement||document.documentElement,a=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===o&&n.overflow!=="hidden"&&(a=!0),a&&t&&(a=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),a}function Vu(e,t){let n=[],o=document.scrollingElement||document.documentElement;do Tw(e,t)&&n.push(e),e=e.parentElement;while(e&&e!==o);return n}function ei(e,t,n={}){let{block:o="nearest",inline:a="nearest"}=n;if(e===t)return;let s=e.scrollTop,i=e.scrollLeft,l=t.getBoundingClientRect(),c=e.getBoundingClientRect(),d=window.getComputedStyle(t),m=window.getComputedStyle(e),u=document.scrollingElement||document.documentElement,p=e===u?0:c.top,f=e===u?e.clientHeight:c.bottom,g=e===u?0:c.left,v=e===u?e.clientWidth:c.right,y=parseInt(d.scrollMarginTop,10)||0,b=parseInt(d.scrollMarginBottom,10)||0,h=parseInt(d.scrollMarginLeft,10)||0,I=parseInt(d.scrollMarginRight,10)||0,C=parseInt(m.scrollPaddingTop,10)||0,D=parseInt(m.scrollPaddingBottom,10)||0,L=parseInt(m.scrollPaddingLeft,10)||0,$=parseInt(m.scrollPaddingRight,10)||0,O=parseInt(m.borderTopWidth,10)||0,_=parseInt(m.borderBottomWidth,10)||0,R=parseInt(m.borderLeftWidth,10)||0,H=parseInt(m.borderRightWidth,10)||0,Z=l.top-y,V=l.bottom+b,w=l.left-h,F=l.right+I,B=e===u?0:R+H,M=e===u?0:O+_,q=e.offsetWidth-e.clientWidth-B,N=e.offsetHeight-e.clientHeight-M,T=p+O+C,k=f-_-D-N,U=g+R+L,J=v-H-$;m.direction==="rtl"&&!br()?U+=q:J-=q;let te=Z<T||V>k,ne=w<U||F>J;if(te&&o==="start")s+=Z-T;else if(te&&o==="center")s+=(Z+V)/2-(T+k)/2;else if(te&&o==="end")s+=V-k;else if(te&&o==="nearest"){let W=Z-T,X=V-k;s+=Math.abs(W)<=Math.abs(X)?W:X}if(ne&&a==="start")i+=w-U;else if(ne&&a==="center")i+=(w+F)/2-(U+J)/2;else if(ne&&a==="end")i+=F-J;else if(ne&&a==="nearest"){let W=w-U,X=F-J;i+=Math.abs(W)<=Math.abs(X)?W:X}if(process.env.NODE_ENV==="test"){e.scrollLeft=i,e.scrollTop=s;return}e.scrollTo({left:i,top:s})}function Ku(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let{left:s,top:i}=e.getBoundingClientRect(),l=Vu(e,!0);for(let m of l)ei(m,e);let{left:c,top:d}=e.getBoundingClientRect();if(Math.abs(s-c)>1||Math.abs(i-d)>1){l=n?Vu(n,!0):[];for(let m of l)ei(m,n,{block:"center",inline:"center"})}}else{let{left:s,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});let{left:l,top:c}=e.getBoundingClientRect();(Math.abs(s-l)>1||Math.abs(i-c)>1)&&(n?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}function Cr(e,t,n,o){let a=Tr(n),s=n==null;E.useEffect(()=>{if(s||!e.current)return;let i=e.current;return i.addEventListener(t,a,o),()=>{i.removeEventListener(t,a,o)}},[e,t,o,s])}const ww=1e3;function Cw(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:o}=e,a=E.useRef({search:"",timeout:void 0}).current,s=i=>{let l=Dw(i.key);if(!(!l||i.ctrlKey||i.metaKey||!ye(i.currentTarget,me(i))||a.search.length===0&&l===" ")){if(l===" "&&a.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),a.search+=l,t.getKeyForSearch!=null){let c=t.getKeyForSearch(a.search,n.focusedKey);c==null&&(c=t.getKeyForSearch(a.search)),c!=null&&(n.setFocusedKey(c),o&&o(c))}clearTimeout(a.timeout),a.timeout=setTimeout(()=>{a.search=""},ww)}};return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?s:void 0}}}function Dw(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Hu(e,t){const n=E.useRef(!0),o=E.useRef(null);Gt(()=>(n.current=!0,()=>{n.current=!1}),[]),Gt(()=>{n.current?n.current=!1:(!o.current||t.some((a,s)=>!Object.is(a,o[s])))&&e(),o.current=t},t)}function Nw(e){let{selectionManager:t,keyboardDelegate:n,ref:o,autoFocus:a=!1,shouldFocusWrap:s=!1,disallowEmptySelection:i=!1,disallowSelectAll:l=!1,escapeKeyBehavior:c="clearSelection",selectOnFocus:d=t.selectionBehavior==="replace",disallowTypeAhead:m=!1,shouldUseVirtualFocus:u,allowsTabNavigation:p=!1,scrollRef:f=o,linkBehavior:g="action"}=e,{direction:v}=$u(),y=$s(),b=w=>{if(w.altKey&&w.key==="Tab"&&w.preventDefault(),!o.current||!ye(o.current,me(w)))return;const F=(B,M)=>{if(B!=null){if(t.isLink(B)&&g==="selection"&&d&&!Gs(w)){Ln.flushSync(()=>{t.setFocusedKey(B,M)});let q=Us(o,B),N=t.getItemProps(B);q&&y.open(q,w,N.href,N.routerOptions);return}if(t.setFocusedKey(B,M),t.isLink(B)&&g==="override")return;w.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(B):d&&!Gs(w)&&t.replaceSelection(B)}};switch(w.key){case"ArrowDown":if(n.getKeyBelow){let B=t.focusedKey!=null?n.getKeyBelow?.(t.focusedKey):n.getFirstKey?.();B==null&&s&&(B=n.getFirstKey?.(t.focusedKey)),B!=null&&(w.preventDefault(),F(B))}break;case"ArrowUp":if(n.getKeyAbove){let B=t.focusedKey!=null?n.getKeyAbove?.(t.focusedKey):n.getLastKey?.();B==null&&s&&(B=n.getLastKey?.(t.focusedKey)),B!=null&&(w.preventDefault(),F(B))}break;case"ArrowLeft":if(n.getKeyLeftOf){let B=t.focusedKey!=null?n.getKeyLeftOf?.(t.focusedKey):n.getFirstKey?.();B==null&&s&&(B=v==="rtl"?n.getFirstKey?.(t.focusedKey):n.getLastKey?.(t.focusedKey)),B!=null&&(w.preventDefault(),F(B,v==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let B=t.focusedKey!=null?n.getKeyRightOf?.(t.focusedKey):n.getFirstKey?.();B==null&&s&&(B=v==="rtl"?n.getLastKey?.(t.focusedKey):n.getFirstKey?.(t.focusedKey)),B!=null&&(w.preventDefault(),F(B,v==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(t.focusedKey===null&&w.shiftKey)return;w.preventDefault();let B=n.getFirstKey(t.focusedKey,kn(w));t.setFocusedKey(B),B!=null&&(kn(w)&&w.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(B):d&&t.replaceSelection(B))}break;case"End":if(n.getLastKey){if(t.focusedKey===null&&w.shiftKey)return;w.preventDefault();let B=n.getLastKey(t.focusedKey,kn(w));t.setFocusedKey(B),B!=null&&(kn(w)&&w.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(B):d&&t.replaceSelection(B))}break;case"PageDown":if(n.getKeyPageBelow&&t.focusedKey!=null){let B=n.getKeyPageBelow(t.focusedKey);B!=null&&(w.preventDefault(),F(B))}break;case"PageUp":if(n.getKeyPageAbove&&t.focusedKey!=null){let B=n.getKeyPageAbove(t.focusedKey);B!=null&&(w.preventDefault(),F(B))}break;case"a":kn(w)&&t.selectionMode==="multiple"&&l!==!0&&(w.preventDefault(),t.selectAll());break;case"Escape":c==="clearSelection"&&!i&&t.selectedKeys.size!==0&&(w.stopPropagation(),w.preventDefault(),t.clearSelection());break;case"Tab":if(!p){if(w.shiftKey)o.current.focus();else{let B=Pu(o.current,{tabbable:!0}),M,q;do q=B.lastChild(),q&&(M=q);while(q);let N=It();M&&(!Zp(M)||N&&!eu(N))&&Pt(M)}break}}},h=E.useRef({top:0,left:0});Cr(f,"scroll",()=>{h.current={top:f.current?.scrollTop??0,left:f.current?.scrollLeft??0}});let I=w=>{if(t.isFocused){ye(w.currentTarget,me(w))||t.setFocused(!1);return}if(ye(w.currentTarget,me(w))){if(t.setFocused(!0),t.focusedKey==null){let F=M=>{M!=null&&(t.setFocusedKey(M),d&&!t.isSelected(M)&&t.replaceSelection(M))},B=w.relatedTarget;B&&w.currentTarget.compareDocumentPosition(B)&Node.DOCUMENT_POSITION_FOLLOWING?F(t.lastSelectedKey??n.getLastKey?.()):F(t.firstSelectedKey??n.getFirstKey?.())}else f.current&&(f.current.scrollTop=h.current.top,f.current.scrollLeft=h.current.left);if(t.focusedKey!=null&&f.current){let F=Us(o,t.focusedKey);F instanceof HTMLElement&&(!Zp(F)&&!u&&Pt(F),Hs()==="keyboard"&&Ku(F,{containingElement:o.current}))}}},C=w=>{ye(w.currentTarget,w.relatedTarget)||t.setFocused(!1)},D=E.useRef(!1);Cr(o,Ew,u?w=>{let{detail:F}=w;w.stopPropagation(),t.setFocused(!0),F?.focusStrategy==="first"&&(D.current=!0)}:void 0),Hu(()=>{if(D.current){let w=n.getFirstKey?.()??null;if(w==null){let F=It();gu(o.current),hu(F,null),t.collection.size>0&&(D.current=!1)}else t.setFocusedKey(w),D.current=!1}},[t.collection]),Hu(()=>{t.collection.size>0&&(D.current=!1)},[t.focusedKey]),Cr(o,yw,u?w=>{w.stopPropagation(),t.setFocused(!1),w.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);const L=E.useRef(a),$=E.useRef(!1);E.useEffect(()=>{if(L.current){let w=null;a==="first"&&(w=n.getFirstKey?.()??null),a==="last"&&(w=n.getLastKey?.()??null);let F=t.selectedKeys;if(F.size){for(let B of F)if(t.canSelectItem(B)){w=B;break}}t.setFocused(!0),t.setFocusedKey(w),w==null&&!u&&o.current&&yr(o.current),t.collection.size>0&&(L.current=!1,$.current=!0)}});let O=E.useRef(t.focusedKey),_=E.useRef(null);E.useEffect(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==O.current||$.current)&&f.current&&o.current){let w=Hs(),F=Us(o,t.focusedKey);if(!(F instanceof HTMLElement))return;(w==="keyboard"||$.current)&&(_.current&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{f.current&&(ei(f.current,F),w!=="virtual"&&Ku(F,{containingElement:o.current}))}))}!u&&t.isFocused&&t.focusedKey==null&&O.current!=null&&o.current&&yr(o.current),O.current=t.focusedKey,$.current=!1}),E.useEffect(()=>()=>{_.current&&cancelAnimationFrame(_.current)},[]),Cr(o,"react-aria-focus-scope-restore",w=>{w.preventDefault(),t.setFocused(!0)});let R={onKeyDown:b,onFocus:I,onBlur:C,onMouseDown(w){f.current===me(w)&&w.preventDefault()}},{typeSelectProps:H}=Cw({keyboardDelegate:n,selectionManager:t});m||(R=dt(H,R));let Z;u||(Z=t.focusedKey==null?0:-1);let V=GT(t.collection);return{collectionProps:dt(R,{tabIndex:Z,"data-collection":V})}}function Iw(e,t,n){let{orientation:o="horizontal",keyboardActivation:a="automatic"}=e,{collection:s,selectionManager:i,disabledKeys:l}=t,{direction:c}=$u(),d=E.useMemo(()=>new fw(s,c,o,l),[s,l,o,c]),{collectionProps:m}=Nw({ref:n,selectionManager:i,keyboardDelegate:d,selectOnFocus:a==="automatic",disallowEmptySelection:!0,scrollRef:n,linkBehavior:"selection"}),u=mr();Yp.set(t,u);let p=Bu({...e,id:u});return{tabListProps:{...dt(m,p),role:"tablist","aria-orientation":o,tabIndex:void 0}}}function Wu({item:e,state:t}){const{key:n}=e,o=r.useRef(null),{tabProps:a}=iw({key:n},t,o),s=t.selectedKey===n,i=t.disabledKeys.has(n);return r.createElement("div",{...a,ref:o,className:K("sps-nav__item","sps-nav__link",s&&"active",i&&"sps-nav__item--disabled")},e.rendered)}function Gu({state:e,...t}){const n=r.useRef(null),{tabPanelProps:o}=mw(t,e,n);return r.createElement("div",{...o,ref:n,className:"sps-card__body"},e.selectedItem?e.selectedItem.props.children:null)}class Uu{constructor(t){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t;let n=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let l of i.childNodes)n(l)};for(let i of t)n(i);let o=null,a=0,s=0;for(let[i,l]of this.keyMap)o?(o.nextKey=i,l.prevKey=o.key):(this.firstKey=i,l.prevKey=void 0),l.type==="item"&&(l.index=a++),(l.type==="section"||l.type==="item")&&s++,o=l,o.nextKey=void 0;this._size=s,this.lastKey=o?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let n=this.keyMap.get(t);return n?n.prevKey??null:null}getKeyAfter(t){let n=this.keyMap.get(t);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}getChildren(t){return this.keyMap.get(t)?.childNodes||[]}}class vt extends Set{constructor(t,n,o){super(t),t instanceof vt?(this.anchorKey=n??t.anchorKey,this.currentKey=o??t.currentKey):(this.anchorKey=n??null,this.currentKey=o??null)}}const xw=typeof document<"u"?E.useInsertionEffect??E.useLayoutEffect:()=>{};function zu(e,t,n){let[o,a]=E.useState(e||t),s=E.useRef(o),i=E.useRef(e!==void 0),l=e!==void 0;E.useEffect(()=>{let u=i.current;u!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${u?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),i.current=l},[l]);let c=l?e:o;xw(()=>{s.current=c});let[,d]=E.useReducer(()=>({}),{}),m=E.useCallback((u,...p)=>{let f=typeof u=="function"?u(s.current):u;Object.is(s.current,f)||(s.current=f,a(f),d(),n?.(f,...p))},[n]);return[c,m]}function kw(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Mw(e){let{selectionMode:t="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:o,selectionBehavior:a="toggle",disabledBehavior:s="all"}=e,i=E.useRef(!1),[,l]=E.useState(!1),c=E.useRef(null),d=E.useRef(null),[,m]=E.useState(null),u=E.useMemo(()=>ju(e.selectedKeys),[e.selectedKeys]),p=E.useMemo(()=>ju(e.defaultSelectedKeys,new vt),[e.defaultSelectedKeys]),[f,g]=zu(u,p,e.onSelectionChange),v=E.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[y,b]=E.useState(a);a==="replace"&&y==="toggle"&&typeof f=="object"&&f.size===0&&b("replace");let h=E.useRef(a);return E.useEffect(()=>{a!==h.current&&(b(a),h.current=a)},[a]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:y,setSelectionBehavior:b,get isFocused(){return i.current},setFocused(I){i.current=I,l(I)},get focusedKey(){return c.current},get childFocusStrategy(){return d.current},setFocusedKey(I,C="first"){c.current=I,d.current=C,m(I)},selectedKeys:f,setSelectedKeys(I){(o||!kw(I,f))&&g(I)},disabledKeys:v,disabledBehavior:s}}function ju(e,t){return e?e==="all"?"all":new vt(e):t}function Lw(e,t){return typeof t.getChildren=="function"?t.getChildren(e.key):e.childNodes}function _w(e){return Pw(e)}function Pw(e,t){for(let n of e)return n}function ti(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let o=[...Yu(e,t),t],a=[...Yu(e,n),n],s=o.slice(0,a.length).findIndex((i,l)=>i!==a[l]);return s!==-1?(t=o[s],n=a[s],t.index-n.index):o.findIndex(i=>i===n)>=0?1:(a.findIndex(i=>i===t)>=0,-1)}function Yu(e,t){let n=[],o=t;for(;o?.parentKey!=null;)o=e.getItem(o.parentKey),o&&n.unshift(o);return n}class ni{constructor(t,n,o){this.collection=t,this.state=n,this.allowsCellSelection=o?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=o?.layoutDelegate||null,this.fullCollection=o?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}get isFocused(){return this.state.isFocused}setFocused(t){this.state.setFocused(t)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(t,n){(t==null||this.collection.getItem(t))&&this.state.setFocusedKey(t,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(t){if(this.state.selectionMode==="none")return!1;let n=this.getKey(t);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let t=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=t.every(o=>n.has(o)),this._isSelectAll}get firstSelectedKey(){let t=null;for(let n of this.state.selectedKeys){let o=this.collection.getItem(n);(!t||o&&ti(this.collection,o,t)<0)&&(t=o)}return t?.key??null}get lastSelectedKey(){let t=null;for(let n of this.state.selectedKeys){let o=this.collection.getItem(n);(!t||o&&ti(this.collection,o,t)>0)&&(t=o)}return t?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let o;if(this.state.selectedKeys==="all")o=new vt([n],n,n);else{let a=this.state.selectedKeys,s=a.anchorKey??n;o=new vt(a,s,n);for(let i of this.getKeyRange(s,a.currentKey??n))o.delete(i);for(let i of this.getKeyRange(n,s))this.canSelectItem(i)&&o.add(i)}this.state.setSelectedKeys(o)}getKeyRange(t,n){let o=this.collection.getItem(t),a=this.collection.getItem(n);return o&&a?ti(this.collection,o,a)<=0?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(t,n);let o=[],a=t;for(;a!=null;){let s=this.collection.getItem(a);if(s&&(s.type==="item"||s.type==="cell"&&this.allowsCellSelection)&&o.push(a),a===n)return o;a=this.collection.getKeyAfter(a)}return[]}getKey(t){let n=this.collection.getItem(t);if(!n||n.type==="cell"&&this.allowsCellSelection)return t;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let o=new vt(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);o.has(n)?o.delete(n):this.canSelectItem(n)&&(o.add(n),o.anchorKey=n,o.currentKey=n),!(this.disallowEmptySelection&&o.size===0)&&this.state.setSelectedKeys(o)}replaceSelection(t){if(this.selectionMode==="none")return;let n=this.getKey(t);if(n==null)return;let o=this.canSelectItem(n)?new vt([n],n,n):new vt;this.state.setSelectedKeys(o)}setSelectedKeys(t){if(this.selectionMode==="none")return;let n=new vt;for(let o of t){let a=this.getKey(o);if(a!=null&&(n.add(a),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let t=this.fullCollection??this.collection,n=[],o=a=>{for(;a!=null;){if(this.canSelectItemIn(a,t)){let s=t.getItem(a);s?.type==="item"&&n.push(a),s?.hasChildNodes&&(this.allowsCellSelection||s.type!=="item")&&o(_w(Lw(s,t))?.key??null)}a=t.getKeyAfter(a)}};return o(t.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new vt)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(t)&&!this.disallowEmptySelection?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(t.size!==n.size)return!1;for(let o of t)if(!n.has(o))return!1;for(let o of n)if(!t.has(o))return!1;return!0}canSelectItem(t){return this.canSelectItemIn(t,this.collection)}canSelectItemIn(t,n){if(this.state.selectionMode==="none"||this.state.disabledKeys.has(t))return!1;let o=n.getItem(t);return!(!o||o?.props?.isDisabled||o.type==="cell"&&!this.allowsCellSelection)}isDisabled(t){return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(t)||!!this.collection.getItem(t)?.props?.isDisabled)}isLink(t){return!!this.collection.getItem(t)?.props?.href}getItemProps(t){return this.collection.getItem(t)?.props}withCollection(t){return new ni(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class Ow{build(t,n){return this.context=n,qu(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:n,items:o}=t;if(E.isValidElement(n)&&n.type===E.Fragment)yield*this.iterateCollection({children:n.props.children,items:o});else if(typeof n=="function"){if(!o)throw new Error("props.children was a function but props.items is missing");let a=0;for(let s of o)yield*this.getFullNode({value:s,index:a},{renderer:n}),a++}else{let a=[];E.Children.forEach(n,i=>{i&&a.push(i)});let s=0;for(let i of a){let l=this.getFullNode({element:i,index:s},{});for(let c of l)s++,yield c}}}getKey(t,n,o,a){if(t.key!=null)return t.key;if(n.type==="cell"&&n.key!=null)return`${a}${n.key}`;let s=n.value;if(s!=null){let i=s.key??s.id;if(i==null)throw new Error("No key found for item");return i}return a?`${a}.${n.index}`:`$.${n.index}`}getChildState(t,n){return{renderer:n.renderer||t.renderer}}*getFullNode(t,n,o,a){if(E.isValidElement(t.element)&&t.element.type===E.Fragment){let c=[];E.Children.forEach(t.element.props.children,m=>{c.push(m)});let d=t.index??0;for(const m of c)yield*this.getFullNode({element:m,index:d++},n,o,a);return}let s=t.element;if(!s&&t.value&&n&&n.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=a?a.key:null,yield c;return}s=n.renderer(t.value)}if(E.isValidElement(s)){let c=s.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let p=s.type;throw new Error(`Unknown element <${p}> in collection.`)}let d=c.getCollectionNode(s.props,this.context),m=t.index??0,u=d.next();for(;!u.done&&u.value;){let p=u.value;t.index=m;let f=p.key??null;f==null&&(f=p.element?null:this.getKey(s,t,n,o));let v=[...this.getFullNode({...p,key:f,index:m,wrapper:Bw(t.wrapper,p.wrapper)},this.getChildState(n,p),o?`${o}${s.key}`:s.key,a)];for(let y of v){if(y.value=p.value??t.value??null,y.value&&this.cache.set(y.value,y),t.type&&y.type!==t.type)throw new Error(`Unsupported type <${oi(y.type)}> in <${oi(a?.type??"unknown parent type")}>. Only <${oi(t.type)}> is supported.`);m++,yield y}u=d.next(v)}return}if(t.key==null||t.type==null)return;let i=this,l={type:t.type,props:t.props,key:t.key,parentKey:a?a.key:null,value:t.value??null,level:(a?.level??0)+(a?.type==="item"?1:0),index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:qu(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let d of t.childNodes()){d.key!=null&&(d.key=`${l.key}${d.key}`);let m=i.getFullNode({...d,index:c},i.getChildState(n,d),l.key,l);for(let u of m)c++,yield u}})};yield l}constructor(){this.cache=new WeakMap}}function qu(e){let t=[],n=null;return{*[Symbol.iterator](){for(let o of t)yield o;n||(n=e());for(let o of n)t.push(o),yield o}}}function Bw(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function oi(e){return e[0].toUpperCase()+e.slice(1)}function Rw(e,t,n){let o=E.useMemo(()=>new Ow,[]),{children:a,items:s,collection:i}=e;return E.useMemo(()=>{if(i)return i;let c=o.build({children:a,items:s},n);return t(c)},[o,a,s,i,n,t])}function Fw(e){let{filter:t,layoutDelegate:n}=e,o=Mw(e),a=E.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),s=E.useCallback(d=>t?new Uu(t(d)):new Uu(d),[t]),i=E.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),l=Rw(e,s,i),c=E.useMemo(()=>new ni(l,o,{layoutDelegate:n}),[l,o,n]);return Aw(l,c),{collection:l,disabledKeys:a,selectionManager:c}}function Aw(e,t){const n=E.useRef(null);E.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){let o=n.current.getKeyAfter(t.focusedKey),a=null;for(;o!=null;){let s=e.getItem(o);if(s&&s.type==="item"&&!t.isDisabled(o)){a=o;break}o=n.current.getKeyAfter(o)}if(a==null)for(o=n.current.getKeyBefore(t.focusedKey);o!=null;){let s=e.getItem(o);if(s&&s.type==="item"&&!t.isDisabled(o)){a=o;break}o=n.current.getKeyBefore(o)}t.setFocusedKey(a)}n.current=e},[e,t])}function $w(e){let[t,n]=zu(e.selectedKey,e.defaultSelectedKey??null,e.onSelectionChange),o=E.useMemo(()=>t!=null?[t]:[],[t]),{collection:a,disabledKeys:s,selectionManager:i}=Fw({...e,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:o,onSelectionChange:c=>{if(c==="all")return;let d=c.values().next().value??null;d===t&&e.onSelectionChange&&e.onSelectionChange(d),n(d)}}),l=t!=null?a.getItem(t):null;return{collection:a,disabledKeys:s,selectionManager:i,selectedKey:t,setSelectedKey:n,selectedItem:l}}function Vw(e){let t=$w({...e,onSelectionChange:e.onSelectionChange?i=>{i!=null&&e.onSelectionChange?.(i)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:e.defaultSelectedKey??Ju(e.collection,e.disabledKeys?new Set(e.disabledKeys):new Set)??void 0}),{selectionManager:n,collection:o,selectedKey:a}=t,s=E.useRef(a);return E.useEffect(()=>{let i=a;e.selectedKey==null&&(n.isEmpty||i==null||!o.getItem(i))&&(i=Ju(o,t.disabledKeys),i!=null&&n.setSelectedKeys([i])),(i!=null&&n.focusedKey==null||!n.isFocused&&i!==s.current)&&n.setFocusedKey(i),s.current=i}),{...t,isDisabled:e.isDisabled||!1}}function Ju(e,t){let n=null;if(e){for(n=e.getFirstKey();n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n!==e.getLastKey();)n=e.getKeyAfter(n);n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n===e.getLastKey()&&(n=e.getFirstKey())}return n}const Kw={},Hw={};function ri(e){const{selectedKey:t,defaultSelectedKey:n,...o}=e,a={...o,selectedKey:t??void 0,defaultSelectedKey:n??void 0},s=Vw(a),i=r.useRef(null),{tabListProps:l}=Iw(a,s,i);return r.createElement(r.Fragment,null,r.createElement("div",{...l,ref:i,className:"sps-nav sps-nav--tabs sps-tabs-v2"},[...s.collection].map(c=>r.createElement(Wu,{key:c.key,item:c,state:s}))),r.createElement(Gu,{key:s.selectedItem?s.selectedItem.key:null,state:s}))}Object.assign(ri,{props:Kw,propTypes:Hw,displayName:"SpsTabsV2"});const Ww={};function ai({children:e,className:t,...n}){return r.createElement("div",{className:K("sps-card__footer",t),...n},e)}Object.assign(ai,{props:Ww,displayName:"SpsCardV2Footer"});const Gw={};function si({children:e,className:t,...n}){return r.createElement("div",{className:K("sps-card__header",t),...n},e)}Object.assign(si,{props:Gw,displayName:"SpsCardV2Header"});const Uw={};function Xu({children:e,className:t,...n}){const[o,a,s,i,l]=at(e,[{type:si},{type:ri},{type:xm.Tabs},{type:ai}]),c=a.length>0?a:s;return r.createElement("div",{className:K("sps-card",t),...n},o,c.length>0?c:r.createElement("div",{className:"sps-card__body"},l),i)}Object.assign(Xu,{props:Uw,displayName:"SpsCardV2"});const zw={};function Zu({children:e,className:t,...n}){return r.createElement("div",{className:K("sps-card__title",t),...n},e)}Object.assign(Zu,{props:zw,displayName:"SpsCardV2Title"});const jw={...md,controlsDisabled:"boolean",footerLinks:"ReactNodeOrRenderFn",formMeta:"SpsFormSetMeta<any>",isOpen:"boolean",onClear:"() => void",onSubmit:"React.FormEventHandler"};function Qu(e){const{children:t,className:n,controlsDisabled:o,footerLinks:a,formArray:s,formGroup:i,formMeta:l,isOpen:c,onClear:d,onSubmit:m,unsafelyReplaceClassName:u,...p}=e,{t:f}=he.useWoodlandLanguage();function g(){d&&d()}const v=K(u||"sps-advanced-search",c&&"sps-advanced-search--open",n);return r.createElement("div",{className:v,...p},r.createElement(ro,{onSubmit:m,formArray:s,formGroup:i,formMeta:l},r.createElement("div",{className:"sps-advanced-search__form"},t),r.createElement("div",{className:"sps-advanced-search__footer"},a&&r.createElement("div",{id:"footer_links"},qe(a)),r.createElement("div",{className:"sps-advanced-search__footer-controls"},r.createElement(Ne,{kind:A.ButtonKind.DEFAULT,type:A.ButtonType.BUTTON,className:"mr-2",onClick:g,disabled:o},f("advancedSearch.clear")),r.createElement(Ne,{kind:A.ButtonKind.KEY,type:A.ButtonType.SUBMIT,disabled:o},f("advancedSearch.search"))))))}Object.assign(Qu,{props:jw,displayName:"SpsAdvancedSearch"});const Yw={general:{label:"General Usage",description:({NavigateTo:e,Link:t})=>r.createElement(r.Fragment,null,r.createElement("p",null,'Advanced Search is comprised of a panel of input fields, and a text button that exposes and hides the panel. By default, the Advanced Search panel is hidden (with the exception of "Advanced Search Only" scenarios).'),r.createElement("p",null,"Advanced Search works in conjunction with the"," ",r.createElement(e,{to:"list-toolbar"},"List Bar")," and"," ",r.createElement(e,{to:"search-results-bar"},"Search Results")," components. Refer to those pages for additional details."),r.createElement("p",null,"Use the following guidelines when including Advanced Search on your page:",r.createElement("ul",null,r.createElement("li",null,"The Advanced Search Panel can contain any number of input fields."),r.createElement("li",null,"The Advanced Search Panel can place input fields in any unique layout to best serve the needs of the search criteria, but must adhere to the rules of the"," ",r.createElement(t,{to:"/style-and-layout/grid/"},"SPS Grid")," and guidelines for"," ",r.createElement(e,{to:"form"},"Form Layouts"),"."))))},basic:{label:"Basic Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("p",null,"A Basic Advanced Search consists of the List Bar with a search input and an Advanced Search text button. For more details on additional button and component options in the List Bar reference the ",r.createElement(e,{to:"list-toolbar"},"List Bar")," page.")),examples:{basic:{react:S.code`
|
|
9835
|
+
`.trim(),w.head.prepend(F)},[p]),E.useEffect(()=>{let w=y.current;return()=>{m||qs(w.target??void 0);for(let F of w.disposables)F();w.disposables=[]}},[m]),{isPressed:c||g,pressProps:dt(f,V,{[Nu]:!0})}}function Xs(e){return e.tagName==="A"&&e.hasAttribute("href")}function Zs(e,t){const{key:n,code:o}=e,a=t,s=a.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||o==="Space")&&!(a instanceof pt(a).HTMLInputElement&&!Lu(a,n)||a instanceof pt(a).HTMLTextAreaElement||a.isContentEditable)&&!((s==="link"||!s&&Xs(a))&&n!=="Enter")}function QT(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function xu(e,t){const n=e.changedTouches;for(let o=0;o<n.length;o++){const a=n[o];if(a.identifier===t)return a}return null}function zt(e,t){let n=0,o=0;return t.targetTouches&&t.targetTouches.length===1&&(n=t.targetTouches[0].clientX,o=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:o}}function dn(e,t){let n=t.clientX,o=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:o,key:t.key}}function ew(e){let t=0,n=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?n=e.height/2:e.radiusY!==void 0&&(n=e.radiusY),{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function tw(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function ku(e,t){let n=t.getBoundingClientRect(),o=ew(e);return tw(n,o)}function nw(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Xs(e)}function Mu(e,t){return e instanceof HTMLInputElement?!Lu(e,t):nw(e)}const ow=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Lu(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":ow.has(e.type)}let rw=0;const Qs=new Map;function aw(e){let[t,n]=E.useState();return Gt(()=>{if(!e)return;let o=Qs.get(e);if(o)n(o.element.id);else{let a=`react-aria-description-${rw++}`;n(a);let s=document.createElement("div");s.id=a,s.style.display="none",s.textContent=e,document.body.appendChild(s),o={refCount:0,element:s},Qs.set(e,o)}return o.refCount++,()=>{o&&--o.refCount===0&&(o.element.remove(),Qs.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}const sw=500;function iw(e){let{isDisabled:t,onLongPressStart:n,onLongPressEnd:o,onLongPress:a,threshold:s=sw,accessibilityDescription:i}=e;const l=E.useRef(void 0);let{addGlobalListener:c,removeGlobalListener:d}=wu(),{pressProps:u}=Iu({isDisabled:t,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(n&&n({...p,type:"longpressstart"}),l.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Re(p.target).activeElement!==p.target&&Pt(p.target),a&&a({...p,type:"longpress"}),l.current=void 0},s),p.pointerType==="touch")){let f=v=>{v.preventDefault()},g=pt(p.target);c(p.target,"contextmenu",f,{once:!0}),c(g,"pointerup",()=>{setTimeout(()=>{d(p.target,"contextmenu",f)},30)},{once:!0})}},onPressEnd(p){l.current&&clearTimeout(l.current),o&&(p.pointerType==="mouse"||p.pointerType==="touch")&&o({...p,type:"longpressend"})}}),m=aw(a&&!t?i:void 0);return{longPressProps:dt(u,m)}}function lw(e){let{id:t,selectionManager:n,key:o,ref:a,shouldSelectOnPressUp:s,shouldUseVirtualFocus:i,focus:l,isDisabled:c,onAction:d,allowsDifferentPressOrigin:u,linkBehavior:m="action"}=e,p=Ks();t=gr(t);let f=T=>{if(T.pointerType==="keyboard"&&zs(T))n.toggleSelection(o);else{if(n.selectionMode==="none")return;if(n.isLink(o)){if(m==="selection"&&a.current){let k=n.getItemProps(o);p.open(a.current,T,k.href,k.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(m==="override"||m==="none")return}n.selectionMode==="single"?n.isSelected(o)&&!n.disallowEmptySelection?n.toggleSelection(o):n.replaceSelection(o):T&&T.shiftKey?n.extendSelection(o):n.selectionBehavior==="toggle"||T&&(kn(T)||T.pointerType==="touch"||T.pointerType==="virtual")?n.toggleSelection(o):n.replaceSelection(o)}};E.useEffect(()=>{o===n.focusedKey&&n.isFocused&&(i?bu(a.current):l?l():It()!==a.current&&a.current&&wr(a.current))},[a,o,n.focusedKey,n.childFocusStrategy,n.isFocused,i]),c=c||n.isDisabled(o);let g={};!i&&!c?g={tabIndex:o===n.focusedKey?0:-1,onFocus(T){me(T)===a.current&&n.setFocusedKey(o)}}:c&&(g.onMouseDown=T=>{T.preventDefault()}),E.useEffect(()=>{c&&n.focusedKey===o&&n.setFocusedKey(null)},[n,c,o]);let v=n.isLink(o)&&m==="override",y=d&&e.UNSTABLE_itemBehavior==="action",b=n.isLink(o)&&m!=="selection"&&m!=="none",h=!c&&n.canSelectItem(o)&&!v&&!y,I=(d||b)&&!c,C=I&&(n.selectionBehavior==="replace"?!h:!h||n.isEmpty),D=I&&h&&n.selectionBehavior==="replace",L=C||D,$=E.useRef(null),O=L&&h,_=E.useRef(!1),R=E.useRef(!1),H=n.getItemProps(o),Z=T=>{d&&(d(),a.current?.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),b&&a.current&&p.open(a.current,T,H.href,H.routerOptions)},V={ref:a};if(s?(V.onPressStart=T=>{$.current=T.pointerType,_.current=O,T.pointerType==="keyboard"&&(!L||Pu(T.key))&&f(T)},u?(V.onPressUp=C?void 0:T=>{T.pointerType==="mouse"&&h&&f(T)},V.onPress=C?Z:T=>{T.pointerType!=="keyboard"&&T.pointerType!=="mouse"&&h&&f(T)}):V.onPress=T=>{if(C||D&&T.pointerType!=="mouse"){if(T.pointerType==="keyboard"&&!_u(T.key))return;Z(T)}else T.pointerType!=="keyboard"&&h&&f(T)}):(V.onPressStart=T=>{$.current=T.pointerType,_.current=O,R.current=C,h&&(T.pointerType==="mouse"&&!C||T.pointerType==="keyboard"&&(!I||Pu(T.key)))&&f(T)},V.onPress=T=>{(T.pointerType==="touch"||T.pointerType==="pen"||T.pointerType==="virtual"||T.pointerType==="keyboard"&&L&&_u(T.key)||T.pointerType==="mouse"&&R.current)&&(L?Z(T):h&&f(T))}),g["data-collection"]=jT(n.collection),g["data-key"]=o,V.preventFocusOnPress=i,i&&(V=dt(V,{onPressStart(T){T.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(o))},onPress(T){T.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(o))}})),H)for(let T of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])H[T]&&(V[T]=Bs(V[T],H[T]));let{pressProps:w,isPressed:F}=Iu(V),B=D?T=>{$.current==="mouse"&&(T.stopPropagation(),T.preventDefault(),Z(T))}:void 0,{longPressProps:M}=iw({isDisabled:!O,onLongPress(T){T.pointerType==="touch"&&(f(T),n.setSelectionBehavior("toggle"))}}),q=T=>{$.current==="touch"&&_.current&&T.preventDefault()},N=m!=="none"&&n.isLink(o)?T=>{Bt.isOpening||T.preventDefault()}:void 0;return{itemProps:dt(g,h||C||i&&!c?w:{},O?M:{},{onDoubleClick:B,onDragStartCapture:q,onClick:N,id:t},i?{onMouseDown:T=>T.preventDefault()}:void 0),isPressed:F,isSelected:n.isSelected(o),isFocused:n.isFocused&&n.focusedKey===o,isDisabled:c,allowsSelection:h,hasAction:L}}function _u(e){return e==="Enter"}function Pu(e){return e===" "}function cw(e,t,n){let{key:o,isDisabled:a,shouldSelectOnPressUp:s}=e,{selectionManager:i,selectedKey:l}=t,c=o===l,d=a||t.isDisabled||t.selectionManager.isDisabled(o),u=t.collection.getItem(o),{itemProps:m,isPressed:p}=lw({selectionManager:i,key:o,ref:n,isDisabled:d,shouldSelectOnPressUp:s??u?.props.href!=null,linkBehavior:"selection"}),f=fr(t,o,"tab"),g=fr(t,o,"tabpanel"),{tabIndex:v}=m,y=tT(u?.props,{labelable:!0});delete y.id;let b=RT(u?.props),{focusableProps:h}=UT({...u?.props,isDisabled:d},n);return{tabProps:dt(y,h,b,m,{id:f,"aria-selected":c,"aria-disabled":d||void 0,"aria-controls":c?g:void 0,tabIndex:d?void 0:v,role:"tab"}),isSelected:c,isDisabled:d,isPressed:p}}class dw{constructor(t,n,o,a){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{if(i.nodeType===Node.ELEMENT_NODE){const l=i.shadowRoot;if(l){const c=this._doc.createTreeWalker(l,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if(this.filter?.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=a??null,this.whatToShow=o??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,o,this._acceptNode));const s=n.shadowRoot;if(s){const i=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}get currentNode(){return this._currentNode}set currentNode(t){if(!ye(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let o=t,a=t;for(this._currentNode=t;o&&o!==this.root;)if(o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=o,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});n.push(l),l.currentNode=a,this._currentSetFor.add(l),o=a=i.host}else o=o.parentNode;const s=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=a,this._currentSetFor.add(s),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return ye(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(t):this.filter?.acceptNode&&(o=this.filter.acceptNode(t)),o===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let a=this.nextNode();return a&&(this.currentNode=a),a}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const n=t.previousNode();if(n){if(n.shadowRoot){let a;if(typeof this.filter=="function"?a=this.filter(n):this.filter?.acceptNode&&(a=this.filter.acceptNode(n)),a===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let s=this.lastChild();return s&&(this.currentNode=s),s}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function pw(e,t,n,o){return br()?new dw(e,t,n,o):e.createTreeWalker(t,n,o)}function uw(e){if(!e.form)return Array.from(Re(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(o=>!o.form);const t=e.form.elements.namedItem(e.name);let n=pt(e);return t instanceof n.RadioNodeList?Array.from(t).filter(o=>o instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function mw(e){if(e.checked)return!0;const t=uw(e);return t.length>0&&!t.some(n=>n.checked)}function Ou(e,t){return!e||!t?!1:t.some(n=>ye(n,e))}function Bu(e,t,n){let o=t?.tabbable?nu:tu,a=e?.nodeType===Node.ELEMENT_NODE?e:null,s=Re(a),i=pw(s,e||s,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return ye(t?.from,l)||t?.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!mw(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:o(l)&&(!n||Ou(l,n))&&(!t?.accept||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}class ei{constructor(){this.fastMap=new Map,this.root=new Ru({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,o){let a=this.fastMap.get(n??null);if(!a)return;let s=new Ru({scopeRef:t});a.addChild(s),s.parent=a,this.fastMap.set(t,s),o&&(s.nodeToRestore=o)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let o=n.parent;for(let s of this.traverse())s!==n&&n.nodeToRestore&&s.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&Ou(s.nodeToRestore,n.scopeRef.current)&&(s.nodeToRestore=n.nodeToRestore);let a=n.children;o&&(o.removeChild(n),a.size>0&&a.forEach(s=>o&&o.addChild(s))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){let t=new ei;for(let n of this.traverse())t.addTreeNode(n.scopeRef,n.parent?.scopeRef??null,n.nodeToRestore);return t}}class Ru{constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}}new ei;function fw(e,t){let n=t?.isDisabled,[o,a]=E.useState(!1);return Gt(()=>{if(e?.current&&!n){let s=()=>{if(e.current){let l=Bu(e.current,{tabbable:!0});a(!!l.nextNode())}};s();let i=new MutationObserver(s);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),n?!1:o}function Fu(e,t){let{id:n,"aria-label":o,"aria-labelledby":a}=e;return n=gr(n),a&&o?a=[...new Set([n,...a.trim().split(/\s+/)])].join(" "):a&&(a=a.trim().split(/\s+/).join(" ")),!o&&!a&&t&&(o=t),{id:n,"aria-label":o,"aria-labelledby":a}}function Sw(e,t,n){let o=fw(n)?void 0:0;const a=fr(t,e.id??t?.selectedKey,"tabpanel"),s=Fu({...e,id:a,"aria-labelledby":fr(t,t?.selectedKey,"tab")});return{tabPanelProps:dt(s,{tabIndex:o,role:"tabpanel","aria-describedby":e["aria-describedby"],"aria-details":e["aria-details"]})}}class gw{constructor(t,n,o,a=new Set){this.collection=t,this.flipDirection=n==="rtl"&&o==="horizontal",this.disabledKeys=a,this.tabDirection=o==="horizontal"}getKeyLeftOf(t){return this.flipDirection?this.getNextKey(t):this.getPreviousKey(t)}getKeyRightOf(t){return this.flipDirection?this.getPreviousKey(t):this.getNextKey(t)}isDisabled(t){return this.disabledKeys.has(t)||!!this.collection.getItem(t)?.props?.isDisabled}getFirstKey(){let t=this.collection.getFirstKey();return t!=null&&this.isDisabled(t)&&(t=this.getNextKey(t)),t}getLastKey(){let t=this.collection.getLastKey();return t!=null&&this.isDisabled(t)&&(t=this.getPreviousKey(t)),t}getKeyAbove(t){return this.tabDirection?null:this.getPreviousKey(t)}getKeyBelow(t){return this.tabDirection?null:this.getNextKey(t)}getNextKey(t){let n=t;do n=this.collection.getKeyAfter(n),n==null&&(n=this.collection.getFirstKey());while(n!=null&&this.isDisabled(n));return n}getPreviousKey(t){let n=t;do n=this.collection.getKeyBefore(n),n==null&&(n=this.collection.getLastKey());while(n!=null&&this.isDisabled(n));return n}}const hw=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),bw=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function vw(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),o=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(o)return o.direction==="rtl";if(n.script)return hw.has(n.script)}let t=e.split("-")[0];return bw.has(t)}const Au=Symbol.for("react-aria.i18n.locale");function $u(){let e=typeof window<"u"&&window[Au]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:vw(e)?"rtl":"ltr"}}let ti=$u(),fo=new Set;function Vu(){ti=$u();for(let e of fo)e(ti)}function yw(){let e=Zp(),[t,n]=E.useState(ti);return E.useEffect(()=>(fo.size===0&&window.addEventListener("languagechange",Vu),fo.add(n),()=>{fo.delete(n),fo.size===0&&window.removeEventListener("languagechange",Vu)}),[]),e?{locale:typeof window<"u"&&window[Au]||"en-US",direction:"ltr"}:t}const Ew=E.createContext(null);function Ku(){let e=yw();return E.useContext(Ew)||e}const Tw="react-aria-clear-focus",ww="react-aria-focus";function Cw(e,t){if(!e)return!1;let n=window.getComputedStyle(e),o=document.scrollingElement||document.documentElement,a=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===o&&n.overflow!=="hidden"&&(a=!0),a&&t&&(a=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),a}function Hu(e,t){let n=[],o=document.scrollingElement||document.documentElement;do Cw(e,t)&&n.push(e),e=e.parentElement;while(e&&e!==o);return n}function ni(e,t,n={}){let{block:o="nearest",inline:a="nearest"}=n;if(e===t)return;let s=e.scrollTop,i=e.scrollLeft,l=t.getBoundingClientRect(),c=e.getBoundingClientRect(),d=window.getComputedStyle(t),u=window.getComputedStyle(e),m=document.scrollingElement||document.documentElement,p=e===m?0:c.top,f=e===m?e.clientHeight:c.bottom,g=e===m?0:c.left,v=e===m?e.clientWidth:c.right,y=parseInt(d.scrollMarginTop,10)||0,b=parseInt(d.scrollMarginBottom,10)||0,h=parseInt(d.scrollMarginLeft,10)||0,I=parseInt(d.scrollMarginRight,10)||0,C=parseInt(u.scrollPaddingTop,10)||0,D=parseInt(u.scrollPaddingBottom,10)||0,L=parseInt(u.scrollPaddingLeft,10)||0,$=parseInt(u.scrollPaddingRight,10)||0,O=parseInt(u.borderTopWidth,10)||0,_=parseInt(u.borderBottomWidth,10)||0,R=parseInt(u.borderLeftWidth,10)||0,H=parseInt(u.borderRightWidth,10)||0,Z=l.top-y,V=l.bottom+b,w=l.left-h,F=l.right+I,B=e===m?0:R+H,M=e===m?0:O+_,q=e.offsetWidth-e.clientWidth-B,N=e.offsetHeight-e.clientHeight-M,T=p+O+C,k=f-_-D-N,U=g+R+L,J=v-H-$;u.direction==="rtl"&&!Er()?U+=q:J-=q;let te=Z<T||V>k,ne=w<U||F>J;if(te&&o==="start")s+=Z-T;else if(te&&o==="center")s+=(Z+V)/2-(T+k)/2;else if(te&&o==="end")s+=V-k;else if(te&&o==="nearest"){let W=Z-T,X=V-k;s+=Math.abs(W)<=Math.abs(X)?W:X}if(ne&&a==="start")i+=w-U;else if(ne&&a==="center")i+=(w+F)/2-(U+J)/2;else if(ne&&a==="end")i+=F-J;else if(ne&&a==="nearest"){let W=w-U,X=F-J;i+=Math.abs(W)<=Math.abs(X)?W:X}if(process.env.NODE_ENV==="test"){e.scrollLeft=i,e.scrollTop=s;return}e.scrollTo({left:i,top:s})}function Wu(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let{left:s,top:i}=e.getBoundingClientRect(),l=Hu(e,!0);for(let u of l)ni(u,e);let{left:c,top:d}=e.getBoundingClientRect();if(Math.abs(s-c)>1||Math.abs(i-d)>1){l=n?Hu(n,!0):[];for(let u of l)ni(u,n,{block:"center",inline:"center"})}}else{let{left:s,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});let{left:l,top:c}=e.getBoundingClientRect();(Math.abs(s-l)>1||Math.abs(i-c)>1)&&(n?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}function Ir(e,t,n,o){let a=Dr(n),s=n==null;E.useEffect(()=>{if(s||!e.current)return;let i=e.current;return i.addEventListener(t,a,o),()=>{i.removeEventListener(t,a,o)}},[e,t,o,s])}const Dw=1e3;function Nw(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:o}=e,a=E.useRef({search:"",timeout:void 0}).current,s=i=>{let l=Iw(i.key);if(!(!l||i.ctrlKey||i.metaKey||!ye(i.currentTarget,me(i))||a.search.length===0&&l===" ")){if(l===" "&&a.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),a.search+=l,t.getKeyForSearch!=null){let c=t.getKeyForSearch(a.search,n.focusedKey);c==null&&(c=t.getKeyForSearch(a.search)),c!=null&&(n.setFocusedKey(c),o&&o(c))}clearTimeout(a.timeout),a.timeout=setTimeout(()=>{a.search=""},Dw)}};return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?s:void 0}}}function Iw(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Gu(e,t){const n=E.useRef(!0),o=E.useRef(null);Gt(()=>(n.current=!0,()=>{n.current=!1}),[]),Gt(()=>{n.current?n.current=!1:(!o.current||t.some((a,s)=>!Object.is(a,o[s])))&&e(),o.current=t},t)}function xw(e){let{selectionManager:t,keyboardDelegate:n,ref:o,autoFocus:a=!1,shouldFocusWrap:s=!1,disallowEmptySelection:i=!1,disallowSelectAll:l=!1,escapeKeyBehavior:c="clearSelection",selectOnFocus:d=t.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:m,allowsTabNavigation:p=!1,scrollRef:f=o,linkBehavior:g="action"}=e,{direction:v}=Ku(),y=Ks(),b=w=>{if(w.altKey&&w.key==="Tab"&&w.preventDefault(),!o.current||!ye(o.current,me(w)))return;const F=(B,M)=>{if(B!=null){if(t.isLink(B)&&g==="selection"&&d&&!zs(w)){Ln.flushSync(()=>{t.setFocusedKey(B,M)});let q=js(o,B),N=t.getItemProps(B);q&&y.open(q,w,N.href,N.routerOptions);return}if(t.setFocusedKey(B,M),t.isLink(B)&&g==="override")return;w.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(B):d&&!zs(w)&&t.replaceSelection(B)}};switch(w.key){case"ArrowDown":if(n.getKeyBelow){let B=t.focusedKey!=null?n.getKeyBelow?.(t.focusedKey):n.getFirstKey?.();B==null&&s&&(B=n.getFirstKey?.(t.focusedKey)),B!=null&&(w.preventDefault(),F(B))}break;case"ArrowUp":if(n.getKeyAbove){let B=t.focusedKey!=null?n.getKeyAbove?.(t.focusedKey):n.getLastKey?.();B==null&&s&&(B=n.getLastKey?.(t.focusedKey)),B!=null&&(w.preventDefault(),F(B))}break;case"ArrowLeft":if(n.getKeyLeftOf){let B=t.focusedKey!=null?n.getKeyLeftOf?.(t.focusedKey):n.getFirstKey?.();B==null&&s&&(B=v==="rtl"?n.getFirstKey?.(t.focusedKey):n.getLastKey?.(t.focusedKey)),B!=null&&(w.preventDefault(),F(B,v==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let B=t.focusedKey!=null?n.getKeyRightOf?.(t.focusedKey):n.getFirstKey?.();B==null&&s&&(B=v==="rtl"?n.getLastKey?.(t.focusedKey):n.getFirstKey?.(t.focusedKey)),B!=null&&(w.preventDefault(),F(B,v==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(t.focusedKey===null&&w.shiftKey)return;w.preventDefault();let B=n.getFirstKey(t.focusedKey,kn(w));t.setFocusedKey(B),B!=null&&(kn(w)&&w.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(B):d&&t.replaceSelection(B))}break;case"End":if(n.getLastKey){if(t.focusedKey===null&&w.shiftKey)return;w.preventDefault();let B=n.getLastKey(t.focusedKey,kn(w));t.setFocusedKey(B),B!=null&&(kn(w)&&w.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(B):d&&t.replaceSelection(B))}break;case"PageDown":if(n.getKeyPageBelow&&t.focusedKey!=null){let B=n.getKeyPageBelow(t.focusedKey);B!=null&&(w.preventDefault(),F(B))}break;case"PageUp":if(n.getKeyPageAbove&&t.focusedKey!=null){let B=n.getKeyPageAbove(t.focusedKey);B!=null&&(w.preventDefault(),F(B))}break;case"a":kn(w)&&t.selectionMode==="multiple"&&l!==!0&&(w.preventDefault(),t.selectAll());break;case"Escape":c==="clearSelection"&&!i&&t.selectedKeys.size!==0&&(w.stopPropagation(),w.preventDefault(),t.clearSelection());break;case"Tab":if(!p){if(w.shiftKey)o.current.focus();else{let B=Bu(o.current,{tabbable:!0}),M,q;do q=B.lastChild(),q&&(M=q);while(q);let N=It();M&&(!eu(M)||N&&!nu(N))&&Pt(M)}break}}},h=E.useRef({top:0,left:0});Ir(f,"scroll",()=>{h.current={top:f.current?.scrollTop??0,left:f.current?.scrollLeft??0}});let I=w=>{if(t.isFocused){ye(w.currentTarget,me(w))||t.setFocused(!1);return}if(ye(w.currentTarget,me(w))){if(t.setFocused(!0),t.focusedKey==null){let F=M=>{M!=null&&(t.setFocusedKey(M),d&&!t.isSelected(M)&&t.replaceSelection(M))},B=w.relatedTarget;B&&w.currentTarget.compareDocumentPosition(B)&Node.DOCUMENT_POSITION_FOLLOWING?F(t.lastSelectedKey??n.getLastKey?.()):F(t.firstSelectedKey??n.getFirstKey?.())}else f.current&&(f.current.scrollTop=h.current.top,f.current.scrollLeft=h.current.left);if(t.focusedKey!=null&&f.current){let F=js(o,t.focusedKey);F instanceof HTMLElement&&(!eu(F)&&!m&&Pt(F),Gs()==="keyboard"&&Wu(F,{containingElement:o.current}))}}},C=w=>{ye(w.currentTarget,w.relatedTarget)||t.setFocused(!1)},D=E.useRef(!1);Ir(o,ww,m?w=>{let{detail:F}=w;w.stopPropagation(),t.setFocused(!0),F?.focusStrategy==="first"&&(D.current=!0)}:void 0),Gu(()=>{if(D.current){let w=n.getFirstKey?.()??null;if(w==null){let F=It();bu(o.current),vu(F,null),t.collection.size>0&&(D.current=!1)}else t.setFocusedKey(w),D.current=!1}},[t.collection]),Gu(()=>{t.collection.size>0&&(D.current=!1)},[t.focusedKey]),Ir(o,Tw,m?w=>{w.stopPropagation(),t.setFocused(!1),w.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);const L=E.useRef(a),$=E.useRef(!1);E.useEffect(()=>{if(L.current){let w=null;a==="first"&&(w=n.getFirstKey?.()??null),a==="last"&&(w=n.getLastKey?.()??null);let F=t.selectedKeys;if(F.size){for(let B of F)if(t.canSelectItem(B)){w=B;break}}t.setFocused(!0),t.setFocusedKey(w),w==null&&!m&&o.current&&wr(o.current),t.collection.size>0&&(L.current=!1,$.current=!0)}});let O=E.useRef(t.focusedKey),_=E.useRef(null);E.useEffect(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==O.current||$.current)&&f.current&&o.current){let w=Gs(),F=js(o,t.focusedKey);if(!(F instanceof HTMLElement))return;(w==="keyboard"||$.current)&&(_.current&&cancelAnimationFrame(_.current),_.current=requestAnimationFrame(()=>{f.current&&(ni(f.current,F),w!=="virtual"&&Wu(F,{containingElement:o.current}))}))}!m&&t.isFocused&&t.focusedKey==null&&O.current!=null&&o.current&&wr(o.current),O.current=t.focusedKey,$.current=!1}),E.useEffect(()=>()=>{_.current&&cancelAnimationFrame(_.current)},[]),Ir(o,"react-aria-focus-scope-restore",w=>{w.preventDefault(),t.setFocused(!0)});let R={onKeyDown:b,onFocus:I,onBlur:C,onMouseDown(w){f.current===me(w)&&w.preventDefault()}},{typeSelectProps:H}=Nw({keyboardDelegate:n,selectionManager:t});u||(R=dt(H,R));let Z;m||(Z=t.focusedKey==null?0:-1);let V=zT(t.collection);return{collectionProps:dt(R,{tabIndex:Z,"data-collection":V})}}function kw(e,t,n){let{orientation:o="horizontal",keyboardActivation:a="automatic"}=e,{collection:s,selectionManager:i,disabledKeys:l}=t,{direction:c}=Ku(),d=E.useMemo(()=>new gw(s,c,o,l),[s,l,o,c]),{collectionProps:u}=xw({ref:n,selectionManager:i,keyboardDelegate:d,selectOnFocus:a==="automatic",disallowEmptySelection:!0,scrollRef:n,linkBehavior:"selection"}),m=gr();Jp.set(t,m);let p=Fu({...e,id:m});return{tabListProps:{...dt(u,p),role:"tablist","aria-orientation":o,tabIndex:void 0}}}function Uu({item:e,state:t}){const{key:n}=e,o=r.useRef(null),{tabProps:a}=cw({key:n},t,o),s=t.selectedKey===n,i=t.disabledKeys.has(n);return r.createElement("div",{...a,ref:o,className:K("sps-nav__item","sps-nav__link",s&&"active",i&&"sps-nav__item--disabled")},e.rendered)}function zu({state:e,...t}){const n=r.useRef(null),{tabPanelProps:o}=Sw(t,e,n);return r.createElement("div",{...o,ref:n,className:"sps-card__body"},e.selectedItem?e.selectedItem.props.children:null)}class ju{constructor(t){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t;let n=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let l of i.childNodes)n(l)};for(let i of t)n(i);let o=null,a=0,s=0;for(let[i,l]of this.keyMap)o?(o.nextKey=i,l.prevKey=o.key):(this.firstKey=i,l.prevKey=void 0),l.type==="item"&&(l.index=a++),(l.type==="section"||l.type==="item")&&s++,o=l,o.nextKey=void 0;this._size=s,this.lastKey=o?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let n=this.keyMap.get(t);return n?n.prevKey??null:null}getKeyAfter(t){let n=this.keyMap.get(t);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}getChildren(t){return this.keyMap.get(t)?.childNodes||[]}}class vt extends Set{constructor(t,n,o){super(t),t instanceof vt?(this.anchorKey=n??t.anchorKey,this.currentKey=o??t.currentKey):(this.anchorKey=n??null,this.currentKey=o??null)}}const Mw=typeof document<"u"?E.useInsertionEffect??E.useLayoutEffect:()=>{};function Yu(e,t,n){let[o,a]=E.useState(e||t),s=E.useRef(o),i=E.useRef(e!==void 0),l=e!==void 0;E.useEffect(()=>{let m=i.current;m!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),i.current=l},[l]);let c=l?e:o;Mw(()=>{s.current=c});let[,d]=E.useReducer(()=>({}),{}),u=E.useCallback((m,...p)=>{let f=typeof m=="function"?m(s.current):m;Object.is(s.current,f)||(s.current=f,a(f),d(),n?.(f,...p))},[n]);return[c,u]}function Lw(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function _w(e){let{selectionMode:t="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:o,selectionBehavior:a="toggle",disabledBehavior:s="all"}=e,i=E.useRef(!1),[,l]=E.useState(!1),c=E.useRef(null),d=E.useRef(null),[,u]=E.useState(null),m=E.useMemo(()=>qu(e.selectedKeys),[e.selectedKeys]),p=E.useMemo(()=>qu(e.defaultSelectedKeys,new vt),[e.defaultSelectedKeys]),[f,g]=Yu(m,p,e.onSelectionChange),v=E.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[y,b]=E.useState(a);a==="replace"&&y==="toggle"&&typeof f=="object"&&f.size===0&&b("replace");let h=E.useRef(a);return E.useEffect(()=>{a!==h.current&&(b(a),h.current=a)},[a]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:y,setSelectionBehavior:b,get isFocused(){return i.current},setFocused(I){i.current=I,l(I)},get focusedKey(){return c.current},get childFocusStrategy(){return d.current},setFocusedKey(I,C="first"){c.current=I,d.current=C,u(I)},selectedKeys:f,setSelectedKeys(I){(o||!Lw(I,f))&&g(I)},disabledKeys:v,disabledBehavior:s}}function qu(e,t){return e?e==="all"?"all":new vt(e):t}function Pw(e,t){return typeof t.getChildren=="function"?t.getChildren(e.key):e.childNodes}function Ow(e){return Bw(e)}function Bw(e,t){for(let n of e)return n}function oi(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let o=[...Ju(e,t),t],a=[...Ju(e,n),n],s=o.slice(0,a.length).findIndex((i,l)=>i!==a[l]);return s!==-1?(t=o[s],n=a[s],t.index-n.index):o.findIndex(i=>i===n)>=0?1:(a.findIndex(i=>i===t)>=0,-1)}function Ju(e,t){let n=[],o=t;for(;o?.parentKey!=null;)o=e.getItem(o.parentKey),o&&n.unshift(o);return n}class ri{constructor(t,n,o){this.collection=t,this.state=n,this.allowsCellSelection=o?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=o?.layoutDelegate||null,this.fullCollection=o?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}get isFocused(){return this.state.isFocused}setFocused(t){this.state.setFocused(t)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(t,n){(t==null||this.collection.getItem(t))&&this.state.setFocusedKey(t,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(t){if(this.state.selectionMode==="none")return!1;let n=this.getKey(t);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let t=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=t.every(o=>n.has(o)),this._isSelectAll}get firstSelectedKey(){let t=null;for(let n of this.state.selectedKeys){let o=this.collection.getItem(n);(!t||o&&oi(this.collection,o,t)<0)&&(t=o)}return t?.key??null}get lastSelectedKey(){let t=null;for(let n of this.state.selectedKeys){let o=this.collection.getItem(n);(!t||o&&oi(this.collection,o,t)>0)&&(t=o)}return t?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let o;if(this.state.selectedKeys==="all")o=new vt([n],n,n);else{let a=this.state.selectedKeys,s=a.anchorKey??n;o=new vt(a,s,n);for(let i of this.getKeyRange(s,a.currentKey??n))o.delete(i);for(let i of this.getKeyRange(n,s))this.canSelectItem(i)&&o.add(i)}this.state.setSelectedKeys(o)}getKeyRange(t,n){let o=this.collection.getItem(t),a=this.collection.getItem(n);return o&&a?oi(this.collection,o,a)<=0?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(t,n);let o=[],a=t;for(;a!=null;){let s=this.collection.getItem(a);if(s&&(s.type==="item"||s.type==="cell"&&this.allowsCellSelection)&&o.push(a),a===n)return o;a=this.collection.getKeyAfter(a)}return[]}getKey(t){let n=this.collection.getItem(t);if(!n||n.type==="cell"&&this.allowsCellSelection)return t;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let o=new vt(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);o.has(n)?o.delete(n):this.canSelectItem(n)&&(o.add(n),o.anchorKey=n,o.currentKey=n),!(this.disallowEmptySelection&&o.size===0)&&this.state.setSelectedKeys(o)}replaceSelection(t){if(this.selectionMode==="none")return;let n=this.getKey(t);if(n==null)return;let o=this.canSelectItem(n)?new vt([n],n,n):new vt;this.state.setSelectedKeys(o)}setSelectedKeys(t){if(this.selectionMode==="none")return;let n=new vt;for(let o of t){let a=this.getKey(o);if(a!=null&&(n.add(a),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let t=this.fullCollection??this.collection,n=[],o=a=>{for(;a!=null;){if(this.canSelectItemIn(a,t)){let s=t.getItem(a);s?.type==="item"&&n.push(a),s?.hasChildNodes&&(this.allowsCellSelection||s.type!=="item")&&o(Ow(Pw(s,t))?.key??null)}a=t.getKeyAfter(a)}};return o(t.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new vt)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(t)&&!this.disallowEmptySelection?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(t.size!==n.size)return!1;for(let o of t)if(!n.has(o))return!1;for(let o of n)if(!t.has(o))return!1;return!0}canSelectItem(t){return this.canSelectItemIn(t,this.collection)}canSelectItemIn(t,n){if(this.state.selectionMode==="none"||this.state.disabledKeys.has(t))return!1;let o=n.getItem(t);return!(!o||o?.props?.isDisabled||o.type==="cell"&&!this.allowsCellSelection)}isDisabled(t){return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(t)||!!this.collection.getItem(t)?.props?.isDisabled)}isLink(t){return!!this.collection.getItem(t)?.props?.href}getItemProps(t){return this.collection.getItem(t)?.props}withCollection(t){return new ri(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class Rw{build(t,n){return this.context=n,Xu(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:n,items:o}=t;if(E.isValidElement(n)&&n.type===E.Fragment)yield*this.iterateCollection({children:n.props.children,items:o});else if(typeof n=="function"){if(!o)throw new Error("props.children was a function but props.items is missing");let a=0;for(let s of o)yield*this.getFullNode({value:s,index:a},{renderer:n}),a++}else{let a=[];E.Children.forEach(n,i=>{i&&a.push(i)});let s=0;for(let i of a){let l=this.getFullNode({element:i,index:s},{});for(let c of l)s++,yield c}}}getKey(t,n,o,a){if(t.key!=null)return t.key;if(n.type==="cell"&&n.key!=null)return`${a}${n.key}`;let s=n.value;if(s!=null){let i=s.key??s.id;if(i==null)throw new Error("No key found for item");return i}return a?`${a}.${n.index}`:`$.${n.index}`}getChildState(t,n){return{renderer:n.renderer||t.renderer}}*getFullNode(t,n,o,a){if(E.isValidElement(t.element)&&t.element.type===E.Fragment){let c=[];E.Children.forEach(t.element.props.children,u=>{c.push(u)});let d=t.index??0;for(const u of c)yield*this.getFullNode({element:u,index:d++},n,o,a);return}let s=t.element;if(!s&&t.value&&n&&n.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=a?a.key:null,yield c;return}s=n.renderer(t.value)}if(E.isValidElement(s)){let c=s.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let p=s.type;throw new Error(`Unknown element <${p}> in collection.`)}let d=c.getCollectionNode(s.props,this.context),u=t.index??0,m=d.next();for(;!m.done&&m.value;){let p=m.value;t.index=u;let f=p.key??null;f==null&&(f=p.element?null:this.getKey(s,t,n,o));let v=[...this.getFullNode({...p,key:f,index:u,wrapper:Fw(t.wrapper,p.wrapper)},this.getChildState(n,p),o?`${o}${s.key}`:s.key,a)];for(let y of v){if(y.value=p.value??t.value??null,y.value&&this.cache.set(y.value,y),t.type&&y.type!==t.type)throw new Error(`Unsupported type <${ai(y.type)}> in <${ai(a?.type??"unknown parent type")}>. Only <${ai(t.type)}> is supported.`);u++,yield y}m=d.next(v)}return}if(t.key==null||t.type==null)return;let i=this,l={type:t.type,props:t.props,key:t.key,parentKey:a?a.key:null,value:t.value??null,level:(a?.level??0)+(a?.type==="item"?1:0),index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:Xu(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let d of t.childNodes()){d.key!=null&&(d.key=`${l.key}${d.key}`);let u=i.getFullNode({...d,index:c},i.getChildState(n,d),l.key,l);for(let m of u)c++,yield m}})};yield l}constructor(){this.cache=new WeakMap}}function Xu(e){let t=[],n=null;return{*[Symbol.iterator](){for(let o of t)yield o;n||(n=e());for(let o of n)t.push(o),yield o}}}function Fw(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function ai(e){return e[0].toUpperCase()+e.slice(1)}function Aw(e,t,n){let o=E.useMemo(()=>new Rw,[]),{children:a,items:s,collection:i}=e;return E.useMemo(()=>{if(i)return i;let c=o.build({children:a,items:s},n);return t(c)},[o,a,s,i,n,t])}function $w(e){let{filter:t,layoutDelegate:n}=e,o=_w(e),a=E.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),s=E.useCallback(d=>t?new ju(t(d)):new ju(d),[t]),i=E.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),l=Aw(e,s,i),c=E.useMemo(()=>new ri(l,o,{layoutDelegate:n}),[l,o,n]);return Vw(l,c),{collection:l,disabledKeys:a,selectionManager:c}}function Vw(e,t){const n=E.useRef(null);E.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){let o=n.current.getKeyAfter(t.focusedKey),a=null;for(;o!=null;){let s=e.getItem(o);if(s&&s.type==="item"&&!t.isDisabled(o)){a=o;break}o=n.current.getKeyAfter(o)}if(a==null)for(o=n.current.getKeyBefore(t.focusedKey);o!=null;){let s=e.getItem(o);if(s&&s.type==="item"&&!t.isDisabled(o)){a=o;break}o=n.current.getKeyBefore(o)}t.setFocusedKey(a)}n.current=e},[e,t])}function Kw(e){let[t,n]=Yu(e.selectedKey,e.defaultSelectedKey??null,e.onSelectionChange),o=E.useMemo(()=>t!=null?[t]:[],[t]),{collection:a,disabledKeys:s,selectionManager:i}=$w({...e,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:o,onSelectionChange:c=>{if(c==="all")return;let d=c.values().next().value??null;d===t&&e.onSelectionChange&&e.onSelectionChange(d),n(d)}}),l=t!=null?a.getItem(t):null;return{collection:a,disabledKeys:s,selectionManager:i,selectedKey:t,setSelectedKey:n,selectedItem:l}}function Hw(e){let t=Kw({...e,onSelectionChange:e.onSelectionChange?i=>{i!=null&&e.onSelectionChange?.(i)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:e.defaultSelectedKey??Zu(e.collection,e.disabledKeys?new Set(e.disabledKeys):new Set)??void 0}),{selectionManager:n,collection:o,selectedKey:a}=t,s=E.useRef(a);return E.useEffect(()=>{let i=a;e.selectedKey==null&&(n.isEmpty||i==null||!o.getItem(i))&&(i=Zu(o,t.disabledKeys),i!=null&&n.setSelectedKeys([i])),(i!=null&&n.focusedKey==null||!n.isFocused&&i!==s.current)&&n.setFocusedKey(i),s.current=i}),{...t,isDisabled:e.isDisabled||!1}}function Zu(e,t){let n=null;if(e){for(n=e.getFirstKey();n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n!==e.getLastKey();)n=e.getKeyAfter(n);n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n===e.getLastKey()&&(n=e.getFirstKey())}return n}const Ww={},Gw={};function si(e){const{selectedKey:t,defaultSelectedKey:n,...o}=e,a={...o,selectedKey:t??void 0,defaultSelectedKey:n??void 0},s=Hw(a),i=r.useRef(null),{tabListProps:l}=kw(a,s,i);return r.createElement(r.Fragment,null,r.createElement("div",{...l,ref:i,className:"sps-nav sps-nav--tabs sps-tabs-v2"},[...s.collection].map(c=>r.createElement(Uu,{key:c.key,item:c,state:s}))),r.createElement(zu,{key:s.selectedItem?s.selectedItem.key:null,state:s}))}Object.assign(si,{props:Ww,propTypes:Gw,displayName:"SpsTabsV2"});const Uw={};function ii({children:e,className:t,...n}){return r.createElement("div",{className:K("sps-card__footer",t),...n},e)}Object.assign(ii,{props:Uw,displayName:"SpsCardV2Footer"});const zw={};function li({children:e,className:t,...n}){return r.createElement("div",{className:K("sps-card__header",t),...n},e)}Object.assign(li,{props:zw,displayName:"SpsCardV2Header"});const jw={};function Qu({children:e,className:t,...n}){const[o,a,s,i,l]=at(e,[{type:li},{type:si},{custom:d=>d?.displayName==="Tabs"},{type:ii}]),c=a.length>0?a:s;return r.createElement("div",{className:K("sps-card",t),...n},o,c.length>0?c:r.createElement("div",{className:"sps-card__body"},l),i)}Object.assign(Qu,{props:jw,displayName:"SpsCardV2"});const Yw={};function em({children:e,className:t,...n}){return r.createElement("div",{className:K("sps-card__title",t),...n},e)}Object.assign(em,{props:Yw,displayName:"SpsCardV2Title"});const qw={...Sd,controlsDisabled:"boolean",footerLinks:"ReactNodeOrRenderFn",formMeta:"SpsFormSetMeta<any>",isOpen:"boolean",onClear:"() => void",onSubmit:"React.FormEventHandler"};function tm(e){const{children:t,className:n,controlsDisabled:o,footerLinks:a,formArray:s,formGroup:i,formMeta:l,isOpen:c,onClear:d,onSubmit:u,unsafelyReplaceClassName:m,...p}=e,{t:f}=he.useWoodlandLanguage();function g(){d&&d()}const v=K(m||"sps-advanced-search",c&&"sps-advanced-search--open",n);return r.createElement("div",{className:v,...p},r.createElement(so,{onSubmit:u,formArray:s,formGroup:i,formMeta:l},r.createElement("div",{className:"sps-advanced-search__form"},t),r.createElement("div",{className:"sps-advanced-search__footer"},a&&r.createElement("div",{id:"footer_links"},qe(a)),r.createElement("div",{className:"sps-advanced-search__footer-controls"},r.createElement(Ne,{kind:A.ButtonKind.DEFAULT,type:A.ButtonType.BUTTON,className:"mr-2",onClick:g,disabled:o},f("advancedSearch.clear")),r.createElement(Ne,{kind:A.ButtonKind.KEY,type:A.ButtonType.SUBMIT,disabled:o},f("advancedSearch.search"))))))}Object.assign(tm,{props:qw,displayName:"SpsAdvancedSearch"});const Jw={general:{label:"General Usage",description:({NavigateTo:e,Link:t})=>r.createElement(r.Fragment,null,r.createElement("p",null,'Advanced Search is comprised of a panel of input fields, and a text button that exposes and hides the panel. By default, the Advanced Search panel is hidden (with the exception of "Advanced Search Only" scenarios).'),r.createElement("p",null,"Advanced Search works in conjunction with the"," ",r.createElement(e,{to:"list-toolbar"},"List Bar")," and"," ",r.createElement(e,{to:"search-results-bar"},"Search Results")," components. Refer to those pages for additional details."),r.createElement("p",null,"Use the following guidelines when including Advanced Search on your page:",r.createElement("ul",null,r.createElement("li",null,"The Advanced Search Panel can contain any number of input fields."),r.createElement("li",null,"The Advanced Search Panel can place input fields in any unique layout to best serve the needs of the search criteria, but must adhere to the rules of the"," ",r.createElement(t,{to:"/style-and-layout/grid/"},"SPS Grid")," and guidelines for"," ",r.createElement(e,{to:"form"},"Form Layouts"),"."))))},basic:{label:"Basic Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("p",null,"A Basic Advanced Search consists of the List Bar with a search input and an Advanced Search text button. For more details on additional button and component options in the List Bar reference the ",r.createElement(e,{to:"list-toolbar"},"List Bar")," page.")),examples:{basic:{react:S.code`
|
|
9836
9836
|
import {
|
|
9837
9837
|
SpsListToolbar,
|
|
9838
9838
|
SpsListToolbarSearch,
|
|
@@ -10063,7 +10063,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
10063
10063
|
</SpsAdvancedSearch>
|
|
10064
10064
|
</>;
|
|
10065
10065
|
}
|
|
10066
|
-
`}}}},
|
|
10066
|
+
`}}}},Xw=function({viewing:e,in:t,onChange:n}){const{t:o}=he.useWoodlandLanguage();return r.createElement("div",{className:"sps-context-bar"},o("contextBar.viewing",{defaultValue:"Viewing"}),r.createElement("span",{className:"sps-context-bar__emphasized"},e),!!t&&r.createElement(r.Fragment,null,o("contextBar.in",{defaultValue:"in"}),r.createElement("span",{className:"sps-context-bar__emphasized"},t)),!!n&&r.createElement(Ne,{className:"sps-context-bar__change-button",kind:A.ButtonKind.LINK,onClick:n},o("contextBar.change",{defaultValue:"Change"})))},Zw={disabled:"boolean",formMeta:"SpsFormFieldMeta<number>",name:"string",onChange:"ChangeEventHandler<number>",value:"number"};function Qw(e){return e?Number.parseInt(e.replace(/[^\d]/g,""),10)/100:null}function eC(e){return typeof e=="number"?e.toFixed(2):""}function nm({className:e,disabled:t=!1,formMeta:n,id:o,name:a,onChange:s,ref:i,title:l,value:c,...d}){const{wrapperId:u,controlId:m}=Ge(o,n),p=r.useRef(null);function f(h){n&&(n.setValue(h),n.markAsDirty()),s&&s(h)}function g(){f(null)}function v(h){f(Qw(h.target.value))}function y(h){h.currentTarget.setSelectionRange(h.currentTarget.value.length,h.currentTarget.value.length)}const b=K("sps-text-input",e);return r.createElement(Le,{id:u,className:b,formMeta:n,inputRef:p,ref:i},r.createElement("div",{className:K("sps-form-control",t&&"disabled")},r.createElement(ht,{className:"sps-text-input__icon",icon:A.SpsIcon.DOLLAR_SIGN}),r.createElement("input",{type:"text",ref:p,onFocus:y,className:"sps-text-input__input",id:m,name:a,placeholder:"0.00",onChange:v,title:l,value:eC(c),disabled:t,...d}),c!==null&&!t&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:g})))}Object.assign(nm,{props:Zw,displayName:"SpsCurrencyInput"});const tC={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
10067
10067
|
import {
|
|
10068
10068
|
useSpsForm,
|
|
10069
10069
|
SpsCurrencyInput,
|
|
@@ -10109,7 +10109,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
10109
10109
|
</>
|
|
10110
10110
|
)
|
|
10111
10111
|
}
|
|
10112
|
-
`}}}},
|
|
10112
|
+
`}}}},nC={};function ci(e){const{children:t,className:n,unsafelyReplaceClassName:o,...a}=e,s=K(o||"sps-list-action-bar-container","z-stratum-bar",n);return r.createElement("div",{className:s,...a},r.createElement("div",{className:"sps-list-action-bar"},r.createElement("div",{className:"sps-list-action-bar__actions"},t)))}Object.assign(ci,{props:nC,displayName:"SpsFocusedTaskActions"});const oC={fullWidth:"boolean",isOpen:"boolean",onClose:"() => void"};function di(e){const{children:t,className:n,fullWidth:o,isOpen:a,onClose:s,title:i,"data-testid":l,unsafelyReplaceClassName:c,...d}=e,u=r.useRef(null),{t:m}=he.useWoodlandLanguage();r.useEffect(()=>{document.body.style.overflow=a?"hidden":""},[a]),r.useEffect(()=>()=>{document.body.style.overflow=""},[]);const p=K(c||"sps-focused-task","z-stratum-dialog",o&&"sps-focused-task--full-width",a&&"sps-focused-task--open",n),[f,g]=at(t,[{type:ci}]);return r.createElement("div",{className:p,ref:u,"data-testid":l,"data-react-aria-top-layer":"true",...d},r.createElement("div",{className:"sps-focused-task__title"},r.createElement(Ne,{className:"sps-focused-task__close-btn",kind:A.ButtonKind.ICON,icon:A.SpsIcon.X,onClick:s,title:m("focusedTask.close",{defaultValue:"Close"})})),r.createElement("div",{className:"sps-focused-task__body"},r.createElement(rt.Provider,{value:{parentElementRef:u}},a&&g)),f)}Object.assign(di,{props:oC,displayName:"SpsFocusedTask"});const rC={basic:{examples:{basic:{react:S.code`
|
|
10113
10113
|
import {
|
|
10114
10114
|
SpsButton,
|
|
10115
10115
|
SpsFocusedTask,
|
|
@@ -10193,7 +10193,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
10193
10193
|
</>
|
|
10194
10194
|
);
|
|
10195
10195
|
}
|
|
10196
|
-
`}}}},
|
|
10196
|
+
`}}}},aC={imgSrc:"string",kind:"GrowlerKind",onClose:"() => void",persist:"boolean",title:"string"};function pi(e){const{children:t,className:n,imgSrc:o,kind:a=A.GrowlerKind.INFO,onClose:s,persist:i,title:l,unsafelyReplaceClassName:c,...d}=e,u=r.useRef(s);r.useEffect(()=>{u.current=s},[s]);const{t:m}=he.useWoodlandLanguage(),[p,f]=r.useState(!0),[g,v]=r.useState(!1);function y(){return[window.setTimeout(()=>v(!0),A.GROWLER_VISIBLE_DURATION_MS),window.setTimeout(()=>{f(!1),u.current&&u.current()},A.GROWLER_VISIBLE_DURATION_MS+A.GROWLER_FADEOUT_DURATION_MS)]}const b=r.useRef([]);function h(){i||(b.current=y())}function I(){for(const _ of b.current)window.clearTimeout(_);b.current=[]}function C(){I(),f(!0),v(!1)}function D(){C(),v(!1),f(!1),s&&s()}const L=a===A.GrowlerKind.PROGRESS?"sps-spinner":K("sps-icon",`sps-icon-${A.GrowlerIcon.get(a)}`),$=K(c||"sps-growler",p&&"show",g&&"fade",`sps-growler--${a}`,n);return r.useEffect(()=>(h(),()=>{I()}),[]),gn("sps-growler-display-area",["sps-growler-area","z-stratum-growlers"])(r.createElement("div",{role:"alert",className:$,onMouseEnter:C,onMouseLeave:h,...d},r.createElement("div",{className:"sps-growler__icon-box"},o&&r.createElement("img",{src:o,alt:""}),!o&&r.createElement("i",{className:L,"aria-hidden":"true"})),r.createElement("div",{className:"sps-growler__message-box"},r.createElement("div",{className:"sps-growler__message-box-text"},l&&r.createElement("span",{className:"sps-growler__message-box-title d-block"},l),r.createElement("div",{className:"sps-growler__message-box-subtitle"},t)),r.createElement("button",{type:"button",className:"sps-growler__close-button","aria-hidden":"true",onClick:D},r.createElement("i",{className:"sps-icon sps-icon-x",title:m("growler.dismiss",{defaultValue:"Dismiss"})})))))}Object.assign(pi,{props:aC,displayName:"SpsGrowler"});function sC(){const[e,t]=r.useState([]),n=r.useCallback(()=>e.map(a=>r.createElement(pi,{id:a.id,key:a.id,title:a.title,kind:a.kind,imgSrc:a.imgSrc,persist:a.persist,onClose:()=>{a.onClose&&a.onClose(),a.closed=!0,e.every(s=>s.closed)&&t([])}},qe(a.content))),[e]),o=r.useCallback(a=>{t(s=>[...s,{...a,kind:a.kind||A.GrowlerKind.INFO,id:a.id||We()}])},[]);return[n,o]}const iC={writingGuidelines:{label:"Writing Guidelines",customSection:()=>r.createElement(r.Fragment,null,r.createElement("p",null,"Use the following guidelines to write an effective Growler message."),r.createElement("ul",null,r.createElement("li",null,"Write all messages in sentence case.",r.createElement("ul",null,r.createElement("li",null,"Capitalize the first word of the message."),r.createElement("li",null,"Add punctuation, such as a period, at the end of the message."))),r.createElement("li",null,"Keep messages as succinct as possible while also providing sufficient information to the customer."),r.createElement("li",null,"If you can clearly convey your message in a single statement, use only the Primary Message."),r.createElement("li",null,"If the message requires additional details, such as further information or instructions, use both the Primary and Secondary Messages.")),r.createElement("p",null,"For more examples of effective feedback message writing, refer to"," ",r.createElement("a",{href:"https://atlassian.design/content/messaging-guidelines",target:"_blank",rel:"noreferrer"},"Atlassian's Messaging Guidelines"),"."))},error:{label:"Error",description:()=>r.createElement(r.Fragment,null,r.createElement("p",null,"Acceptable message: Document ABC123 has not been sent. Check the form and try sending it again."),r.createElement("p",null,`Unacceptable message: Can't send your document."`)),examples:{primary:{description:"Primary Message Only",react:S.code`
|
|
10197
10197
|
import { SpsButton, SpsGrowler } from "@spscommerce/ds-react";
|
|
10198
10198
|
import { ButtonKind, GrowlerKind } from "@spscommerce/ds-shared";
|
|
10199
10199
|
|
|
@@ -10481,7 +10481,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
10481
10481
|
</>
|
|
10482
10482
|
);
|
|
10483
10483
|
}
|
|
10484
|
-
`}}}};function
|
|
10484
|
+
`}}}};function lC(e){const{children:t}=e;return r.createElement("div",{className:"insight-tile-wrapper"},t)}const cC={horizontal:"boolean",icon:"SpsIcon",kind:"SpsInsightTileKind",title:"string",metric:"number | string",partnerCount:"number",totalPartners:"number"};function om(e){const{children:t,className:n,horizontal:o=!1,icon:a,kind:s="general",title:i,metric:l,partnerCount:c,totalPartners:d,unsafelyReplaceClassName:u,...m}=e,p=K(u||"sps-insight-tile",`sps-insight-tile--${s}`,n,o&&"sps-insight-tile--horizontal",t&&"sps-insight-tile--has-detail"),{t:f}=he.useWoodlandLanguage(),[g,v,y]=(c?f("insightTile.partnerCount",{count:c,total:d,defaultValue:`${c} |of| ${d}`}):"").split("|");return r.createElement(r.Fragment,null,r.createElement("div",{className:p,...m},r.createElement("div",{className:"sps-insight-tile__body"},a?r.createElement("i",{className:`sps-icon sps-icon-${a}`}):r.createElement("i",{className:`sps-icon sps-icon-${A.SpsInsightTileIcons[s]}`}),l&&r.createElement("div",{className:"sps-insight-tile__metric-count"},l),i&&r.createElement("div",{className:"sps-insight-tile__description"},r.createElement("div",{className:"sps-insight-tile__title",style:{"-webkit-box-orient":"vertical"}},i),r.createElement("div",{className:"sps-insight-tile__detail"},t))),c&&r.createElement("div",{className:"sps-insight-tile__partner-count"},c===d?r.createElement("div",null,f("insightTile.all",{defaultValue:"ALL"})):r.createElement(r.Fragment,null,r.createElement("div",null,g),r.createElement("div",null,v),r.createElement("div",null,y)),r.createElement("div",{className:"sps-insight-tile__partners-text"},f("insightTile.partners",{defaultValue:"PARTNERS"})))))}Object.assign(om,{props:cC,displayName:"SpsInsightTile"});const dC={inline:"boolean"};function rm(e){const{children:t,className:n,inline:o,"data-testid":a,unsafelyReplaceClassName:s,...i}=e,l=K(s||"sps-key-value-list",o&&"sps-key-value-list--inline",n);return r.createElement("div",{className:l,"data-testid":`${a}`,...i},t)}Object.assign(rm,{props:dC,displayName:"SpsKeyValueList"});const pC={itemKey:{type:"string | nodeOrRenderFn",required:!0},titleColor:"KeyValueListTitleColor"};function am(e){const{children:t,className:n,itemKey:o,titleColor:a=A.KeyValueListTitleColor.LIGHT,"data-testid":s,unsafelyReplaceClassName:i,...l}=e,c=K(i||"sps-key-value-list__item",`sps-key-value-list__item--${a}`,n);return r.createElement("div",{className:c,"data-testid":`${s}`,...l},r.createElement("span",{className:"sps-key-value-list__key","data-testid":`${s}__key`},o),r.createElement("span",{className:"sps-key-value-list__value","data-testid":`${s}__value`},t))}Object.assign(am,{props:pC,displayName:"SpsKeyValueListItem"});const uC={color:"TagKind",href:"String",icon:"SpsIcon",tagKey:{type:"String",required:!0},value:{type:"String",required:!0}};function sm(e){const{color:t=A.TagKind.KEY,className:n,"data-testid":o,href:a,icon:s,tagKey:i,value:l,unsafelyReplaceClassName:c,...d}=e,u=K(c||"sps-key-value-tag",a&&"sps-key-value-tag--link",n);return r.createElement("span",{className:u,"data-testid":`${o}__key-value-tag`,...d},r.createElement(gt,{icon:s,kind:t,className:"sps-key-value-tag--key"},i),r.createElement(gt,{className:`sps-key-value-tag--value ${t}`},a&&r.createElement("a",{href:a},l),!a&&l))}Object.assign(sm,{props:uC,displayName:"SpsKeyValueTag"});const mC={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
10485
10485
|
import { SpsKeyValueTag } from "@spscommerce/ds-react";
|
|
10486
10486
|
function Component() {
|
|
10487
10487
|
return (
|
|
@@ -10510,7 +10510,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
10510
10510
|
</>
|
|
10511
10511
|
)
|
|
10512
10512
|
}
|
|
10513
|
-
`}}}};function
|
|
10513
|
+
`}}}};function im(e){const{tabs:t,activeTab:n,onTabChange:o,className:a,unsafelyReplaceClassName:s,"data-testid":i,...l}=e,[c,d]=r.useState();r.useEffect(()=>{if(t.length)if(n){const p=t.find(f=>f.label===n.label);d(p)}else d(t[0])},[]);const u=(p,f)=>{p.preventDefault(),d(f),typeof o=="function"&&o(f)},m=K(s||"sps-tabs",a);return r.createElement("div",{className:m},r.createElement("nav",{className:"sps-nav sps-nav--tabs","data-testid":i,...l},t.map(p=>r.createElement("a",{key:p.label,id:p.id,className:K("sps-nav__item","sps-nav__link",p===c&&"active"),role:"tab","data-toggle":"tab",href:p.controlsId?`#${p.controlsId}`:void 0,"aria-controls":p.controlsId,"aria-selected":p===n,onClick:f=>{u(f,p)},"data-testid":`${i}__tab-link`},p.icon&&r.createElement("i",{className:`sps-icon sps-icon-${p.icon}`}),r.createElement("span",null,p.label),p.tag&&r.createElement("span",{className:"sps-tag sps-tag--key"},p.tag)))))}Object.assign(im,{displayName:"SpsTabs"});const fC={resultsCount:"number",totalResults:"number",onClear:"() => void"};function lm(e){const{children:t,className:n,resultsCount:o,totalResults:a,onClear:s,"data-testid":i,unsafelyReplaceClassName:l,...c}=e,{t:d}=he.useWoodlandLanguage(),u=K(l||"sps-search-results-bar",n),[m,p,f]=d("searchResultsBar.count",{count:o,total:a,defaultValue:`${o} of ${a}`}).split(" ");return r.createElement("div",{className:u,"data-testid":`${i}`,...c},r.createElement("span",{className:"sps-search-results-bar__label","data-testid":`${i}__label`},d("searchResultsBar.matchingResults",{defaultValue:"Matching results"})),m&&!Number.isNaN(Number(m))&&r.createElement("span",{className:"sps-search-results-bar__count","data-testid":`${i}__count`},r.createElement("i",{className:"sps-icon sps-icon-double-angle-right"}),r.createElement("span",null,m)),f&&!Number.isNaN(Number(f))&&r.createElement("span",{className:"sps-search-results-bar__total","data-testid":`${i}__total`},p," ",f),r.createElement("div",{className:"sps-search-results-bar__buttons","data-testid":`${i}__button`},r.createElement("button",{type:"button",onClick:s},d("searchResultsBar.clear",{defaultValue:"Clear"}))))}Object.assign(lm,{props:fC,displayName:"SpsSearchResultsBar"});const SC={results:"number || string || null",selections:"{ [key: string]: string[] }",zeroStateText:"string",onClear:"() => void"};function ui(e){const{className:t,results:n,selections:o,zeroStateText:a,onClear:s,"data-testid":i,unsafelyReplaceClassName:l,...c}=e,{t:d}=he.useWoodlandLanguage(),u=K(l||"sps-search-results-bar-v2",t),m=o?Object.keys(o).reduce((p,f)=>(o[f].length>0&&(p[f]=o[f]),p),{}):{};return r.createElement("div",{className:u,"data-testid":`${i}`,...c},n!=null&&r.createElement("div",{className:"sps-search-results-bar-v2__results"},r.createElement("span",{"data-testid":`${i}__label`},d("searchResultsBar.results",{defaultValue:"Results:"})),r.createElement(gt,{kind:A.TagKind.INFO},r.createElement("span",null,n))),r.createElement("div",{className:"sps-search-results-bar-v2__selections"},Object.keys(m).length>0?Object.keys(m).map((p,f)=>r.createElement(r.Fragment,null,r.createElement("span",{key:f,className:"sps-search-results-bar-v2__selection"},p,":"),m[p].map((g,v)=>r.createElement(gt,{key:v,kind:A.TagKind.KEY},r.createElement("span",null,g))))):r.createElement("span",{className:"font-italic"},a||d("searchResultsBar.noAdvancedSearchSelections",{defaultValue:"No Advanced Search Selections"}))),r.createElement("div",{className:"sps-search-results-bar-v2__buttons","data-testid":`${i}__button`},r.createElement(Ne,{kind:A.ButtonKind.LINK,onClick:s},d("searchResultsBar.clearResults",{defaultValue:"Clear Results"}))))}Object.assign(ui,{props:SC,displayName:"SpsSearchResultsBarV2"});const gC={basic:{label:"Basic",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("p",null,"SpsSearchResultsBarV2 should be used with List Toolbar and Advanced Search."),r.createElement("p",null,"For more examples go to the Advanced Search section on the"," ",r.createElement(e,{to:"list-toolbar"},"List Toolbar")," page.")),examples:{basic:{react:S.code`
|
|
10514
10514
|
import {
|
|
10515
10515
|
useSpsForm,
|
|
10516
10516
|
SpsListToolbar,
|
|
@@ -10728,7 +10728,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
10728
10728
|
</>
|
|
10729
10729
|
)
|
|
10730
10730
|
}
|
|
10731
|
-
`}}}},
|
|
10731
|
+
`}}}},hC={onSubmit:"FormEventHandler"};function mi(e){const{children:t,onSubmit:n}=e;function o(a){a.preventDefault(),n&&n(a)}return r.createElement("form",{onSubmit:o,className:"sps-list-toolbar__search-form",noValidate:!0},r.createElement(In,{className:"sps-list-toolbar__search-field"},t))}Object.assign(mi,{props:hC,displayName:"SpsListToolbarSearch"});const bC={};function fi(e){const{children:t}=e;return r.createElement("div",null,t)}Object.assign(fi,{props:bC,displayName:"SpsListToolbarSearchInfo"});const vC={activeTab:"SpsTab",advancedSearch:"{ isOpen: boolean, enteredFields: number }",onToggleAdvancedSearch:"(boolean) => void",onTabChange:"(SpsTab) => void",title:"string",tabs:"Array<SpsTab>",onToolbarPinned:"(boolean) => void",selectable:"boolean",isSelected:"boolean",isIndeterminate:"boolean",onSelectionChange:"(boolean) => void",pinResultsBar:"boolean",pinToolbar:"boolean"};function cm(e){const{activeTab:t,advancedSearch:n,children:o,className:a,onToggleAdvancedSearch:s,onTabChange:i,tabs:l,title:c,unsafelyReplaceClassName:d,onToolbarPinned:u,selectable:m,isSelected:p,isIndeterminate:f,onSelectionChange:g,pinResultsBar:v,pinToolbar:y=!0,"data-testid":b,...h}=e,{t:I}=he.useWoodlandLanguage();let C=null;const[D,L]=r.useState(!1),$=r.useRef(null),O=r.useRef(null),_=S.lockToAnimationFrames(()=>{if($.current&&y){const N=$.current.getBoundingClientRect();N&&N.height>0&&N.top<=60&&(typeof C=="number"?window.scrollY<C&&(C=null,L(!1)):(C=window.scrollY,L(!0),s&&s(!1)))}});r.useEffect(()=>(window.addEventListener("scroll",_),()=>{window.removeEventListener("scroll",_)}),[]);const R=r.useRef();r.useLayoutEffect(()=>{if(O.current&&$.current&&y){if(D&&R.current)O.current.style.height=R.current.height,O.current.style.width=R.current.width,O.current.style.marginBottom=R.current.marginBottom;else if(!D){O.current.style.height="",O.current.style.width="",O.current.style.marginBottom="";const N=window.getComputedStyle($.current);R.current={height:N.height,width:N.width,marginBottom:N.marginBottom}}}},[D]);function H(N){i&&i(N)}function Z(){s&&s(!n?.isOpen)}function V(N){u&&u(N)}r.useEffect(()=>{V(D)},[D]);const w=K(d||"sps-list-toolbar",D&&y&&"sps-list-toolbar--pinned",D&&y&&"z-stratum-toolbar",n&&n.isOpen&&"sps-list-toolbar--advanced-search-open",a),[F,B,M,q]=at(o,[{type:mi},{type:fi},{type:ui}]);return r.createElement("div",{className:"sps-list-toolbar__wrapper",ref:O},r.createElement("div",{className:w,"data-testid":b,ref:$,...h},r.createElement("div",{className:"sps-list-toolbar__content"},!!m&&r.createElement("div",{className:"sps-list-toolbar__selection-controls"},r.createElement(Jt,{checked:p,indeterminate:f,onChange:()=>{g?.(!p)}})),l&&r.createElement(im,{tabs:l,onTabChange:H,activeTab:t,"data-testid":`${b}__tabs`}),r.createElement("div",{className:"sps-list-toolbar__search-controls"},!c&&F,!c&&B,F.length>0&&n&&r.createElement("div",{className:"sps-list-toolbar__advanced-search-toggle","data-testid":`${b}__advanced-search`},r.createElement("div",{className:"sps-list-toolbar__advanced-search-toggle-button-wrapper"},r.createElement(Ne,{kind:A.ButtonKind.LINK,onClick:Z},I("listToolbar.advancedSearchToggle",{defaultValue:"Advanced Search"}))),(n.enteredFields||0)>0&&r.createElement(gt,{"data-testid":`${b}__entered_fields`,kind:A.TagKind.INFO},r.createElement("span",null,n.enteredFields))),c&&r.createElement("div",{"data-testid":`${b}-title`,className:"sps-list-toolbar__advanced-search-title"},c)),D?r.createElement("div",{className:"sps-list-toolbar__header-content"},r.createElement(rt.Provider,{value:{fixed:!0}},q)):r.createElement("div",{className:"sps-list-toolbar__header-content"},q)),r.createElement("div",null,(!D||v)&&M)))}Object.assign(cm,{props:vC,displayName:"SpsListToolbar"});const yC={options:"SortOption[]",activeOption:"SortOption",onSortChange:"(option: SortOption) => void",defaultOption:"SortOption"};function dm(e){const{options:t,onSortChange:n,defaultOption:o,activeOption:a,className:s,unsafelyReplaceClassName:i}=e,l=(t||[]).map(d=>[{label:d.label,icon:d.icon},()=>{n&&n(d)}]),c=K(i||"sps-list-toolbar-sort-by",s);return r.createElement(an,{className:c,icon:a?.icon||o?.icon,label:a?.label||o?.label,options:l})}Object.assign(dm,{props:yC,displayName:"SpsListToolbarSortBy"});function pm(){const[e,t]=r.useState(!1);function n(){t(!1)}function o(){t(!0)}return r.createElement(r.Fragment,null,r.createElement("p",null,"The List Bar is divided into a number of different sections. It spans the entire width of the corresponding list."),r.createElement(Ne,{kind:A.ButtonKind.LINK,onClick:o},"View Content Order Example"),r.createElement(di,{isOpen:e,onClose:n},r.createElement("h1",null,"Content Order"),r.createElement("img",{src:"assets/images/list-toolbar-example.svg",alt:"A List Toolbar with labels on each section",className:"w-100 mb-3"}),r.createElement(sn,null,r.createElement(Ht,null,r.createElement(Be,{style:{width:"80px"}},"Order"),r.createElement(Be,null,"Section"),r.createElement(Be,null,"Notes")),r.createElement(Wt,null,r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"1")),r.createElement(re,null,"Checkbox"),r.createElement(re,null,"For Content Rows and Content Tiles only.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"2")),r.createElement(re,null,"Search/Filter Box"),r.createElement(re,null)),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"3")),r.createElement(re,null,"Saved Search"),r.createElement(re,null)),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"4")),r.createElement(re,null,"Advanced Search"),r.createElement(re,null,"For more information, visit the Advanced Search page.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"5")),r.createElement(re,null,"Column Editor"),r.createElement(re,{wrap:500},"Use for Tables only. For more information, visit the Column Editor page.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"6")),r.createElement(re,null,"List View Selector"),r.createElement(re,null)),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"7")),r.createElement(re,null,"Sorting"),r.createElement(re,null)),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"8")),r.createElement(re,null,"Buttons"),r.createElement(re,{wrap:500},"Buttons always appear in the rightmost section of the List Toolbar. For the ordering of Buttons, refer to the Button Groups section on the Buttons page."))))))}const EC={general:{label:"General Usage",description:()=>r.createElement(r.Fragment,null,r.createElement("h5",null,"Use a List Toolbar:"),r.createElement("ul",null,r.createElement("li",null,"When list content needs to be searched, filtered, sorted, or otherwise interacted with.")),r.createElement("h5",null,"Avoid a List Toolbar:"),r.createElement("ul",null,r.createElement("li",null,"When no list is present."),r.createElement("li",null,"When there will always be a small number of elements in the list, or the list does not require searching, filtering, or other actions.")))},contentOrder:{label:"Content Order",description:r.createElement(pm,null)},checkbox:{label:"Checkbox",description:({NavigateTo:e})=>r.createElement("p",null,"Use a Checkbox in the List Toolbar when items in a"," ",r.createElement(e,{to:"Content rows"},"Content Row")," or"," ",r.createElement(e,{to:"Content tiles"},"Content Tile")," are selectable. The Checkbox selects all items in the list, and will cause the Action Bar to appear. Do not use this with a Table, as Tables have a built-in checkbox in the header row."),examples:{checkbox:{react:S.code`
|
|
10732
10732
|
import {
|
|
10733
10733
|
SpsListToolbar,
|
|
10734
10734
|
SpsListToolbarSearch,
|
|
@@ -11419,7 +11419,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
11419
11419
|
</SpsListToolbar>
|
|
11420
11420
|
)
|
|
11421
11421
|
}
|
|
11422
|
-
`}}}};var
|
|
11422
|
+
`}}}};var um=(e=>(e.Ok="Ok",e.Cancel="Cancel",e))(um||{});const TC=()=>{const[e,t]=E.useState([]),n=d=>{const u=[...e],m={...d};return m.key=We(),new Promise(f=>{u.push({component:m,resolve:f}),t(u)})},o=d=>{const u=[...e];u.pop()?.resolve(d),t(u)},[a,s]=E.useState(!1),[i,l]=E.useState();E.useEffect(()=>{a&&(o(i),s(!1))},[a]);const c=d=>{s(!0),l(d)};return[e.map(d=>d.component),n,c]};function wC(e,t){const n={...A.SPS_ACTION_DEFAULTS,...e},[o,a]=Dt(n);return Object.assign(t,o),[t,s=>{a(s),Object.assign(t,o)}]}const CC={};function mm(e){const{children:t,className:n,"data-testid":o,unsafelyReplaceClassName:a,...s}=e;let i;const l=[];r.Children.forEach(t,d=>{r.isValidElement(d)&&d.type==="i"?i=d:l.push(d)});const c=K(a||"sps-page-title",n);return r.createElement("div",{className:c,"data-testid":`${o}`,...s},i,r.createElement("div",{className:"sps-page-title__text","data-testid":`${o}__text`},l))}Object.assign(mm,{props:CC,displayName:"SpsPageTitle"});const DC={};function fm(e){const{children:t,className:n,"data-testid":o,unsafelyReplaceClassName:a,...s}=e,i=K(a||"sps-page-title__subtitle",n);return r.createElement("div",{className:i,"data-testid":o,...s},t)}Object.assign(fm,{props:DC,displayName:"SpsPageSubtitle"});const NC={basic:{label:"Basic",examples:{basic:{imports:S.code`
|
|
11423
11423
|
import { SpsPageTitle } from "@spscommerce/ds-react";
|
|
11424
11424
|
`,jsx:S.code`
|
|
11425
11425
|
<SpsPageTitle>
|
|
@@ -11453,7 +11453,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
11453
11453
|
MacNeil Automotive Parts
|
|
11454
11454
|
</SpsPageSubtitle>
|
|
11455
11455
|
</SpsPageTitle>
|
|
11456
|
-
`}}}},
|
|
11456
|
+
`}}}},IC={active:"boolean",as:"React.ElementType"};function Si(e){const{active:t,as:n="a",children:o,className:a,unsafelyReplaceClassName:s,...i}=e,l=K(s||"sps-nav__item","sps-nav__link",t&&"active");return r.createElement(n,{className:l,...i},o)}Object.assign(Si,{props:IC,displayName:"SpsProductBarTab"});const xC={activeTab:"string",fullWidth:"boolean",onTabChange:"(newTab: string) => void",onProductNameClick:"React.MouseEventHandler",productLogoSrc:"string",productName:"string",productNameHref:"string",tabs:"Array<string>"};function Sm(e){const{activeTab:t,children:n,className:o,fullWidth:a,onProductNameClick:s,onTabChange:i,productLogoSrc:l,productName:c,productNameHref:d,tabs:u=[],unsafelyReplaceClassName:m,...p}=e,{t:f}=he.useWoodlandLanguage(),g=r.useRef(null),[v,y]=at(n,[{type:Si}]),[b,h]=r.useState(t||u[0]);r.useEffect(()=>{h(t||u[0])},[t]);function I(D){h(D),i&&i(D)}const C=K(m||"sps-navbar-container","z-stratum-bar",o);return r.createElement("div",{className:C,...p,ref:g},r.createElement("nav",{className:K("sps-navbar","sps-navbar--expand-lg",a&&"sps-navbar--full-width")},c||l?r.createElement(r.Fragment,null,r.createElement("a",{className:"sps-navbar__brand",href:d,onClick:s},l&&r.createElement("img",{className:"sps-navbar__brand-logo",src:l,"aria-hidden":"true",alt:`${c} Logo`}),c&&r.createElement("span",{className:"sps-navbar__brand-name"},c)),r.createElement("span",{className:"sps-vertical-rule"})):null,r.createElement("div",{className:"sps-navbar__nav"},u.map(D=>r.createElement("a",{className:K("sps-nav__item","sps-nav__link",D===b&&"active"),key:D,onClick:()=>I(D)},r.createElement("span",null,D),D===b&&r.createElement("span",{className:"sr-only"},"(",f("productBar.current",{defaultValue:"current"}),")"))),v),r.createElement("div",{className:"sps-navbar__content"},r.createElement(rt.Provider,{value:{parentElementRef:g,fixed:!0}},y))))}Object.assign(Sm,{props:xC,displayName:"SpsProductBar"});const kC={basic:{label:"Basic",description:S.code`
|
|
11457
11457
|
<p>Product navigation bar</p>
|
|
11458
11458
|
`,examples:{basic:{react:S.code`
|
|
11459
11459
|
import { SpsProductBar, SpsButton } from "@spscommerce/ds-react";
|
|
@@ -11558,7 +11558,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
11558
11558
|
</SpsProductBar>
|
|
11559
11559
|
)
|
|
11560
11560
|
}
|
|
11561
|
-
`}}}},
|
|
11561
|
+
`}}}},MC={percentComplete:"number",title:"string",detail:"string",disabled:"boolean",onClose:"() => void"};function gm(e){const{children:t,className:n,detail:o,disabled:a,onClose:s,percentComplete:i=0,title:l,"data-testid":c,unsafelyReplaceClassName:d,...u}=e,{t:m}=he.useWoodlandLanguage(),p=K(d||"sps-progress-bar",i===1&&"sps-progress-bar--complete",a&&"sps-progress-bar--disabled",n);return r.createElement("div",{className:p,...u},r.createElement("div",{className:"sps-progress-bar__content"},l&&r.createElement("div",{className:"sps-progress-bar__heading"},r.createElement("div",{className:"sps-progress-bar__title"},l),r.createElement("div",{className:"sps-progress-bar__percentage"},`${Math.floor(i*100)}%`)),r.createElement("div",{className:"sps-progress-bar__bar-background"},r.createElement("div",{className:"sps-progress-bar__bar-progress",style:{width:`${i*100}%`}})),o&&r.createElement("div",{className:"sps-progress-bar__detail"},o)),s&&r.createElement("div",{className:"sps-progress-bar__close-button"},r.createElement(Ne,{kind:A.ButtonKind.ICON,icon:A.SpsIcon.X,onClick:s,title:m("progressBar.closeButtonTitle",{defaultValue:"Close progress bar"})})))}Object.assign(gm,{props:MC,displayName:"SpsProgressBar"});const LC={general:{label:"General Usage",customSection:()=>r.createElement(r.Fragment,null,r.createElement("h4",null,"General Usage"),r.createElement("p",null,"Progress Bars can be used in a variety of situations, but the most common use case is to show the live progress of a process such as a file upload or the processing of a digital payload."),r.createElement("p",null,"For processes that typically complete within minutes or less, opt for the Standard Progress Bar."),r.createElement("p",null,"For processes that are divided into specific steps that are accomplished over a longer period of time, opt for the Stepped Progress Bar."))},standard:{label:"Standard Progress Bar",description:()=>r.createElement(r.Fragment,null,r.createElement("p",null,"Standard Progress Bars are comprised of the following Required and Optional elements."),r.createElement("img",{src:"assets/images/progress-bar-example.svg",alt:"A Progress Bar with labels on each section",className:"w-100 mb-3"}),r.createElement(sn,null,r.createElement(Ht,null,r.createElement(Be,null,"Section"),r.createElement(Be,null,"Content Type"),r.createElement(Be,null,"Required"),r.createElement(Be,null,"Description/Guidelines")),r.createElement(Wt,null,r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"1")),r.createElement(re,null,"Title"),r.createElement(re,null,"No"),r.createElement(re,{wrap:400},"Use the Title when it provides necessary or helpful detail about the file or action that is being processed.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"2")),r.createElement(re,null,"Progress Meter"),r.createElement(re,null,"Yes"),r.createElement(re,null)),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"3")),r.createElement(re,null,"Progress Counter"),r.createElement(re,null,"No"),r.createElement(re,{wrap:400},"The Progress Counter should not be used without the existence of a Title.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"4")),r.createElement(re,null,"Clear Button"),r.createElement(re,null,"No"),r.createElement(re,{wrap:400},"If the process requires the option to be cancelled or removed from a list the clear button can be used.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"5")),r.createElement(re,null,"Progress Details"),r.createElement(re,null,"No"),r.createElement(re,{wrap:400},"Progress Details provide more context for the user and are especially useful when the process includes multiple steps."))))),examples:{standard:{label:"Building Standard Progress Bars",description:()=>r.createElement("p",null,"The Standard Progress Bar is designed to expand to fit the entire width of its container. View the diagram above for rules regarding including or excluding certain elements."),react:S.code`
|
|
11562
11562
|
import { SpsCard, SpsProgressBar } from "@spscommerce/ds-react";
|
|
11563
11563
|
function Component() {
|
|
11564
11564
|
function handleClose() {
|
|
@@ -11607,7 +11607,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
11607
11607
|
</SpsCard>
|
|
11608
11608
|
)
|
|
11609
11609
|
}
|
|
11610
|
-
`}}}},
|
|
11610
|
+
`}}}},_C={maxHeight:"string"};function hm(e){const{children:t,maxHeight:n}=e;return r.createElement("div",{className:"sps-scrollable-container",style:{maxHeight:n}},t)}Object.assign(hm,{props:_C,displayName:"SpsScrollableContainer"});const PC={channelId:{type:"string",required:!0}};function bm(e){const{channelId:t,className:n,unsafelyReplaceClassName:o,...a}=e,{t:s}=he.useWoodlandLanguage(),i=K(o||"sps-slack-link",n);return r.createElement("a",{className:i,target:"_blank",rel:"noreferrer",href:`https://spscommerce.slack.com/archives/${t}`,...a},r.createElement("i",{className:`sps-icon sps-icon-${A.SpsIcon.CONVERSATION}`,"aria-hidden":"true"}),r.createElement("span",null,s("slackLink.label",{defaultValue:"Chat"})))}Object.assign(bm,{props:PC,displayName:"SpsSlackLink"});const OC={basic:{examples:{basic:{react:S.code`
|
|
11611
11611
|
import { SpsProductBar, SpsSlackLink } from "@spscommerce/ds-react";
|
|
11612
11612
|
function DemoComponent() {
|
|
11613
11613
|
return (
|
|
@@ -11620,7 +11620,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
11620
11620
|
><SpsSlackLink channelId="CELEGDK4Y" /></SpsProductBar>
|
|
11621
11621
|
);
|
|
11622
11622
|
}
|
|
11623
|
-
`}}}},
|
|
11623
|
+
`}}}},BC={sortKey:"string",sortDisabled:"boolean",sort:"SortedColumn[]",onSortChange:"SortChangeHandler",widthPx:"number",widthRem:"number"};function gi({className:e,"data-testid":t,unsafelyReplaceClassName:n,sortKey:o,sort:a,sortDisabled:s,onSortChange:i,onClick:l,children:c,widthPx:d,widthRem:u,style:m,...p}){const f=r.useMemo(()=>{const b=!!o&&!s&&Array.isArray(a)&&a.find(h=>h.key===o);return b?b.direction:void 0},[a,o,s]),g=K(n||"sps-sorting-header__cell",f===A.SortDirection.ASCENDING&&"sps-sorting-header__cell--sorted-asc",f===A.SortDirection.DESCENDING&&"sps-sorting-header__cell--sorted-desc",s&&"sps-sorting-header__cell--sort-disabled",e),v=d?d/16:u,y=v?{...m,width:`${v}rem`}:m;return r.createElement("div",{className:g,onClick:b=>{o&&!s&&i&&i([{key:o,direction:f===A.SortDirection.ASCENDING?A.SortDirection.DESCENDING:A.SortDirection.ASCENDING}]),l&&l(b)},"data-testid":t,style:y,...p},c)}Object.assign(gi,{props:BC,displayName:"SpsSortingHeaderCell"});const RC={sort:"SortedColumn[]",onSortChange:"SortChangeHandler"};function vm({className:e,"data-testid":t,unsafelyReplaceClassName:n,sort:o,onSortChange:a,children:s,...i}){const l=K(n||"sps-sorting-header",e),c={sort:o,onSortChange:a};return r.createElement("div",{className:l,...i},r.Children.map(s,d=>d&&r.isValidElement(d)&&d.type===gi?r.cloneElement(d,c):d))}Object.assign(vm,{props:RC,displayName:"SpsSortingHeader"});const FC={basic:{label:"Basic Sorting Header",examples:{basic:{react:S.code`
|
|
11624
11624
|
import { SpsSortingHeader, SpsSortingHeaderCell } from "@spscommerce/ds-react";
|
|
11625
11625
|
function DemoComponent() {
|
|
11626
11626
|
const [sort, setSort] = React.useState([{ key: 'id', direction: SortDirection.DESCENDING }]);
|
|
@@ -11668,7 +11668,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
11668
11668
|
</>
|
|
11669
11669
|
)
|
|
11670
11670
|
}
|
|
11671
|
-
`}}}},
|
|
11671
|
+
`}}}},AC={title:"string",stepsCount:"number",completedStepsCount:"number",disabled:"boolean",showStepsCounter:"boolean",color:"SteppedProgressBarColor",data:"SteppedProgressBarData[]"};function ym(e){const{title:t,stepsCount:n,completedStepsCount:o=0,disabled:a,showStepsCounter:s,className:i,data:l,color:c=A.SteppedProgressBarColor.PURPLE}=e,d=Array.from(Array(n)).map((m,p)=>({id:Rt().current||void 0,...l?.find(f=>f.index===p)})),u=K("sps-stepped-progress-bar",`sps-stepped-progress-bar--${c}`,o===n&&"sps-stepped-progress-bar--complete",a&&"sps-stepped-progress-bar--disabled",i);return r.createElement("div",{className:u},r.createElement("div",{className:"sps-stepped-progress-bar__content"},(t||s)&&r.createElement("div",{className:"sps-progress-bar__heading"},t&&r.createElement("div",{className:"sps-progress-bar__title"},t),s&&r.createElement("div",{className:"sps-stepped-progress-bar__percentage"},`${o} of ${n} Complete`)),r.createElement("ul",{className:"sps-stepped-progress-bar__bar-background d-flex align-items-center list-unstyled mb-0"},d.map((m,p)=>r.createElement("li",{id:m.id,key:m.id,className:K("sps-stepped-progress-bar__step",o>p&&!m.skipped&&"sps-stepped-progress-bar__step-complete")},m.icon&&r.createElement(ht,{icon:m.icon,size:A.SpsIconSize.SMALL,className:K("d-block",(m.index||0)>o-1?"gray400":"white")}),m.title&&m.id&&r.createElement(ct,{for:m.id,title:m.title},m.description))))))}Object.assign(ym,{props:AC,displayName:"SpsSteppedProgressBar"});const $C={standard:{label:"Stepped Progress Bar",description:()=>r.createElement(r.Fragment,null,r.createElement("p",null,"Stepped Progress Bars are comprised of the following Required and Optional elements."),r.createElement("img",{src:"assets/images/stepped-progress-bar-example.svg",alt:"A Progress Bar with labels on each section",className:"w-100 mb-3"}),r.createElement(sn,null,r.createElement(Ht,null,r.createElement(Be,null,"Section"),r.createElement(Be,null,"Content Type"),r.createElement(Be,null,"Required"),r.createElement(Be,null,"Description/Guidelines")),r.createElement(Wt,null,r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"1")),r.createElement(re,null,"Title"),r.createElement(re,null,"No"),r.createElement(re,{wrap:400},"Use the Title when it provides necessary or helpful detail about the file or action that is being processed.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"2")),r.createElement(re,null,"Progress Meter"),r.createElement(re,null,"Yes"),r.createElement(re,null)),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"3")),r.createElement(re,null,"Progress Counter"),r.createElement(re,null,"No"),r.createElement(re,{wrap:400},"The Progress Counter should not be used without the existence of a Title.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"4")),r.createElement(re,null,"Step icons"),r.createElement(re,null,"No"),r.createElement(re,{wrap:400},"Icons can be set inside of steps for visual emphasis.")),r.createElement(De,null,r.createElement(re,null,r.createElement("span",{className:"sps-tag sps-tag--info"},"5")),r.createElement(re,null,"Step Tooltips"),r.createElement(re,null,"No"),r.createElement(re,{wrap:400},"Tooltips can be utilized to provide more details about each specific step. Tooltips can be exposed on click or hover."))))),examples:{standard:{description:()=>r.createElement(r.Fragment,null,r.createElement("h4",null,"Building Stepped Progress Bars"),r.createElement("p",null,"The Stepped Progress Bar is designed to expand to fit the entire width of its container. View the diagram above for rules regarding including or excluding certain elements.")),react:S.code`
|
|
11672
11672
|
import { SpsCard, SpsSteppedProgressBar } from "@spscommerce/ds-react";
|
|
11673
11673
|
function Component() {
|
|
11674
11674
|
const data = [
|
|
@@ -11764,7 +11764,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
11764
11764
|
</SpsCard>
|
|
11765
11765
|
)
|
|
11766
11766
|
}
|
|
11767
|
-
`}}}},
|
|
11767
|
+
`}}}},VC={href:"string",icon:{type:"ReactNodeOrRenderFn",required:"true"},error:"boolean",errorIcon:"ReactNodeOrRenderFn",title:{type:"string",required:"true"},warning:"boolean",warningIcon:"ReactNodeOrRenderFn",disabled:"boolean",tagElement:"ReactNodeOrRenderFn"};function Em(e){const{className:t,href:n,target:o,icon:a,error:s=!1,errorIcon:i,title:l,unsafelyReplaceClassName:c,warning:d=!1,warningIcon:u,disabled:m=!1,tagElement:p,...f}=e,g=K(c||"sps-tile",t,s&&"sps-tile--error",d&&"sps-tile--warning",m&&"sps-tile--disabled");return r.useEffect(()=>{if(d&&s)throw new Error("Tile should have warning or error, not both")},[d,s]),r.createElement("div",{className:"sps-tile-container sfg-col-3 sfg-break-col-6"},r.createElement("a",{className:g,href:m?void 0:n,target:o,rel:o==="_blank"?"noopener noreferrer":void 0,...f},(d||s)&&r.createElement("div",{className:"sps-tile--icon"},d&&(u?qe(u):r.createElement("i",{className:K("sps-icon","sps-icon-status-warning")})),s&&(i?qe(i):r.createElement("i",{className:K("sps-icon","sps-icon-ban")}))),p&&r.createElement("div",{className:"sps-tile--tag"},qe(p)),r.createElement("div",{className:"sps-tile--content"},r.createElement("div",{className:"sps-tile--image"},typeof a=="string"?r.createElement("img",{className:"sps-tile--image",src:a,alt:""}):qe(a)),r.createElement("div",{className:"sps-tile--title"},r.createElement("p",null,l,o==="_blank"&&r.createElement("i",{className:K("sps-icon","sps-icon-tabs")}))))))}Object.assign(Em,{props:VC,displayName:"SpsTile"});const KC={};function Tm(e){const{children:t,unsafelyReplaceClassName:n,"data-testid":o,className:a,...s}=e,i=K(n||"sps-tile-list",a||"sfg-row");return r.createElement("div",{className:i,"data-testid":o,...s},t)}Object.assign(Tm,{props:KC,displayName:"SpsTileList"});const HC={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
11768
11768
|
import { SpsTileList, SpsTile } from "@spscommerce/ds-react";
|
|
11769
11769
|
function Component() {
|
|
11770
11770
|
const apps = [
|
|
@@ -11966,7 +11966,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
11966
11966
|
</>
|
|
11967
11967
|
)
|
|
11968
11968
|
}
|
|
11969
|
-
`}}}},
|
|
11969
|
+
`}}}},WC={value:{type:"number",required:"true"},title:{type:"string",required:"true"},kind:"SpsFilterTileKind",active:"boolean"};function wm(e){const{value:t,title:n,kind:o=A.SpsFilterTileKind.GENERAL,active:a,className:s,unsafelyReplaceClassName:i,...l}=e,[c,d]=r.useState(!1),u=a||c,m=K(i||"sps-filter-tile",s,`sps-filter-tile--${o}`,u&&"active");return r.createElement("div",{className:m,...l},r.createElement("div",{className:"sps-filter-tile__body",onMouseOver:()=>d(!0),onMouseOut:()=>d(!1)},r.createElement("div",{className:"sps-filter-tile__body__value"},t),r.createElement("div",{className:"sps-filter-tile__body__title"},n)),r.createElement("div",{className:"sps-filter-tile__footer"}))}Object.assign(wm,{props:WC,displayName:"SpsFilterTile"});const GC={};function Cm(e){const{children:t,unsafelyReplaceClassName:n,"data-testid":o,className:a,...s}=e,i=K(n||"sps-filter-tile-list",a);return r.createElement("div",{className:i,...s},t)}Object.assign(Cm,{props:GC,displayName:"SpsFilterTileList"});const UC={basic:{label:"Basic",examples:{basic:{react:S.code`
|
|
11970
11970
|
import {
|
|
11971
11971
|
SpsFilterTileList,
|
|
11972
11972
|
SpsFilterTile,
|
|
@@ -12022,7 +12022,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
12022
12022
|
</>
|
|
12023
12023
|
)
|
|
12024
12024
|
}
|
|
12025
|
-
`}}}},
|
|
12025
|
+
`}}}},Dm={};function hi(e){const{className:t,...n}=e,o=K("sps-vertical-rule",t);return r.createElement("div",{className:o,...n})}Object.assign(hi,{props:Dm,displayName:"SpsVerticalRule / SpsVr"});function Nm(e){return r.createElement(hi,{...e})}Object.assign(Nm,{props:Dm,displayName:"SpsDescriptionListTerm / SpsDt"});const zC={illustration:"string",icon:{type:"SpsIcon",deprecated:!0},heading:"ReactNodeOrRenderFn",subHeading:"ReactNodeOrRenderFn"};function Im(e){const{className:t,heading:n,icon:o,illustration:a=bi.BUILDING_SMALL,subHeading:s,"data-testid":i,unsafelyReplaceClassName:l,...c}=e,d=K(l||"sps-zero-state","sps-zero-state--micro",t);return r.createElement("div",{className:d,"data-testid":`${i}__actual-micro-zero-state`,...c},o?r.createElement("i",{className:`sps-zero-state__icon sps-icon sps-icon-${o}`,"aria-hidden":"true","data-testid":`${i}__icon`}):r.createElement("img",{style:{height:"3rem"},src:a}),n&&r.createElement("h1",{className:"sps-zero-state__heading","data-testid":`${i}__heading`},n),s&&r.createElement("h2",{className:"sps-zero-state__subheading","data-testid":`${i}__subheading`},s))}Object.assign(Im,{props:zC,displayName:"SpsMicroZeroState"});const jC={illustration:"string",artwork:{type:"string",deprecated:!0},heading:{type:"string",required:!0},subHeading:"string"};function xm(e){const{artwork:t,children:n,className:o,heading:a,illustration:s,subHeading:i,"data-testid":l,unsafelyReplaceClassName:c,...d}=e,u=s||t||bi.BUILDING_LARGE,m=K(c||"sps-zero-state",o);return r.createElement("div",{className:"sps-card__body","data-testid":`${l}`},r.createElement("div",{className:m,"data-testid":`${l}__actual-zero-state`,...d},r.createElement("img",{className:"sps-zero-state__image",src:u,alt:"","data-testid":`${l}__artwork`}),r.createElement("h1",{className:"sps-zero-state__heading","data-testid":`${l}__heading`},a),r.createElement("h2",{className:"sps-zero-state__subheading","data-testid":`${l}__subheading`},i),r.createElement("div",{className:"sps-zero-state__content","data-testid":`${l}__content`},n)))}Object.assign(xm,{props:jC,displayName:"SpsZeroState"});const YC={sizes:{label:"Sizes",customSection:()=>r.createElement("section",{id:"zero-states-sizes"},r.createElement("div",{className:"flex-color-header"},r.createElement("h4",null,"Sizes"),r.createElement(Ne,{onClick:()=>{window.scrollTo({top:0,behavior:"smooth"})},kind:A.ButtonKind.LINK},"Back to Top")),r.createElement("h5",{className:"mb-3"},"There are 2 sizes of Zero States: Large and Small. They differ in appearance and are used in different cases."),r.createElement("h4",null,"Large Zero States"),r.createElement("h5",{className:"mb-3"},"Use Large Zero States in primary or large areas of a page."),r.createElement("h4",null,"Small Zero States"),r.createElement("h5",{className:"mb-0"},"Use Small Zero States in a secondary or small areas of a page."))},regular:{label:"Usage: Large Zero States",description:({NavigateTo:e})=>r.createElement("span",{className:"sps-body-14 mt-4"},"Large Zero States may be accompanied by other components such as Headings, Subtitles, ",r.createElement(e,{to:"Button"},"Buttons"),","," ",r.createElement(e,{to:"List Toolbar"},"Search Bars"),", or a combination of these"),examples:{illustrationAndHeading:{description:"Illustration + Heading",imports:S.code`
|
|
12026
12026
|
import { SpsCard, SpsZeroState } from "@spscommerce/ds-react";
|
|
12027
12027
|
import { Illustrations } from "@sps-woodland/illustrations";
|
|
12028
12028
|
`,jsx:S.code`
|
|
@@ -12136,4 +12136,4 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
|
|
|
12136
12136
|
</SpsCard>
|
|
12137
12137
|
</div>
|
|
12138
12138
|
</div>
|
|
12139
|
-
`}}}};x.AsTypingErrorKeys=un,x.ContentOrderExample=
|
|
12139
|
+
`}}}};x.AsTypingErrorKeys=un,x.ContentOrderExample=pm,x.DEFAULT_DATETIME_PRESETS=Od,x.DEFAULT_PRESETS=ns,x.DragDropContext=ed,x.Draggable=ud,x.Droppable=qa,x.FauxChangeEvent=Lt,x.MANIFEST=qE,x.ModalAction=um,x.OnBlurErrorKeys=Ze,x.OnSubmitErrorKeys=ho,x.PortalContext=rt,x.PreventativeErrorKeys=wt,x.Provide=Fi,x.SimpleDateUtils=j,x.SpsAddRemoveFormRowExamples=by,x.SpsAdvancedSearch=tm,x.SpsAdvancedSearchExamples=Jw,x.SpsApp=uf,x.SpsAutocomplete=Nt,x.SpsAutocompleteExamples=Ki,x.SpsButton=Ne,x.SpsButtonExamples=SE,x.SpsButtonGroup=pp,x.SpsCard=Xa,x.SpsCardTabbedPane=Ja,x.SpsCardV2=Qu,x.SpsCardV2Footer=ii,x.SpsCardV2Header=li,x.SpsCardV2Title=em,x.SpsCheckbox=Jt,x.SpsCheckboxDropdown=ss,x.SpsCheckboxExamples=Hi,x.SpsClickableTag=Vn,x.SpsClickableTagExamples=Wi,x.SpsColumnChooser=Qa,x.SpsColumnChooserColumn=qo,x.SpsColumnChooserExamples=hd,x.SpsConditionalField=_s,x.SpsConditionalFieldExamples=Wp,x.SpsContentRow=es,x.SpsContentRowCol=nn,x.SpsContentRowExamples=bd,x.SpsContentRowExpansion=Jo,x.SpsContextBar=Xw,x.SpsCurrencyInput=nm,x.SpsCurrencyInputExamples=tC,x.SpsDateRangePicker=os,x.SpsDateRangePickerExamples=Md,x.SpsDateTime=as,x.SpsDateTimeRangePicker=rs,x.SpsDateTimeRangePickerExamples=Rd,x.SpsDatepicker=ts,x.SpsDatepickerExamples=Id,x.SpsDatetimeExamples=Fd,x.SpsDd=Kd,x.SpsDescriptionList=tr,x.SpsDescriptionListDefinition=nr,x.SpsDescriptionListExamples=zd,x.SpsDescriptionListTerm=rr,x.SpsDl=$d,x.SpsDropdown=an,x.SpsDropdownExamples=jd,x.SpsDt=Ud,x.SpsFeedbackBlock=Is,x.SpsFeedbackBlockExamples=$E,x.SpsFieldset=is,x.SpsFieldsetExamples=Yd,x.SpsFilterPanel=xs,x.SpsFilterPanelCap=Ms,x.SpsFilterPanelExamples=Hp,x.SpsFilterPanelFilterBox=Ls,x.SpsFilterPanelSection=ks,x.SpsFilterTile=wm,x.SpsFilterTileList=Cm,x.SpsFilterTileListExamples=UC,x.SpsFocusedTask=di,x.SpsFocusedTaskActions=ci,x.SpsFocusedTaskExamples=rC,x.SpsForm=so,x.SpsFormArrayMeta=ki,x.SpsFormComponentWrapper=Le,x.SpsFormExamples=gd,x.SpsFormFieldMeta=On,x.SpsFormGroupMeta=xi,x.SpsFormMetaBase=Yt,x.SpsFormSetMeta=qt,x.SpsGrowler=pi,x.SpsGrowlerExamples=iC,x.SpsI=ht,x.SpsIconButtonPanel=up,x.SpsIncrementor=ls,x.SpsIncrementorExamples=qd,x.SpsInputGroup=In,x.SpsInsightTile=om,x.SpsInsights=lC,x.SpsKeyValueList=rm,x.SpsKeyValueListItem=am,x.SpsKeyValueTag=sm,x.SpsKeyValueTagExamples=mC,x.SpsLabel=cs,x.SpsLabelExamples=Jd,x.SpsListActionBar=ds,x.SpsListActionBarExamples=fp,x.SpsListToolbar=cm,x.SpsListToolbarExamples=EC,x.SpsListToolbarSearch=mi,x.SpsListToolbarSearchInfo=fi,x.SpsListToolbarSortBy=dm,x.SpsLocaleProvider=Ky,x.SpsMicroBlock=ps,x.SpsMicroBlockExamples=Sp,x.SpsMicroZeroState=Im,x.SpsModal=us,x.SpsModalExamples=hp,x.SpsModalFooter=sr,x.SpsMultiSelect=fs,x.SpsMultiSelectExamples=bp,x.SpsMultiValueTextInput=Ps,x.SpsMultiValueTextInputExamples=zp,x.SpsPageSelector=ir,x.SpsPageSubtitle=fm,x.SpsPageTitle=mm,x.SpsPageTitleExamples=NC,x.SpsPagination=Ss,x.SpsPaginationExamples=vp,x.SpsProductBar=Sm,x.SpsProductBarExamples=kC,x.SpsProductBarTab=Si,x.SpsProgressBar=gm,x.SpsProgressBarExamples=LC,x.SpsProgressRing=Cs,x.SpsRadioButton=gs,x.SpsRadioButtonExamples=yp,x.SpsScrollableContainer=hm,x.SpsSearchResultsBar=lm,x.SpsSearchResultsBarExamples=gC,x.SpsSearchResultsBarV2=ui,x.SpsSelect=on,x.SpsSelectExamples=Ld,x.SpsSideNav=Tp,x.SpsSideNavExamples=wp,x.SpsSlackLink=bm,x.SpsSlackLinkExamples=OC,x.SpsSlideInPanel=ms,x.SpsSlideInPanelExamples=gp,x.SpsSortingHeader=vm,x.SpsSortingHeaderCell=gi,x.SpsSortingHeaderExamples=FC,x.SpsSpinner=Ar,x.SpsSplitButton=hs,x.SpsSplitButtonExamples=Cp,x.SpsSteppedProgressBar=ym,x.SpsSteppedProgressBarExamples=$C,x.SpsSummaryListColumn=vs,x.SpsSummaryListExamples=Dp,x.SpsSummaryListExpansion=co,x.SpsSummaryListRow=bs,x.SpsTab=Uu,x.SpsTabPanel=zu,x.SpsTable=sn,x.SpsTableBody=Wt,x.SpsTableCell=re,x.SpsTableExamples=mp,x.SpsTableHead=Ht,x.SpsTableHeader=Be,x.SpsTableRow=De,x.SpsTabsV2=si,x.SpsTag=gt,x.SpsTagExamples=bE,x.SpsTaskQueue=ys,x.SpsTaskQueueExamples=Np,x.SpsTbody=lp,x.SpsTd=dp,x.SpsTextInput=cr,x.SpsTextInputExamples=Ip,x.SpsTextarea=Es,x.SpsTextareaExamples=xp,x.SpsTh=np,x.SpsThead=rp,x.SpsTile=Em,x.SpsTileList=Tm,x.SpsTileListExamples=HC,x.SpsTimeInput=Os,x.SpsTimeInputExamples=Yp,x.SpsToggle=Ts,x.SpsToggleExamples=Mp,x.SpsTooltip=ct,x.SpsTooltipExamples=Lp,x.SpsTooltipTitle=ws,x.SpsTr=sp,x.SpsValidators=vo,x.SpsVerticalRule=hi,x.SpsVr=Nm,x.SpsWf=Pp,x.SpsWfDoc=Rp,x.SpsWfDs=Ap,x.SpsWfStep=Vp,x.SpsWizardExamples=Op,x.SpsWizardSidebar=Ds,x.SpsWizardSubstep=Ns,x.SpsWorkflow=dr,x.SpsWorkflowDocument=pr,x.SpsWorkflowDocumentStatus=ur,x.SpsWorkflowExamples=Kp,x.SpsWorkflowStep=mr,x.SpsZeroState=xm,x.SpsZeroStateExamples=YC,x.TooltipVisibility=ge,x.ValidationMode=Ct,x.addOnChangeErrorKey=wi,x.addOnSubmitErrorKey=Ci,x.bindProps=pf,x.contentOf=qe,x.date=Pn,x.dateConstraint=Ii,x.dateRange=Ni,x.findParentBranches=lr,x.flipPosition=$r,x.formArray=my,x.formControl=fy,x.formGroup=Sy,x.getMember=Za,x.getPosition=Sn,x.letterAndNumberKeys=Vr,x.resetServerContext=uv,x.selectChildren=at,x.setDateFormat=Di,x.toggleTooltipState=or,x.useCheckDeprecatedProps=Ai,x.useColumnCellResizer=ep,x.useColumnHeaderResizer=Qd,x.useCustomValidator=Xm,x.useDidUpdateEffect=Kr,x.useDocumentEventListener=Hr,x.useElementId=Rt,x.useForm=gy,x.useGrowlers=sC,x.useInputPopup=bn,x.useKeyboardSensor=Yc,x.useModals=TC,x.useMouseSensor=jc,x.usePatchReducer=Dt,x.usePortal=gn,x.useServerSideValidation=hy,x.useSpsAction=wC,x.useSpsForm=Mi,x.useSpsLocale=io,x.useTouchSensor=qc,x.validate=yo,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
|