PageSourceSearch

https://lms.nobeluniversity.edu/dist/webpack-production/theme_editor-c-9553a62f8f.js

js nobeluniversity.edu collected 2026-10-04 05:21:40 UTC 53,517 bytes, 556 lines download raw bytes

1(globalThis["webpackChunkcanvas_lms"]=globalThis["webpackChunkcanvas_lms"]||[]).push([[12258,10868],{26514:(e,t,a)=>{"use strict"
2a.d(t,{A:()=>g})
3var n=a(67294)
4var o=a(42342)
5var i=a(45697)
6var s=a.n(i)
7var r=a(71070)
8const l={expanded:(0,r.C)(s().bool,"onToggle","defaultExpanded"),defaultExpanded:s().bool,onToggle:s().func,children:s().func,render:s().func}
9const d=["expanded","defaultExpanded","onToggle","children","render"]
10var u=a(61337)
11var h,c,p
12const m=({expanded:e})=>({expanded:!e})
13let g=(h=(0,u.L)(),h(c=(p=class extends n.Component{constructor(e){super(e)
14this._contentId=void 0
15this.handleToggle=e=>{this.isControlled()||this.setState(m)
16this.props.onToggle(e,!this.expanded)}
17this.state={expanded:this.isControlled(e)?e.expanded:e.defaultExpanded}
18this._contentId=e.deterministicId()}get expanded(){return this.isControlled()?this.props.expanded:this.state.expanded}isControlled(e=this.props){return"boolean"===typeof e.expanded}static getDerivedStateFromProps(e,t){return"boolean"===typeof e.expanded&&e.expanded!==t.expanded?{expanded:e.expanded}:null}render(){const e=this.props,t=e.children,a=e.render,n=void 0===a?t:a
19return"function"===typeof n?n({expanded:this.expanded,getToggleProps:(e={})=>({"aria-controls":this._contentId,"aria-expanded":this.expanded,onClick:(0,o.b)(this.handleToggle,e.onClick),...e}),getDetailsProps:()=>({id:this._contentId})}):null}},p.displayName="Expandable",p.propTypes=l,p.allowedProps=d,p.defaultProps={defaultExpanded:false,onToggle:function(){},children:null},p))||c)},46058:(e,t,a)=>{"use strict"
20a.d(t,{H:()=>s})
21var n=a(67294)
22var o=a(23875)
23var i
24class s extends n.Component{constructor(...e){super(...e)
25this.ref=null
26this.handleRef=e=>{const t=this.props.elementRef
27this.ref=e
28"function"===typeof t&&t(e)}}render(){return n.createElement(o.q,Object.assign({},this.props,{name:"IconArrowOpenDown",viewBox:"0 0 1920 1920",elementRef:this.handleRef}),i||(i=n.createElement("path",{d:"m.08 568.063 176.13-176.13 783.988 783.864 783.74-783.864 176.129 176.13-959.87 960.118z",fillRule:"evenodd"})))}}s.glyphName="arrow-open-down"
29s.variant="Solid"
30s.displayName="IconArrowOpenDownSolid"
31s.propTypes={...o.q.propTypes}
32s.allowedProps=[...o.q.allowedProps]},37285:(e,t,a)=>{"use strict"
33a.d(t,{g:()=>s})
34var n=a(67294)
35var o=a(23875)
36var i
37class s extends n.Component{constructor(...e){super(...e)
38this.ref=null
39this.handleRef=e=>{const t=this.props.elementRef
40this.ref=e
41"function"===typeof t&&t(e)}}render(){return n.createElement(o.q,Object.assign({},this.props,{name:"IconArrowOpenEnd",viewBox:"0 0 1920 1920",elementRef:this.handleRef,bidirectional:true}),i||(i=n.createElement("path",{d:"M568.13.012 392 176.142l783.864 783.989L392 1743.87 568.13 1920l960.118-959.87z",fillRule:"evenodd"})))}}s.glyphName="arrow-open-end"
42s.variant="Solid"
43s.displayName="IconArrowOpenEndSolid"
44s.propTypes={...o.q.propTypes}
45s.allowedProps=[...o.q.allowedProps]},71602:(e,t,a)=>{"use strict"
46a.d(t,{W:()=>s})
47var n=a(67294)
48var o=a(23875)
49var i
50class s extends n.Component{constructor(...e){super(...e)
51this.ref=null
52this.handleRef=e=>{const t=this.props.elementRef
53this.ref=e
54"function"===typeof t&&t(e)}}render(){return n.createElement(o.q,Object.assign({},this.props,{name:"IconArrowOpenUp",viewBox:"0 0 1920 1920",elementRef:this.handleRef}),i||(i=n.createElement("path",{d:"m.08 1351.937 176.13 176.13 783.988-783.864 783.74 783.864 176.129-176.13-959.87-960.118z",fillRule:"evenodd"})))}}s.glyphName="arrow-open-up"
55s.variant="Solid"
56s.displayName="IconArrowOpenUpSolid"
57s.propTypes={...o.q.propTypes}
58s.allowedProps=[...o.q.allowedProps]},10868:(e,t,a)=>{"use strict"
59a.d(t,{z:()=>N})
60var n=a(67294)
61var o=a(85394)
62var i=a(37285)
63var s=a(46058)
64var r=a(26514)
65var l=a(50641)
66var d=a(88472)
67var u=a(69505)
68var h=a(16121)
69var c=a(11493)
70var p=a(70917)
71const m=p.F4`
72  to {
73    opacity: 1;
74  }`
75const g=(e,t,a)=>{const n=t.fluidWidth,o=t.iconPosition,i=t.size,s=t.variant
76const r=a.animate
77const l="end"===o&&("filled"===s||n)
78const d=n?{display:"block",width:"100%"}:{}
79const u={start:{marginInlineEnd:e.iconMargin,marginInlineStart:0},end:{marginInlineStart:e.iconMargin,marginInlineEnd:0}}
80const h={small:{fontSize:e.fontSizeSmall},medium:{fontSize:e.fontSizeMedium},large:{fontSize:e.fontSizeLarge}}
81const c={small:{fontSize:e.smallIconSize},medium:{fontSize:e.mediumIconSize},large:{fontSize:e.largeIconSize}}
82const p="start"!==o||n?{small:{},medium:{},large:{}}:{small:{paddingInlineStart:`calc(${e.smallIconSize} + ${e.togglePadding})`,paddingInlineEnd:"0"},medium:{paddingInlineStart:`calc(${e.mediumIconSize} + ${e.togglePadding})`,paddingInlineEnd:"0"},large:{paddingInlineStart:`calc(${e.largeIconSize} + ${e.togglePadding})`,paddingInlineEnd:"0"}}
83return{toggleDetails:{label:"toggleDetails",fontFamily:e.fontFamily,fontWeight:e.fontWeight,lineHeight:e.lineHeight},summary:{label:"toggleDetails__summary",position:"relative",display:"flex",alignItems:"center",boxSizing:"border-box",textAlign:"start"},summaryText:{label:"toggleDetails__summaryText",minWidth:"0.0625rem",flexGrow:1,...l?{flex:1}:{}},toggle:{label:"toggleDetails__toggle",fontFamily:e.fontFamily,appearance:"none",cursor:"pointer",userSelect:"none",touchAction:"manipulation",position:"relative",overflow:"visible",boxSizing:"border-box",padding:"0",margin:"0",outline:"none",border:"none",background:"transparent",color:e.textColor,"&::-moz-focus-inner":{padding:"0",margin:"0"},"&::before":{content:'""',position:"absolute",top:"-0.375rem",left:"-0.375rem",right:"-0.375rem",bottom:"-0.375rem",border:`${e.toggleBorderWidth} ${e.toggleBorderStyle} ${e.toggleFocusBorderColor}`,borderRadius:`calc(${e.toggleBorderRadius} * 1.5)`,opacity:0,pointerEvents:"none"},"&:focus":{"&::before":{opacity:1}},"&:focus, &:hover,  &:active":{textDecoration:"none",color:e.textColor},textDecoration:"none",...d,...h[i]},icon:{label:"toggleDetails__icon","& >
83 svg":{display:"block"},...u[o],...c[i]},details:{label:"toggleDetails__details",boxSizing:"border-box",paddingTop:e.togglePadding,color:e.textColor,...h[i],...p[i]},content:r?{label:"toggleDetails__content",opacity:.01,animationName:m,animationFillMode:"forwards",animationDuration:".3s"}:{}}}
84const v=g
85const f=e=>{const t=e.colors,a=e.spacing,n=e.borders,o=e.typography,i=e.key
86const s={canvas:{toggleFocusBorderColor:e["ic-brand-primary"],iconColor:e["ic-brand-font-color-dark"],textColor:e["ic-brand-font-color-dark"]}}
87const r={fontFamily:null===o||void 0===o?void 0:o.fontFamily,fontWeight:null===o||void 0===o?void 0:o.fontWeightNormal,lineHeight:null===o||void 0===o?void 0:o.lineHeight,textColor:null===t||void 0===t?void 0:t.textDarkest,fontSizeSmall:null===o||void 0===o?void 0:o.fontSizeSmall,fontSizeMedium:null===o||void 0===o?void 0:o.fontSizeMedium,fontSizeLarge:null===o||void 0===o?void 0:o.fontSizeLarge,smallIconSize:"0.5rem",mediumIconSize:"0.75rem",largeIconSize:"1rem",iconMargin:null===a||void 0===a?void 0:a.xxSmall,iconColor:null===t||void 0===t?void 0:t.textDarkest,togglePadding:null===a||void 0===a?void 0:a.xxSmall,toggleBorderRadius:null===n||void 0===n?void 0:n.radiusMedium,toggleBorderWidth:null===n||void 0===n?void 0:n.widthMedium,toggleBorderStyle:null===n||void 0===n?void 0:n.style,toggleFocusBorderColor:null===t||void 0===t?void 0:t.borderBrand,filledBackgroundColor:null===t||void 0===t?void 0:t.backgroundLight,filledBorderWidth:null===n||void 0===n?void 0:n.widthSmall,filledBorderStyle:null===n||void 0===n?void 0:n.style,filledBorderColor:null===t||void 0===t?void 0:t.borderMedium,filledBorderRadius:null===n||void 0===n?void 0:n.radiusMedium,filledPadding:null===a||void 0===a?void 0:a.small}
88return{...r,...s[i]}}
89const b=f
90var _=a(45697)
91var y=a.n(_)
92var S=a(71070)
93const C={variant:y().oneOf(["default","filled"]),summary:y().node.isRequired,expanded:(0,S.C)(y().bool,"onToggle","defaultExpanded"),defaultExpanded:y().bool,onToggle:y().func,icon:y().func,iconExpanded:y().func,iconPosition:y().oneOf(["start","end"]),fluidWidth:y().bool,children:y().node,size:y().oneOf(["small","medium","large"])}
94const w=["variant","summary","expanded","defaultExpanded","onToggle","icon","iconExpanded","iconPosition","fluidWidth","children","size"]
95var T,Z,x,I
96let N=(T=(0,c.w)(v,b),Z=(0,h.j)(),T(x=Z(x=(I=class e extends n.Component{constructor(...e){super(...e)
97this.ref=null
98this._button=null
99this.getButtonRef=e=>this._button=e
100this.handleToggle=(e,t)=>{var a,n
101"function"===typeof this.props.onToggle&&this.props.onToggle(e,t)
102null===(a=(n=this.props).makeStyles)||void 0===a||a.call(n,{animate:true})}}get focused(){return(0,u.H)(this._button)}focus(){var e
103null===(e=this._button)||void 0===e||e.focus()}componentDidMount(){var e,t
104null===(e=(t=this.props).makeStyles)||void 0===e||e.call(t,{animate:false})}componentDidUpdate(){var e,t
105null===(e=(t=this.props).makeStyles)||void 0===e||e.call(t,{animate:true})}renderSummary(e){var t,a
106const n=this.props,o=n.summary,i=n.iconPosition
107return(0,p.tZ)("span",{css:null===(t=this.props.styles)||void 0===t?void 0:t.summary},"start"===i&&this.renderIcon(e),(0,p.tZ)("span",{css:null===(a=this.props.styles)||void 0===a?void 0:a.summaryText},o),"end"===i&&this.renderIcon(e))}renderToggle(t,a){const n=this.props.variant
108const i={...(0,l.c)(this.props,e.allowedProps),...t,children:this.renderSummary(a)}
109const s=this.renderSummary(a)
110if("filled"===n)return(0,p.tZ)(o.z,Object.assign({},i,{display:"block",textAlign:"start",elementRef:this.getButtonRef}),s)
111if(i.href){var r
112return(0,p.tZ)("a",Object.assign({},i,{css:null===(r=this.props.styles)||void 0===r?void 0:r.toggle,ref:this.getButtonRef}),s)}var d
113return(0,p.tZ)("button",Object.assign({},i,{type:"button",css:null===(d=this.props.styles)||void 0===d?void 0:d.toggle,ref:this.getButtonRef}),s)}renderIcon(e){var t
114const a=e?this.props.iconExpanded:this.props.icon
115return this.props.children&&a?(0,p.tZ)("span",{css:null===(t=this.props.styles)||void 0===t?void 0:t.icon},(0,p.tZ)(a,null)):null}renderDetails(e,t){var a
116const n=this.props.children
117const o=e?{display:"block"}:{display:"none"}
118return(0,p.tZ)("div",Object.assign({},t,{css:[null===(a=this.props.styles)||void 0===a?void 0:a.details,o]}),n&&e&&this.renderContent())}renderContent(){var e
119return(0,p.tZ)("div",{css:null===(e=this.props.styles)||void 0===e?void 0:e.content},this.props.children)}render(){return(0,p.tZ)(r.A,Object.assign({},(0,d.H)(this.props,r.A.allowedProps),{onToggle:this.handleToggle}),(({expanded:e,getToggleProps:t,getDetailsProps:a})=>{var n
120return(0,p.tZ)("div",{css:null===(n=this.props.styles)||void 0===n?void 0:n.toggleDetails,ref:e=>{this.ref=e}},this.renderToggle(t(),e),this.renderDetails(e,a()))}))}},I.displayName="ToggleDetails",I.componentId="ToggleDetails",I.allowedProps=w,I.propTypes=C,I.defaultProps={variant:"default",size:"medium",fluidWidth:false,icon:i.g,iconExpanded:s.H,iconPosition:"start",defaultExpanded:false,children:null},I))||x)||x)},44712:(e,t,a)=>{"use strict"
121a.r(t)
122a(27959)
123var n=a(67294)
124var o=a(73935)
125var i=a(63056)
126var s=a(61323)
127var r=a(6507)
128var l=a.n(r)
129var d=a(96486)
130var u=a.n(d)
131var h=a(83624)
132var c=a(82608)
133a(78547)
134var p=a(24552)
135var m=a(60564)
136const g=(0,s.useScope)("theme_editor")
137class v extends n.Component{constructor(){super()
138this.save=()=>{const e=!!(this.props.sharedBrandConfigBeingEdited&&this.props.sharedBrandConfigBeingEdited.id)
139const t={brand_config_md5:this.props.brandConfigMd5}
140let a,n
141if(e){a=`/api/v1/accounts/${this.props.accountID}/shared_brand_configs/${this.props.sharedBrandConfigBeingEdited.id}`
142n="PUT"}else{if(!this.state.newThemeName){this.setState({modalIsOpen:true})
143return}t.name=this.state.newThemeName
144a=`/api/v1/accounts/${this.props.accountID}/shared_brand_configs`
145n="POST"}return l().ajaxJSON(a,n,{shared_brand_config:t},(e=>{this.setState({modalIsOpen:false})
146this.props.onSave(e)}))}
147this.state={newThemeName:"",modalIsOpen:false}}render(){let e=false
148let t
149if(this.props.userNeedsToPreviewFirst){e=true
150t=g.t('You need to "Preview Changes" before saving')}else if(this.props.sharedBrandConfigBeingEdited&&this.props.sharedBrandConfigBeingEdited.brand_config_md5===this.props.brandConfigMd5){e=true
151t=g.t("There are no unsaved changes")}else this.props.isDefaultConfig&&(e=true)
152return(0,i.Z)("div",{className:"pull-left","data-tooltip":"left",title:t},void 0,(0,i.Z)("button",{type:"button",className:"Button Button--primary",disabled:e,onClick:this.save},void 0,g.t("Save theme")),(0,i.Z)(m.Z,{size:"small",label:g.t("Save Theme"),open:this.state.modalIsOpen,onDismiss:()=>this.setState({modalIsOpen:false})},void 0,(0,i.Z)(m.Z.Body,{},void 0,(0,i.Z)("div",{className:"ic-Form-control"},void 0,(0,i.Z)("label",{htmlFor:"new_theme_theme_name",className:"ic-Label"},void 0,g.t("Theme Name")),(0,i.Z)("input",{type:"text",id:"new_theme_theme_name",className:"ic-Input",placeholder:g.t("Pick a name to save this theme as"),onChange:e=>this.setState({newThemeName:e.target.value})}))),(0,i.Z)(m.Z.Footer,{},void 0,(0,i.Z)("button",{type:"button",className:"Button",onClick:()=>this.setState({modalIsOpen:false})},void 0,g.t("Cancel"))," ",(0,i.Z)("button",{type:"button",onClick:this.save,disabled:!this.state.newThemeName,className:"Button Button--primary"},void 0,g.t("Save theme")))))}}var f=a(1160)
153var b=a(74265)
154var _=a(52860)
155const y=(0,s.useScope)("theme_editor")
156const S=e=>e.includes("Syncing for")?e.replace("Syncing for ",""):e
157function C(e){let{message:t,completion:a}=e
158return(0,i.Z)("li",{className:"Theme-editor-progress-list-item"},void 0,(0,i.Z)("div",{className:"Theme-editor-progress-list-item__title"},void 0,S(t)),(0,i.Z)("div",{className:"Theme-editor-progress-list-item__bar"},void 0,(0,i.Z)(_.Z,{progress:a,title:y.t("Progress for %{account_name}",{account_name:S(t)})})))}function w(e){const t=e.showProgressModal||e.showSubAccountProgress
159return(0,i.Z)(f.u_,{open:t,size:e.showProgressModal?"small":"medium"},void 0,(0,i.Z)(f.u_.Header,{},void 0,(0,i.Z)(b.X,{},void 0,e.showProgressModal?y.t("Generating preview..."):y.t("Applying new styles to subaccounts")," ")),(0,i.Z)(f.u_.Body,{},void 0,e.showProgressModal?(0,i.Z)(_.Z,{progress:e.progress,title:y.t("%{percent} complete",{percent:y.toPercentage(e.progress,{precision:0})})}):(0,i.Z)("div",{},void 0,(0,i.Z)("p",{},void 0,y.t("Changes will still apply if you leave this page.")),(0,i.Z)("ul",{className:"unstyled_list"},void 0,e.activeSubAccountProgresses.map((e=>n.createElement(C,e)))))))}var T=a(65283)
160var Z=a(60474)
161var x=a(34163)
162var I=a(40632)
163var N=a(94184)
164var P=a.n(N)
165var D,B
166const E=(0,s.useScope)("theme_editor")
167class F extends n.Component{constructor(){super(...arguments)
168this.state={}
169this.showWarning=()=>this.props.userInput.invalid&&this.inputNotFocused()
170this.warningLabel=()=>this.showWarning()?(0,i.Z)("span",{role:"alert"},void 0,(0,i.Z)("div",{className:"ic-Form-message ic-Form-message--error",tabIndex:"0"},void 0,(0,i.Z)("div",{className:"ic-Form-message__Layout"},void 0,D||(D=(0,i.Z)("i",{className:"icon-warning",role:"presentation"})),E.t("'%{chosenColor}' is not a valid color.",{chosenColor:this.props.userInput.val})))):B||(B=(0,i.Z)("span",{role:"alert"}))
171this.hexVal=e=>{const t=this.changedColor(e)
172return t?(0,I.Z)(t)||t:""}
173this.inputChange=e=>{const t=!!e&&(!this.changedColor(e)||this.invalidHexString(e))
174this.props.onChange(e,t)
175t||this.props.handleThemeStateChange(this.props.varDef.variable_name,e)}
176this.inputNotFocused=()=>this.textInput&&this.textInput!==document.activeElement
177this.updateIfMounted=()=>{this.forceUpdate()}
178this.textColorInput=()=>(0,i.Z)("span",{},void 0,n.createElement("input",{ref:e=>this.textInput=e,type:"text",id:`brand_config[variables][${this.props.varDef.variable_name}]`,className:P()({"Theme__editor-color-block_input-text":true,"Theme__editor-color-block_input":true,"Theme__editor-color-block_input--has-error":this.props.userInput.invalid}),placeholder:this.props.placeholder,value:this.props.themeState[this.props.varDef.variable_name],"aria-invalid":this.showWarning(),onChange:e=>this.inputChange(e.target.value),onBlur:this.updateIfMounted}))}changedColor(e){if(!e)return null
179const t=document.createElement("span")
180t.style.backgroundColor=e
181const a=t.style.backgroundColor
182if(!a)return null
183if("transparent"===a&&"transparent"!==e)return null
184return a}invalidHexString(e){return!!e.match(/#/)&&!e.match(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)}render(){const e="none"!==this.props.placeholder?this.props.placeholder:null
185return(0,i.Z)("section",{className:"Theme__editor-accordion_element Theme__editor-color ic-Form-control"},void 0,(0,i.Z)("div",{className:"Theme__editor-form--color"},void 0,(0,i.Z)("label",{htmlFor:`brand_config[variables][${this.props.varDef.variable_name}]`,className:"Theme__editor-color_title"},void 0,this.props.varDef.human_name),(0,i.Z)("div",{className:"Theme__editor-color-block"},void 0,this.textColorInput(),this.warningLabel(),(0,i.Z)("label",{className:"Theme__editor-color-label Theme__editor-color-block_label-sample",style:{backgroundColor:this.props.placeholder}},void 0,(0,i.Z)("input",{className:"Theme__editor-color-block_input-sample Theme__editor-color-block_input",type:"color",value:e,role:"presentation",onChange:e=>this.inputChange(e.target.value)})))))}}F.defaultProps={userInput:{},themeState:{},handleThemeStateChange(){}}
186const k=(0,s.useScope)("theme_editor")
187function V(e){return null===e||void 0===e}class A extends n.Component{constructor(){super(...arguments)
188this.setValue=e=>{let t=e
189if(e){this.props.handleThemeStateChange(this.props.varDef.variable_name,e.files[0])
190t=window.URL.createObjectURL(e.files[0])}else{this.fileInput.value=""
191V(this.props.userInput.val)?this.props.handleThemeStateChange(this.props.varDef.variable_name,null,{resetValue:true,useDefault:true}):this.props.handleThemeStateChange(this.props.varDef.variable_name,null,{resetValue:true})}this.props.onChange(t)}}render(){const e=`brand_config[variables][${this.props.varDef.variable_name}]`
192const t=this.props.userInput.val||this.props.placeholder
193return(0,i.Z)("section",{className:"Theme__editor-accordion_element Theme__editor-upload"},void 0,(0,i.Z)("div",{className:"te-Flex"},void 0,(0,i.Z)("div",{className:"Theme__editor-form--upload"},void 0,(0,i.Z)("div",{className:"Theme__editor-upload_header"},void 0,(0,i.Z)("h3",{className:"Theme__editor-upload_title"},void 0,this.props.varDef.human_name),(0,i.Z)("span",{className:"Theme__editor-upload_restrictions"},void 0,this.props.varDef.helper_text)),(0,i.Z)("div",{className:`Theme__editor_preview-img-container Theme__editor_preview-img-container--${this.props.varDef.variable_name}`},void 0,(0,i.Z)("div",{className:"Theme__editor_preview-img"},void 0,t&&(0,i.Z)("img",{src:t,className:"Theme__editor-placeholder",alt:""}))),(0,i.Z)("div",{className:"Theme__editor-image_upload"},void 0,(0,i.Z)("input",{type:"hidden",name:!this.props.userInput.val&&e,value:""===this.props.userInput.val?"":this.props.currentValue}),(0,i.Z)("label",{className:"Theme__editor-image_upload-label"},void 0,(0,i.Z)("span",{className:"screenreader-only"},void 0,this.props.varDef.human_name),n.createElement("input",{type:"file",className:"Theme__editor-input_upload",name:this.props.userInput.val&&e,accept:this.props.varDef.accept,onChange:e=>this.setValue(e.target),ref:e=>this.fileInput=e}),(0,i.Z)("span",{className:"Theme__editor-button_upload Button Button--link","aria-hidden":"true"},void 0,k.t("Select Image"))),this.props.userInput.val||this.props.currentValue?(0,i.Z)("button",{type:"button",className:"Button Button--link",onClick:()=>this.setValue(V(this.props.userInput.val)?"":null)},void 0,V(this.props.userInput.val)?k.t("Use Default"):k.t("Undo")):null))))}}A.defaultProps={userInput:{},handleThemeStateChange(){}}
194var R=a(10868)
195var O=a(71602)
196function j(e){function t(t,a){e.onToggle(t,a,e.index)}return(0,i.Z)(R.z,{summary:e.summary,expanded:e.expanded,onToggle:t,icon:O.W,iconPosition:"end",fluidWidth:true},void 0,e.children)}j.defaultProps={expanded:false}
197class M extends n.Component{constructor(){super(...arguments)
198this.state={value:this.props.defaultValue}
199this.handleChange=e=>{this.setState({value:e.target.value})
200this.props.onChange(e.target.value)
201this.props.handleThemeStateChange(this.props.variableKey,e.target.value)}}componentDidMount(){l()(this.rangeInput).on("input change",this.handleChange)}componentWillUnmount(){l()(this.rangeInput).off("input change",this.handleChange)}render(){const{labelText:e,formatValue:t,onChange:a,value:o,...s}=this.props
202return(0,i.Z)("label",{className:"RangeInput"},void 0,(0,i.Z)("div",{className:"RangeInput__label"},void 0,e),(0,i.Z)("div",{className:"RangeInput__control"},void 0,n.createElement("input",Object.assign({className:"RangeInput__input",ref:e=>this.rangeInput=e,type:"range","aria-valuenow":this.props.defaultValue,"aria-valuemin":this.props.min,"aria-valuemax":this.props.max,"aria-valuetext":t(this.state.value),onChange:()=>{}},s)),n.createElement("output",{ref:e=>this.outputElement=e,htmlFor:this.props.name,className:"RangeInput__value"},t(this.state.value))))}}M.defaultProps={step:1,onChange(){},formatValue:e=>e,themeState:{},handleThemeStateChange(){}}
203const U="Theme__editor-accordion-index"
204class $ extends n.Component{constructor(){super(...arguments)
205this.state={expandedIndex:Number(window.sessionStorage.getItem(U))}
206this.handleToggle=(e,t,a)=>{this.setState({expandedIndex:a},(()=>{this.setStoredAccordionIndex(a)}))}
207this.renderRow=e=>{const t={key:e.variable_name,currentValue:this.props.brandConfigVariables[e.variable_name],userInput:this.props.changedValues[e.variable_name],onChange:this.props.changeSomething.bind(null,e.variable_name),placeholder:this.props.getDisplayValue(e.variable_name),themeState:this.props.themeState,handleThemeStateChange:this.props.handleThemeStateChange,varDef:e}
208switch(e.type){case"color":return n.createElement(F,t)
209case"image":return n.createElement(A,t)
210case"percentage":{const a=t.currentValue||t.placeholder
211return(0,i.Z)(M,{labelText:e.human_name,min:0,max:1,step:.1,defaultValue:a?parseFloat(a):.5,name:`brand_config[variables][${e.variable_name}]`,variableKey:e.variable_name,onChange:e=>t.onChange(e),themeState:t.themeState,handleThemeStateChange:t.handleThemeStateChange,formatValue:e=>s["default"].toPercentage(100*e,{precision:0})},e.variable_name)}default:return null}}}setStoredAccordionIndex(e){window.sessionStorage.setItem(U,e)}render(){return(0,i.Z)("div",{},void 0,this.props.variableSchema.map(((e,t)=>(0,i.Z)(j,{summary:(0,i.Z)(x.x,{as:"h2",weight:"bold"},void 0,e.group_name),index:t,expanded:t===this.state.expandedIndex,onToggle:this.handleToggle},e.group_name,e.variables.map(this.renderRow)))))}}var z,q
212const H=(0,s.useScope)("theme_editor")
213class L extends n.Component{constructor(){super(...arguments)
214this.state={selectedFileName:""}
215this.hasSomethingToReset=()=>this.props.userInput.val||""===this.props.userInput.val||this.props.currentValue
216this.hasUserInput=()=>null!==this.props.userInput.val&&void 0!==this.props.userInput.val
217this.handleFileChanged=e=>{const t=e.target.files[0]
218this.setState({selectedFileName:t.name})
219this.props.handleThemeStateChange(this.props.name,t,{customFileUpload:true})
220this.props.onChange(window.URL.createObjectURL(t))}
221this.handleResetClicked=()=>{this.fileInput.value=""
222this.setState({selectedFileName:""})
223this.props.handleThemeStateChange(this.props.name,null,{customFileUpload:true,resetValue:true,useDefault:!this.hasUserInput()&&this.props.currentValue})
224this.props.onChange(this.hasUserInput()?null:"")}}displayValue(){return!this.hasUserInput()&&this.props.currentValue?this.props.currentValue:this.props.userInput.val?this.state.selectedFileName:""}resetButtonLabel(){return this.props.userInput.val||""===this.props.userInput.val?(0,i.Z)("span",{},void 0,z||(z=(0,i.Z)("i",{className:"icon-reset","aria-hidden":"true"})),(0,i.Z)("span",{className:"screenreader-only"},void 0,H.t("Undo"))):this.props.currentValue?(0,i.Z)("span",{},void 0,q||(q=(0,i.Z)("i",{className:"icon-x","aria-hidden":"true"})),(0,i.Z)("span",{className:"screenreader-only"},void 0,H.t("Clear"))):(0,i.Z)("span",{className:"screenreader-only"},void 0,H.t("Reset"))}viewFileLink(){return!this.hasUserInput()&&this.props.currentValue?(0,i.Z)("a",{href:this.props.currentValue,target:"_blank",rel:"noopener noreferrer",className:"ThemeEditorFileUpload__view-file"},void 0,H.t("View File")):null}render(){return(0,i.Z)("div",{className:"ThemeEditorFileUpload"},void 0,(0,i.Z)("div",{className:"ThemeEditorFileUpload__label ic-Label"},void 0,this.props.label," ",this.viewFileLink()),(0,i.Z)("div",{className:"ic-Input-group"},void 0,(0,i.Z)("button",{disabled:!this.hasSomethingToReset(),type:"button",className:"ic-Input-group__add-on Button ThemeEditorFileUpload__reset-button",onClick:this.handleResetClicked},void 0,this.resetButtonLabel()),(0,i.Z)("input",{type:"hidden",name:!this.props.userInput.val&&this.props.name,value:""===this.props.userInput.val?"":this.props.currentValue}),(0,i.Z)("label",{className:"ThemeEditorFileUpload__file-chooser"},void 0,(0,i.Z)("span",{className:"screenreader-only"},void 0,this.props.label),n.createElement("input",{type:"file",name:this.props.userInput.val&&this.props.name,accept:this.props.accept,onChange:this.handleFileChanged,ref:e=>this.fileInput=e}),(0,i.Z)("div",{className:"ThemeEditorFileUpload__fake-input uneditable-input ic-Input"},void 0,this.displayValue()),(0,i.Z)("div",{className:"Button","aria-hidden":"true"},void 0,H.t("Select")))))}}L.defaultProps={userInput:{},handleThemeStateChange(){}}
225var W
226const G=(0,s.useScope)("theme_editor")
227function J(e){const[t,a]=(0,n.useState)("tab-panel-edit")
228const o=G.t("#community.admin_custom_js_css")
229function s(e,t){let{id:n}=t
230a(n)}if(e.allowGlobalIncludes)return(0,i.Z)(T.mQ,{padding:"0",onRequestTabChange:s},void 0,(0,i.Z)(T.mQ.Panel,{renderTitle:G.t("Edit"),id:"tab-panel-edit",isSelected:"tab-panel-edit"===t},void 0,(0,i.Z)($,{variableSchema:e.variableSchema,brandConfigVariables:e.brandConfig.variables,getDisplayValue:e.getDisplayValue,changedValues:e.changedValues,changeSomething:e.changeSomething,themeState:e.themeState,handleThemeStateChange:e.handleThemeStateChange})),(0,i.Z)(T.mQ.Panel,{renderTitle:G.t("Upload"),id:"tab-panel-upload",isSelected:"tab-panel-upload"===t,padding:"0"},void 0,(0,i.Z)("div",{className:"Theme__editor-upload-overrides"},void 0,(0,i.Z)("div",{className:"Theme__editor-upload-warning"},void 0,W||(W=(0,i.Z)("div",{className:"Theme__editor-upload-warning_icon"},void 0,(0,i.Z)("i",{className:"icon-warning"}))),(0,i.Z)("div",{},void 0,(0,i.Z)("p",{className:"Theme__editor-upload-warning_text-emphasis"},void 0,G.t("Custom CSS and Javascript may cause accessibility issues or conflicts with future Canvas updates!")),(0,i.Z)("p",{dangerouslySetInnerHTML:{__html:G.t("Before implementing custom CSS or Javascript, please refer to *our documentation*.",{wrappers:['<a href="'+o+'" target="_blank">$1</a>']}
230)}}))),(0,i.Z)("div",{className:"Theme__editor-upload-overrides_header"},void 0,G.t("File(s) will be included on all pages in the Canvas desktop application.")),(0,i.Z)("div",{className:"Theme__editor-upload-overrides_form"},void 0,(0,i.Z)(L,{label:G.t("CSS file"),accept:".css",name:"css_overrides",currentValue:e.brandConfig.css_overrides,userInput:e.changedValues.css_overrides,onChange:e.changeSomething.bind(null,"css_overrides"),themeState:e.themeState,handleThemeStateChange:e.handleThemeStateChange}),(0,i.Z)(L,{label:G.t("JavaScript file"),accept:".js",name:"js_overrides",currentValue:e.brandConfig.js_overrides,userInput:e.changedValues.js_overrides,onChange:e.changeSomething.bind(null,"js_overrides"),themeState:e.themeState,handleThemeStateChange:e.handleThemeStateChange}))),(0,i.Z)("div",{className:"Theme__editor-upload-overrides"},void 0,(0,i.Z)("div",{className:"Theme__editor-upload-overrides_header"},void 0,G.t("File(s) will be included when user content is displayed within the Canvas iOS or Android apps, and in third-party apps built on our API.")),(0,i.Z)("div",{className:"Theme__editor-upload-overrides_form"},void 0,(0,i.Z)(L,{label:G.t("Mobile app CSS file"),accept:".css",name:"mobile_css_overrides",currentValue:e.brandConfig.mobile_css_overrides,userInput:e.changedValues.mobile_css_overrides,onChange:e.changeSomething.bind(null,"mobile_css_overrides"),themeState:e.themeState,handleThemeStateChange:e.handleThemeStateChange}),(0,i.Z)(L,{label:G.t("Mobile app JavaScript file"),accept:".js",name:"mobile_js_overrides",currentValue:e.brandConfig.mobile_js_overrides,userInput:e.changedValues.mobile_js_overrides,onChange:e.changeSomething.bind(null,"mobile_js_overrides"),themeState:e.themeState,handleThemeStateChange:e.handleThemeStateChange})))))
231return(0,i.Z)(Z.G,{padding:"small",display:"block"},void 0,(0,i.Z)($,{variableSchema:e.variableSchema,brandConfigVariables:e.brandConfig.variables,getDisplayValue:e.getDisplayValue,changedValues:e.changedValues,changeSomething:e.changeSomething,themeState:e.themeState,handleThemeStateChange:e.handleThemeStateChange}))}J.defaultProps={allowGlobalIncludes:false,changedValues:{}}
232var X=a(87666)
233var Y,Q,K,ee
234const te=(0,s.useScope)("theme_editor")
235const ae=[{id:"te-editor",label:te.t("Edit"),value:"edit",selected:true},{id:"te-upload",label:te.t("Upload"),value:"upload",selected:false}]
236const ne=["js_overrides","css_overrides","mobile_js_overrides","mobile_css_overrides"]
237function oe(e,t){for(let a=0;a<e.length;a++)for(let n=0;n<e[a].variables.length;n++){const o=e[a].variables[n]
238if(o.variable_name===t)return o}}function ie(){try{const e=sessionStorage.getItem("sharedBrandConfigBeingEdited")
239if(e)return JSON.parse(e)}catch(e){console.error("Error reading sharedBrandConfigBeingEdited from sessionStore:",e)}}const se=e=>100!==e.completion
240class re extends n.Component{constructor(e){var t
241super()
242t=this
243this.onProgress=e=>{this.setState({progress:e.completion})}
244this.onSubAccountProgress=e=>{const t=u().map(this.state.activeSubAccountProgresses,(t=>t.tag==e.tag?e:t))
245this.filterAndSetActive(t)
246if(u().isEmpty(this.state.activeSubAccountProgresses)){this.closeSubAccountProgressModal()
247this.redirectToAccount()}}
248this.getDisplayValue=(e,t)=>{let a
249t&&t.ignoreChanges||(a=this.getChangedValue(e))
250a||""===a||(a=this.getBrandConfig(e))
251a||(a=this.getSchemaDefault(e,t))
252return a}
253this.getChangedValue=e=>this.state.changedValues[e]&&this.state.changedValues[e].val
254this.getDefault=e=>this.getDisplayValue(e,{ignoreChanges:true})
255this.getBrandConfig=e=>this.props.brandConfig[e]||this.props.brandConfig.variables[e]
256this.getSchemaDefault=(e,t)=>{const a=oe(this.props.variableSchema,e)
257const n=a?a.default:null
258if(n&&"$"===n[0])return this.getDisplayValue(n.slice(1),t)
259return n}
260this.handleThemeStateChange=function(e,a){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
261const{files:o}=t.state.themeStore
262let{properties:i}=t.state.themeStore
263if(a instanceof File){const t={variable_name:e,value:a}
264n.customFileUpload&&(t.customFileUpload=true)
265const i=o.findIndex((t=>t.variable_name===e));-1!==i?o[i]=t:o.push(t)}else i={...i,[e]:a}
266if(n.resetValue){i={...i,[e]:t.originalThemeProperties[e]}
267const a=o.findIndex((t=>t.variable_name===e));-1!==a&&(o[a].value=t.originalThemeOverrides[e])}if(n.useDefault){i[e]=t.getSchemaDefault(e)
268const a=o.findIndex((t=>t.variable_name===e));-1!==a&&(o[a].value="")}t.setState({themeStore:{properties:i,files:o}})}
269this.somethingHasChanged=()=>u().some(this.state.changedValues,((e,t)=>""===e.val||e.val!==this.getDefault(t)&&null!==e.val))
270this.displayedMatchesSaved=()=>this.state.sharedBrandConfigBeingEdited&&this.state.sharedBrandConfigBeingEdited.brand_config_md5===this.props.brandConfig.md5
271this.changeSomething=(e,t,a)=>
271{const n={...this.state.changedValues,[e]:{val:t,invalid:a}}
272this.setState({changedValues:n})}
273this.invalidForm=()=>Object.keys(this.state.changedValues).some((e=>this.state.changedValues[e].invalid))
274this.updateSharedBrandConfigBeingEdited=e=>{sessionStorage.setItem("sharedBrandConfigBeingEdited",JSON.stringify(e))
275this.setState({sharedBrandConfigBeingEdited:e})}
276this.handleCancelClicked=()=>{if(this.somethingHasChanged()||!this.displayedMatchesSaved()){const e=te.t("You are about to lose any unsaved changes.\n\nWould you still like to proceed?")
277if(!window.confirm(e))return}sessionStorage.removeItem("sharedBrandConfigBeingEdited");(0,p.Z)(`/accounts/${this.props.accountID}/brand_configs`,"DELETE")}
278this.saveToSession=e=>{(0,p.Z)(`/accounts/${this.props.accountID}/brand_configs/save_to_user_session`,"POST",e)}
279this.handleFormSubmit=()=>{let e
280this.setState({showProgressModal:true})
281l().ajax({url:`/accounts/${this.props.accountID}/brand_configs`,type:"POST",data:this.processThemeStoreForSubmit(),processData:false,contentType:false,dataType:"json"}).pipe((t=>{e=t.brand_config.md5
282if(t.progress)return new c.Z(t.progress).poll().progress(this.onProgress)})).pipe((()=>this.saveToSession(e))).fail((()=>{window.alert(te.t("An error occurred trying to generate this theme, please try again."))
283this.setState({showProgressModal:false})}))}
284this.handleApplyClicked=()=>{const e=te.t("This will apply this theme to your entire account. Would you like to proceed?")
285window.confirm(e)&&this.kickOffSubAcountCompilation()}
286this.redirectToAccount=()=>{window.location.replace(`/accounts/${this.props.accountID}/brand_configs?theme_applied=1`)}
287this.kickOffSubAcountCompilation=()=>{this.setState({isApplying:true})
288l().ajax({url:`/accounts/${this.props.accountID}/brand_configs/save_to_account`,type:"POST",data:this.processThemeStoreForSubmit(),processData:false,contentType:false,dataType:"json"}).pipe((e=>{if(e.subAccountProgresses&&!u().isEmpty(e.subAccountProgresses)){this.openSubAccountProgressModal()
289this.filterAndSetActive(e.subAccountProgresses)
290return e.subAccountProgresses.map((e=>new c.Z(e).poll().progress(this.onSubAccountProgress)))}this.redirectToAccount()})).fail((()=>{this.setState({isApplying:false})
291window.alert(te.t("An error occurred trying to apply this theme, please try again."))}))}
292this.filterAndSetActive=e=>{this.setState({activeSubAccountProgresses:e.filter(se)})}
293this.openSubAccountProgressModal=()=>{this.setState({showSubAccountProgress:true})}
294this.closeSubAccountProgressModal=()=>{this.setState({showSubAccountProgress:false})}
295this.renderTabInputs=()=>this.props.allowGlobalIncludes?ae.map((e=>(0,i.Z)("input",{type:"radio",id:e.id,name:"te-action",defaultValue:e.value,className:"Theme__editor-tabs_input",defaultChecked:e.selected},e.id))):null
296this.renderTabLabels=()=>this.props.allowGlobalIncludes?ae.map((e=>(0,i.Z)("label",{htmlFor:e.id,className:"Theme__editor-tabs_item",id:`${e.id}-tab`},`${e.id}-tab`,e.label))):null
297const{variableSchema:a,brandConfig:n}=e
298const o=u().flatMap(a,(e=>e.variables)).reduce(((e,t)=>({...e,[t.variable_name]:t.default})),{})
299this.originalThemeProperties={...o,...n.variables}
300this.originalThemeOverrides=u().pick(n,ne)
301this.state={themeStore:{properties:{...this.originalThemeProperties},files:ne.map((e=>({customFileUpload:true,variable_name:e,value:this.originalThemeOverrides[e]})))},changedValues:{},showProgressModal:false,progress:0,sharedBrandConfigBeingEdited:ie(),showSubAccountProgress:false,activeSubAccountProgresses:[]}}processThemeStoreForSubmit(){const e=new FormData
302const{properties:t,files:a}=this.state.themeStore
303Object.keys(t).forEach((a=>{const n=this.getSchemaDefault(a)
304t[a]!==n&&t[a]&&"$"!==t[a][0]&&e.append(`brand_config[variables][${a}]`,t[a])}))
305a.forEach((t=>{const a=t.customFileUpload?t.variable_name:`brand_config[variables][${t.variable_name}]`;(!t.customFileUpload||t.customFileUpload&&null!=t.value)&&e.append(a,t.value)}))
306ne.forEach((t=>{e.has(t)&&"undefined"!==e.get(t)&&"null"!==e.get(t)||e.append(t,this.props.brandConfig[t]||"")}))
307return e}renderHeader(e){return(0,i.Z)("header",{className:`Theme__header ${!this.props.hasUnsavedChanges&&"Theme__header--is-active-theme"}`},void 0,(0,i.Z)("div",{className:"Theme__header-layout"},void 0,(0,i.Z)("div",{className:"Theme__header-primary"},void 0,this.props.hasUnsavedChanges?(0,i.Z)("span",{"data-tooltip":"right",title:e},void 0,(0,i.Z)("button",{type:"button",className:"Button Button--success",disabled:!!e,onClick:this.handleApplyClicked},void 0,te.t("Apply theme"))):null,(0,i.Z)("h2",{className:"Theme__header-theme-name"},void 0,this.props.hasUnsavedChanges||this.somethingHasChanged()?null:Y||(Y=(0,i.Z)("i",{className:"icon-check"})),"  ",this.state.sharedBrandConfigBeingEdited?this.state.sharedBrandConfigBeingEdited.name:null)),(0,i.Z)("div",{className:"Theme__header-secondary"},void 0,(0,i.Z)(v,{userNeedsToPreviewFirst:this.somethingHasChanged(),sharedBrandConfigBeingEdited:this.state.sharedBrandConfigBeingEdited,accountID:this.props.accountID,brandConfigMd5:this.props.brandConfig.md5,isDefaultConfig:this.props.isDefaultConfig,onSave:this.updateSharedBrandConfigBeingEdited})," ",(0,i.Z)("button",{type:"button",className:"Button",onClick:this.handleCancelClicked},void 0,te.t("Exit")))))}render(){let e=null
308this.somethingHasChanged()?e=te.t('You need to "Preview Changes" before you can apply this to your account'):this.props.isDefaultConfig||this.displayedMatchesSaved()?this.state.isApplying&&(e=te.t("Applying, please be patient")):e=te.t('You need to "Save" before applying to this account')
309return(0,i.Z)("div",{id:"main",className:"ic-Layout-columns"},void 0,(0,i.Z)("h1",{className:"screenreader-only"},void 0,te.t("Theme Editor")),this.props.useHighContrast&&(0,i.Z)("div",{role:"alert",className:"ic-flash-static ic-flash-error"},void 0,(0,i.Z)("h4",{className:"ic-flash__headline"},void 0,Q||(Q=(0,i.Z)("div",{className:"ic-flash__icon","aria-hidden":"true"},void 0,(0,i.Z)("i",{className:"icon-warning"}))),te.t("You will not be able to preview your changes")),(0,i.Z)("p",{className:"ic-flash__text",dangerouslySetInnerHTML:{__html:te.t("To preview Theme Editor branding, you will need to *turn off High Contrast UI*.",{wrappers:['<a href="/profile/settings">$1</a>']}
309)}})),n.createElement("form",{ref:e=>this.ThemeEditorForm=e,onSubmit:(0,h.Z)(this.handleFormSubmit),encType:"multipart/form-data",acceptCharset:"UTF-8",action:"'/accounts/'+this.props.accountID+'/brand_configs",method:"POST",className:"Theme__container"},K||(K=(0,i.Z)("input",{name:"utf8",type:"hidden",value:"✓"})),(0,i.Z)("input",{name:"authenticity_token",type:"hidden",value:(0,X.Z)("_csrf_token")}),(0,i.Z)("div",{className:`Theme__layout ${!this.props.hasUnsavedChanges&&"Theme__layout--is-active-theme"}`},void 0,(0,i.Z)("div",{className:"Theme__editor"},void 0,(0,i.Z)(J,{themeStore:this.state.themeStore,handleThemeStateChange:this.handleThemeStateChange,allowGlobalIncludes:this.props.allowGlobalIncludes,brandConfig:this.props.brandConfig,variableSchema:this.props.variableSchema,getDisplayValue:this.getDisplayValue,changeSomething:this.changeSomething,changedValues:this.state.changedValues})),(0,i.Z)("div",{className:"Theme__preview"},void 0,this.somethingHasChanged()?(0,i.Z)("div",{className:"Theme__preview-overlay"},void 0,(0,i.Z)("button",{type:"submit",className:"Button Button--primary Button--large",disabled:this.invalidForm()},void 0,ee||(ee=(0,i.Z)("i",{className:"icon-refresh"})),(0,i.Z)("span",{className:"Theme__preview-button-text"},void 0,te.t("Preview Your Changes")))):null,(0,i.Z)("iframe",{id:"previewIframe",src:`/accounts/${this.props.accountID}/theme-preview/?editing_brand_config=1`,title:te.t("Preview"),"aria-hidden":this.somethingHasChanged(),tabIndex:this.somethingHasChanged()?"-1":"0"}))),this.renderHeader(e)),(0,i.Z)(w,{showProgressModal:this.state.showProgressModal,showSubAccountProgress:this.state.showSubAccountProgress,activeSubAccountProgresses:this.state.activeSubAccountProgresses,progress:this.state.progress}))}}var le=a(75869)
310var de=a.n(le)
311window.top.location!==self.location&&(window.top.location=self.location.href)
312de()((()=>{o.render(n.createElement(re,{brandConfig:window.ENV.brandConfig,hasUnsavedChanges:window.ENV.hasUnsavedChanges,isDefaultConfig:window.ENV.isDefaultConfig,variableSchema:window.ENV.variableSchema,sharedBrandConfigs:window.ENV.sharedBrandConfigs,allowGlobalIncludes:window.ENV.allowGlobalIncludes,accountID:window.ENV.account_id,useHighContrast:window.ENV.use_high_contrast}),document.body)}))},60564:(e,t,a)=>{"use strict"
313a.d(t,{Z:()=>h})
314var n=a(63056)
315var o=a(67294)
316var i=a(9524)
317var s=a(74265)
318var r=a(61323)
319var l=a(1160)
320const d=(0,r.useScope)("modal")
321function u(){return document.getElementById("flash_screenreader_holder")}function h(e){let{label:t,closeButtonLabel:a,onDismiss:r,children:h,...c}=e
322return o.createElement(l.u_,Object.assign({liveRegion:u},c,{label:t,onDismiss:r}),(0,n.Z)(l.u_.Header,{},void 0,(0,n.Z)(i.P,{"data-testid":"instui-modal-close",placement:"end",offset:"medium",onClick:r,screenReaderLabel:a||d.t("Close")}),(0,n.Z)(s.X,{},void 0,t)),h)}["Header","Body","Footer"].forEach((e=>h[e]=l.u_[e]))},82608:(e,t,a)=>{"use strict"
323a.d(t,{Z:()=>d})
324var n=a(64598)
325var o=a(87155)
326var i=a(6507)
327var s=a.n(i)
328const r=[].indexOf;(0,n.l)(l,o.Hn)
329function l(){this.onPoll=this.onPoll.bind(this)
330this.poll=this.poll.bind(this)
331return l.__super__.constructor.apply(this,arguments)}l.prototype.defaults={completion:0,url:null,timeout:1e3}
332l.prototype.pollStates=["queued","running"]
333l.prototype.isPolling=function(){const e=this.get("workflow_state")
334return r.call(this.pollStates,e)>=0}
335l.prototype.isSuccess=function(){return"completed"===this.get("workflow_state")}
336l.prototype.initialize=function(){this.pollDfd=new(s().Deferred)
337this.on("change:url",(e=this,function(){if(e.isPolling())return e.poll()}))
338var e
339return s()(window).on("beforeunload",function(e){return function(){return clearTimeout(e.timeout)}}(this))}
340l.prototype.url=function(){return this.get("url")}
341l.prototype.poll=function(){this.fetch().then(this.onPoll,(e=this,function(){return e.pollDfd.rejectWith(e,arguments)}))
342var e
343return this.pollDfd}
344l.prototype.onPoll=function(e){this.pollDfd.notify(e)
345if(this.isPolling())return this.timeout=setTimeout(this.poll,this.get("timeout"))
346this.pollDfd[this.isSuccess()?"resolve":"reject"](e)
347return this.trigger("complete")}
348const d=l},52860:(e,t,a)=>{"use strict"
349a.d(t,{Z:()=>s})
350var n=a(63056)
351a(67294)
352var o=a(94184)
353var i=a.n(o)
354function s(e){return(0,n.Z)("div",{className:i()({"progress-bar__bar-container":true,"almost-done":100===e.progress})},void 0,(0,n.Z)("div",{className:i()({"progress-bar__bar":true,"almost-done":100===e.progress}),role:"progressbar","aria-valuenow":e.progress,"aria-valuemin":"
3540","aria-valuemax":"100","aria-label":e["aria-label"]||"",style:{width:`${Math.min(e.progress,100)}%`}}))}},78547:(e,t,a)=>{"use strict"
355var n=a(45697)
356var o=a.n(n)
357var i=a(25683)
358var s=a.n(i)
359const r=/[0-9a-fA-F]{32}$/
360const l={}
361l.md5=(e,t,a)=>{const n=e[t]
362if(null!==n&&!r.test(n))return new Error(`Invalid md5: ${n} propName: ${t} componentName: ${a}`)}
363const d={default:o().string.isRequired,human_name:o().string.isRequired,variable_name:o().string.isRequired}
364l.variables=o().objectOf(o().string).isRequired
365l.color=o().shape(s().extend({type:o().oneOf(["color"]).isRequired},d))
366l.image=o().shape(s().extend({type:o().oneOf(["image"]).isRequired,accept:o().string.isRequired,helper_text:o().string},d))
367l.percentage=o().shape(s().extend({type:o().oneOf(["percentage"]).isRequired,helper_text:o().string},d))
368l.varDef=o().oneOfType([l.image,l.color,l.percentage])
369l.brandConfig=o().shape({md5:l.md5,variables:l.variables})
370l.sharedBrandConfig=o().shape({account_id:o().string,brand_config:l.brandConfig.isRequired,name:o().string.isRequired})
371l.variableGroup=o().shape({group_name:o().string.isRequired,variables:o().arrayOf(l.varDef).isRequired})
372l.userVariableInput=o().shape({val:o().string,invalid:o().bool})
373l.variableSchema=o().arrayOf(l.variableGroup).isRequired
374l.variableDescription=o().shape({default:o().string.isRequired,type:o().oneOf(["color","image","percentage"]).isRequired,variable_name:o().string.isRequired})
375l.brandableVariableDefaults=o().objectOf(l.variableDescription)},24552:(e,t,a)=>{"use strict"
376a.d(t,{Z:()=>s})
377var n=a(6507)
378var o=a.n(n)
379var i=a(16916)
380a(41812)
381function s(e,t,a){o()(`\n    <form hidden action="${(0,i.ZP)(e)}" method="POST">\n      <input name="_method" type="hidden" value="${(0,i.ZP)(t)}" />\n      <input name="authenticity_token" type="hidden" value="${(0,i.ZP)(o().cookie("_csrf_token"))}" />\n      <input name="${(0,i.ZP)(void 0===a?"ignorethis":"brand_config_md5")}" value="${(0,i.ZP)(a||"")}" />\n    </form>\n  `).appendTo("body").submit()}},83624:(e,t,a)=>{"use strict"
382a.d(t,{Z:()=>n})
383function n(e){return function(t){t&&t.preventDefault()
384return e.apply(this,arguments)}}},40632:(e,t,a)=>{"use strict"
385a.d(t,{Z:()=>n})
386function n(e){e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)
387return e&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""}},27959:(e,t,a)=>{(function(){var e
388function t(e){var t=0
389return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,a){if(e==Array.prototype||e==Object.prototype)return e
390e[t]=a.value
391return e}
392function o(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof a.g&&a.g]
393for(var t=0;t<e.length;++t){var n=e[t]
394if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}var i=o(this)
395function s(e,t){if(t){for(var a=i,o=e.split("."),s=0;s<o.length-1;s++){var r=o[s]
396r in a||(a[r]={})
397a=a[r]}o=o[o.length-1]
398s=a[o]
399r=t(s)
400r!=s&&null!=r&&n(a,o,{configurable:!0,writable:!0,value:r})}}s("Symbol",(function(e){function t(e){if(this instanceof t)throw new TypeError("Symbol is not a constructor")
401return new a("jscomp_symbol_"+(e||"")+"_"+o++,e)}function a(e,t){this.o=e
402n(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e
403a.prototype.toString=function(){return this.o}
404var o=0
405return t}))
406s("Symbol.iterator",(function(e){if(e)return e
407e=Symbol("Symbol.iterator")
408for(var a="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<a.length;o++){var s=i[a[o]]
409"function"===typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return r(t(this))}})}return e}))
410function r(e){e={next:e}
411e[Symbol.iterator]=function(){return this}
412return e}function l(e){var a="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator]
413return a?a.call(e):{next:t(e)}}var d
414if("function"==typeof Object.setPrototypeOf)d=Object.setPrototypeOf
415else{var u
416e:{var h={u:!0},c={}
417try{c.__proto__=h
418u=c.u
419break e}catch(e){}u=!1}d=u?function(e,t){e.__proto__=t
420if(e.__proto__!==t)throw new TypeError(e+" is not extensible")
421return e}:null}var p=d
422function m(){this.h=!1
423this.f=null
424this.m=void 0
425this.b=1
426this.l=this.v=0
427this.g=null}function g(e){if(e.h)throw new TypeError("Generator is already running")
428e.h=!0}m.prototype.i=function(e){this.m=e}
429m.prototype.j=function(e){this.g={w:e,A:!0}
430this.b=this.v||this.l}
431m.prototype["return"]=function(e){this.g={return:e}
432this.b=this.l}
433function v(e,t){e.b=3
434return{value:t}}function f(e){this.a=new m
435this.B=e}f.prototype.i=function(e){g(this.a)
436if(this.a.f)return _(this,this.a.f.next,e,this.a.i)
437this.a.i(e)
438return y(this)}
439function b(e,t){g(e.a)
440var a=e.a.f
441if(a)return _(e,"return"in a?a["return"]:function(e){return{value:e,done:!0}},t,e.a["return"])
442e.a["return"](t)
443return y(e)}f.prototype.j=function(e){g(this.a)
444if(this.a.f)return _(this,this.a.f["throw"],e,this.a.i)
445this.a.j(e)
446return y(this)}
447function _(e,t,a,n){try{var o=t.call(e.a.f,a)
448if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object")
449if(!o.done)return e.a.h=!1,o
450var i=o.value}catch(t){return e.a.f=null,e.a.j(t),y(e)}e.a.f=null
451n.call(e.a,i)
452return y(e)}function y(e){for(;e.a.b;)try{var t=e.B(e.a)
453if(t)return e.a.h=!1,{value:t.value,done:!1}}catch(t){e.a.m=void 0,e.a.j(t)}e.a.h=!1
454if(e.a.g){t=e.a.g
455e.a.g=null
456if(t.A)throw t.w
457return{value:t["return"],done:!0}}return{value:void 0,done:!0}}function S(e){this.next=function(t){return e.i(t)}
458this["throw"]=function(t){return e.j(t)}
459this["return"]=function(t){return b(e,t)}
460this[Symbol.iterator]=function(){return this}}function C(e,t){var a=new S(new f(t))
461p&&p(a,e.prototype)
462return a}if("undefined"!==typeof Blob&&("undefined"===typeof FormData||!FormData.prototype.keys)){var w=function(e,t){for(var a=0;a<e.length;a++)t(e[a])},T=function(e,t,a){return t instanceof Blob?[String(e),t,void 0!==a?a+"":"string"===typeof t.name?t.name:"blob"]:[String(e),String(t)]},Z=function(e,t){if(e.length<t)throw new TypeError(t+" argument required, but only "+e.length+" present.")},x=function(e){var t=l(e)
463e=t.next().value
464var a=t.next().value
465t=t.next().value
466a instanceof Blob&&(a=new File([a],t,{type:a.type,lastModified:a.lastModified}))
467return[e,a]},I="object"===typeof globalThis?globalThis:"object"===typeof window?window:"object"===typeof self?self:this,N=I.FormData,P=I.XMLHttpRequest&&I.XMLHttpRequest.prototype.send,D=I.Request&&I.fetch,B=I.navigator&&I.navigator.sendBeacon,E=I.Element&&I.Element.prototype,F=I.Symbol&&Symbol.toStringTag
468F&&(Blob.prototype[F]||(Blob.prototype[F]="Blob"),"File"in I&&!File.prototype[F]&&(File.prototype[F]="File"))
469try{new File([],"")}catch(e){I.File=function(e,t,a){e=new Blob(e,a)
470a=a&&void 0!==a.lastModified?new Date(a.lastModified):new Date
471Object.defineProperties(e,{name:{value:t},lastModifiedDate:{value:a},lastModified:{value:+a},toString:{value:function(){return"[object File]"}}})
472F&&Object.defineProperty(e,F,{value:"File"})
473return e}}var k=function(e){this.c=[]
474var t=this
475e&&w(e.elements,(function(e){if(e.name&&!e.disabled&&"submit"!==e.type&&"button"!==e.type&&!e.matches("form fieldset[disabled] *"))if("file"===e.type){var a=e.files&&e.files.length?e.files:[new File([],"",{type:"application/octet-stream"})]
476w(a,(function(a){t.append(e.name,a)}))}else"select-multiple"===e.type||"select-one"===e.type?w(e.options,(function(a){!a.disabled&&a.selected&&t.append(e.name,a.value)})):"checkbox"===e.type||"radio"===e.type?e.checked&&t.append(e.name,e.value):(a="textarea"===e.type?e.value.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"):e.value,t.append(e.name,a))}))}
477e=k.prototype
478e.append=function(e,t,a){Z(arguments,2)
479this.c.push(T(e,t,a))}
480e["delete"]=function(e){Z(arguments,1)
481var t=[]
482e=String(e)
483w(this.c,(function(a){a[0]!==e&&t.push(a)}))
484this.c=t}
485e.entries=function e(){var t,a=this
486return C(e,(function(e){1==e.b&&(t=0)
487if(3!=e.b)return t<a.c.length?e=v(e,x(a.c[t])):(e.b=0,e=void 0),e
488t++
489e.b=2}))}
490e.forEach=function(e,t){Z(arguments,1)
491for(var a=l(this),n=a.next();!n.done;n=a.next()){var o=l(n.value)
492n=o.next().value
493o=o.next().value
494e.call(t,o,n,this)}}
495e.get=function(e){Z(arguments,1)
496var t=this.c
497e=String(e)
498for(var a=0;a<t.length;a++)if(t[a][0]===e)return x(t[a])[1]
499return null}
500e.getAll=function(e){Z(arguments,1)
501var t=[]
502e=String(e)
503w(this.c,(function(a){a[0]===e&&t.push(x(a)[1])}))
504return t}
505e.has=function(e){Z(arguments,1)
506e=String(e)
507for(var t=0;t<this.c.length;t++)if(this.c[t][0]===e)return!0
508return!1}
509e.keys=function e(){var t,a,n,o,i,s=this
510return C(e,(function(e){1==e.b&&(t=l(s),a=t.next())
511if(3!=e.b){if(a.done){e.b=0
512return}n=a.value
513o=l(n)
514i=o.next().value
515return v(e,i)}a=t.next()
516e.b=2}))}
517e.set=function(e,t,a){Z(arguments,2)
518e=String(e)
519var n=[],o=T(e,t,a),i=!0
520w(this.c,(function(t){t[0]===e?i&&(i=!n.push(o)):n.push(t)}))
521i&&n.push(o)
522this.c=n}
523e.values=function e(){var t,a,n,o,i,s=this
524return C(e,(function(e){1==e.b&&(t=l(s),a=t.next())
525if(3!=e.b){if(a.done){e.b=0
526return}n=a.value
527o=l(n)
528o.next()
529i=o.next().value
530return v(e,i)}a=t.next()
531e.b=2}))}
532k.prototype._asNative=function(){for(var e=new N,t=l(this),a=t.next();!a.done;a=t.next()){var n=l(a.value)
533a=n.next().value
534n=n.next().value
535e.append(a,n)}return e}
536k.prototype._blob=function(){for(var e="----formdata-polyfill-"+Math.random(),t=[],a=l(this),n=a.next();!n.done;n=a.next()){var o=l(n.value)
537n=o.next().value
538o=o.next().value
539t.push("--"+e+"\r\n")
540o instanceof Blob?t.push('Content-Disposition: form-data; name="'+n+'"; filename="'+o.name+'"\r\nContent-Type: '+(o.type||"application/octet-stream")+"\r\n\r\n",o,"\r\n"):t.push('Content-Disposition: form-data; name="'+n+'"\r\n\r\n'+o+"\r\n")}t.push("--"+e+"--")
541return new Blob(t,{type:"multipart/form-data; boundary="+e})}
542k.prototype[Symbol.iterator]=function(){return this.entries()}
543k.prototype.toString=function(){return"[object FormData]"}
544E&&!E.matches&&(E.matches=E.matchesSelector||E.mozMatchesSelector||E.msMatchesSelector||E.oMatchesSelector||E.webkitMatchesSelector||function(e){e=(this.document||this.ownerDocument).querySelectorAll(e)
545for(var t=e.length;0<=--t&&e.item(t)!==this;);return-1<t})
546F&&(k.prototype[F]="FormData")
547if(P){var V=I.XMLHttpRequest.prototype.setRequestHeader
548I.XMLHttpRequest.prototype.setRequestHeader=function(e,t){V.call(this,e,t)
549"content-type"===e.toLowerCase()&&(this.s=!0)}
550I.XMLHttpRequest.prototype.send=function(e){e instanceof k?(e=e._blob(),this.s||this.setRequestHeader("Content-Type",e.type),P.call(this,e)):P.call(this,e)}}D&&(I.fetch=function(e,t){t&&t.body&&t.body instanceof k&&(t.body=t.body._blob())
551return D.call(this,e,t)})
552B&&(I.navigator.sendBeacon=function(e,t){t instanceof k&&(t=t._asNative())
553return B.call(this,e,t)})
554I.FormData=k}})()}}])
555
556//# sourceMappingURL=theme_editor-c-9553a62f8f.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.