PageSourceSearch

https://www.oscainc.org/_next/static/chunks/55643-b3562d8bd234a526.js

js oscainc.org collected 2026-10-04 13:26:11 UTC 14,096 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[55643],{92566:function(e,t,n){n.d(t,{M:function(){return useHandlePastedFiles}});var r=n(82729),i=n(50456),o=n(66252),a=n(47503),l=n(69783);function _templateObject(){let e=(0,r._)(["\n  query UseHandlePastedFiles_GetDraftImageProxy(\n    $input: GetDraftImageProxyInput!\n  ) {\n    getDraftImageProxy(input: $input) {\n      imageId\n      imageProxy(input: {})\n    }\n  }\n"]);return _templateObject=function(){return e},e}let s=(0,i.Ps)(_templateObject()),useHandlePastedFiles=()=>{let e=(0,o.x)(),{uploadImages:t,isUploading:n}=(0,l.i)(a.s3.BLOG_EMBEDDED_IMAGE),getUrlsFromFiles=async n=>{let r=await t(n),i=await Promise.all(r.map(async t=>await e.query({query:s,variables:{input:{imageId:t,source:a.s3.BLOG_EMBEDDED_IMAGE}}})));return i.map(e=>{var t,n;return null!==(n=null===(t=e.data.getDraftImageProxy)||void 0===t?void 0:t.imageProxy)&&void 0!==n?n:""}).filter(e=>""!==e)};return{getUrlsFromFiles,isUploading:n}}},69783:function(e,t,n){n.d(t,{i:function(){return useImageUpload}});var r=n(82729),i=n(50456),o=n(50319),a=n(80419),l=n(69073),s=n(49517);function _templateObject(){let e=(0,r._)(["\n  mutation ImageUpload_UploadImage($input: PrepImagesAtSourceInput!) {\n    prepImagesAtSource(input: $input) {\n      results {\n        presignedS3Url\n        imageFileId\n        metadataHeaders {\n          name\n          value\n        }\n      }\n    }\n  }\n"]);return _templateObject=function(){return e},e}let u="This file exceeds the maximum size of ".concat(15," MB. Please choose an image under the size limit and try again."),isImageUploadFileTooLarge=e=>e.size>15728640,c=(0,i.Ps)(_templateObject()),useImageUpload=(e,t)=>{let n=(0,a.pm)(),[r]=(0,o.D)(c),[i,{isUploading:d,uploadProgress:f,numUploading:g}]=(0,l.w)(),uploadImages=async o=>{try{if(o.some(isImageUploadFileTooLarge)&&(null==t?void 0:t.showUploadErrorToast))return n({title:u,status:"error"}),[];let{data:a}=await r({variables:{input:{source:e,numImages:o.length}}});if(!(null==a?void 0:a.prepImagesAtSource))throw Error("Image upload prep failed");if((null==a?void 0:a.prepImagesAtSource.results.length)!==o.length)throw Error("failed to prep for image upload");let l=null==a?void 0:a.prepImagesAtSource.results.map(async(e,t)=>{let{metadataHeaders:n,presignedS3Url:r,imageFileId:a}=e,l={};return null==n||n.forEach(e=>{let{name:t,value:n}=e;t&&n&&(l[t]=n)}),await i({file:o[t],presignedS3Url:r,metadataHeaders:l}),a}),s=await Promise.all(l);return s}catch(e){return(0,s.H)(e),[]}};return{uploadImages,isUploading:d,uploadProgress:f,numUploading:g}}},69073:function(e,t,n){n.d(t,{w:function(){return useUploadFileToS3}});var r=n(80419),i=n(9669),o=n.n(i),a=n(28662),l=n(67294),s=n(49517);let u=o().create();(0,a.ZP)(u,{retries:3,retryDelay:e=>2e3*e});let c=o().CancelToken;function useUploadFileToS3(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,r.pm)(),{onUploadStart:i,onUploadComplete:a}=t,[d,f]=l.useState(!1),[g,p]=l.useState(!1),[y,h]=l.useState(void 0),[C,S]=l.useState(void 0),[k,m]=l.useState(0),resetHookState=()=>{f(!1),m(e=>e-1),p(!1),h(void 0),S(void 0),e=void 0},uploadFileToS3=async function(t){let{file:r,presignedS3Url:l,metadataHeaders:d={}}=t;try{f(!0),m(e=>e+1),h(0),null==i||i(),await u.put(l,r,{headers:{...d,"Content-Type":"Content-Type"in d?d["Content-Type"]:""},onUploadProgress:e=>{h(e.loaded/e.total*100)},cancelToken:new c(function(t){e=()=>{t(),resetHookState(),p(!0)}})}).then(()=>{resetHookState(),h(100),null==a||a()})}catch(e){if((0,s.H)(e),!o().isCancel(e))throw resetHookState(),S(e),n({title:"An error occurred while uploading your file, please try again.",status:"error",duration:null,isClosable:!0}),e}};return[uploadFileToS3,{isUploading:d,isCanceled:g,uploadProgress:y,error:C,cancelUpload:e,numUploading:k}]}},19598:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(38655);let i=(0,r.m$)("div",{baseStyle:{borderRadius:"8px",backgroundColor:"white",shadow:"base"}})},52670:function(e,t,n){n.d(t,{Z:function(){return r.Z}});var r=n(19598)},63391:function(e,t,n){n.d(t,{i:function(){return s}});var r=n(85893),i=n(83234),o=n(48641),a=n(49184),l=n(67294);let s=l.forwardRef((e,t)=>
1{let{children:n,isDisabled:l,...s}=e,u=(0,i.NJ)(),c=(null==u?void 0:u.isDisabled)||l;return(0,r.jsx)(i.NI,{isDisabled:c,children:(0,r.jsxs)(o.Kq,{direction:"row",alignItems:"center",children:[(0,r.jsx)(a.XZ,{...s,ref:t}),(0,r.jsx)(i.lX,{mb:"0",children:n})]})})});s.displayName="SubtleCheckbox"},14493:function(e,t,n){n.d(t,{k:function(){return NumberedListIcon}});var r=n(85893),i=n(52494);n(67294);let NumberedListIcon=e=>(0,r.jsxs)(i.JO,{width:"1em",height:"1em",viewBox:"0 0 14 15",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[(0,r.jsx)("path",{d:"M4.66699 3.86523H12.2503",stroke:"gray.700",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M4.66699 7.36523H12.2503",stroke:"gray.700",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M4.66699 10.8652H12.2503",stroke:"gray.700",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M2.22307 4.61523H1.81165V3.82112C1.81165 3.72467 1.8137 3.63644 1.81781 3.55641C1.7925 3.58719 1.76104 3.61934 1.72342 3.65285L1.5531 3.79341L1.34277 3.53487L1.85782 3.11523H2.22307V4.61523Z",fill:"gray.700"}),(0,r.jsx)("path",{d:"M2.32763 8.11523H1.25446V7.85225L1.61556 7.48712C1.71873 7.37923 1.78616 7.30573 1.81785 7.26662C1.84954 7.22683 1.87146 7.19278 1.88359 7.16446C1.89641 7.13614 1.90281 7.10647 1.90281 7.07545C1.90281 7.03701 1.89034 7.00667 1.86539 6.98442C1.84044 6.96217 1.80537 6.95104 1.7602 6.95104C1.71367 6.95104 1.66647 6.96453 1.61859 6.9915C1.57139 7.0178 1.51778 7.05691 1.45777 7.10883L1.23828 6.85192C1.31448 6.78381 1.37854 6.73526 1.43046 6.70627C1.48238 6.6766 1.53869 6.65401 1.59937 6.6385C1.66074 6.62299 1.72952 6.61523 1.80571 6.61523C1.90146 6.61523 1.98676 6.63209 2.06161 6.66581C2.13713 6.69952 2.19546 6.74774 2.2366 6.81045C2.2784 6.87248 2.29931 6.94227 2.29931 7.01982C2.29931 7.07781 2.29189 7.13142 2.27705 7.18064C2.26289 7.22987 2.24064 7.27842 2.2103 7.32629C2.17995 7.37349 2.13949 7.42339 2.08892 7.47599C2.03902 7.52859 1.93214 7.62838 1.76829 7.77538V7.7855H2.32763V8.11523Z",fill:"gray.700"}),(0,r.jsx)("path",{d:"M2.26076 10.4526C2.26076 10.543 2.23315 10.6209 2.17793 10.6861C2.12271 10.7506 2.04287 10.7975 1.93841 10.8268V10.8328C2.18192 10.8634 2.30368 10.9785 2.3
10368 11.1781C2.30368 11.3138 2.24979 11.4206 2.142 11.4985C2.03488 11.5763 1.88585 11.6152 1.6949 11.6152C1.61639 11.6152 1.54353 11.6096 1.47633 11.5983C1.4098 11.587 1.33761 11.5663 1.25977 11.5364V11.209C1.32364 11.2416 1.38851 11.2659 1.45438 11.2819C1.52091 11.2972 1.58212 11.3049 1.63801 11.3049C1.7245 11.3049 1.78738 11.2929 1.82663 11.2689C1.86655 11.2443 1.88651 11.2061 1.88651 11.1542C1.88651 11.1142 1.8762 11.0836 1.85557 11.0623C1.83495 11.0404 1.80168 11.0241 1.75577 11.0134C1.70987 11.0021 1.64999 10.9965 1.57613 10.9965H1.48631V10.7001H1.57813C1.7784 10.7001 1.87853 10.6488 1.87853 10.5464C1.87853 10.5078 1.86356 10.4792 1.83362 10.4605C1.80434 10.4419 1.76476 10.4326 1.71486 10.4326C1.62171 10.4326 1.52523 10.4639 1.42543 10.5264L1.26176 10.2629C1.33894 10.2097 1.41778 10.1718 1.49829 10.1492C1.57946 10.1265 1.67227 10.1152 1.77673 10.1152C1.92776 10.1152 2.04619 10.1452 2.13202 10.2051C2.21785 10.2649 2.26076 10.3474 2.26076 10.4526Z",fill:"gray.700"})]})},4662:function(e,t,n){n.d(t,{Sw:function(){return AddLinkButton},UB:function(){return i},Tv:function(){return createLinkPlugin},QR:function(){return editorStateSettingLink},ZJ:function(){return findFirstLinkInBody},Wv:function(){return findFirstLinkInEditor}});var r,i,o=n(85893),a=n(48641),l=n(9041),s=n(68337),u=n.n(s),c=n(67294),d=n(90195),f=n(82415),g=n(47741),p=n(57174),y=n(83234),h=n(20979),C=n(63391),S=n(6491),k=n(23253),m=n(39615);let AddLinkButton=e=>{let{editorState:t,setEditorState:n,submitButtonColorScheme:r,...s}=e,{onOpen:u,onClose:x,isOpen:E}=(0,d.qY)(),v=c.useRef(null),L=t.getSelection(),I=L.getAnchorKey(),w=t.getCurrentContent(),j=w.getBlockForKey(I),P=L.getStartOffset(),O=L.getEndOffset(),K=j.getText().slice(P,O),b=j.getEntityAt(P),F=b&&w.getEntity(b).getType(),T=F===i.LINK,[B,D]=c.useState(K),[M,N]=c.useState(""),_=(0,m.E)(M),{setReferrerPolicy:H}=(0,k.g)(),[U,A]=(0,d.kt)(!1);c.useEffect(()=>{D(K)},[K]);let onPopoverClose=()=>{D(""),N(""),x()},onRemoveLink=()=>{let e=t;j.findEntityRanges(e=>{let t=e.getEntity(),n=t&&l.Entity.get(t);return!!n&&n.getType()===i.LINK},(t,n)=>{if(L.isCollapsed()&&t<=P&&n>=P){let r=new l.SelectionState({anchorOffset:t,anchorKey:j.getKey(),focusOffset:n,focusKey:j.getKey(),isBackward:!1,hasFocus:!1});e=l.EditorState.set(e,{currentContent:l.Modifier.applyEntity(e.getCurrentContent(),r,null)})}else e=l.EditorState.set(e,{currentContent:l.Modifier.applyEntity(e.getCurrentContent(),L,null)})}),n(e=l.EditorState.forceSelection(e,new l.SelectionState({anchorOffset:O,anchorKey:I,focusOffset:O,focusKey:I,isBackward:!1,hasFocus:!1})))};return(0,o.jsxs)(f.J2,{isOpen:E,initialFocusRef:v,onOpen:u,onClose:onPopoverClose,children:[(0,o.jsx)(f.xo,{children:(0,o.jsx)(g.hU,{isActive:T,icon:(0,o.jsx)(S.xPt,{}),onClick:e=>{T&&(onRemoveLink(),e.preventDefault())},...s})}),(0,o.jsx)(p.h_,{children:(0,o.jsxs)(f.yk,{w:"auto",children:[(0,o.jsx)(f.QH,{}),(0,o.jsx)(f.b,{p:"4",children:(0,o.jsxs)(a.Kq,{spacing:"4",children:[(0,o.jsxs)(y.NI,{children:[(0,o.jsx)(y.lX,{children:"Link Text"}),(0,o.jsx)(h.II,{value:B,onChange:e=>D(e.target.value),ref:K?void 0:v})]}),(0,o.jsxs)(y.NI,{children:[(0,o.jsx)(y.lX,{children:"Link Target"}),(0,o.jsx)(h.II,{value:M,onChange:e=>N(e.target.value),ref:K?v:void 0})]}),H&&(0,o.jsx)(y.NI,{children:(0,o.jsx)(C.i,{isChecked:U,onChange:()=>A.toggle(),children:"Set Referrer Policy"})}),(0,o.jsxs)(g.hE,{display:"flex",justifyContent:"flex-end",children:[(0,o.jsx)(g.zx,{variant:"outline",colorScheme:"gray",onClick:onPopoverClose,children:"Cancel"}),(0,o.jsx)(g.zx,{onClick:()=>{if(!_)return;let e=new l.SelectionState({anchorOffset:P,anchorKey:I,focusOffset:O,focusKey:I,isBackward:!1,hasFocus:!1}),r=editorStateSettingLink(t,e,{explicit:!0,url:_,targetOption:"_blank",hideLinkPreview:!1,referrerPolicy:U?"no-referrer-when-downgrade":void 0},B),i=l.EditorState.forceSelection(r,new l.SelectionState({anchorOffset:P+B.length,anchorKey:I,focusOffset:P+B.length,focusKey:I,isBackward:!1,hasFocus:!1}));n(i),onPopoverClose()},isDisabled:!B||!_,colorScheme:r,children:"Add"})]})]})})]})})]})},x={strategy:function(e,t,n){e.findEntityRanges(e=>{let t=e.getEntity();return null!==t&&"LINK"===n.getEntity(t).getType()},t)},component:e=>{let{children:t,entityKey:n,contentState:r}=e,{url:i,targetOption:l}=r.getEntity(n).getData();return(0,o.jsx)(a.rU,{href:i,target:l,children:t})}};(r=i||(i={})).MENTION="mention",r.LINK="LINK";let E=u()();function editorStateSettingLink(e,t,n,r){let i=e.getCurrentContent(),o=function(e){let t=e.getCurrentContent(),n=e.getSelection().getStartKey(),r=e.getSelection().getStartOffset(),i=t.getBlockForKey(n),o=i.getEntityAt(Math.min(i.getText().length-1,r));if(o){let e=t.getEntity(o);if("LINK"===e.getType())return o}return null}(e),a=e;if(o)a=l.EditorState.set(e,{currentContent:e.getCurrentContent().replaceEntityData(o,n)}),a=l.EditorState.forceSelection(a,e.getSelection());else{let o=i.createEntity("LINK","MUTABLE",n),s=o.getLastCreatedEntityKey();if(a=l.EditorState.set(e,{currentContent:o}),a=l.RichUtils.toggleLink(a,t,s),r){let e=l.Modifier.replaceText(i,t,r,a.getCurrentInlineStyle(),s);a=l.EditorState.set(a,{currentContent:e})}}return a}let handleEditorStateChange=e=>{var t;let n=e.getCurrentContent(),r=e.getSelection();if(!r||!r.isCollapsed())return e;let i=r.getStartOffset(),o=r.getStartKey(),a=n.getBlockForKey(o);if("unstyled"!==a.getType())return e;let s=a.getText(),u=s.lastIndexOf(" ",i)+1,c=s.indexOf(" ",i);-1===c&&(c=s.length);let d=s.substr(u,c-u),f=!!E.match(d),g=E.match(s),p=g&&(null===(t=g.find(e=>e.index===u||e.index===u+1&&"("===s[u]))||void 0===t?void 0:t.url)||null,y=p;p&&(y=p.replace(/^\(+|\)+$/g,""));let h=a.getEntityAt(Math.min(s.length-1,i)),C=h&&n.getEntity(h);if(C&&"LINK"!==C.getType()&&(h=""),h){let t=n.getEntity(h).getData();if(t.explicit)return e;if(f){let t=e.getCurrentContent(),n=findFirstLinkInEditor(e),r=n?n[0].hideLinkPreview:void 0,i=n?n[0].referrerPolicy:void 0;return l.EditorState.set(e,{currentContent:t.replaceEntityData(h,{explicit:!1,url:y,targetOption:"_blank",hideLinkPreview:r,referrerPolicy:i})})}
1{let t=new l.SelectionState({anchorOffset:u-1,anchorKey:o,focusOffset:u,focusKey:o,isBackward:!1,hasFocus:!0});return l.EditorState.set(e,{currentContent:l.Modifier.applyEntity(e.getCurrentContent(),t,null)})}}if(!h&&f){let t=p!==y,n=new l.SelectionState({anchorOffset:u,anchorKey:o,focusOffset:c,focusKey:o,isBackward:!1,hasFocus:!1}),i=findFirstLinkInEditor(e),a=i?i[0].hideLinkPreview:void 0,s=i?i[0].referrerPolicy:void 0,d=editorStateSettingLink(e,n,{explicit:!1,url:y,targetOption:"_blank",hideLinkPreview:a,referrerPolicy:s},t&&y?y:void 0);return l.EditorState.acceptSelection(d,r)}return e},findFirstLinkInBody=e=>{if(e)for(let t=0;t<e.blocks.length;t++){let n=e.blocks[t];for(let t=0;t<n.entityRanges.length;t++){let{key:r}=n.entityRanges[t],i=e.entityMap[r];if("LINK"===i.type&&"boolean"==typeof i.data.explicit)return[{key:String(r),hideLinkPreview:i.data.hideLinkPreview,referrerPolicy:i.data.referrerPolicy},{url:i.data.url,targetOption:i.data.targetOption}]}}},findFirstLinkInEditor=e=>{let t;if(!e)return;let n=e.getCurrentContent();return n.getBlockMap().forEach(e=>{null==e||e.findEntityRanges(e=>{let r=e.getEntity();if(r&&"LINK"===n.getEntity(r).getType()&&!t&&"boolean"==typeof n.getEntity(r).getData().explicit){let e=n.getEntity(r).getData();t=[{key:String(r),hideLinkPreview:e.hideLinkPreview,referrerPolicy:e.referrerPolicy},{url:e.url,targetOption:e.targetOption}]}return!1},()=>{})}),t},createLinkPlugin=()=>({decorators:[x],onChange:handleEditorStateChange})}}]);
2//# sourceMappingURL=55643-b3562d8bd234a526.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.